19943ff79471f3521fd5e59035198f01e0763258
[mono.git] / mcs / gmcs / ChangeLog
1 2004-12-08  Martin Baulig  <martin@ximian.com>
2
3         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
4         this actually work.
5
6         * class.cs (MethodCore.MayUnify): Use
7         TypeManager.MayBecomeEqualGenericTypes().       
8
9 2004-12-08  Martin Baulig  <martin@ximian.com>
10
11         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
12         parameter, box it.  Fixes #69233.
13
14 2004-12-08  Martin Baulig  <martin@ximian.com>
15
16         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
17         have the ctor constraint.  Fixes #68326.
18
19 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
20
21         * cs-parser.jay : interface comment was not consumed because of
22           extra opt_semicolon before doc handling.
23
24 2004-12-03  Raja R Harinath  <rharinath@novell.com>
25
26         Fix test-327.cs, test-328.cs, and put in early infrastructure
27         for eventually fixing #52697.
28         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
29         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
30         from other methods.
31         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
32         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
33         (VerifyUsing, error246): Update.
34         * rootcontext.cs (RootContext.NamespaceLookup): Just use
35         'NamespaceEntry.LookupNamespaceOrType'.
36
37 2004-12-07  Martin Baulig  <martin@ximian.com>
38
39         * driver.cs: Call it "BETA SOFTWARE" :-)
40
41 2004-12-06  Raja R Harinath  <rharinath@novell.com>
42
43         Fix crash on cs0657-17.cs.
44         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
45         Use RootContext.Tree.Types, not 'new RootTypes ()'.
46         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
47         the case where the NamespaceEntry gets overwritten.
48
49 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
50
51         Fixed #69195, #56821
52         * ecore.cs (ResolveBoolean): Tiny refactoring.
53
54         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
55         of right expression resolving when left is false constant and
56         operator is LogicalAnd OR true constant and operator is LogicalOr.
57
58         * statement.cs (ResolveUnreachable): Always reports warning.
59
60 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
61
62         * class.cs: Distinguish between 1721 and 1722 (just a little help
63         for the programmer).
64
65 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
66
67         * delegate.cs: Only allow this on new versions of the language. 
68
69 2004-12-02  Duncan Mak  <duncan@ximian.com>
70
71         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
72         Expression class.
73         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
74         here as a static method. Take an additional bool out parameter
75         `must_do_cs1540_check' for signaling to InstanceResolve.
76         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
77         member field from PropertyExpr class and made it an argument of
78         the method instead.
79         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
80         check for MarshalByRefObject, and report CS0122 instead of CS1540.
81         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
82         and `remove_accessor' as well as InstanceResolve: report CS0122
83         where applicable.
84
85         Fixes #70129.
86
87 2004-12-07  Martin Baulig  <martin@ximian.com>
88
89         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
90         and CS0692 where appropriate.
91
92 2004-12-06  Martin Baulig  <martin@ximian.com>
93
94         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
95         IsDuplicateImplementation() and improved it.
96
97         * expression.cs (Invocation.InferTypeArguments): Added
98         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
99         and removed the "ref" modifier from `infered_types'.
100
101         * decl.cs (MemberName.ToString): Removed the exception.
102
103 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
104
105         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
106           comments are allowed.
107
108 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
109
110         * delegate.cs: Add checks for subtypes in paramaters and return values
111         in VerifyMethod () to add support for Covariance/Contravariance
112         in delegates.
113         
114 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
115
116         * report.cs: Remove extra closing parenthesis.
117
118         * convert.cs (Error_CannotImplicitConversion): If the name of the
119         types are the same, provide some extra information.
120
121 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
122
123         Fix bug #70102
124         * attribute.cs (Resolve): Improved implementation of params
125         attribute arguments.
126
127         * support.cs (ParameterData): Add HasParams to be faster.
128
129 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
130
131         all things are for /doc support:
132
133         * doc.cs: new file that supports XML documentation generation.
134         * mcs.exe.sources: added doc.cs.
135         * driver.cs:
136           Handle /doc command line option.
137           Report error 2006 instead of 5 for missing file name for /doc.
138           Generate XML documentation when required, after type resolution.
139         * cs-tokenizer.cs:
140           Added support for picking up documentation (/// and /** ... */),
141           including a new XmlCommentState enumeration.
142         * cs-parser.jay:
143           Added lines to fill Documentation element for field, constant,
144           property, indexer, method, constructor, destructor, operator, event
145           and class, struct, interface, delegate, enum.
146           Added lines to warn incorrect comment.
147         * rootcontext.cs :
148           Added Documentation field (passed only when /doc was specified).
149         * decl.cs:
150           Added DocComment, DocCommentHeader, GenerateDocComment() and
151           OnGenerateDocComment() and some supporting private members for
152           /doc feature to MemberCore.
153         * class.cs:
154           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
155         * delegate.cs:
156           Added overriden DocCommentHeader.
157         * enum.cs:
158           Added overriden DocCommentHeader and GenerateDocComment().
159
160 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
161
162         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
163         unwrapping the enumeration values, chain to
164         DoConstantNumericPromotions again, so we can promote things to the
165         fundamental types (takes care of enums that are bytes, sbytes).
166
167         Fixes bug #62054.
168
169 2004-12-01  Raja R Harinath  <rharinath@novell.com>
170
171         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
172         Fix long-standing bug in type-lookup.  Use FindType instead of
173         LookupType when ec.ResolvingTypeTree.
174         (Attribute.ResolveType, Attribute.Resolve)
175         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
176         Update to changes.
177         (Attributes.Search): Remove internal version.  Update.
178         (Attributes.SearchMulti): Update.
179         (Attributes.GetClsCompliantAttribute): Remove.
180         (Attributes.GetIndexerNameAttribute): Remove.
181         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
182         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
183         * class.cs (Indexer.Define): Likewise.
184
185 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
186
187         Fix bug #68790
188         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
189         MarshallByReference members access.
190
191         * expression.cs: Use CheckMarshallByRefAccess;
192         Better error CS0197 message.
193
194         * report.cs: Print whole related error message.
195
196 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
197
198         * class (GetClassBases): Better error 60 report.
199         (EventProperty): Disabled warning 67 detection.
200
201 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
202
203         Fix bug #60324
204         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
205
206         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
207         precise values.
208
209 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
210
211         Fix bug #49488
212         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
213
214         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
215
216 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
217
218         * attribute.cs (Attribute.Resolve): Refine error reporting and
219         report a cs0117 if the identifier does not exist, to distinguish
220         from 0617 which is a miss-use of the actual identifier.
221
222         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
223         between cs0070 and cs0079.
224
225         * class.cs (MemberBase.DoDefine): When reporting a wrong
226         accessibility level, we use MethodCore to compare instead of
227         Method (this was a regression in some refactoring effort).
228
229         So now we correctly report cs0056 again.
230
231         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
232         testing the target_type (which was known to be object_type) and
233         not the source type (which is anonymous_method).
234
235         Fixed reporting of error cs1660.
236
237         * expression.cs (UserCast.Source): Expose the underlying cast.
238
239         * statement.cs (Switch.SwitchGoverningType): Sort the list of
240         allowed types to find a match to int32 first (most common).
241
242         In addition, it ignores any ImplicitUserConversions that did an
243         internal implicit conversion (as the switch statement allows only
244         one integral conversion to exist).
245
246         * class.cs (PartialContainer.Create): rename `name' to
247         `member_name' for clarity.  Then replace the string calls with a
248         call to MemberName.GetPartialName, as now using
249         MemberName.ToString is an error (this is due to the side effects
250         it had, that were fixed in the past).
251
252         This will restore the error reporting on a number of partial class
253         errors that were missusing this (and getting an exception as a
254         results, which is now just a plain textual warning, because
255         yyparse debug output would crash otherwise).
256
257 2004-11-26  Raja R Harinath  <rharinath@novell.com>
258
259         * Makefile (PROGRAM_INSTALL_DIR): Remove.
260
261 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
262
263         * rootcontext.cs (LookupType): Make sure to cache lookups that
264         don't give us a negative result. This saves about 5% of corlib
265         compilation time.
266
267 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
268
269         * report.cs (AbstractMessage.Print): messages are sent to stderr
270
271         * class.cs (TypeContainer.GetClassBases): It is an error to have a
272         non-interface in the list of interfaces (at this point, either
273         parent was properly set, or a base class is being listed in the
274         interfaces section).
275
276         This flags error 1722, and resolves the crash from bug 69259.
277
278 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
279
280         * statement.cs (Using.EmitExpressionFinally): make this work right
281         for valuetypes. Fixes 69926.
282
283 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
284
285         * const.cs (Const.ChangeType): Cope with the "0 literal can be
286         converted to an enum" here, before we try to change the underlying
287         type.  This code exists, but it is a different code path than the
288         one used while encoding constants.
289
290         (ImplicitReferenceConversionExists): In addition, resynchronized
291         the code here, so it matches the same code in
292         ImplicitReferenceConversionExists for the `from any class-type S
293         to any interface-type T'.       
294
295 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
296
297         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
298
299 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
300
301         * cs-parser.jay: Use verbosity accordingly. 
302
303 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
304
305         * expression.cs (Unary.ResolveOperator): Do not report warning;
306         AddressOf reads from variable.
307         
308         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
309
310 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
311
312         Fix bug #69462
313
314         * attribute.cs (Attributable): Removed CheckTargets.
315         (Attributes.Emit): Explicit attribute targets are tested here.
316
317         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
318         not enabled for interfaces.
319
320         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
321         (GetAssemblyName): Ouch next bug there.
322
323 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
324
325         * expression.cs: Error 275 added.
326         
327 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
328
329         Fix bug #69177 (Implemented decimal constant support)
330
331         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
332         (BinaryFold): Add DecimalConstant.
333
334         * const.cs (Define): Decimal constant 
335         (is not constant.
336         (ChangeType): Add decimal type handling.
337         (LookupConstantValue): Don't set value for decimal type but
338         emit DecimalConstantAttribute. Needed for constant optimization.
339
340         * constant.cs (ToDecimal): New method.
341         (ConvertToDecimal): New method.
342         (IntConstant): Implemented ConvertToDecimal.
343         (DecimalConstant.Emit): Emit optimized version for decimals in
344         int range.
345
346         * expression.cs (ResolveOperator): Changed order of constant
347         reduction to work correctly with native types which have
348         overloaded operators.
349         (ResolveMemberAccess): Extract constant value from attribute
350         for decimal type.
351
352         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
353
354         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
355         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
356         (ChangeType): Decimal is special.
357         (TypeToCoreType): Add decimal type.
358
359 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
360
361         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
362         decimal types.
363
364 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
365
366         * class.cs (EventField.ApplyAttributeBuilder): Fix error
367         test cs1667-5.cs.
368
369 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
370
371         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
372
373         * pending.cs (PendingImplementation): Grab only interfaces.
374
375 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
376
377         * statement.cs (ForeachHelperMethods): Add location member and
378         error 202 detection.
379
380 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
381
382         * expression.cs (DoResolveBase): Fixed wrong warning for out
383         variables.
384
385 2004-12-04  Martin Baulig  <martin@ximian.com>
386
387         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
388         to check whether the conversion is ok.
389
390         * typemanager.cs (TypeManager.GetTypeArguments): Just return
391         `Type.EmptyTypes' if we're not a generic TypeContainer.
392
393 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
394
395         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
396         old bug: when converting from the null literal to a pointer,
397         return an EmptyCast, not the NullLiteral.
398
399         This fixes #69921, the recent null_type changes probably made this
400         bug more prominent.
401
402 2004-12-03  Martin Baulig  <martin@ximian.com>
403
404         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
405         method as our child, call AnonymousMethod.Compatible() on it.
406
407 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
408
409         * class.cs (FieldBase): Use an unused bit field from the field to
410         encode the `has_offset' property from the FieldMember.  This saves
411         a couple of Ks on bootstrap compilation.
412
413         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
414         method as our child, return the AnonymousMethod resolved
415         expression.
416
417         * expression.cs (New.DoResolve): Allow return values from
418         NewDelegate to also include AnonymousMethods.
419
420         Fixes #70150.
421
422 2004-11-29  Raja R Harinath  <rharinath@novell.com>
423
424         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
425         cs1648 report.
426         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
427         System.Runtime.InteropServices._Exception, since it's a base
428         interface of the core type System.Exception in the net_2_0 profile.
429
430 2004-11-27  Martin Baulig  <martin@ximian.com>
431
432         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
433
434 2004-11-26  Raja R Harinath  <rharinath@novell.com>
435
436         * Makefile: Convert to use executable.make.
437         * gmcs.exe.sources: New.
438
439 2004-11-25  Martin Baulig  <martin@ximian.com>
440
441         * expression.cs (Invocation.InferType): Added support for byref types.
442
443 2004-11-25  Martin Baulig  <martin@ximian.com>
444
445         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
446         in TypeManager.TypeToCoreType().
447
448 2004-11-25  Martin Baulig  <martin@ximian.com>
449
450         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
451         "Dispose" method from the `current_type'.
452         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
453         DoDefineMembers() instead of using the MethodBuilder; this is
454         required for generic iterators.
455
456         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
457
458 2004-11-24  Martin Baulig  <martin@ximian.com>
459
460         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
461
462 2004-11-20  Martin Baulig  <martin@ximian.com>
463
464         * expression.cs (Invocation.InferType): Correctly infer generic
465         instances; see gen-103.cs.
466         (Invocation.InferTypeArguments): If a generic method doesn't have
467         any unbound type parameters, we don't need to infer anything.
468
469 2004-11-19  Raja R Harinath  <rharinath@novell.com>
470
471         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
472
473 2004-11-17  Raja R Harinath  <rharinath@novell.com>
474
475         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
476         (TypeHandle.GetMemberCache): New.
477         (TypeHandle.TypeHandle): Update.
478         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
479         (TypeManager.LookupParentInterfacesCache):
480         Rename from LookupInterfaceCache.  Optimize slightly.
481         (TypeManager.MemberLookup_FindMembers): Update.
482         * decl.cs (MemberCache.MemberCache): Set Container to null in the
483         multi-type variant.
484         (AddCacheContents): Rename from AddHashtable.
485         * class.cs (TypeContainer.parent_container): Remove.
486         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
487         (TypeContainer.DoDefineMembers): Don't initialize it.
488         Update to name changes.
489         
490 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
491
492         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
493         that factors the code to check access modifiers on override.  
494
495         (PropertyBase): Use the code here.
496
497         Patch from Lluis S'anchez, fixes bug #69361.
498
499 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
500
501         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
502         routine that is used to report the use of a captured variable
503         whose address has been taken.
504
505         There are two checks: one when variables are being captured and
506         the other check is when the address of a variable is taken. 
507         
508         (because an anonymous methods might be resolved before *or* after
509         the address has been taken) and 
510
511         * expression.cs (Conditional.DoResolve): Remove the special
512         casing that Martin added to trueExpr and falseExpr being both
513         NullLiteral.  We get the right behavior now just by introducing
514         the null_type into the compiler. 
515
516         * convert.cs (ExplicitConversion): Change the code to use
517         null_type instead of testing `expr is NullLiteral'.
518         (ImplicitConversionStandard): use null_type too.
519         (ImplicitReferenceConversionExists): use null_type too.
520         (ImplicitReferenceConversion): use null_type too.
521
522         * literal.cs: The type of `NullLiteral' is now null_type instead
523         of object_type. 
524         (Resolve): Set the type here.
525
526         * typemanager.cs: Introduce null_type.
527
528 2004-11-18  Martin Baulig  <martin@ximian.com>
529
530         * rootcontext.cs
531         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
532
533 2004-11-18  Martin Baulig  <martin@ximian.com>
534
535         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
536
537 2004-11-18  Martin Baulig  <martin@ximian.com>
538
539         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
540         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
541         call ResolveConstructedType() on it to resolve it without checking
542         constraints.
543         (Constraints.ResolveTypes): Check them here.
544         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
545         but don't check constraints.
546         (ConstructedType.ResolveAsTypeTerminal): Override this and also
547         check constraints here.
548         (ConstructedType.ResolveConstructedType): New public method.  This
549         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
550         resolve ourselves without checking constraints.
551
552         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
553
554 2004-11-18  Martin Baulig  <martin@ximian.com>
555
556         * decl.cs
557         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
558
559         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
560
561 2004-11-18  Martin Baulig  <martin@ximian.com>
562
563         * ecore.cs (TypeExpr.ResolveType): Removed.
564         (Expression.ResolveAsTypeTerminal): We always return a fully
565         resolved `TypeExpr', so we can just access its `Type'.
566
567         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
568
569 2004-11-17  Martin Baulig  <martin@ximian.com>
570
571         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
572         sure we don't return any unresolved TypeExpr's.
573         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
574         a `TypeExpr'.
575         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
576
577         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
578         unresolved `ConstructedType's.
579
580 2004-11-17  Martin Baulig  <martin@ximian.com>
581
582         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
583
584 2004-11-17  Martin Baulig  <martin@ximian.com>
585
586         * ecore.cs
587         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
588
589         * decl.cs (DeclSpace.ResolveType): Removed.
590         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
591
592 2004-11-17  Martin Baulig  <martin@ximian.com>
593
594         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
595         direction, like FindMembers() does.  Fixes #69546, testcase is in
596         test-315.cs.    
597
598 2004-11-16  Martin Baulig  <martin@ximian.com>
599
600         This is based on a patch from Marek Safar, see bug #69082.
601         Fixes bugs #63705 and #67130.
602
603         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
604         method; create a MemberCache for an interface type and cache the
605         result.
606
607         * decl.cs (IMemberContainer.ParentContainer): Removed.
608         (IMemberContainer.ParentCache): New property.
609         (MemberCache.SetupCacheForInterface): Removed.
610         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
611         to create a cache for an interface's "parent".
612
613         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
614         interfaces too.
615
616 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
617
618         * statement.cs: Avoid adding bools to a hashtable.
619
620 2004-11-15  Martin Baulig  <martin@ximian.com>
621
622         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
623
624 2004-11-11  Martin Baulig  <martin@ximian.com>
625
626         * typemanager.cs (TypeManager.GetMethodName): New method.
627
628         * class.cs (MethodData.Define): Include the generic arity in the
629         name of an explicit interface; also add it to the method name.
630
631         * pending.cs (PendingImplementation.InterfaceMethod): The method
632         name now includes the generic arity.
633
634 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
635
636         * expression.cs (Invocation.OverloadResolve): Flag error if we are
637         calling an unsafe method from a safe location.
638
639 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
640
641         Fix #69167
642         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
643
644 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
645
646         * namespace.cs (VerifyUsing): use GetPartialName instead of
647         ToString. 
648
649 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
650
651         * statement.cs (Return.Resolve): Fix regression in typo: if
652         `in_exc', we have to request a NeedReturnLabel, this was a typo
653         introduced in the anonymous method check-in.  Fixes #69131.
654
655         * Indexers were using the ShortName when defining themselves,
656         causing a regression in the compiler bootstrap when applying the
657         patch from 2004-11-02 (first part), now they use their full name
658         and the bug is gone.
659
660 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
661
662         * driver.cs: Strip the path from the names of embedded resources. Fixes
663         #68519.
664
665 2004-11-04  Raja R Harinath  <rharinath@novell.com>
666
667         Fix error message regression: cs0104-2.cs.
668         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
669         (AliasEntry.Resolve): Update.
670         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
671         'silent' flag.
672         (RootContext.LookupType): Update.
673
674 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
675
676         * cs-parser.jay: Add support for handling accessor modifiers
677         * class: Add support port accessor modifiers and error checking,
678         define PropertyMethod.Define as virtual (not abstract anymore)
679         * ecore.cs: Add checking for proeprties access with access modifiers
680         * iterators.cs: Modify Accessor constructor call based in the modified
681         constructor
682 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
683
684         * expression.cs (StringConcat): Handle being called twice,
685         as when we have a concat in a field init with more than two
686         ctors in the class
687
688 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
689
690         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
691         special case explicit implementations, we should always produce
692         the .property or .event declaration.
693         
694         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
695         since it will not return correct data if people use this
696         unresolved in the presence of using statements (see test-313).
697
698         * class.cs (MethodData.Define): If we are an explicit interface
699         implementation, set the method name to the full name of the
700         interface plus the name of the method.  
701
702         Notice that using the method.MethodName.GetFullName() does not
703         work, as it will only contain the name as declared on the source
704         file (it can be a shorthand in the presence of using statements)
705         and not the fully qualifed type name, for example:
706
707         using System;
708
709         class D : ICloneable {
710                 object ICloneable.Clone ()  {
711                 }
712         }
713
714         Would produce a method called `ICloneable.Clone' instead of
715         `System.ICloneable.Clone'.
716
717         * namespace.cs (Alias.Resolve): Use GetPartialName.
718         
719 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
720
721         * cs-parser.jay: Add error 1055 report.
722
723 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
724
725         * assign.cs (Assign.DoResolve): Only do the transform of
726         assignment into a New if the types are compatible, if not, fall
727         through and let the implicit code deal with the errors and with
728         the necessary conversions. 
729
730 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
731
732         * cs-parser.jay: Add error 1031 report.
733
734         * cs-tokenizer.cs: Add location for error 1038.
735
736 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
737
738         * cs-parser.jay: Add error 1016 report.
739
740 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
741
742         * cs-parser.jay: Add errors 1575,1611 report.
743
744 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
745
746         * cs-parser.jay: Add error 1001 report.
747
748 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
749
750         Fix #68850
751         * attribute.cs (GetMarshal): Add method argument for
752         caller identification.
753
754         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
755         agument for GetMarshal and RuntimeMissingSupport.
756
757 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
758
759         * attribute.cs (ExtractSecurityPermissionSet): Removed
760         TypeManager.code_access_permission_type.
761
762         * typemanager.cs: Removed TypeManager.code_access_permission_type.
763
764 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
765
766         * expression.cs (LocalVariableReference.DoResolveLValue): Check
767         for obsolete use of a variable here.   Fixes regression on errors
768         cs0619-25 and cs0619-26.
769
770 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
771
772         Fix #62358, implemented security attribute encoding.
773
774         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
775         Tests permitted SecurityAction for assembly or other types.
776         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
777         data from SecurityPermissionAttribute to PermisionSet class.
778
779         * class.cs (ApplyAttributeBuilder): Added special handling
780         for System.Security.Permissions.SecurityAttribute based types.
781
782         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
783         special handling for System.Security.Permissions.SecurityAttribute
784         based types.
785
786         * enum.cs (ApplyAttributeBuilder): Added special handling
787         for System.Security.Permissions.SecurityAttribute based types.
788
789         * parameter.cs (ApplyAttributeBuilder): Added special handling
790         for System.Security.Permissions.SecurityAttribute based types.
791
792         * rootcontext.cs: Next 2 core types.
793
794         * typemanager.cs (TypeManager.security_permission_attr_type):
795         Built in type for the SecurityPermission Attribute.
796         (code_access_permission_type): Build in type.
797
798 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
799
800         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
801         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
802         all of this information into
803         EmitContext.EmitCapturedVariableInstance.
804         
805         * codegen.cs (EmitCapturedVariableInstance): move here the
806         funcionality of emitting an ldarg.0 in the presence of a
807         remapping.   This centralizes the instance emit code.
808
809         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
810         then emit a load of this: it means that we have reached the
811         topmost ScopeInfo: the one that contains the pointer to the
812         instance of the class hosting the anonymous method.
813
814         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
815         captures to the topmost CaptureContext.
816
817 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
818
819         * expression.cs (LocalVariableReference): Move the knowledge about
820         the iterators into codegen's EmitCapturedVariableInstance.
821
822 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
823
824         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
825         all code paths return a value from an anonymous method (it is the
826         same as the 161 error, but for anonymous methods).
827
828 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
829
830         The introduction of anonymous methods in the compiler changed
831         various ways of doing things in the compiler.  The most
832         significant one is the hard split between the resolution phase
833         and the emission phases of the compiler.
834
835         For instance, routines that referenced local variables no
836         longer can safely create temporary variables during the
837         resolution phase: they must do so from the emission phase,
838         since the variable might have been "captured", hence access to
839         it can not be done with the local-variable operations from the runtime.
840         
841         * statement.cs 
842
843         (Block.Flags): New flag `IsTopLevel' to indicate that this block
844         is a toplevel block.
845
846         (ToplevelBlock): A new kind of Block, these are the blocks that
847         are created by the parser for all toplevel method bodies.  These
848         include methods, accessors and anonymous methods.
849
850         These contain some extra information not found in regular blocks:
851         A pointer to an optional CaptureContext (for tracking captured
852         local variables and parameters).  A pointer to the parent
853         ToplevelBlock.
854         
855         (Return.Resolve): Catch missmatches when returning a value from an
856         anonymous method (error 1662).
857         Invoke NeedReturnLabel from the Resolve phase instead of the emit
858         phase.
859
860         (Break.Resolve): ditto.
861
862         (SwitchLabel): instead of defining the labels during the
863         resolution phase, we now turned the public ILLabel and ILLabelCode
864         labels into methods called GetILLabelCode() and GetILLabel() that
865         only define the label during the Emit phase.
866
867         (GotoCase): Track the SwitchLabel instead of the computed label
868         (its contained therein).  Emit the code by using
869         SwitchLabel.GetILLabelCode ().
870
871         (LocalInfo.Flags.Captured): A new flag has been introduce to track
872         whether the Local has been captured or not.
873
874         (LocalInfo.IsCaptured): New property, used to tell whether the
875         local has been captured.
876         
877         * anonymous.cs: Vastly updated to contain the anonymous method
878         support.
879
880         The main classes here are: CaptureContext which tracks any
881         captured information for a toplevel block and ScopeInfo used to
882         track the activation frames for various local variables.   
883
884         Each toplevel block has an optional capture context associated
885         with it.  When a method contains an anonymous method both the
886         toplevel method and the anonymous method will create a capture
887         context.   When variables or parameters are captured, they are
888         recorded on the CaptureContext that owns them, for example:
889
890         void Demo () {
891              int a;
892              MyDelegate d = delegate {
893                  a = 1;
894              }
895         }
896
897         Here `a' will be recorded as captured on the toplevel
898         CapturedContext, the inner captured context will not have anything
899         (it will only have data if local variables or parameters from it
900         are captured in a nested anonymous method.
901
902         The ScopeInfo is used to track the activation frames for local
903         variables, for example:
904
905         for (int i = 0; i < 10; i++)
906                 for (int j = 0; j < 10; j++){
907                    MyDelegate d = delegate {
908                         call (i, j);
909                    }
910                 }
911
912         At runtime this captures a single captured variable `i', but it
913         captures 10 different versions of the variable `j'.  The variable
914         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
915         recorded on a child.  
916
917         The toplevel ScopeInfo will also track information like the `this'
918         pointer if instance variables were referenced (this is necessary
919         as the anonymous method lives inside a nested class in the host
920         type of the method). 
921
922         (AnonymousMethod): Expanded to track the Toplevel, implement
923         `AnonymousMethod.Compatible' to tell whether an anonymous method
924         can be converted to a target delegate type. 
925
926         The routine now also produces the anonymous method content
927
928         (AnonymousDelegate): A helper class that derives from
929         DelegateCreation, this is used to generate the code necessary to
930         produce the delegate for the anonymous method that was created. 
931
932         * assign.cs: API adjustments for new changes in
933         Convert.ImplicitStandardConversionExists.
934
935         * class.cs: Adjustments to cope with the fact that now toplevel
936         blocks are of type `ToplevelBlock'. 
937
938         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
939         insteda of standard blocks.
940
941         Flag errors if params arguments are passed to anonymous methods.
942
943         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
944         `CurrentAnonymousMethod' which points to the current Anonymous
945         Method.  The variable points to the AnonymousMethod class that
946         holds the code being compiled.  It is set in the new EmitContext
947         created for the anonymous method.
948
949         (EmitContext.Phase): Introduce a variable and an enumeration to
950         assist in enforcing some rules about when and where we are allowed
951         to invoke certain methods (EmitContext.NeedsReturnLabel is the
952         only one that enfonces this right now).
953
954         (EmitContext.HaveCaptureInfo): new helper method that returns
955         whether we have a CapturedContext initialized.
956
957         (EmitContext.CaptureVariable): New method used to register that a
958         LocalInfo must be flagged for capturing. 
959
960         (EmitContext.CapturedParameter): New method used to register that a
961         parameters must be flagged for capturing. 
962         
963         (EmitContext.CapturedField): New method used to register that a
964         field must be flagged for capturing. 
965
966         (EmitContext.HaveCapturedVariables,
967         EmitContext.HaveCapturedFields): Return whether there are captured
968         variables or fields. 
969
970         (EmitContext.EmitMethodHostInstance): This is used to emit the
971         instance for the anonymous method.  The instance might be null
972         (static methods), this (for anonymous methods that capture nothing
973         and happen to live side-by-side with the current method body) or a
974         more complicated expression if the method has a CaptureContext.
975
976         (EmitContext.EmitTopBlock): Routine that drives the emission of
977         code: it will first resolve the top block, then emit any metadata
978         and then emit the code.  The split is done so that we can extract
979         any anonymous methods and flag any captured variables/parameters.
980         
981         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
982         during this phase, the ILGenerator should not be used as labels
983         and local variables declared here might not be accessible to any
984         code that is part of an anonymous method.  
985
986         Exceptions to this include the temporary variables that are
987         created by some statements internally for holding temporary
988         variables. 
989         
990         (EmitContext.EmitMeta): New routine, in charge of emitting all the
991         metadata for a cb
992
993         (EmitContext.TemporaryReturn): This method is typically called
994         from the Emit phase, and its the only place where we allow the
995         ReturnLabel to be defined other than the EmitMeta.  The reason is
996         that otherwise we would have to duplicate a lot of logic in the
997         Resolve phases of various methods that today is on the Emit
998         phase. 
999
1000         (EmitContext.NeedReturnLabel): This no longer creates the label,
1001         as the ILGenerator is not valid during the resolve phase.
1002
1003         (EmitContext.EmitThis): Extended the knowledge in this class to
1004         work in anonymous methods in addition to iterators. 
1005
1006         (EmitContext.EmitCapturedVariableInstance): This emits whatever
1007         code is necessary on the stack to access the instance to a local
1008         variable (the variable will be accessed as a field).
1009
1010         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
1011         EmitContext.EmitAddressOfParameter): Routines to support
1012         parameters (not completed at this point). 
1013         
1014         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
1015         will also remove the parameters.
1016
1017         * convert.cs (Convert): Define a `ConstantEC' which points to a
1018         null.  This is just to prefity some code that uses
1019         ImplicitStandardConversion code and do not have an EmitContext
1020         handy.
1021
1022         The idea is to flag explicitly that at that point in time, it is
1023         known that the conversion will not trigger the delegate checking
1024         code in implicit conversions (which requires a valid
1025         EmitContext). 
1026
1027         Everywhere: pass new EmitContext parameter since
1028         ImplicitStandardConversionExists now requires it to check for
1029         anonymous method conversions. 
1030
1031         (Convert.ImplicitStandardConversionExists): If the type of an
1032         expression is the anonymous_method_type, and the type is a
1033         delegate, we invoke the AnonymousMethod.Compatible method to check
1034         whether an implicit conversion is possible. 
1035
1036         (Convert.ImplicitConversionStandard): Only do implicit method
1037         group conversions if the language level is not ISO_1.
1038
1039         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
1040         MethodInfo for the Invoke method.  used by Delegate and
1041         AnonymousDelegate.
1042
1043         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
1044         method conversions if the target type is a delegate.
1045
1046         Removed extra debugging nops.
1047
1048         (LocalVariableReference): Turn the `local_info' into a public
1049         field. 
1050
1051         Add `prepared' field, the same hack used for FieldExprs to cope
1052         with composed assignments, as Local variables do not necessarily
1053         operate purely on the stack as they used to: they can be captured
1054         fields. 
1055
1056         Add `temp' for a temporary result, like fields.
1057
1058         Refactor DoResolve and DoResolveLValue into DoResolveBase.
1059
1060         It now copes with Local variables that are captured and emits the
1061         proper instance variable to load it from a field in the captured
1062         case. 
1063
1064         (ParameterReference.DoResolveBase): During the resolve phase,
1065         capture parameters if we are in an anonymous method.
1066
1067         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
1068         anonymous method, use the EmitContext helper routines to emit the
1069         parameter reference.
1070
1071         * iterators.cs: Set RemapToProxy to true/false during the
1072         EmitDispose class.
1073
1074         * parameters.cs (GetParameterByName): New helper method. 
1075
1076         * typemanager.cs (anonymous_method_type) a new type that
1077         represents an anonyous method.  This is always an internal type,
1078         used as a fencepost to test against the anonymous-methodness of an
1079         expression. 
1080         
1081 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
1082
1083         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
1084         561 report.
1085         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
1086
1087 2004-11-10  Martin Baulig  <martin@ximian.com>
1088
1089         * expression.cs (Invocation.BetterFunction): If two methods have
1090         equal parameter types, but only one of them is generic, the
1091         non-generic one wins.
1092         (New.DoResolve): Don't set `is_struct' to false if we're a generic
1093         instance; just use `Type.IsValueType' to determine whether
1094         something is a struct or not.
1095         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
1096         so we can be called multiple times.
1097
1098 2004-11-10  Martin Baulig  <martin@ximian.com>
1099
1100         * generic.cs (TypeParameter.DefineConstraints): New public method.
1101         (TypeParameter.CheckAccessLevel): Override this and return true.
1102         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
1103         override ResolveType() anymore.
1104         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
1105
1106 2004-11-10  Martin Baulig  <martin@ximian.com>
1107
1108         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
1109         call DeclSpace.ResolveNestedType() on it.
1110
1111 2004-11-10  Martin Baulig  <martin@ximian.com>
1112
1113         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
1114         non-null, call ParameterModifier() on it.
1115
1116 2004-11-10  Martin Baulig  <martin@ximian.com>
1117
1118         * iterators.cs
1119         (Iterators): Added `current_type' and `this_type' fields.
1120         (Iterators.DefineIterator): Create a new EmitContext and store it
1121         in `ec'; compute `this_type'.
1122
1123 2004-11-10  Martin Baulig  <martin@ximian.com>
1124
1125         * typemanager.cs
1126         (TypeManager.IsPrivateAccessible): New public method.
1127         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
1128
1129 2004-11-10  Martin Baulig  <martin@ximian.com>
1130
1131         * class.cs (TypeContainer.DefineType): Call
1132         TypeBuilder.DefineGenericParameters() before resolving the type
1133         parameters.
1134         (MethodData.parent_method): New protected field.
1135         (MethodData..ctor): Added `MethodInfo parent_method' argument.
1136         (MethodData.Define): Compute `parent_method'.
1137
1138         * decl.cs
1139         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1140         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1141         (DeclSpace.ec): New protected field; store the EmitContext here.
1142         (DeclSpace.EmitContext): New public property.
1143         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
1144         (DeclSpace.ResolveNestedType): New public method.
1145         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
1146         (DeclSpace.NestedAccessible): Added `Type tb' argument.
1147         (DeclSpace.FamilyAccessible): Likewise.
1148         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
1149         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1150         EmitContext.
1151
1152         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
1153         field.
1154
1155         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1156         (Enum.Emit): Don't create a new EmitContext.
1157
1158 2004-10-18  Martin Baulig  <martin@ximian.com>
1159
1160         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
1161         `Type' directly, but call ResolveType() on it.
1162         (Catch.Resolve): Likewise.
1163         (Foreach.Resolve): Likewise.
1164
1165 2004-10-18  Martin Baulig  <martin@ximian.com>
1166
1167         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
1168         `Type' directly, but call ResolveType() on it.
1169         (Probe.DoResolve): Likewise.
1170         (ArrayCreation.LookupType): Likewise.
1171         (TypeOf.DoResolve): Likewise.
1172         (SizeOf.DoResolve): Likewise.
1173
1174 2004-10-18  Raja R Harinath  <rharinath@novell.com>
1175
1176         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
1177         the ResolveType.
1178
1179 2004-10-17  John Luke  <john.luke@gmail.com>
1180
1181         * class.cs (Operator.GetSignatureForError): use CSharpName
1182
1183         * parameter.cs (Parameter.GetSignatureForError): Returns
1184         correct name even if was not defined.
1185
1186 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1187
1188         Fix #65816.
1189         * class.cs (TypeContainer.EmitContext): New property.
1190         (DefineNestedTypes): Create an emitcontext for each part.
1191         (MethodCore.DoDefineParameters): Use container's emitcontext.
1192         Pass type array to InternalParameters.
1193         (MemberBase.DoDefine): Use container's emitcontext.
1194         (FieldMember.Define): Likewise.
1195         (Event.Define): Likewise.
1196         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1197         Pass type array to InternalParameters.
1198         (SetIndexerMethod.GetParameterInfo): Likewise.
1199         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1200         * delegate.cs (Define): Pass emitcontext to
1201         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1202         array to InternalParameters.
1203         * expression.cs (ParameterReference.DoResolveBase): Pass
1204         emitcontext to GetParameterInfo.
1205         (ComposedCast.DoResolveAsTypeStep): Remove check on
1206         ec.ResolvingTypeTree.
1207         * parameter.cs (Parameter.Resolve): Change argument to
1208         EmitContext.  Use ResolveAsTypeTerminal.
1209         (Parameter.GetSignature): Change argument to EmitContext.
1210         (Parameters.ComputeSignature): Likewise.
1211         (Parameters.ComputeParameterTypes): Likewise.
1212         (Parameters.GetParameterInfo): Likewise.
1213         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1214         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1215         * support.cs (InternalParameters..ctor): Remove variant that takes
1216         a DeclSpace.
1217         * typemanager.cs (system_intptr_expr): New.
1218         (InitExpressionTypes): Initialize it.
1219
1220 2004-10-12  Chris Toshok  <toshok@ximian.com>
1221
1222         * cs-parser.jay: fix location for try_statement and catch_clause.
1223
1224 2004-10-18  Martin Baulig  <martin@ximian.com>
1225
1226         * class.cs (FieldMember.Define): Don't access the TypeExpr's
1227         `Type' directly, but call ResolveType() on it.
1228         (MemberBase.DoDefine): Likewise.
1229
1230         * expression.cs (New.DoResolve): Don't access the TypeExpr's
1231         `Type' directly, but call ResolveType() on it.
1232         (ComposedCast.DoResolveAsTypeStep): Likewise.
1233
1234         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
1235         `Type' directly, but call ResolveType() on it.
1236
1237 2004-10-17  John Luke  <john.luke@gmail.com>
1238
1239         * class.cs (Operator.GetSignatureForError): use CSharpName
1240
1241         * parameter.cs (Parameter.GetSignatureForError): Returns
1242         correct name even if was not defined.
1243
1244 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1245
1246         Fix #65816.
1247         * class.cs (TypeContainer.EmitContext): New property.
1248         (DefineNestedTypes): Create an emitcontext for each part.
1249         (MethodCore.DoDefineParameters): Use container's emitcontext.
1250         Pass type array to InternalParameters.
1251         (MemberBase.DoDefine): Use container's emitcontext.
1252         (FieldMember.Define): Likewise.
1253         (Event.Define): Likewise.
1254         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1255         Pass type array to InternalParameters.
1256         (SetIndexerMethod.GetParameterInfo): Likewise.
1257         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1258         * delegate.cs (Define): Pass emitcontext to
1259         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1260         array to InternalParameters.
1261         * expression.cs (ParameterReference.DoResolveBase): Pass
1262         emitcontext to GetParameterInfo.
1263         (ComposedCast.DoResolveAsTypeStep): Remove check on
1264         ec.ResolvingTypeTree.
1265         * parameter.cs (Parameter.Resolve): Change argument to
1266         EmitContext.  Use ResolveAsTypeTerminal.
1267         (Parameter.GetSignature): Change argument to EmitContext.
1268         (Parameters.ComputeSignature): Likewise.
1269         (Parameters.ComputeParameterTypes): Likewise.
1270         (Parameters.GetParameterInfo): Likewise.
1271         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1272         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1273         * support.cs (InternalParameters..ctor): Remove variant that takes
1274         a DeclSpace.
1275         * typemanager.cs (system_intptr_expr): New.
1276         (InitExpressionTypes): Initialize it.
1277
1278 2004-10-12  Chris Toshok  <toshok@ximian.com>
1279
1280         * cs-parser.jay: fix location for try_statement and catch_clause.
1281
1282 2004-10-07  Raja R Harinath  <rharinath@novell.com>
1283
1284         More DeclSpace.ResolveType avoidance.
1285         * decl.cs (MemberCore.InUnsafe): New property.
1286         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
1287         with newly created EmitContext.
1288         (FieldMember.Define): Likewise.
1289         * delegate.cs (Delegate.Define): Likewise.
1290         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
1291         only if normal name-lookup fails.
1292         (TypeExpr.DoResolve): Enable error-checking.
1293         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
1294         (SizeOf.DoResolve): Likewise.
1295         (ComposedCast.DoResolveAsTypeStep): Likewise.
1296         (StackAlloc.DoResolve): Likewise.
1297         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
1298         (Block.Unsafe): New property.
1299         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
1300         (Unsafe): Set 'unsafe' flag of contained block.
1301         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
1302         (Fixed.Resolve): Likewise.
1303         (Catch.Resolve): Likewise.
1304         (Using.ResolveLocalVariableDecls): Likewise.
1305         (Foreach.Resolve): Likewise.
1306
1307 2004-10-05  John Luke <john.luke@gmail.com>
1308
1309         * cs-parser.jay: add location to error CS0175
1310
1311 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
1312
1313         * ecore.cs (Expression.Constantity): Add support for turning null
1314         into a constant.
1315
1316         * const.cs (Const.Define): Allow constants to be reference types
1317         as long as the value is Null.
1318
1319 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
1320
1321         * namespace.cs (NamespaceEntry.Using): No matter which warning
1322         level is set, check if this namespace name has already been added.
1323
1324 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
1325
1326         * expression.cs: reftype [!=]= null should always use br[true,false].
1327         # 67410
1328
1329 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
1330
1331         Fix #67108
1332         * attribute.cs: Enum conversion moved to 
1333         GetAttributeArgumentExpression to be applied to the all
1334         expressions.
1335
1336 2004-10-01  Raja R Harinath  <rharinath@novell.com>
1337
1338         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
1339         * class.c (TypeContainer.DefineType): Flag error if
1340         base types aren't accessible due to access permissions.
1341         * decl.cs (DeclSpace.ResolveType): Move logic to
1342         Expression.ResolveAsTypeTerminal.
1343         (DeclSpace.ResolveTypeExpr): Thin layer over
1344         Expression.ResolveAsTypeTerminal.
1345         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
1346         Refactor code into NestedAccess.  Use it.
1347         (DeclSpace.NestedAccess): New.
1348         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
1349         argument to silence errors.  Check access permissions.
1350         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
1351         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
1352         (Cast.DoResolve): Likewise.
1353         (New.DoResolve): Likewise.
1354         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
1355         (TypeOf.DoResolve): Likewise.
1356
1357         * expression.cs (Invocation.BetterConversion): Return the Type of
1358         the better conversion.  Implement section 14.4.2.3 more faithfully.
1359         (Invocation.BetterFunction): Make boolean.  Make correspondence to
1360         section 14.4.2.2 explicit.
1361         (Invocation.OverloadResolve): Update.
1362         (Invocation): Remove is_base field.
1363         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
1364         (Invocation.Emit): Likewise.
1365
1366 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
1367
1368         * cs-parser.jay: Reverted 642 warning fix.
1369
1370 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1371
1372         Fix bug #66615
1373         * decl.cs (FindMemberWithSameName): Indexer can have more than
1374         1 argument.
1375
1376 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1377
1378         * expression.cs (LocalVariableReference.DoResolveLValue):
1379         Do not report warning 219 for out values.
1380         (EmptyExpression.Null): New member to avoid extra allocations.
1381
1382 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1383
1384         * cs-parser.jay: Fix wrong warning 642 report.
1385
1386         * cs-tokenizer.cs (CheckNextToken): New helper;
1387         Inspect next character if is same as expected.
1388
1389 2004-09-23  Martin Baulig  <martin@ximian.com>
1390
1391         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
1392         (Convert.ImplicitReferenceConversionExists): Likewise.
1393
1394 2004-11-09  Raja R Harinath  <rharinath@novell.com>
1395
1396         * Makefile (DISTFILES): Comment out a few missing files.
1397
1398 2004-10-29  Raja R Harinath  <rharinath@novell.com>
1399
1400         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
1401         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
1402         (gmcs.exe): Invoke bootstrap-libs.
1403         (clean-local): Clean the net_2_0_bootstrap profile too.
1404         (PROGRAM_INSTALL_DIR): New.
1405         (install-local): Use it.
1406
1407 2004-10-13  Martin Baulig  <martin@ximian.com>
1408
1409         * generic.cs (TypeManager.InflatedConstraints): New nested class.
1410         (TypeParameter.DefineType): If we're a method type parameter and
1411         that method is overriding something, "inflate" its constraints.
1412
1413 2004-10-12  Martin Baulig  <martin@ximian.com>
1414
1415         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
1416         and have type arguments, create and resolve a ConstructedType.
1417
1418 2004-10-12  Martin Baulig  <martin@ximian.com>
1419
1420         * decl.cs (MemberCache.FindMemberToOverride): Use
1421         TypeManager.IsEqual() to compare the parameters and Type.Equals()
1422         to compare the invocationType.
1423
1424         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
1425         When comparing two type parameters, only do the signature-only
1426         comparision for method type parameters.
1427
1428 2004-10-11  Martin Baulig  <martin@ximian.com>
1429
1430         * report.cs: Don't make --fatal abort on warnings, we have
1431         -warnaserror for that.
1432
1433 2004-10-11  Martin Baulig  <martin@ximian.com>
1434
1435         * typemanager.cs
1436         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
1437         (TypeManager.IsEqual): Call ourself recursively instead of using
1438         Type.IsEqual(). 
1439
1440 2004-10-11  Martin Baulig  <martin@ximian.com>
1441
1442         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
1443         on our own type parameters, not on the ones we inherit from a containing
1444         class.
1445
1446         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
1447         the comparision.
1448
1449         * generic.cs (TypeParameter.Define): We may only be called once.
1450
1451         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
1452         instead of TypeManager.IsEqual().
1453
1454 2004-09-28  Martin Baulig  <martin@ximian.com>
1455
1456         * generic.cs
1457         (GenericConstraints.EffectiveBaseClass): New public property.
1458         (TypeParameter.GenericConstraints): New public property.
1459         (ConstructedType.CheckConstraints): Improved.
1460
1461         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
1462         (Convert.TypeParameterConversion): New private method; use this in
1463         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
1464         for all conversions related to type parameters.
1465
1466 2004-09-24  Martin Baulig  <martin@ximian.com>
1467
1468         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
1469         type parameter conversions for type parameters which are known to
1470         be reference types.
1471
1472 2004-09-24  Martin Baulig  <martin@ximian.com>
1473
1474         * generic.cs (GenericConstraints): Added `IsReferenceType' and
1475         `IsValueType' properties.
1476
1477         * support.cs (ReflectionConstraints): Use
1478         Type.GetGenericParameterConstraints() instead of the old hack.
1479
1480 2004-09-24  Martin Baulig  <martin@ximian.com>
1481
1482         * generic.cs (GenericConstraints): Moved here and made it an
1483         abstract class.
1484
1485         * support.cs (GenericConstraints): Moved to generic.cs.
1486
1487 2004-09-24  Martin Baulig  <martin@ximian.com>
1488
1489         * support.cs
1490         (ReflectionConstraints): Un-nested this class and made it public.
1491
1492         * typemanager.cs
1493         (TypeManager.GetTypeParameterConstraints): New public method.
1494         (TypeManager.HasConstructorConstraint): Use the attributes.
1495
1496 2004-09-24  Martin Baulig  <martin@ximian.com>
1497
1498         * support.cs (GenericConstraints): Replaced `HasConstructor',
1499         `IsReferenceType' and `IsValueType' with `Attributes'.
1500         (ReflectionParameters.ReflectionConstraints): Removed the Create()
1501         method and made the .ctor public.
1502
1503         * generic.cs (Constraints.Attributes): New public property.
1504         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
1505         `IsReferenceType' -> `HasReferenceTypeConstraint' and
1506         `IsValueType' -> `HasValueTypeConstraint'.
1507
1508 2004-09-23  Martin Baulig  <martin@ximian.com>
1509
1510         * generic.cs (Constraints): Reflect latest runtime changes.
1511
1512 2004-09-23  Martin Baulig  <martin@ximian.com>
1513
1514         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
1515         (Convert.ImplicitReferenceConversionExists): Likewise.
1516
1517 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1518
1519         * class.cs (Operator.Define): Add error 448 and 559 report.
1520         
1521 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
1522
1523         * class.cs (MemberBase.IsTypePermitted): New protected
1524         method for checking error CS0610.
1525
1526 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
1527
1528         * class.cs (TypeContainer.HasExplicitLayout): New property
1529         Returns whether container has StructLayout attribute set Explicit.
1530         (FieldMember): New abstract class for consts and fields.
1531         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
1532         (Field): Reuse FieldMember.
1533
1534         * const.cs (Const): Reuse FieldMember.
1535
1536         * rootcontext.cs: EmitConstants call moved to class.
1537
1538 2004-09-22  Martin Baulig  <martin@ximian.com>
1539
1540         Marek and me just fixed one of our oldest bugs: #28562 :-)
1541
1542         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
1543
1544         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
1545         we're an EnumConstant, just return that.
1546         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
1547         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
1548         to get the value which'll actually be written into the attribute.
1549         However, we have to use GetValue() to access the attribute's value
1550         in the compiler.        
1551
1552 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
1553
1554         * constant.cs (Constant.IsNegative): New abstract property
1555         IsNegative.
1556
1557         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
1558         (StackAlloc.DoResolve): Reused IsNegative.
1559
1560 2004-09-22  Martin Baulig  <martin@ximian.com>
1561
1562         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
1563         public method; like LookupTypeContainer, but also works for
1564         generic instances.
1565
1566         * report.cs (Report.SymbolRelatedToPreviousError): Use
1567         TypeManager.LookupGenericTypeContainer().       
1568
1569 2004-09-22  Martin Baulig  <martin@ximian.com>
1570
1571         Thanks to Peter Sestoft for this bug report.
1572
1573         * expression.cs (Conditional): If both the `trueExpr' and the
1574         `falseExpr' is a NullLiteral, return a NullLiteral.
1575
1576 2004-09-22  Martin Baulig  <martin@ximian.com>
1577
1578         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
1579         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
1580         for the "get_Current" call.
1581
1582 2004-09-21  Martin Baulig  <martin@ximian.com>
1583
1584         * convert.cs (Convert.ImplicitReferenceConversion): When
1585         converting to an interface type, first check whether we're
1586         converting from a reference type.
1587
1588 2004-09-14  Martin Baulig  <martin@ximian.com>
1589
1590         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
1591
1592 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
1593
1594         Fixed bug #61902
1595         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
1596         called and is obsolete then this member suppress message
1597         when call is inside next [Obsolete] method or type.
1598
1599         * expression.cs: Use TestObsoleteMethodUsage member.
1600
1601 2004-09-14  Martin Baulig  <martin@ximian.com>
1602
1603         * genericparser.cs: Removed.
1604
1605 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
1606
1607         * class.cs (MethodCore.CheckBase): Fix bug #65757.
1608
1609 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
1610
1611         * attribute.cs (Attribute.Resolve): Add error 653 report.
1612
1613         * class.cs (Class.ApplyAttributeBuilder): Add error 641
1614         report.
1615         (Method.ApplyAttributeBuilder): Add error 685 report.
1616         (Operator.Define): Add error 564 report.
1617
1618         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
1619
1620         * expression.cs (Invocation.DoResolve): Add error
1621         245 and 250 report.
1622
1623         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
1624         error 674 report.
1625
1626 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1627
1628         * class.cs (ConstructorInitializer.Resolve):
1629         Wrong error number (515->516).
1630
1631 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1632
1633         * class.cs (Indexer.Define): Add error 631 report.
1634
1635 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1636
1637         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
1638
1639 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
1640
1641         * expression.cs (Probe.DoResolve): Add error CS0241 report.
1642
1643 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
1644
1645         * cs-parser.jay: Added error CS0241 report.
1646
1647 2004-09-10  Raja R Harinath  <rharinath@novell.com>
1648
1649         * cs-parser.jay (fixed_statement): Introduce a scope for the
1650         declaration in the 'fixed' statement.
1651
1652 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1653
1654         * cs-parser.jay: Added CS0230 error report.
1655
1656 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1657
1658         * cs-parser.jay: Added errors CS0231 and CS0257 report.
1659
1660 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1661
1662         * expression.cs (Argument.Resolve): Added error CS0192 and
1663         CS0199 report.
1664
1665 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
1666
1667         C# 2.0 #pragma warning feature
1668
1669         * cs-tokenizer.cs (PreProcessPragma): New method; 
1670         Handles #pragma directive.
1671
1672         * report.cs (WarningRegions): New class; Support
1673         class for #pragma warning directive. It tests whether
1674         warning is enabled for a given line.
1675
1676 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
1677
1678         * const.cs: Add more descriptive error report, tahnks to
1679         Sebastien. 
1680
1681 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
1682
1683         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
1684
1685 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
1686
1687         * expression.cs: Apply patch from Ben: Remove dead code from
1688         ArrayCreation, and remove the TurnintoConstant call in const.cs,
1689         as that code just threw an exception anwyays.
1690
1691         * const.cs: Remove the call to the turnintoconstant, for details
1692         see bug: #63144
1693         
1694         * literal.cs: The type of the null-literal is the null type;  So
1695         we use a placeholder type (literal.cs:System.Null, defined here)
1696         for it.
1697
1698         * expression.cs (Conditional.DoResolve): Remove some old code that
1699         is no longer needed, conversions have been fixed.
1700
1701         (ArrayCreationExpression.DoResolve): Return false if we fail to
1702         resolve the inner expression.
1703
1704 2004-09-07  Raja R Harinath  <rharinath@novell.com>
1705
1706         Fix test-290.cs.
1707         * cs-parser.jay (delegate_declaration): Record a delegate
1708         declaration as a type declaration.
1709         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
1710
1711 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
1712
1713         * parameter.cs: Do not crash if the type can not be resolved. 
1714
1715         * expression.cs: Report errors with unsafe pointers, fixes #64896
1716
1717 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
1718
1719         * expression.cs: Pointer arith always needs to do a conv.i
1720         if the operand is a long. fix 65320
1721
1722 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
1723
1724         Fixed cs0619-37.cs, cs0619-38.cs
1725
1726         * enum.cs (GetObsoleteAttribute): Removed.
1727
1728         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
1729         on Enum member is double staged. The first is tested member
1730         and then enum.
1731
1732 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
1733
1734         Fixed #56986, #63631, #65231
1735
1736         * class.cs: (TypeContainer.AddToMemberContainer): New method,
1737         adds member to name container.
1738         (TypeContainer.AddToTypeContainer): New method, adds type to
1739         name container.
1740         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
1741         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
1742         AddOperator): Simplified by reusing AddToMemberContainer.
1743         (TypeContainer.UserDefinedStaticConstructor): Changed to property
1744         instead of field.
1745         (Method.CheckForDuplications): Fixed implementation to test all
1746         possibilities.
1747         (MemberBase): Detection whether member is explicit interface
1748         implementation is now in constructor.
1749         (MemberBase.UpdateMemberName): Handles IndexerName.
1750         (Accessor): Changed to keep also location information.
1751         (AbstractPropertyEventMethod): Is derived from MemberCore.
1752         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
1753         will be emited or not.
1754         (PropertyBase.AreAccessorsDuplicateImplementation):
1755         Tests whether accessors are not in collision with some method.
1756         (Operator): Is derived from MethodCore to simplify common
1757         operations.
1758
1759         * decl.cs (Flags.TestMethodDuplication): Test for duplication
1760         must be performed.
1761         (DeclSpace.AddToContainer): Adds the member to defined_names
1762         table. It tests for duplications and enclosing name conflicts.
1763
1764         * enum.cs (EnumMember): Clean up to reuse the base structures
1765
1766 2004-09-03  Martin Baulig  <martin@ximian.com>
1767
1768         Merged latest changes into gmcs.  Please keep this comment in
1769         here, it makes it easier for me to see what changed in MCS since
1770         the last time I merged.
1771
1772 2004-09-03  Martin Baulig  <martin@ximian.com>
1773
1774         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
1775         into TypeContainer, to make partial classes work again.
1776
1777 2004-09-03  Martin Baulig  <martin@ximian.com>
1778
1779         * rootcontext.cs (RootContext.V2): Removed.
1780
1781 2004-03-23  Martin Baulig  <martin@ximian.com>
1782
1783         * expression.cs (Invocation.OverloadResolve): Added `bool
1784         may_fail' argument and use it instead of the Location.IsNull() hack.
1785
1786 2004-09-09  Martin Baulig  <martin@ximian.com>
1787
1788         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
1789
1790 2004-09-09  Martin Baulig  <martin@ximian.com>
1791
1792         * generic.cs (TypeParameter.DefineType): Added support for
1793         explicit interface methods.
1794
1795 2004-09-09  Martin Baulig  <martin@ximian.com>
1796
1797         * README.Changes: New document.  Started to list important changes
1798         between MCS and GMCS here.
1799
1800 2004-09-08  Martin Baulig  <martin@ximian.com>
1801
1802         * class.cs
1803         (TypeContainer.CheckRecursiveDefinition): New protected method.
1804         (TypeContainer.DefineType): Move the CS0146 check into
1805         CheckRecursiveDefinition().     
1806
1807 2004-09-06  Martin Baulig  <martin@ximian.com>
1808
1809         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
1810         types for the constructor constraint.
1811
1812 2004-09-03  Martin Baulig  <martin@ximian.com>
1813
1814         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
1815         into TypeContainer, to make partial classes work again.
1816
1817 2004-09-03  Martin Baulig  <martin@ximian.com>
1818
1819         * rootcontext.cs (RootContext.V2): Removed.
1820
1821 2004-03-23  Martin Baulig  <martin@ximian.com>
1822
1823         * expression.cs (Invocation.OverloadResolve): Added `bool
1824         may_fail' argument and use it instead of the Location.IsNull() hack.
1825
1826 2004-09-03  Martin Baulig  <martin@ximian.com>
1827
1828         Merged latest changes into gmcs.  Please keep this comment in
1829         here, it makes it easier for me to see what changed in MCS since
1830         the last time I merged.
1831
1832 2004-09-03  Raja R Harinath  <rharinath@novell.com>
1833
1834         Fix #61128.
1835         * expression.cs (BetterConversion): Don't allow either conversion 
1836         to be null.  Remove redundant implicit conversion test when 'q ==
1837         null' -- when this function is invoked, we already know that the
1838         implicit conversion exists.
1839         (BetterFunction): Assume that 'best' is non-null.  Remove
1840         redundant reimplementation of IsApplicable when 'best' is null.
1841         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
1842         number of arguments.
1843         (IsAncestralType): Extract from OverloadResolve.
1844         (OverloadResolve): Make robust to the MethodGroupExpr being
1845         unsorted.  Implement all the logic of Section 14.5.5.1, and
1846         support overloading of methods from multiple applicable types.
1847         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
1848
1849         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
1850         (RealError, Warning): Append type of report to related symbol.
1851
1852 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
1853
1854         * enum.cs: Fixed CLS-Compliance checks for enum members.
1855         Error tests cs3008-8.cs, cs3014-8.cs
1856
1857 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1858
1859         Fixed bug #62342, #63102
1860         * class.cs: ImplementIndexer uses member.IsExplicitImpl
1861         like ImplementMethod.
1862
1863 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
1864
1865         * attribute.cs (Attribute.GetAttributeArgumentExpression):
1866         Fixed bug #65170.
1867
1868 2004-09-02  Martin Baulig  <martin@ximian.com>
1869
1870         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
1871         TypeManager.GetArgumentTypes() rather than calling GetParameters()
1872         on the MethodBase.
1873
1874 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
1875
1876         C# 2.0 Static classes implemented
1877
1878         * class.cs (TypeContainer): instance_constructors,
1879         initialized_fields, initialized_static_fields,
1880         default_constructor, base_inteface_types are protected to be
1881         accessible from StaticClass.
1882         (TypeContainer.DefineDefaultConstructor): New virtual method
1883         for custom default constructor generating
1884         (StaticClass): New class to handle "Static classes" feature.
1885
1886         * cs-parser.jay: Handle static keyword on class like instance
1887         of StaticClass.
1888
1889         * driver.cs: Added "/langversion" command line switch with two
1890         options (iso-1, default).
1891
1892 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
1893
1894         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
1895
1896 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
1897
1898         * delegate.cs: Style.
1899
1900 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
1901
1902         * delegate.cs: Add seperate instance expr field for miguel.
1903
1904 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1905
1906         * PointerArithmetic (Resolve): make sure we are not doing
1907         pointer arith on void*. Also, make sure we are resolved
1908         by not setting eclass until resolve.
1909
1910         All callers: Make sure that PointerArithmetic gets resolved.
1911
1912 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
1913
1914         * ArrayCreation (LookupType): If the type does not resolve 
1915         to an array, give an error.
1916
1917 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
1918
1919         * statement.cs (Try.Resolve): Fixed bug #64222
1920
1921 2004-08-27  Martin Baulig  <martin@ximian.com>
1922
1923         * class.cs
1924         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
1925         crash here.     
1926
1927 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1928
1929         * ecore.cs (Constantify): Get underlying type via
1930         System.Enum.GetUnderlyingType to avoid StackOverflow on the
1931         Windows in special cases.
1932
1933 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
1934
1935         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
1936         for obtaining also private methods.
1937         (GetRemoveMethod): Used GetRemoveMethod (true)
1938         for obtaining also private methods.
1939
1940 2004-09-02  Martin Baulig  <martin@ximian.com>
1941
1942         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
1943         TypeManager.GetArgumentTypes() rather than calling GetParameters()
1944         on the MethodBase.
1945
1946 2004-08-27  Martin Baulig  <martin@ximian.com>
1947
1948         * class.cs
1949         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
1950         crash here.     
1951
1952 2004-08-25  Martin Baulig  <martin@ximian.com>
1953
1954         * support.cs (ReflectionParameters..ctor): If this is a generic
1955         method, retrieve and store its type parameters.
1956         (InternalParameters..ctor): Added `TypeParameter[]' argument.
1957         (ReflectionParameters.GenericConstraints): The argument specifies
1958         the type parameter, not the method parameter.
1959         (InternalParameters.GenericConstraints): Likewise.
1960
1961         * generic.cs (TypeParameter.DefineType): Correctly handle
1962         constraints wrt. generic methods in interfaces and their
1963         implementations.        
1964
1965 2004-08-24  Martin Baulig  <martin@ximian.com>
1966
1967         * generic.cs (TypeParameter.IsSubclassOf): New public method.
1968         (Constraints.IsSubclassOf): New internal method.
1969
1970         * typemanager.cs (TypeManager.FindMembers): Added special support
1971         for GenericTypeParameterBuilder's.      
1972         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
1973         type parameters.
1974
1975 2004-08-24  Martin Baulig  <martin@ximian.com>
1976
1977         * typemanager.cs
1978         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
1979         this for accessibility checks.
1980         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
1981         IsNestedFamilyAccessible.
1982         (TypeManager.IsSubclassOf): New method, do what the name actually
1983         says.   
1984
1985 2004-08-24  Martin Baulig  <martin@ximian.com>
1986
1987         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
1988         as a SimpleName, include the generic arity.
1989
1990 2004-08-24  Martin Baulig  <martin@ximian.com>
1991
1992         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
1993         MethodAttributes.HideBySig for operators.
1994
1995 2004-08-23  Martin Baulig  <martin@ximian.com>
1996
1997         Back to the old error reporting system :-)
1998
1999         * report.cs (Message): Removed.
2000         (Report.MessageData, ErrorData, WarningData): Removed.
2001         (Report.Error, Warning): Back to the old system.
2002
2003 2004-08-23  Martin Baulig  <martin@ximian.com>
2004
2005         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
2006
2007         * class.cs (TypeContainer.ParentContainer): New public virtual
2008         method; replaces the explicit interface implementation.
2009         (ClassPart.ParentContainer): Override.
2010
2011 2004-08-23  Martin Baulig  <martin@ximian.com>
2012
2013         * statement.cs (Switch): Added support for constant switches; see
2014         #59428 or test-285.cs.
2015
2016 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2017
2018         Fixed bug #62740.
2019         * statement.cs (GetEnumeratorFilter): Removed useless
2020         logic because C# specs is strict. GetEnumerator must be
2021         public.
2022
2023 2004-08-22  Martin Baulig  <martin@ximian.com>
2024
2025         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2026         a switch and may break, reset the barrier.  Fixes #59867.
2027
2028 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2029
2030         CLS-Compliance speed up (~5% for corlib)
2031
2032         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
2033         New method. Tests container for CLS-Compliant names
2034
2035         * class.cs (TypeContainer.VerifyClsName): New method.
2036         Checks whether container name is CLS Compliant.
2037         (Constructor): Implements IMethodData.
2038
2039         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
2040         low-case table for CLS Compliance test.
2041         (MemberCache.VerifyClsParameterConflict): New method.
2042         Checks method parameters for CS3006 error.
2043
2044         * enum.cs (EnumMember): Is derived from MemberCore.
2045         (Enum.VerifyClsName): Optimized for better performance.
2046
2047 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2048
2049         * report.cs: Renamed Error_T to Error and changed all
2050         references.
2051
2052 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2053
2054         * class.cs (TypeContainer.IndexerArrayList): New inner class
2055         container for indexers.
2056         (TypeContainer.DefaultIndexerName): New constant for default
2057         indexer name. Replaced all "Item" with this constant.
2058         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
2059
2060         * typemanager.cs (TypeManager.default_member_ctor): Cache here
2061         DefaultMemberAttribute constructor.
2062
2063 2004-08-05  Martin Baulig  <martin@ximian.com>
2064
2065         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2066         Fix bug #59429.
2067
2068 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
2069
2070         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
2071         multi platforms problem.
2072
2073         * compiler.csproj: Included shared files.
2074
2075 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2076
2077         Fix bug 60333, 55971 in the more general way
2078         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2079         Added arg_type argument for constant conversion.
2080         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
2081
2082 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2083
2084         Fix bug #59760
2085         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
2086         OperatorArrayList, MethodCoreArrayList for typecontainer
2087         containers. Changed class member types to these new types.
2088         (MethodArrayList.DefineMembers): Added test for CS0659.
2089
2090 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
2091
2092         * cfold.cs: Synchronize the folding with the code in expression.cs
2093         Binary.DoNumericPromotions for uint operands.
2094
2095         * attribute.cs: Revert patch from Raja, it introduced a regression
2096         while building Blam-1.2.1 (hard to isolate a test case).
2097
2098 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2099
2100         Fix for #55382
2101         * class.cs:
2102         (TypeContainer.Define): Renamed to DefineContainerMembers because of
2103         name collision.
2104         (MethodCore.parent_method): New member. The method we're overriding
2105         if this is an override method.
2106         (MethodCore.CheckBase): Moved from Method class and made common.
2107         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
2108         private.
2109         (MethodCore.CheckForDuplications): New abstract method. For custom
2110         member duplication search in a container
2111         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
2112         method and its return type.
2113         (Event.conflict_symbol): New member. Symbol with same name in the
2114         parent class.
2115
2116         * decl.cs:
2117         (MemberCache.FindMemberWithSameName): New method. The method
2118         is looking for conflict with inherited symbols.
2119
2120 2004-08-04  Martin Baulig  <martin@ximian.com>
2121
2122         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2123
2124         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2125
2126 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2127
2128         * report.cs (Message): New enum for better error, warning reference in
2129         the code.
2130         (MessageData): New inner abstract class. It generally handles printing of
2131         error and warning messages.
2132         Removed unused Error, Warning, Message methods.
2133
2134 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2135
2136         Fix for cs0592-8.cs test
2137         * attribute.cs
2138         (Attributable.ValidAttributeTargets): Made public.
2139         (Attribute.ExplicitTarget): New member for explicit target value.
2140         (Attribute.CheckTargets): Now we translate explicit attribute
2141         target to Target here.
2142
2143 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
2144
2145         * ecore.cs (MethodGroupExpr): new IsBase property.
2146
2147         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
2148
2149         * delegate.cs (DelegateCreation): store a MethodGroupExpr
2150         rather than an instance expr.
2151
2152         (DelegateCreation.Emit): Use the method group rather than
2153         the instance expression. Also, if you have base.Foo as the
2154         method for a delegate, make sure to emit ldftn, not ldftnvirt.
2155
2156         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
2157
2158         (NewDelegate.DoResolve): Only check for the existance of Invoke
2159         if the method is going to be needed. Use MethodGroupExpr.
2160
2161         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
2162
2163         * expression.cs: For pointer arith., make sure to use
2164         the size of the type, not the size of the pointer to
2165         the type.
2166
2167 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2168
2169         Fix for #60722
2170         * class.cs (Class): Added error CS0502 test.
2171
2172 2004-08-03  John Luke  <jluke@cfl.rr.com>
2173             Raja R Harinath  <rharinath@novell.com>
2174
2175         Fix for #60997.
2176         * attribute.cs (Attribute.complained_before): New flag.
2177         (Attribute.ResolveType, Attribute.Resolve),
2178         (Attribute.DefinePInvokeMethod): Set it.
2179         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
2180         
2181 2004-08-03  Martin Baulig  <martin@ximian.com>
2182
2183         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2184         use a user-defined operator; we still need to do numeric
2185         promotions in case one argument is a builtin type and the other
2186         one has an implicit conversion to that type.  Fixes #62322.
2187
2188 2004-08-18  Martin Baulig  <martin@ximian.com>
2189
2190         * class.cs (Method.Define): Use the correct method name when
2191         creating the MethodBuilder for a generic method.
2192
2193 2004-08-17  Martin Baulig  <martin@ximian.com>
2194
2195         * generic.cs (Constraints): Support type parameter constraints.
2196
2197 2004-08-16  Martin Baulig  <martin@ximian.com>
2198
2199         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
2200         (Token.GENERIC_DIMENSION): New token; this is returned if we
2201         encounter an unbound generic type in a typeof() expression.
2202
2203         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
2204         this token is only generated while parsing a typeof() expression.
2205         (typeof_expression): Removed the old unbound_type hack.
2206
2207         * generic.cs (TypeArguments.IsUnbound): New public property.
2208
2209         * decl.cs (MemberName): Added support for unbound types.
2210
2211 2004-08-14  Martin Baulig  <martin@ximian.com>
2212
2213         * typemanager.cs
2214         (TypeManager.IsEqualGenericInstance): New static method.
2215         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
2216         just used to check accessibility, so follow the rules of 26.1.6.        
2217
2218         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
2219         ConstructedType instead of a TypeExpression if we have type arguments.
2220
2221         * cs-parser.jay (typeof_expression): Support unbound generic types.
2222
2223         * ecore.cs (UnboundTypeExpression): New public class.
2224
2225 2004-08-12  Martin Baulig  <martin@ximian.com>
2226
2227         * typemanager.cs (TypeManager.IsNestedChildOf): Use
2228         TypeManager.IsEqual() rather than `=='.
2229
2230         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
2231         generic instances as well.
2232
2233 2004-08-12  Martin Baulig  <martin@ximian.com>
2234
2235         * expression.cs (Invocation.InferType): We can only infer method
2236         type parameters.  Fixes #62647.
2237
2238 2004-08-11  Martin Baulig  <martin@ximian.com>
2239
2240         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
2241         before resolving the base classes.
2242
2243 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2244
2245         * Makefile: install .mdb file too.
2246
2247 2004-08-05  Martin Baulig  <martin@ximian.com>
2248
2249         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
2250         initializer, the current type is just the TypeBuilder, not the
2251         instantiated generic type.
2252         (FieldExpr.IsFieldInitializer): New public property.
2253
2254 2004-08-04  Martin Baulig  <martin@ximian.com>
2255
2256         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2257
2258         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2259
2260 2004-08-03  Martin Baulig  <martin@ximian.com>
2261
2262         * class.cs (MethodData.Define): If we're an explicit
2263         implementation, remove the generic arity from the type name.
2264
2265 2004-08-03  Martin Baulig  <martin@ximian.com>
2266
2267         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2268         use a user-defined operator; we still need to do numeric
2269         promotions in case one argument is a builtin type and the other
2270         one has an implicit conversion to that type.  Fixes #62322.
2271
2272 2004-08-02  Martin Baulig  <martin@ximian.com>
2273
2274         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
2275         `TypeExpr[]' array.
2276         (TypeContainer.GetClassBases): Return the unexpanded list of
2277         interfaces; we expand them later.
2278         (TypeContainer.DefineType): After creating the TypeBuilder, call
2279         TypeManager.ExpandInterfaces() to get an expanded and resolved
2280         list of interfaces.
2281
2282         * ecore.cs (TypeExpr.GetInterfaces): Removed
2283
2284         * generics.cs (Constraints.InterfaceConstraints): Remove.
2285         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
2286         register the interface constraints.
2287
2288         * typemanager.cs
2289         (TypeManager.AddUserType): Removed the `ifaces' argument.
2290         (TypeManager.AddTypeParameter): Likewise.
2291         (TypeManager.AddUserInterface): Removed, was unused.
2292         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
2293         `TypeExpr[]' array for the interfaces.
2294         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
2295         has been defined, returns a list of the resolved interfaces types.
2296         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
2297         (TypeManager.GetExplicitInterfaces): Likewise.  
2298
2299 2004-08-02  Martin Baulig  <martin@ximian.com>
2300
2301         * expression.cs (Invocation.EmitCall): If we're invoking a method
2302         on a type parameter, use the new `Constrained' prefix opcode.
2303
2304 2004-08-02  Martin Baulig  <martin@ximian.com>
2305
2306         * statement.cs (LocalInfo.Flags): Added `IsThis'.
2307         (LocalInfo.IsThis): New public property.
2308         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
2309
2310 2004-08-01  Martin Baulig  <martin@ximian.com>
2311
2312         * class.cs (TypeContainer.GetClassBases): Don't set the default
2313         here since we may get called from GetPartialBases().
2314         (TypeContainer.DefineType): If GetClassBases() didn't return a
2315         parent, use the default one.
2316
2317 2004-07-30  Martin Baulig  <martin@ximian.com>
2318
2319         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
2320
2321         * class.cs (SourceMethod): New public class, derive from the
2322         symbol writer's ISourceMethod.
2323         (Method): Use the new symbol writer API.
2324
2325         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
2326         as argument and use the new symbol writer.
2327
2328         * location.cs
2329         (SourceFile): Implement the symbol writer's ISourceFile.
2330         (Location.SymbolDocument): Removed.
2331         (Location.SourceFile): New public property.
2332
2333         * symbolwriter.cs: Use the new symbol writer API.
2334
2335 2004-07-30  Raja R Harinath  <rharinath@novell.com>
2336
2337         * Makefile (install-local): Remove.  Functionality moved to
2338         executable.make.
2339
2340 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
2341
2342         * Makefile: Install mcs.exe.config file together with mcs.exe.
2343         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
2344         correct runtime version.
2345         
2346 2004-07-25  Martin Baulig  <martin@ximian.com>
2347
2348         * class.cs
2349         (TypeContainer.RegisterOrder): Removed, this was unused.
2350         (TypeContainer, interface_order): Removed.
2351         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
2352         TypeContainer as argument since we can also be called with a
2353         `PartialContainer' for a partial class/struct/interface.
2354         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
2355         of checking whether we're an `Interface' - we could be a
2356         `PartialContainer'.
2357         (PartialContainer.Register): Override; call
2358         AddClass()/AddStruct()/AddInterface() on our parent.
2359
2360         * cs-parser.jay (interface_member_declaration): Add things to the
2361         `current_container', not the `current_class'.
2362
2363         * rootcontext.cs (RegisterOrder): The overloaded version which
2364         takes an `Interface' was unused, removed.
2365
2366         * typemanager.cs (TypeManager.LookupInterface): Return a
2367         `TypeContainer', not an `Interface'.
2368         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
2369         contain a `PartialContainer' for an interface, so check it's
2370         `Kind' to figure out what it is.
2371
2372 2004-07-25  Martin Baulig  <martin@ximian.com>
2373
2374         * class.cs (Class.DefaultTypeAttributes): New public constant.
2375         (Struct.DefaultTypeAttributes): Likewise.
2376         (Interface.DefaultTypeAttributes): Likewise.
2377         (PartialContainer.TypeAttr): Override this and add the
2378         DefaultTypeAttributes.
2379
2380 2004-07-25  Martin Baulig  <martin@ximian.com>
2381
2382         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
2383         we can just use the `Parent' field instead.
2384
2385 2004-07-25  Martin Baulig  <martin@ximian.com>
2386
2387         * class.cs (TypeContainer.Emit): Renamed to EmitType().
2388
2389 2004-07-25  Martin Baulig  <martin@ximian.com>
2390
2391         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
2392         our parts before defining any methods.
2393         (TypeContainer.VerifyImplements): Make this virtual.
2394         (ClassPart.VerifyImplements): Override and call VerifyImplements()
2395         on our PartialContainer.
2396
2397 2004-07-25  Martin Baulig  <martin@ximian.com>
2398
2399         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
2400
2401         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
2402         argument, we can just use the `Parent' field instead.
2403
2404         * class.cs
2405         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
2406         (MemberBase.DoDefine): Likewise.
2407
2408 2004-07-24  Martin Baulig  <martin@ximian.com>
2409
2410         * decl.cs (MemberCore.Parent): New public field.
2411         (DeclSpace.Parent): Moved to MemberCore.
2412
2413         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
2414         (MemberBase.ctor): Added TypeContainer argument, pass it to our
2415         parent's .ctor.
2416         (FieldBase, Field, Operator): Likewise.
2417         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
2418         (EventField, Event): Likewise.
2419
2420 2004-07-23  Martin Baulig  <martin@ximian.com>
2421
2422         * class.cs (PartialContainer): New public class.
2423         (ClassPart): New public class.
2424         (TypeContainer): Added support for partial classes.
2425         (TypeContainer.GetClassBases): Splitted some of the functionality
2426         out into GetNormalBases() and GetPartialBases().
2427
2428         * cs-tokenizer.cs (Token.PARTIAL): New token.
2429         (Tokenizer.consume_identifier): Added some hacks to recognize
2430         `partial', but only if it's immediately followed by `class',
2431         `struct' or `interface'.
2432
2433         * cs-parser.jay: Added support for partial clases.
2434
2435 2004-07-23  Martin Baulig  <martin@ximian.com>
2436
2437         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
2438         a `DeclSpace' and also made it readonly.
2439         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
2440         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
2441         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
2442
2443         * cs-parser.jay: Pass the `current_class', not the
2444         `current_container' (at the moment, this is still the same thing)
2445         to a new Method, Property, Event, Indexer or Constructor.
2446
2447 2004-07-23  Martin Baulig  <martin@ximian.com>
2448
2449         * cs-parser.jay (CSharpParser): Added a new `current_class' field
2450         and removed the `current_interface' one.
2451         (struct_declaration, class_declaration, interface_declaration):
2452         Set `current_class' to the newly created class/struct/interface;
2453         set their `Bases' and call Register() before parsing their body.
2454
2455 2004-07-23  Martin Baulig  <martin@ximian.com>
2456
2457         * class.cs (Kind): New public enum.
2458         (TypeContainer): Made this class abstract.
2459         (TypeContainer.Kind): New public readonly field.
2460         (TypeContainer.CheckDef): New public method; moved here from
2461         cs-parser.jay.
2462         (TypeContainer.Register): New public abstract method.
2463         (TypeContainer.GetPendingImplementations): New public abstract
2464         method.
2465         (TypeContainer.GetClassBases): Removed the `is_class' and
2466         `is_iface' parameters.
2467         (TypeContainer.DefineNestedTypes): Formerly known as
2468         DoDefineType().
2469         (ClassOrStruct): Made this class abstract.
2470
2471         * tree.cs (RootTypes): New public type. 
2472
2473 2004-07-20  Martin Baulig  <martin@ximian.com>
2474
2475         * tree.cs (Tree.RecordNamespace): Removed.
2476         (Tree.Namespaces): Removed.
2477
2478         * rootcontext.cs (RootContext.IsNamespace): Removed.
2479
2480         * cs-parser.jay (namespace_declaration): Just create a new
2481         NamespaceEntry here.
2482
2483 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
2484
2485         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
2486         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
2487         entry to make sure it runs in the correct runtime version.
2488         
2489 2004-07-18  Martin Baulig  <martin@ximian.com>
2490
2491         * generic.cs (ConstructedType.CheckConstraints): Improved
2492         constraints checking.
2493
2494 2004-07-18  Martin Baulig  <martin@ximian.com>
2495
2496         * expression.cs (Invocation.BetterMethod): Call
2497         TypeManager.TypeToCoreType() on all types and removed my previous
2498         hack; we're already doig the right thing here.
2499
2500 2004-07-17  Martin Baulig  <martin@ximian.com>
2501
2502         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
2503
2504 2004-07-16  Martin Baulig  <martin@ximian.com>
2505
2506         * iterators.cs: Added generics support.
2507
2508 2004-07-16  Martin Baulig  <martin@ximian.com>
2509
2510         * iterators.cs: Rewrote this.  We're now using one single Proxy
2511         class for both the IEnumerable and the IEnumerator interface and
2512         `Iterator' derives from Class so we can use the high-level API.
2513
2514         * class.cs (TypeContainer.AddIterator): New method.
2515         (TypeContainer.DoDefineType): New protected virtual method, which
2516         is called from DefineType().
2517         (TypeContainer.DoDefineMembers): Call DefineType() and
2518         DefineMembers() on all our iterators.
2519         (TypeContainer.Emit): Call Emit() on all our iterators.
2520         (TypeContainer.CloseType): Call CloseType() on all our iterators.
2521
2522         * codegen.cs (EmitContext.CurrentIterator): New public field.
2523
2524 2004-07-15  Martin Baulig  <martin@ximian.com>
2525
2526         * typemanager.cs
2527         (TypeManager.not_supported_exception_type): New type.   
2528
2529 2004-07-14  Martin Baulig  <martin@ximian.com>
2530
2531         * typemanager.cs
2532         (TypeManager.generic_ienumerable_type): New type.
2533         (TypeManager.generic_ienumerator_type): New type.
2534
2535         * rootcontext.cs
2536         (RootContext.interfaces_first_stage): Added
2537         "System.Collections.Generic.IEnumerator`1" and
2538         "System.Collections.Generic.IEnumerable`1".     
2539
2540 2004-07-14  Martin Baulig  <martin@ximian.com>
2541
2542         * iterators.cs: Use real error numbers.
2543
2544 2004-07-14  Martin Baulig  <martin@ximian.com>
2545
2546         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
2547         requires this to be a System.Collection.IEnumerable and not a
2548         class implementing that interface.
2549         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
2550
2551 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
2552
2553         * class.cs: Fixed previous fix, it broke some error tests.
2554
2555 2004-07-12  Martin Baulig  <martin@ximian.com>
2556
2557         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
2558         Fixes #61293.
2559
2560 2004-07-14  Martin Baulig  <martin@ximian.com>
2561
2562         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
2563         an exclamation mark (!) for the generic arity to reflect the
2564         latest spec changes; ie. use "System.Collections.Generic.IList`1".
2565
2566 2004-07-13  Martin Baulig  <martin@ximian.com>
2567
2568         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
2569         specifiers being part of a type argument.
2570
2571 2004-07-13  Martin Baulig  <martin@ximian.com>
2572
2573         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
2574         name for generic types.
2575
2576 2004-07-13  Martin Baulig  <martin@ximian.com>
2577
2578         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
2579         bit to fix #60119.
2580
2581 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
2582
2583         * assign.cs (LocalTemporary): Add new argument: is_address,If
2584         `is_address' is true, then the value that we store is the address
2585         to the real value, and not the value itself.
2586         
2587         * ecore.cs (PropertyExpr): use the new local temporary
2588         stuff to allow us to handle X.Y += z (where X is a struct)
2589
2590 2004-07-08  Martin Baulig  <martin@ximian.com>
2591
2592         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
2593         not always return, just like we're doing in Using.Resolve().
2594
2595 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
2596
2597         * cs-parser.jay (fixed_statement): flag this as Pinned.
2598
2599 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
2600
2601         * typemanager.cs (TypeManager): Removed MakePinned method, this
2602         mechanism is replaced with the .NET 2.x compatible mechanism of
2603         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
2604
2605         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
2606         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
2607         `IsFixed' property which has a different meaning.
2608
2609 2004-07-02  Raja R Harinath  <rharinath@novell.com>
2610
2611         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
2612         visible from inside a nested class, not just the names of the
2613         immediately enclosing class.
2614         Fix for bug #60730.
2615
2616 2004-06-24  Raja R Harinath  <rharinath@novell.com>
2617
2618         * expression.cs (BetterConversion): Remove buggy special-case
2619         handling of "implicit constant expression conversions".  At this
2620         point, we already know that the conversion is possible -- we're
2621         only checking to see which is better.
2622
2623 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
2624
2625         * cs-parser.jay: Added error CS0210 test.
2626
2627 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
2628
2629         * cs-parser.jay: Added error CS0134 test.
2630
2631 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
2632
2633         Fix bug #52507
2634         * cs-parser.jay: Added error CS0145 test.
2635
2636 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
2637
2638         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
2639
2640 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
2641         
2642         * expression.cs (StackAlloc.Resolve): The argument may not
2643         be a constant; deal with this case.
2644         
2645 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
2646
2647         * attribute.cs (IndexerName_GetIndexerName): Renamed to
2648         GetIndexerAttributeValue.
2649         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
2650
2651         * class.cs (Indexer.Define): Added error tests for CS0415,
2652         CS0609.
2653
2654 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
2655
2656         * attribute.cs (Attribute.Resolve): Keep field code in sync with
2657         property code.
2658
2659 2004-06-23  Martin Baulig  <martin@ximian.com>
2660
2661         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
2662         neither return nor throw, reset the barrier as well.  Fixes #60457.
2663
2664 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
2665
2666         * class.cs : EventAttributes is now set to None by default.
2667           This fixes bug #60459.
2668
2669 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
2670
2671         Fix bug #60219
2672         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
2673         Don't throw exception but return null (it's sufficient now).
2674
2675 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
2676
2677         * typemanager.cs (GetArgumentTypes): Faster implementation.
2678
2679 2004-06-18  Martin Baulig  <martin@ximian.com>
2680
2681         * attribute.cs (Attribute.Resolve): Check whether we're an
2682         EmptyCast which a Constant child.  Fixes #60333.
2683
2684 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
2685
2686         * statement.cs (EmitCollectionForeach): Account for the fact that
2687         not all valuetypes are in areas which we can take the address of.
2688         For these variables, we store to a temporary variable. Also, make
2689         sure that we dont emit a `callvirt' on a valuetype method.
2690
2691 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
2692
2693         * expression.cs (StackAlloc.DoReSolve): Added test for
2694         negative parameter (CS0247).
2695
2696 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
2697
2698         Fix bug #59792
2699         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
2700
2701 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
2702
2703         Fix bug #59781
2704         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
2705         ulong.
2706
2707 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
2708
2709         Fix bug #58254 & cs1555.cs, cs1556.cs
2710         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
2711
2712 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
2713
2714         * cs-parser.jay: Added error CS1669 test for indexers.
2715
2716 2004-06-18  Martin Baulig  <martin@ximian.com>
2717
2718         * generics.cs (GenericMethod.ctor): Don't take an Attributes
2719         argument.  Fixes #60441.
2720
2721 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
2722         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
2723         The name needs to have the actual name of the method in order
2724         for other tests (such as the one in OverloadResolve for Invoke
2725         on a delegate) to work. As well, it does not really help
2726         error reporting because the method group had multiple methods.
2727         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
2728         Make profiling work.
2729         
2730 2004-06-13  Martin Baulig  <martin@ximian.com>
2731
2732         * cs-parser.jay: Don't allow generic attributes.
2733
2734 2004-06-13  Martin Baulig  <martin@ximian.com>
2735
2736         * class.cs (MemberBase.DoDefineBase): New protected method.
2737         (MemberBase.DoDefine): Compute the `flags' in the new
2738         DoDefineBase() which must be called first.
2739         (Method.Define): Call DoDefineBase() first so we have the flags
2740         when defining the generic method.
2741
2742         * cs-parser.jay (interface_method_declaration): Support generic methods.
2743
2744 2004-06-13  Martin Baulig  <martin@ximian.com>
2745
2746         * decl.cs (TypeName): Removed.
2747         (MemberName): Removed TypeName and MemberNow; now we just have
2748         MemberName.
2749
2750         * cs-parser.jay: Don't distinguish between type arguments and type
2751         parameters in the grammar and simplified the rules a bit.  The
2752         reduce/reduce conflicts are now gone (except the one we inherited
2753         from mcs).
2754
2755 2004-06-11  Martin Baulig  <martin@ximian.com>
2756
2757         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
2758         call this twice: for params and varargs methods.
2759
2760 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
2761
2762         * class.cs:
2763         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
2764
2765 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
2766
2767         * attribute.cs (Attribute.GetValidTargets): Made public.
2768
2769         * class.cs: 
2770         (AbstractPropertyEventMethod): New class for better code sharing.
2771         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
2772         CS1667 report.
2773         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
2774
2775 2004-06-09  Martin Baulig  <martin@ximian.com>
2776
2777         * cs-parser.jay: Removed a reduce/reduce conflict.
2778
2779 2004-06-03  Martin Baulig  <martin@ximian.com>
2780
2781         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
2782         GetSimpleName() and return a SimpleName.
2783
2784         * ecore.cs (SimpleName.Arguments): New public field.
2785         (SimpleName): Added overloaded ctor which takes an additional
2786         TypeArguments argument.
2787         (SimpleName.SimpleNameResolve): Added support for generic methods.
2788         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
2789         formerly in MemberAccess.DoResolve(), but we also need it in
2790         SimpleNameResolve().
2791
2792         * expression.cs (MemberAccess.DoResolve): Use the new
2793         MethodGroupExpr.ResolveGeneric().       
2794
2795 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2796
2797         * decl.cs: If possible, use lookuptypedirect here. We can only do
2798         this if there is no `.' after the namespace. Avoids using
2799         LookupType, which does lots of slow processing.
2800         (FindNestedType) New method, does what it says :-).
2801         * namespace.cs: use LookupTypeDirect.
2802         * rootcontext.cs: use membercache, if possible.
2803         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
2804
2805 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2806
2807         * expression.cs:
2808         According to the spec, 
2809
2810         In a member access of the form E.I, if E is a single identifier,
2811         and if the meaning of E as a simple-name (§7.5.2) is a constant,
2812         field, property, localvariable, or parameter with the same type as
2813         the meaning of E as a type-name (§3.8), then both possible
2814         meanings of E are permitted.
2815
2816         We did not check that E as a simple-name had the same type as E as
2817         a type name.
2818
2819         This trivial check gives us 5-7% on bootstrap time.
2820
2821 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2822
2823         * expression.cs (Invocation.OverloadResolve): Avoid the
2824         use of hashtables and boxing here by allocating on demand.
2825
2826 2004-05-30  Martin Baulig  <martin@ximian.com>
2827
2828         * rootcontext.cs (RootContext.LookupType): Don't cache things if
2829         we're doing a silent lookup.  Don't try to lookup nested types in
2830         TypeManager.object_type (thanks to Ben Maurer).
2831
2832 2004-05-30  Martin Baulig  <martin@ximian.com>
2833
2834         Committing a patch from Ben Maurer.
2835
2836         * rootcontext.cs (RootContext.LookupType): Cache negative results.
2837
2838 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2839
2840         * convert.cs: add a trivial cache for overload operator resolution.
2841
2842 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
2843
2844         * attribute.cs
2845         (AttributeTester.GetObsoleteAttribute): Returns instance of
2846         ObsoleteAttribute when type is obsolete.
2847
2848         * class.cs
2849         (TypeContainer.VerifyObsoleteAttribute): Override.
2850         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
2851         (MethodCode.VerifyObsoleteAttribute): Override.
2852         (MemberBase.VerifyObsoleteAttribute): Override.
2853
2854         * decl.cs
2855         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
2856         and report proper error.
2857
2858         *delegate.cs
2859         (Delegate.VerifyObsoleteAttribute): Override.
2860
2861         * ecore.cs
2862         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
2863         and report proper error.
2864         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
2865
2866         * enum.cs
2867         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
2868         and enum member.
2869
2870         * expression.cs
2871         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
2872         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
2873         Added test for ObsoleteAttribute.
2874
2875         * statement.cs
2876         (Catch): Derived from Statement.
2877
2878 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2879
2880         * decl.cs: If possible, use lookuptypedirect here. We can only do
2881         this if there is no `.' after the namespace. Avoids using
2882         LookupType, which does lots of slow processing.
2883         (FindNestedType) New method, does what it says :-).
2884         * namespace.cs: use LookupTypeDirect.
2885         * rootcontext.cs: use membercache, if possible.
2886         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
2887
2888 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2889
2890         * expression.cs:
2891         According to the spec, 
2892
2893         In a member access of the form E.I, if E is a single identifier,
2894         and if the meaning of E as a simple-name (§7.5.2) is a constant,
2895         field, property, localvariable, or parameter with the same type as
2896         the meaning of E as a type-name (§3.8), then both possible
2897         meanings of E are permitted.
2898
2899         We did not check that E as a simple-name had the same type as E as
2900         a type name.
2901
2902         This trivial check gives us 5-7% on bootstrap time.
2903
2904 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
2905
2906         Fixed bug #59071 & cs0160.cs
2907         * statement.cs (Try.Resolve): Check here whether order of catch
2908         clauses matches their dependencies.
2909
2910 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
2911
2912         Fixed bug #58624
2913         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
2914         unsafe type.
2915
2916 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
2917
2918         * expression.cs (Invocation.OverloadResolve): Avoid the
2919         use of hashtables and boxing here by allocating on demand.
2920
2921 2004-05-30  Martin Baulig  <martin@ximian.com>
2922
2923         * rootcontext.cs (RootContext.LookupType): Don't cache things if
2924         we're doing a silent lookup.  Don't try to lookup nested types in
2925         TypeManager.object_type (thanks to Ben Maurer).
2926
2927 2004-05-30  Martin Baulig  <martin@ximian.com>
2928
2929         Committing a patch from Ben Maurer.
2930
2931         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
2932
2933 2004-05-29  Martin Baulig  <martin@ximian.com>
2934
2935         * class.cs (IMethodData.ShouldIgnore): New method.
2936
2937         * typemanager.cs (TypeManager.MethodFlags): Don't take a
2938         `Location' argument, we don't need it anywhere.  Use
2939         `IMethodData.ShouldIgnore ()' instead of
2940         `MethodData.GetMethodFlags ()'.
2941         (TypeManager.AddMethod): Removed.
2942         (TypeManager.AddMethod2): Renamed to AddMethod.
2943
2944 2004-05-29  Martin Baulig  <martin@ximian.com>
2945
2946         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
2947
2948         * convert.cs (Convert.ImplicitReferenceConversion): If we're
2949         converting from a class type S to an interface type and we already
2950         have an object on the stack, don't box it again.  Fixes #52578.
2951
2952 2004-05-29  Martin Baulig  <martin@ximian.com>
2953
2954         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
2955         Added support for `params' parameters.  Fixes #59267.
2956
2957 2004-05-29  Martin Baulig  <martin@ximian.com>
2958
2959         * literal.cs (NullPointer): Provide a private .ctor which sets
2960         `type' to TypeManager.object_type.  Fixes #59048.
2961
2962 2004-05-29  Martin Baulig  <martin@ximian.com>
2963
2964         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
2965         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
2966
2967         * ecore.cs (EventExpr.instance_expr): Make the field private.
2968
2969 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
2970
2971         Fixed bug #50080 & cs0214-2.cs
2972         * expression.cs (Cast.DoResolve): Check unsafe context here.
2973         
2974         * statement.cs (Resolve.DoResolve): Likewise.
2975
2976 2004-05-26  Martin Baulig  <martin@ximian.com>
2977
2978         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
2979
2980         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
2981         (RootContext.LookupType): Pass down the `silent' flag.
2982
2983 2004-05-25  Martin Baulig  <martin@ximian.com>
2984
2985         * expression.cs
2986         (MethodGroupExpr.IdenticalTypeName): New public property.
2987         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
2988         expression actually refers to a type.
2989
2990 2004-05-25  Martin Baulig  <martin@ximian.com>
2991
2992         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
2993         for #56176 and made it actually work.
2994
2995 2004-05-25  Martin Baulig  <martin@ximian.com>
2996
2997         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
2998         (FieldExpr, PropertyExpr): Override and implement
2999         CacheTemporaries.  Fixes #52279.
3000
3001 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
3002
3003         * location.cs: In the new compiler listing a file twice is a
3004         warning, not an error.
3005
3006 2004-05-24  Martin Baulig  <martin@ximian.com>
3007
3008         * enum.cs (Enum.DefineType): For the `BaseType' to be a
3009         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
3010
3011 2004-05-24  Martin Baulig  <martin@ximian.com>
3012
3013         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
3014         walking the `using' list.  Fixes #53921.
3015
3016 2004-05-24  Martin Baulig  <martin@ximian.com>
3017
3018         * const.cs (Const.LookupConstantValue): Added support for
3019         EmptyCast's; fixes #55251.
3020
3021 2004-05-24  Martin Baulig  <martin@ximian.com>
3022
3023         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
3024         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
3025         which does the CS0135 check.  The reason is that we first need to
3026         check whether the variable actually exists.
3027
3028 2004-05-24  Martin Baulig  <martin@ximian.com>
3029
3030         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
3031         than RootContext.LookupType() to find the explicit interface
3032         type.  Fixes #58584.
3033
3034 2004-05-24  Raja R Harinath  <rharinath@novell.com>
3035
3036         * Makefile: Simplify.  Use executable.make.
3037         * mcs.exe.sources: New file.  List of sources of mcs.exe.
3038
3039 2004-05-24  Anders Carlsson  <andersca@gnome.org>
3040
3041         * decl.cs:
3042         * enum.cs:
3043         Use the invariant culture when doing String.Compare for CLS case
3044         sensitivity.
3045         
3046 2004-05-23  Martin Baulig  <martin@ximian.com>
3047
3048         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
3049         don't have any dots.  Fixes #52622, added cs0246-8.cs.
3050
3051         * namespace.cs (NamespaceEntry.Lookup): Likewise.
3052
3053 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3054
3055         * class.cs (MemberBase.Define): Reuse MemberType member for 
3056         resolved type. Other methods can use it too.
3057
3058 2004-05-23  Martin Baulig  <martin@ximian.com>
3059
3060         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
3061         the variable also exists in the current block (otherwise, we need
3062         to report a CS0103).  Fixes #58670.
3063
3064 2004-05-23  Martin Baulig  <martin@ximian.com>
3065
3066         * flowanalysis.cs (Reachability.Reachable): Compute this
3067         on-the-fly rather than storing it as a field.
3068
3069 2004-05-23  Martin Baulig  <martin@ximian.com>
3070
3071         * flowanalysis.cs (Reachability.And): Manually compute the
3072         resulting `barrier' from the reachability.      
3073        
3074 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3075
3076         Fix bug #57835
3077         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
3078         instance of ObsoleteAttribute when symbol is obsolete.
3079
3080         * class.cs
3081         (IMethodData): Extended interface for ObsoleteAttribute support.
3082
3083 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3084
3085         * attribute.cs: Fix bug #55970
3086
3087 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3088
3089         Fix bug #52705
3090         * attribute.cs
3091         (GetObsoleteAttribute): New method. Creates the instance of
3092         ObsoleteAttribute.
3093         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
3094         ObsoleteAttribute when member is obsolete.
3095         (AttributeTester.Report_ObsoleteMessage): Common method for
3096         Obsolete error/warning reporting.
3097
3098         * class.cs
3099         (TypeContainer.base_classs_type): New member for storing parent type.
3100
3101         * decl.cs
3102         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
3103         for this MemberCore.
3104
3105 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3106
3107         * attribute.cs, const.cs: Fix bug #58590
3108
3109 2004-05-21  Martin Baulig  <martin@ximian.com>
3110
3111         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
3112         out parameters if the end of the method is unreachable.  Fixes
3113         #58098. 
3114
3115 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3116
3117         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
3118         Hari was right, why extra method.
3119
3120 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3121
3122         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
3123
3124 2004-05-20  Martin Baulig  <martin@ximian.com>
3125
3126         * delegate.cs: Convert this file to Unix mode - like the original
3127         version in mcs is.
3128
3129 2004-05-20  Martin Baulig  <martin@ximian.com>
3130
3131         * attribute.cs: Convert this file to Unix mode - like the original
3132         version in mcs is.
3133
3134 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
3135
3136        Fix bug #58688 (MCS does not report error when the same attribute
3137        is assigned twice)
3138
3139        * attribute.cs (Attribute.Emit): Distinction between null and default.
3140
3141 2004-05-19  Raja R Harinath  <rharinath@novell.com>
3142
3143        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
3144        of a top-level attribute without an attribute target.
3145        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
3146        Make non-static.
3147        (Attribute.Conditional_GetConditionName), 
3148        (Attribute.Obsolete_GetObsoleteMessage): Update.
3149        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
3150        part of ScanForIndexerName.
3151        (Attribute.CanIgnoreInvalidAttribute): New function.
3152        (Attribute.ScanForIndexerName): Move to ...
3153        (Attributes.ScanForIndexerName): ... here.
3154        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
3155        (Attributes.Search): New internal variant that can choose not to
3156        complain if types aren't resolved.  The original signature now
3157        complains.
3158        (Attributes.GetClsCompliantAttribute): Use internal variant, with
3159        complaints suppressed.
3160        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
3161        only if it not useful.
3162        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
3163        top-level for attributes that are shared between the assembly
3164        and a top-level class.
3165        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
3166        * class.cs: Update to reflect changes.
3167        (DefineIndexers): Fuse loops.
3168        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
3169        a couple more variants of attribute names.
3170
3171 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
3172
3173         Fix bug #52585 (Implemented explicit attribute declaration)
3174
3175         * attribute.cs:
3176         (Attributable.ValidAttributeTargets): New abstract method. It gets
3177         list of valid attribute targets for explicit target declaration.
3178         (Attribute.Target): It holds target itself.
3179         (AttributeSection): Removed.
3180         (Attribute.CheckTargets): New method. It checks whether attribute
3181         target is valid for the current element.
3182
3183         * class.cs:
3184         (EventProperty): New class. For events that are declared like
3185         property (with add and remove accessors).
3186         (EventField): New class. For events that are declared like field.
3187         class.cs
3188
3189         * cs-parser.jay: Implemented explicit attribute target declaration.
3190
3191         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
3192         Override ValidAttributeTargets.
3193
3194         * parameter.cs:
3195         (ReturnParameter): Class for applying custom attributes on 
3196         the return type.
3197         (ParameterAtribute): New class. Class for applying custom
3198         attributes on the parameter type.
3199
3200 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
3201
3202         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
3203         definitions. 
3204
3205         (Method): Allow UNSAFE here.
3206
3207         * modifiers.cs: Support unsafe reporting.
3208
3209 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
3210
3211         * decl.cs: Fix bug #58478.
3212
3213 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3214
3215         * statement.cs: When checking for unreachable code on an EmptyStatement,
3216         set the location. Fixes bug #58488.
3217
3218 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
3219
3220         * driver.cs: Add -pkg handling.
3221
3222         From Gonzalo: UseShelLExecute=false
3223
3224 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
3225
3226         * attribute.cs:
3227         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
3228         for attribute.
3229         (Attribute.IsClsCompliaceRequired): Moved to base for better
3230         accesibility.
3231         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
3232         when attribute is AttributeUsageAttribute.
3233         (Attribute.GetValidTargets): Simplified.
3234         (Attribute.GetAttributeUsage): New method returns AttributeUsage
3235         attribute for this type.
3236         (Attribute.ApplyAttributes): Method renamed to Emit and make
3237         non-static.
3238         (GlobalAttributeSection): New class for special handling of global
3239         attributes (assembly, module).
3240         (AttributeSection.Emit): New method.
3241
3242         * class.cs: Implemented Attributable abstract methods.
3243         (MethodCore.LabelParameters): Moved to Parameter class.
3244         (Accessor): Is back simple class.
3245         (PropertyMethod): Implemented Attributable abstract class.
3246         (DelegateMethod): Implemented Attributable abstract class.
3247         (Event): New constructor for disctintion between normal Event
3248         and Event with accessors.
3249
3250         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
3251
3252         * codegen.cs, const.cs, decl.cs, delegate.cs:
3253         (CommonAssemblyModulClass): Implemented Attributable abstract class
3254         and simplified.
3255
3256         * enum.cs: Implement IAttributeSupport interface.
3257         (EnumMember): New class for emum members. Implemented Attributable
3258         abstract class
3259
3260         * parameter.cs:
3261         (ParameterBase): Is abstract.
3262         (ReturnParameter): New class for easier [return:] attribute handling.
3263
3264         * typemanager.cs: Removed builder_to_attr.
3265
3266 2004-05-11  Raja R Harinath  <rharinath@novell.com>
3267
3268         Fix bug #57151.
3269         * attribute.cs (Attribute.GetPositionalValue): New function.
3270         * class.cs (TypeContainer.VerifyMembers): New function.
3271         (TypeContainer.Emit): Use it.
3272         (ClassOrStruct): New base class for Class and Struct.
3273         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
3274         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
3275         class.
3276         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
3277         then each non-static field should have a FieldOffset attribute.
3278         Otherwise, none of the fields should have a FieldOffset attribute.
3279         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
3280         and FieldOffset attributes.
3281         * typemanager.cs (TypeManager.struct_layout_attribute_type)
3282         (TypeManager.field_offset_attribute_type): New core types.
3283         (TypeManager.InitCoreTypes): Initialize them.
3284
3285 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
3286
3287         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
3288         Return correct type.
3289         From bug #58270.
3290
3291 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
3292
3293         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
3294         be implicitly converted to ulong.
3295         
3296         * expression.cs: The logic for allowing operator &, | and ^ worked
3297         was wrong, it worked before because we did not report an error in
3298         an else branch.  Fixes 57895.
3299
3300         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
3301         allow volatile fields to be reference types.
3302
3303 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
3304
3305         * driver.cs: Add support for /debug-
3306
3307 2004-05-07  Raja R Harinath  <rharinath@novell.com>
3308
3309         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
3310         Add a 'complain' parameter to silence errors.
3311         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
3312         silently overlooked type-resolutions.
3313         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
3314         to reflect changes.
3315         (Attributes.Search): New function.
3316         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
3317         (Attributes.GetAttributeFullName): Remove hack.
3318         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
3319         Update to reflect changes.
3320         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3321         Use Attributes.Search instead of nested loops.
3322
3323 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
3324
3325         * decl.cs:
3326         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
3327         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
3328         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
3329
3330         * report.cs: (Report.Warning): Renamed to Warning_T because of
3331         parameter collision.
3332
3333 2004-05-05  Raja R Harinath  <rharinath@novell.com>
3334
3335         * expression.cs (MemberAccess.ResolveMemberAccess):
3336         Exit with non-zero status after Report.Error.
3337         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
3338         Likewise.
3339         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
3340
3341 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
3342
3343         * support.cs: Don't hang when the file is empty.
3344
3345 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
3346
3347         * support.cs: In SeekableStreamReader, compute the preamble size of the
3348           underlying stream. Position changes should take into account that initial
3349           count of bytes.
3350
3351 2004-05-03  Todd Berman  <tberman@sevenl.net>
3352
3353         * driver.cs: remove unused GetSysVersion function.
3354
3355 2004-05-03  Todd Berman  <tberman@sevenl.net>
3356
3357         * driver.cs: Remove the hack from saturday, as well as the hack
3358         from jackson (LoadAssemblyFromGac), also adds the CWD to the
3359         link_paths to get that bit proper.
3360
3361 2004-05-01  Todd Berman  <tberman@sevenl.net>
3362
3363         * driver.cs: Try a LoadFrom before a Load, this checks the current
3364         path. This is currently a bug in mono that is be fixed, however, this
3365         provides a workaround for now. This will be removed when the bug
3366         is fixed.
3367
3368 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
3369
3370         * CryptoConvert.cs: Updated to latest version. Fix issue with 
3371         incomplete key pairs (#57941).
3372
3373 2004-05-01  Todd Berman  <tberman@sevenl.net>
3374
3375         * driver.cs: Remove '.' from path_chars, now System.* loads properly
3376         from the GAC
3377
3378 2004-04-30  Jackson Harper  <jackson@ximian.com>
3379
3380         * codegen.cs: Open keys readonly.
3381         
3382 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3383
3384         * typemanager.cs: don't report cyclic struct layout when a struct
3385         contains 2 or more fields of the same type. Failed for Pango.AttrShape
3386         which has 2 Pango.Rectangle fields.
3387
3388 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3389
3390         * expression.cs: Handle IntPtr comparisons with IL code
3391         rather than a method call.
3392
3393 2004-04-29  Martin Baulig  <martin@ximian.com>
3394
3395         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
3396         the list of PropertyInfo's in class hierarchy and find the
3397         accessor.  Fixes #56013.
3398
3399 2004-04-29  Martin Baulig  <martin@ximian.com>
3400
3401         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
3402
3403 2004-04-29  Martin Baulig  <martin@ximian.com>
3404
3405         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
3406
3407         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
3408
3409 2004-04-29  Martin Baulig  <martin@ximian.com>
3410
3411         * class.cs (ConstructorInitializer.Resolve): Check whether the
3412         parent .ctor is accessible.  Fixes #52146.
3413
3414 2004-04-29  Martin Baulig  <martin@ximian.com>
3415
3416         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
3417
3418         * statement.cs (Using.EmitLocalVariableDecls): Use
3419         TypeManager.idisposable_type, not typeof (IDisposable).
3420         (Foreach.EmitCollectionForeach): Added support for valuetypes.
3421
3422 2004-04-29  Martin Baulig  <martin@ximian.com>
3423
3424         * class.cs (Event.Define): Don't emit the field and don't set
3425         RTSpecialName and SpecialName for events on interfaces.  Fixes
3426         #57703. 
3427
3428 2004-04-29  Raja R Harinath  <rharinath@novell.com>
3429
3430         Refactor Attribute.ApplyAttributes.
3431         * attribute.cs (Attributable): New base class for objects that can
3432         have Attributes applied on them.
3433         (Attribute): Make AttributeUsage fields public.
3434         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
3435         (Attribute.IsInternalCall): New property.
3436         (Attribute.UsageAttr): Convert to a public read-only property.
3437         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
3438         (Attribute.ResolveType, Attribute.Resolve)
3439         (Attribute.ScanForIndexerName): Update to reflect changes.
3440         (Attribute.CheckAttributeTarget): Re-format.
3441         (Attribute.ApplyAttributes): Refactor, to various
3442         Attributable.ApplyAttributeBuilder methods.
3443         * decl.cs (MemberCore): Make Attributable.
3444         * class.cs (Accessor): Make Attributable.
3445         (MethodData.ApplyAttributes): Use proper attribute types, not
3446         attribute names.
3447         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
3448         (TypeContainer.ApplyAttributeBuilder)
3449         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
3450         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
3451         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
3452         (Operator.ApplyAttributeBuilder): New factored-out methods.
3453         * const.cs (Const.ApplyAttributeBuilder): Likewise.
3454         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
3455         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
3456         * parameter.cs (ParameterBase): New Attributable base class
3457         that can also represent Return types.
3458         (Parameter): Update to the changes.
3459
3460 2004-04-29  Jackson Harper  <jackson@ximian.com>
3461
3462         * driver.cs: Prefer the corlib system version when looking for
3463         assemblies in the GAC. This is still a hack, but its a better hack
3464         now.
3465         
3466 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
3467
3468         * decl.cs, enum.cs: Improved error 3005 reporting.
3469   
3470         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
3471         (related_symbols): New private member for list of symbols
3472         related to reported error/warning.
3473         
3474         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
3475
3476 2004-04-29  Martin Baulig  <martin@ximian.com>
3477
3478         * ecore.cs (Expression.Constantify): If we're an enum and
3479         TypeManager.TypeToCoreType() doesn't give us another type, use
3480         t.UnderlyingSystemType.  Fixes #56178.  
3481
3482 2004-04-29  Martin Baulig  <martin@ximian.com>
3483
3484         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
3485         interfaces and for each interface, only add members directly
3486         declared in that interface.  Fixes #53255.
3487
3488 2004-04-28  Martin Baulig  <martin@ximian.com>
3489
3490         * expression.cs (ConditionalLogicalOperator): Use a temporary
3491         variable for `left' to avoid that we evaluate it more than once;
3492         bug #52588.
3493
3494 2004-04-28  Martin Baulig  <martin@ximian.com>
3495
3496         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
3497         `void[]' (CS1547).
3498
3499 2004-04-28  Martin Baulig  <martin@ximian.com>
3500
3501         * statement.cs (LocalInfo.Resolve): Check whether the type is not
3502         void (CS1547).
3503
3504         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
3505         whether the type is not void (CS1547).
3506
3507 2004-04-28  Martin Baulig  <martin@ximian.com>
3508
3509         * expression.cs (Unary.DoResolveLValue): Override this and report
3510         CS0131 for anything but Operator.Indirection.
3511
3512 2004-04-28  Martin Baulig  <martin@ximian.com>
3513
3514         Committing a patch from Ben Maurer; see bug #50820.
3515
3516         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
3517         check for classes.
3518
3519         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
3520         classes.        
3521
3522 2004-04-28  Martin Baulig  <martin@ximian.com>
3523
3524         Committing a patch from Ben Maurer; see bug #50820.
3525
3526         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
3527         check for classes.
3528
3529         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
3530         classes.        
3531
3532 2004-04-28  Martin Baulig  <martin@ximian.com>
3533
3534         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
3535         (Block.AddLabel): Call DoLookupLabel() to only search in the
3536         current block.
3537
3538 2004-04-28  Martin Baulig  <martin@ximian.com>
3539
3540         * cfold.cs (ConstantFold.BinaryFold): Added special support for
3541         comparing StringConstants and NullLiterals in Equality and Inequality.
3542
3543 2004-04-28  Jackson Harper  <jackson@ximian.com>
3544
3545         * driver.cs: Attempt to load referenced assemblies from the
3546         GAC. This is the quick and dirty version of this method that
3547         doesnt take into account versions and just takes the first
3548         canidate found. Will be good enough for now as we will not have more
3549         then one version installed into the GAC until I update this method.
3550
3551 2004-04-28  Martin Baulig  <martin@ximian.com>
3552
3553         * typemanager.cs (TypeManager.CheckStructCycles): New public
3554         static method to check for cycles in the struct layout.
3555
3556         * rootcontext.cs (RootContext.PopulateTypes): Call
3557         TypeManager.CheckStructCycles() for each TypeContainer.
3558         [Note: We only need to visit each type once.]
3559
3560 2004-04-28  Martin Baulig  <martin@ximian.com>
3561
3562         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
3563
3564         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
3565         success and added `out object value'.  Use a `bool resolved' field
3566         to check whether we've already been called rather than
3567         `ConstantValue != null' since this breaks for NullLiterals.
3568
3569 2004-04-28  Raja R Harinath  <rharinath@novell.com>
3570
3571         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
3572         setting of this flag, since the 'set' method may be non-public.
3573
3574 2004-04-28  Raja R Harinath  <rharinath@novell.com>
3575
3576         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
3577         check on current_vector.Block.
3578
3579 2004-04-27  Martin Baulig  <martin@ximian.com>
3580
3581         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
3582         a field initializer.  Fixes #56459.
3583
3584 2004-04-27  Martin Baulig  <martin@ximian.com>
3585
3586         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
3587         we're not attempting to use an indexer.  Fixes #52154.
3588
3589 2004-04-27  Martin Baulig  <martin@ximian.com>
3590
3591         * statement.cs (Return): Don't create a return label if we don't
3592         need it; reverts my change from January 20th.  Thanks to Ben
3593         Maurer for this.
3594
3595 2004-04-27  Martin Baulig  <martin@ximian.com>
3596
3597         According to the spec, `goto' can only leave a nested scope, but
3598         never enter it.
3599
3600         * statement.cs (Block.LookupLabel): Only lookup in the current
3601         block, don't recurse into parent or child blocks.
3602         (Block.AddLabel): Check in parent and child blocks, report
3603         CS0140/CS0158 if we find a duplicate.
3604         (Block): Removed this indexer for label lookups.
3605         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
3606         this already does the error reporting for us.
3607
3608         * flowanalysis.cs
3609         (FlowBranching.UsageVector.Block): New public variable; may be null.
3610         (FlowBranching.CreateSibling): Added `Block' argument.
3611         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
3612         label for the target of a `goto' and check whether we're not
3613         leaving a `finally'.
3614
3615 2004-04-27  Martin Baulig  <martin@ximian.com>
3616
3617         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3618         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
3619         just for returns).
3620
3621 2004-04-27  Martin Baulig  <martin@ximian.com>
3622
3623         * statement.cs (Block.AddLabel): Also check for implicit blocks
3624         and added a CS0158 check.
3625
3626 2004-04-27  Martin Baulig  <martin@ximian.com>
3627
3628         * flowanalysis.cs (FlowBranchingLoop): New class.
3629         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
3630         UsageVector's instead of an ArrayList.
3631         (FlowBranching.Label): Likewise.
3632         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
3633         (FlowBranching.AddBreakVector): New method.
3634
3635 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
3636
3637         * attribute.cs: Small regression fix: only convert the type if we
3638         the type is different, fixes System.Drawing build.
3639
3640 2004-04-27  Martin Baulig  <martin@ximian.com>
3641
3642         * attribute.cs (Attribute.Resolve): If we have a constant value
3643         for a named field or property, implicity convert it to the correct
3644         type.
3645
3646 2004-04-27  Raja R Harinath  <rharinath@novell.com>
3647
3648         * statement.cs (Block.Block): Implicit blocks share
3649         'child_variable_names' fields with parent blocks.
3650         (Block.AddChildVariableNames): Remove.
3651         (Block.AddVariable): Mark variable as "used by a child block" in
3652         every surrounding block.
3653         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
3654         been used in a child block, complain about violation of "Invariant
3655         meaning in blocks" rule.
3656         * cs-parser.jay (declare_local_variables): Don't use
3657         AddChildVariableNames.
3658         (foreach_statement): Don't create an implicit block: 'foreach'
3659         introduces a scope.
3660
3661 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
3662
3663         * convert.cs (ImplicitNumericConversion): 0 is also positive when
3664         converting from 0L to ulong.  Fixes 57522.
3665
3666 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
3667
3668         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
3669         derived class hides via 'new' keyword field from base class (test-242.cs).
3670         TODO: Handle this in the more general way.
3671         
3672         * class.cs (CheckBase): Ditto.
3673
3674 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
3675
3676         * decl.cs (caching_flags): New member for storing cached values
3677         as bit flags.
3678         (MemberCore.Flags): New enum where bit flags for caching_flags
3679         are defined.
3680         (MemberCore.cls_compliance): Moved to caching_flags.
3681         (DeclSpace.Created): Moved to caching_flags.
3682
3683         * class.cs: Use caching_flags instead of DeclSpace.Created
3684         
3685 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
3686
3687         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
3688         if we are only a derived class, not a nested class.
3689
3690         * typemanager.cs: Same as above, but do this at the MemberLookup
3691         level (used by field and methods, properties are handled in
3692         PropertyExpr).   Allow for the qualified access if we are a nested
3693         method. 
3694
3695 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
3696
3697         * class.cs: Refactoring.
3698         (IMethodData): New inteface; Holds links to parent members
3699         to avoid member duplication (reduced memory allocation).
3700         (Method): Implemented IMethodData interface.
3701         (PropertyBase): New inner classes for get/set methods.
3702         (PropertyBase.PropertyMethod): Implemented IMethodData interface
3703         (Event): New inner classes for add/remove methods.
3704         (Event.DelegateMethod): Implemented IMethodData interface.
3705
3706         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
3707         EmitContext (related to class.cs refactoring).
3708
3709 2004-04-21  Raja R Harinath  <rharinath@novell.com>
3710
3711         * delegate.cs (Delegate.VerifyApplicability): If the number of
3712         arguments are the same as the number of parameters, first try to
3713         verify applicability ignoring  any 'params' modifier on the last
3714         parameter.
3715         Fixes #56442.
3716
3717 2004-04-08  Martin Baulig  <martin@ximian.com>
3718
3719         Merged latest changes into gmcs.  Please keep this comment in
3720         here, it makes it easier for me to see what changed in MCS since
3721         the last time I merged.
3722
3723 2004-04-16  Raja R Harinath  <rharinath@novell.com>
3724
3725         * class.cs (TypeContainer.AddIndexer): Use
3726         'ExplicitInterfaceName' to determine if interface name was
3727         explicitly specified.  'InterfaceType' is not initialized at this time.
3728         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
3729         Indexers array is already in the required order.  Initialize
3730         'IndexerName' only if there are normal indexers.
3731         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
3732         (TypeContainer.Emit): Emit DefaultMember attribute only if
3733         IndexerName is initialized.
3734         Fixes #56300.
3735
3736 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
3737
3738         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
3739         Fixes #57007
3740
3741 2004-04-15  Raja R Harinath  <rharinath@novell.com>
3742
3743         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
3744         attributes.
3745         Fix for #56456.
3746
3747         * attribute.cs (Attribute.Resolve): Check for duplicate named
3748         attributes.
3749         Fix for #56463.
3750
3751 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
3752
3753         * iterators.cs (MarkYield): track whether we are in an exception,
3754         and generate code accordingly.  Use a temporary value to store the
3755         result for our state.
3756
3757         I had ignored a bit the interaction of try/catch with iterators
3758         since their behavior was not entirely obvious, but now it is
3759         possible to verify that our behavior is the same as MS .NET 2.0
3760
3761         Fixes 54814
3762
3763 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
3764
3765         * iterators.cs: Avoid creating temporaries if there is no work to
3766         do. 
3767
3768         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
3769         Enumerations, use TypeManager.EnumToUnderlying and call
3770         recursively. 
3771
3772         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
3773         bug #57013
3774
3775         (This.Emit): Use EmitContext.EmitThis to emit our
3776         instance variable.
3777
3778         (This.EmitAssign): Ditto.
3779
3780         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
3781         codepaths, we will move all the functionality into
3782         Mono.CSharp.This 
3783
3784         (FieldExpr.EmitAssign): Ditto.
3785
3786         This fixes several hidden bugs that I uncovered while doing a code
3787         review of this today.
3788
3789         * codegen.cs (EmitThis): reworked so the semantics are more clear
3790         and also support value types "this" instances.
3791
3792         * iterators.cs: Changed so that for iterators in value types, we
3793         do not pass the value type as a parameter.  
3794
3795         Initialization of the enumerator helpers is now done in the caller
3796         instead of passing the parameters to the constructors and having
3797         the constructor set the fields.
3798
3799         The fields have now `assembly' visibility instead of private.
3800
3801 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
3802
3803         * expression.cs (Argument.Resolve): Check if fields passed as ref
3804         or out are contained in a MarshalByRefObject.
3805
3806         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
3807         another compiler type.
3808
3809 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3810
3811         * class.cs (Indexer.Define): use the new name checking method.
3812         Also, return false on an error.
3813         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
3814         (is_identifier_[start/part]_character): make static.
3815
3816 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
3817
3818         * expression.cs (Binary.ResolveOperator): Do no append strings
3819         twice: since we can be invoked more than once (array evaluation)
3820         on the same concatenation, take care of this here.  Based on a fix
3821         from Ben (bug #56454)
3822
3823 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
3824
3825         * codegen.cs: Fix another case where CS1548 must be reported (when 
3826         delay-sign isn't specified and no private is available #56564). Fix
3827         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
3828         error when MCS is used on the MS runtime and we need to delay-sign 
3829         (which seems unsupported by AssemblyBuilder - see #56621).
3830
3831 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
3832
3833         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
3834         (TypeManager.ComputeNamespaces): Faster implementation for
3835         Microsoft runtime.
3836
3837         * compiler.csproj: Updated AssemblyName to mcs.
3838
3839 2004-05-11  Jackson Harper  <jackson@ximian.com>
3840
3841         * Makefile: Preserve MONO_PATH
3842         
3843 2004-05-11  Jackson Harper  <jackson@ximian.com>
3844
3845         * Makefile: Use mono and mcs to build gmcs
3846         
3847 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
3848
3849         * codegen.cs: Add patch from Robert Shade
3850         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
3851         sync with mcs.
3852
3853 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
3854
3855         * CryptoConvert.cs: Updated to latest version. Fix issue with 
3856         incomplete key pairs (#57941).
3857
3858 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
3859
3860         * codegen.cs: Fix another case where CS1548 must be reported (when 
3861         delay-sign isn't specified and no private is available #56564). Fix
3862         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
3863         error when MCS is used on the MS runtime and we need to delay-sign 
3864         (which seems unsupported by AssemblyBuilder - see #56621).
3865
3866 2004-04-29  Jackson Harper  <jackson@ximian.com>
3867
3868         * Makefile: Set MONO_PATH to use the bootstrap corlib
3869         * driver.cs: Check the GAC for referenced assemblies.
3870                 
3871 2004-04-29  Martin Baulig  <martin@ximian.com>
3872
3873         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
3874
3875 2004-04-07  Martin Baulig  <martin@ximian.com>
3876
3877         * expression.cs (Binary.ResolveOperator): Added special case for
3878         Equality/Inequality between a type parameter and a null literal.
3879
3880 2004-04-07  Martin Baulig  <martin@ximian.com>
3881
3882         * convert.cs: Check null literal -> type parameter conversions.
3883
3884 2004-04-07  Martin Baulig  <martin@ximian.com>
3885
3886         * generic.cs (ConstructedType.CheckConstraints): Enforce the
3887         `class' and `struct' constraints.
3888
3889 2004-04-07  Martin Baulig  <martin@ximian.com>
3890
3891         * generic.cs (SpecialConstraint): New public enum.
3892         (Constraints.Resolve): Added support for the `class' and `struct'
3893         constraints.
3894
3895         * cs-parser.jay (type_parameter_constraint): Added support for the
3896         `class' and `struct' constraints.
3897
3898 2004-04-07  Martin Baulig  <martin@ximian.com>
3899
3900         * support.cs (GenericConstraints): Replaced `Types' by
3901         `ClassConstraint' and `InterfaceConstraints'; added
3902         `HasClassConstraint'.   
3903
3904 2004-04-07  Martin Baulig  <martin@ximian.com>
3905
3906         * generic.cs
3907         (Constraints.InterfaceConstraints): New public property.
3908         (Constraints.Types): Make this property public
3909         (TypeParameter): Implement IMemberContainer.
3910         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
3911         instead of a TypeBuilder/MethodBuilder; pass the interface
3912         constraints to TypeManager.AddTypeParameter().
3913         (TypeParameter.DefineType): Just take an EmitContext and no
3914         TypeBuilder/MethodBuilder.  Use the new public API.
3915
3916         * typemanager.cs (TypeManager.AddTypeParameter): Added
3917         `TypeExpr[]' argument; add the interfaces to the
3918         `builder_to_ifaces' hash.
3919         (TypeManager.LookupMemberContainer): For
3920         GenericTypeParameterBuilders, get the TypeParameter from the
3921         `builder_to_type_param'.
3922         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
3923         the TypeParameter and call FindMembers on it.
3924
3925 2004-04-07  Martin Baulig  <martin@ximian.com>
3926
3927         * class.cs
3928         (MethodCore.GenericMethod): Moved this field here from Method.
3929         (MethodCore.IsDuplicateImplementation): Take the number of type
3930         parameters into account if we're a generic method.
3931
3932         * expression.cs (Invocation.InferTypeArguments): Don't return true
3933         if `arguments' is null; we still need to check whether we actually
3934         don't need to infer anything in this case.
3935         (MemberAccess): Merged the functionality from GenericMemberAccess
3936         into this class.
3937
3938         * generic.cs (GenericMemberAccess): Removed.
3939
3940 2004-04-05  Martin Baulig  <martin@ximian.com>
3941
3942         * decl.cs (MemberCore): For generic classes, interfaces and
3943         structs, `Name' now includes the number of type parameters
3944         ("Stack!1.Node!1").
3945         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
3946         encode the number of type arguments in the type name.
3947
3948         * expression.cs (Expression.MemberLookup): Removed the
3949         `num_type_args' argument; we now encode the number of type
3950         arguments in the type name.
3951
3952         * ecore.cs (SimpleName): Encode the number of type arguments in
3953         the type name itself.
3954
3955         * generic.cs (ConstructedType): Likewise.
3956
3957         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
3958         `MemberName'; we now include the number of type parameters in the
3959         type name.
3960
3961         * typemanager.cs (TypeManager.CheckGeneric): Removed.
3962         (TypeManager.MemberLookup): Removed the
3963         `num_type_args' argument; we now encode the number of type
3964         arguments in the type name.     
3965
3966 2004-04-03  Martin Baulig  <martin@ximian.com>
3967
3968         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
3969         (MemberCore.MemberName): Moved here from MemberBase.
3970         (DeclSpace.SetParameterInfo): Just take the constraints as an
3971         ArrayList; we already have the type parameters in our
3972         `MemberName'; also do the CS0080 reporting here.
3973
3974         * cs-parser.jay (struct_declaration): Use `member_name' instead of
3975         `IDENTIFIER opt_type_parameter_list'; when constructing our
3976         `MemberName', it'll already include our type parameters.
3977         (class_declaration, interface_declaration): Likewise.
3978         (delegate_declaration): Likewise.
3979         (MakeName): Take a MemberName and return a MemberName.
3980         The following two changes are required to avoid shift/reduce conflicts:
3981         (member_name): Don't include a TypeName anymore; ie. this is now
3982         just 'IDENTIFIER opt_type_parameter_list'.
3983         (property_declaration, event_declaration): Use a
3984         `namespace_or_type_name' instead of a `member_name'.            
3985
3986 2004-04-03  Martin Baulig  <martin@ximian.com>
3987
3988         * decl.cs (MemberName): Renamed to `TypeName' and created a new
3989         `MemberName' class.
3990         (TypeName): Formerly known as MemberName.
3991
3992         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
3993         instead of a `MemberName'.
3994
3995         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
3996         (member_name): New rule; create a MemberName.
3997
3998 2004-04-02  Martin Baulig  <martin@ximian.com>
3999
4000         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
4001         (CS0305 and CS0308).
4002
4003 2004-04-02  Martin Baulig  <martin@ximian.com>
4004
4005         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
4006         support for nested types.
4007
4008 2004-04-02  Martin Baulig  <martin@ximian.com>
4009
4010         * ecore.cs (IAlias): New public interface.
4011         (TypeExpr, TypeExpression): Implement IAlias.
4012         (TypeAliasExpression): New public class.
4013
4014         * namespace.cs (Namespace): Implement IAlias.
4015         (Namespace.Lookup): Return an IAlias instead on an object.
4016         (Namespace.DefineName): Take an IAlias instead of an object.
4017         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
4018         an object.
4019         (NamespaceEntry.UsingAlias): Take a Membername instead of an
4020         Expression.
4021         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
4022         object.
4023         (NamespaceEntry.Lookup): Likewise.
4024
4025         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
4026         instead of a Type.      
4027
4028         * decl.cs (DeclSpace): Implement IAlias.
4029         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
4030
4031         * generic.cs (ConstructedType): Improved error checking.
4032
4033 2004-04-02  Martin Baulig  <martin@ximian.com>
4034
4035         * convert.cs: Added type parameter conversions.
4036
4037         * ecore.cs
4038         (UnboxCast.Emit): Emit an `unbox.any' for type params.
4039         (ClassCast.Emit): If the source type is a type parameter, box it.
4040         If the target type is a type parameter, emit an `unbox.any'
4041         instead of a `classcast'.1      
4042
4043 2004-04-01  Martin Baulig  <martin@ximian.com>
4044
4045         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
4046
4047 2004-04-01  Martin Baulig  <martin@ximian.com>
4048
4049         * generic.cs (ConstructedType.CheckConstraints): Use
4050         Convert.ImplicitStandardConversionExists(); user-defined implicit
4051         conversions are not allowed according to the spec.
4052
4053 2004-03-30  Martin Baulig  <martin@ximian.com>
4054
4055         * expression.cs (New): Added support for type parameters.
4056
4057         * typemanager.cs
4058         (TypeManager.activator_type): New public static field.
4059         (TypeManager.activator_create_instance): Likewise.
4060
4061 2004-03-30  Martin Baulig  <martin@ximian.com>
4062
4063         * typemanager.cs (TypeManager.HasConstructorConstraint): New
4064         public method.
4065
4066 2004-03-30  Martin Baulig  <martin@ximian.com>
4067
4068         * generic.cs (ConstructedType.CheckConstraints): Actually follow
4069         the spec here: the argument type must be convertible to the
4070         constraints.
4071
4072 2004-03-30  Martin Baulig  <martin@ximian.com>
4073
4074         * generic.cs
4075         (TypeParameter.Define, TypeParameter.DefineMethod): Call
4076         TypeManager.AddTypeParameter().
4077         (ConstructedType.CheckConstraints): Re-enable this and actually
4078         check whether we have a constructor constraint.
4079
4080         * typemanager.cs
4081         (TypeManager.builder_to_type_param): New static field.
4082         (TypeManager.AddTypeParameter): New static method.
4083         (TypeManager.LookupTypeParameter): New public method.
4084
4085 2004-03-30  Martin Baulig  <martin@ximian.com>
4086
4087         * generic.cs (TypeParameter.DefineType): Return a boolean and use
4088         the new API to actually define the constructor constraint.
4089
4090         * typemanager.cs
4091         (TypeManager.new_constraint_attr_type): New static field.
4092         (TypeManager.InitCoreTypes): Initialize it.
4093
4094 2004-03-30  Martin Baulig  <martin@ximian.com>
4095
4096         * generic.cs (Constraints): Completed error checking, use correct
4097         error numbers.
4098
4099 2004-03-29  Martin Baulig  <martin@ximian.com>
4100
4101         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
4102
4103         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4104         public version which takes a `ParameterData pd' instead of an
4105         `ArrayList args'.
4106
4107 2004-03-29  Martin Baulig  <martin@ximian.com>
4108
4109         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
4110         not a MethodInfo.       
4111
4112 2004-03-29  Martin Baulig  <martin@ximian.com>
4113
4114         * expression.cs (Argument.ResolveMethodGroup): If we're a
4115         ConstructedType, call GetMemberAccess() on it.  
4116
4117 2004-03-29  Martin Baulig  <martin@ximian.com>
4118
4119         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
4120         (MethodCore.CheckGenericOverride): When overriding a generic
4121         method, check whether the constraints match.
4122
4123         * support.cs (GenericConstraints): New public interface.
4124         (ParameterData.GenericConstraints): New public method.
4125
4126         * parameter.cs (Parameter.Resolve): Check whether we're a generic
4127         method parameter and compute our constraints if appropriate.
4128         (Parameter.GenericConstraints): New public property.
4129
4130         * generic.cs (Constraints): Implement GenericConstraints.
4131
4132 2004-03-29  Martin Baulig  <martin@ximian.com>
4133
4134         * decl.cs (MemberCache.FindMemberToOverride): Use
4135         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
4136
4137 2004-03-29  Martin Baulig  <martin@ximian.com>
4138
4139         * generic.cs (GenericMethod.Define): Resolve our type parameters.
4140
4141 2004-03-29  Martin Baulig  <martin@ximian.com>
4142
4143         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
4144         not allowed on non-generic declarations").
4145
4146 2004-03-29  Martin Baulig  <martin@ximian.com>
4147
4148         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4149         public version of this method.
4150
4151         * class.cs (MethodCore.IsDuplicateImplementation): Use
4152         Invocation.InferTypeArguments() to check this.
4153
4154 2004-03-29  Martin Baulig  <martin@ximian.com>
4155
4156         * convert.cs: Use TypeManager.IsDelegateType() instead of
4157         comparing types correctly.
4158
4159 2004-03-29  Martin Baulig  <martin@ximian.com>
4160
4161         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
4162         types directly to make it work for generic instances.
4163
4164         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
4165
4166 2004-03-29  Martin Baulig  <martin@ximian.com>
4167
4168         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
4169         support for arrays.     
4170
4171 2004-03-24  Martin Baulig  <martin@ximian.com>
4172
4173         * decl.cs (DeclSpace.FindType): Also use
4174         TypeManager.CheckGeneric() for types from the using clauses.
4175
4176 2004-03-23  Martin Baulig  <martin@ximian.com>
4177
4178         * expression.cs (Invocation.OverloadResolve): Added `bool
4179         may_fail' argument and use it instead of the Location.IsNull() hack.
4180
4181 2004-03-23  Martin Baulig  <martin@ximian.com>
4182
4183         * expression.cs (Invocation.InferType): Use correct type inference
4184         rules here.     
4185
4186 2004-03-23  Martin Baulig  <martin@ximian.com>
4187
4188         * ecore.cs (MethodGroupExpr.Name): Use
4189         TypeManager.CSharpSignature() instead of just the name.
4190
4191         * expression.cs (Invocation.OverloadResolve): Provide better error
4192         reporting.
4193         (Invocation.DoResolve): OverloadResolve() never returns null
4194         without reporting an error, so removed the error -6 reporting here.
4195
4196 2004-03-23  Martin Baulig  <martin@ximian.com>
4197
4198         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
4199         generic methods.
4200
4201         * cs-parser.jay (delegate_declaration): Support generic delegates.
4202
4203         * delegate.cs: Support generic delegates.
4204
4205 2004-03-22  Martin Baulig  <martin@ximian.com>
4206
4207         * expression.cs (Invocation.InferParamsTypeArguments): New static
4208         method; does type inference for params arguments.
4209
4210 2004-03-21  Martin Baulig  <martin@ximian.com>
4211
4212         * typemanager.cs (TypeManager.IsGenericMethod): New public static
4213         method; checks whether a method is a generic method.    
4214
4215         * expression.cs (Invocation.InferTypeArguments): New static method;
4216         infer type arguments for generic method invocation.
4217
4218         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
4219         property; we set this to true if we're resolving a generic method
4220         invocation and the user specified type arguments, ie. we're not
4221         doing type inference.
4222
4223 2004-03-20  Martin Baulig  <martin@ximian.com>
4224
4225         * class.cs (MethodData.DeclaringType): New public property.
4226         (MethodData.Define): Set DeclaringType here.
4227         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
4228         instead of OperatorMethodBuilder.DeclaringType.
4229
4230 2004-03-20  Martin Baulig  <martin@ximian.com>
4231
4232         * cs-tokenizer.cs (xtoken): Return a special
4233         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
4234
4235         * cs-parser.jay (default_value_expression): Switch to the new
4236         syntax (14.5.13).
4237
4238 2004-03-19  Martin Baulig  <martin@ximian.com>
4239
4240         * decl.cs (MemberName): New class.  We use this to "construct"
4241         namespace_or_type_name's.
4242
4243         * generics.cs (TypeArguments.GetDeclarations): New public method;
4244         returns the type arguments as a string[] and reports a CS0081 if
4245         one of them is not an identifier.
4246
4247         * class.cs (MemberBase): The .ctor now takes the name as a
4248         MemberName instead of a string.
4249         (MemberBase.ExplicitInterfaceName): Changed type from string to
4250         Expression.
4251         (MemberBase.DoDefine): If we're an explicit implementation, the
4252         InterfaceType may be a generic instance.
4253
4254         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
4255         (namespace_name): Call MemberName.GetName () to transform the
4256         MemberName into a string and ensure we don't have any type
4257         arguments.
4258         (type_name): Call MemberName.GetTypeExpression() to transfrom the
4259         MemberName into an expression.
4260         (method_header): Use namespace_or_type_name instead of member_name.     
4261
4262 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
4263
4264         * rootcontext.cs: Add new types to the boot resolution.
4265
4266         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
4267         MulticastDelegate is not allowed.
4268
4269         * typemanager.cs: Add new types to lookup: System.TypedReference
4270         and ArgIterator.
4271
4272         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
4273         check for TypedReference or ArgIterator, they are not allowed. 
4274
4275         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
4276         makes us properly catch 1510 in some conditions (see bug 56016 for
4277         details). 
4278
4279 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
4280
4281         * CryptoConvert.cs: update from corlib version
4282         with endian fixes.
4283
4284 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
4285
4286         * class.cs (Indexer.Define): Check indexername declaration
4287
4288 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
4289
4290         * attribute.cs (IsClsCompliant): Fixed problem with handling
4291         all three states (compliant, not-compliant, undetected).
4292
4293 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
4294
4295         * attribute.cs (Attribute): Location is now public.
4296         (Resolve): Store resolved arguments (pos_values) in attribute class.
4297         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
4298         (GetClsCompliantAttributeValue): New method that gets
4299         CLSCompliantAttribute value.
4300         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
4301         if exists else null.
4302         (AttributeTester): New class for CLS-Compliant verification routines.
4303
4304         * class.cs (Emit): Add CLS-Compliant verification.
4305         (Method.GetSignatureForError): Implemented.
4306         (Constructor.GetSignatureForError): Implemented
4307         (Constructor.HasCompliantArgs): Returns if constructor has
4308         CLS-Compliant arguments.
4309         (Constructor.Emit): Override.
4310         (Construcor.IsIdentifierClsCompliant): New method; For constructors
4311         is needed to test only parameters.
4312         (FieldBase.GetSignatureForError): Implemented.
4313         (TypeContainer): New member for storing base interfaces.
4314         (TypeContainer.FindMembers): Search in base interfaces too.
4315
4316         * codegen.cs (GetClsComplianceAttribute): New method that gets
4317         assembly or module CLSCompliantAttribute value.
4318         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
4319         for assembly.
4320         (ModuleClass.Emit): Add error 3012 test.
4321
4322         * const.cs (Emit): Override and call base for CLS-Compliant tests.
4323
4324         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
4325         state for all decl types.
4326         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
4327         if CLS-Compliant tests are required.
4328         (IsClsCompliaceRequired): New method. Analyze whether code
4329         must be CLS-Compliant.
4330         (IsExposedFromAssembly): New method. Returns true when MemberCore
4331         is exposed from assembly.
4332         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
4333         value or gets cached value.
4334         (HasClsCompliantAttribute): New method. Returns true if MemberCore
4335         is explicitly marked with CLSCompliantAttribute.
4336         (IsIdentifierClsCompliant): New abstract method. This method is
4337         used to testing error 3005.
4338         (IsIdentifierAndParamClsCompliant): New method. Common helper method
4339         for identifier and parameters CLS-Compliant testing.
4340         (VerifyClsCompliance): New method. The main virtual method for
4341         CLS-Compliant verifications.
4342         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
4343         null. I don't know why is null (too many public members !).
4344         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
4345         and get value of first CLSCompliantAttribute that found.
4346
4347         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
4348         (VerifyClsCompliance): Override and add extra tests.
4349
4350         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
4351         clscheck- disable CLS-Compliant verification event if assembly is has
4352         CLSCompliantAttribute(true).
4353
4354         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
4355         ApllyAttribute is now called in emit section as in the other cases.
4356         Possible future Emit integration.
4357         (IsIdentifierClsCompliant): New override.
4358         (VerifyClsCompliance): New override.
4359         (GetEnumeratorName): Returns full enum name.
4360
4361         * parameter.cs (GetSignatureForError): Implemented.
4362
4363         * report.cs (WarningData): New struct for Warning message information.
4364         (LocationOfPreviousError): New method.
4365         (Warning): New method. Reports warning based on the warning table.
4366         (Error_T): New method. Reports error based on the error table.
4367
4368         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
4369         verifications are done here.
4370
4371         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
4372
4373         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
4374         CLSCompliantAttribute.
4375         (all_imported_types): New member holds all imported types from other
4376         assemblies.
4377         (LoadAllImportedTypes): New method fills static table with exported types
4378         from all referenced assemblies.
4379         (Modules): New property returns all assembly modules.
4380
4381 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
4382
4383         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
4384         throwing a parser error.
4385
4386         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
4387         which removes the hardcoded get_/set_ prefixes for properties, as
4388         IL allows for the properties to be named something else.  
4389
4390         Bug #56013
4391
4392         * expression.cs: Do not override operand before we know if it is
4393         non-null.  Fix 56207
4394
4395 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4396
4397         * typemanager.cs: support for pinned variables.
4398
4399 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4400
4401         * decl.cs, typemanager.cs: Avoid using an arraylist
4402         as a buffer if there is only one result set.
4403
4404 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4405
4406         * expression.cs: Make sure you cant call a static method
4407         with an instance expression, bug #56174.
4408
4409 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
4410
4411         * class.cs (IsDuplicateImplementation): Improve error reporting to
4412         flag 663 (method only differs in parameter modifier).
4413
4414         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
4415         in preprocessor directives.
4416
4417         * location.cs (LookupFile): Allow for the empty path.
4418
4419         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
4420         better approach for some of that patch, but its failing with the
4421         CharSet enumeration.  For now try/catch will do.
4422
4423         * typemanager.cs: Do not crash if a struct does not have fields.
4424         Fixes 56150.
4425
4426 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4427
4428         * expression.cs: cs0213, cant fix a fixed expression.
4429         fixes 50231.
4430
4431 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4432
4433         * cs-parser.jay: detect invalid embeded statements gracefully.
4434         bug #51113.
4435
4436 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4437
4438         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
4439         As a regex:
4440         s/
4441         the invocation type may not be a subclass of the tye of the item/
4442         The type of the item must be a subclass of the invocation item.
4443         /g
4444
4445         Fixes bug #50820.
4446
4447 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
4448
4449         * attribute.cs: Added methods to get a string and a bool from an
4450         attribute. Required to information from AssemblyKeyFileAttribute,
4451         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
4452         * codegen.cs: Modified AssemblyName creation to include support for
4453         strongnames. Catch additional exceptions to report them as CS1548.
4454         * compiler.csproj: Updated include CryptoConvert.cs.
4455         * compiler.csproj.user: Removed file - user specific configuration.
4456         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
4457         Mono.Security assembly. The original class is maintained and tested in
4458         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
4459         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
4460         like CSC 8.0 (C# v2) supports.
4461         * Makefile: Added CryptoConvert.cs to mcs sources.
4462         * rootcontext.cs: Added new options for strongnames.
4463
4464 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
4465
4466         * driver.cs: For --expect-error, report error code `2'
4467         if the program compiled with no errors, error code `1' if
4468         it compiled with an error other than the one expected.
4469
4470 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
4471
4472         * compiler.csproj: Updated for Visual Studio .NET 2003.
4473         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
4474         * compiler.sln: Updated for Visual Studio .NET 2003.
4475
4476 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
4477
4478         * expression.cs: Fix bug #47234. We basically need to apply the
4479         rule that we prefer the conversion of null to a reference type
4480         when faced with a conversion to 'object' (csc behaviour).
4481
4482 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4483
4484         * statement.cs: Shorter form for foreach, eliminates
4485         a local variable. r=Martin.
4486
4487 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4488
4489         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
4490         checks if we can use brtrue/brfalse to test for 0.
4491         * expression.cs: use the above in the test for using brtrue/brfalse.
4492         cleanup code a bit.
4493
4494 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4495
4496         * expression.cs: Rewrite string concat stuff. Benefits:
4497
4498         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
4499         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
4500         rather than a concat chain.
4501
4502         * typemanager.cs: Add lookups for more concat overloads.
4503
4504 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
4505
4506         * expression.cs: Emit shorter il code for array init.
4507
4508         newarr
4509         dup
4510         // set 1
4511
4512         // set 2
4513
4514         newarr
4515         stloc.x
4516
4517         ldloc.x
4518         // set 1
4519
4520         ldloc.x
4521         // set 2
4522
4523 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
4524
4525         * statement.cs: Before, two switch blocks would be merged if the
4526         total size of the blocks (end_item - begin_item + 1) was less than
4527         two times the combined sizes of the blocks.
4528
4529         Now, it will only merge if after the merge at least half of the
4530         slots are filled.
4531
4532         fixes 55885.
4533
4534 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
4535
4536         * class.cs : csc build fix for GetMethods(). See bug #52503.
4537
4538 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
4539
4540         * expression.cs: Make sure fp comparisons work with NaN.
4541         This fixes bug #54303. Mig approved this patch a long
4542         time ago, but we were not able to test b/c the runtime
4543         had a related bug.
4544
4545 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
4546
4547         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
4548
4549 2004-03-19  Martin Baulig  <martin@ximian.com>
4550
4551         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
4552         two overloads may unify for some type parameter substitutions and
4553         report a CS0408 if appropriate.
4554
4555 2004-03-19  Martin Baulig  <martin@ximian.com>
4556
4557         * class.cs (MemberCore.IsDuplicateImplementation): Report the
4558         error here and not in our caller.
4559
4560 2004-03-19  Martin Baulig  <martin@ximian.com>
4561
4562         * interface.cs: Completely killed this file.
4563         (Interface): We're now a TypeContainer and live in class.cs.
4564
4565         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
4566         argument; we're now also called for interfaces.
4567         (TypeContainer.DefineMembers): Allow this method being called
4568         multiple times.
4569         (TypeContainer.GetMethods): New public method; formerly known as
4570         Interface.GetMethod().  This is used by PendingImplementation.
4571         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
4572         it's now private and non-static.
4573         (Interface): Moved this here; it's now implemented similar to
4574         Class and Struct.
4575         (Method, Property, Event, Indexer): Added `bool is_interface'
4576         argument to their .ctor's.
4577         (MemberBase.IsInterface): New public field.
4578
4579         * cs-parser.jay: Create normal Method, Property, Event, Indexer
4580         instances instead of InterfaceMethod, InterfaceProperty, etc.
4581         (opt_interface_base): Removed; we now use `opt_class_base' instead.
4582         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
4583
4584 2004-03-19  Martin Baulig  <martin@ximian.com>
4585
4586         * class.cs (MethodCore.IsDuplicateImplementation): New private
4587         method which does the CS0111 checking.
4588         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
4589         Use IsDuplicateImplementation().
4590
4591 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
4592
4593         * decl.cs (FindMemberToOverride): New method to find the correct
4594         method or property to override in the base class.
4595         * class.cs
4596             - Make Method/Property use the above method to find the
4597               version in the base class.
4598             - Remove the InheritableMemberSignatureCompare as it is now
4599               dead code.
4600
4601         This patch makes large code bases much faster to compile, as it is
4602         O(n) rather than O(n^2) to do this validation.
4603
4604         Also, it fixes bug 52458 which is that nested classes are not
4605         taken into account when finding the base class member.
4606
4607         Reviewed/Approved by Martin.
4608
4609 2004-03-17  Martin Baulig  <martin@ximian.com>
4610
4611         * expression.cs (MemberAccess.DoResolve): Take the parent's number
4612         of type arguments into account; use the `real_num_type_args'
4613         approach like in DoResolveAsTypeStep().
4614
4615         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
4616         nested types.
4617
4618 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
4619
4620         * interface.cs: In all interface classes removed redundant
4621         member initialization.
4622
4623 2004-03-16  Martin Baulig  <martin@ximian.com>
4624
4625         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
4626
4627 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
4628
4629         * decl.cs (DefineTypeAndParents): New helper method to define a
4630         type's containers before the type itself is defined;  This is a
4631         bug exposed by the recent changes to Windows.Forms when an
4632         implemented interface was defined inside a class that had not been
4633         built yet.   
4634
4635         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
4636
4637         (Check): Loop correctly to report errors modifiers
4638         (UNSAFE was not in the loop, since it was the same as TOP).
4639
4640         * interface.cs: Every interface member now takes a ModFlags,
4641         instead of a "is_new" bool, which we set on the base MemberCore. 
4642
4643         Every place where we called "UnsafeOk" in the interface, now we
4644         call the proper member (InterfaceMethod.UnsafeOK) instead to get
4645         the unsafe settings from the member declaration instead of the
4646         container interface. 
4647
4648         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
4649
4650         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
4651         `set_indexer_name' to the pending bits (one per type).
4652
4653         We fixed a bug today that was picking the wrong method to
4654         override, since for properties the existing InterfaceMethod code
4655         basically ignored the method name.  Now we make sure that the
4656         method name is one of the valid indexer names.
4657
4658 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
4659  
4660         * support.cs (SeekableStreamReader): Keep track of stream byte
4661         positions and don't mix them with character offsets to the buffer.
4662
4663         Patch from Gustavo Giráldez
4664
4665 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
4666
4667         * interface.cs (InterfaceSetGetBase): Removed double member
4668         initialization, base class does it as well.
4669
4670 2004-03-13  Martin Baulig  <martin@ximian.com>
4671
4672         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
4673         when compiling corlib.
4674
4675 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
4676
4677         * convert.cs (ExplicitConversion): We were reporting an error on
4678         certain conversions (object_type source to a value type, when the
4679         expression was `null') before we had a chance to pass it through
4680         the user defined conversions.
4681
4682         * driver.cs: Replace / and \ in resource specifications to dots.
4683         Fixes 50752
4684
4685         * class.cs: Add check for duplicate operators.  Fixes 52477
4686
4687 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
4688
4689         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
4690         that are in the middle of the statements, not only at the end.
4691         Fixes #54987
4692
4693         * class.cs (TypeContainer.AddField): No longer set the
4694         `HaveStaticConstructor' flag, now we call it
4695         `UserDefineStaticConstructor' to diferentiate the slightly
4696         semantic difference.
4697
4698         The situation is that we were not adding BeforeFieldInit (from
4699         Modifiers.TypeAttr) to classes that could have it.
4700         BeforeFieldInit should be set to classes that have no static
4701         constructor. 
4702
4703         See:
4704
4705         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
4706
4707         And most importantly Zoltan's comment:
4708
4709         http://bugzilla.ximian.com/show_bug.cgi?id=44229
4710
4711         "I think beforefieldinit means 'it's ok to initialize the type sometime 
4712          before its static fields are used', i.e. initialization does not need
4713          to be triggered by the first access to the type. Setting this flag
4714          helps the JIT to compile better code, since it can run the static
4715          constructor at JIT time, and does not need to generate code to call it
4716          (possibly lots of times) at runtime. Unfortunately, mcs does not set
4717          this flag for lots of classes like String. 
4718          
4719          csc sets this flag if the type does not have an explicit static 
4720          constructor. The reasoning seems to be that if there are only static
4721          initalizers for a type, and no static constructor, then the programmer
4722          does not care when this initialization happens, so beforefieldinit
4723          can be used.
4724          
4725          This bug prevents the AOT compiler from being usable, since it 
4726          generates so many calls to mono_runtime_class_init that the AOT code
4727          is much slower than the JITted code. The JITted code is faster, 
4728          because it does not generate these calls if the vtable is type is
4729          already initialized, which is true in the majority of cases. But the
4730          AOT compiler can't do this."
4731
4732 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
4733
4734         * class.cs (MethodData.Emit): Refactor the code so symbolic
4735         information is generated for destructors;  For some reasons we
4736         were taking a code path that did not generate symbolic information
4737         before. 
4738
4739 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
4740
4741         * class.cs: Create a Constructor.CheckBase method that
4742         takes care of all validation type code. The method
4743         contains some code that was moved from Define.
4744
4745         It also includes new code that checks for duplicate ctors.
4746         This fixes bug #55148.
4747
4748 2004-03-09  Joshua Tauberer <tauberer@for.net>
4749
4750         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
4751         a { ... }-style array creation invokes EmitStaticInitializers
4752         which is not good for reference-type arrays.  String, decimal
4753         and now null constants (NullCast) are not counted toward
4754         static initializers.
4755
4756 2004-03-05  Martin Baulig  <martin@ximian.com>
4757
4758         * location.cs (SourceFile.HasLineDirective): New public field;
4759         specifies whether the file contains or is referenced by a "#line"
4760         directive.
4761         (Location.DefineSymbolDocuments): Ignore source files which
4762         either contain or are referenced by a "#line" directive.        
4763
4764 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
4765
4766         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
4767         direct access to our parent, so check the method inline there.
4768
4769 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
4770
4771         * expression.cs (Invocation.EmitCall): Miguel's last commit
4772         caused a regression. If you had:
4773
4774             T t = null;
4775             t.Foo ();
4776
4777         In Foo the implict this would be null.
4778
4779 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
4780
4781         * expression.cs (Invocation.EmitCall): If the method is not
4782         virtual, do not emit a CallVirt to it, use Call.
4783
4784         * typemanager.cs (GetFullNameSignature): Improve the method to
4785         cope with ".ctor" and replace it with the type name.
4786
4787         * class.cs (ConstructorInitializer.Resolve): Now the method takes
4788         as an argument the ConstructorBuilder where it is being defined,
4789         to catch the recursive constructor invocations.
4790
4791 2004-03-16  Martin Baulig  <martin@ximian.com>
4792
4793         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
4794         ConstructedType, call ResolveType() on it to get the type rather
4795         than just using `expr.Type'.
4796
4797 2004-03-16  Martin Baulig  <martin@ximian.com>
4798
4799         * generics.cs (ConstructedType.GetMemberAccess): Take the
4800         EmitContext instead on the TypeExpr and use
4801         ec.TypeContainer.CurrentType/ec.ContainerType.
4802
4803 2004-03-16  Martin Baulig  <martin@ximian.com>
4804
4805         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
4806         parameters before aliases.
4807
4808 2004-03-16  Martin Baulig  <martin@ximian.com>
4809
4810         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
4811         New oublic function; checks whether two generic instances may become
4812         equal under some instantiations (26.3.1).
4813
4814         * class.cs (TypeContainer.Define): Call
4815         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
4816         error.
4817
4818 2004-03-16  Martin Baulig  <martin@ximian.com>
4819
4820         * class.cs (TypeContainer.GetClassBases): Moved
4821         Error_TypeParameterAsBase() here and also check whether the base
4822         class is not an attribute.
4823
4824 2004-03-16  Martin Baulig  <martin@ximian.com>
4825
4826         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
4827
4828 2004-03-16  Martin Baulig  <martin@ximian.com>
4829
4830         * class.cs (Error_TypeParameterAsBase): Use correct error number
4831         here (CS0689).  
4832
4833 2004-03-16  Martin Baulig  <martin@ximian.com>
4834
4835         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
4836         for generics.
4837
4838         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
4839         error reporting.
4840
4841 2004-03-15  Martin Baulig  <martin@ximian.com>
4842
4843         * typemanager.cs (TypeManager.GetFullName): New public method.
4844         (TypeManager.MemberLookup): Added `int_num_type_arguments'
4845         argument; only return members with the correct number of type
4846         arguments.
4847         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
4848         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
4849         whether the number of type arguments matches.
4850
4851         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
4852         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
4853
4854         * expression.cs (MemberAccess): Added public `NumTypeArguments'
4855         field; it's set by the protected .ctor when we're actually a
4856         GenericMemberAccess.
4857         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
4858         arguments and pass it to MemberLookupFinal ().
4859
4860         * ecore.cs (Expression.MemberLookup): Added `int
4861         num_type_arguments' argument; only return members with the correct
4862         number of type arguments.
4863         (Expression.MemberLookupFailed): Check whether the MemberLookup
4864         failed because we did not have the correct number of type
4865         arguments; report CS0305 in this case.
4866
4867         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
4868         `e.ResolveAsTypeTerminal()' already did so.
4869
4870 2004-03-15  Martin Baulig  <martin@ximian.com>
4871
4872         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
4873         we're a ConstructedType; in this case, the caller must report an
4874         error (for instance CS0131).
4875
4876         * generic.cs (TypeArguments): Added Location argument to the .ctor.
4877         (TypeArguments.Resolve): Actually report errors here.
4878
4879 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
4880
4881         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
4882         `set_indexer_name' to the pending bits (one per type).
4883
4884         We fixed a bug today that was picking the wrong method to
4885         override, since for properties the existing InterfaceMethod code
4886         basically ignored the method name.  Now we make sure that the
4887         method name is one of the valid indexer names.
4888
4889 2004-03-15  Martin Baulig  <martin@ximian.com>
4890
4891         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
4892         for generic instances.
4893
4894 2004-03-13  Martin Baulig  <martin@ximian.com>
4895
4896         * class.cs (TypeContainer.DefineType): Call
4897         TypeManager.AddUserType() immediately after creating the
4898         TypeBuilder; pass all type parameters when creating the
4899         CurrentType.
4900
4901         * decl.cs (DeclSpace.FindNestedType): New public method.
4902         (DeclSpace.FindType): Added `int num_type_args' argument; only
4903         return types with the correct number of type parameters.
4904         (DeclSpace.CountTypeParams): New public property.
4905
4906         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
4907         the number of type parameters; defaults to zero.
4908
4909         * generic.cs (TypeArguments.Count): New public property.
4910         (ConstructedType.DoResolveAsTypeStep): First call
4911         ds.FindNestedType() to find out whether we're nested in the
4912         current generic type; in this case, we inherit all type parameters
4913         from the current class.
4914
4915         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
4916         num_type_args' argument.
4917         (RootContext.LookupType): Added overloaded version which takes the
4918         number of type arguments; only return types with the correct
4919         number of type arguments.
4920
4921         * typemanager.cs (TypeManager.CheckGeneric): New public function;
4922         checks whether `Type t' has `int num_type_args'.
4923
4924 2004-03-13  Martin Baulig  <martin@ximian.com>
4925
4926         * generic.cs (GenericMethod.DefineType): New method; calls
4927         DefineType() on all the type parameters.
4928
4929         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
4930         (MethodData.Define): If we're a generic method, call
4931         GenericMethod.DefineType() to define the type parameters.       
4932
4933 2004-03-10  Martin Baulig  <martin@ximian.com>
4934
4935         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
4936         instead of IsAssignableFrom.    
4937
4938 2004-03-10  Martin Baulig  <martin@ximian.com>
4939
4940         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
4941
4942         * support.cs (ParameterData.HasArrayParameter): New property.
4943         (ReflectionParameters.ctor): Take a MethodBase instead of a
4944         ParameterInfo[].  If we have any type parameters, get the generic
4945         method definition and ask it whether we have variable arguments.
4946
4947 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
4948
4949         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
4950         routines to check if a type is an enumerable/enumerator allow
4951         classes that implement the IEnumerable or IEnumerator interfaces.
4952
4953         * class.cs (Property, Operator): Implement IIteratorContainer, and
4954         implement SetYields.
4955
4956         (Property.Define): Do the block swapping for get_methods in the
4957         context of iterators.   We need to check if Properties also
4958         include indexers or not.
4959
4960         (Operator): Assign the Block before invoking the
4961         OperatorMethod.Define, so we can trigger the Iterator code
4962         replacement. 
4963
4964         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
4965         Property and Operator classes are not created when we parse the
4966         declarator but until we have the block completed, so we use a
4967         singleton SimpleIteratorContainer.Simple to flag whether the
4968         SetYields has been invoked.
4969
4970         We propagate this setting then to the Property or the Operator to
4971         allow the `yield' to function.
4972
4973 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
4974
4975         * codegen.cs: Implemented attribute support for modules.
4976         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
4977         Assembly/Module functionality.
4978
4979         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
4980         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
4981         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
4982
4983 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
4984
4985         * interface.cs (FindMembers): The operation is performed on all base
4986         interfaces and not only on the first. It is required for future CLS Compliance patch.
4987
4988 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
4989
4990         * statement.cs, codegen.cs:
4991         This patch deals with patterns such as:
4992
4993         public class List : IEnumerable {
4994
4995                 public MyEnumerator GetEnumerator () {
4996                         return new MyEnumerator(this);
4997                 }
4998
4999                 IEnumerator IEnumerable.GetEnumerator () {
5000                         ...
5001                 }
5002                 
5003                 public struct MyEnumerator : IEnumerator {
5004                         ...
5005                 }
5006         }
5007
5008         Before, there were a few things we did wrong:
5009         1) we would emit callvirt on a struct, which is illegal
5010         2) we emited ldarg when we needed to emit ldarga
5011         3) we would mistakenly call the interface methods on an enumerator
5012         type that derived from IEnumerator and was in another assembly. For example:
5013
5014         public class MyEnumerator : IEnumerator
5015
5016         Would have the interface methods called, even if there were public impls of the
5017         method. In a struct, this lead to invalid IL code.
5018
5019 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5020
5021         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5022           renamed to Emit.
5023
5024         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5025
5026 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5027
5028         * cs-parser.jay: Fix small regression: we were not testing V2
5029         compiler features correctly.
5030
5031         * interface.cs: If the emit context is null, then create one
5032
5033 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5034
5035         * decl.cs (GetSignatureForError): New virtual method to get full name
5036           for error messages.
5037
5038         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5039           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5040
5041         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5042           Duplicated members and code in these classes has been removed.
5043           Better encapsulation in these classes.
5044
5045 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5046
5047         * assign.cs (Assign.DoResolve): When dealing with compound
5048         assignments, there is a new rule in ECMA C# 2.4 (might have been
5049         there before, but it is documented here) that states that in:
5050
5051         a op= b;
5052
5053         If b is of type int, and the `op' is a shift-operator, then the
5054         above is evaluated as:
5055
5056         a = (int) a op b 
5057
5058         * expression.cs (Binary.ResolveOperator): Instead of testing for
5059         int/uint/long/ulong, try to implicitly convert to any of those
5060         types and use that in pointer arithmetic.
5061
5062         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5063         method to print information for from the type, not from the
5064         null-method we were given.
5065
5066 2004-02-01  Duncan Mak  <duncan@ximian.com>
5067
5068         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
5069         parsing for cmd, fixes bug #53694.
5070
5071 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
5072
5073         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
5074         in the member name duplication tests. Property and operator name duplication
5075         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
5076
5077 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
5078
5079         * interface.cs (PopulateMethod): Fixed crash when interface method
5080         returns not existing type (error test cs0246-3.cs).
5081
5082 2004-02-02  Ravi Pratap M <ravi@ximian.com>
5083
5084         * cs-parser.jay (interface_accessors): Re-write actions to also
5085         store attributes attached to get and set methods. Fix spelling
5086         while at it.
5087
5088         (inteface_property_declaration): Modify accordingly.
5089
5090         (InterfaceAccessorInfo): New helper class to store information to pass
5091         around between rules that use interface_accessors.
5092
5093         * interface.cs (Emit): Apply attributes on the get and set
5094         accessors of properties and indexers too.
5095
5096         * attribute.cs (ApplyAttributes): Modify accordingly to use the
5097         right MethodBuilder when applying attributes to the get and set accessors.
5098
5099 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
5100
5101         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
5102
5103 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
5104
5105         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
5106
5107 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
5108
5109         * cs-parser.jay: Remove YIELD token, instead use the new grammar
5110         changes that treat `yield' specially when present before `break'
5111         or `return' tokens.
5112
5113         * cs-tokenizer.cs: yield is no longer a keyword.
5114
5115 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
5116
5117         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
5118         setting for default constructors.
5119         For default constructors are almost every time set wrong Modifier. The
5120         generated IL code has been alright. But inside mcs this values was
5121         wrong and this was reason why several of my CLS Compliance tests
5122         failed.
5123
5124 2004-02-27  Martin Baulig  <martin@ximian.com>
5125
5126         * generics.cs (ConstructedType.ResolveType): Make the nested type
5127         stuff actually work.
5128
5129 2004-02-25  Martin Baulig  <martin@ximian.com>
5130
5131         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
5132         property; returns the type parameters just from the current type,
5133         ie. with the ones from outer classes.
5134         (DeclSpace.LookupGeneric): First search in the current class, then
5135         in outer classes.
5136         (DeclSpace.initialize_type_params): When hiding a type parameter
5137         from an outer class, put it into the `type_param_list' anyways.
5138
5139         * expression.cs (MemberAccess.expr): Made this field protected.
5140
5141         * class.cs (TypeContainer.Define): The `CurrentType' just contains
5142         the type parameters from the current class.
5143
5144         * generic.cs (ConstructedType.ResolveType): Support nested generic
5145         types by taking the type parameters which we inherit from outer
5146         classes into account.
5147         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
5148         support for nested generic types.
5149
5150 2004-02-23  Martin Baulig  <martin@ximian.com>
5151
5152         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
5153         field and check whether we're nested inside a generic type.
5154         (DeclSpace.ResolveType): If we're resolving to a generic type
5155         definition, create a ConstructedType and return its resolved type.
5156         (DeclSpace.initialize_type_params): New private method;
5157         initializes the `type_param_list' field from the type parameters
5158         from this and all enclosing classes.
5159         (DeclSpace.TypeParameters): Call initialize_type_params() unless
5160         we're already initialized.
5161
5162 2004-02-23  Martin Baulig  <martin@ximian.com>
5163
5164         * class.cs (Method.Define): Create the generic method before
5165         calling DoDefine().
5166         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
5167         the TypeContainer one); we use this for generic methods.
5168
5169         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
5170         parent's TypeBuilder.
5171
5172 2004-02-18  Martin Baulig  <martin@ximian.com>
5173
5174         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
5175         to check for equality.
5176
5177 2004-02-05  Martin Baulig  <martin@ximian.com>
5178
5179         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
5180         `ec.TypeContainer.CurrentType', use it instead of
5181         `ec.ContainerType' to check whether we're in the type's ctor.
5182
5183 2004-01-29  Martin Baulig  <martin@ximian.com>
5184
5185         * expression.cs (Invocation.DoResolve): If we're a
5186         `ConstructedType', then we're actually a generic method, so
5187         rewrite the expr as a GenericMemberAccess.
5188
5189         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
5190         here; manually parse it into a string.
5191
5192 2004-01-28  Martin Baulig  <martin@ximian.com>
5193
5194         * typemanager.cs (TypeManager.IsEqual): New static method.
5195         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
5196         check for equality instead of using `=='.
5197
5198 2004-01-26  Martin Baulig  <martin@ximian.com>
5199
5200         * decl.cs (DeclSpace.CurrentType): New public field.
5201
5202         * expression.cs (This.ResolveBase): If we have an
5203         `ec.TypeContainer.CurrentType', use it instead of
5204         `ec.ContainerType'.
5205
5206         * class.cs (TypeContainer.DefineType): If we're a generic type,
5207         create the `CurrentType' (unresolved).
5208         (TypeContainer.GenericType): New private field.
5209         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
5210         it and store it in `GenericType' before creating the MemberCache.
5211         (TypeContainer.GetMembers): If we have a `GenericType', call
5212         TypeManager.FindMembers() on it.
5213
5214         * interface.cs (Interface.GenericType): New private field.
5215         (Interface.DefineType): If we're a generic type, create the
5216         `CurrentType' (unresolved).
5217         (Interface.DefineMembers): If we have a `CurrentType', resolve it
5218         and store it in `GenericType' before creating the MemberCache.
5219         (Interface.GetMembers): If we have a `GenericType', call
5220         TypeManager.FindMembers() on it.
5221
5222 2004-01-22  Martin Baulig  <martin@ximian.com>
5223
5224         * cs-parser.jay (namespace_or_type_name): Return an Expression,
5225         not a QualifiedIdentifier.  This is what `type_name_expression'
5226         was previously doing.
5227         (type_name_expression): Removed; the code is now in
5228         `namespace_or_type_name'.
5229         (qualified_identifier): Removed, use `namespace_or_type_name'
5230         instead.
5231         (QualifiedIdentifier): Removed this class.      
5232
5233 2004-01-22  Martin Baulig  <martin@ximian.com>
5234
5235         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
5236         not a string as alias name.
5237
5238 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
5239
5240         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
5241         #52730 bug, and instead compute correctly the need to use a
5242         temporary variable when requesting an address based on the
5243         static/instace modified of the field and the constructor.
5244  
5245 2004-01-21  Martin Baulig  <martin@ximian.com>
5246
5247         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
5248         class and namespace before looking up aliases.  Fixes #52517.
5249
5250 2004-01-21  Martin Baulig  <martin@ximian.com>
5251
5252         * flowanalysis.cs (UsageVector.Merge): Allow variables being
5253         assinged in a 'try'; fixes exception4.cs.
5254
5255 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5256         * class.cs : Implemented parameter-less constructor for TypeContainer
5257
5258         * decl.cs: Attributes are now stored here. New property OptAttributes
5259
5260         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
5261
5262         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
5263
5264 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5265
5266         * typemanager.cs (CSharpSignature): Now reports also inner class name.
5267           (CSharpSignature): New method for indexer and property signature.
5268
5269 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5270
5271         * pending.cs (IsVirtualFilter): Faster implementation.
5272
5273 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5274
5275         * typemanager.cs: Avoid inclusion of same assembly more than once.
5276
5277 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5278
5279         * cs-parser.jay: Fixed problem where the last assembly attribute
5280           has been applied also to following declaration (class, struct, etc.)
5281           
5282 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5283
5284         * class.cs: Added error CS0538, CS0539 reporting.
5285         Fixed crash on Microsoft runtime when field type is void.
5286
5287         * cs-parser.jay: Added error CS0537 reporting.
5288
5289         * pending.cs: Added error CS0535 reporting.
5290         Improved error report for errors CS0536, CS0534.
5291
5292 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
5293
5294         Merge a few bits from the Anonymous Method MCS tree.
5295
5296         * statement.cs (ToplevelBlock): New class for toplevel methods,
5297         will hold anonymous methods, lifted variables.
5298
5299         * cs-parser.jay: Create toplevel blocks for delegates and for
5300         regular blocks of code. 
5301
5302 2004-01-20  Martin Baulig  <martin@ximian.com>
5303
5304         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
5305         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
5306         and `NeedExplicitReturn'; added `IsLastStatement'.
5307         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
5308         have a `ReturnLabel' or we're not unreachable.
5309
5310         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
5311         child's reachability; don't just override ours with it.  Fixes
5312         #58058 (lluis's example).
5313         (FlowBranching): Added public InTryOrCatch(), InCatch(),
5314         InFinally(), InLoop(), InSwitch() and
5315         BreakCrossesTryCatchBoundary() methods.
5316
5317         * statement.cs (Return): Do all error checking in Resolve().
5318         Unless we are the last statement in a top-level block, always
5319         create a return label and jump to it.
5320         (Break, Continue): Do all error checking in Resolve(); also make
5321         sure we aren't leaving a `finally'.
5322         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
5323         statement in a top-level block.
5324         (Block.Flags): Added `IsDestructor'.
5325         (Block.IsDestructor): New public property.
5326
5327 2004-01-20  Martin Baulig  <martin@ximian.com>
5328
5329         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
5330
5331 2004-01-20  Martin Baulig  <martin@ximian.com>
5332
5333         * statement.cs (Statement.ResolveUnreachable): New public method.
5334         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
5335         (Block.Resolve): Resolve unreachable statements.
5336
5337 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5338
5339         * expression.cs: We need to fix the case where we do
5340         not have a temp variable here.
5341
5342         * assign.cs: Only expression compound assignments need
5343         temporary variables.
5344
5345 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5346
5347         * flowanalysis.cs: Reduce memory allocation in a few ways:
5348           - A block with no variables should not allocate a bit
5349             vector for itself.
5350           - A method with no out parameters does not need any tracking
5351             for assignment of the parameters, so we need not allocate
5352             any data for it.
5353           - The arrays:
5354                 public readonly Type[] VariableTypes;
5355                 public readonly string[] VariableNames;
5356             Are redundant. The data is already stored in the variable
5357             map, so we need not allocate another array for it.
5358           - We need to add alot of checks for if (params | locals) == null
5359             due to the first two changes.
5360
5361 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
5362
5363         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
5364         implement IMemoryLocation, we store a copy on a local variable and
5365         take the address of it.  Patch from Benjamin Jemlich
5366
5367         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
5368         to use a special "type_name_expression" rule which reduces the
5369         number of "QualifiedIdentifier" classes created, and instead
5370         directly creates MemberAccess expressions.
5371
5372 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
5373
5374         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
5375         that fixes #52853.  Null literal assignment to ValueType
5376
5377         * class.cs (MethodData.Emit): Instead of checking the name of the
5378         method to determine if its a destructor, create a new derived
5379         class from Method called Destructor, and test for that.  
5380
5381         * cs-parser.jay: Create a Destructor object instead of a Method.  
5382
5383         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
5384
5385         Fixes: 52933
5386
5387 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
5388
5389         * expression.cs (Binary.ResolveOperator): Perform an implicit
5390         conversion from MethodGroups to their delegate types on the
5391         Addition operation.
5392
5393         * delegate.cs: Introduce a new class DelegateCreation that is the
5394         base class for `NewDelegate' and `ImplicitDelegateCreation',
5395         factor some code in here.
5396
5397         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
5398         conversion from MethodGroups to compatible delegate types. 
5399
5400         * ecore.cs (Expression.Resolve): Do not flag error 654
5401         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
5402         we allow conversions from MethodGroups to delegate types now.
5403
5404         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
5405         assignments in v2 either.
5406
5407 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
5408
5409         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
5410         static read-only fields in ctors.
5411
5412         Applied patch from Benjamin Jemlich 
5413
5414         * expression.cs (UnaryMutator): Avoid leaking local variables. 
5415
5416 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
5417
5418         * cs-tokenizer.cs (IsCastToken): Allow the various native types
5419         here to return true, as they can be used like this:
5420
5421                 (XXX) int.MEMBER ()
5422
5423         Fixed 49836 and all the other dups
5424
5425 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
5426
5427         * driver.cs: Implement /win32res and /win32icon.
5428
5429 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
5430
5431         * cs-parser.jay: Add a rule to improve error handling for the
5432         common mistake of placing modifiers after the type.
5433
5434 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
5435
5436         * cs-parser.jay (interface_event_declaration): Catch
5437         initialization of events on interfaces, and report cs0068
5438
5439         * cs-parser.jay (interface_event_declaration): Catch
5440         initialization of events. 
5441
5442         * ecore.cs: Better report missing constructors.
5443
5444         * expression.cs (Binary.ResolveOperator): My previous bug fix had
5445         the error reporting done in the wrong place.  Fix.
5446
5447         * expression.cs (Binary.ResolveOperator): Catch the 
5448         operator + (E x, E y) error earlier, and later allow for implicit
5449         conversions in operator +/- (E e, U x) from U to the underlying
5450         type of E.
5451
5452         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
5453         52596, if the container class is abstract, the default constructor
5454         is protected otherwise its public (before, we were always public).
5455
5456         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
5457         fixed statement.
5458
5459         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
5460         Jemlich that fixes bug #52597, MCS was generating invalid code for
5461         idisposable structs.   Thanks to Ben for following up with this
5462         bug as well.
5463
5464 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
5465
5466         * driver.cs: Allow assemblies without code to be generated, fixes
5467         52230.
5468
5469 2004-01-07  Nick Drochak <ndrochak@gol.com>
5470
5471         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
5472
5473 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
5474
5475         * cs-parser.jay: Add rules to improve error reporting if fields or
5476         methods are declared at the namespace level (error 116)
5477
5478         * Add rules to catch event add/remove
5479
5480 2004-01-04  David Sheldon <dave-mono@earth.li>
5481
5482   * expression.cs: Added matching ")" to error message for 
5483   CS0077
5484
5485 2004-01-03 Todd Berman <tberman@gentoo.org>
5486
5487         * ecore.cs, attribute.cs:
5488         Applying fix from #52429.
5489
5490 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5491
5492         * ecore.cs, expression.cs, statement.cs:
5493         Total rewrite of how we handle branching. We
5494         now handle complex boolean expressions with fewer
5495         jumps. As well if (x == 0) no longer emits a ceq.
5496
5497         if (x is Foo) is much faster now, because we generate
5498         better code.
5499
5500         Overall, we get a pretty big improvement on our benchmark
5501         tests. The code we generate is smaller and more readable.
5502
5503         I did a full two-stage bootstrap. The patch was reviewed
5504         by Martin and Miguel.
5505
5506 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5507
5508         * cs-parser.jay: Make primary_expression not take a QI.
5509         we dont need this because the member_access rule covers
5510         us here. So we replace the rule with just IDENTIFIER.
5511
5512         This has two good effects. First, we remove a s/r conflict.
5513         Second, we allocate many fewer QualifiedIdentifier objects.
5514
5515 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5516
5517         * attribute.cs: Handle MarshalAs attributes as pseudo, and
5518         set the correct information via SRE. This prevents
5519         hanging on the MS runtime. Fixes #29374.
5520
5521 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
5522
5523         * convert.cs: correctly handle conversions to value types
5524         from Enum and ValueType as unboxing conversions.
5525
5526         Fixes bug #52569. Patch by Benjamin Jemlich.
5527
5528 2004-01-02  Ravi Pratap  <ravi@ximian.com>
5529
5530         * expression.cs (BetterConversion): Prefer int -> uint
5531         over int -> ulong (csc's behaviour). This fixed bug #52046.
5532
5533 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5534
5535         * decl.cs (MemberCache.FindMembers): now returns a
5536         MemberInfo [].
5537
5538         * typemanager.cs: In general, go with with ^^.
5539         (CopyNewMethods): take an IList.
5540         (RealMemberLookup): Only allocate an arraylist
5541         if we copy from two sets of methods.
5542
5543         This change basically does two things:
5544         1) Fewer array lists allocated due to CopyNewMethods.
5545         2) the explicit cast in MemberList costed ALOT.
5546
5547 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
5548
5549         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
5550         a hashtable to avoid needless string allocations when an identifier is
5551         used more than once (the common case).
5552
5553 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
5554
5555         * pending.cs: MS's TypeBuilder.GetInterfaces ()
5556         is broken, it will not return anything. So, we
5557         have to use the information we have in mcs to
5558         do the task.
5559
5560         * typemanager.cs: Add a cache for GetInterfaces,
5561         since this will now be used more often (due to ^^)
5562
5563         (GetExplicitInterfaces) New method that gets the
5564         declared, not effective, interfaces on a type
5565         builder (eg, if you have interface IFoo, interface
5566         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
5567         { IBar }.
5568
5569         This patch makes MCS able to bootstrap itself on
5570         Windows again.
5571
5572 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
5573
5574         * expression.cs: Remove the Nop's that Miguel put
5575         in by mistake.
5576
5577 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5578
5579         * report.cs, codegen.cs: Give the real stack trace to
5580         the error when an exception is thrown.
5581
5582 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5583
5584         * decl.cs: only allocate hashtables for ifaces if 
5585         it is an iface!
5586
5587 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
5588
5589         * expression.cs: fix the error from cs0121-2.cs
5590         (a parent interface has two child interfaces that
5591         have a function with the same name and 0 params
5592         and the function is called through the parent).
5593
5594 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5595
5596         * class.cs, rootcontext.cs, typmanager.cs: do not
5597         leak pointers.
5598
5599 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5600
5601         * codegen.cs: remove stack for the ec flow branching.
5602         It is already a linked list, so no need.
5603
5604 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5605
5606         * Makefile: Allow custom profiler here.
5607
5608 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
5609
5610         * typemanager.cs (LookupType):
5611           - Use a static char [], because split takes
5612             a param array for args, so it was allocating
5613             every time.
5614           - Do not store true in a hashtable, it boxes.
5615
5616 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
5617
5618         * flowanalysis.cs: bytify common enums.
5619
5620 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
5621
5622         * modifiers.cs: Add a new set of flags for the
5623         flags allowed on explicit interface impls.
5624         * cs-parser.jay: catch the use of modifiers in
5625         interfaces correctly.
5626         * class.cs: catch private void IFoo.Blah ().
5627
5628         All related to bug #50572.
5629
5630 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
5631
5632         * decl.cs: Rewrite the consistant accessability checking.
5633         Accessability is not linear, it must be implemented in
5634         a tableish way. Fixes #49704.
5635
5636 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
5637
5638         * expression.cs: Handle negation in a checked context.
5639         We must use subtraction from zero. Fixes #38674.
5640
5641 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5642
5643         * class.cs: Ignore static void main in DLLs.
5644         * rootcontext.cs: Handle the target type here,
5645         since we are have to access it from class.cs
5646         * driver.cs: account for the above.
5647
5648 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5649
5650         * report.cs: Give line numbers and files if available.
5651
5652 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
5653
5654         * driver.cs: Implement /addmodule.
5655
5656         * typemanager.cs:  Change 'modules' field so it now contains Modules not
5657         ModuleBuilders.
5658
5659 2003-12-20  Martin Baulig  <martin@ximian.com>
5660
5661         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
5662         (FieldBase.IsAssigned): Removed this field.
5663         (FieldBase.SetAssigned): New public method.
5664         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
5665
5666 2003-12-20  Martin Baulig  <martin@ximian.com>
5667
5668         * expression.cs (LocalVariableReference.DoResolve): Don't set
5669         `vi.Used' if we're called from DoResolveLValue().
5670
5671         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
5672         returns the usage vector it just merged into the current one -
5673         pass this one to UsageWarning().
5674         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
5675         of the `EmitContext', don't call this recursively on our children.
5676
5677 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
5678
5679         * driver.cs: Implement /target:module.
5680
5681 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
5682
5683         * support.cs (CharArrayHashtable): New helper class.
5684
5685         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
5686         char arrays, not strings, so we can avoid creating a string in
5687         consume_identifier if the identifier is a keyword.
5688
5689 2003-12-16  Martin Baulig  <martin@ximian.com>
5690
5691         * statement.cs (LocalInfo.Assigned): Removed this property.
5692         (LocalInfo.Flags): Removed `Assigned'.
5693         (LocalInfo.IsAssigned): New public method; takes the EmitContext
5694         and uses flow analysis.
5695         (Block.UsageWarning): Made this method private.
5696         (Block.Resolve): Call UsageWarning() if appropriate.
5697
5698         * expression.cs (LocalVariableReference.DoResolve): Always set
5699         LocalInfo.Used here.
5700
5701 2003-12-13  Martin Baulig  <martin@ximian.com>
5702
5703         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
5704         any value here; we're now using flow analysis to figure out
5705         whether a statement/block returns a value.
5706
5707 2003-12-13  Martin Baulig  <martin@ximian.com>
5708
5709         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
5710         working again.
5711         (FlowBranching.MergeFinally): Don't call
5712         `branching.CheckOutParameters()' here, this is called in
5713         MergeTopBlock().
5714         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
5715         when adding the `finally' vector.       
5716
5717 2003-12-13  Martin Baulig  <martin@ximian.com>
5718
5719         * flowanalysis.cs
5720         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
5721         actually work and also fix #48962.
5722
5723 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5724
5725         * decl.cs: Do not check System.Object for nested types,
5726         since we know it does not have any. Big bang for buck:
5727
5728         BEFORE:
5729            Run 1:   8.35 seconds
5730            Run 2:   8.32 seconds
5731            corlib:  17.99 seconds
5732         AFTER:
5733            Run 1:   8.17 seconds
5734            Run 2:   8.17 seconds
5735            corlib:  17.39 seconds
5736
5737 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5738
5739         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
5740         time we are returning 0 members, so we save alot here.
5741
5742 2003-12-11  Martin Baulig  <martin@ximian.com>
5743
5744         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
5745         `MergeChild()', also just take the `FlowBranching' as argument;
5746         call Merge() on it and return the result.
5747         (FlowBranching.Merge): We don't need to do anything if we just
5748         have one sibling.
5749
5750 2003-12-11  Martin Baulig  <martin@ximian.com>
5751
5752         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
5753         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
5754         Maurer for this idea.
5755
5756 2003-12-11  Martin Baulig  <martin@ximian.com>
5757
5758         * flowanalysis.cs (MergeResult): This class is now gone; we now
5759         use the `UsageVector' for this.  The reason for this is that if a
5760         branching just has one sibling, we don't need to "merge" them at
5761         all - that's the next step to do.
5762         (FlowBranching.Merge): We now return a `UsageVector' instead of a
5763         `MergeResult'.
5764
5765 2003-12-11  Martin Baulig  <martin@ximian.com>
5766
5767         Reworked flow analyis and made it more precise and bug-free.  The
5768         most important change is that we're now using a special `Reachability'
5769         class instead of having "magic" meanings of `FlowReturns'.  I'll
5770         do some more cleanups and optimizations and also add some more
5771         documentation this week.
5772
5773         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
5774         largely reworked this class.
5775         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
5776         the new `Reachability' class instead of having "magic" values here.
5777         (FlowBranching): We're now using an instance of `Reachability'
5778         instead of having separate `Returns', `Breaks' etc. fields.
5779
5780         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
5781         based on flow analysis; ignore the return value of block.Emit ().
5782
5783 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
5784
5785         * driver.cs typemanager.cs: Find the mono extensions to corlib even
5786         if they are private.
5787
5788 2003-12-09  Martin Baulig  <martin@ximian.com>
5789
5790         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
5791         call them directly on the UsageVector.
5792
5793 2003-12-09  Martin Baulig  <martin@ximian.com>
5794
5795         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
5796         Changed return type from `FlowReturns' to `Reachability'.
5797
5798 2003-12-09  Martin Baulig  <martin@ximian.com>
5799
5800         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
5801         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
5802         `Reachable' fields with a single `Reachability' one.
5803
5804 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
5805
5806         * class.cs (FindMembers): Remove foreach's.
5807
5808         Bootstrap times:
5809
5810         BEFORE
5811                 Run 1:   8.74 seconds
5812                 Run 2:   8.71 seconds
5813
5814         AFTER
5815                 Run 1:   8.64 seconds
5816                 Run 2:   8.58 seconds
5817
5818
5819 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
5820
5821         * cs-parser.jay:
5822         * gen-treedump.cs:
5823         * statement.cs:
5824         This patch does a few things:
5825                 1. EmptyStatement is now a singleton, so it is never reallocated.
5826                 2. All blah is EmptyStatement constructs have been changed to
5827                    blah == EmptyStatement.Value, which is much faster and valid
5828                    now that EmptyStatement is a singleton.
5829                 3. When resolving a block, rather than allocating a new array for
5830                    the non-empty statements, empty statements are replaced with
5831                    EmptyStatement.Value
5832                 4. Some recursive functions have been made non-recursive.
5833         Mainly the performance impact is from (3), however (1) and (2) are needed for
5834         this to work. (4) does not make a big difference in normal situations, however
5835         it makes the profile look saner.
5836
5837         Bootstrap times:
5838
5839         BEFORE
5840         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
5841         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
5842         Total memory allocated: 56397 KB
5843
5844         AFTER
5845         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
5846         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
5847         Total memory allocated: 55666 KB
5848
5849 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
5850
5851         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
5852         than the hashtable in a hashtable version
5853
5854         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
5855         we always end up concating a string. This results in a huge perf
5856         loss, because many strings have to be tracked by the GC. In this
5857         patch, we first use a hashtable that works with two keys, so that
5858         the strings do not need to be concat'ed.
5859
5860         Bootstrap times:
5861         BEFORE
5862                 Run 1:   8.74 seconds
5863                 Run 2:   8.71 seconds
5864
5865         AFTER
5866                 Run 1:   8.65 seconds
5867                 Run 2:   8.56 seconds
5868
5869 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
5870
5871         * Makefile: Add a new target `do-time' that does a quick and simple
5872         profile, leaving easy to parse output.
5873
5874 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
5875
5876         * codegen.cs (Init): Create the dynamic assembly with 
5877         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
5878
5879 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
5880
5881         * support.cs: Make the PtrHashtable use only one
5882         instance of its comparer.
5883
5884 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
5885
5886         * typemanager.cs: Fix lookup of GetNamespaces.
5887
5888 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
5889
5890         * expression.cs: Removed redundant line.
5891
5892         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
5893         ArrayLists, use for loops with bounds.  
5894
5895         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
5896         arraylist.
5897
5898         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
5899         arraylists, use for loop with bounds.
5900
5901         The above three changes give us a 0.071 second performance
5902         improvement out of 3.294 seconds down to 3.223.  On my machine
5903         the above changes reduced the memory usage by 1,387 KB during
5904         compiler bootstrap.
5905
5906         * cs-parser.jay (QualifiedIdentifier): New class used to represent
5907         QualifiedIdentifiers.  Before we created a new string through
5908         concatenation, and mostly later on, the result would be
5909         manipulated by DecomposeQI through string manipulation.
5910
5911         This reduced the compiler memory usage for bootstrapping from
5912         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
5913         compile times in 0.05 seconds.
5914
5915 2003-11-28  Dick Porter  <dick@ximian.com>
5916
5917         * support.cs: Do string compares with the Invariant culture.
5918
5919         * rootcontext.cs: 
5920         * gen-treedump.cs: 
5921         * expression.cs: 
5922         * driver.cs: 
5923         * decl.cs: 
5924         * codegen.cs: 
5925         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
5926         the comparison is done with the Invariant culture.
5927
5928 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
5929
5930         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
5931         GetEnumerator method.
5932
5933         (ProbeCollectionType): Iterate starting at the most specific type
5934         upwards looking for a GetEnumerator
5935
5936         * expression.cs: Shift count can be up to 31 for int/uint and 63
5937         for long/ulong.
5938
5939 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
5940
5941         * statement.cs (Block.LookupLabel): Also look for the label on the
5942         children blocks.  Use a hash table to keep track of visited
5943         nodes. 
5944
5945         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
5946         we actually did transform the other operand, otherwise fall back
5947         to the common codepath that casts to long.
5948
5949         * cs-tokenizer.cs: Use the same code pattern as the int case.
5950         Maybe I should do the parsing myself, and avoid depending on the
5951         Parse routines to get this done.
5952
5953 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
5954
5955         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
5956         which fixes bug 51347.  This time test it.
5957
5958         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
5959         attributes for example can not tell the difference between these.
5960         The difference was only a syntax feature of the language. 
5961
5962         * attribute.cs: Apply attributes to delegates.
5963
5964         * delegate.cs: Call the apply attributes method.
5965
5966 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
5967
5968         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
5969         comparing 0 vs Byte.MinValue, not the value
5970
5971         (ImplicitConversionRequired): When reporting a conversion error,
5972         use error 31 to print out the constant error instead of the
5973         simpler 29.
5974
5975         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
5976         which fixes bug 51347.
5977
5978 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
5979
5980         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
5981         which fixes the -warnaserror command line option.
5982
5983 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
5984
5985         * cfold.cs (DoNumericPromotions): During constant folding of
5986         additions on UIntConstant, special case intconstants with
5987         IntConstants like we do on the expression binary operator. 
5988
5989 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
5990
5991         * convert.cs (ImplicitReferenceConversion): We were missing a case
5992         (System.Enum are not value types or class types, so we need to
5993         classify them separatedly).
5994
5995         * driver.cs: We do not support error 2007.
5996
5997 2003-11-12 Jackson Harper <jackson@ximian.com>
5998
5999         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6000         system directory. Also use the full file name so users can
6001         libraries names mscorlib-o-tron.dll in a non system dir.
6002         
6003 2004-01-04  David Sheldon <dave-mono@earth.li>
6004
6005         * expression.cs: Added matching ")" to error message for CS0077.
6006
6007 2003-12-19  Martin Baulig  <martin@ximian.com>
6008
6009         * typemanager.cs (TypeManager.IsEqualGenericType): New public
6010         static method; see documentation in the method.
6011         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
6012
6013         * convert.cs (Convert.ImplicitReferenceConversion,
6014         Convert.ImplicitReferenceConversionExists): Add support for
6015         generic type declarations; see gen-36.cs.
6016
6017 2003-12-19  Martin Baulig  <martin@ximian.com>
6018
6019         * pending.cs (Pending.InterfaceMethod): Use
6020         `Type.IsAssignableFrom()' instead of `=='.
6021
6022 2003-12-18  Martin Baulig  <martin@ximian.com>
6023
6024         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
6025         byref types first.
6026
6027         * convert.cs (Convert.ImplicitStandardConversionExists): Use
6028         `expr_type.Equals (target_type)' instead of `=='.
6029
6030 2003-12-08  Martin Baulig  <martin@ximian.com>
6031
6032         * generics.cs (Constraints.Types): Removed.
6033         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
6034         to Type's.
6035         (Constraints.ResolveTypes): New public method; resolves the
6036         TypeExpr's to Type's.
6037         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
6038         longer takes the constraints.
6039         (TypeParameter.DefineMethod): Likewise.
6040         (TypeParameter.DefineType): New public method.  Calls
6041         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
6042         the constraints.
6043
6044 2003-12-08  Martin Baulig  <martin@ximian.com>
6045
6046         * convert.cs (Convert.ImplicitConversionStandard): Use
6047         `expr_type.Equals (target_type)' instead of `=='.
6048
6049 2003-12-08  Martin Baulig  <martin@ximian.com>
6050
6051         * typemanager.cs (TypeManager.GetReferenceType): Call
6052         `Type.MakeByRefType ()'.
6053
6054 2003-12-08  Martin Baulig  <martin@ximian.com>
6055
6056         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
6057         just has some special meaning in some situations.  For instance,
6058         it is allowed to use `where' as the name of a variable etc.
6059
6060 2003-12-04  Martin Baulig  <martin@ximian.com>
6061
6062         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6063         `Type.MakeArrayType()' for array types.
6064
6065 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
6066
6067         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
6068         debugging message.
6069
6070         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
6071         corlib to compile.
6072
6073 2003-11-16  Martin Baulig  <martin@ximian.com>
6074
6075         * codegen.cs (EmitContext.IsGeneric): Removed.
6076
6077         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
6078         ResolveGeneric() on the DeclSpace.
6079
6080 2003-11-16  Martin Baulig  <martin@ximian.com>
6081
6082         * generic.cs (TypeArguments.Resolve):
6083         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
6084         `ResolveType()' on it to get the Type.
6085
6086 2003-11-15  Martin Baulig  <martin@ximian.com>
6087
6088         * generic.cs (ConstructedType.GetInterfaces): Override this.
6089
6090 2003-11-14  Martin Baulig  <martin@ximian.com>
6091
6092         * interface.cs (Interface.DefineType): Define all type parameters
6093         before adding the interfaces we inherit.
6094
6095 2003-11-11  Martin Baulig  <martin@ximian.com>
6096
6097         * generic.cs (ConstructedType.ResolveType): Always call
6098         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
6099
6100 2003-11-10  Martin Baulig  <martin@ximian.com>
6101
6102         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6103         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6104         calling `ResolveType()' on them, directly assign their `Type'.
6105
6106 2003-11-08  Martin Baulig  <martin@ximian.com>
6107
6108         * generic.cs (ConstructedType): Override `IsClass' etc.
6109
6110 2003-11-08  Martin Baulig  <martin@ximian.com>
6111
6112         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6113         return value and the `out parent' parameter.
6114         (TypeContainer.DefineType): Moved the CS0644 check into
6115         GetClassBases().  Don't pass the interface types to the
6116         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6117         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6118
6119         * ecore.cs (TypeExpr.IsAttribute): New property.
6120         (TypeExpr.GetInterfaces): New method.
6121
6122         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6123         TypeExpr instead of a Type.
6124         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6125         (Interface.DefineType): Don't pass the interface types to the
6126         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6127         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6128
6129         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6130         instead of a `Type[]'.
6131         (TypeManager.RegisterBuilder): Likewise.
6132         (TypeManager.AddUserInterface): Likewise.
6133         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6134         `Type[]' and also return a `TypeExpr[]'.
6135         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6136
6137 2003-11-08  Martin Baulig  <martin@ximian.com>
6138
6139         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6140         Expression.     
6141
6142 2003-11-08  Martin Baulig  <martin@ximian.com>
6143
6144         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6145         TypeManager.ResolveExpressionTypes().
6146
6147         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6148         instead of an Expression.
6149         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6150         (TypeExpression): New public class; formerly known as `TypeExpr'.
6151
6152         * expression.cs (ComposedCast): Derive from TypeExpr.
6153
6154         * typemanager.cs (TypeManager.system_*_expr): These are now
6155         TypExpr's instead of Expression's.
6156         (TypeManager.ResolveExpressionTypes): New public static function;
6157         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6158         of them.        
6159
6160 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6161
6162         * expression.cs (New.DoResolve): Do not dereference value that
6163         might be a null return.
6164
6165         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6166         sure that the constant value has the right type.  Fixes an
6167         unreported bug, similar to 50425.
6168
6169         * const.cs (Const.LookupConstantValue): Call
6170         ImplicitStandardConversionExists before doing a conversion to
6171         avoid havng the TypeManager.ChangeType do conversions.
6172
6173         Reduced the number of casts used
6174
6175         (Const.ChangeType): New routine to enable reuse of the constant
6176         type changing code from statement.
6177
6178         * typemanager.cs (ChangeType): Move common initialization to
6179         static global variables.
6180
6181         Fixes #50425.
6182
6183         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6184         every value type to go through, even if it was void.  Fix that. 
6185
6186         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6187         character of the define, and the is_identifier_part_character for
6188         the rest of the string.
6189
6190 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6191
6192         * expression.cs (UnaryMutator.EmitCode): When I updated
6193         LocalVariableReference.DoResolve, I overdid it, and dropped an
6194         optimization done on local variable references.
6195
6196 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6197
6198         * ecore.cs: Convert the return from Ldlen into an int.
6199
6200 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6201
6202         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6203         the accessibility, this is a special case for toplevel non-public
6204         classes (internal for instance).
6205
6206 2003-10-20  Nick Drochak <ndrochak@gol.com>
6207
6208         * ecore.cs: Fix typo and build.  Needed another right paren.
6209
6210 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6211
6212         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6213         `internal' case regular and protected, but not allowing protected
6214         to be evaluated later.  Bug 49840
6215
6216 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6217
6218         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6219         to kb.Nlast, and not the kb.nFirst to isolate the switch
6220         statement.
6221
6222         Extract the underlying type, so enumerations of long/ulong are
6223         treated like long/ulong.
6224
6225 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6226
6227         * expression.cs (New): Overload the meaning of RequestedType to
6228         track the possible creation of the NewDelegate type, since
6229         DoResolve is invoked more than once for new constructors on field
6230         initialization.
6231
6232         See bugs: #48800 and #37014
6233
6234         * cs-parser.jay (declare_local_constants): Take an arraylist
6235         instead of a single constant.
6236
6237         (local_constant_declaration): It should take a
6238         constant_declarators, not a constant_declarator.  Fixes 49487
6239
6240         * convert.cs: Fix error report.
6241
6242 2003-10-13 Jackson Harper <jackson@ximian.com>
6243
6244         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6245         bug #49611
6246         
6247 2003-11-03  Martin Baulig  <martin@ximian.com>
6248
6249         * expression.cs (ArrayAccess.GetStoreOpcode): Added
6250         `out bool has_type_arg'; if set, we need to pass the type to
6251         ig.Emit().
6252         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
6253         Stelem_Any/Ldelem_Any for generic parameters.   
6254
6255 2003-11-02  Martin Baulig  <martin@ximian.com>
6256
6257         * expression.cs (Invocation.EmitCall): Use
6258         `TypeManager.IsValueType()' to check whether it's a value type.
6259         Don't set `struct_call' when calling a method on a type parameter.
6260
6261 2003-11-02  Martin Baulig  <martin@ximian.com>
6262
6263         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
6264         and removed the TypeBuilder argument.
6265
6266         * typemanager.cs (TypeManager.IsValueType): Return
6267         `t.IsGenericParameter || t.IsValueType'.
6268
6269 2003-10-25  Martin Baulig  <martin@ximian.com>
6270
6271         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
6272         call ConstructedType.Resolve() on it.
6273
6274         * generic.cs (ConstructedType.Resolve): Set `type' on success.
6275
6276 2003-10-25  Martin Baulig  <martin@ximian.com>
6277
6278         * class.cs (TypeContainer.GetClassBases): Changed
6279         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
6280         CS8214 reporting here.
6281         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
6282         instead of a `Type' for our parent.  In case of a recursive
6283         declaration (see tests/gen-23.cs for an example), our parent is a
6284         ConstructedType and it doesn't have its type set.  So, first
6285         create our own TypeBuilder, then call constructed.Resolve() to get
6286         the parent's type and finally TypeBuilder.SetParent() it.
6287
6288         * ecore.cs (TypeExpr.Name): New public virtual property.
6289
6290         * generic.cs
6291         (ConstructedType): We're now a TypeExpr and not just an Expression.
6292         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
6293         arguments here; this is done later.
6294         (ConstructedType.Resolve): New public method to resolve the type
6295         arguments and bind them.
6296
6297 2003-10-21  Martin Baulig  <martin@ximian.com>
6298
6299         * convert.cs: Use `TypeManager.IsValueType' instead of
6300         'type.IsValueType' everywhere.
6301
6302         * typemanager.cs (TypeManager.IsValueType): Return true for type
6303         parameters.  The reason for this is that we need to box a type
6304         parameter when converting it to a reference type.
6305
6306         * cs-parser.jay: Added support for default value expressions.
6307
6308         * generics.cs (DefaultValueExpression): New public class.       
6309
6310 2003-10-17  Martin Baulig  <martin@ximian.com>
6311
6312         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
6313         TypeContainer so we can also use this for Interfaces.
6314         (TypeParameter.Resolve): Likewise.
6315
6316         * interface.cs (Interface.DefineType): Added support for generic
6317         interfaces.
6318
6319         * cs-parser.jay: Added support for generic structs and interfaces.
6320
6321 2003-10-17  Martin Baulig  <martin@ximian.com>
6322
6323         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
6324         call generic methods :-)
6325
6326 2003-10-16  Martin Baulig  <martin@ximian.com>
6327
6328         * cs-parser.jay (namespace_or_type_name): Only create a
6329         GenericMemberAccess if we actually have type arguments.
6330
6331 2003-10-13  Martin Baulig  <martin@ximian.com>
6332
6333         * class.cs (Method.Define): If we're a generic method, call
6334         TypeBuilder.DefineGenericMethod () before resolving
6335         the parameters.
6336         (MethodData): Added .ctor which takes an additional MethodBuilder
6337         argument; this is used for generic methods.
6338         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
6339         we already have a MethodBuilder.
6340
6341 2003-10-10  Martin Baulig  <martin@ximian.com>
6342
6343         * class.cs (Method): Added .ctor which takes a `GenericMethod'
6344         instead of a `DeclSpace'.  This is used for generic methods.
6345
6346         * cs-parser.jay (method_header): Added support for generic
6347         methods; create a `GenericMethod' instance and pass it to the
6348         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
6349         parameters and locals.
6350
6351         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
6352         since we already have the location.  Check whether we're a generic
6353         type declaration or a generic method and create the correct type
6354         parameter.
6355
6356         * generic.cs (TypeParameter.DefineMethod): New public method.
6357         (GenericMethod): New public class; derives from DeclSpace and is
6358         used for generic methods.       
6359
6360 2003-10-09  Martin Baulig  <martin@ximian.com>
6361
6362         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6363         to the .ctor.
6364         (MethodCore.DoDefineParameters): Removed the TypeContainer
6365         argument; use the DeclSpace which was passed to the .ctor instead.
6366         (MethodCore.CheckParameter): Take a DeclSpace instead of a
6367         TypeContainer; we only need a DeclSpace here.
6368
6369 2003-10-09  Martin Baulig  <martin@ximian.com>
6370
6371         * class.cs (MethodData): Added additional `DeclSpace ds' argument
6372         to the .ctor.
6373         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6374         EmitContext's .ctor.    
6375
6376 2003-10-09  Martin Baulig  <martin@ximian.com>
6377
6378         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
6379         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
6380         AsAccessible(), moved them as well.
6381
6382         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
6383
6384 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
6385
6386         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
6387         generation for >=, as spotted by Paolo, bug 48679.  
6388         Patch from David Waite.
6389
6390         * cs-tokenizer.cs: Add handling for #pragma.
6391
6392         * cs-parser.jay: Allow for both yield and yield return in the
6393         syntax.  The anti-cobolization of C# fight will go on!
6394
6395         * class.cs (TypeBuilder.DefineType): Catch error condition here
6396         (Parent.DefineType erroring out and returning null).
6397
6398         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
6399         coping with enumerations variables, we were mistakenly processing
6400         them as a regular value type instead of built-in types.  Fixes the
6401         bug #48063
6402
6403         * typemanager.cs (IsBuiltinOrEnum): New method.
6404
6405 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
6406
6407         * cs-parser.jay: Upgrade: yield now needs the return clause.
6408
6409 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
6410
6411         * cs-parser.jay : Renamed yyName to yyNames related to jay.
6412
6413 2003-09-29  Martin Baulig  <martin@ximian.com>
6414
6415         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
6416         inflated generic methods.
6417
6418         * generics.cs (ConstructedType): Distinguish between open and
6419         closed constructed types; correctly resolve the arguments.
6420
6421 2003-09-22  Martin Baulig  <martin@ximian.com>
6422
6423         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
6424         all type arguments meet their constraints.
6425
6426 2003-09-19  Martin Baulig  <martin@ximian.com>
6427
6428         * decl.cs (MemberCache.SetupCacheForInterface): Take a
6429         `MemberCache parent' argument.  Normally, an interface doesn't
6430         have a parent type except System.Object, but we use this in gmcs
6431         for generic type parameters.
6432
6433 2003-09-18  Martin Baulig  <martin@ximian.com>
6434
6435         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
6436         on `type.IsInterface'; don't check whether the type has a parent
6437         to determine whether it's an interface.
6438
6439 2003-09-17  Martin Baulig  <martin@ximian.com>
6440
6441         * generic.cs (ConstructedType.ToString): Always use `name' as the
6442         type name.
6443
6444 2003-09-15  Martin Baulig  <martin@ximian.com>
6445
6446         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
6447
6448         * generic.cs (Constraints.Resolve): New public method; this is
6449         called to resolve the constraint types and to check whether all
6450         the constraints are correct.
6451         (Constraints.Types): New public property.
6452         (TypeParameter.Resolve): New public method; resolves all the
6453         type's constraints.
6454
6455         * class.cs (TypeContainer.DefineType): Call
6456         TypeParameter.Resolve() before actually defining the type.
6457
6458 2003-09-15  Martin Baulig  <martin@ximian.com>
6459
6460         * class.cs (TypeContainer.DefineType): Added an error flag to
6461         avoid reporting duplicate CS0146's ("class definition is
6462         circular.").
6463
6464         * driver.cs (Driver.MainDriver): Abort if
6465         RootContext.ResolveTree() reported any errors.
6466
6467 2003-09-07  Martin Baulig  <martin@ximian.com>
6468
6469         * report.cs (Error, Warning): Added overloaded versions which take
6470         a `params object[] args' and call String.Format().
6471
6472 2003-09-07  Martin Baulig  <martin@ximian.com>
6473
6474         * decl.cs (DeclSpace..ctor): Don't call
6475         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
6476         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
6477         (DeclSpace.RecordDecl): New method.
6478
6479         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
6480
6481 2003-09-02  Ravi Pratap  <ravi@ximian.com>
6482
6483         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
6484         value attributes to be applied to ParameterBuilders.
6485
6486         * class.cs (MethodCore.LabelParameters): Make static and more
6487         generic so that it can be used from other places - like interface
6488         methods, for instance.
6489
6490         * interface.cs (Interface.Emit): Call LabelParameters before
6491         emitting attributes on the InterfaceMethod.
6492
6493 2003-09-07  Martin Baulig  <martin@ximian.com>
6494
6495         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
6496         if the number of type parameters doesn't match.
6497
6498 2003-09-04  Martin Baulig  <martin@ximian.com>
6499
6500         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
6501         for arrays of generic type params (ie. `!0[]').
6502
6503 2003-09-04  Martin Baulig  <martin@ximian.com>
6504
6505         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
6506         for the moment.
6507
6508 2003-09-04  Martin Baulig  <martin@ximian.com>
6509
6510         * decl.cs (DeclSpace.LookupGeneric): New method.
6511         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
6512         moment.
6513
6514         * generic.cs (TypeParameterExpr): Take a TypeParameter as
6515         argument, not just a string.
6516         (TypeParameter.Define): New public method; this is called to
6517         actually define the generic parameter; after this, you can use the
6518         new `Type' property to get the type.
6519
6520 2003-09-04  Martin Baulig  <martin@ximian.com>
6521
6522         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
6523         is now an ArrayList; initialize the result of the `TypeParameters'
6524         property here.
6525         (DeclSpace.GetGenericData): Removed.
6526         (DeclSpace.LookupGeneric): Temporarily removed; we need to
6527         implement this in a different way.
6528         (DeclSpace.GetTypeParameters): Removed; there's now a
6529         `TypeParameters' property.
6530         (DeclSpace.TypeParameters): New public property.
6531
6532         * generic.cs (Constraints): Make this class public.
6533         (TypeParameter): New public class.
6534
6535 2003-09-04  Martin Baulig  <martin@ximian.com>
6536
6537         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
6538         generic parameters.
6539
6540         * class.cs (TypeContainer.DefineType): Call
6541         TypeBuilder.DefineGenericParameter () on all generic parameters if
6542         this is a generic type.
6543
6544 2003-08-28  Martin Baulig  <martin@ximian.com>
6545
6546         * sample-stack.il: Compile this with ilasm: "ilasm /dll
6547         sample-stack.il".
6548
6549         * sample-hello.cs: Compile this with gmcs: "gmcs
6550         /r:sample-stack.dll sample-hello.cs".
6551
6552 2003-08-28  Martin Baulig  <martin@ximian.com>
6553
6554         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
6555         the parameters to the generic type.
6556
6557 2003-08-28  Martin Baulig  <martin@ximian.com>
6558
6559         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
6560
6561 2003-08-28  Martin Baulig  <martin@ximian.com>
6562
6563         * cs-parser.jay (opt_type_argument_list): Use
6564         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
6565         (primary_expression): Replace `qualified_identifier' with `type_name'.
6566         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
6567
6568         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
6569         parser to check whether it is syntactically a type parameter list;
6570         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
6571         this case.
6572
6573 2003-08-26  Martin Baulig  <martin@ximian.com>
6574
6575         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
6576         resolving aliases; fixes #47927.
6577
6578 2003-08-26  Martin Baulig  <martin@ximian.com>
6579
6580         * statement.cs (Using.DoResolve): This is internally emitting a
6581         try/finally clause, so we need to set ec.NeedExplicitReturn if we
6582         do not always return.  Fixes #47681.
6583
6584 2003-08-26  Martin Baulig  <martin@ximian.com>
6585
6586         * decl.cs (MemberCore): Moved WarningNotHiding(),
6587         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
6588         into MemberBase.
6589         (AdditionResult): Make this nested in DeclSpace.
6590         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
6591         argument; call NamespaceEntry.Define() unless we're nested in a
6592         class or struct.
6593
6594         * namespace.cs (Namespace.DefineName): New public function.  This
6595         is called from DeclSpace's .ctor to add 
6596         (Namespace.Lookup): Include DeclSpaces in the lookup.
6597
6598         * class.cs (Operator): Derive from MemberBase, not MemberCore.
6599
6600         * const.cs (Const): Derive from MemberBase, not MemberCore.     
6601
6602 2003-08-25  Martin Baulig  <martin@ximian.com>
6603
6604         * convert.cs (Convert.ExplicitReferenceConversion): When
6605         converting from an interface type to a class, unbox if the target
6606         type is a struct type.  Fixes #47822.
6607
6608 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6609
6610         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
6611         #47854.
6612
6613 2003-08-22  Martin Baulig  <martin@ximian.com>
6614
6615         * class.cs (TypeManager.DefineType): When defining a nested type,
6616         call DefineType() on our parent; fixes #47801.
6617
6618 2003-08-22  Martin Baulig  <martin@ximian.com>
6619
6620         * class.cs (MethodData.Define): While checking if a method is an
6621         interface implementation, improve the test a bit more to fix #47654.
6622
6623 2003-08-22  Martin Baulig  <martin@ximian.com>
6624
6625         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
6626         correctly; fixes #47722.
6627
6628 2003-08-22  Martin Baulig  <martin@ximian.com>
6629
6630         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
6631         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
6632
6633         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
6634
6635 2003-08-22  Martin Baulig  <martin@ximian.com>
6636
6637         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
6638         can only be assigned in static constructors.  Fixes #47161.
6639
6640 2003-08-22  Martin Baulig  <martin@ximian.com>
6641
6642         Rewrote and improved the flow analysis code.
6643
6644         * flowbranching.cs (FlowBranching): Make this class abstract.
6645         (FlowBranching.CreateBranching): New static function to create a
6646         new flow branching.
6647         (FlowBranchingBlock, FlowBranchingException): New classes.
6648         (FlowBranching.UsageVector.Type): New public readonly field.
6649         (FlowBranching.UsageVector.Breaks): Removed the setter.
6650         (FlowBranching.UsageVector.Returns): Removed the setter.
6651         (FlowBranching.UsageVector): Added Break(), Return(),
6652         NeverReachable() and Throw() methods to modify the reachability.
6653         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
6654         done by FlowBranching.Merge().
6655         (FlowBranching.UsageVector.MergeChild): New method; merges the
6656         merge result into the current vector.
6657         (FlowBranching.Merge): New abstract method to merge a branching.
6658
6659 2003-08-12  Martin Baulig  <martin@ximian.com>
6660
6661         * expression.cs (Indirection.CacheTemporaries): Create the
6662         LocalTemporary with the pointer type, not its element type.
6663
6664 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
6665
6666         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
6667         token was a keyword or not.
6668
6669         Add `error' options where an IDENTIFIER was expected;  Provide
6670         CheckToken and CheckIdentifierToken convenience error reporting
6671         functions. 
6672
6673         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
6674
6675         * decl.cs: Rename `NamespaceEntry Namespace' public field into
6676         NameSpaceEntry NameSpaceEntry.
6677
6678         (LookupInterfaceOrClass): Avoid creating a full qualified name
6679         from namespace and name: avoid doing lookups when we know the
6680         namespace is non-existant.   Use new Tree.LookupByNamespace which
6681         looks up DeclSpaces based on their namespace, name pair.
6682
6683         * driver.cs: Provide a new `parser verbose' to display the
6684         exception thrown during parsing.  This is turned off by default
6685         now, so the output of a failure from mcs is more graceful.
6686
6687         * namespace.cs: Track all the namespaces defined in a hashtable
6688         for quick lookup.
6689
6690         (IsNamespace): New method
6691
6692 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
6693
6694         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
6695         we know that we need to concatenate (full typename can never be
6696         null). 
6697
6698         * class.cs: ditto.
6699
6700         * statement.cs: Use a bitfield;  Do not initialize to null things
6701         which are done by the constructor by default.
6702
6703         * cs-parser.jay: bug fix, parameter was 4, not 3.
6704
6705         * expression.cs: Just use the property;
6706
6707         * statement.cs: No need for GetVariableInfo method.
6708
6709 2003-08-08  Martin Baulig  <martin@ximian.com>
6710
6711         * flowanalysis.cs (FlowReturns): This is now nested in the
6712         `FlowBranching' class.
6713         (MyBitVector): Moved this here from statement.cs.
6714         (FlowBranching.SiblingType): New enum type.
6715         (FlowBranching.CreateSibling): Added `SiblingType' argument.
6716
6717 2003-08-07  Martin Baulig  <martin@ximian.com>
6718
6719         * flowanalysis.cs (FlowBranchingType): This is now nested in the
6720         `FlowBranching' class and called `BranchingType'.
6721
6722 2003-08-07  Martin Baulig  <martin@ximian.com>
6723
6724         * flowanalysis.cs: Moved all the control flow analysis code into
6725         its own file.
6726
6727 2003-08-07  Martin Baulig  <martin@ximian.com>
6728
6729         * assign.cs (Assign.DoResolve): `target' must either be an
6730         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
6731         #37319.
6732
6733 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
6734
6735         * expression.cs (BinaryMethod): This kind of expression is created by the
6736         Binary class if it determines that the operator has to be handled
6737         by a method.
6738
6739         (BinaryDelegate): This kind of expression is created if we are
6740         dealing with a + or - operator on delegates.
6741
6742         (Binary): remove method, argumetns, and DelegateOperator: when
6743         dealing with methods, 
6744
6745         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
6746
6747         * statement.cs (Block): use bitfields for the three extra booleans
6748         we had in use.   Remove unused topblock parameter.
6749
6750         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
6751
6752         * assign.cs: Drop extra unneeded tests.
6753
6754 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
6755
6756         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
6757
6758         * statement.cs (Foreach): Use VariableStorage instead of
6759         LocalBuilders.   
6760
6761         * codegen.cs (VariableStorage): New class used by clients that
6762         require a variable stored: locals or fields for variables that
6763         need to live across yield.
6764
6765         Maybe provide a convenience api for EmitThis+EmitLoad?
6766
6767         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
6768         these bad boys.
6769
6770 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
6771
6772         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
6773         RemapParameterLValue): New methods that are used to turn a
6774         precomputed FieldInfo into an expression like this:
6775
6776                 instance.FieldInfo
6777
6778         The idea is to use this instead of making LocalVariableReference
6779         have more than one meaning.
6780
6781         * cs-parser.jay: Add error production to BASE.
6782
6783         * ecore.cs: Deal with TypeManager.GetField returning null, which
6784         is now a valid return value.
6785
6786         (FieldExprNoAddress): New expression for Fields whose address can
6787         not be taken.
6788
6789         * expression.cs (LocalVariableReference): During the resolve
6790         phases, create new expressions if we are in a remapping context.
6791         Remove code that dealt with remapping here.
6792
6793         (ParameterReference): same.
6794
6795         (ProxyInstance): New expression, like the `This' expression, but
6796         it is born fully resolved.  We know what we are doing, so remove
6797         the errors that are targeted to user-provided uses of `this'.
6798
6799         * statement.cs (Foreach): our variable is now stored as an
6800         Expression;  During resolution, follow the protocol, dont just
6801         assume it will return this.
6802
6803 2003-08-06  Martin Baulig  <martin@ximian.com>
6804
6805         * support.cs (SeekableStreamReader.cs): New public class.
6806
6807         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
6808         SeekableStreamReader instead of the normal StreamReader.
6809
6810 2003-08-04  Martin Baulig  <martin@ximian.com>
6811
6812         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
6813         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
6814         deambiguate casts and delegate invocations.
6815         (parenthesized_expression): Use the new tokens to ensure this is
6816         not a cast of method invocation.
6817
6818         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
6819         when reading a `)' and Deambiguate_CloseParens () was previously
6820         called.
6821
6822         * expression.cs (ParenthesizedExpression): New class.  This is
6823         just used for the CS0075 test.
6824         (Binary.DoResolve): Check for CS0075.   
6825
6826 2003-07-29  Ravi Pratap  <ravi@ximian.com>
6827
6828         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
6829         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
6830         reference comparison.
6831
6832         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
6833         examine the ReturnType for equality - this is necessary in the
6834         cases of implicit and explicit operators whose signature also
6835         includes the return type.
6836
6837 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
6838
6839         * namespace.cs: Cache the result of the namespace computation,
6840         instead of computing it every time.
6841
6842 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
6843
6844         * decl.cs: Use a global arraylist that we reuse over invocations
6845         to avoid excesive memory consumption.  Reduces memory usage on an
6846         mcs compile by one meg (45 average).
6847
6848         * typemanager.cs (LookupTypeReflection): In .NET pointers are
6849         private, work around that.
6850
6851 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
6852
6853         * literal.cs (IntLiteral): Define Zero and One static literals. 
6854
6855         * cs-parser.jay (integer_literal): use static literals to reduce
6856         memory usage for the most used literals (0, 1 and -1).  211kb
6857         reduced in memory usage.
6858
6859         Replace all calls to `new ArrayList' with `new
6860         ArrayList(4)' which is a good average number for most allocations,
6861         and also requires only 16 bytes of memory for its buffer by
6862         default. 
6863
6864         This reduced MCS memory usage in seven megabytes for the RSS after
6865         bootstrapping.
6866
6867 2003-07-28  Ravi Pratap  <ravi@ximian.com>
6868
6869         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
6870         handle params methods the correct way by forming only one
6871         applicable set with params and normal methods in them. Earlier we
6872         were looking at params methods only if we found no normal methods
6873         which was not the correct thing to do.
6874
6875         (Invocation.BetterFunction): Take separate arguments indicating
6876         when candidate and the best method are params methods in their
6877         expanded form.
6878
6879         This fixes bugs #43367 and #46199.
6880
6881         * attribute.cs: Documentation updates.
6882
6883         (CheckAttribute): Rename to CheckAttributeTarget.
6884         (GetValidPlaces): Rename to GetValidTargets.
6885
6886         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
6887         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
6888
6889         Fixes bug #44468.
6890
6891 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
6892
6893         * codegen.cs: Compute IsGeneric correctly.
6894
6895         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
6896         resolution. 
6897
6898         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
6899         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
6900         regressions, and I was chasing more bugs than I required.
6901
6902         * interface.cs: Use expressions for base type names (like classes
6903         and structs have been doing for a while now), and resolve that.
6904         This patch should probably go into head as well.
6905
6906         This makes it one less user of FindType.
6907
6908 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
6909
6910         This compiler can not self host currently.  Need to fix that.
6911         
6912         * Makefile: compile to `gmcs.exe'
6913
6914         * driver.cs: Turn on v2 by default on gmcs.
6915
6916         * generic.cs (ConstructedType): Does no longer take a container
6917         type argument;  That will be taken care of later.
6918
6919         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
6920         Use SimpleName to resolve for now, so we can continue the work on
6921         the parser, until we get Type.GetType that understands generics.
6922
6923         (ConstructedType.ToString): Implement
6924
6925         (TypeArguments.Resolve): Resolve the child expressions as types. 
6926         
6927         * cs-parser.jay: Rename interface_constraints to
6928         type_parameter_constraints
6929
6930         (namespace_or_type_name): Only use constructed types for the basic
6931         construction, we will deal with identifier<...> later.
6932
6933         (type/type_name): No longer call DecomposeQI, as
6934         namespace_or_type_name is always decoded now.
6935         
6936 2003-07-22  Ravi Pratap  <ravi@ximian.com>
6937
6938         * expression.cs (Invocation.OverloadResolve): Follow the spec more
6939         closely: we eliminate methods in base types when we have an
6940         applicable method in a top-level type.
6941
6942         Please see section 14.5.5.1 for an exact description of what goes
6943         on. 
6944
6945         This fixes bug #45127 and a host of other related to corlib compilation.
6946
6947         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
6948         array is the method corresponding to the top-level type (this is
6949         because of the changes made to icall.c) so we change this
6950         accordingly.
6951
6952         (MethodGroupExpr.Name): This too.
6953
6954         * typemanager.cs (GetElementType): New method which does the right
6955         thing when compiling corlib. 
6956
6957         * everywhere: Make use of the above in the relevant places.
6958
6959 2003-07-22  Martin Baulig  <martin@ximian.com>
6960
6961         * cs-parser.jay (invocation_expression): Moved
6962         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
6963         `cast_expression', but create a InvocationOrCast which later
6964         resolves to either an Invocation or a Cast.
6965
6966         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
6967         method; call this before EmitStatement() to make sure that this
6968         expression can be used as a statement.
6969
6970         * expression.cs (InvocationOrCast): New class; resolves to either
6971         an Invocation or a Cast.
6972
6973         * statement.cs (StatementExpression): Call ResolveStatement() on
6974         the ExpressionStatement before emitting it.
6975
6976 2003-07-21  Martin Baulig  <martin@ximian.com>
6977
6978         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
6979         `ref' and `out' attributes match; fixes #46220.
6980         (MemberAccess.ResolveMemberAccess): You can't reference a type
6981         through an expression; fixes #33180.
6982         (Indexers.GetIndexersForType): Don't return the indexers from
6983         interfaces the class implements; fixes #46502.
6984
6985 2003-07-21  Martin Baulig  <martin@ximian.com>
6986
6987         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
6988         CS0661 checks; fixes bug #30442.
6989
6990 2003-07-21  Martin Baulig  <martin@ximian.com>
6991
6992         * decl.cs (AdditionResult): Added `Error'.
6993
6994         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
6995
6996         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
6997         cs0031.cs actually work.
6998
6999  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7000  
7001         * cs-parser.jay (namespace_name): do not use
7002         namespace_or_type_name, use qualified_identifier, because
7003         namespace_or_type_name will soon return a composed expression
7004         instead of a string.
7005  
7006         (namespace_or_type_name): Instead of returning a string, now this
7007         production returns an expression.
7008  
7009         * codegen.cs (EmitContext): Setup IsGeneric property based on
7010         whether our DeclSpace is generic, our the method is generic.
7011  
7012         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
7013         the method is generic.
7014  
7015         * cs-parser.jay (type_arguments, opt_type_argument_list,
7016         type_parameters, type_parameter_list, opt_type_parameter_list,
7017         type_parameter,, opt_type_parameter_constraints_clauses,
7018         type_parameter_constraints_clauses,
7019         type_parameter_constraint_clause, type_parameter_constraint,
7020         interface_constraints): Add new production
7021  
7022         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
7023         DeclSpace is generic or not.
7024  
7025         (DeclSpace.SetParameterInfo): New routine, used to set the
7026         parameter info for a type.
7027  
7028         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
7029         returns a GenericTypeExpr
7030  
7031         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
7032         generic, lookup the generic argument.
7033  
7034         * attribute.cs: Do not allow TypeParameterExpressions in
7035         Attributes.
7036  
7037         * class.cs: Do not allow the Main method to be defined in a
7038         Generic container.
7039  
7040         * expression.cs (SizeOf): Do not allow generic types to be used as
7041         arguments to sizeof.
7042  
7043         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
7044         it: whether a type is generic or not.  Only works for types we are
7045         currently building for now.
7046         
7047 2003-07-20  Martin Baulig  <martin@ximian.com>
7048
7049         * namespace.cs: Fixed that bug which caused a crash when compiling
7050         the debugger's GUI.
7051
7052 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7053
7054         * typemanager.cs (LookupTypeReflection): Never expose types which
7055         are NotPublic, NestedPrivate, NestedAssembly, or
7056         NestedFamANDAssem.  We used to return these, and later do a check
7057         that would report a meaningful error, but the problem is that we
7058         would not get the real match, if there was a name override.
7059
7060 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7061
7062         * namespace.cs (Namespace, Name): Do not compute the namespace
7063         name dynamically, compute it in the constructor.  This reduced
7064         memory usage by 1697 KB.
7065
7066         * driver.cs: Use --pause to pause at the end.
7067
7068 2003-07-17  Peter Williams  <peter@newton.cx>
7069
7070         * Makefile: Change the name of the test target so that it doesn't
7071         conflict with the recursive test target.
7072
7073 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7074
7075         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7076         AddressOf): Do not use EmitThis, that was wrong, use the actual
7077         this pointer.
7078
7079 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7080
7081         * class.cs (MethodData.Define): While checking if a method is an
7082         interface implementation, improve the test: If we are not public
7083         (use new test here: use the computed MethodAttributes directly,
7084         instead of the parsed modifier flags) check if the `implementing'
7085         method comes from an interface or not.
7086
7087         * pending.cs (VerifyPendingMethods): Slightly better error
7088         message.
7089
7090         * makefile: add test target that does the mcs bootstrap.
7091
7092 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7093
7094         * interface.cs (Define): Do nothing here since there are no
7095         members to populate etc. Move the attribute emission out of here
7096         since this was just totally the wrong place to put it. Attribute
7097         application happens during the 'Emit' phase, not in the 'Define'
7098         phase.
7099
7100         (Emit): Add this method and move the attribute emission here
7101
7102         * rootcontext.cs (EmitCode): Call the Emit method on interface
7103         types too.
7104
7105 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7106
7107         * expression.cs (OverloadResolve): Report error only if Location
7108         is not 'Null' which means that there was a probe going on.
7109
7110 2003-07-14  Martin Baulig  <martin@ximian.com>
7111
7112         * expression.cs (ConditionalLogicalOperator): New public class to
7113         implement user defined conditional logical operators.
7114         This is section 14.11.2 in the spec and bug #40505.
7115
7116 2003-07-14  Martin Baulig  <martin@ximian.com>
7117
7118         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7119
7120 2003-07-14  Martin Baulig  <martin@ximian.com>
7121
7122         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7123
7124         * ecore.cs (IVariable.VerifyFixed): New interface method.
7125
7126         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7127         operator, check whether the variable is actually fixed.  Fixes bug
7128         #36055.  Set a variable definitely assigned when taking its
7129         address as required by the spec.
7130
7131         * statement.cs (LocalInfo.IsFixed): New field.
7132         (LocalInfo.MakePinned): Set `IsFixed' to true.
7133
7134 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7135
7136         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7137         for .ctors, ensure that we only ask for members declared in the
7138         attribute type (BindingFlags.DeclaredOnly).
7139
7140         Fixes bug #43632.
7141
7142         * expression.cs (Error_WrongNumArguments): Report error 1501
7143         correctly the way CSC does.
7144
7145 2003-07-13  Martin Baulig  <martin@ximian.com>
7146
7147         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7148         lookup on the fully qualified name, to make things like "X.X" work
7149         where "X.X" is a fully qualified type name, but we also have a
7150         namespace "X" in the using list.  Fixes #41975.
7151
7152 2003-07-13  Martin Baulig  <martin@ximian.com>
7153
7154         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7155         function. If we're a CompoundAssign, we need to create an embedded
7156         CompoundAssign, not an embedded Assign.
7157         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7158         Fixes #45854.
7159
7160 2003-07-13  Martin Baulig  <martin@ximian.com>
7161
7162         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7163         work to fix bug #46088.
7164
7165 2003-07-13  Ravi Pratap <ravi@ximian.com>
7166
7167         * class.cs (Operator.Emit): Do not emit attributes here - it is
7168         taken care of by the Method class that we delegate too. This takes
7169         care of bug #45876.
7170
7171 2003-07-10  Martin Baulig  <martin@ximian.com>
7172
7173         * expression.cs (TypeOfVoid): New class.
7174         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7175
7176 2003-07-10  Martin Baulig  <martin@ximian.com>
7177
7178         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7179         bug #35957.
7180
7181 2003-07-10  Martin Baulig  <martin@ximian.com>
7182
7183         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7184         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7185
7186         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7187
7188         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7189
7190 2003-07-10  Martin Baulig  <martin@ximian.com>
7191
7192         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7193         of decimal.  Fixes #42850.
7194
7195         NOTE: I also fixed the created byte blob, but this doesn't work on
7196         the MS runtime and csc never produces any byte blobs for decimal
7197         arrays.
7198
7199 2003-07-10  Martin Baulig  <martin@ximian.com>
7200
7201         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7202         structs; fixes #32068.
7203         (Block.AddChildVariableNames): Fixed #44302.
7204
7205 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7206
7207         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7208
7209 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7210
7211         * attribute.cs: And this test is onger needed.
7212
7213 2003-07-08  Martin Baulig  <martin@ximian.com>
7214
7215         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7216         inaccessible types.  Fixes #36313.
7217
7218         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7219
7220         * namespace.cs (NamespaceEntry): Create implicit entries for all
7221         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7222         implicit entries for N1.N2 and N1.
7223
7224 2003-07-08  Martin Baulig  <martin@ximian.com>
7225
7226         Rewrote the handling of namespaces to fix a lot of the issues
7227         wrt. `using' aliases etc.
7228
7229         * namespace.cs (Namespace): Splitted this class into a
7230         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7231
7232         * typemanager.cs (TypeManager.IsNamespace): Removed.
7233         (TypeManager.ComputeNamespaces): Only compute namespaces from
7234         loaded assemblies here, not the namespaces from the assembly we're
7235         currently compiling.
7236
7237 2003-07-08  Martin Baulig  <martin@ximian.com>
7238
7239         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7240
7241 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7242
7243         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7244         already fixed it.  
7245
7246         I thought about the memory savings here, but LookupTypeReflection
7247         is used under already very constrained scenarios.  Compiling
7248         corlib or mcs only exposes one hit, so it would not really reduce
7249         any memory consumption.
7250
7251 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7252
7253         * typemanager.cs: fixes bug #45889 by only adding public types from
7254         other assemblies to the list of known types.
7255
7256 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7257
7258         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7259         on the type we resolved.
7260
7261 2003-07-05  Martin Baulig  <martin@ximian.com>
7262
7263         * pending.cs (PendingImplementation.ParentImplements): Don't
7264         create the proxy if the parent is abstract.
7265
7266         * class.cs (TypeContainer.DefineIndexers): Process explicit
7267         interface implementations first.  Fixes #37714.
7268
7269 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7270
7271         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7272         defined recursively;  but since we modify the input parameters
7273         (left is set to `this' temporarily), we reset this value if the
7274         left_is_explicit is false, which gives the original semantics to
7275         the code.  
7276
7277         * literal.cs (NullPointer): new class used to represent a null
7278         literal in a pointer context.
7279
7280         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7281         type is a pointer, use a NullPointer object instead of a
7282         NullLiteral.   Closes 43687
7283
7284         (ExplicitConversion): Convert pointer values using
7285         the conv opcode to the proper type.
7286
7287         * ecore.cs (New): change ValueTypeVariable property into a method,
7288         that returns whether the valuetype is suitable for being used.
7289
7290         * expression.cs (Binary.DoNumericPromotions): Only return if we
7291         the int constant was a valid uint, and we can return both left and
7292         right as uints.  If not, we continue processing, to trigger the
7293         type conversion.  This fixes 39018.
7294
7295         * statement.cs (Block.EmitMeta): During constant resolution, set
7296         the CurrentBlock property on the emitcontext, so that we resolve
7297         constants propertly.
7298
7299 2003-07-02  Martin Baulig  <martin@ximian.com>
7300
7301         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7302         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7303
7304         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7305         than emitting it here.
7306
7307         * statement.cs: Fixed some more flow analysis bugs.
7308
7309 2003-07-02  Martin Baulig  <martin@ximian.com>
7310
7311         * class.cs (MethodData.Define): When implementing interface
7312         methods, set Final unless we're Virtual.
7313
7314         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7315         check work for interface methods.
7316
7317 2003-07-01  Martin Baulig  <martin@ximian.com>
7318
7319         * ecore.cs (EmitContext.This): Replaced this property with a
7320         GetThis() method which takes a Location argument.  This ensures
7321         that we get the correct error location for a CS0188.
7322
7323 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7324
7325         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7326         ImplicitStandardConversion.
7327
7328         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7329
7330 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7331
7332         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7333         optimization.
7334
7335 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7336
7337         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7338         constructors.
7339
7340         (MethodData.Define): Turn off initlocals for unsafe methods.
7341
7342 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7343
7344         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7345         complete;  Fixes #37521.
7346
7347         * delegate.cs: Use Modifiers.TypeAttr to compute the
7348         TypeAttributes, instead of rolling our own.  This makes the flags
7349         correct for the delegates.
7350
7351 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7352
7353         * class.cs (Constructor.Define): Set the private flag for static
7354         constructors as well.
7355
7356         * cs-parser.jay (statement_expression): Set the return value to
7357         null, to avoid a crash when we catch an error.
7358
7359 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7360
7361         * cs-parser.jay: Applied patch from Jackson that adds support for
7362         extern and unsafe modifiers to destructor declarations.
7363
7364         * expression.cs: Report error 21 if the user is trying to index a
7365         System.Array.
7366
7367         * driver.cs: Add an error message, suggested by the bug report.
7368
7369         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7370         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7371
7372 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7373
7374         * namespace.cs: Add some information to reduce FAQs.
7375
7376 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7377
7378         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7379         underlying enumeration types.  Fixes #43915.
7380
7381         * expression.cs: Treat ushort/short as legal values to be used in
7382         bitwise operations.
7383
7384 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7385
7386         * delegate.cs: transfer custom attributes for paramenters from
7387         the delegate declaration to Invoke and BeginInvoke.
7388
7389 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7390
7391         * attribute.cs: handle custom marshalers and emit marshal info
7392         for fields, too.
7393
7394 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7395
7396         * makefile.gnu: Added anonymous.cs to the compiler sources.
7397
7398 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7399
7400         * iterators.cs: Change the name of the proxy class to include two
7401         underscores.
7402
7403         * cs-parser.jay: Update grammar to include anonymous methods.
7404
7405         * anonymous.cs: new file.
7406
7407 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7408
7409         * class.cs (Field.Define): Add missing test for pointers and
7410         safety. 
7411
7412 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7413
7414         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7415         we use the stobj opcode.
7416
7417         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7418         since it wasn't the correct fix. 
7419
7420         It still is puzzling that we are required to use stobj for IntPtr
7421         which seems to be a ValueType.
7422
7423 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7424
7425         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7426         during regular simple name resolution.   Now, the trick is that
7427         instead of returning for processing the simplename, we do a
7428         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7429         contextual lookup type).   If a match is found, return that, if
7430         not, return for further composition.
7431
7432         This fixes long-standing 30485.
7433
7434         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7435         using the address to initialize an object, do an Stobj instead of
7436         using the regular Stelem.
7437
7438         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7439         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7440         Because if we are a BaseIndexerAccess that value will be true.
7441         Fixes 43643.
7442
7443         * statement.cs (GotoCase.Resolve): Return after reporting an
7444         error, do not attempt to continue. 
7445
7446         * expression.cs (PointerArithmetic.Emit): If our operand is a
7447         long, convert our constants to match the operand before
7448         multiplying.  Convert to I type before adding.   Fixes 43670.
7449
7450 2003-05-14  Ravi Pratap  <ravi@ximian.com>
7451
7452         * enum.cs (ImplicitConversionExists) : Rename to
7453         ImplicitEnumConversionExists to remove ambiguity. 
7454
7455         * ecore.cs (NullCast): New type of cast expression class which
7456         basically is very similar to EmptyCast with the difference being
7457         it still is a constant since it is used only to cast a null to
7458         something else
7459         (eg. (string) null)
7460
7461         * convert.cs (ImplicitReferenceConversion): When casting a null
7462         literal, we return a NullCast.
7463
7464         * literal.cs (NullLiteralTyped): Remove - I don't see why this
7465         should be around anymore.
7466
7467         The renaming (reported was slightly wrong). Corrections:
7468
7469         ConvertImplicitStandard -> ImplicitConversionStandard
7470         ConvertExplicitStandard -> ExplicitConversionStandard
7471
7472         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
7473         before passing them in !
7474
7475         * convert.cs (ImplicitConversionStandard): When comparing for
7476         equal expr and target types, ensure that expr is not a
7477         NullLiteral.
7478
7479         In general, we must not be checking (expr_type ==
7480         target_type) in the top level conversion methods
7481         (ImplicitConversion, ExplicitConversion etc). This checking is
7482         done in the methods that they delegate to.
7483
7484 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
7485
7486         * convert.cs: Move Error_CannotConvertType,
7487         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
7488         ImplicitNumericConversion, ImplicitConversionExists,
7489         ImplicitUserConversionExists, StandardConversionExists,
7490         FindMostEncompassedType, FindMostSpecificSource,
7491         FindMostSpecificTarget, ImplicitUserConversion,
7492         ExplicitUserConversion, GetConversionOperators,
7493         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
7494         TryImplicitIntConversion, Error_CannotConvertImplicit,
7495         ConvertImplicitRequired, ConvertNumericExplicit,
7496         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
7497         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
7498         its own file.
7499
7500         Perform the following renames:
7501
7502         StandardConversionExists -> ImplicitStandardConversionExists
7503         ConvertImplicit -> ImplicitConversion
7504         ConvertImplicitStandard -> ImplicitStandardConversion
7505         TryImplicitIntConversion -> ImplicitIntConversion
7506         ConvertImplicitRequired -> ImplicitConversionRequired
7507         ConvertNumericExplicit -> ExplicitNumericConversion
7508         ConvertReferenceExplicit -> ExplicitReferenceConversion
7509         ConvertExplicit -> ExplicitConversion
7510         ConvertExplicitStandard -> ExplicitStandardConversion
7511
7512 2003-05-19  Martin Baulig  <martin@ximian.com>
7513
7514         * statement.cs (TypeInfo.StructInfo): Made this type protected.
7515         (TypeInfo): Added support for structs having structs as fields.
7516
7517         * ecore.cs (FieldExpr): Implement IVariable.
7518         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
7519         VariableInfo for the field.
7520
7521 2003-05-18  Martin Baulig  <martin@ximian.com>
7522
7523         * expression.cs (This.DoResolve): Report a CS0027 if we're
7524         emitting a field initializer.
7525
7526 2003-05-18  Martin Baulig  <martin@ximian.com>
7527
7528         * expression.cs (This.ResolveBase): New public function.
7529         (This.DoResolve): Check for CS0188.
7530
7531         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
7532         This.Resolve().
7533
7534         * ecore.cs (MethodGroupExpr.DoResolve): Set the
7535         `instance_expression' to null if we don't have any non-static
7536         methods.
7537
7538 2003-05-18  Martin Baulig  <martin@ximian.com>
7539
7540         Reworked the way how local variables and parameters are handled by
7541         the flow analysis code.
7542
7543         * statement.cs (TypeInfo, VariableMap): New public classes.
7544         (VariableInfo): New public class.  This is now responsible for
7545         checking whether a variable has been assigned.  It is used for
7546         parameters and local variables.
7547         (Block.EmitMeta): Take the InternalParameters as argument; compute
7548         the layout of the flow vectors here.
7549         (Block.LocalMap, Block.ParameterMap): New public properties.
7550         (FlowBranching): The .ctor doesn't get the InternalParameters
7551         anymore since Block.EmitMeta() now computes the layout of the flow
7552         vector.
7553         (MyStructInfo): This class is now known as `StructInfo' and nested
7554         in `TypeInfo'; we don't access this directly anymore.
7555
7556         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
7557         property and removed IsAssigned(), IsFieldAssigned(),
7558         SetAssigned() and SetFieldAssigned(); we now call them on the
7559         VariableInfo so we don't need to duplicate this code everywhere.
7560
7561         * expression.cs (ParameterReference): Added `Block block' argument
7562         to the .ctor.
7563         (LocalVariableReference, ParameterReference, This): The new
7564         VariableInfo class is now responsible for all the definite
7565         assignment stuff.
7566
7567         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
7568         IsParameterAssigned, SetParameterAssigned): Removed.
7569
7570 2003-05-18  Martin Baulig  <martin@ximian.com>
7571
7572         * typemanager.cs (InitCoreTypes): Try calling
7573         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
7574         the 3-args-version.  Corlib now also needs our `void_type'.
7575         (GetMethod): Added overloaded version which takes an optional
7576         `bool report_errors' to allow lookups of optional methods.
7577
7578 2003-05-12  Martin Baulig  <martin@ximian.com>
7579
7580         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
7581         only used for locals and not for parameters.
7582
7583 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
7584
7585         * support.cs (InternalParameters.ParameterType): Return the
7586         ExternalType of the parameter.
7587
7588         * parameter.cs (Parameter.ExternalType): drop the two arguments,
7589         they were unused.
7590
7591 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
7592
7593         * class.cs (MethodData.Define): Do not set the `newslot' on
7594         interface members, if they are also flagged as "override".
7595
7596         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
7597         better code for ++i and i++.  This only works for static fields
7598         and local variables.
7599
7600         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
7601         want to pull the DeclSpace out of the builder_to_declspace instead
7602         of the TypeBuilder (like in TypeContainer.FindMembers).
7603
7604         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
7605         instead of LookupTypeContainer.  Fixes the crash on .NET for
7606         looking up interface members.
7607
7608         * const.cs: Create our own emit context during the Definition
7609         stage, so that constants are evaluated in the proper context, when
7610         a recursive definition happens.
7611
7612 2003-05-11  Martin Baulig  <martin@ximian.com>
7613
7614         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
7615         new block for a switch section.
7616         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
7617         the adding/lookup in the switch block.  Fixes #39828.
7618
7619 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
7620
7621         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
7622         functionality: I needed to convert the data after I had performed
7623         the add/sub operation into the operands type size.
7624
7625         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
7626         pass the type for the box operation, otherwise the resulting
7627         object would have been of type object.
7628
7629         (BoxedCast): Add constructor to specify the type to box as.
7630
7631 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
7632
7633         * iterators.cs: I was reusing the `count' variable inadvertently,
7634         take steps to not allow this to happen.
7635
7636 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
7637
7638         * attribute.cs (Attribute.Resolve): Params attributes are encoded
7639         by creating an array at the point where the params starts and
7640         putting all those arguments there, then adjusting the size of the
7641         array.
7642
7643 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
7644
7645         * expression.cs (New.AddressOf): Implement interface
7646         IMemoryLocation.  This is used when the `new' operator is used in
7647         the context of an invocation to a method on a value type.
7648
7649         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
7650         example. 
7651
7652         * namespace.cs: Also check the using aliases here.
7653
7654         * driver.cs: Move the test for using validity after the types have
7655         been entered, so we do a single pass that also includes the using
7656         aliases. 
7657
7658         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
7659         in the regular case.   CreateSiblingForFinally is doing extra
7660         error checking.
7661
7662         * attribute.cs (GetAttributeArgumentExpression): Store the result
7663         on an out value, and use the return value to indicate failure
7664         instead of using null (which is a valid return for Constant.GetValue).
7665
7666         * statement.cs: Perform the analysis flow for the increment
7667         portion after the statement, because this will be the real flow of
7668         execution.  Fixes #42385
7669
7670         * codegen.cs (EmitContext.EmitArgument,
7671         EmitContext.EmitStoreArgument): New helper functions when the
7672         RemapToProxy flag is set.
7673
7674         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
7675         function.
7676
7677         Add support for remapping parameters. 
7678
7679         * iterators.cs: Propagate parameter values;  Store parameter
7680         values in the proxy classes.
7681
7682 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
7683
7684         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
7685         need a proxy reference;  I do not know what I was thinking
7686
7687         * cs-parser.jay (constructor_initializer): catch another error,
7688         and display nice message.
7689
7690         (field_declaration): catch void field declaration
7691         to flag a better error. 
7692
7693         * class.cs (MemberBase.CheckBase): Report an error instead of a
7694         warning if a new protected member is declared in a struct. 
7695         (Field.Define): catch the error of readonly/volatile.
7696
7697         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
7698
7699         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
7700         volatile variable is taken
7701
7702 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
7703
7704         * statement.cs (Fixed.Resolve): Report an error if we are not in
7705         an unsafe context.
7706
7707 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
7708
7709         * typemanager.cs: reuse the code that handles type clashes for
7710         delegates and enumerations.
7711
7712         * class.cs (Report28): Always report.
7713
7714         * expression.cs (EncodeAsAttribute): Allow nulls here.
7715
7716 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
7717
7718         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
7719         the functionality for testing whether an expression is valid for
7720         an attribute here.  Also handle the case of arrays of elements
7721         being stored. 
7722
7723         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
7724         encoding a linear array into an array of objects that are suitable
7725         to be passed to an CustomAttributeBuilder.
7726
7727         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
7728
7729         * ecore.cs: (FieldExpr): Handle field remapping here.
7730
7731         * iteratators.cs: Pass the instance variable (if the method is an
7732         instance method) to the constructors, so we can access the field
7733         variables on the class.
7734
7735         TODO: Test this with structs.  I think the THIS variable on
7736         structs might have to be a pointer, and not a refenrece
7737
7738 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
7739
7740         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
7741         local variables to fields in a proxy class.
7742
7743         * iterators.cs (PopulateProxy): Rename our internal fields to
7744         <XXX>.  
7745         Create a <THIS> field if we are an instance method, so we can
7746         reference our parent container variables.
7747         (MapVariable): Called back from the EmitContext code to enter a
7748         new variable to field mapping into the proxy class (we just create
7749         a FieldBuilder).
7750
7751         * expression.cs
7752         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
7753         for using the remapped locals to fields.
7754
7755         I placed the code here, because that gives the same semantics to
7756         local variables, and only changes the Emit code.
7757
7758         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
7759         statements inside iterators.
7760         (VariableInfo): Add a FieldBuilder for the cases when we are
7761         remapping local variables to fields in a proxy class
7762
7763         * ecore.cs (SimpleNameResolve): Avoid testing two times for
7764         current_block != null.
7765
7766         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
7767         not cope with strings, as it has been moved to the
7768         TableSwitchEmit.  Fixed bug in switch generation.
7769
7770         * expression.cs (New.DoResolve): Provide more context for the user
7771         when reporting an error.
7772
7773         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
7774         pointers. 
7775
7776         * expression.cs (MemberAccess.DoResolve): When we get a type back,
7777         check the permissions for it.  Note than in a type-resolution
7778         context the check was already present in DeclSpace.ResolveType,
7779         but was missing from the MemberAccess.
7780
7781         (ArrayCreation.CheckIndices): warn if the user has
7782         more nested levels of expressions, but there are no more
7783         dimensions specified.  Avoids crash on bug 41906.
7784
7785 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
7786
7787         * statement.cs (Block): replace Implicit bool, for a generic
7788         flags.   
7789         New flag: `Unchecked'.  This is used during the EmitMeta phase
7790         (which is out-of-line with the regular Resolve/Emit process for a
7791         statement, as this is done ahead of time, but still gets a chance
7792         to call constant resolve).
7793
7794         (Block.Flags): new enum for adding a new flag.
7795
7796         (Block.EmitMeta): track the state of unchecked.
7797
7798         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
7799         to enable constant resolution to work there as well.
7800
7801 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
7802
7803         * typemanager.cs (ienumerable_type): Also look up
7804         System.Collections.IEnumerable. 
7805
7806 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
7807
7808         TODO: Test more than one conditional per method.
7809
7810         * class.cs (Indexer.Define): Report the location where the user is
7811         referencing the unsupported feature.
7812
7813         (MethodData): Overload the use of `conditionals' to
7814         minimize the creation of needless ArrayLists.   This saves roughly
7815         212kb on my machine.
7816
7817         (Method): Implement the new IIteratorContainer interface.
7818         (Method.SetYields): Implement the method by setting the ModFlags
7819         to contain METHOD_YIELDS.
7820
7821         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
7822         which just got set to null.
7823
7824         * iterators.cs: New file.
7825
7826         (Yield, YieldBreak): New statements.
7827
7828         * statement.cs (Return.Resolve): Flag an error if we are used in
7829         an iterator method.
7830
7831         * codegen.cs (InIterator): New flag set if the code is being
7832         compiled in an iterator method.
7833
7834         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
7835         internal modifier, and we just use it to avoid adding extra
7836         fields, as this is seldom used.  
7837
7838         * cs-parser.jay: Add yield_statement (yield and yield break).
7839
7840         * driver.cs: New flag -v2 to turn on version 2 features. 
7841
7842         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
7843         hashtable when v2 is enabled.
7844
7845 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
7846
7847         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
7848         there is already a namespace defined with this name.
7849
7850         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
7851         people upgraded their corlibs.
7852
7853         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
7854         always use fully qualified types, no need to use the compiler
7855         front end.
7856
7857         (TypeManager.IsNamespace): Use binarysearch.
7858
7859         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
7860         AddDelegate): I did not quite use the new IsValid API properly: I
7861         have to pass the short-name and the fullname.  I was passing only
7862         the basename instead of the fullname sometimes. 
7863
7864         (TypeContainer.DefineType): call NamespaceClash.
7865
7866         * interface.cs (Interface.DefineType): use NamespaceClash before
7867         defining the type.
7868
7869         * delegate.cs (Delegate.DefineType): use NamespaceClash before
7870         defining the type.
7871
7872         * enum.cs: (Enum.DefineType): use NamespaceClash before
7873         defining the type.
7874
7875         * typemanager.cs (: 3-line patch that gives us some tasty 11%
7876         speed increase.  First, use the negative_hits cache when we get a
7877         negative.  Second, add the type with its full original name
7878         instead of the new . and + encoded name (reflection uses + to
7879         separate type from a nested type).  Use LookupTypeReflection
7880         directly which bypasses the type->name hashtable (that we already
7881         know does not contain the type.
7882
7883         * decl.cs (DeclSpace.ResolveTypeExpr): track the
7884         location/container type. 
7885
7886         * driver.cs: When passing utf8, use directly the UTF8Encoding.
7887
7888 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
7889
7890         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
7891
7892         * delegate.cs (NewDelegate.Resolve): Test whether an instance
7893         method is being referenced in the method group from a static
7894         context, and report error 120 if so.
7895
7896         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
7897         Error118. 
7898
7899         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
7900         is created, we create the A namespace).
7901
7902         * cs-parser.jay: A namespace also introduces a DeclarationFound.
7903         Fixes #41591
7904
7905 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
7906
7907         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
7908         invocation to ModuleBuilder.GetType with the same values will
7909         return a new type instance, so we need to cache its return
7910         values. 
7911
7912         * expression.cs (Binary.ResolveOperator): Only allow the compare
7913         operators on enums if they are of the same type.
7914
7915         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
7916         types of ValueType on their own case.  Before we were giving them
7917         the same treatment as objects.
7918
7919         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
7920         fullname.  Short name is used to compare against container name.
7921         Fullname is used to check against defined namespace names.
7922
7923         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
7924         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
7925
7926         (Method.CheckBase): Call parent.
7927         (MemberBase.CheckBase): Check for protected members on sealed
7928         classes.
7929         (PropertyBase.CheckBase): Call parent.
7930         (Field.Define): Call parent.
7931
7932         * report.cs: Negative error codes are now mapped to 8000 - code,
7933         so that the display is render more nicely.
7934
7935         * typemanager.cs: Do not use try/catch, instead report a regular
7936         error. 
7937
7938         (GetPointerType, GetReferenceType): These methods provide
7939         mechanisms to obtain the T* and T& from a T.  We had the code
7940         previously scattered around the code base, and it also used
7941         TypeManager.LookupType that would go through plenty of caches.
7942         This one goes directly to the type source.
7943
7944         In some places we did the Type.GetType followed by
7945         ModuleBuilder.GetType, but not in others, so this unifies the
7946         processing as well.
7947
7948         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
7949         statements now that we have namespace information.
7950
7951         * typemanager.cs (IsNamespace): New method, returns whether the
7952         string presented is a namespace or not.
7953
7954         (ComputeNamespaces): New public entry point, computes the list of
7955         available namespaces, using the GetNamespaces API call in Mono, or
7956         the slower version in MS.NET.   
7957
7958         Now before we start the semantic analysis phase, we have a
7959         complete list of namespaces including everything that the user has
7960         provided.
7961
7962         Deleted old code to cache namespaces in .nsc files.
7963
7964 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
7965
7966         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
7967         class/struct location definition Location for the implicit
7968         constructor location.
7969
7970         (Operator.Define): Use the location of the operator for the
7971         implicit Method definition.
7972
7973         (Constructor.Emit): use the constructor location for the implicit
7974         base initializer constructor.
7975
7976         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
7977         and the Expression class now contains two new methods:
7978
7979         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
7980         isolate type lookup from the rest of the resolution process.
7981
7982         Since we use Expressions to hold type definitions due to the way
7983         we parse the input we have historically overloaded Resolve to
7984         perform the Type lookups if a special flag is passed.  Now this is
7985         eliminated and two methods take their place. 
7986
7987         The differences in the two methods between xStep and xTerminal is
7988         that xStep is involved in our current lookup system that uses
7989         SimpleNames to compose a name, while xTerminal is used just to
7990         catch the case where the simplename lookup failed.
7991
7992 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
7993
7994         * expression.cs (ResolveMemberAccess): Remove redundant code.
7995         TypeExpr expressions are always born fully resolved.
7996
7997         * interface.cs (PopulateMethod): Do not lookup the types twice.
7998         We were doing it once during SemanticAnalysis and once during
7999         PopulateMethod.
8000
8001         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8002         in local variable type definitions, were being returned as a
8003         SimpleName (we decomposed everything into a string), that is
8004         because primary_expression was being used instead of a type in the
8005         grammar (reduce/reduce conflicts).
8006
8007         The part that was wrong is that we converted the expression into a
8008         string (an oversimplification in one hand, compounded with primary
8009         expressions doing string concatenation).
8010
8011         So things like:
8012
8013         A.B.C [] x;
8014
8015         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8016         using clauses from working on this particular context.  And a type
8017         was being matched directly against "A.B.C[]".
8018
8019         We now use the correct approach, and allow for ComposedCast to be
8020         part of the unary expression.  So the "A.B.C []" become a composed
8021         cast of "A.B.C" (as a nested group of MemberAccess with a
8022         SimpleName at the end) plus the rank composition "[]". 
8023
8024         Also fixes 35567
8025
8026 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8027
8028         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8029         for the access level checking.
8030
8031         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8032         `TypeContainer container', because I kept getting confused when I
8033         was debugging this code.
8034
8035         * expression.cs (Indexers): Instead of tracking getters/setters,
8036         we now track them in parallel.  We create one arraylist less, but
8037         most importantly it is possible now for the LValue code to find a
8038         matching get for a set.
8039
8040         (IndexerAccess.DoResolveLValue): Update the code.
8041         GetIndexersForType has been modified already to extract all the
8042         indexers from a type.  The code assumed it did not.
8043
8044         Also make the code set the correct return type for the indexer.
8045         This was fixed a long time ago for properties, but was missing for
8046         indexers.  It used to be void_type.
8047
8048         (Binary.Emit): Test first for doubles instead of
8049         floats, as they are more common.
8050
8051         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8052         when dealing with floats and the <=, >= operators.  This fixes bug
8053         #39314 
8054
8055         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8056         to load the array value by emitting a load on the foreach variable
8057         type.  This was incorrect.  
8058
8059         We now emit the code to load an element using the the array
8060         variable type, and then we emit the conversion operator.
8061
8062         Fixed #40176
8063
8064 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8065
8066         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8067
8068 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8069
8070         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8071         test for protection before we test for signatures. 
8072
8073         (MethodSignature.ToString): implement.
8074
8075         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8076         to the case where we reduced into a LongConstant.
8077
8078         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8079         depend on whether the information is acurrate, because the
8080         Microsoft runtime will always claim that the array type is public,
8081         regardless of the real state.
8082
8083         If the type is a pointer, another problem happens: the type is
8084         reported as non-public in Microsoft.  
8085
8086         In both cases we have to call CheckAccessLevel recursively with
8087         the underlying type as the argument to be tested.
8088
8089 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8090
8091         * assign.cs (Assign.Emit): If we are dealing with a compound
8092         assignment expression, we should use the code path that stores the
8093         intermediate result in a temporary value.  This fixes #40903.
8094
8095         *expression.cs (Indirection.ToString): Provide ToString method for
8096         debugging. 
8097
8098 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8099
8100         * class.cs: Null out fields holding references to Block objects so
8101         they can be garbage collected.
8102
8103         * expression.cs (OverloadResolve): Remove unused local.
8104
8105 2003-04-07  Martin Baulig  <martin@ximian.com>
8106
8107         * codegen.cs (EmitContext.CurrentFile): New public field.
8108         (EmitContext.Mark): Use the CurrentFile to check whether the
8109         location is in the correct file.
8110         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8111
8112 2003-04-07  Martin Baulig  <martin@ximian.com>
8113
8114         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8115
8116         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8117         location.  [FIXME: The location argument which gets passed to this
8118         method is sometimes wrong!]
8119
8120 2003-04-07  Nick Drochak <ndrochak@gol.com>
8121
8122         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8123
8124 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8125
8126         * expression.cs (Indirection.EmitAssign): We were using the
8127         temporary, but returning immediately instead of continuing the
8128         EmitAssing flow.
8129
8130 2003-04-06  Martin Baulig  <martin@ximian.com>
8131
8132         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8133         if it's a nested child, but also deriving from the outer class.
8134         See test 190.cs.
8135
8136         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8137         nested child, but also deriving from the outer class.  See
8138         test-190.cs.
8139         (FilterWithClosure): We may access private members of the outer
8140         class if we're a nested child and deriving from the outer class.
8141         (RealMemberLookup): Only set `closure_private_ok' if the
8142         `original_bf' contained BindingFlags.NonPublic.
8143
8144 2003-04-05  Martin Baulig  <martin@ximian.com>
8145
8146         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
8147         probe if its a type parameter, and if so, flag an error.
8148
8149         * decl.cs: Move here the SetParameterInfo code from class.cs.
8150         Handle IsGeneric here.
8151
8152         Handle a variety of errors in the parameter info definition.
8153
8154         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
8155         type parameters here.
8156
8157         * cs-parser.jay (class_declaration): report errors for parameters
8158         here as well.
8159
8160 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
8161
8162         * generic.cs: New file, contains support code for generics.
8163
8164         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
8165         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
8166
8167         Update parser for the above removals.
8168
8169         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
8170         now taken care of in the parser.
8171
8172 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8173
8174         * class.cs (Event.Define): Do not allow abstract events to have
8175         initializers. 
8176
8177 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8178
8179         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8180         block in event declarations.
8181
8182         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8183         value type, get its address.
8184
8185         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8186         leaving a class on the stack instead of a boolean value (int
8187         0/1).  Change the code so we compare against null, and then the
8188         result against zero.
8189
8190         * class.cs (TypeContainer.GetClassBases): We were checking for the
8191         parent class being sealed too late.
8192
8193         * expression.cs (Binary.Emit): For <= and >= when dealing with
8194         floating point values, use cgt.un and clt.un instead of cgt and
8195         clt alone.
8196
8197 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8198
8199         * statement.cs: Apply the same optimization as MS: skip the 
8200         GetEnumerator returning an IEnumerator, and use the one returning a 
8201         CharEnumerator instead. This allows us to avoid the try-finally block 
8202         and the boxing.
8203
8204 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8205
8206         * cs-parser.jay: Attributes cannot be applied to
8207                          namespaces. Fixes #40473
8208
8209 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8210
8211         * class.cs:
8212         (Add*): check if the name is valid using the full name for constants,
8213         fields, properties and events.
8214
8215 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8216
8217         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8218         char constants to be part of the enumeration.
8219
8220         * expression.cs (Conditional.DoResolve): Add support for operator
8221         true. Implements the missing functionality from 14.12
8222
8223         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8224         operator true/false as required by the spec.
8225
8226         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8227         implicit conversion to boolean.
8228
8229         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8230         also one where the type implements `operator true'. 
8231
8232         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8233         get an expression that will invoke operator true based on an
8234         expression.  
8235
8236         (GetConversionOperators): Removed the hack that called op_True
8237         here.  
8238
8239         (Expression.ResolveBoolean): Move this from Statement.
8240
8241 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8242
8243         * ecore.cs (FieldExpr): do not allow initialization of initonly
8244         fields on derived classes
8245
8246 2003-03-13  Martin Baulig  <martin@ximian.com>
8247
8248         * statement.cs (Block.Emit): Call ig.BeginScope() and
8249         ig.EndScope() when compiling with debugging info; call
8250         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8251
8252 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8253
8254         * expression.cs (Indexers): Do not construct immediately, allow
8255         for new members to be appended as we go.  Fixes 38143
8256
8257 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8258
8259         * expression.cs: save/restore context when resolving an unchecked
8260         expression.
8261
8262 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8263
8264         * cfold.cs: Catch division by zero in modulus operator during
8265         constant folding.
8266
8267 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8268
8269         * interface.cs (Interface.DefineMembers): Avoid defining members
8270         twice. 
8271
8272 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8273
8274         * driver.cs: handle the +/- options for -noconfig
8275
8276         * statement.cs (Unckeched.Resolve): Also track the state of
8277         unchecked in the Resolve phase.
8278
8279 2003-02-27  Martin Baulig  <martin@ximian.com>
8280
8281         * ecore.cs (Expression.MemberLookup): Don't create a
8282         MethodGroupExpr for something which is not a method.  Fixes #38291.
8283
8284 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8285
8286         * class.cs (MemberBase.CheckParameters): Also check that the type
8287         is unmanaged if it is a pointer.
8288
8289         * expression.cs (SizeOf.Resolve): Add location information.
8290
8291         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8292         a managed type is declared.
8293
8294         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8295         parameter modifiers as well.  Fixes bug 38606
8296
8297         * class.cs: Very sad.  Am backing out the speed up changes
8298         introduced by the ArrayList -> Array in the TypeContainer, as they
8299         were not actually that much faster, and introduced a bug (no error
8300         reports on duplicated methods).
8301
8302         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8303         source first, this will guarantee that we have a valid expression
8304         before calling in lower levels functions that will require a
8305         resolved object.  Then use this original_source in the
8306         target.ResolveLValue instead of the original source that was
8307         passed to us.
8308
8309         Another change.  Use target.Resolve instead of LValueResolve.
8310         Although we are resolving for LValues, we will let the Assign code
8311         take care of that (it will be called again from Resolve).  This
8312         basically allows code like this:
8313
8314         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8315         class Y { void A (X x) { x [0] += o; }
8316
8317         The problem was that the indexer was trying to resolve for
8318         set_Item (idx, object o) and never finding one.  The real set_Item
8319         was set_Item (idx, X).  By delaying the process we get the right
8320         semantics. 
8321
8322         Fixes bug 36505
8323
8324 2003-02-23  Martin Baulig  <martin@ximian.com>
8325
8326         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8327         while calling DoEmit ().
8328
8329         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8330         source files; if you use the #line directive inside a method, the
8331         compiler stops emitting line numbers for the debugger until it
8332         reaches the end of the method or another #line directive which
8333         restores the original file.
8334
8335 2003-02-23  Martin Baulig  <martin@ximian.com>
8336
8337         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8338
8339 2003-02-23  Martin Baulig  <martin@ximian.com>
8340
8341         * statement.cs (Block.AddChildVariableNames): We need to call this
8342         recursively, not just for our immediate children.
8343
8344 2003-02-23  Martin Baulig  <martin@ximian.com>
8345
8346         * class.cs (Event.Define): Always make the field private, like csc does.
8347
8348         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8349         actually work, fixes bug #37521.
8350
8351 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8352
8353         * delegate.cs: When creating the various temporary "Parameters"
8354         classes, make sure that we call the ComputeAndDefineParameterTypes
8355         on those new parameters (just like we do with the formal ones), to
8356         allow them to be resolved in the context of the DeclSpace.
8357
8358         This fixes the bug that Dick observed in Bugzilla #38530.
8359
8360 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8361
8362         * expression.cs (ResolveMemberAccess): When resolving a constant,
8363         do not attempt to pull a constant if the value was not able to
8364         generate a valid constant.
8365
8366         * const.cs (LookupConstantValue): Do not report more errors than required.
8367
8368 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8369
8370         * expression.cs: fixes bug #38328.
8371
8372 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8373
8374         * class.cs: Changed all the various members that can be part of a
8375         class from being an ArrayList to be an Array of the right type.
8376         During the DefineType type_list, interface_list, delegate_list and
8377         enum_list are turned into types, interfaces, delegates and enums
8378         arrays.  
8379
8380         And during the member population, indexer_list, event_list,
8381         constant_list, field_list, instance_constructor_list, method_list,
8382         operator_list and property_list are turned into their real arrays.
8383
8384         Although we could probably perform this operation earlier, for
8385         good error reporting we need to keep the lists and remove the
8386         lists for longer than required.
8387
8388         This optimization was triggered by Paolo profiling the compiler
8389         speed on the output of `gen-sample-program.pl' perl script. 
8390
8391         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8392         not crash in methods like MemberLookupFailed that use this field.  
8393
8394         This problem arises when the compiler fails to resolve a type
8395         during interface type definition for example.
8396
8397 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8398
8399         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8400         inherit from System.Object, so we have to stop at null, not only
8401         when reaching System.Object.
8402
8403 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8404
8405         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8406         DeclaredOnly because the parent indexer might have had a different
8407         name, but did not loop until the top of the hierarchy was reached.
8408
8409         The problem this one fixes is 35492: when a class implemented an
8410         indexer from an interface, we were getting the interface method
8411         (which was abstract) and we were flagging an error (can not invoke
8412         abstract method).
8413
8414         This also keeps bug 33089 functioning, and test-148 functioning.
8415
8416         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8417         out if a method is special is to see if it is declared in a
8418         property or event, or whether it is one of the predefined operator
8419         names.   This should fix correctly #36804.
8420
8421 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8422
8423         The goal here is to remove the dependency on EmptyCast.Peel ().
8424         Killing it completely.
8425
8426         The problem is that currently in a number of places where
8427         constants are expected, we have to "probe" for an EmptyCast, and
8428         Peel, which is not the correct thing to do, as this will be
8429         repetitive and will likely lead to errors. 
8430
8431         The idea is to remove any EmptyCasts that are used in casts that
8432         can be reduced to constants, so we only have to cope with
8433         constants. 
8434
8435         This bug hunt was triggered by Bug 37363 and the desire to remove
8436         the duplicate pattern where we were "peeling" emptycasts to check
8437         whether they were constants.  Now constants will always be
8438         constants.
8439
8440         * ecore.cs: Use an enumconstant here instead of wrapping with
8441         EmptyCast.  
8442
8443         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8444         throwing me off.  By handling this we can get rid of a few hacks.
8445
8446         * statement.cs (Switch): Removed Peel() code.
8447
8448 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * class.cs: Location information for error 508
8451
8452         * expression.cs (New.DoResolve): Add a guard against double
8453         resolution of an expression.  
8454
8455         The New DoResolve might be called twice when initializing field
8456         expressions (see EmitFieldInitializers, the call to
8457         GetInitializerExpression will perform a resolve on the expression,
8458         and later the assign will trigger another resolution
8459
8460         This leads to bugs (#37014)
8461
8462         * delegate.cs: The signature for EndInvoke should contain any ref
8463         or out parameters as well.  We were not doing this in the past. 
8464
8465         * class.cs (Field.Define): Do not overwrite the type definition
8466         inside the `volatile' group.  Turns out that volatile enumerations
8467         were changing the type here to perform a validity test, which
8468         broke conversions. 
8469
8470 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
8471
8472         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
8473         and structs, we do not want to load the instance variable
8474
8475         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
8476         enum_type has to be handled like an object reference (implicit
8477         conversions exists from this to object), but the regular IsClass
8478         and IsValueType tests will never return true for this one.
8479
8480         Also we use TypeManager.IsValueType instead of type.IsValueType,
8481         just for consistency with the rest of the code (this is only
8482         needed if we ever use the construct exposed by test-180.cs inside
8483         corlib, which we dont today).
8484
8485 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
8486
8487         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
8488         just InternalCall.
8489
8490 2003-02-09  Martin Baulig  <martin@ximian.com>
8491
8492         * namespace.cs (Namespace..ctor): Added SourceFile argument.
8493         (Namespace.DefineNamespaces): New static public method; this is
8494         called when we're compiling with debugging to add all namespaces
8495         to the symbol file.
8496
8497         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
8498         pass it to the Namespace's .ctor.
8499
8500         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
8501         and MethodBase arguments; pass the namespace ID to the symwriter;
8502         pass the MethodBase instead of the token to the symwriter.
8503         (SymbolWriter.DefineNamespace): New method to add a namespace to
8504         the symbol file.
8505
8506 2003-02-09  Martin Baulig  <martin@ximian.com>
8507
8508         * symbolwriter.cs: New file.  This is a wrapper around
8509         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
8510         methods here in near future.
8511
8512 2003-02-09  Martin Baulig  <martin@ximian.com>
8513
8514         * codegen.cs (EmitContext.Mark): Just pass the arguments to
8515         ILGenerator.MarkSequencePoint() which are actually used by the
8516         symbol writer.
8517
8518 2003-02-09  Martin Baulig  <martin@ximian.com>
8519
8520         * location.cs (SourceFile): New public sealed class.  This
8521         contains the name and an index which is used in the location's token.
8522         (Location): Reserve an appropriate number of bits in the token for
8523         the source file instead of walking over that list, this gives us a
8524         really huge performance improvement when compiling with debugging.
8525
8526         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
8527         `SourceFile' argument instead of a string.
8528         (Driver.ProcessFile): Add all the files via Location.AddFile(),
8529         but don't parse/tokenize here, we need to generate the list of all
8530         source files before we do that.
8531         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
8532         the files.
8533
8534         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
8535         instead of a string.
8536
8537         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
8538         of a string.
8539
8540 2003-02-09  Martin Baulig  <martin@ximian.com>
8541
8542         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
8543         filename on `#line default'.
8544
8545 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
8546
8547         * statement.cs: don't clear the pinned var when the fixed statement
8548         returns from the method (fixes bug#37752).
8549
8550 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
8551
8552         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
8553         to IsValueType.
8554
8555 2003-02-07  Martin Baulig  <martin@ximian.com>
8556
8557         * driver.cs: Removed the `--debug-args' command line argument.
8558
8559         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
8560         automatically by the AsssemblyBuilder.
8561         (CodeGen.InitializeSymbolWriter): We don't need to call any
8562         initialization function on the symbol writer anymore.  This method
8563         doesn't take any arguments.
8564
8565 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
8566
8567         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
8568         from referenced assemblies as well.
8569
8570 2003-02-02  Martin Baulig  <martin@ximian.com>
8571
8572         * class.cs (MethodData.Emit): Generate debugging info for external methods.
8573
8574 2003-02-02  Martin Baulig  <martin@ximian.com>
8575
8576         * class.cs (Constructor.Emit): Open the symbol writer before
8577         emitting the constructor initializer.
8578         (ConstructorInitializer.Emit): Call ec.Mark() to allow
8579         single-stepping through constructor initializers.
8580
8581 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
8582
8583         * class.cs: Handle error 549: do not allow virtual methods in
8584         sealed classes. 
8585
8586 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
8587
8588         * decl.cs: Check access levels when resolving types
8589
8590 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
8591
8592         * statement.cs: Add parameters and locals set in catch blocks that might 
8593         return to set vector
8594
8595 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
8596
8597         * class.cs (Operator): Set the SpecialName flags for operators.
8598
8599         * expression.cs (Invocation.DoResolve): Only block calls to
8600         accessors and operators on SpecialName methods.
8601
8602         (Cast.TryReduce): Handle conversions from char constants.
8603
8604
8605 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
8606
8607         * statement.cs: small memory and time optimization in FlowBranching.
8608
8609 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
8610
8611         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
8612         problem that the last fix but in the other sid (Set).
8613
8614         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
8615         access when there is no indexer in the hierarchy.
8616
8617 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
8618
8619         * class.cs: Combine some if statements.
8620
8621 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8622
8623         * driver.cs: fixed bug #37187.
8624
8625 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
8626
8627         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
8628         any indexer, it's needed to build a list with all the indexers in the
8629         hierarchy (AllGetters), else we have problems. Fixes #35653.
8630
8631 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
8632
8633         * class.cs (MethodData.Define): It is wrong for an interface
8634         implementation to be static in both cases: explicit and implicit.
8635         We were only handling this in one case.
8636
8637         Improve the if situation there to not have negations.
8638
8639         * class.cs (Field.Define): Turns out that we do not need to check
8640         the unsafe bit on field definition, only on usage.  Remove the test.
8641
8642 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8643
8644         * driver.cs: use assembly.Location instead of Codebase (the latest
8645         patch made mcs fail when using MS assemblies).
8646
8647 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
8648
8649         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
8650         get the path to *corlib.dll.
8651
8652 2003-01-21  Nick Drochak <ndrochak@gol.com>
8653
8654         * cs-tokenizer.cs:
8655         * pending.cs:
8656         * typemanager.cs: Remove compiler warnings
8657
8658 2003-01-20  Duncan Mak  <duncan@ximian.com>
8659
8660         * AssemblyInfo.cs: Bump the version number to 0.19.
8661
8662 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8663
8664         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
8665
8666 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
8667
8668         * class.cs (Constructor::Emit): Emit debugging info for constructors.
8669
8670 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
8671
8672         * cs-parser.jay: Small fix: we were not comparing the constructor
8673         name correctly.   Thanks to Zoltan for the initial pointer.
8674
8675 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
8676
8677         * cs-tokenizer.cs: Set file name when specified with #line
8678
8679 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
8680
8681         * cs-parser.jay: Only perform the constructor checks here if we
8682         are named like the class;  This will help provider a better
8683         error.  The constructor path is taken when a type definition is
8684         not found, but most likely the user forgot to add the type, so
8685         report that rather than the constructor error.
8686
8687 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
8688
8689         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
8690         allocations.
8691
8692 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
8693
8694         * cs-parser.jay: Add cleanup call.
8695
8696 2003-01-13  Duncan Mak  <duncan@ximian.com>
8697
8698         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
8699         consistent with other methods.
8700
8701 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
8702
8703         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
8704
8705 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
8706
8707         * attribute.cs: only set GuidAttr to true when we have a
8708         GuidAttribute.
8709
8710 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8711
8712         * ecore.cs:
8713         * expression.cs:
8714         * typemanager.cs: fixes to allow mcs compile corlib with the new
8715         Type.IsSubclassOf fix.
8716
8717 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
8718
8719         * expression.cs (LocalVariableReference.DoResolve): Classify a
8720         constant as a value, not as a variable.   Also, set the type for
8721         the variable.
8722
8723         * cs-parser.jay (fixed_statement): take a type instead of a
8724         pointer_type, so we can produce a better error message later.
8725
8726         * statement.cs (Fixed.Resolve): Flag types that are not pointers
8727         as an error.  
8728
8729         (For.DoEmit): Make inifinite loops have a
8730         non-conditional branch back.
8731
8732         (Fixed.DoEmit): First populate the pinned variables, then emit the
8733         statement, then clear the variables.  Before I was emitting the
8734         code once for each fixed piece.
8735
8736
8737 2003-01-08  Martin Baulig  <martin@ximian.com>
8738
8739         * statement.cs (FlowBranching.MergeChild): A break in a
8740         SWITCH_SECTION does not leave a loop.  Fixes #36155.
8741
8742 2003-01-08  Martin Baulig  <martin@ximian.com>
8743
8744         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
8745         lives in the same number space than `param_map'.  Fixes #36154.
8746
8747 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
8748
8749         * cs-parser.jay (constructor_declaration): Set the
8750         Constructor.ModFlags before probing for it.  This makes the
8751         compiler report 514, 515 and 132 (the code was there, but got
8752         broken). 
8753
8754         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
8755         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
8756         (GotoCase.Resolve): Set `Returns' to ALWAYS.
8757
8758 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
8759
8760         * enum.cs: create the enum static fields using the enum type.
8761
8762 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
8763
8764         * class.cs: don't try to create the ParamBuilder for the return
8765         type if it's not needed (and handle it breaking for the ms runtime
8766         anyway).
8767
8768 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
8769
8770         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
8771
8772 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
8773
8774         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
8775         the command.   This showed up while compiling the JANET source
8776         code, which used \r as its only newline separator.
8777
8778 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
8779
8780         * class.cs (Method.Define): If we are an operator (because it
8781         reuses our code), then set the SpecialName and HideBySig.  #36128
8782
8783 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
8784
8785         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
8786         exception, report error 120 `object reference required'.
8787
8788         * driver.cs: Add --pause option, used during to measure the size
8789         of the process as it goes with --timestamp.
8790
8791         * expression.cs (Invocation.DoResolve): Do not allow methods with
8792         SpecialName to be invoked.
8793
8794 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
8797         number before adding it.
8798
8799 2002-12-21  Ravi Pratap  <ravi@ximian.com>
8800
8801         * ecore.cs (StandardImplicitConversion): When in an unsafe
8802         context, we allow conversion between void * to any other pointer
8803         type. This fixes bug #35973.
8804
8805 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
8806
8807         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
8808         is not thrown when extensionless outputs are used 
8809
8810 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8811
8812         * rootcontext.cs: fixed compilation of corlib.
8813
8814 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
8815
8816         * attribute.cs (Attributes.Contains): Add new method.
8817
8818         * class.cs (MethodCore.LabelParameters): if the parameter is an
8819         `out' parameter, check that no attribute `[In]' has been passed.
8820
8821         * enum.cs: Handle the `value__' name in an enumeration.
8822
8823 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
8824
8825         * decl.cs: Added special case to allow overrides on "protected
8826         internal" methods
8827
8828 2002-12-18  Ravi Pratap  <ravi@ximian.com>
8829
8830         * attribute.cs (Attributes.AddAttributeSection): Rename to this
8831         since it makes much more sense.
8832
8833         (Attributes.ctor): Don't require a Location parameter.
8834
8835         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
8836
8837         * attribute.cs (ApplyAttributes): Remove extra Location parameters
8838         since we already have that information per attribute.
8839
8840         * everywhere : make appropriate changes.
8841
8842         * class.cs (LabelParameters): Write the code which actually
8843         applies attributes to the return type. We can't do this on the MS
8844         .NET runtime so we flag a warning in the case an exception is
8845         thrown.
8846
8847 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
8848
8849         * const.cs: Handle implicit null conversions here too.
8850
8851 2002-12-17  Ravi Pratap  <ravi@ximian.com>
8852
8853         * class.cs (MethodCore.LabelParameters): Remove the extra
8854         Type [] parameter since it is completely unnecessary. Instead
8855         pass in the method's attributes so that we can extract
8856         the "return" attribute.
8857
8858 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
8859
8860         * cs-parser.jay (parse): Use Report.Error to flag errors instead
8861         of ignoring it and letting the compile continue.
8862
8863         * typemanager.cs (ChangeType): use an extra argument to return an
8864         error condition instead of throwing an exception.
8865
8866 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
8867
8868         * expression.cs (Unary.TryReduce): mimic the code for the regular
8869         code path.  Perform an implicit cast in the cases where we can
8870         implicitly convert to one of the integral types, and then reduce
8871         based on that constant.   This fixes bug #35483.
8872
8873 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8874
8875         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
8876
8877 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8878
8879         * namespace.cs: fixed bug #35489.
8880
8881 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
8882
8883         * class.cs: Remove some dead code.
8884
8885         * cs-parser.jay: Estimate the number of methods needed
8886         (RootContext.MethodCount);
8887
8888         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
8889         numbers instead of StringBuilders.
8890
8891         * support.cs (PtrHashtable): Add constructor with initial size;
8892         We can now reduce reallocations of the method table.
8893
8894 2002-12-10  Ravi Pratap  <ravi@ximian.com>
8895
8896         * attribute.cs (ApplyAttributes): Keep track of the emitted
8897         attributes on a per-target basis. This fixes bug #35413.
8898
8899 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
8900
8901         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
8902         default to the Windows 1252 encoding.
8903
8904         (UnixParseOption): Support version, thanks to Alp for the missing
8905         pointer. 
8906
8907         * AssemblyInfo.cs: Add nice assembly information.
8908
8909         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
8910         (bug 35169).
8911
8912         * cs-parser.jay: Allow a trailing comma before the close bracked
8913         in the attribute_section production.
8914
8915         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
8916         address of the instance was being taken, I will take this out,
8917         because we take the address of the object immediately here.
8918
8919 2002-12-09  Ravi Pratap  <ravi@ximian.com>
8920
8921         * typemanager.cs (AreMultipleAllowed): Take care of the most
8922         obvious case where attribute type is not in the current assembly -
8923         stupid me ;-)
8924
8925 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
8926
8927         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
8928         definitions, instead of doing that afterwards.  
8929
8930         Also we use a nice little hack, depending on the constructor, we
8931         know if we are a "composed" name or a simple name.  Hence, we
8932         avoid the IndexOf test, and we avoid 
8933
8934         * codegen.cs: Add code to assist in a bug reporter to track down
8935         the source of a compiler crash. 
8936
8937 2002-12-07  Ravi Pratap  <ravi@ximian.com>
8938
8939         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
8940         types have been emitted for a given element and flag an error
8941         if something which does not have AllowMultiple set is used more
8942         than once.
8943
8944         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
8945         attribute types and their corresponding AllowMultiple properties
8946
8947         (AreMultipleAllowed): Check the property for a given type.
8948
8949         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
8950         property in the case we have a TypeContainer.
8951
8952         (Attributes.AddAttribute): Detect duplicates and just skip on
8953         adding them. This trivial fix catches a pretty gross error in our
8954         attribute emission - global attributes were being emitted twice!
8955
8956         Bugzilla bug #33187 is now fixed.
8957
8958 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
8959
8960         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
8961         instead of pp_and).
8962
8963         * expression.cs (Binary.ResolveOperator): I can only use the
8964         Concat (string, string, string) and Concat (string, string,
8965         string, string) if the child is actually a concatenation of
8966         strings. 
8967
8968 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
8969
8970         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
8971         context where we need a 2-character lookahead.
8972
8973         * pending.cs (PendingImplementation): Rework so we can keep track
8974         of interface types all the time, and flag those which were
8975         implemented by parents as optional.
8976
8977 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
8978
8979         * expression.cs (Binary.ResolveOperator): Use
8980         String.Concat(string,string,string) or
8981         String.Concat(string,string,string,string) when possible. 
8982
8983         * typemanager: More helper methods.
8984
8985
8986 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
8987
8988         * pending.cs: remove the bogus return from GetMissingInterfaces()
8989         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
8990
8991 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8992
8993         * namespace.cs: avoid duplicated 'using xxx' being added to
8994         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
8995         when we get more than one 'using' statement for the same namespace.
8996         Report a CS0105 warning for it.
8997
8998 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
8999
9000         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9001         of calling getChar/putback, uses internal knowledge of it.    
9002
9003         (xtoken): Reorder tokenizer so most common patterns are checked
9004         first.  This reduces the compilation time in another 5% (from 8.11s
9005         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9006
9007         The parsing time is 22% of the compilation in mcs, and from that
9008         64% is spent on the tokenization process.  
9009
9010         I tried using a binary search for keywords, but this is slower
9011         than the hashtable.  Another option would be to do a couple of
9012         things:
9013
9014                 * Not use a StringBuilder, instead use an array of chars,
9015                   with a set value.  Notice that this way we could catch
9016                   the 645 error without having to do it *afterwards*.
9017
9018                 * We could write a hand-parser to avoid the hashtable
9019                   compares altogether.
9020
9021         The identifier consumption process takes 37% of the tokenization
9022         time.  Another 15% is spent on is_number.  56% of the time spent
9023         on is_number is spent on Int64.Parse:
9024
9025                 * We could probably choose based on the string length to
9026                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9027                   computations. 
9028
9029         Another 3% is spend on wrapping `xtoken' in the `token' function.
9030
9031         Handle 0xa0 as whitespace (#34752)
9032
9033 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9034
9035         * typemanager.cs (IsCLRType): New routine to tell whether a type
9036         is one of the builtin types.  
9037
9038         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9039         typecode in more places instead of doing pointer comparissions.
9040         We could leverage some knowledge about the way the typecodes are
9041         laid out.
9042
9043         New code to cache namespaces in assemblies, it is currently not
9044         invoked, to be used soon.
9045
9046         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9047
9048         * expression.cs (Binary.ResolveOperator): specially handle
9049         strings, and do not perform user-defined operator overloading for
9050         built-in types.
9051
9052 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9053
9054         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9055         internalcall as it is a pretty simple operation;  Avoid whenever
9056         possible to call Char.IsLetter.
9057
9058         (consume_identifier): Cut by half the number of
9059         hashtable calls by merging the is_keyword and GetKeyword behavior.
9060
9061         Do not short-circuit, because if we do, we
9062         report errors (ie, #if false && true would produce an invalid
9063         directive error);
9064
9065
9066 2002-11-24  Martin Baulig  <martin@ximian.com>
9067
9068         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9069         check constant ranges and report a CS0221.  Fixes #33186.
9070
9071 2002-11-24  Martin Baulig  <martin@ximian.com>
9072
9073         * cs-parser.jay: Make this work for uninitialized variable
9074         declarations in the `for' initializer.  Fixes #32416.
9075
9076 2002-11-24  Martin Baulig  <martin@ximian.com>
9077
9078         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9079         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9080
9081 2002-11-24  Martin Baulig  <martin@ximian.com>
9082
9083         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9084         argument; if true, we also check for user-defined conversions.
9085         This is only needed if both arguments are of a user-defined type.
9086         Fixes #30443, added test-175.cs.
9087         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9088
9089         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9090
9091 2002-11-24  Martin Baulig  <martin@ximian.com>
9092
9093         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9094         function to get the store opcode.
9095         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9096         only emit the Ldelema if the store opcode is Stobj.  You must run
9097         both test-34 and test-167 to test this.  Fixes #34529.
9098
9099 2002-11-23  Martin Baulig  <martin@ximian.com>
9100
9101         * ecore.cs (Expression.MemberLookup): Added additional
9102         `qualifier_type' argument which is used when we're being called
9103         from MemberAccess.DoResolve() and null if we're called from a
9104         SimpleName lookup.
9105         (Expression.MemberLookupFailed): New method to report errors; this
9106         does the CS1540 check and reports the correct error message.
9107
9108         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9109         argument for the CS1540 check and redone the way how we're dealing
9110         with private members.  See the comment in the source code for details.
9111         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9112         `closure_start_type' to `closure_qualifier_type' and check whether
9113         it's not null.  It was not this filter being broken, it was just
9114         being called with the wrong arguments.
9115
9116         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9117         and pass it the correct `qualifier_type'; this also does the error
9118         handling for us.
9119
9120 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9121
9122         * expression.cs (Invocation.EmitParams): If the we are dealing
9123         with a non-built-in value type, load its address as well.
9124
9125         (ArrayCreation): Use a a pretty constant instead
9126         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9127         static initializers.  
9128
9129         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9130         because they are not really value types, just glorified integers. 
9131
9132         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9133
9134         * ecore.cs: Remove redundant code for enumerations, make them use
9135         the same code path as everything else, fixes the casting issue
9136         with enumerations in Windows.Forms.
9137
9138         * attribute.cs: Do only cast to string if it is a string, the
9139         validation happens later.
9140
9141         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9142         people upgrade their corlibs.
9143
9144         * ecore.cs: Oops, enumerations were not following the entire code path
9145
9146 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9147
9148         * typemanager.cs (FilterWithClosure): Commented out the test for
9149         1540 in typemanager.cs, as it has problems when accessing
9150         protected methods from a parent class (see test-174.cs). 
9151
9152         * attribute.cs (Attribute.ValidateGuid): new method.
9153         (Attribute.Resolve): Use above.
9154
9155 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9156
9157         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9158
9159         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9160         handling for enumerations, as we only needed the TypeContainer
9161         functionality to begin with (this is required for the fix below to
9162         work for enums that reference constants in a container class for
9163         example). 
9164
9165         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9166
9167         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9168         a valid TypeBuilder to perform lookups on.o
9169
9170         * class.cs (InheritableMemberSignatureCompare): Use true in the
9171         call to GetGetMethod and GetSetMethod, because we are comparing
9172         the signature, and we need to get the methods *even* if they are
9173         private. 
9174
9175         (PropertyBase.CheckBase): ditto.
9176
9177         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9178         GotoCase.Resolve): Use Peel on EmpytCasts.
9179
9180         * ecore.cs (EmptyCast): drop child, add Peel method.
9181
9182 2002-11-17  Martin Baulig  <martin@ximian.com>
9183
9184         * ecore.cs (EmptyCast.Child): New public property.
9185
9186         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9187         label resolved to an EmptyCast.  Fixes #34162.
9188         (GotoCase.Resolve): Likewise.
9189         (Block.EmitMeta): Likewise.
9190
9191 2002-11-17  Martin Baulig  <martin@ximian.com>
9192
9193         * expression.cs (Invocation.BetterConversion): Prefer int over
9194         uint; short over ushort; long over ulong for integer literals.
9195         Use ImplicitConversionExists instead of StandardConversionExists
9196         since we also need to check for user-defined implicit conversions.
9197         Fixes #34165.  Added test-173.cs.
9198
9199 2002-11-16  Martin Baulig  <martin@ximian.com>
9200
9201         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9202         with the `true' and `false' literals.  Fixes #33151.
9203
9204 2002-11-16  Martin Baulig  <martin@ximian.com>
9205
9206         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9207         October 22nd; don't do the cs1540 check for static members.
9208
9209         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9210         now using our own filter here and doing the cs1540 check again.
9211
9212 2002-11-16  Martin Baulig  <martin@ximian.com>
9213
9214         * support.cs (InternalParameters): Don't crash if we don't have
9215         any fixed parameters.  Fixes #33532.
9216
9217 2002-11-16  Martin Baulig  <martin@ximian.com>
9218
9219         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9220         when looking up static methods to make this work on Windows.
9221         Fixes #33773.
9222
9223 2002-11-16  Martin Baulig  <martin@ximian.com>
9224
9225         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9226         a setter rather than using PropertyInfo.CanWrite.
9227
9228 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9229
9230         * class.cs: Allow acces to block member by subclasses. Fixes build
9231         breaker.
9232
9233 2002-11-14  Martin Baulig  <martin@ximian.com>
9234
9235         * class.cs (Constructor.Emit): Added the extern/block check.
9236         Fixes bug #33678.
9237
9238 2002-11-14  Martin Baulig  <martin@ximian.com>
9239
9240         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9241         iteration while looking for indexers, this is needed because the
9242         indexer may have a different name in our base classes.  Fixed the
9243         error reporting (no indexers at all, not get accessor, no
9244         overloaded match).  Fixes bug #33089.
9245         (IndexerAccess.DoResolveLValue): Likewise.
9246
9247 2002-11-14  Martin Baulig  <martin@ximian.com>
9248
9249         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9250         indexers.  Fixes the first part of bug #33089.
9251         (MethodSignature.InheritableMemberSignatureCompare): Added support
9252         for properties.
9253
9254 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9255
9256         * attribute.cs (Attribute.Resolve): Catch the
9257         NullReferenceException and report it since it isn't supposed to
9258         happen. 
9259
9260 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9261
9262         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9263         LogicalOr and LogicalAnd that can benefit from recursively
9264         handling EmitBranchable.  The code now should be nice for Paolo.
9265
9266 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9267
9268         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9269         the Type lookups, as we perform quite a number of lookups on
9270         non-Types.  This can be removed once we can deterministically tell
9271         whether we have a type or a namespace in advance.
9272
9273         But this might require special hacks from our corlib.
9274
9275         * TODO: updated.
9276
9277         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9278         and double which avoids a conversion from an integer to a double.
9279
9280         * expression.cs: tiny optimization, avoid calling IsConstant,
9281         because it effectively performs the lookup twice.
9282
9283 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9284
9285         But a bogus return here to keep the semantics of the old code
9286         until the Mono runtime is fixed.
9287
9288         * pending.cs (GetMissingInterfaces): New method used to remove all
9289         the interfaces that are already implemented by our parent
9290         classes from the list of pending methods. 
9291
9292         * interface.cs: Add checks for calls after ResolveTypeExpr.
9293
9294 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9295
9296         * class.cs (Class.Emit): Report warning 67: event not used if the
9297         warning level is beyond 3.
9298
9299         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9300         being a NullLiteral.
9301
9302         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9303         specifiers. 
9304
9305         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9306         path that might fail if a type can not be resolved.
9307
9308         * expression.cs (Binary.Emit): Emit unsigned versions of the
9309         operators. 
9310
9311         * driver.cs: use error 5.
9312
9313 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9314
9315         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9316
9317 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9318
9319         * cs-parser.jay (switch_section): A beautiful patch from Martin
9320         Baulig that fixed 33094.
9321
9322 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9323
9324         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9325         Check whether the base is abstract and report an error if so.
9326
9327         * expression.cs (IndexerAccess.DoResolveLValue,
9328         IndexerAccess.DoResolve): ditto. 
9329
9330         (Invocation.DoResolve): ditto.
9331
9332         (Invocation.FullMethodDesc): Improve the report string.
9333
9334         * statement.cs (Block): Eliminate IsVariableDefined as it is
9335         basically just a wrapper for GetVariableInfo.
9336
9337         * ecore.cs (SimpleName): Use new 
9338
9339         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9340         type, as we return the actual parameter ref/unref state on a
9341         different call.
9342
9343 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * support.cs: Return proper flags REF/OUT fixing the previous
9346         commit.  
9347
9348         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9349         not used to mean `ref' but `ref or out' in ParameterReference
9350
9351         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9352         full type signature instead of calling TypeManger.CSharpName
9353         ourselves. 
9354
9355         * support.cs (InternalParameters.ParameterDesc): Do not compare
9356         directly to the modflags, because REF/OUT will actually be bitsets
9357         if set. 
9358
9359         * delegate.cs (VerifyMethod): Check also the modifiers.
9360
9361         * cs-tokenizer.cs: Fix bug where floating point values with an
9362         exponent where a sign was missing was ignored.
9363
9364         * driver.cs: Allow multiple assemblies to be specified in a single
9365         /r: argument
9366
9367 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9368
9369         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9370         because identifiers after a parenthesis would end up in this kind
9371         of production, and we needed to desamiguate it for having casts
9372         like:
9373
9374                 (UserDefinedType *) xxx
9375
9376 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9377
9378         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9379         we should set on the Bindingflags.NonPublic, but not turn on
9380         private_ok.  private_ok controls whether a Private member is
9381         returned (this is chekced on the filter routine), while the
9382         BindingFlags.NonPublic just controls whether private/protected
9383         will be allowed.   This fixes the problem part of the problem of
9384         private properties being allowed to be used in derived classes.
9385
9386         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9387         so we can call the children DoResolveLValue method (this will
9388         properly signal errors on lvalue assignments to base properties)
9389
9390         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9391         getter are null, and we have a property info, we know that this
9392         happened because the lookup failed, so we report an error 122 for
9393         protection level violation.
9394
9395         We also silently return if setter and getter are null in the
9396         resolve functions, this condition only happens if we have flagged
9397         the error before.  This is the other half of the problem. 
9398
9399         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9400         not have accessibility information, that is why we were returning
9401         true in the filter function in typemanager.cs.
9402
9403         To properly report 122 (property is inaccessible because of its
9404         protection level) correctly, we report this error in ResolveAccess
9405         by failing if both the setter and the getter are lacking (ie, the
9406         lookup failed). 
9407
9408         DoResolve and DoLResolve have been modified to check for both
9409         setter/getter being null and returning silently, the reason being
9410         that I did not want to put the knowledge about this error in upper
9411         layers, like:
9412
9413         int old = Report.Errors;
9414         x = new PropertyExpr (...);
9415         if (old != Report.Errors)
9416                 return null;
9417         else
9418                 return x;
9419
9420         So the property expr is returned, but it is invalid, so the error
9421         will be flagged during the resolve process. 
9422
9423         * class.cs: Remove InheritablePropertySignatureCompare from the
9424         class, as we no longer depend on the property signature to compute
9425         whether it is possible to implement a method or not.
9426
9427         The reason is that calling PropertyInfo.GetGetMethod will return
9428         null (in .NET, in Mono it works, and we should change this), in
9429         cases where the Get Method does not exist in that particular
9430         class.
9431
9432         So this code:
9433
9434         class X { public virtual int A { get { return 1; } } }
9435         class Y : X { }
9436         class Z : Y { public override int A { get { return 2; } } }
9437
9438         Would fail in Z because the parent (Y) would not have the property
9439         defined.  So we avoid this completely now (because the alternative
9440         fix was ugly and slow), and we now depend exclusively on the
9441         method names.
9442
9443         (PropertyBase.CheckBase): Use a method-base mechanism to find our
9444         reference method, instead of using the property.
9445
9446         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9447         routines are gone now.
9448
9449         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9450         names, they were incorrectly named.
9451
9452         * cs-tokenizer.cs: Return are more gentle token on failure. 
9453
9454         * pending.cs (PendingImplementation.InterfaceMethod): This routine
9455         had an out-of-sync index variable, which caused it to remove from
9456         the list of pending methods the wrong method sometimes.
9457
9458 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
9459
9460         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9461         CanWrite, because those refer to this particular instance of the
9462         property, and do not take into account the fact that we can
9463         override single members of a property.
9464
9465         Constructor requires an EmitContext.  The resolution process does
9466         not happen here, but we need to compute the accessors before,
9467         because the resolution does not always happen for properties.
9468
9469         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
9470         subclass, before we did not update this flag, but we did update
9471         bindingflags. 
9472
9473         (GetAccessors): Drop this routine, as it did not work in the
9474         presence of partially overwritten set/get methods. 
9475
9476         Notice that this broke the cs1540 detection, but that will require
9477         more thinking. 
9478
9479 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9480
9481         * class.cs:
9482         * codegen.cs:
9483         * driver.cs: issue a warning instead of an error if we don't support
9484         debugging for the platform. Also ignore a couple of errors that may
9485         arise when trying to write the symbols. Undo my previous patch.
9486
9487 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9488
9489         * driver.cs: ignore /debug switch except for Unix platforms.
9490
9491 2002-10-23  Nick Drochak  <ndrochak@gol.com>
9492
9493         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
9494
9495 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
9496
9497         * driver.cs: Do not make mcs-debug conditional, so we do not break
9498         builds that use it.
9499
9500         * statement.cs (UsageVector.MergeChildren): I would like Martin to
9501         review this patch.  But basically after all the children variables
9502         have been merged, the value of "Breaks" was not being set to
9503         new_breaks for Switch blocks.  I think that it should be set after
9504         it has executed.  Currently I set this to the value of new_breaks,
9505         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
9506         conservative, but I do not understand this code very well.
9507
9508         I did not break anything in the build, so that is good ;-)
9509
9510         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
9511
9512 2002-10-20  Mark Crichton  <crichton@gimp.org>
9513
9514         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
9515
9516 2002-10-20  Nick Drochak  <ndrochak@gol.com>
9517
9518         * cfold.cs: Fixed compile blocker.
9519
9520 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * driver.cs: I was chekcing the key, not the file.
9523
9524 2002-10-19  Ravi Pratap  <ravi@ximian.com>
9525
9526         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
9527         message that we were generating - we just need to silently return
9528         a null.
9529
9530 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * class.cs (Event.Define): Change my previous commit, as this
9533         breaks the debugger.  This is a temporary hack, as it seems like
9534         the compiler is generating events incorrectly to begin with.
9535
9536         * expression.cs (Binary.ResolveOperator): Added support for 
9537         "U operator - (E x, E y)"
9538
9539         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
9540         y)".
9541
9542         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
9543         init-only variables, but this path did not take into account that
9544         there might be also instance readonly variables.  Correct this
9545         problem. 
9546
9547         This fixes bug 32253
9548
9549         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
9550         delegates as well.
9551
9552         * driver.cs: Change the extension for modules to `netmodule'
9553
9554         * cs-parser.jay: Improved slightly the location tracking for
9555         the debugger symbols.
9556
9557         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
9558         modifiers that were specified instead of the hardcoded value
9559         (FamAndAssem).  This was basically ignoring the static modifier,
9560         and others.  Fixes 32429.
9561
9562         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
9563         fixed a bug in the process (32476)
9564
9565         * expression.cs (ArrayAccess.EmitAssign): Patch from
9566         hwang_rob@yahoo.ca that fixes bug 31834.3
9567
9568 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
9569
9570         * driver.cs: Make the module extension .netmodule.
9571
9572 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
9573
9574         * driver.cs: Report an error if the resource file is not found
9575         instead of crashing.
9576
9577         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
9578         false, like Emit does.
9579
9580 2002-10-16  Nick Drochak  <ndrochak@gol.com>
9581
9582         * typemanager.cs: Remove unused private member.  Also reported mcs
9583         bug to report this as a warning like csc.
9584
9585 2002-10-15  Martin Baulig  <martin@gnome.org>
9586
9587         * statement.cs (Statement.Emit): Made this a virtual method; emits
9588         the line number info and calls DoEmit().
9589         (Statement.DoEmit): New protected abstract method, formerly knows
9590         as Statement.Emit().
9591
9592         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
9593
9594 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
9595
9596         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
9597         have fixed a remaining problem: not every AddXXXX was adding a
9598         fully qualified name.  
9599
9600         Now everyone registers a fully qualified name in the DeclSpace as
9601         being defined instead of the partial name.  
9602
9603         Downsides: we are slower than we need to be due to the excess
9604         copies and the names being registered this way.  
9605
9606         The reason for this is that we currently depend (on the corlib
9607         bootstrap for instance) that types are fully qualified, because
9608         we dump all the types in the namespace, and we should really have
9609         types inserted into the proper namespace, so we can only store the
9610         basenames in the defined_names array.
9611
9612 2002-10-10  Martin Baulig  <martin@gnome.org>
9613
9614         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
9615         from bug #31834, see the bug report for a testcase which is
9616         miscompiled.
9617
9618 2002-10-10  Martin Baulig  <martin@gnome.org>
9619
9620         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
9621         flow analysis code for this.
9622
9623         * statement.cs (Do, While, For): Tell the flow analysis code about
9624         infinite loops.
9625         (FlowBranching.UsageVector): Added support for infinite loops.
9626         (Block.Resolve): Moved the dead code elimination here and use flow
9627         analysis to do it.
9628
9629 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
9630
9631         * class.cs (Field.Define): Catch cycles on struct type
9632         definitions. 
9633
9634         * typemanager.cs (IsUnmanagedtype): Do not recursively check
9635         fields if the fields are static.  We only need to check instance
9636         fields. 
9637
9638         * expression.cs (As.DoResolve): Test for reference type.
9639
9640         * statement.cs (Using.ResolveExpression): Use
9641         ConvertImplicitRequired, not ConvertImplicit which reports an
9642         error on failture
9643         (Using.ResolveLocalVariableDecls): ditto.
9644
9645         * expression.cs (Binary.ResolveOperator): Report errors in a few
9646         places where we had to.
9647
9648         * typemanager.cs (IsUnmanagedtype): Finish implementation.
9649
9650 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
9651
9652         * expression.cs: Use StoreFromPtr instead of extracting the type
9653         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
9654
9655         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
9656         an enumeration value to a System.Enum, but System.Enum is not a
9657         value type, but an class type, so we need to box.
9658
9659         (Expression.ConvertExplicit): One codepath could return
9660         errors but not flag them.  Fix this.  Fixes #31853
9661
9662         * parameter.cs (Resolve): Do not allow void as a parameter type.
9663
9664 2002-10-06  Martin Baulig  <martin@gnome.org>
9665
9666         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
9667         if it's a class type and not a struct.  Fixes #31815.
9668
9669 2002-10-06  Martin Baulig  <martin@gnome.org>
9670
9671         * statement.cs: Reworked the flow analysis code a bit to make it
9672         usable for dead code elimination.
9673
9674 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9675
9676         * cs-parser.jay: allow empty source files. Fixes bug #31781.
9677
9678 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
9679
9680         * expression.cs (ComposedCast.DoResolveType): A quick workaround
9681         to fix the test 165, will investigate deeper.
9682
9683 2002-10-04  Martin Baulig  <martin@gnome.org>
9684
9685         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
9686         finally blocks actually work.
9687         (Try.Resolve): We don't need to create a sibling for `finally' if
9688         there is no finally block.
9689
9690 2002-10-04  Martin Baulig  <martin@gnome.org>
9691
9692         * class.cs (Constructor.Define): The default accessibility for a
9693         non-default constructor is private, not public.
9694
9695 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
9696
9697         * class.cs (Constructor): Make AllowedModifiers public, add
9698         EXTERN.
9699
9700         * cs-parser.jay: Perform the modifiers test here, as the
9701         constructor for the Constructor class usually receives a zero
9702         because of the way we create it (first we create, later we
9703         customize, and we were never checking the modifiers).
9704
9705         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
9706         is a version of LookupTypeReflection that includes the type-name
9707         cache.  This can be used as a fast path for functions that know
9708         the fully qualified name and are only calling into *.GetType() to
9709         obtain a composed type.
9710
9711         This is also used by TypeManager.LookupType during its type
9712         composition.
9713
9714         (LookupType): We now also track the real type name, as sometimes
9715         we can get a quey for the real type name from things like
9716         ComposedCast.  This fixes bug 31422.
9717
9718         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
9719         complete type fullname, it does not have to go through the type
9720         resolution system to obtain the composed version of the type (for
9721         obtaining arrays or pointers).
9722
9723         (Conditional.Emit): Use the EmitBoolExpression to
9724         generate nicer code, as requested by Paolo.
9725
9726         (ArrayCreation.CheckIndices): Use the patch from
9727         hwang_rob@yahoo.ca to validate the array initializers. 
9728
9729 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
9730
9731         * class.cs (ConstructorInitializer.Emit): simplify code by using
9732         Invocation.EmitCall, and at the same time, fix the bugs in calling
9733         parent constructors that took variable arguments. 
9734
9735         * ecore.cs (Expression.ConvertNumericExplicit,
9736         Expression.ImplicitNumericConversion): Remove the code that
9737         manually wrapped decimal (InternalTypeConstructor call is now gone
9738         as well).
9739
9740         * expression.cs (Cast.TryReduce): Also handle decimal types when
9741         trying to perform a constant fold on the type.
9742
9743         * typemanager.cs (IsUnmanagedtype): Partially implemented.
9744
9745         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
9746         that only turned off an error report, and did nothing else. 
9747
9748 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
9749
9750         * driver.cs: Handle and ignore /fullpaths
9751
9752 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
9753
9754         * expression.cs (Binary.ResolveOperator): Catch the case where
9755         DoNumericPromotions returns true, 
9756
9757         (Binary.DoNumericPromotions): Simplify the code, and the tests.
9758
9759 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
9760
9761         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
9762         report error 70.
9763
9764 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
9765
9766         * ecore.cs (ConvertNumericExplicit): It is not enough that the
9767         conversion exists, but it is also required that the conversion be
9768         performed.  This manifested in "(Type64Enum) 2".  
9769
9770         * class.cs (TypeManager.AddMethod): The fix is not to change
9771         AddEnum, because that one was using a fully qualified name (every
9772         DeclSpace derivative does), but to change the AddMethod routine
9773         that was using an un-namespaced name.  This now correctly reports
9774         the duplicated name.
9775
9776         Revert patch until I can properly fix it.  The issue
9777         is that we have a shared Type space across all namespaces
9778         currently, which is wrong.
9779
9780         Options include making the Namespace a DeclSpace, and merge
9781         current_namespace/current_container in the parser.
9782
9783 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
9784
9785         * cs-parser.jay: Improve error reporting when we get a different
9786         kind of expression in local_variable_type and
9787         local_variable_pointer_type. 
9788
9789         Propagate this to avoid missleading errors being reported.
9790
9791         * ecore.cs (ImplicitReferenceConversion): treat
9792         TypeManager.value_type as a target just like object_type.   As
9793         code like this:
9794
9795         ValueType v = 1;
9796
9797         Is valid, and needs to result in the int 1 being boxed before it
9798         is assigned to the value type v.
9799
9800         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
9801         to validate the enumeration name.
9802
9803         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
9804         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
9805         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
9806
9807         * ecore.cs (TryImplicitIntConversion): When doing an
9808         implicit-enumeration-conversion, check if the type is 64-bits and
9809         perform a conversion before passing to EnumConstant.
9810
9811 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
9812
9813         * decl.cs (Error_AmbiguousTypeReference); New routine used to
9814         report ambiguous type references.  Unlike the MS version, we
9815         report what the ambiguity is.   Innovation at work ;-)
9816
9817         (DeclSpace.FindType): Require a location argument to
9818         display when we display an ambiguous error.
9819
9820         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
9821
9822         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
9823
9824         * expression.cs (EmitDynamicInitializers): Apply patch from
9825         hwang_rob@yahoo.ca that fixes the order in which we emit our
9826         initializers. 
9827
9828 2002-09-21  Martin Baulig  <martin@gnome.org>
9829
9830         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
9831         delegate takes no arguments.
9832
9833 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
9834
9835         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
9836         from integers.
9837
9838         * expression.cs: Extract the underlying type.
9839
9840         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
9841
9842         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
9843
9844 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
9845
9846         * class.cs (TypeContainer.DefineType): We can not use the nice
9847         PackingSize with the size set to 1 DefineType method, because it
9848         will not allow us to define the interfaces that the struct
9849         implements.
9850
9851         This completes the fixing of bug 27287
9852
9853         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
9854         means also structs.  This fixes part of the problem. 
9855         (Expresion.ImplicitReferenceConversionExists): ditto.
9856
9857         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
9858         error if there were no errors reported during the type lookup
9859         process, to avoid duplicates or redundant errors.  Without this
9860         you would get an ambiguous errors plus a type not found.  We have
9861         beaten the user enough with the first error.  
9862
9863         (DeclSparce.FindType): Emit a warning if we have an ambiguous
9864         reference. 
9865
9866         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
9867         during the resolution process, stop the lookup, this avoids
9868         repeated error reports (same error twice).
9869
9870         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
9871
9872         * typemanager.cs (LookupType): Redo the type lookup code to match
9873         the needs of System.Reflection.  
9874
9875         The issue is that System.Reflection requires references to nested
9876         types to begin with a "+" sign instead of a dot.  So toplevel
9877         types look like: "NameSpace.TopLevelClass", and nested ones look
9878         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
9879         levels. 
9880
9881 2002-09-19  Martin Baulig  <martin@gnome.org>
9882
9883         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
9884         says that a method always returns or always throws an exception,
9885         don't report the CS0161.
9886
9887         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
9888         set `Returns = new_returns'.
9889
9890 2002-09-19  Martin Baulig  <martin@gnome.org>
9891
9892         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
9893         to an enum constant, check for a CS0176.
9894
9895 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
9896
9897         * class.cs (TypeContainer.CheckPairedOperators): Now we check
9898         for operators that must be in pairs and report errors.
9899
9900         * ecore.cs (SimpleName.DoResolveType): During the initial type
9901         resolution process, when we define types recursively, we must
9902         check first for types in our current scope before we perform
9903         lookups in the enclosing scopes.
9904
9905         * expression.cs (MakeByteBlob): Handle Decimal blobs.
9906
9907         (Invocation.VerifyArgumentsCompat): Call
9908         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
9909         I thought we were supposed to always call this, but there are a
9910         few places in the code where we dont do it.
9911
9912 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
9913
9914         * driver.cs: Add support in -linkres and -resource to specify the
9915         name of the identifier.
9916
9917 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
9918
9919         * ecore.cs (StandardConversionExists): Sync with the conversion
9920         code: allow anything-* to void* conversions.
9921
9922         (FindMostSpecificSource): Use an Expression argument
9923         instead of a Type, because we might be handed over a Literal which
9924         gets a few more implicit conversions that plain types do not.  So
9925         this information was being lost.
9926
9927         Also, we drop the temporary type-holder expression when not
9928         required.
9929
9930 2002-09-17  Martin Baulig  <martin@gnome.org>
9931
9932         * class.cs (PropertyBase.CheckBase): Don't check the base class if
9933         this is an explicit interface implementation.
9934
9935 2002-09-17  Martin Baulig  <martin@gnome.org>
9936
9937         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
9938         different `IndexerName' attributes.
9939
9940         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
9941         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
9942         virtual CommonResolve().
9943
9944 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
9945
9946         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
9947         and convert that to the UnderlyingType.
9948
9949         * statement.cs (Foreach.Resolve): Indexers are just like variables
9950         or PropertyAccesses.
9951
9952         * cs-tokenizer.cs (consume_string): Track line numbers and columns
9953         inside quoted strings, we were not doing this before.
9954
9955 2002-09-16  Martin Baulig  <martin@gnome.org>
9956
9957         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
9958         resolve it.  This is needed for the definite assignment check of the
9959         instance expression, fixes bug #29846.
9960         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
9961
9962 2002-09-16  Nick Drochak  <ndrochak@gol.com>
9963
9964         * parameter.cs: Fix compile error.  Cannot reference static member
9965         from an instance object.  Is this an mcs bug?
9966
9967 2002-09-14  Martin Baulig  <martin@gnome.org>
9968
9969         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
9970         multiple times.  Fixes bug #30295, added test-166.cs.
9971
9972 2002-09-14  Martin Baulig  <martin@gnome.org>
9973
9974         * statement.cs (Block.Emit): Don't emit unreachable code.
9975         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
9976         `break' statements.
9977         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
9978
9979 2002-09-14  Martin Baulig  <martin@gnome.org>
9980
9981         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
9982         is set.
9983
9984 2002-09-14  Martin Baulig  <martin@gnome.org>
9985
9986         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
9987         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
9988         be false on the ms runtime.
9989
9990 2002-09-13  Martin Baulig  <martin@gnome.org>
9991
9992         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
9993         the CS0038 error message.
9994
9995 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
9996
9997         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
9998         constant inside, return it.
9999
10000 2002-09-12  Martin Baulig  <martin@gnome.org>
10001
10002         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10003         implicit conversion can be done between enum types.
10004
10005         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10006         check whether an implicit conversion to the current enum's UnderlyingType
10007         exists and report an error if not.
10008
10009         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10010         without debugging support.
10011
10012         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10013         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10014
10015 2002-09-12  Martin Baulig  <martin@gnome.org>
10016
10017         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10018
10019         * ecore.cs (IMemberExpr.DeclaringType): New property.
10020         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10021         nonstatic member of an outer type (CS0038).
10022
10023 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10024
10025         * driver.cs: Activate the using-error detector at warning level
10026         4 (at least for MS-compatible APIs).
10027
10028         * namespace.cs (VerifyUsing): Small buglett fix.
10029
10030         * pending.cs (PendingImplementation): pass the container pointer. 
10031
10032         * interface.cs (GetMethods): Allow for recursive definition.  Long
10033         term, I would like to move every type to support recursive
10034         definitions, not the current ordering mechanism that we have right
10035         now.
10036
10037         The situation is this: Attributes are handled before interfaces,
10038         so we can apply attributes to interfaces.  But some attributes
10039         implement interfaces, we will now handle the simple cases
10040         (recursive definitions will just get an error).  
10041
10042         * parameter.cs: Only invalidate types at the end if we fail to
10043         lookup all types.  
10044
10045 2002-09-09  Martin Baulig  <martin@gnome.org>
10046
10047         * ecore.cs (PropertyExpr.Emit): Also check for
10048         TypeManager.system_int_array_get_length so this'll also work when
10049         compiling corlib.  Fixes #30003.
10050
10051 2002-09-09  Martin Baulig  <martin@gnome.org>
10052
10053         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10054         and throw an exception if we can't get the type's size.  Fixed #30040,
10055         added test-165.cs.
10056
10057 2002-09-09  Martin Baulig  <martin@gnome.org>
10058
10059         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10060
10061         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10062         context.  Fixes bug #30027.
10063
10064         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10065         virtual functions.  Fixes bug #30043, added test-164.cs.
10066
10067 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10068
10069         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10070
10071 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10072
10073         * driver.cs: Use an object to get the windows codepage since it's not a
10074         static property.
10075
10076 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10077
10078         * statement.cs (For.Emit): for infinite loops (test == null)
10079         return whether there is a break inside, not always "true".
10080
10081         * namespace.cs (UsingEntry): New struct to hold the name of the
10082         using definition, the location where it is defined, and whether it
10083         has been used in a successful type lookup.
10084
10085         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10086         strings.
10087
10088         * decl.cs: ditto.
10089
10090 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10091
10092         * attribute.cs : Fix incorrect code which relied on catching
10093         a NullReferenceException to detect a null being passed in
10094         where an object was expected.
10095
10096 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10097
10098         * statement.cs (Try): flag the catch variable as assigned
10099
10100         * expression.cs (Cast): Simplified by using ResolveType instead of
10101         manually resolving.
10102
10103         * statement.cs (Catch): Fix bug by using ResolveType.
10104
10105 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10106
10107         * expression.cs (BetterConversion): Special case for when we have
10108         a NullLiteral as the argument and we have to choose between string
10109         and object types - we choose string the way csc does.
10110
10111         * attribute.cs (Attribute.Resolve): Catch the
10112         NullReferenceException and report error #182 since the Mono
10113         runtime no more has the bug and having this exception raised means
10114         we tried to select a constructor which takes an object and is
10115         passed a null.
10116
10117 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10118
10119         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10120         message (1502, 1503) when we can't locate a method after overload
10121         resolution. This is much more informative and closes the bug
10122         Miguel reported.
10123
10124         * interface.cs (PopulateMethod): Return if there are no argument
10125         types. Fixes a NullReferenceException bug.
10126
10127         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10128         expressions too. Previously we were checking only in one place for
10129         positional arguments leaving out named arguments.
10130
10131         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10132         type to the enum type is not allowed. Remove code corresponding to
10133         that.
10134
10135         (ConvertNumericExplicit): Allow explicit conversions from
10136         the underlying type to enum type. This precisely follows the spec
10137         and closes a bug filed by Gonzalo.
10138
10139 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10140
10141         * compiler.csproj:
10142         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10143
10144 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10145
10146         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10147         it was important that we stored the right value after the
10148         reduction in `converted'.
10149
10150 2002-09-04  Martin Baulig  <martin@gnome.org>
10151
10152         * location.cs (Location.SymbolDocument): Use full pathnames for the
10153         source files.
10154
10155 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10156
10157         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10158         of the expression resolve mechanism, because that will catch the
10159         SimpleName error failures.
10160
10161         (Conditional): If we can not resolve the
10162         expression, return, do not crash.
10163
10164 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10165
10166         * cs-tokenizer.cs:
10167         (location): display token name instead of its number.
10168
10169 2002-08-28  Martin Baulig  <martin@gnome.org>
10170
10171         * expression.cs (Binary.ResolveOperator): Don't silently return
10172         but return an error if an operator cannot be applied between two
10173         enum types.
10174
10175 2002-08-28  Martin Baulig  <martin@gnome.org>
10176
10177         * class.cs (Constructor.Define): Set the permission attributes
10178         correctly instead of making all constructors public.
10179
10180 2002-08-28  Martin Baulig  <martin@gnome.org>
10181
10182         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10183         for private members before reporting a CS0103; if we find anything,
10184         it's a CS0122.
10185
10186 2002-08-28  Martin Baulig  <martin@gnome.org>
10187
10188         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10189         to check whether `closure_start_type == closure_invocation_type',
10190         we also need to check whether `m.DeclaringType == closure_invocation_type'
10191         before bypassing the permission checks.  We might be accessing
10192         protected/private members from the base class.
10193         (TypeManager.RealMemberLookup): Only set private_ok if private
10194         members were requested via BindingFlags.NonPublic.
10195
10196         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10197
10198         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10199         MethodGroupExpr.IsExplicitImpl if appropriate.
10200         (Invocation.DoResolve): Don't report the CS0120 for explicit
10201         interface implementations.
10202
10203 2002-08-27  Martin Baulig  <martin@gnome.org>
10204
10205         * expression.cs (Invocation.DoResolve): If this is a static
10206         method and we don't have an InstanceExpression, we must report
10207         a CS0120.
10208
10209 2002-08-25  Martin Baulig  <martin@gnome.org>
10210
10211         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10212         `==' between a valuetype and an object.
10213
10214 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * ecore.cs (TypeExpr): Provide a ToString method.
10217
10218 2002-08-24  Martin Baulig  <martin@gnome.org>
10219
10220         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10221         now called proggie.dbg and it's a binary file.
10222
10223 2002-08-23  Martin Baulig  <martin@gnome.org>
10224
10225         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10226
10227 2002-08-23  Martin Baulig  <martin@gnome.org>
10228
10229         * struct.cs (MyStructInfo.ctor): Make this work with empty
10230         structs; it's not allowed to use foreach() on null.
10231
10232 2002-08-23  Martin Baulig  <martin@gnome.org>
10233
10234         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10235         writer the full pathname of the generated assembly.
10236
10237 2002-08-23  Martin Baulig  <martin@gnome.org>
10238
10239         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10240         A `finally' block never returns or breaks; improved handling of
10241         unreachable code.
10242
10243 2002-08-23  Martin Baulig  <martin@gnome.org>
10244
10245         * statement.cs (Throw.Resolve): Allow `throw null'.
10246
10247 2002-08-23  Martin Baulig  <martin@gnome.org>
10248
10249         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10250         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10251         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10252         MemberLookup would return a wrong event if this is an explicit
10253         interface implementation and the class has an event with the same
10254         name.
10255
10256 2002-08-23  Martin Baulig  <martin@gnome.org>
10257
10258         * statement.cs (Block.AddChildVariableNames): New public method.
10259         (Block.AddChildVariableName): Likewise.
10260         (Block.IsVariableNameUsedInChildBlock): Likewise.
10261         (Block.AddVariable): Check whether a variable name has already
10262         been used in a child block.
10263
10264         * cs-parser.jay (declare_local_variables): Mark all variable names
10265         from the current block as being used in a child block in the
10266         implicit block.
10267
10268 2002-08-23  Martin Baulig  <martin@gnome.org>
10269
10270         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10271         find the symbol writer.
10272
10273         * driver.cs: csc also allows the arguments to /define being
10274         separated by commas, not only by semicolons.
10275
10276 2002-08-23  Martin Baulig  <martin@gnome.org>
10277
10278         * interface.cs (Interface.GetMembers): Added static check for events.
10279
10280 2002-08-15  Martin Baulig  <martin@gnome.org>
10281
10282         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10283         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10284
10285         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10286         why the MethodData.EmitDestructor() change was necessary.
10287
10288 2002-08-20  Martin Baulig  <martin@gnome.org>
10289
10290         * class.cs (TypeContainer.FindMembers): Added static check for events.
10291
10292         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10293
10294         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10295         use Type.GetEvents(), not Type.FindMembers().
10296
10297 2002-08-20  Martin Baulig  <martin@gnome.org>
10298
10299         * decl.cs (MemberCache): Added a special method cache which will
10300         be used for method-only searched.  This ensures that a method
10301         search will return a MethodInfo with the correct ReflectedType for
10302         inherited methods.      
10303
10304 2002-08-20  Martin Baulig  <martin@gnome.org>
10305
10306         * decl.cs (DeclSpace.FindMembers): Made this public.
10307
10308 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10309
10310         * delegate.cs: fixed build on windows.
10311         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10312
10313 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10314
10315         * ecore.cs (StandardConversionExists): Return a false
10316         if we are trying to convert the void type to anything else
10317         since that is not allowed.
10318
10319         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10320         we flag error 70 in the event an event is trying to be accessed
10321         directly from outside the declaring type.
10322
10323 2002-08-20  Martin Baulig  <martin@gnome.org>
10324
10325         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10326         MemberCache from typemanager.cs to decl.cs.
10327
10328 2002-08-19  Martin Baulig  <martin@gnome.org>
10329
10330         * class.cs (TypeContainer): Implement IMemberContainer.
10331         (TypeContainer.DefineMembers): Create the MemberCache.
10332         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10333         return public members if BindingFlags.Public was given, check
10334         whether members are static.
10335
10336 2002-08-16  Martin Baulig  <martin@gnome.org>
10337
10338         * decl.cs (DeclSpace.Define): Splitted this in Define and
10339         DefineMembers.  DefineMembers is called first and initializes the
10340         MemberCache.
10341
10342         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10343         DefineMembers() on all our DeclSpaces.
10344
10345         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10346         but call DefineMembers() on all nested interfaces.  We call their
10347         Define() in our new Define() function.
10348
10349         * interface.cs (Interface): Implement IMemberContainer.
10350         (Interface.Define): Moved all code except the attribute stuf to
10351         DefineMembers().
10352         (Interface.DefineMembers): Initialize the member cache.
10353
10354         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10355         need this anymore since we can use MemberCache.FindMembers directly.
10356
10357 2002-08-19  Martin Baulig  <martin@gnome.org>
10358
10359         * typemanager.cs (MemberCache): When creating the cache for an
10360         interface type, add all inherited members.
10361         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10362         to `out bool used_cache' and documented it.
10363         (TypeManager.MemberLookup): If we already used the cache in the first
10364         iteration, we don't need to do the interfaces check.
10365
10366 2002-08-19  Martin Baulig  <martin@gnome.org>
10367
10368         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10369         here from IMemberFinder and don't implement this interface anymore.
10370         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10371
10372         * typemanager.cs (IMemberFinder): This interface is now only used by
10373         classes which actually support the member cache.
10374         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10375         since we only put DeclSpaces into this Hashtable.
10376         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10377         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10378
10379 2002-08-16  Martin Baulig  <martin@gnome.org>
10380
10381         * typemanager.cs (ICachingMemberFinder): Removed.
10382         (IMemberFinder.MemberCache): New property.
10383         (TypeManager.FindMembers): Merged this with RealFindMembers().
10384         This function will never be called from TypeManager.MemberLookup()
10385         so we can't use the cache here, just the IMemberFinder.
10386         (TypeManager.MemberLookup_FindMembers): Check whether the
10387         IMemberFinder has a MemberCache and call the cache's FindMembers
10388         function.
10389         (MemberCache): Rewrote larger parts of this yet another time and
10390         cleaned it up a bit.
10391
10392 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10393
10394         * driver.cs (LoadArgs): Support quoting.
10395
10396         (Usage): Show the CSC-like command line arguments.
10397
10398         Improved a few error messages.
10399
10400 2002-08-15  Martin Baulig  <martin@gnome.org>
10401
10402         * typemanager.cs (IMemberContainer.Type): New property.
10403         (IMemberContainer.IsInterface): New property.
10404
10405         The following changes are conditional to BROKEN_RUNTIME, which is
10406         defined at the top of the file.
10407
10408         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10409         class'es members, but add all members from TypeHandle.ObjectType
10410         if we're an interface.
10411         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10412         is the current type.
10413         (MemberCache.CacheEntry.Container): Removed this field.
10414         (TypeHandle.GetMembers): Include inherited members.
10415
10416 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10417
10418         * typemanager.cs: fixed compilation and added a comment on a field that
10419         is never used.
10420
10421 2002-08-15  Martin Baulig  <martin@gnome.org>
10422
10423         * class.cs (ConstructorInitializer.Resolve): In the
10424         Expression.MemberLookup call, use the queried_type as
10425         invocation_type.
10426
10427         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10428         declared' attribute, it's always true.
10429         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10430         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10431         temporary wrapper for FindMembers which tells MemberLookup whether
10432         members from the base classes are included in the return value.
10433         This will go away soon.
10434         (TypeManager.MemberLookup): Use this temporary hack here; once the
10435         new MemberCache is completed, we don't need to do the DeclaredOnly
10436         looping here anymore since the MemberCache will take care of this.
10437         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10438         (MemberCache): When creating the MemberCache for a class, get
10439         members from the current class and all its base classes.
10440         (MemberCache.CacheEntry.Container): New field.  This is a
10441         temporary hack until the Mono runtime is fixed to distinguish
10442         between ReflectedType and DeclaringType.  It allows us to use MCS
10443         with both the MS runtime and the unfixed Mono runtime without
10444         problems and without accecting performance.
10445         (MemberCache.SearchMembers): The DeclaredOnly looping from
10446         TypeManager.MemberLookup is now done here.      
10447
10448 2002-08-14  Martin Baulig  <martin@gnome.org>
10449
10450         * statement.cs (MyStructInfo.MyStructInfo): Don't call
10451         Type.GetFields on dynamic types but get the fields from the
10452         corresponding TypeContainer.
10453         (MyStructInfo.GetStructInfo): Added check for enum types.
10454
10455         * typemanager.cs (MemberList.IsSynchronized): Implemented.
10456         (MemberList.SyncRoot): Implemented.
10457         (TypeManager.FilterWithClosure): No need to check permissions if
10458         closure_start_type == closure_invocation_type, don't crash if
10459         closure_invocation_type is null.
10460
10461 2002-08-13  Martin Baulig  <martin@gnome.org>
10462
10463         Rewrote TypeContainer.FindMembers to use a member cache.  This
10464         gives us a speed increase of about 35% for the self-hosting MCS
10465         build and of about 15-20% for the class libs (both on GNU/Linux).
10466
10467         * report.cs (Timer): New class to get enhanced profiling.  This
10468         whole class is "TIMER" conditional since it remarkably slows down
10469         compilation speed.
10470
10471         * class.cs (MemberList): New class.  This is an IList wrapper
10472         which we're now using instead of passing MemberInfo[]'s around to
10473         avoid copying this array unnecessarily.
10474         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
10475         (ICachingMemberFinder, IMemberContainer): New interface.
10476         (TypeManager.FilterWithClosure): If `criteria' is null, the name
10477         has already been checked, otherwise use it for the name comparision.
10478         (TypeManager.FindMembers): Renamed to RealMemberFinder and
10479         provided wrapper which tries to use ICachingMemberFinder.FindMembers
10480         if possible.  Returns a MemberList, not a MemberInfo [].
10481         (TypeHandle): New class, implements IMemberContainer.  We create
10482         one instance of this class per type, it contains a MemberCache
10483         which is used to do the member lookups.
10484         (MemberCache): New class.  Each instance of this class contains
10485         all members of a type and a name-based hash table.
10486         (MemberCache.FindMembers): This is our new member lookup
10487         function.  First, it looks up all members of the requested name in
10488         the hash table.  Then, it walks this list and sorts out all
10489         applicable members and returns them.
10490
10491 2002-08-13  Martin Baulig  <martin@gnome.org>
10492
10493         In addition to a nice code cleanup, this gives us a performance
10494         increase of about 1.4% on GNU/Linux - not much, but it's already
10495         half a second for the self-hosting MCS compilation.
10496
10497         * typemanager.cs (IMemberFinder): New interface.  It is used by
10498         TypeManager.FindMembers to call FindMembers on a TypeContainer,
10499         Enum, Delegate or Interface.
10500         (TypeManager.finder_to_member_finder): New PtrHashtable.
10501         (TypeManager.finder_to_container): Removed.
10502         (TypeManager.finder_to_delegate): Removed.
10503         (TypeManager.finder_to_interface): Removed.
10504         (TypeManager.finder_to_enum): Removed.
10505
10506         * interface.cs (Interface): Implement IMemberFinder.
10507
10508         * delegate.cs (Delegate): Implement IMemberFinder.
10509
10510         * enum.cs (Enum): Implement IMemberFinder.
10511
10512         * class.cs (TypeContainer): Implement IMemberFinder.
10513
10514 2002-08-12  Martin Baulig  <martin@gnome.org>
10515
10516         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
10517
10518 2002-08-12  Martin Baulig  <martin@gnome.org>
10519
10520         * ecore.cs (ITypeExpression): New interface for expressions which
10521         resolve to a type.
10522         (TypeExpression): Renamed to TypeLookupExpression.
10523         (Expression.DoResolve): If we're doing a types-only lookup, the
10524         expression must implement the ITypeExpression interface and we
10525         call DoResolveType() on it.
10526         (SimpleName): Implement the new ITypeExpression interface.
10527         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
10528         hack, the situation that we're only looking up types can't happen
10529         anymore when this method is called.  Moved the type lookup code to
10530         DoResolveType() and call it.
10531         (SimpleName.DoResolveType): This ITypeExpression interface method
10532         is now doing the types-only lookup.
10533         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
10534         (ResolveFlags): Added MaskExprClass.
10535
10536         * expression.cs (MemberAccess): Implement the ITypeExpression
10537         interface.
10538         (MemberAccess.DoResolve): Added support for a types-only lookup
10539         when we're called via ITypeExpression.DoResolveType().
10540         (ComposedCast): Implement the ITypeExpression interface.
10541
10542         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
10543         Expression.Resolve() with ResolveFlags.Type instead.
10544
10545 2002-08-12  Martin Baulig  <martin@gnome.org>
10546
10547         * interface.cs (Interface.Define): Apply attributes.
10548
10549         * attribute.cs (Attribute.ApplyAttributes): Added support for
10550         interface attributes.
10551
10552 2002-08-11  Martin Baulig  <martin@gnome.org>
10553
10554         * statement.cs (Block.Emit): Only check the "this" variable if we
10555         do not always throw an exception.
10556
10557         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
10558         whether the property has a set accessor.
10559
10560 2002-08-11  Martin Baulig  <martin@gnome.org>
10561
10562         Added control flow analysis support for structs.
10563
10564         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
10565         with control flow analysis turned off.
10566         (IVariable): New interface.
10567         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
10568         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
10569         (FieldExpr.DoResolve): Resolve the instance expression with flow
10570         analysis turned off and do the definite assignment check after the
10571         resolving when we know what the expression will resolve to.
10572
10573         * expression.cs (LocalVariableReference, ParameterReference):
10574         Implement the new IVariable interface, only call the flow analysis
10575         code if ec.DoFlowAnalysis is true.
10576         (This): Added constructor which takes a Block argument.  Implement
10577         the new IVariable interface.
10578         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
10579         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
10580         This does the definite assignment checks for struct members.
10581
10582         * class.cs (Constructor.Emit): If this is a non-static `struct'
10583         constructor which doesn't have any initializer, call
10584         Block.AddThisVariable() to tell the flow analysis code that all
10585         struct elements must be initialized before control returns from
10586         the constructor.
10587
10588         * statement.cs (MyStructInfo): New public class.
10589         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
10590         argument to this indexer.  If non-zero, check an individual struct
10591         member, not the whole struct.
10592         (FlowBranching.CheckOutParameters): Check struct members.
10593         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
10594         overloaded versions of these methods which take an additional
10595         `int field_idx' argument to check struct members.
10596         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
10597         overloaded versions of these methods which take an additional
10598         `string field_name' argument to check struct member.s
10599         (VariableInfo): Implement the IVariable interface.
10600         (VariableInfo.StructInfo): New public property.  Returns the
10601         MyStructInfo instance of the variable if it's a struct or null.
10602         (Block.AddThisVariable): New public method.  This is called from
10603         Constructor.Emit() for non-static `struct' constructor which do
10604         not have any initializer.  It creates a special variable for the
10605         "this" instance variable which will be checked by the flow
10606         analysis code to ensure that all of the struct's fields are
10607         initialized before control returns from the constructor.
10608         (UsageVector): Added support for struct members.  If a
10609         variable/parameter is a struct with N members, we reserve a slot
10610         in the usage vector for each member.  A struct is considered fully
10611         initialized if either the struct itself (slot 0) or all its
10612         members are initialized.
10613
10614 2002-08-08  Martin Baulig  <martin@gnome.org>
10615
10616         * driver.cs (Driver.MainDriver): Only report an error CS5001
10617         if there were no compilation errors.
10618
10619         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
10620         `UnsafeContext' property to determine whether the parent is in
10621         unsafe context rather than checking the parent's ModFlags:
10622         classes nested in an unsafe class are unsafe as well.
10623
10624 2002-08-08  Martin Baulig  <martin@gnome.org>
10625
10626         * statement.cs (UsageVector.MergeChildren): Distinguish between
10627         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
10628         we return.  Added test17() and test18() to test-154.cs.
10629
10630 2002-08-08  Martin Baulig  <martin@gnome.org>
10631
10632         * typemanager.cs (TypeManager.FilterWithClosure): If we have
10633         Family access, make sure the invoking type isn't a subclass of the
10634         queried type (that'd be a CS1540).
10635
10636         * ecore.cs (Expression.MemberLookup): Added overloaded version of
10637         this method which takes an additional `Type invocation_type'.
10638
10639         * expression.cs (BaseAccess.DoResolve): Use the base type as
10640         invocation and query type.
10641         (MemberAccess.DoResolve): If the lookup failed and we're about to
10642         report a CS0122, try a lookup with the ec.ContainerType - if this
10643         succeeds, we must report a CS1540.
10644
10645 2002-08-08  Martin Baulig  <martin@gnome.org>
10646
10647         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
10648         (MethodGroupExpr): Implement the IMemberExpr interface.
10649
10650         * expression (MemberAccess.ResolveMemberAccess): No need to have
10651         any special code for MethodGroupExprs anymore, they're now
10652         IMemberExprs.   
10653
10654 2002-08-08  Martin Baulig  <martin@gnome.org>
10655
10656         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
10657         Family, FamANDAssem and FamORAssem permissions.
10658         (TypeManager.IsSubclassOrNestedChildOf): New public method.
10659
10660 2002-08-08  Martin Baulig  <martin@gnome.org>
10661
10662         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
10663         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
10664         or loop block.
10665
10666 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
10667
10668         * driver.cs: implemented /resource option to embed managed resources.
10669
10670 2002-08-07  Martin Baulig  <martin@gnome.org>
10671
10672         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
10673         (FieldBase.HasFieldInitializer): New public property.
10674         (FieldBase.GetInitializerExpression): New public method.  Resolves and
10675         returns the field initializer and makes sure it is only resolved once.
10676         (TypeContainer.EmitFieldInitializers): Call
10677         FieldBase.GetInitializerExpression to get the initializer, this ensures
10678         that it isn't resolved multiple times.
10679
10680         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
10681         the resolving process (SimpleName/MemberLookup) that we're currently
10682         emitting a field initializer (which must not access any instance members,
10683         this is an error CS0236).
10684
10685         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
10686         argument, if the `IsFieldInitializer' flag is set, we must report and
10687         error CS0236 and not an error CS0120.   
10688
10689 2002-08-07  Martin Baulig  <martin@gnome.org>
10690
10691         * ecore.cs (IMemberExpr): New public interface.
10692         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
10693         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
10694         if the expression is an IMemberExpr.
10695
10696         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
10697         to be null, implicitly default to `this' if we're non-static in
10698         this case.  Simplified the code a lot by using the new IMemberExpr
10699         interface.  Also fixed bug #28176 here.
10700
10701 2002-08-06  Martin Baulig  <martin@gnome.org>
10702
10703         * cs-parser.jay (SimpleLookup): Removed.  We need to create
10704         ParameterReferences during semantic analysis so that we can do a
10705         type-only search when resolving Cast, TypeOf and SizeOf.
10706         (block): Pass the `current_local_parameters' to the Block's
10707         constructor.
10708
10709         * class.cs (ConstructorInitializer): Added `Parameters parameters'
10710         argument to the constructor.
10711         (ConstructorInitializer.Resolve): Create a temporary implicit
10712         block with the parameters.
10713
10714         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
10715         references here if we aren't doing a type-only search.
10716
10717         * statement.cs (Block): Added constructor which takes a
10718         `Parameters parameters' argument.
10719         (Block.Parameters): New public property.
10720
10721         * support.cs (InternalParameters.Parameters): Renamed `parameters'
10722         to `Parameters' and made it public readonly.
10723
10724 2002-08-06  Martin Baulig  <martin@gnome.org>
10725
10726         * ecore.cs (Expression.Warning): Made this public as well.
10727
10728         * report.cs (Report.Debug): Print the contents of collections.
10729
10730 2002-08-06  Martin Baulig  <martin@gnome.org>
10731
10732         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
10733         used to tell Resolve() which kinds of expressions it may return.
10734         (Expression.Resolve): Added overloaded version of this method which
10735         takes a `ResolveFlags flags' argument.  This can be used to tell
10736         Resolve() which kinds of expressions it may return.  Reports a
10737         CS0118 on error.
10738         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
10739         ResolveFlags.SimpleName.
10740         (Expression.Error118): Added overloaded version of this method which
10741         takes a `ResolveFlags flags' argument.  It uses the flags to determine
10742         which kinds of expressions are allowed.
10743
10744         * expression.cs (Argument.ResolveMethodGroup): New public method.
10745         Resolves an argument, but allows a MethodGroup to be returned.
10746         This is used when invoking a delegate.
10747
10748         * TODO: Updated a bit.
10749
10750 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10751
10752         Fixed compilation with csc.
10753
10754         * ecore.cs: Expression.Error made public. Is this correct? Should
10755         Warning be made public too?
10756
10757         * expression.cs: use ea.Location instead of ea.loc.
10758         [FIXME:  Filed as bug #28607: MCS must report these errors.]
10759
10760 2002-08-06  Martin Baulig  <martin@gnome.org>
10761
10762         * ecore.cs (Expression.loc): Moved the location here instead of
10763         duplicating it in all derived classes.
10764         (Expression.Location): New public property.
10765         (Expression.Error, Expression.Warning): Made them non-static and
10766         removed the location argument.
10767         (Expression.Warning): Added overloaded version which takes an
10768         `int level' argument.
10769         (Expression.Error118): Make this non-static and removed the
10770         expression and location arguments.
10771         (TypeExpr): Added location argument to the constructor.
10772
10773         * expression.cs (StaticCallExpr): Added location argument to
10774         the constructor.
10775         (Indirection, PointerArithmetic): Likewise.
10776         (CheckedExpr, UnCheckedExpr): Likewise.
10777         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
10778         (StringPtr): Likewise.
10779
10780
10781 2002-08-05  Martin Baulig  <martin@gnome.org>
10782
10783         * expression.cs (BaseAccess.DoResolve): Actually report errors.
10784
10785         * assign.cs (Assign.DoResolve): Check whether the source
10786         expression is a value or variable.
10787
10788         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
10789         while resolving the corresponding blocks.
10790
10791         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
10792         an error, don't silently return null.
10793
10794         * statement.cs (Block.AddVariable): Do the error reporting here
10795         and distinguish between CS0128 and CS0136.
10796         (Block.DoResolve): Report all unused labels (warning CS0164).
10797         (LabeledStatement): Pass the location to the constructor.
10798         (LabeledStatement.HasBeenReferenced): New property.
10799         (LabeledStatement.Resolve): Set it to true here.
10800
10801         * statement.cs (Return.Emit): Return success even after reporting
10802         a type mismatch error (CS0126 or CS0127), this is what csc does and
10803         it avoids confusing the users with any consecutive errors.
10804
10805 2002-08-05  Martin Baulig  <martin@gnome.org>
10806
10807         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
10808
10809         * const.cs (Const.LookupConstantValue): Catch circular definitions.
10810
10811         * expression.cs (MemberAccess.DoResolve): Silently return if an
10812         error has already been reported.
10813
10814         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
10815         error has already been reported.
10816
10817 2002-08-05  Martin Baulig  <martin@gnome.org>
10818
10819         * statement.cs (UsageVector): Only initialize the `parameters'
10820         vector if we actually have any "out" parameters.
10821
10822 2002-08-05  Martin Baulig  <martin@gnome.org>
10823
10824         * expression.cs (Binary.ResolveOperator): When combining delegates,
10825         they must have the same type.
10826
10827 2002-08-05  Martin Baulig  <martin@gnome.org>
10828
10829         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
10830         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
10831         work with the ms runtime and we also don't need it: if we're a
10832         PropertyBuilder and not in the `indexer_arguments' hash, then we
10833         are a property and not an indexer.
10834
10835         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
10836         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
10837         since the latter one doesn't work with the ms runtime.
10838
10839 2002-08-03  Martin Baulig  <martin@gnome.org>
10840
10841         Fixed bugs #27998 and #22735.
10842
10843         * class.cs (Method.IsOperator): New public field.
10844         (Method.CheckBase): Report CS0111 if there's already a method
10845         with the same parameters in the current class.  Report CS0508 when
10846         attempting to change the return type of an inherited method.
10847         (MethodData.Emit): Report CS0179 if a method doesn't have a body
10848         and it's not marked abstract or extern.
10849         (PropertyBase): New abstract base class for Property and Indexer.
10850         (PropertyBase.CheckBase): Moved here from Property and made it work
10851         for indexers.
10852         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
10853         the same so we can reuse it there.
10854         (Property, Indexer): Derive from PropertyBase.
10855         (MethodSignature.inheritable_property_signature_filter): New delegate
10856         to find properties and indexers.
10857
10858         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
10859         argument and improved error reporting.
10860
10861         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
10862         EmptyReadOnlyParameters and made it a property.
10863
10864         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
10865         version of this method which takes a `PropertyInfo indexer'.
10866         (TypeManager.RegisterIndexer): New method.
10867
10868         * class.cs: Added myself as author of this file :-)
10869
10870 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10871
10872         * class.cs: fixed compilation on windoze.
10873
10874 2002-08-03  Martin Baulig  <martin@gnome.org>
10875
10876         * interface.cs (Interface.GetInterfaceBases): Check whether all
10877         base interfaces are at least as accessible than the current one.
10878
10879         * class.cs (TypeContainer.GetClassBases): Check whether base types
10880         are at least as accessible than the current type.
10881         (TypeContainer.AsAccessible): Implemented and made non-static.
10882         (MemberBase.CheckParameters): Report errors if the accessibility
10883         checks fail.
10884
10885         * delegate.cs (Delegate.Delegate): The default visibility is
10886         internal for top-level types and private for nested types.
10887         (Delegate.Define): Report errors if the accessibility checks fail.
10888
10889         * enum.cs (Enum.Enum): The default visibility is internal for
10890         top-level types and private for nested types.
10891         (Enum.DefineType): Compute the correct visibility.
10892
10893         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
10894         function which takes a `bool is_toplevel' instead of a TypeContainer.
10895
10896         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
10897         builtin type.
10898
10899 2002-08-02  Martin Baulig  <martin@gnome.org>
10900
10901         * expression.cs (LocalVariableReferenc): Added constructor which
10902         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
10903         (LocalVariableReference.IsReadOnly): New property.
10904         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
10905         variable is readonly, use our own readonly flag to do this; you can
10906         use the new constructor to get a writable reference to a read-only
10907         variable.
10908
10909         * cs-parser.jay (foreach_statement, using_statement): Get a writable
10910         reference to the local variable.
10911
10912 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
10913
10914         * rootcontext.cs (ResolveCore): Also include System.Exception
10915
10916         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
10917         we reach an EmptyStatement.
10918
10919         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
10920         is also fine.
10921
10922         * expression.cs (Binary.ResolveOperator): Check error result in
10923         two places.
10924
10925         use brtrue/brfalse directly and avoid compares to null.
10926
10927 2002-08-02  Martin Baulig  <martin@gnome.org>
10928
10929         * class.cs (TypeContainer.Define): Define all nested interfaces here.
10930         Fixes bug #28407, added test-155.cs.
10931
10932 2002-08-01  Martin Baulig  <martin@gnome.org>
10933
10934         * class.cs (Event.EmitDefaultMethod): Make this work with static
10935         events.  Fixes #28311, added verify-3.cs.
10936
10937 2002-08-01  Martin Baulig  <martin@gnome.org>
10938
10939         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
10940         `is_disposable' fields.
10941         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
10942         `hm.is_disposable' if we're using the collection pattern.
10943         (Foreach.EmitCollectionForeach): Use the correct type for the
10944         enumerator's local variable, only emit the try/finally block if
10945         necessary (fixes #27713).
10946
10947 2002-08-01  Martin Baulig  <martin@gnome.org>
10948
10949         * ecore.cs (Expression.report118): Renamed to Error118 and made
10950         it public static.
10951
10952         * statement.cs (Throw.Resolve): Check whether the expression is of
10953         the correct type (CS0118) and whether the type derives from
10954         System.Exception (CS0155).
10955         (Catch.Resolve): New method.  Do the type lookup here and check
10956         whether it derives from System.Exception (CS0155).
10957         (Catch.CatchType, Catch.IsGeneral): New public properties.
10958
10959         * typemanager.cs (TypeManager.exception_type): Added.
10960
10961 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
10962
10963         * driver.cs: Updated About function.
10964
10965 2002-07-31  Martin Baulig  <martin@gnome.org>
10966
10967         Implemented Control Flow Analysis.
10968
10969         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
10970         (EmitContext.CurrentBranching): Added.
10971         (EmitContext.StartFlowBranching): Added.
10972         (EmitContext.EndFlowBranching): Added.
10973         (EmitContext.KillFlowBranching): Added.
10974         (EmitContext.IsVariableAssigned): Added.
10975         (EmitContext.SetVariableAssigned): Added.
10976         (EmitContext.IsParameterAssigned): Added.
10977         (EmitContext.SetParameterAssigned): Added.
10978         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
10979         Added control flow analysis stuff here.
10980
10981         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
10982         resolve the expression as lvalue.
10983         (LocalVariableReference.DoResolve): Check whether the variable has
10984         already been assigned.
10985         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
10986         the parameter as assigned here.
10987         (ParameterReference.DoResolve): Check whether the parameter has already
10988         been assigned.
10989         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
10990         expression as lvalue.
10991
10992         * statement.cs (FlowBranching): New class for the flow analysis code.
10993         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
10994         (LabeledStatement.IsDefined): New public property.
10995         (LabeledStatement.AddUsageVector): New public method to tell flow
10996         analyis that the label may be reached via a forward jump.
10997         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
10998         flow analysis.
10999         (VariableInfo.Number): New public field.  This is used by flow analysis
11000         to number all locals of a block.
11001         (Block.CountVariables): New public property.  This is the number of
11002         local variables in this block (including the locals from all parent
11003         blocks).
11004         (Block.EmitMeta): Number all the variables.
11005
11006         * statement.cs: Added flow analysis support to all classes.
11007
11008 2002-07-31  Martin Baulig  <martin@gnome.org>
11009
11010         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11011         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11012         then use this argument.
11013
11014         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11015
11016         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11017         use this to specify /define options.
11018
11019 2002-07-29  Martin Baulig  <martin@gnome.org>
11020
11021         * statement.cs (Fixed): Moved all code that does variable lookups
11022         and resolvings from Emit to Resolve.
11023
11024         * statement.cs (For): Moved all code that does variable lookups
11025         and resolvings from Emit to Resolve.
11026
11027         * statement.cs (Using): Moved all code that does variable lookups
11028         and resolvings from Emit to Resolve.
11029
11030 2002-07-29  Martin Baulig  <martin@gnome.org>
11031
11032         * attribute.cs (Attribute.Resolve): Explicitly catch a
11033         System.NullReferenceException when creating the
11034         CustromAttributeBuilder and report a different warning message.
11035
11036 2002-07-29  Martin Baulig  <martin@gnome.org>
11037
11038         * support.cs (ParameterData.ParameterName): Added method to
11039         get the name of a parameter.
11040
11041         * typemanager.cs (TypeManager.IsValueType): New public method.
11042
11043 2002-07-29  Martin Baulig  <martin@gnome.org>
11044
11045         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11046         is a flag which specifies that it's either ref or out.
11047         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11048         the out parameter to `out Parameter.Modifier mod', also set the
11049         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11050
11051         * support.cs (InternalParameters.ParameterModifier): Distinguish
11052         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11053         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11054
11055         * expression.cs (Argument.GetParameterModifier): Distinguish
11056         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11057         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11058
11059 2002-07-29  Martin Baulig  <martin@gnome.org>
11060
11061         * expression.cs (ParameterReference.ParameterReference): Added
11062         `Location loc' argument to the constructor.
11063
11064         * cs-parser.jay: Pass location to ParameterReference.
11065
11066 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11067
11068         * statement.cs (Try): Initialize the location.
11069
11070         * cs-parser.jay: pass location to Try.
11071
11072         * expression.cs (Unary.Reduce): Change the prototype to return
11073         whether a constant fold could be performed or not.  The result is
11074         returned in an out parameters.  In the case of Indirection and
11075         AddressOf, we want to perform the full tests.
11076
11077 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11078
11079         * statement.cs (Statement.Emit): Flag dead code.
11080
11081 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11082
11083         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11084
11085 2002-07-27  Martin Baulig  <martin@gnome.org>
11086
11087         * class.cs (MethodData.Define): Put back call to
11088         TypeManager.AddMethod(), accidentally commented this out.
11089
11090         * report.cs (Debug): New public method to print debugging information,
11091         this is `[Conditional ("DEBUG")]'.
11092
11093 2002-07-26  Martin Baulig  <martin@gnome.org>
11094
11095         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11096         (switch_statement): Push the current_block to the switch_stack and
11097         pop it again when we're done with the switch.
11098         (switch_section): The new block is a child of the current_block.
11099         Fixes bug #24007, added test-152.cs.
11100
11101 2002-07-27  Martin Baulig  <martin@gnome.org>
11102
11103         * expression.cs (Invocation.EmitArguments): When calling a varargs
11104         function with only its fixed arguments, we need to pass an empty
11105         array.
11106
11107 2002-07-27  Martin Baulig  <martin@gnome.org>
11108
11109         Mono 0.13 has been released.
11110
11111 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11112
11113         * driver.cs: Rename --resource to --linkres, because that is what
11114         we do currently, we dont support --resource yet.
11115
11116         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11117
11118 2002-07-25  Martin Baulig  <martin@gnome.org>
11119
11120         * class.cs (MethodData): New public class.  This is a `method builder'
11121         class for a method or one accessor of a Property/Indexer/Event.
11122         (MethodData.GetMethodFlags): Moved here from MemberBase.
11123         (MethodData.ApplyAttributes): Likewise.
11124         (MethodData.ApplyObsoleteAttribute): Likewise.
11125         (MethodData.ApplyConditionalAttribute): Likewise.
11126         (MethodData.ApplyDllImportAttribute): Likewise.
11127         (MethodData.CheckAbstractAndExternal): Likewise.
11128         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11129         (MethodData.Emit): Formerly known as Method.Emit().
11130         (MemberBase): Moved everything which was specific to a single
11131         accessor/method to MethodData.
11132         (Method): Create a new MethodData and call Define() and Emit() on it.
11133         (Property, Indexer, Event): Create a new MethodData objects for each
11134         accessor and call Define() and Emit() on them.
11135
11136 2002-07-25  Martin Baulig  <martin@gnome.org>
11137
11138         Made MethodCore derive from MemberBase to reuse the code from there.
11139         MemberBase now also checks for attributes.
11140
11141         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11142         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11143         as virtual.
11144         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11145         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11146         (MemberBase.ApplyAttributes): New virtual method; applies the
11147         attributes to a method or accessor.
11148         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11149         (MemberBase.ApplyConditionalAttribute): Likewise.
11150         (MemberBase.ApplyDllImportAttribute): Likewise.
11151         (MemberBase.CheckAbstractAndExternal): Likewise.
11152         (MethodCore.ParameterTypes): This is now a property instead of a
11153         method, it's initialized from DoDefineParameters().
11154         (MethodCore.ParameterInfo): Removed the set accessor.
11155         (MethodCore.DoDefineParameters): New protected virtual method to
11156         initialize ParameterTypes and ParameterInfo.
11157         (Method.GetReturnType): We can now simply return the MemberType.
11158         (Method.GetMethodFlags): Override the MemberBase version and add
11159         the conditional flags.
11160         (Method.CheckBase): Moved some code from Define() here, call
11161         DoDefineParameters() here.
11162         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11163         here to avoid some larger code duplication.
11164         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11165         ensure that abstract and external accessors don't declare a body.
11166
11167         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11168         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11169         lookup in the attribute's parent classes, so we need to abort as soon
11170         as we found the first match.
11171         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11172         the attribute has no arguments.
11173
11174         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11175         of a Method.
11176
11177 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11178
11179         * cs-parser.jay: reverted previous patch.
11180
11181 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11182
11183         * cs-parser.jay: fixed bug #22119.
11184
11185 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11186
11187         * attribute.cs: fixed compilation. The error was:
11188         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11189         be assigned to before control leaves the current method."
11190         [FIXME:  Filed as bug #28186: MCS must report this error.]
11191
11192 2002-07-25  Martin Baulig  <martin@gnome.org>
11193
11194         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11195         method to pull the condition name ouf of a Conditional attribute.
11196         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11197         the obsolete message and error flag out of an Obsolete attribute.
11198
11199         * class.cs (Method.GetMethodFlags): New public method to get the
11200         TypeManager.MethodFlags for this method.
11201         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11202         private methods.
11203         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11204         if we're overriding a virtual function, set the new private variable
11205         `parent_method'; call the new TypeManager.AddMethod().
11206
11207         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11208         the MethodBuilder and the Method in a PtrHashtable.
11209         (TypeManager.builder_to_method): Added for this purpose.
11210         (TypeManager.MethodFlags): Added IsObsoleteError.
11211         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11212         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11213         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11214         the message from the attribute.
11215
11216 2002-07-24  Martin Baulig  <martin@gnome.org>
11217
11218         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11219         preprocessor directives, ensure that the argument to #define/#undef is
11220         exactly one identifier and that it's actually an identifier.
11221
11222         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11223         did not work ....
11224
11225 2002-07-24  Martin Baulig  <martin@gnome.org>
11226
11227         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11228         initialize it to TypeManager.object_type in the constructor.
11229         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11230         of the `hm.get_current' method if we're using the collection pattern.
11231         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11232         for the explicit conversion to make it work when we're using the collection
11233         pattern and the `Current' property has a different return type than `object'.
11234         Fixes #27713.
11235
11236 2002-07-24  Martin Baulig  <martin@gnome.org>
11237
11238         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11239         does not match, but don't report any errors.  This method is called in
11240         order for all methods in a MethodGroupExpr until a matching method is
11241         found, so we don't want to bail out if the first method doesn't match.
11242         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11243         matches, report the 123.  Fixes #28070.
11244
11245 2002-07-24  Martin Baulig  <martin@gnome.org>
11246
11247         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11248         TypeManager.TypeToCoreType() to the top of the method so the
11249         following equality checks will work.  Fixes #28107.
11250
11251 2002-07-24  Martin Baulig  <martin@gnome.org>
11252
11253         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11254         operand is of type uint, and the other operand is of type sbyte,
11255         short or int, the operands are converted to type long." -
11256         Actually do what this comment already told us.  Fixes bug #28106,
11257         added test-150.cs.
11258
11259 2002-07-24  Martin Baulig  <martin@gnome.org>
11260
11261         * class.cs (MethodBase): New abstract class.  This is now a base
11262         class for Property, Indexer and Event to avoid some code duplication
11263         in their Define() and DefineMethods() methods.
11264         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11265         generic methods for Define() and DefineMethods().
11266         (FieldBase): Derive from MemberBase, not MemberCore.
11267         (Property): Derive from MemberBase, not MemberCore.
11268         (Property.DefineMethod): Moved all the code from this method to the
11269         new MethodBase.DefineAccessor(), just call it with appropriate
11270         argumetnts.
11271         (Property.Define): Call the new Property.DoDefine(), this does some
11272         sanity checks and we don't need to duplicate the code everywhere.
11273         (Event): Derive from MemberBase, not MemberCore.
11274         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11275         accessors, this will also make them work with interface events.
11276         (Indexer): Derive from MemberBase, not MemberCore.
11277         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11278         (Indexer.Define): Use the new MethodBase functions.
11279
11280         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11281         argument to the constructor.
11282         (Interface.FindMembers): Added support for interface events.
11283         (Interface.PopluateEvent): Implemented.
11284
11285         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11286
11287 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11288
11289         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11290         but this is required to check for a method name being the same as
11291         the containing class.  
11292
11293         Handle this now.
11294
11295 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11296
11297         * interface.cs: initialize variable.
11298
11299 2002-07-23  Martin Baulig  <martin@gnome.org>
11300
11301         Implemented the IndexerName attribute in interfaces.
11302
11303         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11304         name if this is an explicit interface implementation.
11305         (Indexer.InterfaceIndexerName): New public variable.  If we're
11306         implementing an interface indexer, this is the IndexerName in that
11307         interface.  Otherwise, it's the IndexerName.
11308         (Indexer.DefineMethod): If we're implementing interface indexer,
11309         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11310         and Pending.ImplementIndexer methods.
11311         (Indexer.Define): Also define the PropertyBuilder if we're
11312         implementing an interface indexer and this is neither an explicit
11313         interface implementation nor do the IndexerName match the one in
11314         the interface.
11315
11316         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11317         If a method is defined here, then we always need to create a proxy
11318         for it.  This is used when implementing interface indexers.
11319         (Pending.IsInterfaceIndexer): New public method.
11320         (Pending.ImplementIndexer): New public method.
11321         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11322         This is used when implementing interface indexers to define a proxy
11323         if necessary.
11324         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11325         define a proxy if necessary.
11326
11327         * interface.cs (Interface.IndexerName): New public variable.
11328         (Interface.PopulateIndexer): Set the IndexerName.
11329         (Interface.DefineIndexers): New private method.  Populate all the
11330         indexers and make sure their IndexerNames match.
11331
11332         * typemanager.cs (IndexerPropertyName): Added support for interface
11333         indexers.
11334
11335 2002-07-22  Martin Baulig  <martin@gnome.org>
11336
11337         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11338         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11339         ret if HasReturnLabel.
11340         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11341         variables.
11342
11343         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11344         and set the ec.LoopBeginTryCatchLevel.
11345         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11346         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11347         the current ec.TryCatchLevel, the branch goes out of an exception
11348         block.  In this case, we need to use Leave and not Br.
11349
11350 2002-07-22  Martin Baulig  <martin@gnome.org>
11351
11352         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11353         block unless the block does not always return or it is contained in
11354         another try { ... } catch { ... } block.  Fixes bug #26506.
11355         Added verify-1.cs to the test suite.
11356
11357 2002-07-22  Martin Baulig  <martin@gnome.org>
11358
11359         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11360         then we do not always return.  Fixes bug #24985.
11361
11362 2002-07-22  Martin Baulig  <martin@gnome.org>
11363
11364         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11365         lookup on a per-class level; ie. walk up the class hierarchy until we
11366         found at least one applicable method, then choose the best among them.
11367         Fixes bug #24463 and test-29.cs.
11368
11369 2002-07-22  Martin Baulig  <martin@gnome.org>
11370
11371         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11372         return types of the methods.  The return type is not part of the
11373         signature and we must not check it to make the `new' modifier work.
11374         Fixes bug #27999, also added test-147.cs.
11375         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11376
11377         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11378         on the method's return type.
11379
11380 2002-07-21  Martin Baulig  <martin@gnome.org>
11381
11382         * assign.cs: Make this work if the rightmost source is a constant and
11383         we need to do an implicit type conversion.  Also adding a few more tests
11384         to test-38.cs which should have caught this.
11385
11386         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11387         target in the makefile for this.  The makefile.gnu is primarily intended
11388         for end-users who don't want to debug the compiler.
11389
11390 2002-07-21  Martin Baulig  <martin@gnome.org>
11391
11392         * assign.cs: Improved the Assign class so it can now handle embedded
11393         assignments (X = Y = Z = something).  As a side-effect this'll now also
11394         consume less local variables.  test-38.cs now passes with MCS, added
11395         a few new test cases to that test.
11396
11397 2002-07-20  Martin Baulig  <martin@gnome.org>
11398
11399         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11400         instructions.  Fixes bug #27977, also added test-146.cs.
11401
11402 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11403
11404         * cs-tokenizer.cs: fixed getHex ().
11405
11406 2002-07-19  Martin Baulig  <martin@gnome.org>
11407
11408         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11409         not Type.GetType() to lookup the array type.  This is needed when
11410         we're constructing an array of a user-defined type.
11411         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11412         single-dimensional arrays, but also for single-dimensial arrays of
11413         type decimal.
11414
11415 2002-07-19  Martin Baulig  <martin@gnome.org>
11416
11417         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11418         this function is called, it's not allowed to share LocalBuilders
11419         among ILGenerators.
11420
11421 2002-07-19  Martin Baulig  <martin@gnome.org>
11422
11423         * expression.cs (Argument.Resolve): Report an error 118 when trying
11424         to pass a type as argument.
11425
11426 2002-07-18  Martin Baulig  <martin@gnome.org>
11427
11428         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11429         Conv_R_Un for the signed `long' type.
11430
11431 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11432
11433         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11434         `expr' for the temporary result, as that will fail if we do
11435         multiple resolves on the same expression.
11436
11437 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11438
11439         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11440         ec.TypeContainer for looking up aliases. 
11441
11442         * class.cs (TypeContainer): Remove LookupAlias from here.
11443
11444         * decl.cs (DeclSpace); Move here.
11445
11446 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
11447
11448         * class.cs (FindMembers): Only call filter if the constructor
11449         bulider is not null.
11450
11451         Also handle delegates in `NestedTypes' now.  Now we will perform
11452         type lookups using the standard resolution process.  This also
11453         fixes a bug.
11454
11455         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11456         This uses Expressions (the limited kind that can be parsed by the
11457         tree) instead of strings.
11458
11459         * expression.cs (ComposedCast.ToString): Implement, used to flag
11460         errors since now we have to render expressions.
11461
11462         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
11463         FormArrayType. 
11464
11465         * ecore.cs (SimpleName.ToString): ditto.
11466
11467         * cs-parser.jay: Instead of using strings to assemble types, use
11468         Expressions to assemble the type (using SimpleName, ComposedCast,
11469         MemberAccess).  This should fix the type lookups in declarations,
11470         because we were using a different code path for this.
11471
11472         * statement.cs (Block.Resolve): Continue processing statements
11473         even when there is an error.
11474
11475 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
11476
11477         * class.cs (Event.Define): Also remove the `remove' method from
11478         the list of pending items.
11479
11480         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
11481         generate more compact code. 
11482
11483 2002-07-17  Martin Baulig  <martin@gnome.org>
11484
11485         * const.cs (Const.LookupConstantValue): Add support for constant
11486         `unchecked' and `checked' expressions.
11487         Also adding test case test-140.cs for this.
11488
11489 2002-07-17  Martin Baulig  <martin@gnome.org>
11490
11491         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
11492         check whether mi.ReturnType implements the IEnumerator interface; the
11493         `==' and the IsAssignableFrom() will fail in this situation.
11494
11495 2002-07-16  Ravi Pratap  <ravi@ximian.com>
11496
11497         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
11498         here too.
11499
11500 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11501
11502         * expression.cs: fixed bug #27811.
11503
11504 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
11507         Molaro: when we are a ref, the value already contains a pointer
11508         value, do not take the address of it.
11509
11510 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
11511         * removed mb-parser.jay and mb-tokenizer.cs
11512
11513 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11514
11515         * expression.cs: check against the building corlib void type.
11516
11517 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
11518
11519         * ecore.cs: fix for valuetype static readonly fields: when 
11520         initializing them, we need their address, not the address of a copy.
11521
11522 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
11523
11524         * typemanager.cs: register also enum_type in corlib.
11525
11526 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
11527
11528         * class.cs: allow calling this (but not base) initializers in structs.
11529
11530 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
11531
11532         * ecore.cs: make sure we compare against the building base types
11533         in GetTypeSize ().
11534
11535 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
11536
11537         * typemanager.cs: fix TypeToCoreType() to handle void and object
11538         (corlib gets no more typerefs after this change).
11539
11540 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
11541
11542         * expression.cs (ArrayCreation.EmitArrayArguments): use
11543         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
11544
11545         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
11546         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
11547         array indexes, the runtime actually forbids them.
11548
11549         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
11550         for array arguments here.
11551
11552         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
11553         instead of the default for ValueTypes.
11554
11555         (New.DoEmit): Use IsValueType instead of
11556         IsSubclassOf (value_type)
11557         (New.DoResolve): ditto.
11558         (Invocation.EmitCall): ditto.
11559
11560         * assign.cs (Assign): ditto.
11561
11562         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
11563         Statements *are* currently doing part of their resolution during
11564         Emit.  
11565
11566         Expressions do always resolve during resolve, but statements are
11567         only required to propagate resolution to their children.
11568
11569 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
11570
11571         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
11572
11573         (LoadAssembly): Do not add the dll if it is already specified
11574
11575         (MainDriver): Add the System directory to the link path at the end,
11576         after all the other -L arguments. 
11577
11578         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
11579         wrong opcode for loading bytes and bools (ldelem.i1 instead of
11580         ldelem.u1) and using the opposite for sbytes.
11581
11582         This fixes Digger, and we can finally run it.
11583
11584         * driver.cs (UnixParseOption): Move the option parsing here.  
11585         (CSCParseOption): Implement CSC-like parsing of options.
11586
11587         We now support both modes of operation, the old Unix way, and the
11588         new CSC-like way.  This should help those who wanted to make cross
11589         platform makefiles.
11590
11591         The only thing broken is that /r:, /reference: and /lib: are not
11592         implemented, because I want to make those have the same semantics
11593         as the CSC compiler has, and kill once and for all the confussion
11594         around this.   Will be doing this tomorrow.
11595
11596         * statement.cs (Unsafe.Resolve): The state is checked during
11597         resolve, not emit, so we have to set the flags for IsUnsfe here.
11598
11599 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
11600
11601         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
11602         not catch the Error_ObjectRefRequired in SimpleName (as it is
11603         possible to have a class/instance variable name that later gets
11604         deambiguated), we have to check this here.      
11605
11606 2002-07-10  Ravi Pratap  <ravi@ximian.com>
11607
11608         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
11609         make static and put into Expression.
11610
11611         (Event.Define): Register the private field of the event with the 
11612         TypeManager so that GetFieldFromEvent can get at it.
11613
11614         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
11615         keep track of the private field associated with an event which
11616         has no accessors.
11617
11618         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
11619         private field.
11620
11621         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
11622
11623 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
11624
11625         * expression.cs (Binary.EmitBranchable): this routine emits the
11626         Binary expression in a branchable context.  This basically means:
11627         we need to branch somewhere, not just get the value on the stack.
11628
11629         This works together with Statement.EmitBoolExpression.
11630
11631         * statement.cs (Statement.EmitBoolExpression): Use
11632         EmitBranchable. 
11633
11634 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
11635
11636         * statement.cs (For): Reduce the number of jumps in loops.
11637
11638         (For): Implement loop inversion for the For statement.
11639
11640         (Break): We can be breaking out of a Try/Catch controlled section
11641         (foreach might have an implicit try/catch clause), so we need to
11642         use Leave instead of Br.
11643
11644         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
11645         now).  If the instace expression supports IMemoryLocation, we use
11646         the AddressOf method from the IMemoryLocation to extract the
11647         address instead of emitting the instance.
11648
11649         This showed up with `This', as we were emitting the instance
11650         always (Emit) instead of the Address of This.  Particularly
11651         interesting when This is a value type, as we dont want the Emit
11652         effect (which was to load the object).
11653
11654 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
11655
11656         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
11657
11658         * statement.cs (Checked): Set the CheckedState during the resolve
11659         process too, as the ConvCast operations track the checked state on
11660         the resolve process, and not emit.
11661
11662         * cs-parser.jay (namespace_member_declaration): Flag that we have
11663         found a declaration when we do.  This is used to flag error 1529
11664
11665         * driver.cs: Report ok when we display the help only.
11666
11667 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
11668
11669         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
11670
11671 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
11672
11673         * cs-tokenizer.cs (define): We also have to track locally the
11674         defines.  AllDefines is just used for the Conditional Attribute,
11675         but we also need the local defines for the current source code. 
11676
11677 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
11678
11679         * statement.cs (While, For, Do): These loops can exit through a
11680         Break statement, use this information to tell whether the
11681         statement is the last piece of code.
11682
11683         (Break): Flag that we break.
11684
11685         * codegen.cs (EmitContexts): New `Breaks' state variable.
11686
11687 2002-07-03  Martin Baulig  <martin@gnome.org>
11688
11689         * class.cs (TypeContainer.MethodModifiersValid): Allow override
11690         modifiers in method declarations in structs.  Otherwise, you won't
11691         be able to override things like Object.Equals().
11692
11693 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
11694
11695         * class.cs (Method, Property, Indexer): Do not allow the public
11696         modifier to be used in explicit interface implementations.
11697
11698         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
11699         override modifiers in method declarations in structs
11700
11701 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
11702
11703         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
11704         integer or real overflow, report an error
11705
11706 2002-07-02  Martin Baulig  <martin@gnome.org>
11707
11708         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
11709         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
11710         to tell the runtime about our newly created System.Object and
11711         System.ValueType types.
11712
11713 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
11714
11715         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
11716         struct instead of Ldarg/Starg.
11717
11718 2002-07-02  Martin Baulig  <martin@gnome.org>
11719
11720         * expression.cs (Indirection.Indirection): Call
11721         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
11722
11723 2002-07-02  Martin Baulig  <martin@gnome.org>
11724
11725         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
11726         ValueType, call TypeManager.TypeToCoreType() on it.
11727         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
11728         the OpCodes.Newarr argument.
11729
11730 2002-07-02  Martin Baulig  <martin@gnome.org>
11731
11732         * expression.cs (Invocation.EmitCall): When compiling corlib,
11733         replace all calls to the system's System.Array type to calls to
11734         the newly created one.
11735
11736         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
11737         System.Array methods.
11738         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
11739         from the system's System.Array type which must be replaced.
11740
11741 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
11742
11743         * typemanager.cs: load unverifiable_code_ctor so we can build
11744         corlib using the correct type. Avoid using GetTypeCode() with
11745         TypeBuilders.
11746         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
11747         TypeManager.object_type to allow building corlib.
11748
11749 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
11750
11751         * ecore.cs: handle System.Enum separately in LoadFromPtr().
11752
11753 2002-07-01  Martin Baulig  <martin@gnome.org>
11754
11755         * class.cs: Make the last change actually work, we need to check
11756         whether `ifaces != null' to avoid a crash.
11757
11758 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
11759
11760         * class.cs: when we build structs without fields that implement
11761         interfaces, we need to add the interfaces separately, since there is
11762         no API to both set the size and add the interfaces at type creation
11763         time.
11764
11765 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
11766
11767         * expression.cs: the dimension arguments to the array constructors
11768         need to be converted if they are a long.
11769
11770 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
11771
11772         * class.cs: don't emit ldarg.0 if there is no parent constructor
11773         (fixes showstopper for corlib).
11774
11775 2002-06-29  Martin Baulig  <martin@gnome.org>
11776
11777         MCS now compiles corlib on GNU/Linux :-)
11778
11779         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
11780         ie. check for MethodImplOptions.InternalCall.
11781
11782         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
11783         and TypeManager.attribute_type are null, so we must explicitly check
11784         whether parent is not null to find out whether it's an attribute type.
11785         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
11786         and SetBuilder, not only if the property is neither abstract nor external.
11787         This is necessary to set the MethodImplOptions on the accessor methods.
11788         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
11789         SetBuilder, see Property.Emit().
11790
11791         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
11792         populate "System.Object", "System.ValueType" and "System.Attribute" since
11793         they've already been populated from BootCorlib_PopulateCoreTypes().
11794
11795 2002-06-29  Martin Baulig  <martin@gnome.org>
11796
11797         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
11798         is the NullLiteral, we also need to make sure that target_type is not
11799         an enum type.   
11800
11801 2002-06-29  Martin Baulig  <martin@gnome.org>
11802
11803         * rootcontext.cs (RootContext.ResolveCore): We must initialize
11804         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
11805         before calling BootstrapCorlib_ResolveDelegate ().
11806
11807 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11808
11809         * statement.cs: fixed build-breaker. All tests passed ok.
11810
11811 2002-06-27  Martin Baulig  <martin@gnome.org>
11812
11813         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
11814         for System.Decimal when compiling corlib.
11815
11816 2002-06-27  Martin Baulig  <martin@gnome.org>
11817
11818         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
11819         switch blocks which contain nothing but a default clause.
11820
11821 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
11822
11823        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
11824
11825 2002-06-27  Martin Baulig  <martin@gnome.org>
11826
11827         * ecore.cs (PropertyExpr.PropertyExpr): Call
11828         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
11829
11830         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
11831         is already a TypeBuilder.
11832
11833 2002-06-27  Martin Baulig  <martin@gnome.org>
11834
11835         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
11836         `target_type == TypeManager.array_type', not IsAssignableFrom() in
11837         the "from an array-type to System.Array" case.  This makes it work
11838         when compiling corlib.
11839
11840 2002-06-27  Martin Baulig  <martin@gnome.org>
11841
11842         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
11843         non-static PropertyExpr, set its InstanceExpression.  This makes
11844         the `ICollection.Count' property work in System/Array.cs.
11845
11846 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
11847
11848         * driver.cs: Made error handling more consistent.  Errors now
11849         tracked by Report class, so many methods which used to return int
11850         now return void.  Main() now prints success/failure and 
11851         errors/warnings message.
11852
11853         Renamed '--probe' compiler argument to '--expect-error'.  Removed
11854         the magic number return values (123 and 124).  Now, if the
11855         expected error occurs, the compiler exits with success (exit value
11856         0).  If the compilation completes without seeing that particular
11857         error, the compiler exits with failure (exit value 1).  The
11858         makefile in mcs/errors has been changed to handle the new behaviour.
11859
11860         * report.cs: Made 'expected error' number a property and renamed
11861         it from 'Probe' to 'ExpectedError'.
11862
11863         * genericparser.cs: Removed error handling support, since it is
11864         now all done by Report class.
11865
11866         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
11867         class, so parse() no longer returns an int.
11868
11869         * namespace.cs: Use Report.Error instead of GenericParser.error
11870
11871 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
11872
11873         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
11874         TypeContainer.AddOperator): At the front of the list put the
11875         explicit implementations, so they get resolved/defined first. 
11876
11877 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
11878
11879         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
11880         interface type is implemented by this TypeContainer.  Used during
11881         explicit interface implementation.
11882
11883         (Property.Define, Indexer.Define, Method.Define): Validate that
11884         the given interface in the explicit implementation is one of the
11885         base classes for the containing type.
11886
11887         Also if we are explicitly implementing an interface, but there is
11888         no match in the pending implementation table, report an error.
11889
11890         (Property.Define): Only define the property if we are
11891         not explicitly implementing a property from an interface.  Use the
11892         correct name also for those properties (the same CSC uses,
11893         although that is really not needed).
11894
11895         (Property.Emit): Do not emit attributes for explicitly implemented
11896         properties, as there is no TypeBuilder.
11897
11898         (Indexer.Emit): ditto.
11899
11900         Hiding then means that we do not really *implement* a pending
11901         implementation, which makes code fail.
11902
11903 2002-06-22  Martin Baulig  <martin@gnome.org>
11904
11905         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
11906         the return value of Object.GetType().  [FIXME: we need to do this whenever
11907         we get a type back from the reflection library].
11908
11909 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
11910
11911         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
11912
11913 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
11914
11915         * attribute.cs: Return null if we can not look up the type.
11916
11917         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
11918         the interface types found.
11919
11920         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
11921         interface types found.
11922
11923         * typemanager.cs (GetInterfaces): Make this routine returns alll
11924         the interfaces and work around the lame differences between
11925         System.Type and System.Reflection.Emit.TypeBuilder in the results
11926         result for GetInterfaces.
11927
11928         (ExpandInterfaces): Given an array of interface types, expand and
11929         eliminate repeated ocurrences of an interface.  This expands in
11930         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
11931         be IA, IB, IC.
11932
11933 2002-06-21  Martin Baulig  <martin@gnome.org>
11934
11935         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
11936         on System.Enum.
11937
11938 2002-06-21  Martin Baulig  <martin@gnome.org>
11939
11940         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
11941         and called with one of the core types, return the corresponding typebuilder for
11942         that type.
11943
11944         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
11945         element type.
11946
11947 2002-06-21  Martin Baulig  <martin@gnome.org>
11948
11949         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
11950         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
11951         (Expression.ConvertReferenceExplicit): Likewise.
11952
11953         * expression.cs (ElementAccess.DoResolve): Likewise.
11954         (ElementAccess.DoResolveLValue): Likewise.
11955
11956 2002-06-10  Martin Baulig  <martin@gnome.org>
11957
11958         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
11959         add the "value" parameter to the parameter list.
11960
11961         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
11962         to our caller.
11963
11964 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
11965
11966         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
11967         the argument to an int, uint, long or ulong, per the spec.  Also
11968         catch negative constants in array creation.
11969
11970 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
11971
11972         * class.cs: do not allow the same interface to appear twice in
11973         the definition list.
11974
11975 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
11976
11977         * ecore.cs: don't use ldlen with System.Array.
11978
11979 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
11980
11981         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
11982
11983 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
11984
11985         * modifiers.cs: produce correct field attributes for protected
11986         internal. Easy fix so miguel can work on ther harder stuff:-)
11987
11988 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
11989
11990         * pending.cs: New file.  Move the code from class.cs here.
11991         Support clearning the pending flag for all methods (when not doing
11992         explicit interface implementation).
11993
11994 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
11995
11996         * rootcontext.cs: added a couple more types needed to bootstrap.
11997
11998 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
11999
12000         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12001         constructor in the type, instead of any constructor in the type
12002         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12003         a bug in the Mono runtime when applying the params attribute). 
12004
12005 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12006         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12007
12008 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12009
12010         * expression.cs (Unary.ResolveOperator): Use TypeManager
12011         to resolve the type.
12012
12013 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12014
12015         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12016         attached.
12017
12018         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12019         with each member too.
12020
12021         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12022         field builders too - this takes care of the enum member case.
12023
12024 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12025
12026         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12027         address-of operator on both value types and pointers.
12028
12029 2002-06-10  Martin Baulig  <martin@gnome.org>
12030
12031         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12032         PropertyBuilder to the `property_builders' list.
12033
12034         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12035         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12036         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12037         find any indexers which are inherited from an interface.
12038
12039 2002-06-09  Martin Baulig  <martin@gnome.org>
12040
12041         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12042         the same type as the constant if necessary.  There's also a test-130.cs
12043         for this.
12044
12045         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12046
12047         * typemanager.cs (TypeManager.ChangeType): Previously known as
12048         Enum.ChangeEnumType().
12049
12050 2002-06-09  Martin Baulig  <martin@gnome.org>
12051
12052         * expression.cs (Cast.TryReduce): Added support for consts.
12053
12054 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12055
12056         * class.cs (Accessor): Hold attributes information so we can pass
12057         it along.
12058
12059         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12060         Modify to pass in attributes attached to the methods.
12061
12062         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12063
12064         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12065         to handle the Accessor kind :-)
12066
12067         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12068
12069 2002-06-08  Martin Baulig  <martin@gnome.org>
12070
12071         * expression.cs (Unary.TryReduceNegative): Added support for
12072         ULongConstants.
12073
12074 2002-06-08  Martin Baulig  <martin@gnome.org>
12075
12076         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12077         name can't be found in the `defined_names' - the caller will do a
12078         MemberLookup in this case and thus find methods in System.Enum
12079         such as Enum.IsDefined().
12080
12081 2002-06-08  Martin Baulig  <martin@gnome.org>
12082
12083         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12084         Convert.ChangeType() which works with TypeBuilder created types.
12085         (Enum.LookupEnumValue, Enum.Define): Use it here.
12086
12087         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12088         `TypeBuilder.BaseType != null' check.
12089         (TypeContainer.FindMembers): Only lookup parent members if we
12090         actually have a parent.
12091         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12092         (ConstructorInitializer.Resolve): Likewise.
12093
12094         * interface.cs (Interface.FindMembers): Added
12095         `TypeBuilder.BaseType != null' check.
12096
12097         * rootcontext.cs (RootContext.ResolveCore): Added
12098         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12099         classes_second_stage.
12100
12101         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12102         debug_type and trace_type when compiling with --nostdlib.       
12103
12104 2002-06-07  Martin Baulig  <martin@gnome.org>
12105
12106         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12107         (AddField): Set it to true when adding a non-static field.
12108         (DefineType): Use `have_nonstatic_fields' to find out whether we
12109         have non-static fields, not `Fields != null'.
12110
12111 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12112
12113         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12114         dereferencing a null on the static-field code path)
12115
12116 2002-05-30  Martin Baulig  <martin@gnome.org>
12117
12118         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12119         to take command line arguments.  Use reflection to call the new
12120         custom `Initialize' function on the symbol writer and pass it the
12121         command line arguments.
12122
12123         * driver.cs (--debug-args): New command line argument to pass command
12124         line arguments to the symbol writer.
12125
12126 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12127
12128         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12129         the target type for indexers and properties.  Thanks to Joe for
12130         catching this.
12131
12132 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12133
12134         * typemanager.cs (MethodFlags): returns the method flags
12135         (Obsolete/ShouldIgnore) that control warning emission and whether
12136         the invocation should be made, or ignored. 
12137
12138         * expression.cs (Invocation.Emit): Remove previous hack, we should
12139         not do this on matching a base type, we should do this based on an attribute
12140
12141         Only emit calls to System.Diagnostics.Debug and
12142         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12143         on the command line.
12144
12145         * rootcontext.cs: Global settings for tracing and debugging.
12146
12147         * cs-tokenizer.cs (define): New utility function to track
12148         defines.   Set the global settings for TRACE and DEBUG if found.
12149
12150 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12151
12152         * interface.cs (Populate*): Pass in the TypeContainer as well as
12153         the DeclSpace as parameters so that we can create EmitContexts and
12154         then use that to apply attributes etc.
12155
12156         (PopulateMethod, PopulateEvent, PopulateProperty)
12157         (PopulateIndexer): Apply attributes everywhere.
12158
12159         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12160         etc.
12161
12162         (ApplyAttributes): Update accordingly.
12163
12164         We now apply interface attributes for all members too.
12165
12166 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * class.cs (Indexer.Define); Correctly check if we are explicit
12169         implementation (instead of checking the Name for a ".", we
12170         directly look up if the InterfaceType was specified).
12171
12172         Delay the creation of the PropertyBuilder.
12173
12174         Only create the PropertyBuilder if we are not an explicit
12175         interface implementation.   This means that explicit interface
12176         implementation members do not participate in regular function
12177         lookups, and hence fixes another major ambiguity problem in
12178         overload resolution (that was the visible effect).
12179
12180         (DefineMethod): Return whether we are doing an interface
12181         implementation. 
12182
12183         * typemanager.cs: Temporary hack until we get attributes in
12184         interfaces (Ravi is working on that) and we get IndexerName
12185         support in interfaces.
12186
12187         * interface.cs: Register the indexers as properties.
12188
12189         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12190         warning, I have verified that this is a bug in the .NET runtime
12191         (JavaScript suffers of the same problem).
12192
12193         * typemanager.cs (MemberLookup): When looking up members for
12194         interfaces, the parent of an interface is the implicit
12195         System.Object (so we succeed in searches of Object methods in an
12196         interface method invocation.  Example:  IEnumerable x;  x.ToString
12197         ()) 
12198
12199 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12200
12201         * class.cs (Event): Events should also register if they do
12202         implement the methods that an interface requires.
12203
12204         * typemanager.cs (MemberLookup); use the new GetInterfaces
12205         method. 
12206
12207         (GetInterfaces): The code used to lookup interfaces for a type is
12208         used in more than one place, factor it here. 
12209
12210         * driver.cs: Track the errors at the bottom of the file, we kept
12211         on going.
12212
12213         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12214         instance if the method we are calling is static!
12215
12216 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * attribute.cs (ApplyAttributes): Make this function filter out
12219         the IndexerName attribute (as that attribute in reality is never
12220         applied) and return the string constant for the IndexerName
12221         attribute. 
12222
12223         * class.cs (TypeContainer.Emit): Validate that all the indexers
12224         have the same IndexerName attribute, and if so, set the
12225         DefaultName attribute on the class. 
12226
12227         * typemanager.cs: The return value might contain other stuff (not
12228         only methods).  For instance, consider a method with an "Item"
12229         property and an Item method.
12230
12231         * class.cs: If there is a problem with the parameter types,
12232         return. 
12233
12234 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12235
12236         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12237         looks at user defined conversion after making a call to 
12238         StandardConversionExists - we need this for overload resolution.
12239
12240         * expression.cs : Update accordingly the various method calls.
12241
12242         This fixes 2 bugs filed against implicit user defined conversions 
12243
12244 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12245
12246         * statement.cs: Track the result of the assignment.
12247
12248 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12249
12250         * expression.cs (MemberAccess): Improved error reporting for
12251         inaccessible members.
12252
12253 2002-05-22  Martin Baulig  <martin@gnome.org>
12254
12255         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12256         itself with debugging support.
12257
12258 2002-05-22  Martin Baulig  <martin@gnome.org>
12259
12260         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12261         Removed, this isn't needed anymore.
12262
12263 2002-05-20  Martin Baulig  <martin@gnome.org>
12264
12265         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12266         be underlying type for an enum.
12267
12268 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12269
12270         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12271         that splits out the loading of just the core types.
12272
12273         * rootcontext.cs (ResolveCore): Split the struct resolution in
12274         two, so we can load the enumeration underlying types before any
12275         enums are used.
12276
12277         * expression.cs (Is): Bandaid until we fix properly Switch (see
12278         bug #24985 for details).
12279
12280         * typemanager.cs (ImplementsInterface): The hashtable will contain
12281         a null if there are no interfaces implemented.
12282
12283 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12284
12285         * cs-parser.jay (indexer_declarator): It is fine to have array
12286         parameters
12287
12288 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12289
12290         * typemanager.cs: (RegisterBuilder): New function used to register
12291         TypeBuilders that implement interfaces.  Since
12292         TypeBuilder.GetInterfaces (as usual) does not work with lame
12293         Reflection.Emit. 
12294         (AddUserType): register interfaces.
12295
12296         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12297         dealing with TypeBuilder.  Also, arrays are showing up as
12298         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12299         methods can not be invoked on them!
12300
12301         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12302         (ImplicitReferenceConversionExists): Split out from
12303         StandardConversionExists. 
12304
12305         * expression.cs (As): We were only implementing one of the three
12306         cases for the as operator.  We now implement them all.
12307         (Is): Implement the various other cases for Is as well.
12308
12309         * typemanager.cs (CACHE): New define used to control if we want or
12310         not the FindMembers cache.  Seems to have a negative impact on
12311         performance currently
12312
12313         (MemberLookup): Nested types have full acess to
12314         enclosing type members
12315
12316         Remove code that coped with instance/static returns for events, we
12317         now catch this in RealFindMembers.
12318
12319         (RealFindMembers): only perform static lookup if the instance
12320         lookup did not return a type or an event.  
12321
12322 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12323
12324         * assign.cs (CompoundAssign): We pass more semantic information
12325         now to Compound Assignments than we did before: now we have all
12326         the information at hand, and now we resolve the target *before* we
12327         do the expression expansion, which allows the "CacheValue" method
12328         to have the effect we intended (before, a [x] += 1 would generate
12329         two differen ArrayAccess expressions from the ElementAccess,
12330         during the resolution process).
12331
12332         (CompoundAssign.DoResolve): Resolve target and original_source here.
12333
12334 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * expression.cs (ArrayAccess): dropped debugging information. 
12337
12338         * typemanager.cs: Small bug fix: I was always returning i_members,
12339         instead of one of i_members or s_members (depending on which had
12340         the content).
12341
12342         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12343         method is invoked before any code generation takes place, and it
12344         is a mechanism to inform that the expression will be invoked more
12345         than once, and that the method should use temporary values to
12346         avoid having side effects
12347
12348         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12349
12350         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12351         implementation.
12352
12353         * expression.cs (Indirection, ArrayAccess): Add support for
12354         CacheTemporaries in these two bad boys. 
12355
12356         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12357         ldobj or ldind_ref.  
12358         (StoreFromPtr): Handle stobj as well.
12359
12360         * expression.cs (UnaryMutator): Share more code.
12361
12362         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12363         down: I was not tracking the Filter function as well, which
12364         was affecting the results of the cache.
12365
12366 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12367
12368         * attribute.cs: Remove the hack to handle the CharSet property on
12369         StructLayouts. 
12370
12371 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * attribute.cs (DoResolve): More uglyness, we now only try to
12374         resolve the attribute partially, to extract the CharSet
12375         information (only if we are a StructLayout attribute).  Otherwise 
12376
12377         (GetExtraTypeInfo): Add some code to conditionally kill in the
12378         future this.   I am more and more convinced that the .NET
12379         framework has special code to handle the attribute setting on
12380         certain elements.
12381
12382         * expression.cs (IsParamsMethodApplicable): Revert my previous
12383         foreach change here, it was wrong.
12384
12385 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12386
12387         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12388         (pp_expr): do not abort on unknown input, just return.
12389         (eval): abort if there are pending chars.
12390
12391         * attribute.cs (Attribute.Resolve): Positional parameters are
12392         optional.  Deal with that case.
12393
12394         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12395         the Ansi/Unicode/Auto information for the type.
12396
12397         (TypeContainer.DefineType): instantiate the EmitContext here, as
12398         we will be using it during the type definition (to resolve
12399         attributes) and during the emit phase.
12400
12401         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12402         to pull type information out of the attributes
12403
12404         (Attribute.Resolve): track the constructor builder, and allow for
12405         multiple invocations (structs and classes will use this).
12406
12407         * ecore.cs (MemberLookupFinal): new version with all the
12408         parameters customizable.
12409
12410         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12411         constructors.  Return if the result value is null (as the error
12412         would have been flagged already by MemberLookupFinal)
12413
12414         Do not allow instances of abstract classes or interfaces to be
12415         created.
12416
12417         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12418         We have to compare the assembly property here when dealing with
12419         FamANDAssem and Assembly access modifiers, because we might be
12420         creating an assembly from *modules* (that means that we are not
12421         getting TypeBuilders for types defined in other modules that are
12422         part of this assembly).
12423
12424         (Method.Emit): If the method is marked abstract and has a body,
12425         emit an error. 
12426
12427         (TypeContainer.DefineMembers): If both the defined member and the
12428         parent name match are methods, then do not emit any warnings: let
12429         the Method.Define routine take care of flagging warnings.  But if
12430         there is a mismatch (method overrides something else, or method is
12431         overriwritten by something, then emit warning).
12432
12433         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12434         set to null, this means `do not check for the return type on the
12435         signature'. 
12436
12437         (Method.Define): set the return type for the method signature to
12438         null, so that we get methods with the same name and parameters and
12439         different return types.  This is used to flag warning 114 (you are
12440         hiding a method, and you probably want to use the new/override
12441         keywords instead).
12442
12443         * typemanager.cs (MemberLookup): Implemented proper access
12444         control, closing a long standing set of bug reports.  The problem
12445         was that the Framework only has two bits: Public and NonPublic,
12446         and NonPublic includes private and protected methods, but we need
12447         to enforce the FamANDAssem, FamOrAssem and Family. 
12448
12449 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
12450
12451         * statement.cs (GotoCase): Return true: Ammounts to giving up
12452         knowledge on whether we return or not, and letting the other case
12453         be responsible for it.
12454
12455 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
12456
12457         * driver.cs: Do not load directories for each file processed, only
12458         do it if there is a pattern.
12459
12460         * ecore.cs: Report readonly assigns here as well, as we might have
12461         been resolved only by MemberAccess.
12462
12463         (SimpleName.SimpleNameResolve): Also be useful for LValue
12464         resolution.   We need this to propagate assign to local readonly variables
12465
12466         * typemanager.cs: Use a ptrhashtable for the criteria, because we
12467         do not want to reuse potential criteria memory.
12468
12469         * class.cs (MyEventBuilder): Set reflected_type;
12470
12471         * ecore.cs (Constantify): Added support for constifying bools.
12472
12473         (RootContext.LookupType): Added a cache for values looked up in
12474         the declaration space.
12475
12476         * typemanager.cs (FindMembers): Now is a front-end to
12477         RealFindMembers, and provides a two-level hashtable-based cache to
12478         the request.  
12479
12480         15% performance improvement: from 22.5 to 19.2 seconds.
12481
12482         * expression.cs (IsParamsMethodApplicable): use foreach.
12483         (Invocation.DoResolve): ditto.
12484         (New.DoResolve): ditto.
12485         (ArrayCreation.DoResolve): ditto.
12486
12487         * ecore.cs (FindMostEncompassingType): use foreach.
12488
12489         * delegate.cs (NewDelegate.DoResolve): Use foreach
12490
12491         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
12492         (RemoveMethods): use foreach.
12493
12494         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
12495         nested foreach statements instead of for, and also break out of
12496         the inner loop once a match is found.
12497
12498         (Invocation.OverloadResolve): Use foreach, simplify the code. 
12499
12500 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
12501
12502         * cfold.cs (BinaryFold): During an enumeration evaluation context,
12503         we actually unwrap the expression to allow for extra information
12504         to be extracted. 
12505
12506         * expression.cs: Use Shr_Un on unsigned operations. 
12507
12508 2002-05-08  Ravi Pratap  <ravi@ximian.com>
12509
12510         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
12511         applicable operators was not being considered correctly. This closes
12512         the bug Miguel reported.
12513
12514 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
12515
12516         * attribute.cs: check that the type derives from System.Attribute
12517         and report the correct error in that case (moved the duplicate code to
12518         its own method, too).
12519
12520 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
12521
12522         * attribute.cs: lookup attribute type name as the spec says: first the
12523         bare attribute name and then name + "Attribute" (nant compiles with
12524         mcs after this fix).
12525
12526 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
12527
12528         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
12529         Because of the way we parse things, we should try to see if a
12530         UIntConstant can fit in an integer.
12531
12532 2002-05-07  Ravi Pratap  <ravi@ximian.com>
12533
12534         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
12535         when we are in an explicit context.
12536
12537         (ConvertReferenceExplicit): When converting from Iface type S to Class
12538         T make sure the rules are implemented as an OR.
12539
12540         * parameter.cs (ParameterType): Make it a property for now although the
12541         purpose really isn't anything immediate.
12542
12543         * expression.cs (Is*Applicable): Do better checking on the parameter type
12544         of a ref/out parameter. The ones from the system assemblies are already 
12545         marked with the correct type so we don't need to do any correction.
12546
12547         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
12548         the object type is standard too so include that.
12549
12550 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12551
12552         * ecore.cs (StandardConversionExists): Augment with missing code:
12553         deal with IntConstant, LongConstants and Enumerations.
12554
12555         * assign.cs: Report the error, instead of failing silently
12556
12557         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
12558         typecontainer that they are declared, because the
12559         typecontainer/namespace will have the list of using clauses that
12560         need to be applied.
12561
12562         Assembly Attributes were escaping the normal registration
12563         mechanism. 
12564
12565         (EmitCode): Apply attributes within an EmitContext that represents
12566         the container they were declared on.
12567
12568         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
12569
12570 2002-05-06  Ravi Pratap  <ravi@ximian.com>
12571
12572         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
12573         Revamp completely - make much cleaner as we now operate only
12574         on a set of Types.
12575
12576         (FindMostSpecificSource, FindMostSpecificTarget): New methods
12577         to implement the logic detailed in the spec more correctly.
12578
12579         (UserDefinedConversion): Update accordingly.
12580
12581 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12582
12583         * statement.cs: Return flow analysis information up.
12584
12585         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
12586         and the default.
12587
12588         (token): Do not consume an extra character before calling
12589         decimal_digits.
12590
12591 2002-05-06  Piers Haken <piersh@friskit.com>
12592
12593         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
12594
12595 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
12596
12597         * class.cs (Constructor.Emit): Set the IsStatic flag in the
12598         EmitContext during the instance constructor initializer
12599         resolution, to stop access to instance variables.
12600
12601         This is mandated by the spec, last paragraph of the `constructor
12602         initializers' section. 
12603
12604 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
12605
12606         * cs-parser.jay, class.cs (Accessor): new class used to represent
12607         an accessor (get or set).  In the past we used `null' to represent
12608         a missing accessor.  But this is ambiguous because there was no
12609         way to tell in abstract indexers/properties if one of them was
12610         specified.
12611
12612         Now there is a way of addressing that.
12613
12614         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
12615         instead of FindMembers.
12616
12617         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
12618         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
12619
12620         * attribute.cs: Treat indexers and properties as the same in terms
12621         of applying attributes
12622
12623         * ecore.cs (FindMostEncompassedType): Use statically initialized
12624         EmptyExpressions()s like we do elsewhere to avoid creating useless
12625         objects (and we take this out of the tight loop).
12626
12627         (GetConversionOperators): Move the code to extract the actual
12628         operators to a separate routine to clean things up.
12629
12630 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
12631
12632         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
12633         events are always registered FieldBuilders.
12634
12635         * class.cs (FieldBase): New class shared by Fields 
12636
12637         * delegate.cs: If we are a toplevel delegate, use our full name.
12638         If we are a nested delegate, then only use our tail name.
12639
12640 2002-05-02  Ravi Pratap  <ravi@ximian.com>
12641
12642         * expression.cs (IsApplicable): Ensure that we add the "&" to
12643         ref/out types before comparing it with the type of the argument.
12644
12645         (IsParamsMethodApplicable): Ditto.
12646
12647         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
12648         silly me ;-)
12649
12650         * delegate.cs : Handle the case when we have more than one applicable
12651         method. Flag an error only when we finish checking all.
12652
12653 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
12654
12655         * expression.cs: Add support for boolean static initializers.
12656
12657 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
12658
12659         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
12660
12661         * parameter.cs (ComputeParameterTypes,
12662         ComputeAndDefineParameterTypes): Better error handling: now we
12663         clear the `types' cache if we fail during any of the type lookups.
12664         We also return the status code correctly to our caller
12665
12666         * delegate.cs: If we fail to define a delegate, abort the extra
12667         steps. 
12668
12669         * expression.cs (Binary.ResolveOperator): for
12670         operator==(object,object) and operator !=(object, object) we also
12671         have to verify that there is an implicit conversion from one to
12672         the other.
12673
12674         (ArrayAccess.DoResolve): Array Access can operate on
12675         non-variables. 
12676
12677 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * assign.cs (CompoundAssign): A new class used as a "flag" that
12680         the assignment actually is happening as part of a compound
12681         assignment operator.
12682
12683         During compound assignment, a few new rules exist to enable things
12684         like:
12685
12686         byte b |= 1 + 2
12687
12688         From the spec:
12689
12690         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
12691         to the type of x) if y is implicitly convertible to the type of x,
12692         and the operator is a builtin operator and the return type of the
12693         operator is explicitly convertible to the type of x. 
12694
12695         * rootcontext.cs: Reset warning level to 2.  4 catches various
12696         "interesting" features in mcs, we must clean this up at some
12697         point, but currently am trying to kill other bugs ;-)
12698
12699         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
12700         in container classes as well.  
12701
12702         * expression.cs (Binary.ResolveOperator): Handle string case
12703         before anything else (as operator overloading does emit an error
12704         before doing anything else).
12705
12706         This code could go away when we move to a table driven model, but
12707         i could not come up with a good plan last night.
12708
12709 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
12710
12711         * typemanager.cs (CSharpName): reimplementation using regex.
12712         * class.cs: added null check for fields in Emit
12713         * rootcontext.cs: set warninglevel to 4
12714
12715 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
12716
12717         * typemanager.cs (CSharpName): reimplemented with Lupus
12718         suggestion.
12719
12720 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
12721
12722         * statement.cs (If): correclty implement Resolve, because we were
12723         not catching sem errors in there.  The same process is needed
12724         everywhere else. 
12725         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
12726
12727
12728         (Statement.Warning_DeadCodeFound): Factorize code.
12729         (While): Report dead code here too.
12730
12731         (Statement): Added Resolve virtual method to allow
12732         for resolution split from the emit code.
12733
12734 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
12735
12736         * statement.cs (EmitBoolExpression): No longer try to resolve the
12737         expression here.    
12738         (MakeBoolean): New utility function that resolve, implicitly
12739         converts to boolean and tags the expression. 
12740
12741
12742         (If, Do): Implement dead code elimination.
12743         (While): Implement loop inversion
12744
12745         (Do, While, For, If): Resolve the expression prior to calling our
12746         code generation.
12747
12748 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
12749
12750         * class.cs:
12751           - added method Report28 (warning: program has more than one entry point)
12752           - added method IsEntryPoint, implements paragraph 10.1 of the spec
12753           - modified method Method.Define, the part at the end of the method
12754
12755         * rootcontext.cs: added static public Location EntryPointLocation;
12756           
12757         * ../errors/cs0028.cs : Add test case for the above warning.              
12758
12759         * typemanager.cs:
12760           - modified method CSharpName to allow arrays of primitive type to
12761             be printed nicely (e.g. instead of System.Int32[][] it now prints
12762             int[][])
12763           - added method CSharpSignature: returns the signature of a method
12764             in string format to be used in reporting errors, warnings, etc.
12765
12766         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
12767         with String.Empty.
12768
12769 2002-04-26  Ravi Pratap  <ravi@ximian.com>
12770
12771         * delegate.cs (Define): Fix extremely silly bug where I was
12772         setting the type of the 'object' parameter of the BeginInvoke
12773         method to System.IAsyncResult instead of System.Object ;-)
12774
12775 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
12776
12777         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
12778         here. 
12779
12780         (Constructor.Emit): return if we fail to initialize the
12781         constructor.  Another door closed!  
12782
12783         * expression.cs (New.DoResolve): Improve error message (from -6 to
12784         1501).  Use DeclaredOnly lookup to find the exact constructor.
12785
12786         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
12787         loop.  This is useful.
12788
12789         * cs-parser.jay: Adjust the default parameters so that destructors
12790         have the proper signature.
12791
12792 2002-04-26  Martin Baulig  <martin@gnome.org>
12793
12794         * driver.cs (LoadAssembly): If `assembly' contains any characters
12795         which are only valid in path names and not in assembly names
12796         (currently slash, backslash and point), use Assembly.LoadFrom ()
12797         instead of Assembly.Load () on the `assembly' (before iteration
12798         over the link_paths).
12799
12800 2002-04-26  Martin Baulig  <martin@gnome.org>
12801
12802         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
12803
12804 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
12805
12806         * class.cs (Property): use the new typemanager.MemberLookup
12807
12808         (TypeContainer.MemberLookup): Implement using the
12809         TypeManager.MemberLookup now. 
12810
12811         * typemanager.cs: Make MemberLookup a function of the TypeManager,
12812         and return MemberInfos, so that these can be used without an
12813         EmitContext (what we had before).
12814
12815 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
12816
12817         * expression.cs: Fix the case where the argument to params if the
12818         type of the params.  I omitted handling this before.   Fixed
12819
12820 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
12821
12822         * driver.cs: Call BootCorlib_PopulateCoreType
12823
12824         * class.cs (Property.CheckBase): Check for properties only, not
12825         for all members. 
12826
12827         * interface.cs: Temporary hack: try/catch around the
12828         CustomAttributeBuilder, because I am getting an exception that I
12829         do not understand.
12830
12831         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
12832         types whose definitions are required to be there (attributes are
12833         defined before standard types).
12834
12835         Compute definitions as we boot the various types, as they are used
12836         immediately (value_type class will need object_type, but if we do
12837         not initialize object_type, we will pass a null, which will let
12838         the runtime pick the System.Object from the existing corlib, which
12839         is not what we want).
12840
12841 2002-04-22  Patrik Torstensson <totte@labs2.com>
12842
12843         * cs-tokenizer.cs: fixed a number of trim() issues.
12844
12845 2002-04-22  Ravi Pratap  <ravi@ximian.com>
12846
12847         * expression.cs (Argument.Type): Ensure that we return the correct
12848         type when we have out or ref parameters [in which case we 
12849         append a "&"].
12850
12851 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
12852
12853         * class.cs (Property, Indexer): Allow extern modifier in there. 
12854
12855         * typemanager.cs (InitBaseTypes): Initializes object_type and
12856         value_type, since those will be used early on during the bootstrap
12857         process to compile corlib.
12858
12859         (InitCoreTypes): Move code from here to InitBaseTypes.
12860
12861 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
12862
12863         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
12864         single-dimension arrays as using the ldlen opcode.  
12865
12866         Daniel Lewis discovered this optimization.  
12867
12868         * typemanager.cs: Add signature for System.Array::get_Length
12869
12870 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12871
12872         * statement.cs: report the error when the foreach does not apply to an
12873         array nor a collection.
12874
12875 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
12876
12877         * expression.cs: Add implicit conversions to the operator ~.
12878
12879         * constant.cs (DecimalConstant.Emit): Emit decimal value.
12880
12881         * typemanager.cs: Locate the decimal constructor.
12882
12883 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12884
12885         * attribute.cs: use the new property of TypeOf.
12886         * expression.cs: added 'get' property around typearg.
12887
12888         These changes fix a build breaker reported by NickD. Is this the
12889         correct way to fix?  If not, please, revert my changes and make it
12890         work :-).
12891
12892 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
12893
12894         * attribute.cs: Add support for typeof in attribute invocations.
12895         I am not sure that this is right though.
12896
12897 2002-04-14  Duncan Mak  <duncan@ximian.com>
12898
12899         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
12900         Binary.Operator.Division case.
12901
12902 2002-04-13  Ravi Pratap  <ravi@ximian.com>
12903
12904         * class.cs (DefineType): Ensure that we do a proper check on
12905         attribute types and also register it with the TypeManager.
12906
12907         (TypeContainer.Targets): The default for attribute types is
12908         AttributeTargets.All.
12909
12910         * attribute.cs (ApplyAttributes): Registering the attribute type
12911         is done elsewhere, not when we discover we have a Usage attribute.
12912
12913 2002-04-12  Ravi Pratap  <ravi@ximian.com>
12914
12915         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
12916         and get rid of is_delegate parameter.
12917
12918         * everywhere : update.
12919
12920 2002-04-12  Ravi Pratap  <ravi@ximian.com>
12921
12922         * cs-parser.jay (compilation_unit): Revamp completely to use
12923         some new ideas that I got from Rhys' grammar to solve the problems
12924         with assembly level attributes.
12925
12926         (outer_declaration): New grammar production.
12927
12928         (attribute_sections): Add.
12929
12930         (opt_attributes): Base on attribute_sections
12931
12932         (namespace_declaration): Allow opt_attributes to tackle the case
12933         when we have assembly level attributes - we are clever in this
12934         regard now ;-)
12935
12936         * attribute.cs (ApplyAttributes): Do not worry about assembly 
12937         attributes in the non-global context.
12938
12939         * rootcontext.cs (AddGlobalAttributes): Go back to using this
12940         instead of SetGlobalAttributes.
12941
12942         * class.cs, rootcontext.cs : Ensure we define and generate 
12943         attribute types before anything else.
12944
12945         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
12946         and flag the new error -20 for the case when the attribute type
12947         does not have valid targets specified. csc does not catch this.
12948
12949         * ../errors/errors.txt : update for error # -20
12950
12951 2002-04-11  Ravi Pratap  <ravi@ximian.com>
12952
12953         * support.cs (InternalParameters.ParameterModifier): Do some null
12954         checking and return sane values.
12955
12956         * class.cs (Method.Define): If we are a PInvoke method, ensure
12957         that we are static and extern. Report error # 601
12958
12959         * ../errors/cs0601.cs : Add test case for the above error.
12960
12961 2002-04-07  Ravi Pratap  <ravi@ximian.com>
12962
12963         * rootcontext.cs (attribute_types): We need to keep type of
12964         all attribute types separately and emit code for them first.
12965
12966         (RegisterAttribute) : Implement.
12967
12968         * class.cs (DefineType): Check if the current Type is a custom
12969         attribute type and register it accordingly.
12970
12971         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
12972         adding the first attribute twice and rename to
12973
12974         (SetGlobalAttributes): this.
12975
12976         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
12977         lookups.
12978
12979         * attribute.cs (ApplyAttributes): Take an additional argument telling us
12980         if we are processing global arguments. Hmm, I am unsure of this.
12981
12982 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12983
12984         * expression.cs: added static array of strings to avoid calling
12985         Enum.ToString () for Operator in Binary. Significant recover of
12986         performance.
12987
12988 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
12989
12990         * class.cs (FindMembers): Allow the Builders of the various
12991         members to be null.  If they are skip them.  This only happens
12992         during the PInvoke declaration.
12993
12994 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
12995
12996         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
12997         failure, so we do not keep going afterwards.
12998
12999         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13000         wanted to pass `false' as the `is_delegate' argument.  If this is
13001         the case, why not use delegate_type == null to mean `is_delegate =
13002         false' and anything else as is_delegate = true.
13003
13004 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13005
13006         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13007         code for the section, not the beginning of the tests.
13008
13009 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13012
13013         * expression.cs (Binary): same.  Warn about errors where we have
13014         Enum/Enum in operator + as well.
13015
13016 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13017
13018         * statement.cs:
13019                 - added support for switch(bool)
13020                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13021                 - add TableSwitchEmit() to handle table-based switch statements
13022
13023 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13024
13025         * expression.cs (Invocation.OverloadResolve): Factor out code which
13026         does parameter compatibility checking with arguments so that we can 
13027         re-use the code even from Delegate.VerifyApplicability
13028
13029         (VerifyArgumentsCompat): Move above code here.
13030
13031         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13032         and instead make a call to the above method.
13033
13034 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13035
13036         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13037         We use it to keep track of classes which are attribute types.
13038
13039 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13040
13041         * delegate.cs (Delegate.Define): Correctly define the types in the
13042         presence of fixed and array parameters.
13043
13044         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13045         doing FindMembers.
13046
13047         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13048         include NonPublic after the first iteration.
13049
13050         * class.cs (Indexer.CheckBase): Only check if both parents are
13051         non-null. 
13052
13053         * cs-parser.jay (accessor_body): If empty, set to null.
13054
13055         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13056         same code path here to resolve constants names that we did have in
13057         MemberAccess.DoResolve.  There is too much code duplicated here.
13058
13059 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13060
13061         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13062
13063         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13064         to MakeUnionSet.
13065
13066         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13067         tokens, numbers and strings.
13068
13069         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13070         parenthesis.
13071
13072         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13073         asyncronous parameters and the regular parameters.  
13074
13075         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13076         specify the target directory.
13077
13078         * expression.cs: (This.DoResolve): Simplify
13079         (As.Emit): Optimize, do not generate IsInst if the expression is
13080         always of the given type.
13081
13082         (Is.DoResolve): Bug fix, we were reporting both always/never for
13083         the is expression.
13084
13085         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13086         creating too many unnecessary arrays.
13087
13088 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13091         fields instead of rolling our own initializer.   Takes care of all
13092         implicit conversions, and drops unnecessary static checks/argument.
13093
13094 2002-03-31  Dick Porter  <dick@ximian.com>
13095
13096         * driver.cs: use the GetDirectories() return values properly, and
13097         use "/" as path separator.
13098
13099 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * expression.cs (Unary): Optimize - - expr into expr.
13102         (Binary): Optimize a + (-b) into a -b.
13103
13104         * codegen.cs (CodeGen): Made all methods static.
13105
13106 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13107
13108         * rootcontext.cs: 
13109
13110         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13111         TypeBuilder property.
13112
13113         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13114         instead. 
13115
13116         * tree.cs: Removed the various RecordXXXX, and replaced with a
13117         single RecordDecl.  Removed all the accessor methods, and just
13118         left a single access point Type 
13119
13120         * enum.cs: Rename DefineEnum to DefineType.
13121
13122         * decl.cs: New abstract method `DefineType' used to unify the
13123         Defines for Enumerations, Interfaces, TypeContainers and
13124         Delegates.
13125
13126         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13127         LookupBaseClasses method that used to live in class.cs and
13128         interface.cs here, and renamed to FindType.
13129
13130         * delegate.cs: Implement DefineType.  Take advantage of the
13131         refactored pattern for locating the parent builder without taking
13132         the parent_builder argument (which we know does not work if we are
13133         nested, and triggering a toplevel definition).
13134
13135 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13136
13137         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13138         accessibility of a member has changed during override and report
13139         an error if so.
13140
13141         * class.cs (Method.Define, Property.Define): Only complain on
13142         overrides if the method is private, any other accessibility is
13143         fine (and since we just checked the permission is the same, we are
13144         good to go).
13145
13146         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13147         and elif are processed always.  The other pre-processing
13148         directives are only processed if we are "taking" the path
13149
13150 2002-03-29  Martin Baulig  <martin@gnome.org>
13151
13152         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13153         current location is not Null.
13154
13155         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13156         a separate method so we can profile it.
13157
13158         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13159         `span.Seconds' are just seconds, but no minutes or hours.
13160         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13161
13162 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13163
13164         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13165         Remove the gratuitous set of Final:
13166
13167                                 // If an interface implementation, then we can set Final.
13168                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13169                                     implementing.DeclaringType.IsInterface)
13170                                         flags |= MethodAttributes.Final;
13171
13172         I do not know what I was smoking when I used that.
13173
13174
13175         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13176         step into fixing the name resolution issues for delegates and
13177         unifying the toplevel name resolution.
13178
13179 2002-03-28  Martin Baulig  <martin@gnome.org>
13180
13181         * class.cs (Method.Emit): If we have a symbol writer, call its
13182         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13183         tell it about the current method.
13184
13185         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13186         writer that we're going to emit the first byte of IL code for a new
13187         statement (a new source line).
13188         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13189         EmitContext.Mark() before emitting any code.
13190
13191         * location.cs (SymbolDocument): Return null when we're Null.
13192
13193         * statement.cs (Statement): Moved the `Location loc' variable here.
13194         (Statement.EmitBoolExpression): If we have a symbol writer, call
13195         ec.Mark() before emitting any code to tell it that we're at the
13196         beginning of a new statement.
13197         (StatementExpression): Added `Location' argument to the constructor.
13198         (Block): Added public readonly variable `StartLocation' and public
13199         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13200         (Block): Added constructor which takes a start and end location.
13201         (Block.SetEndLocation): New method. This sets the end location.
13202         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13203         local variables we create.
13204         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13205         each statement and do also mark the begin and end of the block.
13206
13207         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13208         tell it the current lexer.Location, use Location.Null for the end of the
13209         block.
13210         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13211         current block, set its end location using SetEndLocation().
13212         (statement_expression): StatementExpression constructor now takes the
13213         lexer.Location as additional argument.
13214         (for_statement, declare_local_variables): Likewise.
13215         (declare_local_variables): When creating a new implicit block, use the
13216         new Block constructor and pass it the lexer.Location.
13217
13218 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13219
13220         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13221         members also on the parent interfaces recursively.
13222
13223 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13224
13225         * report.cs: Use new formats, since Gonzalo finished the missing
13226         bits. 
13227
13228         * expression.cs (Binary.ResolveOperator): added missing operator|
13229         operator& and operator^ for bool/bool.
13230
13231         * cs-parser.jay: CheckDef now takes a Location argument that is
13232         used to report errors more precisly (instead of reporting the end
13233         of a definition, we try to track something which is a lot closer
13234         to the source of the problem).
13235
13236         * cs-tokenizer.cs: Track global token use, so we can properly flag
13237         the use of #define/#undef after the first token has been seen.
13238
13239         Also, rename the reportXXXX to Error_DescriptiveName
13240
13241         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13242         TypeContainer, so that Enum and Interface can use this too.
13243
13244         * class.cs (TypeContainer.LookupInterfaceOrClass,
13245         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13246         `builder' argument.  Typically this was used to pass the parent
13247         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13248         the definition).  
13249
13250         The problem is that a nested class could trigger the definition of
13251         a toplevel class, and the builder would be obviously wrong in that
13252         case. 
13253
13254         So we drop this argument, and we compute dynamically the
13255         TypeBuilder/ModuleBuilder (the correct information was available
13256         to us anyways from DeclSpace.Parent)
13257
13258         * interface.cs (Interface.DefineInterface): Drop builder
13259         parameter cleanup like class.cs
13260
13261         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13262         like class.cs
13263
13264         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13265         values. 
13266
13267         (Try.Emit): Propagate the returns value from the statement.
13268
13269         (Return.Emit): Even if we are leavning 
13270
13271         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13272
13273         * modifiers.cs: Fix the computation of MethodAttributes flags.
13274
13275 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13276
13277         * driver.cs: allow compilation of files that start with '/'.
13278         Add a default case when checking the argument of --target.
13279
13280 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * interface.cs: Implement the same search algorithm for types in
13283         the interface code.
13284
13285         * delegate.cs: Do not allow multiple definition.
13286
13287         * Recovered ChangeLog that got accidentally amputated
13288
13289         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13290
13291         * rootcontext.cs: Load manually enum to allow core classes to
13292         contain enumerations.
13293
13294         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13295         Update to new static methods in TypeManager.
13296
13297         * typemanager.cs (GetMethod, GetConstructor): Use our
13298         implementation of FindMembers to find the members, since during
13299         corlib compilation, the types are TypeBuilders and GetMethod and
13300         GetConstructor do not work.
13301
13302         Make all methods in TypeManager static.
13303
13304         (InitCodeHelpers): Split the functionality from
13305         the InitCodeTypes function.
13306
13307         * driver.cs: Call InitCodeHelpers after we have populated the
13308         types. 
13309
13310         * cs-parser.jay (delegate_declaration): we did not used to compute
13311         the delegate name correctly for void delegates.
13312
13313 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13314
13315         * rootcontext.cs (RootContext): Init the interface_resolve_order
13316         and type_container_resolve_order always.
13317
13318         (ResolveCore, BootstrapCorlib_ResolveClass,
13319         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13320         compiler when compiling with --nostdlib
13321
13322         * class.cs (TypeContainer.DefineType): Check that our parent is
13323         not null.  This test is most important when we are bootstraping
13324         the core types.
13325
13326         * codegen.cs: Split out the symbol writing code.
13327
13328 2002-03-25  Martin Baulig  <martin@gnome.org>
13329
13330         * driver.cs (-g): Made -g an alias for --debug.
13331
13332 2002-03-24  Martin Baulig  <martin@gnome.org>
13333
13334         * codegen.cs (SymbolWriter): New public variable. Returns the
13335         current symbol writer.
13336         (CodeGen): Added `bool want_debugging_support' argument to the
13337          constructor. If true, tell the ModuleBuild that we want debugging
13338         support and ask it for the ISymbolWriter.
13339         (Save): If we have a symbol writer, call it's Close() method after
13340         saving the assembly.
13341
13342         * driver.c (--debug): New command line argument to create a
13343         debugger information file.
13344
13345         * location.cs (SymbolDocument): New public property. Returns an
13346         ISymbolDocumentWriter object for the current source file or null
13347         if we don't have a symbol writer.
13348
13349 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13350
13351         * driver.cs (LoadAssembly): Correctly return when all the paths
13352         have been tried and not before.
13353
13354         * statement.cs (Switch.Emit): return the actual coverage for this
13355         statement (returns/not-returns)
13356
13357         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13358         switch of the statement if we are the last switch section.  That
13359         kills two problems: try/catch problems (we used to emit an empty
13360         nop at the end) and switch statements where all branches would
13361         return. 
13362
13363 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13364
13365         * driver.cs: Add default assemblies (the equivalent to the
13366         Microsoft CSC.RSP file)
13367
13368         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13369         also update tokens_seen and set it to false.
13370
13371         * driver.cs: Implement --recurse for Mike.
13372
13373         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13374         correctly splitting out the paths.
13375
13376 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13377
13378         * interface.cs (Interface.PopulateProperty): Instead of using
13379         `parent' as the declaration space for the set parameters, use
13380         `this' 
13381
13382         * support.cs (InternalParameters): InternalParameters constructor
13383         takes a DeclSpace instead of a TypeContainer.
13384
13385         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13386         types are being initialized, load the address of it before calling
13387         the function.  
13388
13389         (New): Provide a mechanism to disable the generation of local
13390         value type temporaries when the caller will be providing us with
13391         an address to store it.
13392
13393         (ArrayCreation.EmitDynamicInitializers): Use it.
13394
13395 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13396
13397         * expression.cs (Invocation.EmitArguments): Only probe for array
13398         property if there is more than one argument.  Sorry about that.
13399
13400         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13401         empty param arrays.
13402
13403         * class.cs (Method.LabelParameters): Fix incorrect code path that
13404         prevented the `ParamArrayAttribute' from being applied to the
13405         params attribute.
13406
13407 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * support.cs (ReflectionParameters): Correctly compute whether the
13410         last argument is a params array.  Fixes the problem with
13411         string.Split ('a')
13412
13413         * typemanager.cs: Make the assemblies array always be non-null
13414         (empty, but non-null)
13415
13416         * tree.cs (RecordDecl): New function that abstracts the recording
13417         of names.  This reports error 101, and provides a pointer to the
13418         previous declaration.  Fixes a crash in the compiler.
13419
13420         * cs-parser.jay (constructor_declaration): Update to new grammar,
13421         and provide a constructor_body that can be empty.
13422
13423 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13424
13425         * driver.cs: Add support for --resources.
13426
13427         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13428         Make all types for the various array helper methods be integer.
13429
13430         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13431         CheckState to ConvCast.
13432
13433         (ConvCast): Now it takes a `checked' state argument, to avoid
13434         depending on the emit context for the conversion, and just using
13435         the resolve time setting.
13436
13437         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13438         instead of Invocation.EmitArguments.  We do not emit the original
13439         arguments, instead we emit those which have been converted to
13440         unsigned int expressions.
13441
13442         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13443
13444         * codegen.cs: ditto.
13445
13446         * expression.cs (LocalVariableReference): Drop the use of the
13447         Store function that depended on the variable index.
13448
13449         * statement.cs (VariableInfo): Drop the `Idx' property from this
13450         class, as this is not taking into account the indexes for
13451         temporaries tat we generate during the execution, getting the
13452         indexes wrong.
13453
13454         * class.cs: First emit class initializers, then call the parent
13455         constructor. 
13456
13457         * expression.cs (Binary): Fix opcode emision.
13458         (UnaryMutator.EmitCode): Support checked code generation
13459
13460         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13461         matches for events for both the Static and Instance scans,
13462         pointing to the same element.   Fix that.
13463
13464 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
13465
13466         * rootcontext.cs (ResolveTree): Always set the
13467         interface_resolve_order, because nested interfaces will be calling
13468         into us.
13469
13470         * class.cs (GetInterfaceOrClass): Track the same resolution
13471         process used by TypeManager.LookupType.  This fixes the nested
13472         type lookups in class declarations (separate path from
13473         LookupType). 
13474
13475         (TypeContainer.DefineType): Also define nested interfaces.
13476         (TypeContainer.RegisterOrder): New public function used to
13477         register the order in which child interfaces need to be closed.
13478
13479         Nested interfaces need to be closed after their parents have been
13480         created. 
13481
13482         * interface.cs (InterfaceAttr): Put all the logic for computing
13483         the interface attribute here. 
13484
13485         (DefineInterface): Register our interface order with the
13486         RootContext or with the TypeContainer depending on the case.
13487
13488 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * cs-parser.jay: rework foreach statement to work with the new
13491         changes to the policy on SimpleNames.
13492
13493         * report.cs: support Stacktrace on warnings as well.
13494
13495         * makefile: drop --unsafe and /unsafe from the compile.
13496
13497 2002-03-13  Ravi Pratap  <ravi@ximian.com>
13498
13499         * ecore.cs (StandardConversionExists): Modify to take an Expression
13500         as the first parameter. Ensure we do null -> reference type conversion
13501         checking.
13502
13503         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
13504         temporary Expression objects.
13505
13506 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
13507
13508         * interface.cs: workaround bug in method overloading resolution
13509         (there is already a bugzilla bug for it).
13510
13511 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
13512
13513         We could also solve this problem by having a separate path for
13514         performing type lookups, instead of DoResolve, we could have a
13515         ResolveType entry point, and only participating pieces of the
13516         production (simplename, deref, array) would implement this. 
13517
13518         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
13519         signal SimpleName to only resolve type names and not attempt to
13520         resolve anything else.
13521
13522         * expression.cs (Cast): Set the flag.
13523
13524         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
13525
13526         * class.cs: Only report 108 if there is no `new' modifier.
13527
13528         * cs-parser.jay: rework foreach statement to work with the new
13529         changes to the policy on SimpleNames.
13530         
13531         * report.cs: support Stacktrace on warnings as well.
13532
13533         * makefile: drop --unsafe and /unsafe from the compile.
13534
13535 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
13536
13537         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
13538         lookups here, instead of doing that at parse time.  This means
13539         that our grammar will not introduce `LocalVariableReferences' as
13540         expressions at this point.  That solves the problem of code like
13541         this:
13542
13543         class X {
13544            static void Main ()
13545            { int X = 1;
13546             { X x = null }}}
13547
13548         This is only half the fix.  The full fix requires parameters to
13549         also be handled in this way.
13550
13551         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
13552         makes the use more obvious of the DeclSpace.  The
13553         ec.TypeContainer.TypeBuilder is now only used to pull the
13554         TypeBuilder for it.
13555
13556         My theory is that I can get rid of the TypeBuilder completely from
13557         the EmitContext, and have typecasts where it is used (from
13558         DeclSpace to where it matters).  
13559
13560         The only pending problem is that the code that implements Aliases
13561         is on TypeContainer, and probably should go in DeclSpace.
13562
13563         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
13564         lookups here, instead of doing that at parse time.  This means
13565         that our grammar will not introduce `LocalVariableReferences' as
13566         expressions at this point.  That solves the problem of code like
13567         this:
13568
13569         class X {
13570            static void Main ()
13571            { int X = 1;
13572             { X x = null }}}
13573
13574         This is only half the fix.  The full fix requires parameters to
13575         also be handled in this way.
13576
13577         * class.cs (Property.DefineMethod): When implementing an interface
13578         method, set newslot, when implementing an abstract method, do not
13579         set the flag (before we tried never setting it, or always setting
13580         it, which is the difference).
13581         (Indexer.DefineMethod): same.
13582         (Method.DefineMethod): same.
13583
13584         * ecore.cs: Only set the status used flag if we get back a Field.
13585
13586         * attribute.cs: Temporary hack, so Paolo can keep working.
13587
13588 2002-03-08  Ravi Pratap  <ravi@ximian.com>
13589
13590         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
13591         the unmanaged type in the case we have a MarshalAs attribute.
13592
13593         (Resolve): Handle the case when we are parsing the special MarshalAs
13594         attribute [we need to store the unmanaged type to use later]
13595
13596         * typemanager.cs (marshal_as_attr_type): Built in type for the 
13597         MarshalAs Attribute.
13598
13599         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
13600         on parameters and accordingly set the marshalling info.
13601
13602 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
13603
13604         * class.cs: Optimizing slightly by removing redundant code after
13605         we switched to the `NoTypes' return value.
13606         (Property.DefineMethod): use NoTypes here too.
13607
13608         This fixes the bug I introduced in my last batch of changes.
13609
13610 2002-03-05  Ravi Pratap  <ravi@ximian.com>
13611
13612         * tree.cs (RecordEnum): Add. We now keep track of enums too.
13613
13614         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
13615         Enums since those are types too. 
13616
13617         * cs-parser.jay (enum_declaration): Record enums as we parse them.
13618
13619         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
13620         thanks to a call during the lookup process.
13621
13622 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
13623
13624         * statement.cs (Foreach): Lots of work to accomodate a particular
13625         kind of foreach statement that I had not kept in mind.  It is
13626         possible to have foreachs on classes that provide a GetEnumerator
13627         method that return objects that implement the "pattern" for using
13628         a foreach, there is no need to support GetEnumerator
13629         specifically. 
13630
13631         This is needed to compile nant.
13632
13633         * decl.cs: Only report 114 if the member is not `Finalize' and if
13634         the warning level is at least 2.
13635
13636         * class.cs: Moved the compare function from Method to
13637         MethodSignature. 
13638
13639         (MethodSignature.InheritableMemberSignatureCompare): Add new
13640         filter function that is used to extract inheritable methods from a
13641         class. 
13642
13643         (Method.Define): Use the new `inheritable_method_signature_filter'
13644         delegate
13645
13646         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
13647         command. 
13648
13649 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
13650
13651         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
13652
13653         * cs-parser.jay: Add opt_semicolon to the interface declaration.
13654
13655         * expression.cs: Pass location information to
13656         ConvertImplicitStandard. 
13657
13658         * class.cs: Added debugging code to track return values from
13659         interfaces. 
13660
13661 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
13662
13663         * expression.cs (Is.DoResolve): If either side of the `is' is an
13664         interface, do not flag the warning.
13665
13666         * ecore.cs (ImplicitReferenceConversion): We need a separate test
13667         for interfaces
13668
13669         * report.cs: Allow for --fatal to be used with --probe.
13670
13671         * typemanager.cs (NoTypes): Move the definition for the empty Type
13672         array here. 
13673
13674         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
13675         properties. 
13676         (TypeContainer.DefineProxy): New function used to proxy to parent
13677         implementations when implementing interfaces.
13678         (TypeContainer.ParentImplements): used to lookup if our parent
13679         implements a public function that is required by an interface.
13680         (TypeContainer.VerifyPendingMethods): Hook this up.
13681
13682         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
13683         `modules' and `assemblies' arraylists into arrays.  We only grow
13684         these are the very early start up of the program, so this improves
13685         the speedof LookupType (nicely measured).
13686
13687         * expression.cs (MakeByteBlob): Replaced unsafe code with
13688         BitConverter, as suggested by Paolo.
13689
13690         * cfold.cs (ConstantFold.Binary): Special case: perform constant
13691         folding of string concatenation, but if either side is a string,
13692         and the other is not, then return null, and let the runtime use
13693         the concatenation on the string plus the object (using
13694         `Object.ToString'). 
13695
13696 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
13697
13698         Constant Folding has been implemented now.
13699
13700         * expression.cs (Unary.Reduce): Do not throw an exception, catch
13701         the error instead on types that are not supported in one's
13702         complement. 
13703
13704         * constant.cs (Constant and all children): New set of functions to
13705         perform implict and explicit conversions.
13706
13707         * ecore.cs (EnumConstant): Implement the new functions to perform
13708         conversion by proxying to the child expression.
13709
13710         * codegen.cs: (ConstantCheckState): Constant evaluation has its
13711         own separate setting that can not be turned off from the command
13712         line using --unchecked or --checked and is only controlled using
13713         the checked/unchecked statements and expressions.  This setting is
13714         used by the constant folder to flag errors.
13715
13716         * expression.cs (CheckedExpr, UncheckedExpr): Set the
13717         ConstantCheckState as well.   
13718
13719         During Resolve, they also have to flag the state, because the
13720         constant folder runs completely in the Resolve phase.
13721
13722         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
13723         well.
13724
13725 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
13726
13727         * cfold.cs: New file, this file contains the constant folder.
13728
13729         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
13730         argument to track whether we are using the resulting address to
13731         load or store a value and provide better error messages. 
13732
13733         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
13734         new AddressOf arguments.
13735
13736         * statement.cs (Foreach.EmitCollectionForeach): Update
13737
13738         * expression.cs (Argument.Emit): Call AddressOf with proper
13739         arguments to track usage.
13740
13741         (New.DoEmit): Call AddressOf with new arguments.
13742
13743         (Unary.Emit): Adjust AddressOf call.
13744
13745 2002-03-01  Ravi Pratap  <ravi@ximian.com>
13746
13747         * cs-parser.jay (member_access): Change the case for pre-defined types
13748         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
13749         this suggestion.
13750
13751         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
13752         a method body.
13753
13754         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
13755         essentially like methods and apply attributes like MethodImplOptions to them too.
13756
13757         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
13758         not being null.
13759
13760         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
13761         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
13762         is the DeclSpace.
13763
13764         * Update code everywhere accordingly.
13765
13766         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
13767
13768         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
13769
13770 2002-02-28  Ravi Pratap  <ravi@ximian.com>
13771
13772         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
13773         try performing lookups against those instead of jumping straight into using
13774         the 'using' clauses.
13775
13776         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
13777
13778         (LookupType): Perform lookups in implicit parents too.
13779
13780         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
13781         sequence as RootContext.LookupType. 
13782
13783         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
13784         the various cases of namespace lookups into this method.
13785
13786 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
13789         in positional arguments)
13790
13791         * class.cs (Operator): Update the AllowedModifiers to contain
13792         extern. 
13793
13794         * cs-parser.jay: Update operator declaration to allow for the
13795         operator body to be empty.
13796
13797         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
13798         values. 
13799
13800 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
13801
13802         * class.cs (Method.Emit): Label parameters.
13803
13804         * driver.cs: Return 1 or 0 as the program exit code.
13805
13806 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * expression.cs: Special case the `null' object when trying to
13809         auto-compute the type, as anything can be explicitly converted to
13810         that. 
13811
13812         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
13813         spotting this Paolo.
13814
13815         (Expression.ImplicitNumericConversion): Perform comparissions of
13816         the type using the underlying type in the case of an enumeration
13817         rather than using the enumeration type for the compare.
13818
13819         Cope with the underlying == type case, which is not possible to
13820         catch before. 
13821
13822         (Expression.ConvertNumericExplicit): Perform comparissions of
13823         the type using the underlying type in the case of an enumeration
13824         rather than using the enumeration type for the compare.
13825
13826         * driver.cs: If the user does not supply an extension, assume .exe
13827
13828         * cs-parser.jay (if_statement): Rewrote so that we can track the
13829         location for the if statement.
13830
13831         * expression.cs (Binary.ConstantFold): Only concat strings when
13832         the operation is "+", not everything ;-)
13833
13834         * statement.cs (Statement.EmitBoolExpression): Take a location
13835         argument. 
13836         (If, While, Do): Track location.
13837
13838         * expression.cs (Binary.ResolveOperator): In the object + string
13839         case, I was missing a call to ConvertImplicit
13840
13841 2002-02-25  Ravi Pratap  <ravi@ximian.com>
13842
13843         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
13844         Location arguments. Ensure we use RootContext.LookupType to do our work
13845         and not try to do a direct Type.GetType and ModuleBuilder.GetType
13846
13847         * interface.cs (PopulateMethod): Handle the type of the parameter being
13848         null gracefully.
13849
13850         * expression.cs (Invocation.BetterFunction): Handle the case when we 
13851         have a params method with no fixed arguments and a call is made with no
13852         arguments.
13853
13854 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
13855
13856         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
13857         the verbatim-string-literal
13858
13859         * support.cs (InternalParameters.ParameterModifier): handle null
13860         fixed parameters.
13861         (InternalParameters.ParameterType): ditto.
13862
13863         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
13864         duplicating the name of the variable parameter.
13865         (GetParameterByName): Fix bug where we were not looking up array
13866         paramters if they were the only present (thanks Paolo!).
13867         (GetParameterInfo): We only have an empty set of types if both
13868         fixed and array are set to null.
13869         (GetParameterInfo-idx): Handle FixedParameter == null
13870
13871         * cs-parser.jay: Handle the case where there is no catch
13872         statements (missing null test).
13873
13874 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
13875
13876         * driver.cs (MainDriver): Be conservative on our command line
13877         handling.
13878
13879         Catch DirectoryNotFoundException when calling GetFiles.
13880
13881         (SplitPathAndPattern): Used to split the input specification into
13882         a path and a pattern that we can feed to Directory.GetFiles.
13883
13884 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
13885
13886         * statement.cs (Fixed): Implement the last case of the Fixed
13887         statement (string handling).
13888
13889         * expression.cs (StringPtr): New class used to return a char * to
13890         a string;  Used by the Fixed statement.
13891
13892         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
13893
13894         * expression.cs (Binary.ResolveOperator): Remove redundant
13895         MemberLookup pn parent type.
13896         Optimize union call, we do not need a union if the types are the same.
13897         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
13898         type.
13899
13900         Specialize the use of MemberLookup everywhere, instead of using
13901         the default settings. 
13902
13903         (StackAlloc): Implement stackalloc keyword.
13904
13905         * cs-parser.jay: Add rule to parse stackalloc.
13906
13907         * driver.cs: Handle /h, /help, /?
13908
13909         * expression.cs (MakeByteBlob): Removed the hacks we had in place
13910         before we supported unsafe code.
13911
13912         * makefile: add --unsafe to the self compilation of mcs.
13913
13914 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
13915
13916         * expression.cs (PointerArithmetic): New class that is used to
13917         perform pointer arithmetic.
13918         (Binary.Resolve): Handle pointer arithmetic
13919         Handle pointer comparission.
13920         (ArrayPtr): Utility expression class that is used to take the
13921         address of an array.
13922
13923         (ElementAccess): Implement array access for pointers
13924
13925         * statement.cs (Fixed): Implement fixed statement for arrays, we
13926         are missing one more case before we are done.
13927
13928         * expression.cs (Indirection): Implement EmitAssign and set the
13929         ExprClass to Variable.  This allows pointer dereferences to be
13930         treated as variables, and to have values assigned to them.
13931
13932         * ecore.cs (Expression.StoreFromPtr): New utility function to
13933         store values dereferencing.
13934
13935 2002-02-20  Ravi Pratap  <ravi@ximian.com>
13936
13937         * expression.cs (Binary.ResolveOperator): Ensure that we are
13938         not trying to operate on a void type - this fixes the reported
13939         bug.
13940
13941         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
13942         the parent implementation is sealed.
13943
13944         * ../errors/cs0239.cs : Add.
13945
13946         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
13947
13948         * typemanager.cs (unverifiable_code_type): Corresponds to 
13949         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
13950         which have unsafe code in them.
13951
13952         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
13953         unsafe context.
13954
13955 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * cs-tokenizer.cs: Add support for @"litreal strings"
13958
13959         Make tokenizer accept pre-processor directives
13960         on any column (remove the old C-like limitation). 
13961
13962         * rootcontext.cs (EmitCode): Emit any global attributes.
13963         (AddGlobalAttributes): Used to keep track of assembly attributes. 
13964
13965         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
13966
13967         * cs-parser.jay: Add support for global attributes.  
13968
13969 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
13970
13971         * expression.cs (Indirection): New helper class.  Unary will
13972         create Indirection classes to be able to implement the
13973         IMemoryLocation interface on it.
13974
13975 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
13976
13977         * cs-parser.jay (fixed_statement): reference the right statement.
13978
13979         * statement.cs (Fixed.Emit): Finish implementing the fixed
13980         statement for the &x case.
13981
13982 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
13983
13984         * class.cs (Property.Define, Method.Define): Remove newslot when
13985         `implementing'.  
13986
13987         * modifiers.cs: My use of NewSlot when `Abstract' was set was
13988         wrong.  NewSlot should only be used if the `new' keyword is present.
13989
13990         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
13991         locating our system dir.  Sorry about this.
13992
13993 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
13994
13995         * driver.cs (GetSystemDir): Compute correctly the location of our
13996         system assemblies.  I was using the compiler directory instead of
13997         the library directory.
13998
13999 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14000
14001         * expression.cs (BetterFunction): Put back in what Miguel commented out
14002         since it is the correct fix. The problem is elsewhere ;-)
14003
14004         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14005         parameters of the parms method are themselves compatible or not !
14006
14007         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14008         to check that a class implements an interface before saying that an implicit
14009         conversion was allowed. Use ImplementsInterface to do the checking.
14010
14011 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14012
14013         * class.cs (Method.Define): Track whether we are an explicit
14014         implementation or not.  And only call DefineMethodOverride if we
14015         are an explicit implementation.
14016
14017         (Property.DefineMethod): Ditto.
14018
14019 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14020
14021         * expression.cs (BetterFunction): Catch hideous bug which was
14022          preventing us from detecting ambiguous calls due to implicit casts i.e
14023         cs0121.
14024
14025 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14026
14027         * support.cs (Pair): Remove un-needed method.  I figured why I was
14028         getting the error in cs-parser.jay, the variable in a foreach loop
14029         is readonly, and the compiler does not really treat this as a variable.
14030
14031         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14032         instead of EQUALS in grammar.  
14033
14034         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14035
14036         * expression.cs (Unary.DoResolve): Check whether the argument is
14037         managed or not.
14038
14039 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14040
14041         * support.cs: Api for Pair to set a value.  Despite the fact that
14042         the variables are public the MS C# compiler refuses to compile
14043         code that accesses the field if the variable is part of a foreach
14044         statement. 
14045
14046         * statement.cs (Fixed): Begin implementation of the fixed
14047         statement.
14048
14049         (Block.AddVariable): Return the VariableInfo on success and null
14050         on failure instead of true/false. 
14051
14052         * cs-parser.jay (foreach): Catch errors on variables already
14053         defined (we were ignoring this value before) and properly unwind
14054         the block hierarchy
14055
14056         (fixed_statement): grammar for the fixed statement.
14057
14058 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14059
14060         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14061         pointer types to be incretemented.
14062
14063         (SizeOf): Implement.
14064
14065         * cs-parser.jay (pointer_member_access): Implement
14066         expr->IDENTIFIER production.
14067
14068         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14069         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14070         on safe contexts.
14071
14072         (Unary): Implement indirection.
14073
14074         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14075         use in non-unsafe context).
14076
14077         (SimpleName.DoResolve): Check for pointers in field access on safe
14078         contexts. 
14079
14080         (Expression.LoadFromPtr): Factor the load-indirect code in this
14081         function.  This was duplicated in UnboxCast and ParameterReference
14082
14083 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14084
14085         * expression.cs (ComposedCast): report an error if a pointer cast
14086         is used in a safe region.
14087
14088         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14089         pointer type casts in unsafe context.
14090
14091         * codegen.cs (EmitContext): Set up IsUnsafe.
14092
14093         * cs-parser.jay (non_expression_type): Add productions for pointer
14094         casts. 
14095
14096         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14097         code.  We should not use force into static mode if the method is
14098         not virtual.  Fixes bug in MIS
14099
14100         * statement.cs (Do.Emit, While.Emit, For.Emit,
14101         Statement.EmitBoolExpression): Add support to Do and While to
14102         propagate infinite loop as `I do return' semantics.
14103
14104         Improve the For case to also test for boolean constants.
14105
14106         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14107         to the list of attributes we can add.
14108
14109         Remove `EmitContext' argument.
14110
14111         * class.cs (Method.Define): Apply parameter attributes.
14112         (Constructor.Define): Apply parameter attributes.
14113         (MethodCore.LabelParameters): Move here the core of labeling
14114         parameters. 
14115
14116         * support.cs (ReflectionParameters.ParameterModifier,
14117         InternalParameters.ParameterModifier): Use IsByRef on the type and
14118         only return the OUT bit for these parameters instead of in/out/ref
14119         flags.
14120
14121         This is because I miss-understood things.  The ParameterInfo.IsIn
14122         and IsOut represent whether the parameter has the [In] and [Out]
14123         attributes set.  
14124
14125 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14126
14127         * ecore.cs (FieldExpr.Emit): Release temporaries.
14128
14129         * assign.cs (LocalTemporary.Release): new function.
14130
14131         * codegen.cs (EmitContext.GetTemporaryStorage,
14132         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14133         temporary storage.  Now we can "put back" localbuilders when we
14134         are done with them
14135
14136 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14137
14138         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14139         need to make a copy of the variable to generate verifiable code.
14140
14141 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14142
14143         * driver.cs: Compute dynamically the system directory.
14144
14145         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14146         Slower, but more generally useful.  Used by the abstract
14147         registering implementation. 
14148
14149         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14150         the rules for the special rule on Type/instances.  First check if
14151         we have the same name, and if so, try that special static path
14152         rather than the instance path.
14153
14154 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14155
14156         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14157         for, while and if.
14158
14159         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14160         Enum, ValueType, Delegate or Array for non-corlib compiles.
14161
14162         * cs-tokenizer.cs: Catch long identifiers (645)
14163
14164         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14165         piece of code.
14166
14167         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14168         fix, we were returning too early, so we were not registering
14169         pending methods from abstract classes.
14170
14171         Do not register pending methods if the class is abstract.
14172
14173         * expression.cs (Conditional.DoResolve): Report circular implicit
14174         conversions when we neecd to compute it for conditional
14175         expressions. 
14176
14177         (Is.DoResolve): If the expression is always of the provided type,
14178         flag warning 183.  If the expression can not ever be of the
14179         provided type flag warning 184.
14180
14181         * class.cs: Catch 169 as well.
14182
14183         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14184         read. 
14185
14186 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14187
14188         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14189
14190 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14191
14192         * interface.cs: (PopulateMethod): Check for pointers being defined
14193         only if the unsafe context is active.
14194         (PopulateProperty): ditto.
14195         (PopulateIndexer): ditto.
14196
14197         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14198         specified.  If pointers are present, make sure that they are
14199         present in an unsafe context.
14200         (Constructor, Constructor.Define): ditto.
14201         (Field, Field.Define): ditto.
14202         (Property, Property.Define): ditto.
14203         (Event, Event.Define): ditto.
14204
14205         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14206         hashtable if there are classes or structs defined.
14207
14208         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14209         code, as the constant resolution moved.
14210
14211         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14212         the metadata, so we can flag error 133. 
14213
14214         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14215         pointer is being declared in an unsafe context.
14216
14217 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14218
14219         * modifiers.cs (Modifiers.Check): Require a Location argument.
14220         Report error 227 for Unsafe use.
14221
14222         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14223
14224         * statement.cs (For.Emit): If the test is null, then report that
14225         we do `return', as we wont reach anything afterwards.
14226
14227         (Switch.SwitchGoverningType): Track the expression that matched
14228         the conversion.
14229
14230         * driver.cs: Allow negative numbers as an error code to flag.
14231
14232         * cs-parser.jay: Handle 1551.
14233
14234         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14235
14236 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14237
14238         * cs-parser.jay: Report 1518 (type declaration can only contain
14239         class, struct, interface, enum or delegate)
14240
14241         (switch_label): Report 1523 (keywords `case' or `default' must
14242         preced code)
14243
14244         (opt_switch_sections): Report 1522 (empty switch)
14245
14246         * driver.cs: Report 1515 (response file specified multiple times)
14247         Report 1516 (Source file specified multiple times).
14248
14249         * expression.cs (Argument.Resolve): Signal 1510
14250
14251         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14252         access not allowed in static code)
14253
14254 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14255
14256         * typemanager.cs (IsPointerType): Utility method which we are going
14257         to need a lot.
14258
14259         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14260         the object type, so we take care of that.
14261
14262         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14263
14264         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14265         added to non-params parameters :-)
14266
14267         * typemanager.cs (CSharpName): Include 'void' type too. 
14268
14269         (void_ptr_type): Include in the set of core types.
14270
14271         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14272         duplicating code.
14273
14274         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14275         an unsafe context.
14276
14277         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14278         completely forgotten about it.
14279
14280 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14281
14282         * cs-parser.jay (pointer_type): Add. This begins our implementation
14283         of parsing rules for unsafe code.
14284
14285         (unsafe_statement): Implement.
14286
14287         (embedded_statement): Modify to include the above.
14288
14289         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14290
14291         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14292         if the current context is an unsafe one.
14293
14294         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14295         are handled differently, we need separate rules for them.
14296
14297         (local_variable_declaration): Update to use local_variable_pointer_type
14298         to allow variable declarations of unmanaged pointer types.
14299
14300         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14301         in unsafe contexts.
14302
14303         * ../errors/cs0214.cs : Add.
14304
14305 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14306
14307         * makefile: remove 'response' file when cleaning.
14308
14309 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * cs-parser.jay: Report 1524.
14312
14313 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14314
14315         * typemanager.cs (RegisterMethod): drop checking if we have
14316         registered this from here
14317
14318 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * class.cs (Method.EmitDestructor): Implement calling our base
14321         destructor. 
14322
14323         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14324         value of InFinally.
14325
14326         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14327         this routine and will wrap the call in a try/catch block.  Deal
14328         with the case.
14329
14330 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14331
14332         * ecore.cs (Expression.MemberLookup): instead of taking a
14333         parameter `same_type' that was used to tell whether we could
14334         access private members we compute our containing type from the
14335         EmitContext.
14336
14337         (FieldExpr): Added partial support for volatile fields.  This does
14338         not work for volatile fields exposed from assemblies, as I can not
14339         figure out how to extract the modreq from it.
14340
14341         Updated all the source files to use this.
14342
14343         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14344         because it is referenced by MemberLookup very often. 
14345
14346 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14347
14348         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14349         TypeBuilder.GetCustomAttributes to retrieve what we need.
14350
14351         Get rid of redundant default_member_attr_type as this is the same as
14352         default_member_type which already exists.
14353
14354         * interface.cs, attribute.cs : Update accordingly.
14355
14356 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14357
14358         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14359         work for TYpeBuilders though.  Ravi, can you please fix this?
14360
14361         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14362
14363         * expression.cs (Argument.Emit): Handle the case of ref objects
14364         being passed to ref functions;  
14365
14366         (ParameterReference.EmitLoad): Loads the content of the pointer
14367         without dereferencing.
14368
14369 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14372
14373 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14374
14375         * class.cs (Indexer.DefineMethod): Incorporate the interface
14376         type in the name of the method if we are doing explicit interface
14377         implementation.
14378
14379         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14380
14381         (BetterConversion): Fix extremely trivial bug where we were referring to
14382         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14383         again !
14384
14385         * ../errors/bug16.cs : Add although we have fixed it.
14386
14387 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14388
14389         * expression.cs (BaseIndexer): Begin implementation.
14390
14391         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14392
14393         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14394         production directly to remove a shift/reduce, and implement
14395         explicit interface implementation.
14396
14397         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14398         after a floating point suffix.
14399
14400         * expression.cs (DoNumericPromotions): Improved the conversion for
14401         uint/uint.  If we have a constant, we avoid doing a typecast to a
14402         larger type.
14403
14404         * class.cs (Indexer): Implement explicit interface implementation
14405         for indexers.
14406
14407 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14408
14409         * class.cs: make the default instance constructor public and hidebysig.
14410
14411 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14412
14413         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14414         so we can call it from elsewhere.
14415
14416         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14417         we emit it internally if the class has a defined indexer; otherwise the user
14418         emits it by decorating the class definition with the DefaultMemberAttribute.
14419
14420         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14421         attribute is not used on a type which defines an indexer.
14422
14423         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14424         character when we skip whitespace.
14425
14426         * ../errors/cs0646.cs : Add.
14427
14428 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14431         again. 
14432
14433         * makefile: Add practical target `mcs3.exe' which builds the third
14434         generation compiler. 
14435
14436         * expression.cs (New): Fix structures constructor calling.
14437
14438         * class.cs (Property, Method, Indexer): Emit Final flag on the
14439         method if we are an interface implementation and we are not
14440         abstract. 
14441
14442         * ecore.cs (PropertyExpr): New public field `IsBase', tells
14443         whether this property is referencing a `base' method.
14444
14445         * expression.cs (Invocation.EmitCall): take an extra argument:
14446         is_base, this is used to determine whether the `call' or
14447         `callvirt' opcode should be used.
14448
14449
14450         * delegate.cs: update EmitCall.
14451
14452         * class.cs (Method.Define): Set NewSlot for the cases where we are
14453         not implementing an interface method.
14454
14455         (Property.Define): ditto.
14456
14457 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
14458
14459         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14460         'r'.  Allows mcs to parse itself fully.
14461
14462 2002-01-02  Ravi Pratap  <ravi@ximian.com>
14463
14464         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14465         of the number of initializers that require the InitializeArray method.
14466
14467         (CheckIndices): Store the Expression in all cases - not the plain value. Also
14468         update the above field where necessary.
14469
14470         (MakeByteBlob): Update accordingly.
14471
14472         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
14473         greater than 2.
14474
14475         (EmitDynamicInitializers): Update in accordance with the new optimization.
14476
14477         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
14478         same OpCode applies.
14479
14480         * cs-parser.jay : Fix some glaring errors I introduced.
14481
14482 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
14483
14484         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
14485         so that we can check for name clashes there too.
14486
14487         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
14488         for interface indexers.
14489
14490         * interfaces.cs (Define): Emit the default member attribute.
14491
14492         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
14493         variable was being referred to while setting the value ;-)
14494
14495 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
14496
14497         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
14498         byte-by-byte information when we know the data is zero.
14499
14500         Make the block always a multiple of 4, because
14501         DefineInitializedData has a bug.
14502
14503         * assign.cs: Fix, we should assign from the temporary, not from
14504         the source. 
14505
14506         * expression.cs (MakeByteBlob): Fix my incorrect code.
14507
14508 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
14509
14510         * typemanager.cs (EnumToUnderlying): This function is used to get
14511         the underlying type from an enumeration, because it does not
14512         always work. 
14513
14514         * constant.cs: Use the I4_S form for values between -128 and 127.
14515
14516         * statement.cs (Block.LookupLabel): Looks up a label.
14517         (Block): Drop support for labeled blocks.
14518
14519         (LabeledStatement): New kind of statement that represents a label
14520         only.
14521
14522         (Goto): Finally implement this bad boy.
14523
14524         * cs-parser.jay: Update to reflect new mechanism to implement
14525         labels.
14526
14527 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
14528
14529         * codegen.cs (EmitContext.This): a codegen property that keeps the
14530         a single instance of this instead of creating many different this
14531         instances. 
14532
14533         * delegate.cs (Delegate.DoResolve): Update to use the property;
14534
14535         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
14536
14537         * expression.cs (BaseAccess.DoResolve): Ditto.
14538
14539 2001-12-29  Ravi Pratap  <ravi@ximian.com>
14540
14541         * typemanager.cs (methodimpl_attr_type): Add to hold the type
14542         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
14543
14544         (InitCoreTypes): Update accordingly.
14545
14546         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
14547         so we can quickly store the state.
14548
14549         (ApplyAttributes): Set the correct implementation flags
14550         for InternalCall methods.
14551
14552 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
14553
14554         * expression.cs (EmitCall): if a method is not virtual, then do
14555         not use callvirt on it.
14556
14557         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
14558         user defined stuff) requires the use of stobj, which takes an
14559         address on the stack instead of an array and an index.  So emit
14560         the Ldelema operation for it.
14561
14562         (EmitStoreOpcode): Use stobj for valuetypes.
14563
14564         (UnaryMutator.EmitCode): Use the right 1 value depending on
14565         whether we are dealing with int64/uint64, float or doubles.
14566
14567         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
14568         constructors that I implemented last night.
14569
14570         (Constructor.IsDefault): Fix to work properly for static
14571         constructors.
14572
14573         * cs-parser.jay (CheckDef): report method signature errors.
14574         Update error number 103 to be 132.
14575
14576         * decl.cs: New AdditionResult enumeration value: MethodExists.
14577         Although we do this check for methods later on in the semantic
14578         analysis, catching repeated default constructors is so easy that
14579         we catch these here. 
14580
14581         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
14582         promotions code.
14583
14584         (ParameterReference.EmitAssign, Emit): handle
14585         bools as bytes.
14586
14587         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
14588         (ArrayAccess.EmitStoreOpcode): ditto.
14589
14590         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
14591
14592         * expression.cs (MakeByteBlob): Complete all the missing types
14593         (uint, short, ushort, byte, sbyte)
14594
14595         * class.cs: Only init instance field initializers on instance
14596         constructors. 
14597
14598         Rename `constructors' to instance_constructors. 
14599
14600         (TypeContainer.AddConstructor): Only add constructors to the list
14601         if it is not static.
14602
14603         Make sure that we handle default_static_constructor independently
14604         everywhere where we handle instance_constructors
14605
14606 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
14607
14608         * class.cs: Do not lookup or create a base initializer for a
14609         static constructor.
14610
14611         (ConstructorInitializer.Resolve): use the proper type to lookup
14612         for constructors.
14613
14614         * cs-parser.jay: Report error 1585 (modifiers between type and name).
14615
14616         * enum.cs, interface.cs: Remove CloseType, this is taken care by
14617         in DeclSpace. 
14618
14619         * decl.cs: CloseType is now an virtual method, the default
14620         implementation just closes this type.
14621
14622 2001-12-28  Ravi Pratap  <ravi@ximian.com>
14623
14624         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
14625         to PreserveSig by default. Also emit HideBySig on such methods.
14626
14627         Basically, set the defaults to standard values.
14628
14629         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
14630         argument, if candidate is better, it can't be worse than the best !
14631
14632         (Invocation): Re-write bits to differentiate between methods being
14633         applicable in their expanded form and their normal form - for params
14634         methods of course.
14635
14636         Get rid of use_standard everywhere as only standard conversions are allowed
14637         in overload resolution. 
14638
14639         More spec conformance.
14640
14641 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * driver.cs: Add --timestamp, to see where the compiler spends
14644         most of its time.
14645
14646         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
14647         `this' in static code.
14648
14649         (SimpleName.DoResolve): Implement in terms of a helper function
14650         that allows static-references to be passed upstream to
14651         MemberAccess.
14652
14653         (Expression.ResolveWithSimpleName): Resolve specially simple
14654         names when called by MemberAccess to implement the special
14655         semantics. 
14656
14657         (Expression.ImplicitReferenceConversion): Handle conversions from
14658         Null to reference types before others, as Null's type is
14659         System.Object. 
14660
14661         * expression.cs (Invocation.EmitCall): Handle the special case of
14662         calling methods declared on a reference type from a ValueType
14663         (Base classes System.Object and System.Enum)
14664
14665         (MemberAccess.Resolve): Only perform lookups on Enumerations if
14666         the left hand side is a TypeExpr, not on every enumeration. 
14667
14668         (Binary.Resolve): If types are reference types, then do a cast to
14669         object on operators != and == of both arguments.
14670
14671         * typemanager.cs (FindMembers): Extract instance and static
14672         members if requested.
14673
14674         * interface.cs (PopulateProperty): Use void_type instead of null
14675         as the return type for the setter method.
14676
14677         (PopulateIndexer): ditto.
14678
14679 2001-12-27  Ravi Pratap  <ravi@ximian.com>
14680
14681         * support.cs (ReflectionParameters): Fix minor bug where we
14682         were examining the wrong parameter for the ParamArray attribute.
14683
14684         Cope with requests for the type of the parameter at position
14685         greater than the params parameter's. We now return the element
14686         type of the params array as that makes more sense.
14687
14688         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
14689         accordingly as we no longer have to extract the element type
14690         ourselves.
14691
14692         (Invocation.OverloadResolve): Update.
14693
14694 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
14697         against IEnumerator, test whether the return value is a descendant
14698         of the IEnumerator interface.
14699
14700         * class.cs (Indexer.Define): Use an auxiliary method to implement
14701         the other bits of the method definition.  Begin support for
14702         explicit interface implementation.
14703
14704         (Property.DefineMethod): Use TypeManager.void_type instead of null
14705         for an empty return value.
14706
14707 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
14708
14709         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
14710         dealing with a FieldExpr which is composed of a FieldBuilder, in
14711         the code path we did extract the constant, but we should have
14712         obtained the underlying value to be able to cast it (otherwise we
14713         end up in an infinite loop, this is what Ravi was running into).
14714
14715         (ArrayCreation.UpdateIndices): Arrays might be empty.
14716
14717         (MemberAccess.ResolveMemberAccess): Add support for section
14718         14.5.4.1 that deals with the special case of E.I when E is a type
14719         and something else, that I can be a reference to a static member.
14720
14721         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
14722         handle a particular array type to create byte blobs, it is just
14723         something we dont generate byteblobs for.
14724
14725         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
14726         arguments. 
14727
14728         * location.cs (Push): remove the key from the hashtable that we
14729         are about to add.   This happens for empty files.
14730
14731         * driver.cs: Dispose files after we have parsed them.
14732
14733         (tokenize): new function that only runs the tokenizer on its
14734         input, for speed testing.
14735
14736 2001-12-26  Ravi Pratap  <ravi@ximian.com>
14737
14738         * class.cs (Event.Define): Define the private field only if there
14739         are no accessors defined.
14740
14741         * expression.cs (ResolveMemberAccess): If there is no associated
14742         field with the event, that means we have an event defined with its
14743         own accessors and we should flag error cs0070 since transforming
14744         ourselves into a field is not valid in that case.
14745
14746         * ecore.cs (SimpleName.DoResolve): Same as above.
14747
14748         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
14749         and charset to sane values.
14750
14751 2001-12-25  Ravi Pratap  <ravi@ximian.com>
14752
14753         * assign.cs (DoResolve): Perform check on events only if they 
14754         are being accessed outside the declaring type.
14755
14756         * cs-parser.jay (event_declarations): Update rules to correctly
14757         set the type of the implicit parameter etc.
14758
14759         (add_accessor, remove_accessor): Set current local parameters.
14760
14761         * expression.cs (Binary): For delegate addition and subtraction,
14762         cast the return value from the method into the appropriate delegate
14763         type.
14764
14765 2001-12-24  Ravi Pratap  <ravi@ximian.com>
14766
14767         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
14768         of these as the workaround is unnecessary.
14769
14770         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
14771         delegate data - none of that is needed at all.
14772
14773         Re-write bits to extract the instance expression and the delegate method
14774         correctly.
14775
14776         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
14777         on delegates too.
14778
14779         * attribute.cs (ApplyAttributes): New method to take care of common tasks
14780         of attaching attributes instead of duplicating code everywhere.
14781
14782         * everywhere : Update code to do attribute emission using the above method.
14783
14784 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
14785
14786         * expression.cs (IsParamsMethodApplicable): if there are not
14787         parameters, return immediately.
14788
14789         * ecore.cs: The 0 literal can be implicity converted to an enum
14790         type. 
14791
14792         (SimpleName.DoResolve): First lookup the type, then lookup the
14793         members. 
14794
14795         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
14796         want to get its address.  If the InstanceExpression is not
14797         addressable, store the result in a temporary variable, then get
14798         the address of it.
14799
14800         * codegen.cs: Only display 219 errors on warning level or above. 
14801
14802         * expression.cs (ArrayAccess): Make it implement the
14803         IMemoryLocation interface.
14804
14805         (Binary.DoResolve): handle the operator == (object a, object b)
14806         and operator != (object a, object b) without incurring into a
14807         BoxedCast (because 5 != o should never be performed).
14808
14809         Handle binary enumerator operators.
14810
14811         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
14812         value type, otherwise use Ldelem_ref.
14813
14814         Use precomputed names;
14815
14816         (AddressOf): Implement address of
14817
14818         * cs-parser.jay (labeled_statement): Fix recursive block
14819         addition by reworking the production.
14820
14821         * expression.cs (New.DoEmit): New has a special case:
14822                 
14823                  If we are dealing with a ValueType, we have a few
14824                  situations to deal with:
14825                 
14826                     * The target of New is a ValueType variable, that is
14827                       easy, we just pass this as the variable reference
14828                 
14829                     * The target of New is being passed as an argument,
14830                       to a boxing operation or a function that takes a
14831                       ValueType.
14832                 
14833                       In this case, we need to create a temporary variable
14834                       that is the argument of New.
14835
14836
14837 2001-12-23  Ravi Pratap  <ravi@ximian.com>
14838
14839         * rootcontext.cs (LookupType): Check that current_type is not null before
14840         going about looking at nested types.
14841
14842         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
14843         not implement the IAssignMethod interface any more.
14844
14845         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
14846         where we tranform them into FieldExprs if they are being resolved from within
14847         the declaring type.
14848
14849         * ecore.cs (SimpleName.DoResolve): Do the same here.
14850
14851         * assign.cs (DoResolve, Emit): Clean up code considerably. 
14852
14853         * ../errors/bug10.cs : Add.
14854
14855         * ../errors/cs0070.cs : Add.
14856
14857         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
14858
14859         * assign.cs : Get rid of EventIsLocal everywhere.
14860
14861 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * ecore.cs (ConvertIntLiteral): finished the implementation.
14864
14865         * statement.cs (SwitchLabel): Convert the value we are using as a
14866         key before looking up the table.
14867
14868 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * codegen.cs (EmitTopBlock): Require a Location argument now.
14871
14872         * cs-parser.jay (constructor_declarator): We need to setup
14873         current_local_parameters before we parse the
14874         opt_constructor_initializer, to allow the variables to be bound
14875         to the constructor arguments.
14876
14877         * rootcontext.cs (LookupType): First lookup nested classes in our
14878         class and our parents before we go looking outside our class.
14879
14880         * expression.cs (ConstantFold): Extract/debox the values at the
14881         beginnning. 
14882
14883         * rootcontext.cs (EmitCode): Resolve the constants first before we
14884         resolve the types.  This is not really needed, but it helps debugging.
14885
14886         * statement.cs: report location.
14887
14888         * cs-parser.jay: pass location to throw statement.
14889
14890         * driver.cs: Small bug fix.
14891
14892         * report.cs: Updated format to be 4-zero filled digits.
14893
14894 2001-12-22  Ravi Pratap  <ravi@ximian.com>
14895
14896         * expression.cs (CheckIndices): Fix minor bug where the wrong
14897         variable was being referred to ;-)
14898
14899         (DoEmit): Do not call EmitStaticInitializers when the 
14900         underlying type is System.Object.
14901
14902 2001-12-21  Ravi Pratap  <ravi@ximian.com>
14903
14904         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
14905         and do the usual workaround for SRE.
14906
14907         * class.cs (MyEventBuilder.EventType): New member to get at the type
14908         of the event, quickly.
14909
14910         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
14911
14912         * assign.cs (Assign.DoResolve): Handle the case when the target
14913         is an EventExpr and perform the necessary checks.
14914
14915         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
14916         interface.
14917
14918         (SimpleName.MemberStaticCheck): Include check for EventExpr.
14919
14920         (EventExpr): Set the type in the constructor itself since we 
14921         are meant to be born fully resolved.
14922
14923         (EventExpr.Define): Revert code I wrote earlier.
14924                 
14925         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
14926         instance expression is null. The instance expression is a This in that case
14927         or a null, depending on whether it is a static method or not.
14928
14929         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
14930         refers to more than one method.
14931
14932         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
14933         and accordingly flag errors.
14934
14935 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
14936
14937         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
14938
14939 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
14940
14941         * location.cs (ToString): Provide useful rutine.
14942
14943 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
14944
14945         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
14946         objects, return the actual integral boxed.
14947
14948         * statement.cs (SwitchLabel): define an ILLabel for each
14949         SwitchLabel. 
14950
14951         (Switch.CheckSwitch): If the value is a Literal, extract
14952         the underlying literal.
14953
14954         Also in the unused hashtable we had, add the SwitchLabel so we can
14955         quickly look this value up.
14956
14957         * constant.cs: Implement a bunch of new constants.  Rewrite
14958         Literal based on this.  Made changes everywhere to adapt to this.
14959
14960         * expression.cs (Expression.MakeByteBlob): Optimize routine by
14961         dereferencing array only once, and also copes with enumrations.
14962
14963         bytes are two bytes wide, not one.
14964
14965         (Cast): Perform constant conversions.
14966
14967         * ecore.cs (TryImplicitIntConversion): Return literals instead of
14968         wrappers to the literals here.
14969
14970         * expression.cs (DoNumericPromotions): long literals can converted
14971         to ulong implicity (this is taken care of elsewhere, but I was
14972         missing this spot).
14973
14974         * ecore.cs (Expression.Literalize): Make the return type Literal,
14975         to improve type checking.
14976
14977         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
14978
14979 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
14980
14981         * literal.cs: Revert code from ravi that checked the bounds.  The
14982         bounds are sane by the definition of the type itself. 
14983
14984         * typemanager.cs: Fix implementation of ImplementsInterface.  We
14985         need to actually look up in our parent hierarchy for interfaces
14986         implemented. 
14987
14988         * const.cs: Use the underlying type for enumerations
14989
14990         * delegate.cs: Compute the basename for the delegate creation,
14991         that should fix the delegate test case, and restore the correct
14992         Type Lookup semantics in rootcontext
14993
14994         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
14995         referencing a nested type with the Reflection API is using the "+"
14996         sign. 
14997
14998         * cs-parser.jay: Do not require EOF token at the end.
14999
15000 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15001
15002         * rootcontext.cs (LookupType): Concatenate type names with
15003         a '.' instead of a '+' The test suite passes again.
15004
15005         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15006         field of the enumeration.
15007
15008         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15009         the case when the member is an EventExpr.
15010
15011         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15012         static has an associated instance expression.
15013
15014         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15015
15016         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15017
15018         * class.cs (Event.Define): Register event and perform appropriate checks
15019         for error #111.
15020
15021         We define the Add and Remove methods even if the use provides none because
15022         in that case, we provide default implementations ourselves.
15023
15024         Define a private field of the type of the event. This is done by the CSC compiler
15025         and we should be doing it too ;-)
15026
15027         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15028         More methods we use in code we generate.
15029
15030         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15031         is important.
15032
15033         (InitCoreTypes): Update accordingly for the above.
15034
15035         * class.cs (Event.Emit): Generate code for default accessors that we provide
15036
15037         (EmitDefaultMethod): Do the job in the above.
15038
15039         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15040         appropriate place.
15041
15042 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15043
15044         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15045         builders even if we were missing one.
15046
15047         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15048         pass the Basename as our class name instead of the Name.  The
15049         basename will be correctly composed for us.
15050
15051         * parameter.cs (Paramters): Now takes a Location argument.
15052
15053         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15054         make all the code call directly LookupType in RootContext and take
15055         this chance to pass the Location information everywhere.
15056
15057         * Everywhere: pass Location information.
15058
15059 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * class.cs (Constructor.Define): Updated way of detecting the
15062         length of the parameters.
15063
15064         (TypeContainer.DefineType): Use basename as the type name for
15065         nested types.
15066
15067         (TypeContainer.Define): Do not recursively define types here, as
15068         definition is taken care in order by the RootContext.
15069
15070         * tree.cs: Keep track of namespaces in a per-file basis.
15071
15072         * parameter.cs (Parameter.ComputeSignature): Update to use
15073         DeclSpace. 
15074
15075         (Parameters.GetSignature): ditto.
15076
15077         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15078         instead of a TypeContainer.
15079
15080         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15081         resolve names.  Because we need to be resolve in our context, not
15082         our parents.
15083
15084         * driver.cs: Implement response files.
15085
15086         * class.cs (TypeContainer.DefineType): If we are defined, do not
15087         redefine ourselves.
15088
15089         (Event.Emit): Emit the code for add/remove handlers.
15090         (Event.Define): Save the MethodBuilders for add/remove.
15091
15092         * typemanager.cs: Use pair here too.
15093
15094         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15095         DictionaryEntry requires the first argument to be non-null.  
15096
15097         (enum_declaration): Compute full name for registering the
15098         enumeration.
15099
15100         (delegate_declaration): Instead of using
15101         formal_parameter_list, use opt_formal_parameter_list as the list
15102         can be empty.
15103
15104         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15105         (EventParsing): New property that controls whether `add' and
15106         `remove' are returned as tokens or identifiers (for events);
15107
15108 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15109
15110         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15111         use MyEventBuilder only and let it wrap the real builder for us.
15112
15113         (MyEventBuilder): Revamp constructor etc.
15114
15115         Implement all operations that we perform on EventBuilder in precisely the same
15116         way here too.
15117
15118         (FindMembers): Update to use the EventBuilder member.
15119
15120         (Event.Emit): Update accordingly.
15121
15122 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15123
15124         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15125         by calling the appropriate methods.
15126
15127         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15128         useful.
15129
15130         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15131
15132 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15133
15134         * delegate.cs (Delegate.Populate): Check that the return type
15135         and various parameters types are indeed accessible.
15136
15137         * class.cs (Constructor.Define): Same here.
15138
15139         (Field.Define): Ditto.
15140
15141         (Event.Define): Ditto.
15142
15143         (Operator.Define): Check that the underlying Method defined itself
15144         correctly - so it's MethodBuilder should not be null.
15145
15146         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15147         expression happens to be null.
15148
15149         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15150         members but as of now we don't seem to be able to do anything really useful with it.
15151
15152         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15153         not the EventBuilder.
15154
15155 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15156
15157         * cs-tokenizer.cs: Add support for defines.
15158         Add support for #if, #elif, #else, #endif
15159
15160         (eval_var): evaluates a variable.
15161         (eval): stubbed for evaluating functions.
15162
15163         * cs-parser.jay: Pass the defines information
15164
15165         * driver.cs: Add --define command line option.
15166
15167         * decl.cs: Move MemberCore here.
15168
15169         Make it the base class for DeclSpace.  This allows us to catch and
15170         report 108 and 109 for everything now.
15171
15172         * class.cs (TypeContainer.Define): Extract all the members
15173         before populating and emit the warning 108 (new keyword required
15174         to override) instead of having each member implement this.
15175
15176         (MemberCore.Define): New abstract method, we will be using this in
15177         the warning reporting engine in Populate.
15178
15179         (Operator.Define): Adjust to new MemberCore protocol. 
15180
15181         * const.cs (Const): This does not derive from Expression, it is a
15182         temporary object we use to create fields, it is a MemberCore. 
15183
15184         * class.cs (Method.Define): Allow the entry point to be in a
15185         specific class.
15186
15187         * driver.cs: Rewrite the argument handler to clean it up a bit.
15188
15189         * rootcontext.cs: Made it just an auxiliary namespace feature by
15190         making everything static.
15191
15192         * driver.cs: Adapt code to use RootContext type name instead of
15193         instance variable.
15194
15195         * delegate.cs: Remove RootContext argument.
15196
15197         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15198         argument. 
15199
15200         * class.cs (Event.Define): The lookup can fail.
15201
15202         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15203
15204         * expression.cs: Resolve the this instance before invoking the code.
15205
15206 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15207
15208         * cs-parser.jay: Add a production in element_access that allows
15209         the thing to become a "type" reference.  This way we can parse
15210         things like "(string [])" as a type.
15211
15212         Note that this still does not handle the more complex rules of
15213         casts. 
15214
15215
15216         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15217
15218         * ecore.cs: (CopyNewMethods): new utility function used to
15219         assemble the list of methods from running FindMembers.
15220
15221         (MemberLookup): Rework FindMembers so that 
15222
15223 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15224
15225         * class.cs (TypeContainer): Remove Delegates who fail to be
15226         defined.
15227
15228         * delegate.cs (Populate): Verify that we dont get null return
15229         values.   TODO: Check for AsAccessible.
15230
15231         * cs-parser.jay: Use basename to emit error 574 (destructor should
15232         have the same name as container class), not the full name.
15233
15234         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15235         possible representation.  
15236
15237         Also implements integer type suffixes U and L.
15238
15239 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * expression.cs (ArrayCreation.DoResolve): We need to do the
15242         argument resolution *always*.
15243
15244         * decl.cs: Make this hold the namespace.  Hold the root context as
15245         well.
15246         (LookupType): Move here.
15247
15248         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15249
15250         * location.cs (Row, Name): Fixed the code, it was always returning
15251         references to the first file.
15252
15253         * interface.cs: Register properties defined through interfaces.
15254
15255         * driver.cs: Add support for globbing on the command line
15256
15257         * class.cs (Field): Make it derive from MemberCore as well.
15258         (Event): ditto.
15259
15260 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15261
15262         * class.cs (Event::Define): Check that the type of the event is a delegate
15263         type else flag error #66.
15264
15265         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15266         same.
15267
15268         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15269         values of EntryPoint, CharSet etc etc.
15270
15271         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15272
15273         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15274         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15275         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15276         which needs this to do its work.
15277
15278         * ../errors/cs0066.cs : Add.
15279
15280 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15283         helper functions.
15284
15285         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15286         clears out the parameters field.
15287         (MemberSignatureCompare): Cleanup
15288
15289         (MemberCore): New base class used to share code between MethodCore
15290         and Property.
15291
15292         (RegisterRequiredImplementations) BindingFlags.Public requires
15293         either BindingFlags.Instace or Static.  Use instance here.
15294
15295         (Property): Refactored code to cope better with the full spec.
15296
15297         * parameter.cs (GetParameterInfo): Return an empty array instead
15298         of null on error.
15299
15300         * class.cs (Property): Abstract or extern properties have no bodies.
15301
15302         * parameter.cs (GetParameterInfo): return a zero-sized array.
15303
15304         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15305         method modifier validation to the typecontainer so we can reuse
15306         this on properties.
15307
15308         (MethodCore.ParameterTypes): return an empty sized array of types.
15309
15310         (Property.Define): Test property modifier validity.
15311
15312         Add tests for sealed/override too.
15313
15314         (Method.Emit): abstract or extern methods have no bodies.
15315
15316 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15317
15318         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15319         thing.
15320
15321         (Method::Define, ::Emit): Modify accordingly.
15322
15323         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15324
15325         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15326
15327         * makefile: Pass in /unsafe.
15328
15329 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15330
15331         * class.cs (MakeKey): Kill routine.
15332
15333         * class.cs (TypeContainer.Define): Correctly define explicit
15334         method implementations (they require the full interface name plus
15335         the method name).
15336
15337         * typemanager.cs: Deply the PtrHashtable here and stop using the
15338         lame keys.  Things work so much better.
15339
15340         This of course broke everyone who depended on `RegisterMethod' to
15341         do the `test for existance' test.  This has to be done elsewhere.
15342
15343         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15344         the object stupid Equals method (because, that like fails all over
15345         the place).  We still do not use it.
15346
15347         * class.cs (TypeContainer.SetRequiredInterface,
15348         TypeContainer.RequireMethods): Killed these two routines and moved
15349         all the functionality to RegisterRequiredImplementations.
15350
15351         (TypeContainer.RegisterRequiredImplementations): This routine now
15352         registers all the implementations required in an array for the
15353         interfaces and abstract methods.  We use an array of structures
15354         which can be computed ahead of time to reduce memory usage and we
15355         also assume that lookups are cheap as most classes will not
15356         implement too many interfaces.
15357
15358         We also avoid creating too many MethodSignatures.
15359
15360         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15361         clear the "pending" bit if we find that there are problems with
15362         the declaration.
15363
15364         (TypeContainer.VerifyPendingMethods): Update to report errors of
15365         methods that look like implementations but are not.
15366
15367         (TypeContainer.Define): Add support for explicit interface method
15368         implementation. 
15369
15370 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15371
15372         * typemanager.cs: Keep track of the parameters here instead of
15373         being a feature of the TypeContainer.
15374
15375         * class.cs: Drop the registration of parameters here, as
15376         InterfaceMethods are also interface declarations.
15377
15378         * delegate.cs: Register methods with the TypeManager not only with
15379         the TypeContainer.  This code was buggy.
15380
15381         * interface.cs: Full registation here.
15382
15383 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15384
15385         * expression.cs: Remove reducer for binary expressions, it can not
15386         be done this way.
15387
15388         * const.cs: Put here the code that used to go into constant.cs
15389
15390         * constant.cs: Put here the code for constants, this is a new base
15391         class for Literals.
15392
15393         * literal.cs: Make Literal derive from Constant.
15394
15395 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15396
15397         * statement.cs (Return.Emit): Report error 157 if the user
15398         attempts to return from a finally block.
15399
15400         (Return.Emit): Instead of emitting a return, jump to the end of
15401         the function.
15402
15403         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15404         LocalBuilder to store the result of the function.  ReturnLabel is
15405         the target where we jump.
15406
15407
15408 2001-12-09  Radek Doulik  <rodo@ximian.com>
15409
15410         * cs-parser.jay: remember alias in current namespace
15411
15412         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15413         namespaces
15414
15415         * class.cs (LookupAlias): lookup alias in my_namespace
15416
15417         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15418         aliases hashtable
15419         (LookupAlias): lookup alias in this and if needed in parent
15420         namespaces
15421
15422 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15423
15424         * support.cs: 
15425
15426         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15427         making things static.  I need this to avoid passing the
15428         TypeContainer when calling ParameterType.
15429
15430         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15431         that did string manipulation to compute the type and then call
15432         GetType.  Use Parameter.ParameterType instead.
15433
15434         * cs-tokenizer.cs: Consume the suffix for floating values.
15435
15436         * expression.cs (ParameterReference): figure out whether this is a
15437         reference parameter or not.  Kill an extra variable by computing
15438         the arg_idx during emission.
15439
15440         * parameter.cs (Parameters.GetParameterInfo): New overloaded
15441         function that returns whether a parameter is an out/ref value or not.
15442
15443         (Parameter.ParameterType): The type of the parameter (base,
15444         without ref/out applied).
15445
15446         (Parameter.Resolve): Perform resolution here.
15447         (Parameter.ExternalType): The full type (with ref/out applied).
15448
15449         * statement.cs (Using.Emit, Using.EmitExpression): Implement
15450         support for expressions on the using statement.
15451
15452 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
15453
15454         * statement.cs (Using.EmitLocalVariableDecls): Split the
15455         localvariable handling of the using statement.
15456
15457         (Block.EmitMeta): Keep track of variable count across blocks.  We
15458         were reusing slots on separate branches of blocks.
15459
15460         (Try.Emit): Emit the general code block, we were not emitting it. 
15461
15462         Check the type of the declaration to be an IDisposable or
15463         something that can be implicity converted to it. 
15464
15465         Emit conversions if required.
15466
15467         * ecore.cs (EmptyExpression): New utility class.
15468         (Expression.ImplicitConversionExists): New utility function.
15469
15470 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
15471
15472         * statement.cs (Using): Implement.
15473
15474         * expression.cs (LocalVariableReference): Support read only variables.
15475
15476         * statement.cs: Remove the explicit emit for the Leave opcode.
15477         (VariableInfo): Add a readonly field.
15478
15479 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
15480
15481         * ecore.cs (ConvCast): new class used to encapsulate the various
15482         explicit integer conversions that works in both checked and
15483         unchecked contexts.
15484
15485         (Expression.ConvertNumericExplicit): Use new ConvCast class to
15486         properly generate the overflow opcodes.
15487
15488 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15489
15490         * statement.cs: The correct type for the EmptyExpression is the
15491         element_type, not the variable type.  Ravi pointed this out.
15492
15493 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15494
15495         * class.cs (Method::Define): Handle PInvoke methods specially
15496         by using DefinePInvokeMethod instead of the usual one.
15497
15498         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
15499         above to do the task of extracting information and defining the method.
15500
15501 2001-12-04  Ravi Pratap  <ravi@ximian.com>
15502
15503         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
15504         of the condition for string type.
15505
15506         (Emit): Move that here. 
15507
15508         (ArrayCreation::CheckIndices): Keep string literals in their expression
15509         form.
15510
15511         (EmitDynamicInitializers): Handle strings appropriately.
15512
15513 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
15514
15515         * codegen.cs (EmitContext): Replace multiple variables with a
15516         single pointer to the current Switch statement.
15517
15518         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
15519         EmitContext.
15520
15521 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * statement.cs 
15524
15525         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
15526         default'.
15527
15528         (Foreach.Emit): Foreach on arrays was not setting
15529         up the loop variables (for break/continue).
15530
15531         (GotoCase): Semi-implented.
15532
15533 2001-12-03  Ravi Pratap  <ravi@ximian.com>
15534
15535         * attribute.cs (CheckAttribute): Handle system attributes by using
15536         Attribute.GetAttributes to examine information we need.
15537
15538         (GetValidPlaces): Same here.
15539
15540         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
15541
15542         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
15543
15544         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
15545
15546         (Method::Define): Set appropriate flags if we have a DllImport attribute.
15547
15548         (Method::Emit): Handle the case when we are a PInvoke method.
15549
15550 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
15551
15552         * expression.cs: Use ResolveWithSimpleName on compound names.
15553
15554 2001-12-02  Ravi Pratap  <ravi@ximian.com>
15555
15556         * constant.cs (EmitConstant): Make sure we resolve the associated expression
15557         before trying to reduce it.
15558
15559         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
15560
15561         * constant.cs (LookupConstantValue): Implement.
15562
15563         (EmitConstant): Use the above in emitting the constant.
15564
15565         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
15566         that are user-defined by doing a LookupConstantValue on them.
15567
15568         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
15569         too, like above.
15570
15571 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
15572
15573         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
15574
15575         (BaseAccess.DoResolve): Implement.
15576
15577         (MemberAccess.DoResolve): Split this routine into a
15578         ResolveMemberAccess routine that can be used independently
15579
15580 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
15581
15582         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
15583         As that share bits of the implementation.  Is returns a boolean,
15584         while As returns the Type that is being probed.
15585
15586 2001-12-01  Ravi Pratap  <ravi@ximian.com>
15587
15588         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
15589         instead of a Literal - much easier.
15590
15591         (EnumInTransit): Remove - utterly useless :-)
15592
15593         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
15594
15595         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
15596
15597         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
15598         chain when we have no associated expression.
15599
15600 2001-11-30  Ravi Pratap  <ravi@ximian.com>
15601
15602         * constant.cs (Define): Use Location while reporting the errror.
15603
15604         Also emit a warning when 'new' is used and there is no inherited
15605         member to hide.
15606
15607         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
15608         populated.
15609
15610         (LookupEnumValue): Implement to lookup an enum member's value and define it
15611         if necessary.
15612
15613         (Populate): Re-write accordingly to use the above routine.
15614
15615 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
15616
15617         * expression.cs (This): Fix prototype for DoResolveLValue to
15618         override the base class DoResolveLValue.
15619
15620         * cs-parser.cs: Report errors cs574 and cs575 (destructor
15621         declarations) 
15622
15623         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
15624         (we need to load the address of the field here).  This fixes
15625         test-22. 
15626
15627         (FieldExpr.DoResolveLValue): Call the DoResolve
15628         function to initialize the Instance expression.
15629
15630         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
15631         correctly the GetEnumerator operation on a value type.
15632
15633         * cs-parser.jay: Add more simple parsing error catches.
15634
15635         * statement.cs (Switch): Add support for string switches.
15636         Handle null specially.
15637
15638         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
15639
15640 2001-11-28  Ravi Pratap  <ravi@ximian.com>
15641
15642         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
15643
15644         (declare_local_constant): New helper function.
15645
15646         * statement.cs (AddConstant): Keep a separate record of constants
15647
15648         (IsConstant): Implement to determine if a variable is a constant.
15649
15650         (GetConstantExpression): Implement.
15651
15652         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
15653
15654         * statement.cs (IsVariableDefined): Re-write.
15655
15656 2001-11-27  Ravi Pratap  <ravi@ximian.com>
15657
15658         * class.cs (TypeContainer::FindMembers): Look for constants
15659         in the case when we are looking for MemberTypes.Field
15660
15661         * expression.cs (MemberAccess::DoResolve): Check that in the
15662         case we are a FieldExpr and a Literal, we are not being accessed
15663         by an instance reference.
15664
15665         * cs-parser.jay (local_constant_declaration): Implement.
15666
15667         (declaration_statement): Implement for constant declarations.
15668
15669 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
15670
15671         * statement.cs (Switch): Catch double defaults.
15672
15673         (Switch): More work on the switch() statement
15674         implementation.  It works for integral values now, need to finish
15675         string support.
15676
15677
15678 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
15681         integer literals into other integer literals.  To be used by
15682         switch. 
15683
15684 2001-11-24  Ravi Pratap  <ravi@ximian.com>
15685
15686         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
15687         some memory.
15688
15689         (EmitDynamicInitializers): Cope with the above since we extract data
15690         directly from ArrayData now.
15691
15692         (ExpectInitializers): Keep track of whether initializers are mandatory
15693         or not.
15694
15695         (Bounds): Make it a hashtable to prevent the same dimension being 
15696         recorded for every element in that dimension.
15697
15698         (EmitDynamicInitializers): Fix bug which prevented the Set array method
15699         from being found.
15700
15701         Also fix bug which was causing the indices to be emitted in the reverse
15702         order.
15703
15704 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
15705
15706         * expression.cs (ArrayCreation): Implement the bits that Ravi left
15707         unfinished.  They do not work, because the underlying code is
15708         sloppy.
15709
15710 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15711
15712         * cs-parser.jay: Remove bogus fixme.
15713
15714         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
15715         on Switch statement.
15716
15717 2001-11-23  Ravi Pratap  <ravi@ximian.com>
15718
15719         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
15720         the same. 
15721
15722         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
15723         parameter. Apparently, any expression is allowed. 
15724
15725         (ValidateInitializers): Update accordingly.
15726
15727         (CheckIndices): Fix some tricky bugs thanks to recursion.
15728
15729         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
15730         I was being completely brain-dead.
15731
15732         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
15733         and re-write acordingly.
15734
15735         (DelegateInvocation): Re-write accordingly.
15736
15737         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
15738
15739         (MakeByteBlob): Handle types more correctly.
15740
15741         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
15742         initialization from expressions but it is incomplete because I am a complete
15743         Dodo :-|
15744
15745 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15746
15747         * statement.cs (If.Emit): Fix a bug that generated incorrect code
15748         on If.  Basically, we have to return `true' (ie, we do return to
15749         our caller) only if both branches of the if return.
15750
15751         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
15752         short-circuit operators, handle them as short circuit operators. 
15753
15754         (Cast.DoResolve): Resolve type.
15755         (Cast.Cast): Take an expression as the target type.
15756
15757         * cs-parser.jay (cast_expression): Remove old hack that only
15758         allowed a limited set of types to be handled.  Now we take a
15759         unary_expression and we resolve to a type during semantic
15760         analysis.
15761
15762         Use the grammar productions from Rhys to handle casts (this is
15763         not complete like Rhys syntax yet, we fail to handle that corner
15764         case that C# has regarding (-x), but we will get there.
15765
15766 2001-11-22  Ravi Pratap  <ravi@ximian.com>
15767
15768         * class.cs (EmitFieldInitializer): Take care of the case when we have a
15769         field which is an array type.
15770
15771         * cs-parser.jay (declare_local_variables): Support array initialization too.
15772
15773         * typemanager.cs (MakeKey): Implement.
15774
15775         (everywhere): Use the above appropriately.
15776
15777         * cs-parser.jay (for_statement): Update for array initialization while
15778         declaring variables.
15779
15780         * ecore.cs : The error message was correct, it's the variable's names that
15781         were misleading ;-) Make the code more readable.
15782
15783         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
15784         the correct type etc.
15785
15786         (ConvertExplicit): Handle Enum types by examining the underlying type.
15787
15788 2001-11-21  Ravi Pratap  <ravi@ximian.com>
15789
15790         * parameter.cs (GetCallingConvention): Always return
15791         CallingConventions.Standard for now.
15792
15793 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
15794
15795         * expression.cs (Binary.ResolveOperator): Update the values of `l'
15796         and `r' after calling DoNumericPromotions.
15797
15798         * ecore.cs: Fix error message (the types were in the wrong order).
15799
15800         * statement.cs (Foreach.ProbeCollectionType): Need to pass
15801         BindingFlags.Instance as well 
15802
15803         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
15804         implicit int literal conversion in an empty cast so that we
15805         propagate the right type upstream.
15806
15807         (UnboxCast): new class used to unbox value types.
15808         (Expression.ConvertExplicit): Add explicit type conversions done
15809         by unboxing.
15810
15811         (Expression.ImplicitNumericConversion): Oops, forgot to test for
15812         the target type before applying the implicit LongLiterals to ULong
15813         literal cast.
15814
15815 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
15816
15817         * cs-parser.jay (for_statement): Reworked the way For works: now
15818         we declare manually any variables that are introduced in
15819         for_initializer to solve the problem of having out-of-band code
15820         emition (that is what got for broken).
15821
15822         (declaration_statement): Perform the actual variable declaration
15823         that used to be done in local_variable_declaration here.
15824
15825         (local_variable_declaration): Do not declare anything, just pass
15826         the information on a DictionaryEntry
15827
15828 2001-11-20  Ravi Pratap  <ravi@ximian.com>
15829
15830         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
15831         re-write of the logic to now make it recursive.
15832
15833         (UpdateIndices): Re-write accordingly.
15834
15835         Store element data in a separate ArrayData list in the above methods.
15836
15837         (MakeByteBlob): Implement to dump the array data into a byte array.
15838
15839 2001-11-19  Ravi Pratap  <ravi@ximian.com>
15840
15841         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
15842         into CheckIndices.
15843
15844         * constant.cs (Define): Implement.
15845
15846         (EmitConstant): Re-write fully.
15847
15848         Pass in location info.
15849
15850         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
15851         respectively.
15852
15853         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
15854         DictionaryEntry since we need location info too.
15855
15856         (constant_declaration): Update accordingly.
15857
15858         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
15859         code into another method : UpdateIndices.
15860
15861 2001-11-18  Ravi Pratap  <ravi@ximian.com>
15862
15863         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
15864         some type checking etc.
15865
15866 2001-11-17  Ravi Pratap  <ravi@ximian.com>
15867
15868         * expression.cs (ArrayCreation::ValidateInitializers): Implement
15869         bits to provide dimension info if the user skips doing that.
15870
15871         Update second constructor to store the rank correctly.
15872
15873 2001-11-16  Ravi Pratap  <ravi@ximian.com>
15874
15875         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
15876         and try to implement.
15877
15878         * ../errors/cs0150.cs : Add.
15879
15880         * ../errors/cs0178.cs : Add.
15881
15882 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
15883
15884         * statement.cs: Implement foreach on multi-dimensional arrays. 
15885
15886         * parameter.cs (Parameters.GetParameterByName): Also lookup the
15887         name of the params argument.
15888
15889         * expression.cs: Use EmitStoreOpcode to get the right opcode while
15890         initializing the array.
15891
15892         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
15893         we can use this elsewhere.
15894
15895         * statement.cs: Finish implementation of foreach for single
15896         dimension arrays.
15897
15898         * cs-parser.jay: Use an out-of-band stack to pass information
15899         around, I wonder why I need this.
15900
15901         foreach_block: Make the new foreach_block the current_block.
15902
15903         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
15904         function used to return a static Parameters structure.  Used for
15905         empty parameters, as those are created very frequently.
15906
15907         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
15908
15909 2001-11-15  Ravi Pratap  <ravi@ximian.com>
15910
15911         * interface.cs : Default modifier is private, not public. The
15912         make verify test passes again.
15913
15914 2001-11-15  Ravi Pratap  <ravi@ximian.com>
15915
15916         * support.cs (ReflectionParameters): Fix logic to determine
15917         whether the last parameter is a params one. Test 9 passes again.
15918
15919         * delegate.cs (Populate): Register the builders we define with
15920         RegisterParameterForBuilder. Test 19 passes again.
15921
15922         * cs-parser.jay (property_declaration): Reference $6 instead
15923         of $$ to get at the location.
15924
15925         (indexer_declaration): Similar stuff.
15926
15927         (attribute): Ditto.
15928
15929         * class.cs (Property): Register parameters for the Get and Set methods
15930         if they exist. Test 23 passes again.
15931
15932         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
15933         call to EmitArguments as we are sure there aren't any params arguments. 
15934         Test 32 passes again.
15935
15936         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
15937         IndexOutOfRangeException. 
15938
15939         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
15940         Test 33 now passes again.
15941
15942 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
15945         broke a bunch of things.  Will have to come up with a better way
15946         of tracking locations.
15947
15948         * statement.cs: Implemented foreach for single dimension arrays.
15949
15950 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
15951
15952         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
15953         an error.  This removes the lookup from the critical path.
15954
15955         * cs-parser.jay: Removed use of temporary_loc, which is completely
15956         broken. 
15957
15958 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * support.cs (ReflectionParameters.ParameterModifier): Report
15961         whether the argument is a PARAMS argument or not.
15962
15963         * class.cs: Set the attribute `ParamArrayAttribute' on the
15964         parameter argument.
15965
15966         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
15967         and cons_param_array_attribute (ConstructorInfo for
15968         ParamArrayAttribute)., 
15969
15970         * codegen.cs: Emit the return using the `Return' statement, that
15971         way we can report the error correctly for missing return values. 
15972
15973         * class.cs (Method.Emit): Clean up.
15974
15975         * expression.cs (Argument.Resolve): Take another argument: the
15976         location where this argument is used.  Notice that this is not
15977         part of the "Argument" class as to reduce the size of the
15978         structure (we know the approximate location anyways).
15979
15980         Test if the argument is a variable-reference, if not, then
15981         complain with a 206.
15982
15983         (Argument.Emit): Emit addresses of variables.
15984
15985         (Argument.FullDesc): Simplify.
15986
15987         (Invocation.DoResolve): Update for Argument.Resolve.
15988
15989         (ElementAccess.DoResolve): ditto.
15990
15991         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
15992         method should be virtual, as this method is always virtual.
15993
15994         (NewDelegate.DoResolve): Update for Argument.Resolve.
15995
15996         * class.cs (ConstructorInitializer.DoResolve): ditto.
15997
15998         * attribute.cs (Attribute.Resolve): ditto.
15999
16000 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16001
16002         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16003
16004         * expression.cs (ParameterReference): Drop IStackStorage and implement
16005         IAssignMethod instead. 
16006
16007         (LocalVariableReference): ditto.
16008
16009         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16010         IAssignMethod instead. 
16011
16012 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16013
16014         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16015         enumerations that are used in heavily used structures derive from
16016         byte in a laughable and pathetic attempt to reduce memory usage.
16017         This is the kind of pre-optimzations that you should not do at
16018         home without adult supervision.
16019
16020         * expression.cs (UnaryMutator): New class, used to handle ++ and
16021         -- separatedly from the other unary operators.  Cleans up the
16022         code, and kills the ExpressionStatement dependency in Unary.
16023
16024         (Unary): Removed `method' and `Arguments' from this class, making
16025         it smaller, and moving it all to SimpleCall, so I can reuse this
16026         code in other locations and avoid creating a lot of transient data
16027         strucutres when not required.
16028
16029         * cs-parser.jay: Adjust for new changes.
16030
16031 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16032
16033         * enum.cs (Enum.Populate): If there is a failure during
16034         definition, return
16035
16036         * cs-parser.jay (opt_enum_base): we used to catch type errors
16037         here, but this is really incorrect.  The type error should be
16038         catched during semantic analysis.
16039
16040 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16041
16042         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16043         current_local_parameters as expected since I, in my stupidity, had forgotten
16044         to do this :-)
16045
16046         * attribute.cs (GetValidPlaces): Fix stupid bug.
16047
16048         * class.cs (Method::Emit): Perform check on applicability of attributes.
16049
16050         (Constructor::Emit): Ditto.
16051
16052         (Field::Emit): Ditto.
16053
16054         (Field.Location): Store location information.
16055
16056         (Property, Event, Indexer, Operator): Ditto.
16057
16058         * cs-parser.jay (field_declaration): Pass in location for each field.
16059
16060         * ../errors/cs0592.cs : Add.
16061
16062 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16063
16064         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16065
16066         (InitCoreTypes): Update accordingly.
16067
16068         (RegisterAttrType, LookupAttr): Implement.
16069
16070         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16071         info about the same.
16072
16073         (Resolve): Update to populate the above as necessary.
16074
16075         (Error592): Helper.
16076
16077         (GetValidPlaces): Helper to the above.
16078
16079         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16080
16081         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16082
16083 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16084
16085         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16086
16087         * ../errors/cs0617.cs : Add.
16088
16089 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16090
16091         * enum.cs (Emit): Rename to Populate to be more consistent with what
16092         we expect it to do and when exactly it is called.
16093
16094         * class.cs, rootcontext.cs : Update accordingly.
16095
16096         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16097         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16098
16099         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16100
16101         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16102         of a fieldinfo using the above, when dealing with a FieldBuilder.
16103
16104 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16105
16106         * ../errors/cs0031.cs : Add.
16107
16108         * ../errors/cs1008.cs : Add.
16109
16110         * ../errrors/cs0543.cs : Add.
16111
16112         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16113         enum type.
16114
16115         (FindMembers): Implement.
16116
16117         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16118         enums and delegates too.
16119
16120         (enum_types): Rename to builder_to_enum.
16121
16122         (delegate_types): Rename to builder_to_delegate.
16123
16124         * delegate.cs (FindMembers): Implement.
16125
16126 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16127
16128         * typemanager.cs (IsEnumType): Implement.
16129
16130         * enum.cs (Emit): Re-write parts to account for the underlying type
16131         better and perform checking etc.
16132
16133         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16134         of the underlying type.
16135
16136         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16137         value
16138
16139         * enum.cs (error31): Helper to report error #31.
16140
16141         * cs-parser.jay (enum_declaration): Store location of each member too.
16142
16143         * enum.cs (member_to_location): New hashtable. 
16144
16145         (AddEnumMember): Update location hashtable.
16146
16147         (Emit): Use the location of each member while reporting errors.
16148
16149 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16150
16151         * cs-parser.jay: A for_initializer if is a
16152         local_variable_declaration really ammount to have an implicit
16153         block with the variable declaration and no initializer for for.
16154
16155         * statement.cs (For.Emit): Cope with null initializers.
16156
16157         This fixes the infinite loop on for initializers.
16158
16159 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16160
16161         * enum.cs: More cleanup.
16162
16163         * ecore.cs: Remove dead code.
16164
16165         * class.cs (Property.Emit): More simplification.
16166         (Event.Emit): ditto.
16167
16168         Reworked to have less levels of indentation.
16169
16170 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16171
16172         * class.cs (Property): Emit attributes.
16173
16174         (Field): Ditto.
16175
16176         (Event): Ditto.
16177
16178         (Indexer): Ditto.
16179
16180         (Operator): Ditto.
16181
16182         * enum.cs (Emit): Ditto.
16183
16184         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16185         Enums too.
16186
16187         * class.cs (Field, Event, etc.): Move attribute generation into the
16188         Emit method everywhere.
16189
16190         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16191         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16192         as we had no way of defining nested enums !
16193
16194         * rootcontext.cs : Adjust code accordingly.
16195
16196         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16197
16198 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16199
16200         * expression.cs (EvalConstantExpression): Move into ecore.cs
16201
16202         * enum.cs (Enum): Rename some members and make them public and readonly
16203         according to our convention.
16204
16205         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16206         nothing else.
16207
16208         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16209
16210         (Enum::Emit): Write a simple version for now which doesn't try to compute
16211         expressions. I shall modify this to be more robust in just a while.
16212
16213         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16214
16215         (TypeContainer::CloseType): Create the Enum types too.
16216
16217         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16218
16219         * expression.cs (EvalConstantExpression): Get rid of completely.
16220
16221         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16222         user-defined values and other cases.
16223
16224         (IsValidEnumLiteral): Helper function.
16225
16226         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16227         out there in the case we had a literal FieldExpr.
16228
16229         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16230
16231         (Literalize): Revamp a bit to take two arguments.
16232
16233         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16234
16235 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16236
16237         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16238
16239         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16240
16241         (Resolve): Use the above to ensure we have proper initializers.
16242
16243 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16244
16245         * expression.cs (Expression::EvalConstantExpression): New method to 
16246         evaluate constant expressions.
16247
16248         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16249
16250 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16251
16252         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16253         in an array.
16254
16255         (Binary.ResolveOperator): Handle operator != (object a, object b)
16256         and operator == (object a, object b);
16257
16258         (Binary.DoNumericPromotions): Indicate whether the numeric
16259         promotion was possible.
16260
16261         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16262         Implement.  
16263
16264         Made the ArrayAccess implement interface IAssignMethod instead of
16265         IStackStore as the order in which arguments are passed reflects
16266         this.
16267
16268         * assign.cs: Instead of using expr.ExprClass to select the way of
16269         assinging, probe for the IStackStore/IAssignMethod interfaces.
16270
16271         * typemanager.cs: Load InitializeArray definition.
16272
16273         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16274         static data that can be used to initialize arrays. 
16275
16276 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * expression.cs: Handle operator== and operator!= for booleans.
16279
16280         (Conditioal.Reduce): Implement reducer for the ?: operator.
16281
16282         (Conditional.Resolve): Implement dead code elimination.
16283
16284         (Binary.Resolve): Catch string literals and return a new
16285         concatenated string.
16286
16287         (Unary.Reduce): Implement reduction of unary expressions.
16288
16289         * ecore.cs: Split out the expression core handling here.
16290
16291         (Expression.Reduce): New method used to perform constant folding
16292         and CSE.  This is needed to support constant-expressions. 
16293
16294         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16295         targets, and optimize for !x.
16296
16297 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16298
16299         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16300         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16301         set custom atttributes.
16302
16303         * literal.cs (Literal::GetValue): New abstract method to return the actual
16304         value of the literal, cast as an object.
16305
16306         (*Literal): Implement GetValue method.
16307
16308         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16309         expressions to the arraylist but objects of type Argument.
16310
16311         * class.cs (TypeContainer::Emit): Emit our attributes too.
16312
16313         (Method::Emit, Constructor::Emit): Ditto.
16314
16315         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16316         to be ignoring earlier.
16317
16318 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16319
16320         * attribute.cs (AttributeSection::Define): Implement to do the business
16321         of constructing a CustomAttributeBuilder.
16322
16323         (Attribute): New trivial class. Increases readability of code.  
16324
16325         * cs-parser.jay : Update accordingly.
16326
16327         (positional_argument_list, named_argument_list, named_argument): New rules
16328
16329         (attribute_arguments): Use the above so that we are more correct.
16330
16331 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16332
16333         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16334         to perform all checks for a method with a params parameter.
16335
16336         (Invocation::OverloadResolve): Update to use the above method and therefore
16337         cope correctly with params method invocations.
16338
16339         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16340         params too.
16341
16342         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16343         constructors in our parent too because we can't afford to miss out on 
16344         protected ones ;-)
16345
16346         * attribute.cs (AttributeSection): New name for the class Attribute
16347
16348         Other trivial changes to improve readability.
16349
16350         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16351         use the new class names.
16352
16353 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16354
16355         * class.cs (Method::Define): Complete definition for params types too
16356
16357         (Indexer::Define): Ditto.
16358
16359         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16360         Cope everywhere with a request for info about the array parameter.
16361
16362 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16363
16364         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16365
16366         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16367         local_variable_type to extract the string corresponding to the type.
16368
16369         (local_variable_type): Fixup the action to use the new helper method.
16370
16371         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16372         go.
16373
16374         * expression.cs : Clean out code which uses the above.
16375
16376 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16377
16378         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16379         and bale out if necessary by returning a false.
16380
16381         (RegisterProperty): Ditto.
16382
16383         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16384         and print out appropriate error messages.
16385
16386         * interface.cs (everywhere): Ditto.
16387
16388         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16389         location to constructor.
16390
16391         * class.cs (Property, Event, Indexer): Update accordingly.
16392
16393         * ../errors/cs111.cs : Added.
16394
16395         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16396         of a method, as laid down by the spec.
16397
16398         (Invocation::OverloadResolve): Use the above method.
16399
16400 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16401
16402         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16403         now take a TypeContainer and a Parameters object.
16404
16405         (ParameterData): Modify return type of ParameterModifier method to be 
16406         Parameter.Modifier and not a string.
16407
16408         (ReflectionParameters, InternalParameters): Update accordingly.
16409
16410         * expression.cs (Argument::GetParameterModifier): Same here.
16411
16412         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16413         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16414         symbol in it at all so maybe this is only for now.
16415
16416 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16417
16418         * support.cs (InternalParameters): Constructor now takes an extra argument 
16419         which is the actual Parameters class.
16420
16421         (ParameterDesc): Update to provide info on ref/out modifiers.
16422
16423         * class.cs (everywhere): Update call to InternalParameters to pass in
16424         the second argument too.
16425
16426         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16427         to return the modifier info [ref/out etc]
16428
16429         (InternalParameters, ReflectionParameters): Implement the above.
16430
16431         * expression.cs (Argument::ParameterModifier): Similar function to return
16432         info about the argument's modifiers.
16433
16434         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16435         too.
16436
16437         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16438         a new SetFormalParameters object which we pass to InternalParameters.
16439
16440 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16441
16442         * expression.cs (NewArray): Merge into the ArrayCreation class.
16443
16444 2001-10-29  Ravi Pratap  <ravi@ximian.com>
16445
16446         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
16447         NewUserdefinedArray into one as there wasn't much of a use in having
16448         two separate ones.
16449
16450         * expression.cs (Argument): Change field's name to ArgType from Type.
16451
16452         (Type): New readonly property which returns the proper type, taking into 
16453         account ref/out modifiers.
16454
16455         (everywhere): Adjust code accordingly for the above.
16456
16457         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16458         whether we are emitting for a ref or out parameter.
16459
16460         * expression.cs (Argument::Emit): Use the above field to set the state.
16461
16462         (LocalVariableReference::Emit): Update to honour the flag and emit the
16463         right stuff.
16464
16465         * parameter.cs (Attributes): Set the correct flags for ref parameters.
16466
16467         * expression.cs (Argument::FullDesc): New function to provide a full desc.
16468
16469         * support.cs (ParameterData): Add method ParameterDesc to the interface.
16470
16471         (ReflectionParameters, InternalParameters): Implement the above method.
16472
16473         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
16474         reporting errors.
16475
16476         (Invocation::FullMethodDesc): Ditto. 
16477
16478 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
16479
16480         * cs-parser.jay: Add extra production for the second form of array
16481         creation. 
16482
16483         * expression.cs (ArrayCreation): Update to reflect the above
16484         change. 
16485
16486         * Small changes to prepare for Array initialization.
16487
16488 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
16489
16490         * typemanager.cs (ImplementsInterface): interface might be null;
16491         Deal with this problem;
16492
16493         Also, we do store negative hits on the cache (null values), so use
16494         this instead of calling t.GetInterfaces on the type everytime.
16495
16496 2001-10-28  Ravi Pratap  <ravi@ximian.com>
16497
16498         * typemanager.cs (IsBuiltinType): New method to help determine the same.
16499
16500         * expression.cs (New::DoResolve): Get rid of array creation code and instead
16501         split functionality out into different classes.
16502
16503         (New::FormArrayType): Move into NewBuiltinArray.
16504
16505         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
16506         quite useless.
16507
16508         (NewBuiltinArray): New class to handle creation of built-in arrays.
16509
16510         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
16511         account creation of one-dimensional arrays.
16512
16513         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
16514
16515         (NewUserdefinedArray::DoResolve): Implement.
16516
16517         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
16518
16519         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
16520         we maintain inside the TypeManager. This is necessary to perform lookups on the
16521         module builder.
16522
16523         (LookupType): Update to perform GetType on the module builders too.     
16524
16525         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
16526
16527         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
16528
16529 2001-10-23  Ravi Pratap  <ravi@ximian.com>
16530
16531         * expression.cs (New::DoResolve): Implement guts of array creation.
16532
16533         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
16534
16535 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
16536
16537         * expression.cs: Fix bug I introduced lsat night that broke
16538         Delegates. 
16539
16540         (Expression.Resolve): Report a 246 error (can not resolve name)
16541         if we find a SimpleName in the stream.
16542
16543         (Expression.ResolveLValue): Ditto.
16544
16545         (Expression.ResolveWithSimpleName): This function is a variant of
16546         ResolveName, this one allows SimpleNames to be returned without a
16547         warning.  The only consumer of SimpleNames is MemberAccess
16548
16549 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
16550
16551         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
16552         might arrive here.  I have my doubts that this is correct.
16553
16554         * statement.cs (Lock): Implement lock statement.
16555
16556         * cs-parser.jay: Small fixes to support `lock' and `using'
16557
16558         * cs-tokenizer.cs: Remove extra space
16559
16560         * driver.cs: New flag --checked, allows to turn on integer math
16561         checking. 
16562
16563         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
16564         Threading.Monitor.Exit 
16565
16566 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * expression.cs (IndexerAccess::DoResolveLValue): Set the
16569         Expression Class to be IndexerAccess.
16570
16571         Notice that Indexer::DoResolve sets the eclass to Value.
16572
16573 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
16574
16575         * class.cs (TypeContainer::Emit): Emit code for indexers.
16576
16577         * assign.cs (IAssignMethod): New interface implemented by Indexers
16578         and Properties for handling assignment.
16579
16580         (Assign::Emit): Simplify and reuse code. 
16581
16582         * expression.cs (IndexerAccess, PropertyExpr): Implement
16583         IAssignMethod, clean up old code. 
16584
16585 2001-10-22  Ravi Pratap  <ravi@ximian.com>
16586
16587         * typemanager.cs (ImplementsInterface): New method to determine if a type
16588         implements a given interface. Provides a nice cache too.
16589
16590         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
16591         method.
16592
16593         (ConvertReferenceExplicit): Ditto.
16594
16595         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
16596         various methods, with correct names etc.
16597
16598         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
16599         Operator.UnaryNegation.
16600
16601         * cs-parser.jay (operator_declarator): Be a little clever in the case where
16602         we have a unary plus or minus operator.
16603
16604         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
16605         UnaryMinus.
16606
16607         * everywhere : update accordingly.
16608
16609         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
16610         respectively.
16611
16612         * class.cs (Method::Define): For the case where we are implementing a method
16613         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
16614         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
16615
16616 2001-10-21  Ravi Pratap  <ravi@ximian.com>
16617
16618         * interface.cs (FindMembers): Implement to work around S.R.E
16619         lameness.
16620
16621         * typemanager.cs (IsInterfaceType): Implement.
16622
16623         (FindMembers): Update to handle interface types too.
16624
16625         * expression.cs (ImplicitReferenceConversion): Re-write bits which
16626         use IsAssignableFrom as that is not correct - it doesn't work.
16627
16628         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
16629         and accordingly override EmitStatement.
16630
16631         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
16632         using the correct logic :-)
16633
16634 2001-10-19  Ravi Pratap  <ravi@ximian.com>
16635
16636         * ../errors/cs-11.cs : Add to demonstrate error -11 
16637
16638 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
16639
16640         * assign.cs (Assign::Resolve): Resolve right hand side first, and
16641         then pass this as a hint to ResolveLValue.
16642
16643         * expression.cs (FieldExpr): Add Location information
16644
16645         (FieldExpr::LValueResolve): Report assignment to readonly
16646         variable. 
16647
16648         (Expression::ExprClassFromMemberInfo): Pass location information.
16649
16650         (Expression::ResolveLValue): Add new method that resolves an
16651         LValue. 
16652
16653         (Expression::DoResolveLValue): Default invocation calls
16654         DoResolve. 
16655
16656         (Indexers): New class used to keep track of indexers in a given
16657         Type. 
16658
16659         (IStackStore): Renamed from LValue, as it did not really describe
16660         what this did.  Also ResolveLValue is gone from this interface and
16661         now is part of Expression.
16662
16663         (ElementAccess): Depending on the element access type
16664
16665         * typemanager.cs: Add `indexer_name_type' as a Core type
16666         (System.Runtime.CompilerServices.IndexerNameAttribute)
16667
16668         * statement.cs (Goto): Take a location.
16669
16670 2001-10-18  Ravi Pratap  <ravi@ximian.com>
16671
16672         * delegate.cs (Delegate::VerifyDelegate): New method to verify
16673         if two delegates are compatible.
16674
16675         (NewDelegate::DoResolve): Update to take care of the case when
16676         we instantiate a delegate from another delegate.
16677
16678         * typemanager.cs (FindMembers): Don't even try to look up members
16679         of Delegate types for now.
16680
16681 2001-10-18  Ravi Pratap  <ravi@ximian.com>
16682
16683         * delegate.cs (NewDelegate): New class to take care of delegate
16684         instantiation.
16685
16686         * expression.cs (New): Split the delegate related code out into 
16687         the NewDelegate class.
16688
16689         * delegate.cs (DelegateInvocation): New class to handle delegate 
16690         invocation.
16691
16692         * expression.cs (Invocation): Split out delegate related code into
16693         the DelegateInvocation class.
16694
16695 2001-10-17  Ravi Pratap  <ravi@ximian.com>
16696
16697         * expression.cs (New::DoResolve): Implement delegate creation fully
16698         and according to the spec.
16699
16700         (New::DoEmit): Update to handle delegates differently.
16701
16702         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
16703         because of which we were printing out arguments in reverse order !
16704
16705         * delegate.cs (VerifyMethod): Implement to check if the given method
16706         matches the delegate.
16707
16708         (FullDelegateDesc): Implement.
16709
16710         (VerifyApplicability): Implement.
16711
16712         * expression.cs (Invocation::DoResolve): Update to accordingly handle
16713         delegate invocations too.
16714
16715         (Invocation::Emit): Ditto.
16716
16717         * ../errors/cs1593.cs : Added.
16718
16719         * ../errors/cs1594.cs : Added.
16720
16721         * delegate.cs (InstanceExpression, TargetMethod): New properties.
16722
16723 2001-10-16  Ravi Pratap  <ravi@ximian.com>
16724
16725         * typemanager.cs (intptr_type): Core type for System.IntPtr
16726
16727         (InitCoreTypes): Update for the same.
16728
16729         (iasyncresult_type, asynccallback_type): Ditto.
16730
16731         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
16732         correct.
16733
16734         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
16735         too.
16736
16737         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
16738         the builders for the 4 members of a delegate type :-)
16739
16740         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
16741         type.
16742
16743         * expression.cs (New::DoResolve): Implement guts for delegate creation.
16744
16745         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
16746
16747 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
16748
16749         * statement.cs (Break::Emit): Implement.   
16750         (Continue::Emit): Implement.
16751
16752         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16753         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16754         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
16755         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
16756         end loop
16757
16758         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
16759         properties that track the label for the current loop (begin of the
16760         loop and end of the loop).
16761
16762 2001-10-15  Ravi Pratap  <ravi@ximian.com>
16763
16764         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
16765         use of emitting anything at all.
16766
16767         * class.cs, rootcontext.cs : Get rid of calls to the same.
16768
16769         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
16770
16771         (Populate): Define the constructor correctly and set the implementation
16772         attributes.
16773
16774         * typemanager.cs (delegate_types): New hashtable to hold delegates that
16775         have been defined.
16776
16777         (AddDelegateType): Implement.
16778
16779         (IsDelegateType): Implement helper method.
16780
16781         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
16782
16783         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
16784         and accordingly handle it.
16785
16786         * delegate.cs (Populate): Take TypeContainer argument.
16787         Implement bits to define the Invoke method. However, I still haven't figured out
16788         how to take care of the native int bit :-(
16789
16790         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
16791         Qualify the name of the delegate, not its return type !
16792
16793         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
16794         conversion.
16795
16796         (StandardConversionExists): Checking for array types turns out to be recursive.
16797
16798         (ConvertReferenceExplicit): Implement array conversion.
16799
16800         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
16801
16802 2001-10-12  Ravi Pratap  <ravi@ximian.com>
16803
16804         * cs-parser.jay (delegate_declaration): Store the fully qualified
16805         name as it is a type declaration.
16806
16807         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
16808         readonly.
16809
16810         (DefineDelegate): Renamed from Define. Does the same thing essentially,
16811         as TypeContainer::DefineType.
16812
16813         (Populate): Method in which all the definition of the various methods (Invoke)
16814         etc is done.
16815
16816         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
16817         see.
16818
16819         (CloseDelegate): Finally creates the delegate.
16820
16821         * class.cs (TypeContainer::DefineType): Update to define delegates.
16822         (Populate, Emit and CloseType): Do the same thing here too.
16823
16824         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
16825         delegates in all these operations.
16826
16827 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
16828
16829         * expression.cs: LocalTemporary: a new expression used to
16830         reference a temporary that has been created.
16831
16832         * assign.cs: Handle PropertyAccess back here, so that we can
16833         provide the proper semantic access to properties.
16834
16835         * expression.cs (Expression::ConvertReferenceExplicit): Implement
16836         a few more explicit conversions. 
16837
16838         * modifiers.cs: `NEW' modifier maps to HideBySig.
16839
16840         * expression.cs (PropertyExpr): Make this into an
16841         ExpressionStatement, and support the EmitStatement code path. 
16842
16843         Perform get/set error checking, clean up the interface.
16844
16845         * assign.cs: recognize PropertyExprs as targets, and if so, turn
16846         them into toplevel access objects.
16847
16848 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
16849
16850         * expression.cs: PropertyExpr::PropertyExpr: use work around the
16851         SRE.
16852
16853         * typemanager.cs: Keep track here of our PropertyBuilders again to
16854         work around lameness in SRE.
16855
16856 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
16857
16858         * expression.cs (LValue::LValueResolve): New method in the
16859         interface, used to perform a second resolution pass for LValues. 
16860
16861         (This::DoResolve): Catch the use of this in static methods.
16862
16863         (This::LValueResolve): Implement.
16864
16865         (This::Store): Remove warning, assigning to `this' in structures
16866         is 
16867
16868         (Invocation::Emit): Deal with invocation of
16869         methods on value types.  We need to pass the address to structure
16870         methods rather than the object itself.  (The equivalent code to
16871         emit "this" for structures leaves the entire structure on the
16872         stack instead of a pointer to it). 
16873
16874         (ParameterReference::DoResolve): Compute the real index for the
16875         argument based on whether the method takes or not a `this' pointer
16876         (ie, the method is static).
16877
16878         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
16879         value types returned from functions when we need to invoke a
16880         method on the sturcture.
16881
16882
16883 2001-10-11  Ravi Pratap  <ravi@ximian.com>
16884
16885         * class.cs (TypeContainer::DefineType): Method to actually do the business of
16886         defining the type in the Modulebuilder or Typebuilder. This is to take
16887         care of nested types which need to be defined on the TypeBuilder using
16888         DefineNestedMethod.
16889
16890         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
16891         methods in RootContext, only ported to be part of TypeContainer.
16892
16893         (TypeContainer::GetInterfaceOrClass): Ditto.
16894
16895         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
16896
16897         * interface.cs (Interface::DefineInterface): New method. Does exactly
16898         what RootContext.CreateInterface did earlier, only it takes care of nested types 
16899         too.
16900
16901         (Interface::GetInterfaces): Move from RootContext here and port.
16902
16903         (Interface::GetInterfaceByName): Same here.
16904
16905         * rootcontext.cs (ResolveTree): Re-write.
16906
16907         (PopulateTypes): Re-write.
16908
16909         * class.cs (TypeContainer::Populate): Populate nested types too.
16910         (TypeContainer::Emit): Emit nested members too.
16911
16912         * typemanager.cs (AddUserType): Do not make use of the FullName property,
16913         instead just use the name argument passed in as it is already fully
16914         qualified.
16915
16916         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
16917         to TypeContainer mapping to see if a type is user-defined.
16918
16919         * class.cs (TypeContainer::CloseType): Implement. 
16920
16921         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
16922         the default constructor.
16923
16924         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
16925         twice.
16926
16927         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
16928
16929         * interface.cs (CloseType): Create the type here.
16930
16931         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
16932         the hierarchy.
16933
16934         Remove all the methods which are now in TypeContainer.
16935
16936 2001-10-10  Ravi Pratap  <ravi@ximian.com>
16937
16938         * delegate.cs (Define): Re-write bits to define the delegate
16939         correctly.
16940
16941 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
16942
16943         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
16944
16945         * expression.cs (ImplicitReferenceConversion): handle null as well
16946         as a source to convert to any reference type.
16947
16948         * statement.cs (Return): Perform any implicit conversions to
16949         expected return type.  
16950
16951         Validate use of return statement.  
16952
16953         * codegen.cs (EmitContext): Pass the expected return type here.
16954
16955         * class.cs (Method, Constructor, Property): Pass expected return
16956         type to EmitContext.
16957
16958 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
16959
16960         * expression.cs: Make DoResolve take an EmitContext instead of a
16961         TypeContainer.
16962
16963         Replaced `l' and `location' for `loc', for consistency.
16964
16965         (Error, Warning): Remove unneeded Tc argument.
16966
16967         * assign.cs, literal.cs, constant.cs: Update to new calling
16968         convention. 
16969
16970         * codegen.cs: EmitContext now contains a flag indicating whether
16971         code is being generated in a static method or not.
16972
16973         * cs-parser.jay: DecomposeQI, new function that replaces the old
16974         QualifiedIdentifier.  Now we always decompose the assembled
16975         strings from qualified_identifier productions into a group of
16976         memberaccesses.
16977
16978 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * rootcontext.cs: Deal with field-less struct types correctly now
16981         by passing the size option to Define Type.
16982
16983         * class.cs: Removed hack that created one static field. 
16984
16985 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
16986
16987         * statement.cs: Moved most of the code generation here. 
16988
16989 2001-10-09  Ravi Pratap  <ravi@ximian.com>
16990
16991         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
16992         seem very right.
16993
16994         (ElementAccess): Remove useless bits for now - keep checks as the spec
16995         says.
16996
16997 2001-10-08  Ravi Pratap  <ravi@ximian.com>
16998
16999         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17000         and start performing checks according to the spec.
17001
17002 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17003
17004         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17005         rank_specifiers instead.
17006
17007         (rank_specifiers): Change the order in which the rank specifiers are stored
17008
17009         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17010
17011         * expression.cs (ElementAccess): Implement the LValue interface too.
17012
17013 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17014
17015         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17016         except that user defined conversions are not included.
17017
17018         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17019         perform the conversion of the return type, if necessary.
17020
17021         (New::DoResolve): Check whether we are creating an array or an object
17022         and accordingly do the needful.
17023
17024         (New::Emit): Same here.
17025
17026         (New::DoResolve): Implement guts of array creation.
17027
17028         (New::FormLookupType): Helper function.
17029
17030 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17031
17032         * codegen.cs: Removed most of the code generation here, and move the
17033         corresponding code generation bits to the statement classes. 
17034
17035         Added support for try/catch/finalize and throw.
17036
17037         * cs-parser.jay: Added support for try/catch/finalize.
17038
17039         * class.cs: Catch static methods having the flags override,
17040         virtual or abstract.
17041
17042         * expression.cs (UserCast): This user cast was not really doing
17043         what it was supposed to do.  Which is to be born in fully resolved
17044         state.  Parts of the resolution were being performed at Emit time! 
17045
17046         Fixed this code.
17047
17048 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * expression.cs: Implicity convert the result from UserCast.
17051
17052 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17053
17054         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17055         prevented it from working correctly. 
17056
17057         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17058         merely ConvertImplicit.
17059
17060 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17061
17062         * typemanager.cs: Make the LookupTypeContainer function static,
17063         and not per-instance.  
17064
17065         * class.cs: Make static FindMembers (the one that takes a Type
17066         argument). 
17067
17068         * codegen.cs: Add EmitForeach here.
17069
17070         * cs-parser.jay: Make foreach a toplevel object instead of the
17071         inline expansion, as we need to perform semantic analysis on it. 
17072
17073 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17074
17075         * expression.cs (Expression::ImplicitUserConversion): Rename to
17076         UserDefinedConversion.
17077
17078         (Expression::UserDefinedConversion): Take an extra argument specifying 
17079         whether we look for explicit user conversions too.
17080
17081         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17082
17083         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17084
17085         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17086         with the appropriate arguments.
17087
17088         * cs-parser.jay (cast_expression): Record location too.
17089
17090         * expression.cs (Cast): Record location info.
17091
17092         (Expression::ConvertExplicit): Take location argument.
17093
17094         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17095         to determine if we are doing explicit conversions.
17096
17097         (UserCast::Emit): Update accordingly.
17098
17099         (Expression::ConvertExplicit): Report an error if everything fails.
17100
17101         * ../errors/cs0030.cs : Add.
17102
17103 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17104
17105         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17106         virtual and newslot bits. 
17107
17108         * class.cs (TypeContainer::RegisterRequiredImplementations):
17109         Record methods we need.
17110
17111         (TypeContainer::MakeKey): Helper function to make keys for
17112         MethodBases, since the Methodbase key is useless.
17113
17114         (TypeContainer::Populate): Call RegisterRequiredImplementations
17115         before defining the methods.   
17116
17117         Create a mapping for method_builders_to_methods ahead of time
17118         instead of inside a tight loop.
17119
17120         (::RequireMethods):  Accept an object as the data to set into the
17121         hashtable so we can report interface vs abstract method mismatch.
17122
17123 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17124
17125         * report.cs: Make all of it static.
17126
17127         * rootcontext.cs: Drop object_type and value_type computations, as
17128         we have those in the TypeManager anyways.
17129
17130         Drop report instance variable too, now it is a global.
17131
17132         * driver.cs: Use try/catch on command line handling.
17133
17134         Add --probe option to debug the error reporting system with a test
17135         suite. 
17136
17137         * report.cs: Add support for exiting program when a probe
17138         condition is reached.
17139
17140 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17141
17142         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17143         we do a forcible conversion regardless of type, to check if 
17144         ForceConversion returns a null.
17145
17146         (Binary::error19): Use location to report error.
17147
17148         (Unary::error23): Use location here too.
17149
17150         * ../errors/cs0019.cs : Check in.
17151
17152         * ../errors/cs0023.cs : Check in.
17153
17154         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17155         case of a non-null MethodInfo object with a length of 0 !
17156
17157         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17158         an applicable member - according to the spec :-)
17159         Also fix logic to find members in base types.
17160
17161         (Unary::ResolveOperator): Same here.
17162
17163         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17164         as I was getting thoroughly confused between this and error19 :-)
17165
17166         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17167         (::FindMostEncompassedType): Implement.
17168         (::FindMostEncompassingType): Implement.
17169         (::StandardConversionExists): Implement.
17170
17171         (UserImplicitCast): Re-vamp. We now need info about most specific
17172         source and target types so that we can do the necessary conversions.
17173
17174         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17175         mathematical union with no duplicates.
17176
17177 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17178
17179         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17180         in order from base classes to child classes, so that we can in
17181         child classes look up in our parent for method names and
17182         attributes (required for handling abstract, virtual, new, override
17183         constructs: we need to instrospect our base class, and if we dont
17184         populate the classes in order, the introspection might be
17185         incorrect.  For example, a method could query its parent before
17186         the parent has any methods and would determine that the parent has
17187         no abstract methods (while it could have had them)).
17188
17189         (RootContext::CreateType): Record the order in which we define the
17190         classes.
17191
17192 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17193
17194         * class.cs (TypeContainer::Populate): Also method definitions can
17195         fail now, keep track of this.
17196
17197         (TypeContainer::FindMembers): Implement support for
17198         DeclaredOnly/noDeclaredOnly flag.
17199
17200         (Constructor::Emit) Return the ConstructorBuilder.
17201
17202         (Method::Emit) Return the MethodBuilder. 
17203         Check for abstract or virtual methods to be public.
17204
17205         * rootcontext.cs (RootContext::CreateType): Register all the
17206         abstract methods required for the class to be complete and the
17207         interface methods that must be implemented. 
17208
17209         * cs-parser.jay: Report error 501 (method requires body if it is
17210         not marked abstract or extern).
17211
17212         * expression.cs (TypeOf::Emit): Implement.
17213
17214         * typemanager.cs: runtime_handle_type, new global type.
17215
17216         * class.cs (Property::Emit): Generate code for properties.
17217
17218 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17219
17220         * expression.cs (Unary::ResolveOperator): Find operators on base type
17221         too - we now conform exactly to the spec.
17222
17223         (Binary::ResolveOperator): Same here.
17224
17225         * class.cs (Operator::Define): Fix minor quirk in the tests.
17226
17227         * ../errors/cs0215.cs : Added.
17228
17229         * ../errors/cs0556.cs : Added.
17230
17231         * ../errors/cs0555.cs : Added.
17232
17233 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17234
17235         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17236         single integer which is really efficient
17237
17238 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17239
17240         *  expression.cs (Expression::ImplicitUserConversion): Use location
17241         even in the case when we are examining True operators.
17242  
17243         * class.cs (Operator::Define): Perform extensive checks to conform
17244         with the rules for operator overloading in the spec.
17245
17246         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17247         some of the other conversions mentioned in the spec.
17248
17249         * typemanager.cs (array_type): New static member for the System.Array built-in
17250         type.
17251
17252         (cloneable_interface): For System.ICloneable interface.
17253
17254         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17255         we start resolving the tree and populating types.
17256
17257         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17258  
17259 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17260
17261         * expression.cs (Expression::ExprClassFromMemberInfo,
17262         Expression::Literalize): Create literal expressions from
17263         FieldInfos which are literals.
17264
17265         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17266         type casts, because they were wrong.  The test suite in tests
17267         caught these ones.
17268
17269         (ImplicitNumericConversion): ushort to ulong requires a widening
17270         cast. 
17271
17272         Int32 constant to long requires widening cast as well.
17273
17274         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17275         for integers because the type on the stack is not i4.
17276
17277 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17278
17279         * expression.cs (report118): require location argument. 
17280
17281         * parameter.cs: Do not dereference potential null value.
17282
17283         * class.cs: Catch methods that lack the `new' keyword when
17284         overriding a name.  Report warnings when `new' is used without
17285         anything being there to override.
17286
17287         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17288
17289         * class.cs: Only add constructor to hashtable if it is non-null
17290         (as now constructors can fail on define).
17291
17292         (TypeManager, Class, Struct): Take location arguments.
17293
17294         Catch field instance initialization in structs as errors.
17295
17296         accepting_filter: a new filter for FindMembers that is static so
17297         that we dont create an instance per invocation.
17298
17299         (Constructor::Define): Catch errors where a struct constructor is
17300         parameterless 
17301
17302         * cs-parser.jay: Pass location information for various new
17303         constructs. 
17304
17305         * delegate.cs (Delegate): take a location argument.
17306
17307         * driver.cs: Do not call EmitCode if there were problesm in the
17308         Definition of the types, as many Builders wont be there. 
17309
17310         * decl.cs (Decl::Decl): Require a location argument.
17311
17312         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17313         into integers, and find the most appropiate integer for it.
17314
17315         * literal.cs: Implement ULongLiteral.
17316
17317         * rootcontext.cs: Provide better information about the location of
17318         failure when CreateType fails.
17319
17320 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17321
17322         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17323         as well.
17324
17325         * expression.cs (Binary::CheckShiftArguments): Add missing type
17326         computation.
17327         (Binary::ResolveOperator): Add type to the logical and and logical
17328         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17329         before.
17330
17331         (Binary::DoNumericPromotions): In the case where either argument
17332         is ulong (and most signed types combined with ulong cause an
17333         error) perform implicit integer constant conversions as well.
17334
17335 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17336
17337         * expression.cs (UserImplicitCast): Method should always be
17338         non-null. 
17339         (Invocation::BetterConversion): Simplified test for IntLiteral.
17340
17341         (Expression::ImplicitNumericConversion): Split this routine out.
17342         Put the code that performs implicit constant integer conversions
17343         here. 
17344
17345         (Expression::Resolve): Become a wrapper around DoResolve so we can
17346         check eclass and type being set after resolve.
17347
17348         (Invocation::Badness): Remove this dead function
17349
17350         (Binary::ResolveOperator): Do not compute the expensive argumnets
17351         unless we have a union for it.
17352
17353         (Probe::Emit): Is needs to do an isinst and then
17354         compare against null.
17355
17356         (::CanConvert): Added Location argument.  If the Location argument
17357         is null (Location.Null), then we do not report errors.  This is
17358         used by the `probe' mechanism of the Explicit conversion.  We do
17359         not want to generate an error for something that the user
17360         explicitly requested to be casted.  But the pipeline for an
17361         explicit cast first tests for potential implicit casts.
17362
17363         So for now, if the Location is null, it means `Probe only' to
17364         avoid adding another argument.   Might have to revise this
17365         strategy later.
17366
17367         (ClassCast): New class used to type cast objects into arbitrary
17368         classes (used in Explicit Reference Conversions).
17369
17370         Implement `as' as well.
17371
17372         Reverted all the patches from Ravi below: they were broken:
17373
17374                 * The use of `level' as a mechanism to stop recursive
17375                   invocations is wrong.  That was there just to catch the
17376                   bug with a strack trace but not as a way of addressing
17377                   the problem.
17378
17379                   To fix the problem we have to *understand* what is going
17380                   on and the interactions and come up with a plan, not
17381                   just get things going.
17382
17383                 * The use of the type conversion cache that I proposed
17384                   last night had an open topic: How does this work across
17385                   protection domains.  A user defined conversion might not
17386                   be public in the location where we are applying the
17387                   conversion, a different conversion might be selected
17388                   (ie, private A->B (better) but public B->A (worse),
17389                   inside A, A->B applies, but outside it, B->A will
17390                   apply).
17391
17392                 * On top of that (ie, even if the above is solved),
17393                   conversions in a cache need to be abstract.  Ie, `To
17394                   convert from an Int to a Short use an OpcodeCast', not
17395                   `To convert from an Int to a Short use the OpcodeCast on
17396                   the variable 5' (which is what this patch was doing).
17397
17398 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17399
17400         * expression.cs (Invocation::ConversionExists): Re-write to use
17401         the conversion cache
17402
17403         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17404         cache all conversions done, not just user-defined ones.
17405
17406         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17407         to determine if a conversion exists instead of acutually trying to 
17408         perform the conversion. It's faster too.
17409
17410         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17411         and only then attempt the implicit conversion.
17412
17413 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17414
17415         * expression.cs (ConvertImplicit): Use a cache for conversions
17416         already found. Check level of recursion and bail out if necessary.
17417
17418 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17419
17420         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17421         Export standard methods that we expect for string operations.
17422
17423         * statement.cs (Block::UsageWarning): Track usage of variables and
17424         report the errors for not used variables.
17425
17426         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17427         operator. 
17428
17429 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17430
17431         * codegen.cs: remove unnneded code 
17432
17433         * expression.cs: Removed BuiltinTypeAccess class
17434
17435         Fix the order in which implicit conversions are
17436         done.  
17437
17438         The previous fixed dropped support for boxed conversions (adding a
17439         test to the test suite now)
17440
17441         (UserImplicitCast::CanConvert): Remove test for source being null,
17442         that code is broken.  We should not feed a null to begin with, if
17443         we do, then we should track the bug where the problem originates
17444         and not try to cover it up here.
17445
17446         Return a resolved expression of type UserImplicitCast on success
17447         rather than true/false.  Ravi: this is what I was talking about,
17448         the pattern is to use a static method as a "constructor" for
17449         objects. 
17450
17451         Also, do not create arguments until the very last minute,
17452         otherwise we always create the arguments even for lookups that
17453         will never be performed. 
17454
17455         (UserImplicitCast::Resolve): Eliminate, objects of type
17456         UserImplicitCast are born in a fully resolved state. 
17457
17458         * typemanager.cs (InitCoreTypes): Init also value_type
17459         (System.ValueType). 
17460
17461         * expression.cs (Cast::Resolve): First resolve the child expression.
17462
17463         (LValue): Add new method AddressOf to be used by
17464         the `&' operator.  
17465
17466         Change the argument of Store to take an EmitContext instead of an
17467         ILGenerator, because things like FieldExpr need to be able to call
17468         their children expression to generate the instance code. 
17469
17470         (Expression::Error, Expression::Warning): Sugar functions for
17471         reporting errors.
17472
17473         (Expression::MemberLookup): Accept a TypeContainer instead of a
17474         Report as the first argument.
17475
17476         (Expression::ResolvePrimary): Killed.  I still want to improve
17477         this as currently the code is just not right.
17478
17479         (Expression::ResolveMemberAccess): Simplify, but it is still
17480         wrong. 
17481
17482         (Unary::Resolve): Catch errors in AddressOf operators.
17483
17484         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
17485         index to a byte for the short-version, or the compiler will choose
17486         the wrong Emit call, which generates the wrong data.
17487
17488         (ParameterReference::Emit, ::Store): same.
17489
17490         (FieldExpr::AddressOf): Implement.
17491
17492         * typemanager.cs: TypeManager: made public variable instead of
17493         property.
17494
17495         * driver.cs: document --fatal.
17496
17497         * report.cs (ErrorMessage, WarningMessage): new names for the old
17498         Error and Warning classes.
17499
17500         * cs-parser.jay (member_access): Turn built-in access to types
17501         into a normal simplename
17502
17503 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17504
17505         * expression.cs (Invocation::BetterConversion): Fix to cope
17506         with q being null, since this was introducing a bug.
17507
17508         * expression.cs (ConvertImplicit): Do built-in conversions first.
17509
17510 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17511
17512         * expression.cs (UserImplicitCast::Resolve): Fix bug.
17513
17514 2001-09-27  Ravi Pratap  <ravi@ximian.com>
17515
17516         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
17517         I had introduced long ago (what's new ?).
17518
17519         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
17520         the work of all the checking. 
17521         (ConvertImplicit): Call CanConvert and only then create object if necessary.
17522         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
17523
17524         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
17525         that is the right way. 
17526
17527         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
17528         overloading resolution. Use everywhere instead of cutting and pasting code.
17529
17530         (Binary::ResolveOperator): Use MakeUnionSet.
17531
17532         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
17533         we have to convert to bool types. Not complete yet.
17534
17535 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17536
17537         * typemanager.cs (TypeManager::CSharpName): support ushort.
17538
17539         * expression.cs (Expression::TryImplicitIntConversion): Attempts
17540         to provide an expression that performsn an implicit constant int
17541         conversion (section 6.1.6).
17542         (Expression::ConvertImplicitRequired): Reworked to include
17543         implicit constant expression conversions.
17544
17545         (Expression::ConvertNumericExplicit): Finished.
17546
17547         (Invocation::Emit): If InstanceExpression is null, then it means
17548         that we perform a call on this.
17549
17550 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
17551
17552         * expression.cs (Unary::Emit): Remove some dead code.
17553         (Probe): Implement Resolve and Emit for `is'.
17554         (Expression::ConvertImplicitRequired): Attempt to do constant
17555         expression conversions here.  Maybe should be moved to
17556         ConvertImplicit, but I am not sure.
17557         (Expression::ImplicitLongConstantConversionPossible,
17558         Expression::ImplicitIntConstantConversionPossible): New functions
17559         that tell whether is it possible to apply an implicit constant
17560         expression conversion.
17561
17562         (ConvertNumericExplicit): Started work on explicit numeric
17563         conversions.
17564
17565         * cs-parser.jay: Update operator constants.
17566
17567         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
17568         (Parameters::GetSignature): Hook up VerifyArgs here.
17569         (Parameters::VerifyArgs): Verifies that no two arguments have the
17570         same name. 
17571
17572         * class.cs (Operator): Update the operator names to reflect the
17573         ones that the spec expects (as we are just stringizing the
17574         operator names).
17575
17576         * expression.cs (Unary::ResolveOperator): Fix bug: Use
17577         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
17578         previous usage did only work for our methods.
17579         (Expression::ConvertImplicit): Handle decimal implicit numeric
17580         conversions as well.
17581         (Expression::InternalTypeConstructor): Used to invoke constructors
17582         on internal types for default promotions.
17583
17584         (Unary::Emit): Implement special handling for the pre/post
17585         increment/decrement for overloaded operators, as they need to have
17586         the same semantics as the other operators.
17587
17588         (Binary::ResolveOperator): ditto.
17589         (Invocation::ConversionExists): ditto.
17590         (UserImplicitCast::Resolve): ditto.
17591
17592 2001-09-26  Ravi Pratap  <ravi@ximian.com>
17593
17594         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
17595         operator, return after emitting body. Regression tests pass again !
17596
17597         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
17598         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
17599         (Invocation::OverloadResolve): Ditto.
17600         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
17601
17602         * everywhere : update calls to the above methods accordingly.
17603
17604 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
17605
17606         * assign.cs (Assign): Make it inherit from ExpressionStatement.
17607
17608         * expression.cs (ExpressionStatement): New base class used for
17609         expressions that can appear in statements, so that we can provide
17610         an alternate path to generate expression that do not leave a value
17611         on the stack.
17612
17613         (Expression::Emit, and all the derivatives): We no longer return
17614         whether a value is left on the stack or not.  Every expression
17615         after being emitted leaves a single value on the stack.
17616
17617         * codegen.cs (EmitContext::EmitStatementExpression): Use the
17618         facilties of ExpressionStatement if possible.
17619
17620         * cs-parser.jay: Update statement_expression.
17621
17622 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * driver.cs: Change the wording of message
17625
17626 2001-09-25  Ravi Pratap  <ravi@ximian.com>
17627
17628         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
17629         the type of the expression to the return type of the method if
17630         we have an overloaded operator match ! The regression tests pass again !
17631         (Unary::ResolveOperator): Ditto.
17632
17633         * expression.cs (Invocation::ConversionExists): Correct the member lookup
17634         to find "op_Implicit", not "implicit" ;-)
17635         (UserImplicitCast): New class to take care of user-defined implicit conversions.
17636         (ConvertImplicit, ForceConversion): Take TypeContainer argument
17637
17638         * everywhere : Correct calls to the above accordingly.
17639
17640         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
17641         (ConvertImplicit): Do user-defined conversion if it exists.
17642
17643 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
17644
17645         * assign.cs: track location.
17646         (Resolve): Use implicit conversions on assignment.
17647
17648         * literal.cs: Oops.  Not good, Emit of short access values should
17649         pass (Bytes) or the wrong argument will be selected.
17650
17651         * expression.cs (Unary::Emit): Emit code for -expr.
17652
17653         (Unary::ResolveOperator): Handle `Substract' for non-constants
17654         (substract from zero from the non-constants).
17655         Deal with Doubles as well. 
17656
17657         (Expression::ConvertImplicitRequired): New routine that reports an
17658         error if no implicit conversion exists. 
17659
17660         (Invocation::OverloadResolve): Store the converted implicit
17661         expressions if we make them
17662
17663 2001-09-24  Ravi Pratap  <ravi@ximian.com>
17664
17665         * class.cs (ConstructorInitializer): Take a Location argument.
17666         (ConstructorBaseInitializer): Same here.
17667         (ConstructorThisInitializer): Same here.
17668
17669         * cs-parser.jay : Update all calls accordingly.
17670
17671         * expression.cs (Unary, Binary, New): Take location argument.
17672         Update accordingly everywhere.
17673
17674         * cs-parser.jay : Update all calls to the above to take a location
17675         argument.
17676
17677         * class.cs : Ditto.
17678
17679 2001-09-24  Ravi Pratap  <ravi@ximian.com>
17680
17681         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
17682         (Invocation::BetterConversion): Same here
17683         (Invocation::ConversionExists): Ditto.
17684
17685         (Invocation::ConversionExists): Implement.
17686
17687 2001-09-22  Ravi Pratap  <ravi@ximian.com>
17688
17689         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
17690         Also take an additional TypeContainer argument.
17691
17692         * All over : Pass in TypeContainer as argument to OverloadResolve.
17693
17694         * typemanager.cs (CSharpName): Update to check for the string type and return
17695         that too.
17696
17697         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
17698         a given method.
17699
17700 2001-09-21  Ravi Pratap  <ravi@ximian.com>
17701
17702         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
17703         (Invocation::BetterFunction): Implement.
17704         (Invocation::BetterConversion): Implement.
17705         (Invocation::ConversionExists): Skeleton, no implementation yet.
17706
17707         Okay, things work fine !
17708
17709 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
17710
17711         * typemanager.cs: declare and load enum_type, delegate_type and
17712         void_type. 
17713
17714         * expression.cs (Expression::Emit): Now emit returns a value that
17715         tells whether a value is left on the stack or not.  This strategy
17716         might be reveted tomorrow with a mechanism that would address
17717         multiple assignments.
17718         (Expression::report118): Utility routine to report mismatches on
17719         the ExprClass.
17720
17721         (Unary::Report23): Report impossible type/operator combination
17722         utility function.
17723
17724         (Unary::IsIncrementableNumber): Whether the type can be
17725         incremented or decremented with add.
17726         (Unary::ResolveOperator): Also allow enumerations to be bitwise
17727         complemented. 
17728         (Unary::ResolveOperator): Implement ++, !, ~,
17729
17730         (Invocation::Emit): Deal with new Emit convetion.
17731
17732         * All Expression derivatives: Updated their Emit method to return
17733         whether they leave values on the stack or not.
17734
17735         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
17736         stack for expressions that are statements. 
17737
17738 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
17739
17740         * expression.cs (LValue): New interface.  Must be implemented by
17741         LValue objects.
17742         (LocalVariableReference, ParameterReference, FieldExpr): Implement
17743         LValue interface.
17744
17745         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
17746         interface for generating code, simplifies the code.
17747
17748 2001-09-20  Ravi Pratap  <ravi@ximian.com>
17749
17750         * expression.cs (everywhere): Comment out return statements in ::Resolve
17751         methods to avoid the warnings.
17752
17753 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
17754
17755         * driver.cs (parse): Report error 2001 if we can not open the
17756         source file.
17757
17758         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
17759         not resolve it.
17760
17761         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
17762         object. 
17763
17764         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
17765         otherwise nested blocks end up with the same index.
17766
17767         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
17768
17769         * expression.cs:  Instead of having FIXMEs in the Resolve
17770         functions, throw exceptions so it is obvious that we are facing a
17771         bug. 
17772
17773         * cs-parser.jay (invocation_expression): Pass Location information.
17774
17775         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
17776         Use a basename for those routines because .NET does not like paths
17777         on them. 
17778
17779         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
17780         already defined.
17781
17782 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
17783
17784         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
17785         are loading the correct data types (throws an exception if not).
17786         (TypeManager::InitCoreTypes): Use CoreLookupType
17787
17788         * expression.cs (Unary::ResolveOperator): return the child
17789         expression for expressions which are just +expr.
17790         (Unary::ResolveOperator): Return negative literals for -LITERAL
17791         expressions (otherwise they are Unary {Literal}).
17792         (Invocation::Badness): Take into account `Implicit constant
17793         expression conversions'.
17794
17795         * literal.cs (LongLiteral): Implement long literal class.
17796         (IntLiteral): export the `Value' of the intliteral. 
17797
17798 2001-09-19  Ravi Pratap  <ravi@ximian.com>
17799
17800         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
17801
17802         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
17803         instead of 'Operator'
17804
17805         * expression.cs (Binary::ResolveOperator): Update accordingly.
17806         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
17807         and 'Minus'
17808
17809         * cs-parser.jay (unary_expression): Update to use the new names.
17810
17811         * gen-treedump.cs (GetUnary): Same here.
17812
17813         * expression.cs (Unary::Resolve): Implement.
17814         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
17815         operators are found instead of making noise ;-)
17816         (Unary::ResolveOperator): New method to do precisely the same thing which
17817         Binary::ResolveOperator does for Binary expressions.
17818         (Unary.method, .Arguments): Add.
17819         (Unary::OperName): Implement.   
17820         (Unary::ForceConversion): Copy and Paste !
17821
17822         * class.cs (Operator::Define): Fix a small bug for the case when we have 
17823         a unary operator.
17824
17825         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
17826         for the inbuilt operators. Only overloading works for now ;-)
17827
17828 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
17829
17830         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
17831         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
17832
17833         * expression.cs (This::Emit): Implement. 
17834         (This::Resolve): Implement.
17835         (TypeOf:Resolve): Implement.
17836         (Expression::ResolveSimpleName): Add an implicit this to instance
17837         field references. 
17838         (MemberAccess::Resolve): Deal with Parameters and Fields. 
17839         Bind instance variable to Field expressions.
17840         (FieldExpr::Instance): New field used to track the expression that
17841         represents the object instance.
17842         (FieldExpr::Resolve): Track potential errors from MemberLookup not
17843         binding 
17844         (FieldExpr::Emit): Implement.
17845
17846         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
17847         the last instruction contains a return opcode to avoid generating
17848         the last `ret' instruction (this generates correct code, and it is
17849         nice to pass the peverify output).
17850
17851         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
17852         initializer for static and instance variables.
17853         (Constructor::Emit): Allow initializer to be null in the case of
17854         static constructors.  Only emit initializer for instance
17855         constructors. 
17856
17857         (TypeContainer::FindMembers): Return a null array if there are no
17858         matches.
17859
17860         Also fix the code for the MemberTypes.Method branch, as it was not
17861         scanning that for operators (or tried to access null variables before).
17862
17863         * assign.cs (Assign::Emit): Handle instance and static fields. 
17864
17865         * TODO: Updated.
17866
17867         * driver.cs: Stop compilation if there are parse errors.
17868
17869         * cs-parser.jay (constructor_declaration): Provide default base
17870         initializer for non-static constructors.
17871         (constructor_declarator): Do not provide a default base
17872         initializers if none was specified.
17873         Catch the fact that constructors should not have parameters.
17874
17875         * class.cs: Do not emit parent class initializers for static
17876         constructors, that should be flagged as an error.
17877
17878 2001-09-18  Ravi Pratap  <ravi@ximian.com>
17879
17880         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
17881         Move back code into TypeContainer::Populate.
17882
17883 2001-09-18  Ravi Pratap  <ravi@ximian.com>
17884
17885         * class.cs (TypeContainer::AddConstructor): Fix the check to
17886         compare against Name, not Basename. 
17887         (Operator::OpType): Change Plus and Minus to Add and Subtract.
17888
17889         * cs-parser.jay : Update accordingly.
17890
17891         * class.cs (TypeContainer::FindMembers): For the case where we are searching
17892         for methods, don't forget to look into the operators too.
17893         (RegisterMethodBuilder): Helper method to take care of this for
17894         methods, constructors and operators.
17895         (Operator::Define): Completely revamp.
17896         (Operator.OperatorMethod, MethodName): New fields.
17897         (TypeContainer::Populate): Move the registering of builders into
17898         RegisterMethodBuilder.
17899         (Operator::Emit): Re-write.
17900
17901         * expression.cs (Binary::Emit): Comment out code path to emit method
17902         invocation stuff for the case when we have a user defined operator. I am
17903         just not able to get it right !
17904
17905 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
17906
17907         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
17908         argument. 
17909
17910         (Expression::MemberLookup): Provide a version that allows to
17911         specify the MemberTypes and BindingFlags. 
17912
17913         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
17914         so it was not fetching variable information from outer blocks.
17915
17916         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
17917         Beforefieldinit as it was buggy.
17918
17919         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
17920         that Ravi put here.  
17921
17922         * class.cs (Constructor::Emit): Only emit if block is not null.
17923         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
17924         deal with this by semantically definining it as if the user had
17925         done it.
17926
17927         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
17928         constructors as we now "emit" them at a higher level.
17929
17930         (TypeContainer::DefineDefaultConstructor): Used to define the
17931         default constructors if none was provided.
17932
17933         (ConstructorInitializer): Add methods Resolve and Emit. 
17934
17935         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
17936
17937 2001-09-17  Ravi Pratap  <ravi@ximian.com>
17938
17939         * class.cs (TypeContainer::EmitDefaultConstructor): Register
17940         the default constructor builder with our hashtable for methodbuilders
17941         to methodcores.
17942
17943         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
17944         and argument_count is 0 in which case we have a match.
17945         (Binary::ResolveOperator): More null checking and miscellaneous coding
17946         style cleanup.
17947
17948 2001-09-17  Ravi Pratap  <ravi@ximian.com>
17949
17950         * rootcontext.cs (IsNameSpace): Compare against null.
17951
17952         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
17953
17954         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
17955         and Unary::Operator.
17956
17957         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
17958         accordingly.
17959
17960         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
17961         we have overloaded operators.
17962         (Binary::ResolveOperator): Implement the part which does the operator overload
17963         resolution.
17964
17965         * class.cs (Operator::Emit): Implement.
17966         (TypeContainer::Emit): Emit the operators we have too.
17967
17968         * expression.cs (Binary::Emit): Update to emit the appropriate code for
17969         the case when we have a user-defined operator.
17970
17971 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
17974
17975 2001-09-16  Ravi Pratap  <ravi@ximian.com>
17976
17977         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
17978         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
17979         (Constructor::Emit): Implement.
17980         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
17981         if we have no work to do. 
17982         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
17983         Emit method.
17984
17985         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
17986         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
17987
17988         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
17989         of parent.parent.
17990
17991 2001-09-15  Ravi Pratap  <ravi@ximian.com>
17992
17993         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
17994         in the source.
17995         (Tree::RecordNamespace): Method to do what the name says ;-)
17996         (Tree::Namespaces): Property to get at the namespaces hashtable.
17997
17998         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
17999         keep track.
18000
18001         * rootcontext.cs (IsNamespace): Fixed it :-)
18002
18003 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18004
18005         * class.cs (TypeContainer::FindMembers): Add support for
18006         constructors. 
18007         (MethodCore): New class that encapsulates both the shared aspects
18008         of a Constructor and a Method.  
18009         (Method, Constructor): Factored pieces into MethodCore.
18010
18011         * driver.cs: Added --fatal which makes errors throw exceptions.
18012         Load System assembly as well as part of the standard library.
18013
18014         * report.cs: Allow throwing exceptions on errors for debugging.
18015
18016         * modifiers.cs: Do not use `parent', instead use the real type
18017         container to evaluate permission settings.
18018
18019         * class.cs: Put Ravi's patch back in.  He is right, and we will
18020         have to cope with the
18021
18022 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18023
18024         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18025         FamORAssem, not FamANDAssem.
18026
18027 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18028
18029         * driver.cs: Added --parse option that only parses its input files
18030         and terminates.
18031
18032         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18033         incorrect.  IsTopLevel is not used to tell whether an object is
18034         root_types or not (that can be achieved by testing this ==
18035         root_types).  But to see if this is a top-level *class* (not
18036         necessarly our "toplevel" container). 
18037
18038 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18039
18040         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18041         parent instead of a direct call to GetType.
18042
18043 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18044
18045         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18046         Modifiers.TypeAttr. This should just be a call to that method.
18047
18048         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18049         object so that we can determine if we are top-level or not.
18050
18051         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18052         TypeContainer too.
18053
18054         * enum.cs (Enum::Define): Ditto.
18055
18056         * modifiers.cs (FieldAttr): Re-write.
18057
18058         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18059         (TypeContainer::HaveStaticConstructor): New property to provide access
18060         to precisely that info.
18061
18062         * modifiers.cs (MethodAttr): Re-write.
18063         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18064
18065         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18066         of top-level types as claimed.
18067
18068 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18069
18070         * expression.cs (MemberLookup): Fruitless attempt to lookup
18071         constructors.  Maybe I need to emit default constructors?  That
18072         might be it (currently .NET emits this for me automatically).
18073         (Invocation::OverloadResolve): Cope with Arguments == null.
18074         (Invocation::EmitArguments): new function, shared by the new
18075         constructor and us.
18076         (Invocation::Emit): Handle static and instance methods.  Emit
18077         proper call instruction for virtual or non-virtual invocations.
18078         (New::Emit): Implement.
18079         (New::Resolve): Implement.
18080         (MemberAccess:Resolve): Implement.
18081         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18082         to track instances.
18083         (FieldExpr::Resolve): Set type.
18084
18085         * support.cs: Handle empty arguments.
18086                 
18087         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18088         SimpleLookup): Auxiliary routines to help parse a qualifier
18089         identifier.  
18090
18091         Update qualifier_identifier rule.
18092
18093         * codegen.cs: Removed debugging messages.
18094
18095         * class.cs: Make this a global thing, this acts just as a "key" to
18096         objects that we might have around.
18097
18098         (Populate): Only initialize method_builders_to_methods once.
18099
18100         * expression.cs (PropertyExpr): Initialize type from the
18101         PropertyType. 
18102
18103         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18104         Resolve pattern.  Attempt to implicitly convert value to boolean.
18105         Emit code.
18106
18107         * expression.cs: Set the type for the int32/int32 argument case.
18108         (Binary::ResolveOperator): Set the return type to boolean for
18109         comparission operators
18110
18111         * typemanager.cs: Remove debugging print code.
18112
18113         (Invocation::Resolve): resolve type.
18114
18115         * class.cs: Allocate a MemberInfo of the correct size, as the code
18116         elsewhere depends on the test to reflect the correct contents.
18117
18118         (Method::) Keep track of parameters, due to System.Reflection holes
18119
18120         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18121         mapping here.
18122
18123         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18124         of the exact size and return that.
18125
18126         (Class::LookupMethodByBuilder): New function that maps
18127         MethodBuilders to its methods.  Required to locate the information
18128         on methods because System.Reflection bit us again.
18129
18130         * support.cs: New file, contains an interface ParameterData and
18131         two implementations: ReflectionParameters and InternalParameters
18132         used to access Parameter information.  We will need to grow this
18133         as required.
18134
18135         * expression.cs (Invocation::GetParameterData): implement a cache
18136         and a wrapper around the ParameterData creation for methods. 
18137         (Invocation::OverloadResolve): Use new code.
18138
18139 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18140
18141         * class.cs (TypeContainer::EmitField): Remove and move into 
18142         (Field::Define): here and modify accordingly.
18143         (Field.FieldBuilder): New member.
18144         (TypeContainer::Populate): Update accordingly.
18145         (TypeContainer::FindMembers): Implement.
18146
18147 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18148
18149         * statement.cs: (VariableInfo::VariableType): New field to be
18150         initialized with the full type once it is resolved. 
18151
18152 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18153
18154         * parameter.cs (GetParameterInfo): Use a type cache to compute
18155         things only once, and to reuse this information
18156
18157         * expression.cs (LocalVariableReference::Emit): Implement.
18158         (OpcodeCast::Emit): fix.
18159
18160         (ParameterReference::Resolve): Implement.
18161         (ParameterReference::Emit): Implement.
18162
18163         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18164         that are expressions need to stay as Expressions.
18165
18166         * typemanager.cs (CSharpName): Returns the C# name of a type if
18167         possible. 
18168
18169         * expression.cs (Expression::ConvertImplicit): New function that
18170         implements implicit type conversions.
18171
18172         (Expression::ImplicitReferenceConversion): Implements implicit
18173         reference conversions.
18174
18175         (EmptyCast): New type for transparent casts.
18176
18177         (OpcodeCast): New type for casts of types that are performed with
18178         a sequence of bytecodes.
18179
18180         (BoxedCast): New type used for casting value types into reference
18181         types.  Emits a box opcode.
18182
18183         (Binary::DoNumericPromotions): Implements numeric promotions of
18184         and computation of the Binary::Type.
18185
18186         (Binary::EmitBranchable): Optimization.
18187
18188         (Binary::Emit): Implement code emission for expressions.
18189
18190         * typemanager.cs (TypeManager): Added two new core types: sbyte
18191         and byte.
18192
18193 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18194
18195         * class.cs (TypeContainer::FindMembers): Method which does exactly
18196         what Type.FindMembers does, only we don't have to use reflection. No
18197         implementation yet.
18198
18199         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18200         typecontainer objects as we need to get at them.
18201         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18202
18203         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18204         typecontainer object.
18205
18206         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18207         of just a Report object.
18208
18209 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18210
18211         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18212         "remove_"
18213         (TypeContainer::Populate): Now define the delegates of the type too.
18214         (TypeContainer.Delegates): Property to access the list of delegates defined
18215         in the type.
18216
18217         * delegates.cs (Delegate::Define): Implement partially.
18218
18219         * modifiers.cs (TypeAttr): Handle more flags.
18220
18221 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18222
18223         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18224         and not <=
18225         (Operator::Define): Re-write logic to get types by using the LookupType method
18226         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18227         (Indexer::Define): Ditto.
18228         (Event::Define): Ditto.
18229         (Property::Define): Ditto.
18230
18231 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18232
18233         * class.cs (TypeContainer::Populate): Now define operators too. 
18234         (TypeContainer.Operators): New property to access the list of operators
18235         in a type.
18236         (Operator.OperatorMethodBuilder): New member to hold the method builder
18237         for the operator we are defining.
18238         (Operator::Define): Implement.
18239
18240 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18241
18242         * class.cs (Event::Define): Make the prefixes of the accessor methods
18243         addOn_ and removeOn_ 
18244
18245         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18246         of the location being passed in too. Ideally, this should go later since all
18247         error reporting should be done through the Report object.
18248
18249         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18250         (Populate): Iterate thru the indexers we have and define them too.
18251         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18252         for the get and set accessors.
18253         (Indexer::Define): Implement.
18254
18255 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18256
18257         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18258         my previous implementation, did not work.
18259
18260         * typemanager.cs: Add a couple of missing types (the longs).
18261
18262         * literal.cs: Use TypeManager.bool_type instead of getting it.
18263
18264         * expression.cs (EventExpr): New kind of expressions.
18265         (Expressio::ExprClassFromMemberInfo): finish
18266
18267 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18268
18269         * assign.cs: Emit stores to static fields differently.
18270
18271 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18272
18273         * Merge in changes and adjust code to tackle conflicts. Backed out my
18274         code in Assign::Resolve ;-) 
18275
18276 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18277
18278         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18279         instead Report.Error and also pass in the location.
18280         (CSharpParser::Lexer): New readonly property to return the reference
18281         to the Tokenizer object.
18282         (declare_local_variables): Use Report.Error with location instead of plain 
18283         old error.
18284         (CheckDef): Ditto.
18285
18286         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18287         (Operator.CheckBinaryOperator): Ditto.
18288
18289         * cs-parser.jay (operator_declarator): Update accordingly.
18290
18291         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18292         (CheckBinaryOperator): Same here.
18293
18294         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18295         on the name without any prefixes of namespace names etc. This is because we
18296         already might have something already fully qualified like 
18297         'System.Console.WriteLine'
18298
18299         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18300
18301 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18302
18303         * cs-tokenizer.cs (location): Return a string which also contains
18304         the file name.
18305
18306         * expression.cs (ElementAccess): New class for expressions of the
18307         type 'element access.'
18308         (BaseAccess): New class for expressions of the type 'base access.'
18309         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18310         respectively.
18311
18312         * cs-parser.jay (element_access): Implement action.
18313         (base_access): Implement actions.
18314         (checked_expression, unchecked_expression): Implement.
18315
18316         * cs-parser.jay (local_variable_type): Correct and implement.
18317         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18318
18319         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18320
18321         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18322         name and the specifiers.
18323
18324         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18325
18326         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18327         making them all public ;-)
18328
18329         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18330         class anyways.
18331
18332 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18333
18334         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18335         PropertyExprs.
18336         (FieldExpr, PropertyExprs): New resolved expressions.
18337         (SimpleName::MemberStaticCheck): Perform static checks for access
18338         to non-static fields on static methods. Maybe this should be
18339         generalized for MemberAccesses. 
18340         (SimpleName::ResolveSimpleName): More work on simple name
18341         resolution. 
18342
18343         * cs-parser.jay (primary_expression/qualified_identifier): track
18344         the parameter index.
18345
18346         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18347         (EmitContext::EmitBoolExpression): Chain to expression generation
18348         instead of temporary hack.
18349         (::EmitStatementExpression): Put generic expression code generation.
18350
18351         * assign.cs (Assign::Emit): Implement variable assignments to
18352         local variables, parameters and fields.
18353
18354 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18355
18356         * statement.cs (Block::GetVariableInfo): New method, returns the
18357         VariableInfo for a variable name in a block.
18358         (Block::GetVariableType): Implement in terms of GetVariableInfo
18359
18360         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18361         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18362
18363 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18364
18365         * cs-parser.jay (operator_declaration): Continue on my quest : update
18366         to take attributes argument.
18367         (event_declaration): Ditto.
18368         (enum_declaration): Ditto.
18369         (indexer_declaration): Ditto.
18370
18371         * class.cs (Operator::Operator): Update constructor accordingly.
18372         (Event::Event): Ditto.
18373
18374         * delegate.cs (Delegate::Delegate): Same here.
18375
18376         * enum.cs (Enum::Enum): Same here.
18377
18378 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18379
18380         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18381
18382         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18383
18384         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18385         being passed around as an arraylist.
18386         (Attributes::AddAttribute): Method to add attribute sections.
18387
18388         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18389         (struct_declaration): Update accordingly.
18390         (constant_declaration): Update.
18391         (field_declaration): Update.
18392         (method_header): Update.
18393         (fixed_parameter): Update.
18394         (parameter_array): Ditto.
18395         (property_declaration): Ditto.
18396         (destructor_declaration): Ditto.
18397
18398         * class.cs (Struct::Struct): Update constructors accordingly.
18399         (Class::Class): Ditto.
18400         (Field::Field): Ditto.
18401         (Method::Method): Ditto.
18402         (Property::Property): Ditto.
18403         (TypeContainer::OptAttribute): update property's return type.
18404
18405         * interface.cs (Interface.opt_attributes): New member.
18406         (Interface::Interface): Update to take the extra Attributes argument.
18407
18408         * parameter.cs (Parameter::Parameter): Ditto.
18409
18410         * constant.cs (Constant::Constant): Ditto.
18411
18412         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18413         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18414         the attributes as a parameter.
18415         (InterfaceProperty): Update constructor call.
18416         (InterfaceEvent): Ditto.
18417         (InterfaceMethod): Ditto.
18418         (InterfaceIndexer): Ditto.
18419
18420         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18421         pass the attributes too.
18422         (interface_event_declaration): Ditto.
18423         (interface_property_declaration): Ditto.
18424         (interface_method_declaration): Ditto.
18425         (interface_declaration): Ditto.
18426
18427 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18428
18429         * class.cs (Method::Define): Track the "static Main" definition to
18430         create an entry point. 
18431
18432         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18433         EntryPoint if we find it. 
18434
18435         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18436         (EmitContext::ig): Make this variable public.
18437
18438         * driver.cs: Make the default output file be the first file name
18439         with the .exe extension.  
18440
18441         Detect empty compilations
18442
18443         Handle various kinds of output targets.  Handle --target and
18444         rename -t to --dumper.
18445
18446         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18447         methods inherited from Expression return now an Expression.  This
18448         will is used during the tree rewriting as we resolve them during
18449         semantic analysis.
18450
18451         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18452         the spec.  Missing entirely is the information about
18453         accessability of elements of it.
18454
18455         (Expression::ExprClassFromMemberInfo): New constructor for
18456         Expressions that creates a fully initialized Expression based on
18457         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18458         a Type.
18459
18460         (Invocation::Resolve): Begin implementing resolution of invocations.
18461
18462         * literal.cs (StringLiteral):  Implement Emit.
18463
18464 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18465
18466         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18467         member.
18468
18469 2001-09-04  Ravi Pratap  <ravi@ximian.com>
18470
18471         * cs-parser.jay (attribute_arguments): Implement actions.
18472         (attribute): Fix bug in production. Implement action.
18473         (attribute_list): Implement.
18474         (attribute_target): Implement.
18475         (attribute_target_specifier, opt_target_specifier): Implement
18476         (CheckAttributeTarget): New method to check if the attribute target
18477         is valid.
18478         (attribute_section): Implement.
18479         (opt_attributes): Implement.
18480
18481         * attribute.cs : New file to handle attributes.
18482         (Attribute): Class to hold attribute info.
18483
18484         * cs-parser.jay (opt_attribute_target_specifier): Remove production
18485         (attribute_section): Modify production to use 2 different rules to 
18486         achieve the same thing. 1 s/r conflict down !
18487         Clean out commented, useless, non-reducing dimension_separator rules.
18488
18489         * class.cs (TypeContainer.attributes): New member to hold list
18490         of attributes for a type.
18491         (Struct::Struct): Modify to take one more argument, the attribute list.
18492         (Class::Class): Ditto.
18493         (Field::Field): Ditto.
18494         (Method::Method): Ditto.
18495         (Property::Property): Ditto.
18496
18497         * cs-parser.jay (struct_declaration): Update constructor call to
18498         pass in the attributes too.
18499         (class_declaration): Ditto.
18500         (constant_declaration): Ditto.
18501         (field_declaration): Ditto.
18502         (method_header): Ditto.
18503         (fixed_parameter): Ditto.
18504         (parameter_array): Ditto.
18505         (property_declaration): Ditto.
18506
18507         * constant.cs (Constant::Constant): Update constructor similarly.
18508         Use System.Collections.
18509
18510         * parameter.cs (Parameter::Parameter): Update as above.
18511
18512 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18513
18514         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
18515         (TypeContainer.delegates): New member to hold list of delegates.
18516
18517         * cs-parser.jay (delegate_declaration): Implement the action correctly 
18518         this time as I seem to be on crack ;-)
18519
18520 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
18521
18522         * rootcontext.cs (RootContext::IsNamespace): new function, used to
18523         tell whether an identifier represents a namespace.
18524
18525         * expression.cs (NamespaceExpr): A namespace expression, used only
18526         temporarly during expression resolution.
18527         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
18528         utility functions to resolve names on expressions.
18529
18530 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
18531
18532         * codegen.cs: Add hook for StatementExpressions. 
18533
18534         * class.cs: Fix inverted test for static flag in methods.
18535
18536 2001-09-02  Ravi Pratap  <ravi@ximian.com>
18537
18538         * class.cs (Operator::CheckUnaryOperator): Correct error number used
18539         to make it coincide with MS' number.
18540         (Operator::CheckBinaryOperator): Ditto.
18541
18542         * ../errors/errors.txt : Remove error numbers added earlier.
18543
18544         * ../errors/cs1019.cs : Test case for error # 1019
18545
18546         * ../errros/cs1020.cs : Test case for error # 1020
18547
18548         * cs-parser.jay : Clean out commented cruft.
18549         (dimension_separators, dimension_separator): Comment out. Ostensibly not
18550         used anywhere - non-reducing rule.
18551         (namespace_declarations): Non-reducing rule - comment out.
18552
18553         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
18554         with TypeContainer::AddEnum.
18555
18556         * delegate.cs : New file for delegate handling classes.
18557         (Delegate): Class for declaring delegates.
18558
18559         * makefile : Update.
18560
18561         * cs-parser.jay (delegate_declaration): Implement.
18562
18563 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
18564
18565         * class.cs (Event::Define): Implement.
18566         (Event.EventBuilder): New member.
18567
18568         * class.cs (TypeContainer::Populate): Update to define all enums and events
18569         we have.
18570         (Events): New property for the events arraylist we hold. Shouldn't we move to using
18571         readonly fields for all these cases ?
18572
18573 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
18574
18575         * class.cs (Property): Revamp to use the convention of making fields readonly.
18576         Accordingly modify code elsewhere.
18577
18578         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
18579         the Define method of the Property class.
18580
18581         * class.cs : Clean up applied patch and update references to variables etc. Fix 
18582         trivial bug.
18583         (TypeContainer::Populate): Update to define all the properties we have. Also
18584         define all enumerations.
18585
18586         * enum.cs (Define): Implement.
18587
18588 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
18589
18590         * cs-parser.jay (overloadable_operator): The semantic value is an
18591         enum of the Operator class.
18592         (operator_declarator): Implement actions.
18593         (operator_declaration): Implement.
18594
18595         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
18596         validity of definitions.
18597         (Operator::CheckBinaryOperator): Static method to check for binary operators
18598         (TypeContainer::AddOperator): New method to add an operator to a type.
18599
18600         * cs-parser.jay (indexer_declaration): Added line to actually call the
18601         AddIndexer method so it gets added ;-)
18602
18603         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
18604         already taken care of by the MS compiler ?  
18605
18606 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
18607
18608         * class.cs (Operator): New class for operator declarations.
18609         (Operator::OpType): Enum for the various operators.
18610
18611 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
18612
18613         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
18614         ostensibly handle this in semantic analysis.
18615
18616         * cs-parser.jay (general_catch_clause): Comment out
18617         (specific_catch_clauses, specific_catch_clause): Ditto.
18618         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
18619         (catch_args, opt_catch_args): New productions.
18620         (catch_clause): Rewrite to use the new productions above
18621         (catch_clauses): Modify accordingly.
18622         (opt_catch_clauses): New production to use in try_statement
18623         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
18624         and re-write the code in the actions to extract the specific and
18625         general catch clauses by being a little smart ;-)
18626
18627         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
18628         Hooray, try and catch statements parse fine !
18629
18630 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18631
18632         * statement.cs (Block::GetVariableType): Fix logic to extract the type
18633         string from the hashtable of variables.
18634
18635         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
18636         I end up making that mistake ;-)
18637         (catch_clauses): Fixed gross error which made Key and Value of the 
18638         DictionaryEntry the same : $1 !!
18639
18640 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18641
18642         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
18643
18644         * cs-parser.jay (event_declaration): Correct to remove the semicolon
18645         when the add and remove accessors are specified. 
18646
18647 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
18648
18649         * cs-parser.jay (IndexerDeclaration): New helper class to hold
18650         information about indexer_declarator.
18651         (indexer_declarator): Implement actions.
18652         (parsing_indexer): New local boolean used to keep track of whether
18653         we are parsing indexers or properties. This is necessary because 
18654         implicit_parameters come into picture even for the get accessor in the 
18655         case of an indexer.
18656         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
18657
18658         * class.cs (Indexer): New class for indexer declarations.
18659         (TypeContainer::AddIndexer): New method to add an indexer to a type.
18660         (TypeContainer::indexers): New member to hold list of indexers for the
18661         type.
18662
18663 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
18664
18665         * cs-parser.jay (add_accessor_declaration): Implement action.
18666         (remove_accessor_declaration): Implement action.
18667         (event_accessors_declaration): Implement
18668         (variable_declarators): swap statements for first rule - trivial.
18669
18670         * class.cs (Event): New class to hold information about event
18671         declarations.
18672         (TypeContainer::AddEvent): New method to add an event to a type
18673         (TypeContainer::events): New member to hold list of events.
18674
18675         * cs-parser.jay (event_declaration): Implement actions.
18676
18677 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
18678
18679         * cs-parser.jay (dim_separators): Implement. Make it a string
18680         concatenating all the commas together, just as they appear.
18681         (opt_dim_separators): Modify accordingly
18682         (rank_specifiers): Update accordingly. Basically do the same
18683         thing - instead, collect the brackets here.
18684         (opt_rank_sepcifiers): Modify accordingly.
18685         (array_type): Modify to actually return the complete type string
18686         instead of ignoring the rank_specifiers.
18687         (expression_list): Implement to collect the expressions
18688         (variable_initializer): Implement. We make it a list of expressions
18689         essentially so that we can handle the array_initializer case neatly too.
18690         (variable_initializer_list): Implement.
18691         (array_initializer): Make it a list of variable_initializers
18692         (opt_array_initializer): Modify accordingly.
18693
18694         * expression.cs (New::NType): Add enumeration to help us
18695         keep track of whether we have an object/delegate creation
18696         or an array creation.
18697         (New:NewType, New::Rank, New::Indices, New::Initializers): New
18698         members to hold data about array creation.
18699         (New:New): Modify to update NewType
18700         (New:New): New Overloaded contructor for the array creation
18701         case.
18702
18703         * cs-parser.jay (array_creation_expression): Implement to call
18704         the overloaded New constructor.
18705
18706 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
18707
18708         * class.cs (TypeContainer::Constructors): Return member
18709         constructors instead of returning null.
18710
18711 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
18712
18713         * typemanager.cs (InitCoreTypes): Initialize the various core
18714         types after we have populated the type manager with the user
18715         defined types (this distinction will be important later while
18716         compiling corlib.dll)
18717
18718         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
18719         on Expression Classification.  Now all expressions have a method
18720         `Resolve' and a method `Emit'.
18721
18722         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
18723         generation from working.     Also add some temporary debugging
18724         code. 
18725
18726 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
18727
18728         * codegen.cs: Lots of code generation pieces.  This is only the
18729         beginning, will continue tomorrow with more touches of polish.  We
18730         handle the fundamentals of if, while, do, for, return.  Others are
18731         trickier and I need to start working on invocations soon.
18732
18733         * gen-treedump.cs: Bug fix, use s.Increment here instead of
18734         s.InitStatement. 
18735
18736         * codegen.cs (EmitContext): New struct, used during code
18737         emission to keep a context.   Most of the code generation will be
18738         here. 
18739
18740         * cs-parser.jay: Add embedded blocks to the list of statements of
18741         this block.  So code generation proceeds in a top down fashion.
18742
18743 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
18744
18745         * statement.cs: Add support for multiple child blocks.
18746
18747 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * codegen.cs (EmitCode): New function, will emit the code for a
18750         Block of code given a TypeContainer and its ILGenerator. 
18751
18752         * statement.cs (Block): Standard public readonly optimization.
18753         (Block::Block constructors): Link children. 
18754         (Block::Child): Child Linker.
18755         (Block::EmitVariables): Emits IL variable declarations.
18756
18757         * class.cs: Drop support for MethodGroups here, delay until
18758         Semantic Analysis.
18759         (Method::): Applied the same simplification that I did before, and
18760         move from Properties to public readonly fields.
18761         (Method::ParameterTypes): Returns the parameter types for the
18762         function, and implements a cache that will be useful later when I
18763         do error checking and the semantic analysis on the methods is
18764         performed.
18765         (Constructor::GetCallingConvention): Renamed from CallingConvetion
18766         and made a method, optional argument tells whether this is a class
18767         or a structure to apply the `has-this' bit.
18768         (Method::GetCallingConvention): Implement, returns the calling
18769         convention. 
18770         (Method::Define): Defines the type, a second pass is performed
18771         later to populate the methods.
18772
18773         (Constructor::ParameterTypes): implement a cache similar to the
18774         one on Method::ParameterTypes, useful later when we do semantic
18775         analysis. 
18776
18777         (TypeContainer::EmitMethod):  New method.  Emits methods.
18778
18779         * expression.cs: Removed MethodGroup class from here.
18780
18781         * parameter.cs (Parameters::GetCallingConvention): new method.
18782
18783 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
18784
18785         * class.cs (TypeContainer::Populate): Drop RootContext from the
18786         argument. 
18787
18788         (Constructor::CallingConvention): Returns the calling convention.
18789         (Constructor::ParameterTypes): Returns the constructor parameter
18790         types. 
18791
18792         (TypeContainer::AddConstructor): Keep track of default constructor
18793         and the default static constructor.
18794
18795         (Constructor::) Another class that starts using `public readonly'
18796         instead of properties. 
18797
18798         (Constructor::IsDefault): Whether this is a default constructor. 
18799
18800         (Field::) use readonly public fields instead of properties also.
18801
18802         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
18803         track of static constructors;  If none is used, turn on
18804         BeforeFieldInit in the TypeAttributes. 
18805
18806         * cs-parser.jay (opt_argument_list): now the return can be null
18807         for the cases where there are no arguments. 
18808
18809         (constructor_declarator): If there is no implicit `base' or
18810         `this', then invoke the default parent constructor. 
18811
18812         * modifiers.cs (MethodAttr): New static function maps a set of
18813         modifiers flags into a MethodAttributes enum
18814         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
18815         MethodAttr, TypeAttr to represent the various mappings where the
18816         modifiers are used.
18817         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
18818
18819 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
18820
18821         * parameter.cs (GetParameterInfo): Fix bug where there would be no
18822         method arguments.
18823
18824         * interface.cs (PopulateIndexer): Implemented the code generator
18825         for interface indexers.
18826
18827 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
18828
18829         * interface.cs (InterfaceMemberBase): Now we track the new status
18830         here.  
18831
18832         (PopulateProperty): Implement property population.  Woohoo!  Got
18833         Methods and Properties going today. 
18834
18835         Removed all the properties for interfaces, and replaced them with
18836         `public readonly' fields. 
18837
18838 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
18839
18840         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
18841         initialize their hashtables/arraylists only when they are needed
18842         instead of doing this always.
18843
18844         * parameter.cs: Handle refs and out parameters.
18845
18846         * cs-parser.jay: Use an ArrayList to construct the arguments
18847         instead of the ParameterCollection, and then cast that to a
18848         Parameter[] array.
18849
18850         * parameter.cs: Drop the use of ParameterCollection and use
18851         instead arrays of Parameters.
18852
18853         (GetParameterInfo): Use the Type, not the Name when resolving
18854         types. 
18855
18856 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
18859         and instead use public readonly fields.
18860
18861         * class.cs: Put back walking code for type containers.
18862
18863 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * class.cs (MakeConstant): Code to define constants.
18866
18867         * rootcontext.cs (LookupType): New function.  Used to locate types 
18868
18869
18870 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
18871
18872         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
18873         this System.Reflection code is.  Kudos to Microsoft
18874
18875         * typemanager.cs: Implement a type cache and avoid loading all
18876         types at boot time.  Wrap in LookupType the internals.  This made
18877         the compiler so much faster.  Wow.  I rule!
18878
18879         * driver.cs: Make sure we always load mscorlib first (for
18880         debugging purposes, nothing really important).
18881
18882         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
18883         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
18884
18885         * rootcontext.cs: Lookup types on their namespace;  Lookup types
18886         on namespaces that have been imported using the `using' keyword.
18887
18888         * class.cs (TypeContainer::TypeAttr): Virtualize.
18889         (Class::TypeAttr): Return attributes suitable for this bad boy.
18890         (Struct::TypeAttr): ditto.
18891         Handle nested classes.
18892         (TypeContainer::) Remove all the type visiting code, it is now
18893         replaced with the rootcontext.cs code
18894
18895         * rootcontext.cs (GetClassBases): Added support for structs. 
18896
18897 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
18898
18899         * interface.cs, statement.cs, class.cs, parameter.cs,
18900         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
18901         Drop use of TypeRefs, and use strings instead.
18902
18903 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
18904
18905         * rootcontext.cs: 
18906
18907         * class.cs (Struct::Struct): set the SEALED flags after
18908         checking the modifiers.
18909         (TypeContainer::TypeAttr): new property, returns the
18910         TypeAttributes for a class.  
18911
18912         * cs-parser.jay (type_list): Oops, list production was creating a
18913         new list of base types.
18914
18915         * rootcontext.cs (StdLib): New property.
18916         (GetInterfaceTypeByName): returns an interface by type name, and
18917         encapsulates error handling here.
18918         (GetInterfaces): simplified.
18919         (ResolveTree): Encapsulated all the tree resolution here.
18920         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
18921         types. 
18922
18923         * driver.cs: Add support for --nostdlib, to avoid loading the
18924         default assemblies.
18925         (Main): Do not put tree resolution here. 
18926
18927         * rootcontext.cs: Beginning of the class resolution.
18928
18929 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
18930
18931         * rootcontext.cs: Provide better error reporting. 
18932
18933         * cs-parser.jay (interface_base): set our $$ to be interfaces.
18934
18935         * rootcontext.cs (CreateInterface): Handle the case where there
18936         are no parent interfaces.
18937
18938         (CloseTypes): Routine to flush types at the end.
18939         (CreateInterface): Track types.
18940         (GetInterfaces): Returns an array of Types from the list of
18941         defined interfaces.
18942
18943         * typemanager.c (AddUserType): Mechanism to track user types (puts
18944         the type on the global type hash, and allows us to close it at the
18945         end). 
18946
18947 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
18948
18949         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
18950         RecordInterface instead.
18951
18952         * cs-parser.jay: Updated to reflect changes above.
18953
18954         * decl.cs (Definition): Keep track of the TypeBuilder type that
18955         represents this type here.  Not sure we will use it in the long
18956         run, but wont hurt for now.
18957
18958         * driver.cs: Smaller changes to accomodate the new code.
18959
18960         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
18961         when done. 
18962
18963         * rootcontext.cs (CreateInterface):  New method, used to create
18964         the System.TypeBuilder type for interfaces.
18965         (ResolveInterfaces): new entry point to resolve the interface
18966         hierarchy. 
18967         (CodeGen): Property, used to keep track of the code generator.
18968
18969 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
18970
18971         * cs-parser.jay: Add a second production for delegate_declaration
18972         with `VOID'.
18973
18974         (enum_body): Put an opt_comma here instead of putting it on
18975         enum_body or enum_member_declarations so we can handle trailing
18976         commas on enumeration members.  Gets rid of a shift/reduce.
18977
18978         (type_list): Need a COMMA in the middle.
18979
18980         (indexer_declaration): Tell tokenizer to recognize get/set
18981
18982         * Remove old targets.
18983
18984         * Re-add the parser target.
18985
18986 2001-07-13  Simon Cozens <simon@simon-cozens.org>
18987
18988         * cs-parser.jay: Add precendence rules for a number of operators
18989         ot reduce the number of shift/reduce conflicts in the grammar.
18990
18991 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
18992
18993         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
18994         and put it here.
18995
18996         Get rid of old crufty code.
18997
18998         * rootcontext.cs: Use this to keep track of the parsed
18999         representation and the defined types available to the program. 
19000
19001         * gen-treedump.cs: adjust for new convention.
19002
19003         * type.cs: Split out the type manager, and the assembly builder
19004         from here. 
19005
19006         * typemanager.cs: the type manager will live here now.
19007
19008         * cil-codegen.cs: And the code generator here. 
19009
19010 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19011
19012         * makefile: Fixed up for easy making.
19013
19014 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19015
19016         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19017         the 
19018
19019         (unary_expression): Expand pre_increment_expression and
19020         post_decrement_expression to reduce a shift/reduce.
19021
19022 2001-07-11  Simon Cozens
19023
19024         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19025
19026         Improve allow_keyword_as_indent name.
19027
19028 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19029
19030         * Adjustments for Beta2. 
19031
19032 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19033
19034         * decl.cs: Added `Define' abstract method.
19035         (InTransit): new property, used to catch recursive definitions. 
19036
19037         * interface.cs: Implement `Define'. 
19038
19039         * modifiers.cs: Map Modifiers.constants to
19040         System.Reflection.TypeAttribute flags.
19041
19042         * class.cs: Keep track of types and user-defined types.
19043         (BuilderInit): New method for creating an assembly
19044         (ResolveType): New function to launch the resolution process, only
19045         used by interfaces for now.
19046
19047         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19048         that are inserted into the name space. 
19049
19050 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19051
19052         * ARGH.  I have screwed up my tree so many times due to the use of
19053         rsync rather than using CVS.  Going to fix this at once. 
19054
19055         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19056         load types.
19057
19058 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19059
19060         * Experiment successful: Use System.Type rather that our own
19061         version of Type.  
19062
19063 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19064
19065         * cs-parser.jay: Removed nsAliases from here.
19066
19067         Use new namespaces, handle `using XXX;' 
19068
19069         * namespace.cs: Reimplemented namespace handling, use a recursive
19070         definition of the class.  Now we can keep track of using clauses
19071         and catch invalid using clauses.
19072
19073 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19074
19075         * gen-treedump.cs: Adapted for all the renaming.
19076
19077         * expression.cs (Expression): this class now has a Type property
19078         which returns an expression Type.
19079
19080         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19081         `Type', as this has a different meaning now in the base
19082
19083 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19084
19085         * interface.cs, class.cs: Removed from all the sources the
19086         references to signature computation, as we can not do method
19087         signature computation during the parsing time, as we are not
19088         trying to solve at that point distinguishing:
19089
19090         class X {
19091                 void a (Blah x) {}
19092                 void a (NS.Blah x) {}
19093         }
19094
19095         Which depending on the context might be valid or not, as we do not
19096         know if Blah is the same thing as NS.Blah at that point.
19097
19098         * Redid everything so the code uses TypeRefs now instead of
19099         Types.  TypeRefs are just temporary type placeholders, that need
19100         to be resolved.  They initially have a pointer to a string and the
19101         current scope in which they are used.  This is used later by the
19102         compiler to resolve the reference to an actual Type. 
19103
19104         * DeclSpace is no longer a CIR.Type, and neither are
19105         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19106         are all DeclSpaces, but no Types. 
19107
19108         * type.cs (TypeRefManager): This implements the TypeRef manager,
19109         which keeps track of all the types that need to be resolved after
19110         the parsing has finished. 
19111
19112 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19113
19114         * ARGH.  We are going to have to store `foreach' as a class rather
19115         than resolving it, as we need to verify error 1579 after name
19116         resolution.   *OR* we could keep a flag that says `This request to
19117         IEnumerator comes from a foreach statement' which we can then use
19118         to generate the error.
19119
19120 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * class.cs (TypeContainer.AddMethod): we now add methods to the
19123         MethodGroup instead of the method hashtable.  
19124
19125         * expression.cs: Add MethodGroup abstraction, which gets us one
19126         step closer to the specification in the way we handle method
19127         declarations.  
19128
19129         * cs-parser.jay (primary_expression): qualified_identifier now
19130         tried to match up an identifier to a local variable reference or
19131         to a parameter reference.
19132
19133         current_local_parameters is now a parser global variable that
19134         points to the current parameters for the block, used during name
19135         lookup.
19136
19137         (property_declaration): Now creates an implicit `value' argument to
19138         the set accessor.
19139
19140 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19141
19142         * parameter.cs: Do not use `param' arguments as part of the
19143         signature, per the spec.
19144
19145 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19146
19147         * decl.cs: Base class for classes, structs and interfaces.  This
19148         is the "Declaration Space" 
19149
19150         * cs-parser.jay: Use CheckDef for checking declaration errors
19151         instead of having one on each function.
19152
19153         * class.cs: Factor out some code for handling error handling in
19154         accordance to the "Declarations" section in the "Basic Concepts"
19155         chapter in the ECMA C# spec.
19156
19157         * interface.cs: Make all interface member classes derive from
19158         InterfaceMemberBase.
19159
19160 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19161
19162         * Many things: all interfaces are parsed and generated in
19163         gen-treedump.  Support for member variables, constructors,
19164         destructors, properties, constants is there.
19165
19166         Beginning of the IL backend, but very little done, just there for
19167         testing purposes. 
19168
19169 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19170
19171         * cs-parser.jay: Fix labeled statement.
19172
19173         * cs-tokenizer.cs (escape): Escape " and ' always.
19174         ref_line, ref_name: keep track of the line/filename as instructed
19175         by #line by the compiler.
19176         Parse #line.
19177
19178 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19179
19180         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19181         to match the values in System.CodeDOM.
19182
19183         Divid renamed to Divide.
19184
19185         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19186         statements. 
19187         (Statements.set): remove.
19188
19189         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19190         statements. 
19191
19192         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19193         falseStatements always have valid values. 
19194
19195         * cs-parser.jay: Use System.CodeDOM now.
19196