2005-03-15 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / bmcs / ChangeLog
1 2005-02-28  Martin Baulig  <martin@ximian.com>
2
3         * generic.cs (TypeManager.IsNullableType): New static method.
4         (Nullable): New abstract class.
5         (Nullable.NullLiteral): New public class.
6         (Nullable.LiftedConversion): New public class.
7
8         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
9         `builtin_types opt_nullable'.
10
11         * convert.cs
12         (Convert.ImplicitConversionStandard): Added nullable conversions.
13         (Convert.ExplicitConversionStandard): Likewise.
14         (Convert.ExplicitConversion): Likewise.
15
16 2005-02-26  Martin Baulig  <martin@ximian.com>
17
18         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
19         begin with a "?", for instance "?[]".  Don't do a type lookup if
20         `dim' is empty.
21
22 2005-02-25  Martin Baulig  <martin@ximian.com>
23
24         The first part of Nullable Types :-)
25
26         * generic.cs (NullableType): New public class.
27         (NullCoalescingOperator): New public class.
28         (TypeArguments.Resolve): Add a CS0306 check.
29
30         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
31         (opt_nullable): New rule.
32         (type): Added `opt_nullable' to `namespace_or_type_name',
33         `builtin_types' and `pointer_type'.
34         (array_type): Added `opt_nullable'.
35         (opt_rank_specifier_or_nullable): New rule; this is the
36         combination of `opt_rank_specifier' and `opt_nullable'.
37         (opt_error): New rule; catch errors here.
38         (nullable_type_or_conditional): New rule; we use this to check for
39         nullable and still detect the conditional operator.
40         (local_variable_type): Use `opt_rank_specifier_or_nullable'
41         instead `opt_rank_specifier'.
42
43         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
44         for nullables.
45
46 2005-02-24  Martin Baulig  <martin@ximian.com>
47
48         * README, README.Changes: Removed; they're old and obsolete.
49
50 2005-02-22  Martin Baulig  <martin@ximian.com>
51
52         * generic.cs (TypeParameter.Resolve): If resolving the constraints
53         returned an error, set `constraints' to null to avoid a crash
54         later on.
55         (TypeParameter.ResolveType): Likewise.
56
57 2005-02-22  Martin Baulig  <martin@ximian.com>
58
59         * generic.cs
60         (Constraints.ResolveTypes): Protect against being called twice.
61         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
62         (TypeParameter.ResolveType): New public method; calls
63         constraints.ResolveTypes().
64         (TypeParameter.DefineType): Moved constraints.ResolveType() out
65         into the new ResolveType().
66         (GenericMethod.Define): Call ResolveType() on all our
67         TypeParameter's.        
68
69 2005-02-21  Martin Baulig  <martin@ximian.com>
70
71         * generic.cs
72         (TypeManager.generic_nullable_type): New static public field.
73         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
74
75         * rootcontext.cs
76         (RootContext.ResolveCore): Resolve "System.Nullable`1".
77
78 2005-02-15  Martin Baulig  <martin@ximian.com>
79
80         * generic.cs (ConstructedType.Constraints): Correctly check
81         constraints if the argument type is a type parameter; fixes
82         #72326. 
83
84
85 2005-03-01  Jambunathan K  <kjambunathan.devel@gmail.com>
86
87         * ecore.cs (ImplicitInvocation, ImplicitNew, FloatingToFixedCast): Added
88         * expression.cs (ImplicitInvocation, ImplicitNew): Removed
89
90         * driver.cs, rootcontext.cs: Added the 'removeintchecks' and
91         'optionstrict' command line options
92
93         * convert.cs (WideningNumericConversion,
94         NarrowingNumericConversion): Updated to refelct VB.NET semantics.
95
96 2005-03-01  Jambunathan K  <kjambunathan.devel@gmail.com>
97
98         * convert.cs: Added the following conversion routines:
99         BooleanConversions, WideningStringConversions,
100         NarrowingStringConversions.
101
102         * ecore.cs: Added following helper classes: BooleanToNumericCast,
103         NumericToBooleanCast
104         
105         * typemanager.cs: Added System.DateTime to the cached types.
106
107 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
108
109         * ecore.cs (StringToExpression):
110         * expression.cs (ImplicitInvocation, ImplicitNew): VB.NET specific
111         helper classes and methods.
112
113 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
114
115         * assign.cs, attribute.cs, cfold.cs, const.cs, constant.cs,
116         * convert.cs, ecore.cs, enum.cs, expression.cs, generic.cs,
117         * iterator.cs, statement.cs : Broadly, what C# spec terms as
118         "Implicit" & "Explicit", VB.NET spec terms as "Widening" &
119         "Narrowing" respectively. So renamed exisiting methods to reflect
120         the VB.NET nomenclature. These are just first renamings.
121         
122 2005-02-28  Jambunathan K  <kjambunathan.devel@gmail.com>
123
124         * convert.cs :
125         * expression.cs :       
126         * statement.cs: VB.NET has no notion of User defined
127         conversions. Assuming that UserDefinedConversion() returns null,
128         propagated the resulting changes upstream. 
129
130 2005-02-02  Martin Baulig  <martin@ximian.com>
131
132         * delegate.cs (Delegate.DefineType): Report an internal error if
133         TypeManager.multicast_delegate_type is null.  See bug #72015 for
134         details.        
135
136 2005-01-29  Miguel de Icaza  <miguel@novell.com>
137
138         * pending.cs: Produce better code (no nops produced by using Ldarg
139         + value).
140         
141         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
142         i - 1' it should be arg + 1.
143
144         Fixes bug #71819.
145         
146 2005-01-26  Martin Baulig  <martin@ximian.com>
147
148         * cs-parser.jay (indexer_declarator): Don't report an error if we
149         have type parameters since we can be an explicit interface
150         implementation; fixes #71449.
151
152 2005-01-26  Martin Baulig  <martin@ximian.com>
153
154         * class.cs (TypeContainer.AttributeTargets): Return the correct
155         AttributeTargets depending on our `Kind' instead of throwing an
156         exception; fixes #71632.
157
158 2005-01-26  Martin Baulig  <martin@ximian.com>
159
160         * delegate.cs (Delegate.DefineType): Correctly define our type
161         parameters.  Fixes #71483.
162
163 2005-01-25  Raja R Harinath  <rharinath@novell.com>
164
165         Fix #71602.
166         * expression.cs (MemberAccess.DoResolve): Don't complain with
167         cs0572 when the LHS of a member access has identical name and type
168         name.
169
170 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
171
172         Fix #71651, #71675
173         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
174         CreatePermission.
175         Create custom PermissionSet only for PermissionSetAttribute.
176
177 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
178
179         Fix #71649
180         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
181         delegates in static class.
182
183 2005-01-24  Martin Baulig  <martin@ximian.com>
184
185         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
186         merging an implicit block, just use its reachability.
187
188         * statement.cs (Block.Resolve): Make the unreachable code check
189         work wrt. implicit blocks; see test-337 from #63842.
190
191 2005-01-21  Alp Toker  <alp@atoker.com>
192  
193         * cs-parser.jay: destructor_declaration's container is PartialContainer
194         not Class when partial types are used, so use Kind prop instead of
195         'is'.
196         
197 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
198
199         * cs-parser.jay: Improve error reporting when an interface
200         declares new types.
201
202 2005-01-20  Dick Porter  <dick@ximian.com>
203
204         * support.cs: SeekableStreamReader fix from Sandor Dobos
205         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
206         chars are read.  Fixes bug 70369.
207
208 2005-01-20  Raja R Harinath  <rharinath@novell.com>
209
210         * cs-parser.jay (catch_clause): Simplify current_block handling
211         somewhat.
212
213 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
214
215         * convert.cs (ImplicitStandardConversionExists): Synchronize the
216         code with ImplicitStandardConversion to handle the implicit
217         conversion of method groups into valid delegate invocations. 
218
219         The problem is that in parameter handling we were using this code
220         path.  Fixes bug #64698
221
222 2005-01-19  Raja R Harinath  <rharinath@novell.com>
223
224         * cs-parser.jay: Fix several infelicities.
225         - Avoid assigning to the parser value stack.  Code like 
226           '$3 = null' is unclean.  Synthesize a value for the code block
227           instead. 
228         - Avoid using oob_stack for storing location information.  Use ...
229         (_mark_): ... this.  New (empty) rule.  Saves the current location
230         in $$.
231         (foreach_statement): Avoid using oob_stack for current_block
232         handling.  Use technique used in for_statement and
233         using_statement.  Synthesize a value for the code block to store
234         additional intermediate information.
235
236 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
237
238         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
239         of a different type is only allowed to private fields of a
240         containing type, not on fields of a base class.
241
242         See test-174.cs and error cs0122-9.cs
243
244 2005-01-13  Raja R Harinath  <rharinath@novell.com>
245
246         Fix test-335.cs (bug #58126).
247         * cs-parser.jay (argument): Split out non-expression parts of the
248         rule into 'non_simple_argument'.
249         (invocation_expression): Support parenthesized invocations with
250         multiple arguments, and with single non-simple arguments.
251
252 2005-01-13  Raja R Harinath  <rharinath@novell.com>
253
254         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
255         places.
256
257 2005-01-12  Raja R Harinath  <rharinath@novell.com>
258
259         Fix cs0038-1.cs, cs1640-6.cs.
260         * ecore.cs (Expression.Resolve): Remove special-case for
261         SimpleName in error-handling.
262         (Expression.almostMatchedMembers): Relax access permission to
263         protected.
264         (Expression.MemberLookupFailed): Handle duplicates in
265         almostMatchedMembers list.
266         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
267         * expression.cs (New.DoResolve): Report CS1540 for more cases.
268         * typemanager.cs (GetFullNameSignature): Use the MethodBase
269         overload if the passed in MemberInfo is a MethodBase.
270
271 2005-01-25  Martin Baulig  <martin@ximian.com>
272
273         * doc.cs
274         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
275
276 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
277
278         Fix #70749
279         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
280         for non-CAS & merge permission sets properly.
281
282 2005-01-11  Raja R Harinath  <rharinath@novell.com>
283
284         Improve standard-compliance of simple name and member access 
285         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
286         * ecore.cs (FullNamedExpression): New abstract base class 
287         for Namespaces and TypeExpressions.
288         (ResolveFlags.SimpleName): Remove.
289         (SimpleName): Remove support for dotted names.
290         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
291         DeclSpace.FindType and DeclSpace.LookupType.
292         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
293         (Expression.ExprClassName): Make member function.
294         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
295         a namespace.  Remove creation of dotted "SimpleName"s.
296         (MemberAccess.DoResolve): Likewise.
297         * decl.cs (DeclSpace.Cache): Make private.
298         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
299         (DeclSpace.FindType): Update.
300         (DeclSpace.LookupType): Move here from RootContext.  Return a 
301         FullNamedExpression.
302         * namespace.cs (Namespace): Derive from FullNamedExpression
303         so that it can be part of expression resolution.
304         (Namespace.Lookup): Return an FullNamedExpression.
305         (NamespaceEntry.LookupAlias): Lookup aliases only in current
306         namespace.
307         * rootcontext.cs (NamespaceLookup): Remove.
308         (LookupType): Move to DeclSpace.
309         * attribute.cs (CheckAttributeType): Update.
310         * doc.cs (FindDocumentedType): Remove allowAlias argument.
311         (FindDocumentedTypeNonArray): Likewise.
312
313 2005-01-11  Raja R Harinath  <rharinath@novell.com>
314
315         Fix cs0509.cs, cs1632.cs.
316         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
317         is the same as IsInterface.
318         (TypeContainer.GetClassBases): Likewise.
319         * statement.cs (LabeledStatement.ig): New field.
320         (LabeledStatement.LabelTarget): Save ILGenerator which created the
321         label.
322         (LabeledStatement.DoEmit): Check that the label was created with
323         the same ILGenerator.
324
325 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
326
327         Fix #71058
328         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
329         accessors to its properties.
330
331         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
332         from accessors to property.
333         
334 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
335
336         Fix #70722
337         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
338         only for overrides.
339         
340 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
341
342         * attribute.cs: Check for null and empty strings.  
343
344         I have lost another battle to Paolo.
345
346 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
347
348         Fix #70942
349         * class.cs (PropertyMethod): Set Parent field in ctors.
350         (SetMethod.InternalParameters): Add unsafe switch hack.
351         Override MarkForDuplicationCheck where it is appropriate.
352
353         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
354         It says whether container allows members with the same name.
355         Base default is no.
356         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
357         Removed is_method parameter.
358
359 2005-01-06  Duncan Mak  <duncan@ximian.com>
360
361         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
362         because the previous change led to incorrect reporting of CS1032
363         ("Cannot define/undefine preprocessor symbols after first token in
364         file"). Instead of using `tokens_seen' as the only flag that
365         triggers CS1040, introduce `comments_seen'. This new flag is used
366         to signify having seen comments on the current line, so it is
367         unset after a newline.
368
369 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
370
371         * doc.cs : When searching for a type, find nested type too.
372           This fixes bug #71040.
373
374 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
375
376         * doc.cs :
377           - Warn missing member comment on those classes which also does not
378             have doc comments. Fixed bug #71041.
379           - Don't warn missing doc comment on default constructor.
380             Fixed bug #71042.
381
382 2005-01-06  Duncan Mak  <duncan@ximian.com>
383
384         * cs-tokenizer.cs (xtoken): After handling traditional C-style
385         comments, set `tokens_seen' to true. This allows us to detect
386         misplaced preprocessor directives (i.e. not at the beginning of
387         the a line, nor after whitespaces). In that case, report error
388         CS1040. This fixes bug #56460.
389
390         * cs-parser.jay (interface_member_declaration): Add checks for
391         IsExplicitImpl, and report CS0541 error if an interface member is
392         defined as an explicit interface declaration.
393
394 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
395
396         Fix #70817
397         * class.cs (PropertyMethod): Set Parent field in ctors.
398         (SetMethod.InternalParameters): Add unsafe switch hack.
399         
400         * decl.cs (MemberCore.Parent): Cannot be readonly.
401
402 2005-01-06  Raja R Harinath  <rharinath@novell.com>
403
404         * decl.cs (DeclSpace.ResolveType): Remove.
405         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
406         Merge in code from ...
407         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
408         * class.cs, enum.cs: Update to changes.
409
410 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
411
412         * anonymous.cs: Ensure that we init the scope of our parent if it
413         has not been initialized yet.
414
415 2004-12-30  Duncan Mak  <duncan@ximian.com>
416
417         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
418         if field.FieldBuilder is null. Fixes #70758.
419
420         * convert.cs: Fixed some typos and updated some of the comments.
421         (ImplicitStandardConversionExists):
422         (TryImplicitIntConversion): If `target_type' is an interface and
423         the type of `ic' implements this interface, return true or a new
424         BoxedCast instead of null. This fixes #70468.
425
426 2004-12-29  Duncan Mak  <duncan@ximian.com>
427
428         * expression.cs (Argument.Emit): Check that Expr is
429         IMemoryLocation before casting to it, and report CS1510 otherwise.
430
431         This fixes #70402.
432
433 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
434
435         * statement.cs (Block.ThisVariable): remove the recursion here, to
436         make the --profile more sane.
437
438 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
439
440         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
441         assembly, by JB Evain.
442
443 2004-12-17  Raja R Harinath  <rharinath@novell.com>
444
445         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
446           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
447         "parent" refers to enclosing type/class.  "base" refers to superclass.
448
449 2004-12-17  Raja R Harinath  <rharinath@novell.com>
450
451         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
452         Ensure that we only have GlobalAttributes.
453         * attribute.cs (Attribute.Emit): Make non-virtual.
454         (GlobalAttribute.Emit): Remove.
455         (Attribute.Resolve): Make virtual.
456         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
457         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
458         the argument. Don't create one.
459         (Attribute.GetObsoleteAttribute): Likewise.
460         (Attribute.GetClsCompliantAttributeValue): Likewise.
461         * class.cs, decl.cs: Update to changes.
462
463 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
464
465         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
466         
467         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
468         
469         * statement.cs (Foreach.Resolve): Add error 186 report.
470
471 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
472
473         * expression.cs (Conditional.DoResolve): Add warning 429.
474         
475         * statement.cs (If.Resolve): Add warning 665.
476
477 2004-12-16  Raja R Harinath  <rharinath@novell.com>
478
479         New invariant: RootContext.Tree.Types.NamespaceEntry == null
480         except when in the parser, and in GlobalAttribute.
481         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
482         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
483         RootContext.Tree.Types.NamespaceEntry once work is done.
484         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
485         and resets RootContext.Tree.Types.NamespaceEntry.
486
487 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
488
489         * cs-parser.jay: Don't create a block for every variable.
490
491 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
492
493         * location.cs: Provide extra information.
494
495         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
496         variables from the captured environment, it is the ldarg_0.
497
498 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
499
500         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
501         find a conclusion.
502         
503         * class.cs: Changed warning level for 169 to avoid developer
504         displeasure from warning flooding. It will be changed back when they
505         fix most of current BCL warnings.
506         
507         * RootContext.cs: Pushed default WarningLevel to 3.
508         
509         * statement.cs: Removed unused variable.
510
511 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
512
513         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
514         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
515         Add error 502 report.
516         (StaticClass.DefineType): Add error 441 report.
517         (Class.AllowedModifiersProp): New virtual property as temporary
518         extension to AllowedModifiers.
519         (Class.DefineType): Add error 418 report. Moved ModFlags check here
520         to share implementation with StaticClass and don't call virtual
521         methods from ctor.
522         
523         * driver.cs (MainDriver): Add error 1558 test.
524
525         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
526         report. Moved error 36 test here.
527
528         * statement.cs (Throw.Resolve): Add error 724 report.
529
530         * typemanager.cs: Add out_attribute_type core type.
531         
532 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
533
534         * class.cs (TypeContainer.VerifyClsCompliance): Add error
535         3018 report.
536         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
537
538         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
539         3017 report.
540         
541         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
542
543         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
544         Add error 3023 report.
545         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
546
547         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
548         implementation.
549
550 2004-12-12  John Luke  <john.luke@gmail.com>
551
552         * driver.cs (AddArgs): take -- into account when
553         adding arguments, fixes bug 65710 
554
555 2004-12-12  Martin Baulig  <martin@ximian.com>
556
557         * expression.cs (Unary.TryReduceNegative): Added support for
558         SByteConstant and ByteConstant.
559         (Unary.Reduce): Check error values from TryReduceNegative().
560
561 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
562
563         * attributes.cs (Attribute.Resolve): Avoid multiple error report
564         and report exception as error 182.
565
566 2004-12-10  Raja R Harinath  <rharinath@novell.com>
567
568         * driver.cs (Main): Fix message when there are warnings.
569
570 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
571
572         * delegate.cs: Fixed my fix from yesterday, sorry about that.
573
574 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
575
576         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
577         Reduced number of warnings.
578         
579         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
580
581 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
582
583         * driver.cs: Removed message.
584
585         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
586
587 2004-12-08    <vargaz@freemail.hu>
588
589         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
590
591 2004-12-08  Martin Baulig  <martin@ximian.com>
592
593         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
594         instead of a CS3002 for properties and indexer.
595
596 2004-12-08  Martin Baulig  <martin@ximian.com>
597
598         * decl.cs (MemberName.ToString): Make this work again.
599
600 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
601
602         * attribute.cs (Resolve): Add error 591 detection.
603
604         * class.cs (FieldMember.Define): Add error 1547 detection.
605         (Indexer.Define): Add error 620 detection.
606         (Operator.Define): Add error 590 detection.
607
608         * ecore.cs: Missing argument for error 79.
609
610         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
611         detection.
612
613 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
614
615         Fix #70106
616         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
617         only.
618
619 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
620
621         * cs-parser.jay : handle doc comments on implicit/explicit operators.
622           Some operator comments were suppressed.
623         * doc.cs : Implicit/explicit operator name in doc comments are like
624           "op_Explicit(type)~returnType", so added suffix handling.
625
626 2005-01-21  Alp Toker  <alp@atoker.com>
627
628         * cs-parser.jay: destructor_declaration's container is PartialContainer
629         not Class when partial types are used, so use Kind prop instead of 'is'.
630
631 2004-12-12  Martin Baulig  <martin@ximian.com>
632
633         * expression.cs (Unary.TryReduceNegative): Added support for
634         SByteConstant and ByteConstant.
635         (Unary.Reduce): Check error values from TryReduceNegative().
636
637 2004-12-11  Martin Baulig  <martin@ximian.com>
638
639         * support.cs (ReflectionParameters.ParameterName): If we have a
640         `gpd', call `ParameterName' on it.
641
642         * parameter.cs (Parameter.GetParameterAttributes): New static method.
643
644         * pending.cs (PendingImplementation.DefineProxy): Call
645         DefineParameter() for all of the MethodBuilder's arguments.
646
647 2004-12-09  Martin Baulig  <martin@ximian.com>
648
649         * doc.cs (DocUtil): Make this a static class.
650
651 2004-12-09  Martin Baulig  <martin@ximian.com>
652
653         * expression.cs (Invocation.InferType): Moved the type inference
654         implementation into TypeManager.
655
656         * generics.cs (TypeManager): Moved the type inference
657         implementation here.
658
659 2004-12-09  Martin Baulig  <martin@ximian.com>
660
661         * typemanager.cs (TypeManager): Make this a partial class.
662
663         * generics.cs
664         (TypeManager): Move the generics part of `TypeManager' here.
665
666 2004-12-08  Martin Baulig  <martin@ximian.com>
667
668         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
669         instead of a CS3002 for properties and indexer.  Added CS3024
670         check for generic interfaces.
671
672         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
673         instances are not CLS-compliant.
674
675 2004-12-08  Martin Baulig  <martin@ximian.com>
676
677         * cs-parser.jay
678         (void_pointer_expression): New rule for `void*', `void**' etc.
679         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
680
681 2004-12-08  Martin Baulig  <martin@ximian.com>
682
683         * expression.cs (Invocation.InferType): Removed the hack for
684         MethodCore.MayUnify().  
685
686         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
687         this actually work.
688
689         * class.cs (MethodCore.MayUnify): Use
690         TypeManager.MayBecomeEqualGenericTypes().       
691
692 2004-12-08  Martin Baulig  <martin@ximian.com>
693
694         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
695         parameter, box it.  Fixes #69233.
696
697 2004-12-08  Martin Baulig  <martin@ximian.com>
698
699         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
700         have the ctor constraint.  Fixes #68326.
701
702 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
703
704         * cs-parser.jay : interface comment was not consumed because of
705           extra opt_semicolon before doc handling.
706
707 2004-12-03  Raja R Harinath  <rharinath@novell.com>
708
709         Fix test-327.cs, test-328.cs, and put in early infrastructure
710         for eventually fixing #52697.
711         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
712         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
713         from other methods.
714         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
715         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
716         (VerifyUsing, error246): Update.
717         * rootcontext.cs (RootContext.NamespaceLookup): Just use
718         'NamespaceEntry.LookupNamespaceOrType'.
719
720 2004-12-07  Martin Baulig  <martin@ximian.com>
721
722         * driver.cs: Call it "BETA SOFTWARE" :-)
723
724 2004-12-06  Raja R Harinath  <rharinath@novell.com>
725
726         Fix crash on cs0657-17.cs.
727         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
728         Use RootContext.Tree.Types, not 'new RootTypes ()'.
729         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
730         the case where the NamespaceEntry gets overwritten.
731
732 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
733
734         Fixed #69195, #56821
735         * ecore.cs (ResolveBoolean): Tiny refactoring.
736
737         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
738         of right expression resolving when left is false constant and
739         operator is LogicalAnd OR true constant and operator is LogicalOr.
740
741         * statement.cs (ResolveUnreachable): Always reports warning.
742
743 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
744
745         * class.cs: Distinguish between 1721 and 1722 (just a little help
746         for the programmer).
747
748 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
749
750         * delegate.cs: Only allow this on new versions of the language. 
751
752 2004-12-02  Duncan Mak  <duncan@ximian.com>
753
754         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
755         Expression class.
756         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
757         here as a static method. Take an additional bool out parameter
758         `must_do_cs1540_check' for signaling to InstanceResolve.
759         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
760         member field from PropertyExpr class and made it an argument of
761         the method instead.
762         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
763         check for MarshalByRefObject, and report CS0122 instead of CS1540.
764         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
765         and `remove_accessor' as well as InstanceResolve: report CS0122
766         where applicable.
767
768         Fixes #70129.
769
770 2004-12-07  Martin Baulig  <martin@ximian.com>
771
772         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
773         and CS0692 where appropriate.
774
775 2004-12-06  Martin Baulig  <martin@ximian.com>
776
777         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
778         IsDuplicateImplementation() and improved it.
779
780         * expression.cs (Invocation.InferTypeArguments): Added
781         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
782         and removed the "ref" modifier from `infered_types'.
783
784         * decl.cs (MemberName.ToString): Removed the exception.
785
786 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
787
788         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
789           comments are allowed.
790
791 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
792
793         * delegate.cs: Add checks for subtypes in paramaters and return values
794         in VerifyMethod () to add support for Covariance/Contravariance
795         in delegates.
796         
797 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
798
799         * report.cs: Remove extra closing parenthesis.
800
801         * convert.cs (Error_CannotImplicitConversion): If the name of the
802         types are the same, provide some extra information.
803
804 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
805
806         Fix bug #70102
807         * attribute.cs (Resolve): Improved implementation of params
808         attribute arguments.
809
810         * support.cs (ParameterData): Add HasParams to be faster.
811
812 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
813
814         all things are for /doc support:
815
816         * doc.cs: new file that supports XML documentation generation.
817         * mcs.exe.sources: added doc.cs.
818         * driver.cs:
819           Handle /doc command line option.
820           Report error 2006 instead of 5 for missing file name for /doc.
821           Generate XML documentation when required, after type resolution.
822         * cs-tokenizer.cs:
823           Added support for picking up documentation (/// and /** ... */),
824           including a new XmlCommentState enumeration.
825         * cs-parser.jay:
826           Added lines to fill Documentation element for field, constant,
827           property, indexer, method, constructor, destructor, operator, event
828           and class, struct, interface, delegate, enum.
829           Added lines to warn incorrect comment.
830         * rootcontext.cs :
831           Added Documentation field (passed only when /doc was specified).
832         * decl.cs:
833           Added DocComment, DocCommentHeader, GenerateDocComment() and
834           OnGenerateDocComment() and some supporting private members for
835           /doc feature to MemberCore.
836         * class.cs:
837           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
838         * delegate.cs:
839           Added overriden DocCommentHeader.
840         * enum.cs:
841           Added overriden DocCommentHeader and GenerateDocComment().
842
843 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
844
845         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
846         unwrapping the enumeration values, chain to
847         DoConstantNumericPromotions again, so we can promote things to the
848         fundamental types (takes care of enums that are bytes, sbytes).
849
850         Fixes bug #62054.
851
852 2004-12-01  Raja R Harinath  <rharinath@novell.com>
853
854         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
855         Fix long-standing bug in type-lookup.  Use FindType instead of
856         LookupType when ec.ResolvingTypeTree.
857         (Attribute.ResolveType, Attribute.Resolve)
858         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
859         Update to changes.
860         (Attributes.Search): Remove internal version.  Update.
861         (Attributes.SearchMulti): Update.
862         (Attributes.GetClsCompliantAttribute): Remove.
863         (Attributes.GetIndexerNameAttribute): Remove.
864         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
865         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
866         * class.cs (Indexer.Define): Likewise.
867
868 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
869
870         Fix bug #68790
871         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
872         MarshallByReference members access.
873
874         * expression.cs: Use CheckMarshallByRefAccess;
875         Better error CS0197 message.
876
877         * report.cs: Print whole related error message.
878
879 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
880
881         * class (GetClassBases): Better error 60 report.
882         (EventProperty): Disabled warning 67 detection.
883
884 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
885
886         Fix bug #60324
887         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
888
889         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
890         precise values.
891
892 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
893
894         Fix bug #49488
895         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
896
897         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
898
899 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
900
901         * attribute.cs (Attribute.Resolve): Refine error reporting and
902         report a cs0117 if the identifier does not exist, to distinguish
903         from 0617 which is a miss-use of the actual identifier.
904
905         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
906         between cs0070 and cs0079.
907
908         * class.cs (MemberBase.DoDefine): When reporting a wrong
909         accessibility level, we use MethodCore to compare instead of
910         Method (this was a regression in some refactoring effort).
911
912         So now we correctly report cs0056 again.
913
914         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
915         testing the target_type (which was known to be object_type) and
916         not the source type (which is anonymous_method).
917
918         Fixed reporting of error cs1660.
919
920         * expression.cs (UserCast.Source): Expose the underlying cast.
921
922         * statement.cs (Switch.SwitchGoverningType): Sort the list of
923         allowed types to find a match to int32 first (most common).
924
925         In addition, it ignores any ImplicitUserConversions that did an
926         internal implicit conversion (as the switch statement allows only
927         one integral conversion to exist).
928
929         * class.cs (PartialContainer.Create): rename `name' to
930         `member_name' for clarity.  Then replace the string calls with a
931         call to MemberName.GetPartialName, as now using
932         MemberName.ToString is an error (this is due to the side effects
933         it had, that were fixed in the past).
934
935         This will restore the error reporting on a number of partial class
936         errors that were missusing this (and getting an exception as a
937         results, which is now just a plain textual warning, because
938         yyparse debug output would crash otherwise).
939
940 2004-11-26  Raja R Harinath  <rharinath@novell.com>
941
942         * Makefile (PROGRAM_INSTALL_DIR): Remove.
943
944 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
945
946         * rootcontext.cs (LookupType): Make sure to cache lookups that
947         don't give us a negative result. This saves about 5% of corlib
948         compilation time.
949
950 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
951
952         * report.cs (AbstractMessage.Print): messages are sent to stderr
953
954         * class.cs (TypeContainer.GetClassBases): It is an error to have a
955         non-interface in the list of interfaces (at this point, either
956         parent was properly set, or a base class is being listed in the
957         interfaces section).
958
959         This flags error 1722, and resolves the crash from bug 69259.
960
961 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
962
963         * statement.cs (Using.EmitExpressionFinally): make this work right
964         for valuetypes. Fixes 69926.
965
966 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
967
968         * const.cs (Const.ChangeType): Cope with the "0 literal can be
969         converted to an enum" here, before we try to change the underlying
970         type.  This code exists, but it is a different code path than the
971         one used while encoding constants.
972
973         (ImplicitReferenceConversionExists): In addition, resynchronized
974         the code here, so it matches the same code in
975         ImplicitReferenceConversionExists for the `from any class-type S
976         to any interface-type T'.       
977
978 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
979
980         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
981
982 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
983
984         * cs-parser.jay: Use verbosity accordingly. 
985
986 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
987
988         * expression.cs (Unary.ResolveOperator): Do not report warning;
989         AddressOf reads from variable.
990         
991         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
992
993 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
994
995         Fix bug #69462
996
997         * attribute.cs (Attributable): Removed CheckTargets.
998         (Attributes.Emit): Explicit attribute targets are tested here.
999
1000         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1001         not enabled for interfaces.
1002
1003         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1004         (GetAssemblyName): Ouch next bug there.
1005
1006 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1007
1008         * expression.cs: Error 275 added.
1009         
1010 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1011
1012         Fix bug #69177 (Implemented decimal constant support)
1013
1014         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1015         (BinaryFold): Add DecimalConstant.
1016
1017         * const.cs (Define): Decimal constant 
1018         (is not constant.
1019         (ChangeType): Add decimal type handling.
1020         (LookupConstantValue): Don't set value for decimal type but
1021         emit DecimalConstantAttribute. Needed for constant optimization.
1022
1023         * constant.cs (ToDecimal): New method.
1024         (ConvertToDecimal): New method.
1025         (IntConstant): Implemented ConvertToDecimal.
1026         (DecimalConstant.Emit): Emit optimized version for decimals in
1027         int range.
1028
1029         * expression.cs (ResolveOperator): Changed order of constant
1030         reduction to work correctly with native types which have
1031         overloaded operators.
1032         (ResolveMemberAccess): Extract constant value from attribute
1033         for decimal type.
1034
1035         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1036
1037         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1038         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1039         (ChangeType): Decimal is special.
1040         (TypeToCoreType): Add decimal type.
1041
1042 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1043
1044         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1045         decimal types.
1046
1047 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1048
1049         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1050         test cs1667-5.cs.
1051
1052 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1053
1054         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1055
1056         * pending.cs (PendingImplementation): Grab only interfaces.
1057
1058 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1059
1060         * statement.cs (ForeachHelperMethods): Add location member and
1061         error 202 detection.
1062
1063 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1064
1065         * expression.cs (DoResolveBase): Fixed wrong warning for out
1066         variables.
1067
1068 2004-12-04  Martin Baulig  <martin@ximian.com>
1069
1070         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1071         to check whether the conversion is ok.
1072
1073         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1074         `Type.EmptyTypes' if we're not a generic TypeContainer.
1075
1076 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1077
1078         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1079         old bug: when converting from the null literal to a pointer,
1080         return an EmptyCast, not the NullLiteral.
1081
1082         This fixes #69921, the recent null_type changes probably made this
1083         bug more prominent.
1084
1085 2004-12-03  Martin Baulig  <martin@ximian.com>
1086
1087         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1088         method as our child, call AnonymousMethod.Compatible() on it.
1089
1090 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1091
1092         * class.cs (FieldBase): Use an unused bit field from the field to
1093         encode the `has_offset' property from the FieldMember.  This saves
1094         a couple of Ks on bootstrap compilation.
1095
1096         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1097         method as our child, return the AnonymousMethod resolved
1098         expression.
1099
1100         * expression.cs (New.DoResolve): Allow return values from
1101         NewDelegate to also include AnonymousMethods.
1102
1103         Fixes #70150.
1104
1105 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1106
1107         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1108         cs1648 report.
1109         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1110         System.Runtime.InteropServices._Exception, since it's a base
1111         interface of the core type System.Exception in the net_2_0 profile.
1112
1113 2004-11-27  Martin Baulig  <martin@ximian.com>
1114
1115         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1116
1117 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1118
1119         * Makefile: Convert to use executable.make.
1120         * gmcs.exe.sources: New.
1121
1122 2004-11-25  Martin Baulig  <martin@ximian.com>
1123
1124         * expression.cs (Invocation.InferType): Added support for byref types.
1125
1126 2004-11-25  Martin Baulig  <martin@ximian.com>
1127
1128         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1129         in TypeManager.TypeToCoreType().
1130
1131 2004-11-25  Martin Baulig  <martin@ximian.com>
1132
1133         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1134         "Dispose" method from the `current_type'.
1135         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1136         DoDefineMembers() instead of using the MethodBuilder; this is
1137         required for generic iterators.
1138
1139         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1140
1141 2004-11-24  Martin Baulig  <martin@ximian.com>
1142
1143         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1144
1145 2004-11-20  Martin Baulig  <martin@ximian.com>
1146
1147         * expression.cs (Invocation.InferType): Correctly infer generic
1148         instances; see gen-103.cs.
1149         (Invocation.InferTypeArguments): If a generic method doesn't have
1150         any unbound type parameters, we don't need to infer anything.
1151
1152 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1153
1154         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1155
1156 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1157
1158         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1159         (TypeHandle.GetMemberCache): New.
1160         (TypeHandle.TypeHandle): Update.
1161         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1162         (TypeManager.LookupParentInterfacesCache):
1163         Rename from LookupInterfaceCache.  Optimize slightly.
1164         (TypeManager.MemberLookup_FindMembers): Update.
1165         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1166         multi-type variant.
1167         (AddCacheContents): Rename from AddHashtable.
1168         * class.cs (TypeContainer.parent_container): Remove.
1169         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1170         (TypeContainer.DoDefineMembers): Don't initialize it.
1171         Update to name changes.
1172         
1173 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1174
1175         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1176         that factors the code to check access modifiers on override.  
1177
1178         (PropertyBase): Use the code here.
1179
1180         Patch from Lluis S'anchez, fixes bug #69361.
1181
1182 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1183
1184         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1185         routine that is used to report the use of a captured variable
1186         whose address has been taken.
1187
1188         There are two checks: one when variables are being captured and
1189         the other check is when the address of a variable is taken. 
1190         
1191         (because an anonymous methods might be resolved before *or* after
1192         the address has been taken) and 
1193
1194         * expression.cs (Conditional.DoResolve): Remove the special
1195         casing that Martin added to trueExpr and falseExpr being both
1196         NullLiteral.  We get the right behavior now just by introducing
1197         the null_type into the compiler. 
1198
1199         * convert.cs (ExplicitConversion): Change the code to use
1200         null_type instead of testing `expr is NullLiteral'.
1201         (ImplicitConversionStandard): use null_type too.
1202         (ImplicitReferenceConversionExists): use null_type too.
1203         (ImplicitReferenceConversion): use null_type too.
1204
1205         * literal.cs: The type of `NullLiteral' is now null_type instead
1206         of object_type. 
1207         (Resolve): Set the type here.
1208
1209         * typemanager.cs: Introduce null_type.
1210
1211 2004-11-18  Martin Baulig  <martin@ximian.com>
1212
1213         * rootcontext.cs
1214         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1215
1216 2004-11-18  Martin Baulig  <martin@ximian.com>
1217
1218         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1219
1220 2004-11-18  Martin Baulig  <martin@ximian.com>
1221
1222         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1223         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1224         call ResolveConstructedType() on it to resolve it without checking
1225         constraints.
1226         (Constraints.ResolveTypes): Check them here.
1227         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1228         but don't check constraints.
1229         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1230         check constraints here.
1231         (ConstructedType.ResolveConstructedType): New public method.  This
1232         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1233         resolve ourselves without checking constraints.
1234
1235         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1236
1237 2004-11-18  Martin Baulig  <martin@ximian.com>
1238
1239         * decl.cs
1240         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1241
1242         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1243
1244 2004-11-18  Martin Baulig  <martin@ximian.com>
1245
1246         * ecore.cs (TypeExpr.ResolveType): Removed.
1247         (Expression.ResolveAsTypeTerminal): We always return a fully
1248         resolved `TypeExpr', so we can just access its `Type'.
1249
1250         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1251
1252 2004-11-17  Martin Baulig  <martin@ximian.com>
1253
1254         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1255         sure we don't return any unresolved TypeExpr's.
1256         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1257         a `TypeExpr'.
1258         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1259
1260         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1261         unresolved `ConstructedType's.
1262
1263 2004-11-17  Martin Baulig  <martin@ximian.com>
1264
1265         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1266
1267 2004-11-17  Martin Baulig  <martin@ximian.com>
1268
1269         * ecore.cs
1270         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1271
1272         * decl.cs (DeclSpace.ResolveType): Removed.
1273         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1274
1275 2004-11-17  Martin Baulig  <martin@ximian.com>
1276
1277         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1278         direction, like FindMembers() does.  Fixes #69546, testcase is in
1279         test-315.cs.    
1280
1281 2004-11-16  Martin Baulig  <martin@ximian.com>
1282
1283         This is based on a patch from Marek Safar, see bug #69082.
1284         Fixes bugs #63705 and #67130.
1285
1286         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1287         method; create a MemberCache for an interface type and cache the
1288         result.
1289
1290         * decl.cs (IMemberContainer.ParentContainer): Removed.
1291         (IMemberContainer.ParentCache): New property.
1292         (MemberCache.SetupCacheForInterface): Removed.
1293         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1294         to create a cache for an interface's "parent".
1295
1296         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1297         interfaces too.
1298
1299 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1300
1301         * statement.cs: Avoid adding bools to a hashtable.
1302
1303 2004-11-15  Martin Baulig  <martin@ximian.com>
1304
1305         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1306
1307 2004-11-11  Martin Baulig  <martin@ximian.com>
1308
1309         * typemanager.cs (TypeManager.GetMethodName): New method.
1310
1311         * class.cs (MethodData.Define): Include the generic arity in the
1312         name of an explicit interface; also add it to the method name.
1313
1314         * pending.cs (PendingImplementation.InterfaceMethod): The method
1315         name now includes the generic arity.
1316
1317 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1318
1319         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1320         calling an unsafe method from a safe location.
1321
1322 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1323
1324         Fix #69167
1325         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1326
1327 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1328
1329         * namespace.cs (VerifyUsing): use GetPartialName instead of
1330         ToString. 
1331
1332 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1333
1334         * statement.cs (Return.Resolve): Fix regression in typo: if
1335         `in_exc', we have to request a NeedReturnLabel, this was a typo
1336         introduced in the anonymous method check-in.  Fixes #69131.
1337
1338         * Indexers were using the ShortName when defining themselves,
1339         causing a regression in the compiler bootstrap when applying the
1340         patch from 2004-11-02 (first part), now they use their full name
1341         and the bug is gone.
1342
1343 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1344
1345         * driver.cs: Strip the path from the names of embedded resources. Fixes
1346         #68519.
1347
1348 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1349
1350         Fix error message regression: cs0104-2.cs.
1351         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1352         (AliasEntry.Resolve): Update.
1353         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1354         'silent' flag.
1355         (RootContext.LookupType): Update.
1356
1357 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1358
1359         * cs-parser.jay: Add support for handling accessor modifiers
1360         * class: Add support port accessor modifiers and error checking,
1361         define PropertyMethod.Define as virtual (not abstract anymore)
1362         * ecore.cs: Add checking for proeprties access with access modifiers
1363         * iterators.cs: Modify Accessor constructor call based in the modified
1364         constructor
1365 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1366
1367         * expression.cs (StringConcat): Handle being called twice,
1368         as when we have a concat in a field init with more than two
1369         ctors in the class
1370
1371 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1372
1373         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1374         special case explicit implementations, we should always produce
1375         the .property or .event declaration.
1376         
1377         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1378         since it will not return correct data if people use this
1379         unresolved in the presence of using statements (see test-313).
1380
1381         * class.cs (MethodData.Define): If we are an explicit interface
1382         implementation, set the method name to the full name of the
1383         interface plus the name of the method.  
1384
1385         Notice that using the method.MethodName.GetFullName() does not
1386         work, as it will only contain the name as declared on the source
1387         file (it can be a shorthand in the presence of using statements)
1388         and not the fully qualifed type name, for example:
1389
1390         using System;
1391
1392         class D : ICloneable {
1393                 object ICloneable.Clone ()  {
1394                 }
1395         }
1396
1397         Would produce a method called `ICloneable.Clone' instead of
1398         `System.ICloneable.Clone'.
1399
1400         * namespace.cs (Alias.Resolve): Use GetPartialName.
1401         
1402 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1403
1404         * cs-parser.jay: Add error 1055 report.
1405
1406 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1407
1408         * assign.cs (Assign.DoResolve): Only do the transform of
1409         assignment into a New if the types are compatible, if not, fall
1410         through and let the implicit code deal with the errors and with
1411         the necessary conversions. 
1412
1413 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1414
1415         * cs-parser.jay: Add error 1031 report.
1416
1417         * cs-tokenizer.cs: Add location for error 1038.
1418
1419 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1420
1421         * cs-parser.jay: Add error 1016 report.
1422
1423 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1424
1425         * cs-parser.jay: Add errors 1575,1611 report.
1426
1427 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1428
1429         * cs-parser.jay: Add error 1001 report.
1430
1431 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1432
1433         Fix #68850
1434         * attribute.cs (GetMarshal): Add method argument for
1435         caller identification.
1436
1437         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1438         agument for GetMarshal and RuntimeMissingSupport.
1439
1440 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1441
1442         * attribute.cs (ExtractSecurityPermissionSet): Removed
1443         TypeManager.code_access_permission_type.
1444
1445         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1446
1447 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1448
1449         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1450         for obsolete use of a variable here.   Fixes regression on errors
1451         cs0619-25 and cs0619-26.
1452
1453 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1454
1455         Fix #62358, implemented security attribute encoding.
1456
1457         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1458         Tests permitted SecurityAction for assembly or other types.
1459         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1460         data from SecurityPermissionAttribute to PermisionSet class.
1461
1462         * class.cs (ApplyAttributeBuilder): Added special handling
1463         for System.Security.Permissions.SecurityAttribute based types.
1464
1465         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1466         special handling for System.Security.Permissions.SecurityAttribute
1467         based types.
1468
1469         * enum.cs (ApplyAttributeBuilder): Added special handling
1470         for System.Security.Permissions.SecurityAttribute based types.
1471
1472         * parameter.cs (ApplyAttributeBuilder): Added special handling
1473         for System.Security.Permissions.SecurityAttribute based types.
1474
1475         * rootcontext.cs: Next 2 core types.
1476
1477         * typemanager.cs (TypeManager.security_permission_attr_type):
1478         Built in type for the SecurityPermission Attribute.
1479         (code_access_permission_type): Build in type.
1480
1481 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1482
1483         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1484         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1485         all of this information into
1486         EmitContext.EmitCapturedVariableInstance.
1487         
1488         * codegen.cs (EmitCapturedVariableInstance): move here the
1489         funcionality of emitting an ldarg.0 in the presence of a
1490         remapping.   This centralizes the instance emit code.
1491
1492         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1493         then emit a load of this: it means that we have reached the
1494         topmost ScopeInfo: the one that contains the pointer to the
1495         instance of the class hosting the anonymous method.
1496
1497         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1498         captures to the topmost CaptureContext.
1499
1500 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1501
1502         * expression.cs (LocalVariableReference): Move the knowledge about
1503         the iterators into codegen's EmitCapturedVariableInstance.
1504
1505 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1506
1507         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1508         all code paths return a value from an anonymous method (it is the
1509         same as the 161 error, but for anonymous methods).
1510
1511 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1512
1513         The introduction of anonymous methods in the compiler changed
1514         various ways of doing things in the compiler.  The most
1515         significant one is the hard split between the resolution phase
1516         and the emission phases of the compiler.
1517
1518         For instance, routines that referenced local variables no
1519         longer can safely create temporary variables during the
1520         resolution phase: they must do so from the emission phase,
1521         since the variable might have been "captured", hence access to
1522         it can not be done with the local-variable operations from the runtime.
1523         
1524         * statement.cs 
1525
1526         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1527         is a toplevel block.
1528
1529         (ToplevelBlock): A new kind of Block, these are the blocks that
1530         are created by the parser for all toplevel method bodies.  These
1531         include methods, accessors and anonymous methods.
1532
1533         These contain some extra information not found in regular blocks:
1534         A pointer to an optional CaptureContext (for tracking captured
1535         local variables and parameters).  A pointer to the parent
1536         ToplevelBlock.
1537         
1538         (Return.Resolve): Catch missmatches when returning a value from an
1539         anonymous method (error 1662).
1540         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1541         phase.
1542
1543         (Break.Resolve): ditto.
1544
1545         (SwitchLabel): instead of defining the labels during the
1546         resolution phase, we now turned the public ILLabel and ILLabelCode
1547         labels into methods called GetILLabelCode() and GetILLabel() that
1548         only define the label during the Emit phase.
1549
1550         (GotoCase): Track the SwitchLabel instead of the computed label
1551         (its contained therein).  Emit the code by using
1552         SwitchLabel.GetILLabelCode ().
1553
1554         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1555         whether the Local has been captured or not.
1556
1557         (LocalInfo.IsCaptured): New property, used to tell whether the
1558         local has been captured.
1559         
1560         * anonymous.cs: Vastly updated to contain the anonymous method
1561         support.
1562
1563         The main classes here are: CaptureContext which tracks any
1564         captured information for a toplevel block and ScopeInfo used to
1565         track the activation frames for various local variables.   
1566
1567         Each toplevel block has an optional capture context associated
1568         with it.  When a method contains an anonymous method both the
1569         toplevel method and the anonymous method will create a capture
1570         context.   When variables or parameters are captured, they are
1571         recorded on the CaptureContext that owns them, for example:
1572
1573         void Demo () {
1574              int a;
1575              MyDelegate d = delegate {
1576                  a = 1;
1577              }
1578         }
1579
1580         Here `a' will be recorded as captured on the toplevel
1581         CapturedContext, the inner captured context will not have anything
1582         (it will only have data if local variables or parameters from it
1583         are captured in a nested anonymous method.
1584
1585         The ScopeInfo is used to track the activation frames for local
1586         variables, for example:
1587
1588         for (int i = 0; i < 10; i++)
1589                 for (int j = 0; j < 10; j++){
1590                    MyDelegate d = delegate {
1591                         call (i, j);
1592                    }
1593                 }
1594
1595         At runtime this captures a single captured variable `i', but it
1596         captures 10 different versions of the variable `j'.  The variable
1597         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
1598         recorded on a child.  
1599
1600         The toplevel ScopeInfo will also track information like the `this'
1601         pointer if instance variables were referenced (this is necessary
1602         as the anonymous method lives inside a nested class in the host
1603         type of the method). 
1604
1605         (AnonymousMethod): Expanded to track the Toplevel, implement
1606         `AnonymousMethod.Compatible' to tell whether an anonymous method
1607         can be converted to a target delegate type. 
1608
1609         The routine now also produces the anonymous method content
1610
1611         (AnonymousDelegate): A helper class that derives from
1612         DelegateCreation, this is used to generate the code necessary to
1613         produce the delegate for the anonymous method that was created. 
1614
1615         * assign.cs: API adjustments for new changes in
1616         Convert.ImplicitStandardConversionExists.
1617
1618         * class.cs: Adjustments to cope with the fact that now toplevel
1619         blocks are of type `ToplevelBlock'. 
1620
1621         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
1622         insteda of standard blocks.
1623
1624         Flag errors if params arguments are passed to anonymous methods.
1625
1626         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
1627         `CurrentAnonymousMethod' which points to the current Anonymous
1628         Method.  The variable points to the AnonymousMethod class that
1629         holds the code being compiled.  It is set in the new EmitContext
1630         created for the anonymous method.
1631
1632         (EmitContext.Phase): Introduce a variable and an enumeration to
1633         assist in enforcing some rules about when and where we are allowed
1634         to invoke certain methods (EmitContext.NeedsReturnLabel is the
1635         only one that enfonces this right now).
1636
1637         (EmitContext.HaveCaptureInfo): new helper method that returns
1638         whether we have a CapturedContext initialized.
1639
1640         (EmitContext.CaptureVariable): New method used to register that a
1641         LocalInfo must be flagged for capturing. 
1642
1643         (EmitContext.CapturedParameter): New method used to register that a
1644         parameters must be flagged for capturing. 
1645         
1646         (EmitContext.CapturedField): New method used to register that a
1647         field must be flagged for capturing. 
1648
1649         (EmitContext.HaveCapturedVariables,
1650         EmitContext.HaveCapturedFields): Return whether there are captured
1651         variables or fields. 
1652
1653         (EmitContext.EmitMethodHostInstance): This is used to emit the
1654         instance for the anonymous method.  The instance might be null
1655         (static methods), this (for anonymous methods that capture nothing
1656         and happen to live side-by-side with the current method body) or a
1657         more complicated expression if the method has a CaptureContext.
1658
1659         (EmitContext.EmitTopBlock): Routine that drives the emission of
1660         code: it will first resolve the top block, then emit any metadata
1661         and then emit the code.  The split is done so that we can extract
1662         any anonymous methods and flag any captured variables/parameters.
1663         
1664         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
1665         during this phase, the ILGenerator should not be used as labels
1666         and local variables declared here might not be accessible to any
1667         code that is part of an anonymous method.  
1668
1669         Exceptions to this include the temporary variables that are
1670         created by some statements internally for holding temporary
1671         variables. 
1672         
1673         (EmitContext.EmitMeta): New routine, in charge of emitting all the
1674         metadata for a cb
1675
1676         (EmitContext.TemporaryReturn): This method is typically called
1677         from the Emit phase, and its the only place where we allow the
1678         ReturnLabel to be defined other than the EmitMeta.  The reason is
1679         that otherwise we would have to duplicate a lot of logic in the
1680         Resolve phases of various methods that today is on the Emit
1681         phase. 
1682
1683         (EmitContext.NeedReturnLabel): This no longer creates the label,
1684         as the ILGenerator is not valid during the resolve phase.
1685
1686         (EmitContext.EmitThis): Extended the knowledge in this class to
1687         work in anonymous methods in addition to iterators. 
1688
1689         (EmitContext.EmitCapturedVariableInstance): This emits whatever
1690         code is necessary on the stack to access the instance to a local
1691         variable (the variable will be accessed as a field).
1692
1693         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
1694         EmitContext.EmitAddressOfParameter): Routines to support
1695         parameters (not completed at this point). 
1696         
1697         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
1698         will also remove the parameters.
1699
1700         * convert.cs (Convert): Define a `ConstantEC' which points to a
1701         null.  This is just to prefity some code that uses
1702         ImplicitStandardConversion code and do not have an EmitContext
1703         handy.
1704
1705         The idea is to flag explicitly that at that point in time, it is
1706         known that the conversion will not trigger the delegate checking
1707         code in implicit conversions (which requires a valid
1708         EmitContext). 
1709
1710         Everywhere: pass new EmitContext parameter since
1711         ImplicitStandardConversionExists now requires it to check for
1712         anonymous method conversions. 
1713
1714         (Convert.ImplicitStandardConversionExists): If the type of an
1715         expression is the anonymous_method_type, and the type is a
1716         delegate, we invoke the AnonymousMethod.Compatible method to check
1717         whether an implicit conversion is possible. 
1718
1719         (Convert.ImplicitConversionStandard): Only do implicit method
1720         group conversions if the language level is not ISO_1.
1721
1722         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
1723         MethodInfo for the Invoke method.  used by Delegate and
1724         AnonymousDelegate.
1725
1726         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
1727         method conversions if the target type is a delegate.
1728
1729         Removed extra debugging nops.
1730
1731         (LocalVariableReference): Turn the `local_info' into a public
1732         field. 
1733
1734         Add `prepared' field, the same hack used for FieldExprs to cope
1735         with composed assignments, as Local variables do not necessarily
1736         operate purely on the stack as they used to: they can be captured
1737         fields. 
1738
1739         Add `temp' for a temporary result, like fields.
1740
1741         Refactor DoResolve and DoResolveLValue into DoResolveBase.
1742
1743         It now copes with Local variables that are captured and emits the
1744         proper instance variable to load it from a field in the captured
1745         case. 
1746
1747         (ParameterReference.DoResolveBase): During the resolve phase,
1748         capture parameters if we are in an anonymous method.
1749
1750         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
1751         anonymous method, use the EmitContext helper routines to emit the
1752         parameter reference.
1753
1754         * iterators.cs: Set RemapToProxy to true/false during the
1755         EmitDispose class.
1756
1757         * parameters.cs (GetParameterByName): New helper method. 
1758
1759         * typemanager.cs (anonymous_method_type) a new type that
1760         represents an anonyous method.  This is always an internal type,
1761         used as a fencepost to test against the anonymous-methodness of an
1762         expression. 
1763         
1764 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
1765
1766         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
1767         561 report.
1768         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
1769
1770 2004-11-10  Martin Baulig  <martin@ximian.com>
1771
1772         * expression.cs (Invocation.BetterFunction): If two methods have
1773         equal parameter types, but only one of them is generic, the
1774         non-generic one wins.
1775         (New.DoResolve): Don't set `is_struct' to false if we're a generic
1776         instance; just use `Type.IsValueType' to determine whether
1777         something is a struct or not.
1778         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
1779         so we can be called multiple times.
1780
1781 2004-11-10  Martin Baulig  <martin@ximian.com>
1782
1783         * generic.cs (TypeParameter.DefineConstraints): New public method.
1784         (TypeParameter.CheckAccessLevel): Override this and return true.
1785         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
1786         override ResolveType() anymore.
1787         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
1788
1789 2004-11-10  Martin Baulig  <martin@ximian.com>
1790
1791         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
1792         call DeclSpace.ResolveNestedType() on it.
1793
1794 2004-11-10  Martin Baulig  <martin@ximian.com>
1795
1796         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
1797         non-null, call ParameterModifier() on it.
1798
1799 2004-11-10  Martin Baulig  <martin@ximian.com>
1800
1801         * iterators.cs
1802         (Iterators): Added `current_type' and `this_type' fields.
1803         (Iterators.DefineIterator): Create a new EmitContext and store it
1804         in `ec'; compute `this_type'.
1805
1806 2004-11-10  Martin Baulig  <martin@ximian.com>
1807
1808         * typemanager.cs
1809         (TypeManager.IsPrivateAccessible): New public method.
1810         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
1811
1812 2004-11-10  Martin Baulig  <martin@ximian.com>
1813
1814         * class.cs (TypeContainer.DefineType): Call
1815         TypeBuilder.DefineGenericParameters() before resolving the type
1816         parameters.
1817         (MethodData.parent_method): New protected field.
1818         (MethodData..ctor): Added `MethodInfo parent_method' argument.
1819         (MethodData.Define): Compute `parent_method'.
1820
1821         * decl.cs
1822         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1823         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1824         (DeclSpace.ec): New protected field; store the EmitContext here.
1825         (DeclSpace.EmitContext): New public property.
1826         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
1827         (DeclSpace.ResolveNestedType): New public method.
1828         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
1829         (DeclSpace.NestedAccessible): Added `Type tb' argument.
1830         (DeclSpace.FamilyAccessible): Likewise.
1831         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
1832         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1833         EmitContext.
1834
1835         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
1836         field.
1837
1838         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1839         (Enum.Emit): Don't create a new EmitContext.
1840
1841 2004-10-18  Martin Baulig  <martin@ximian.com>
1842
1843         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
1844         `Type' directly, but call ResolveType() on it.
1845         (Catch.Resolve): Likewise.
1846         (Foreach.Resolve): Likewise.
1847
1848 2004-10-18  Martin Baulig  <martin@ximian.com>
1849
1850         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
1851         `Type' directly, but call ResolveType() on it.
1852         (Probe.DoResolve): Likewise.
1853         (ArrayCreation.LookupType): Likewise.
1854         (TypeOf.DoResolve): Likewise.
1855         (SizeOf.DoResolve): Likewise.
1856
1857 2004-10-18  Raja R Harinath  <rharinath@novell.com>
1858
1859         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
1860         the ResolveType.
1861
1862 2004-10-17  John Luke  <john.luke@gmail.com>
1863
1864         * class.cs (Operator.GetSignatureForError): use CSharpName
1865
1866         * parameter.cs (Parameter.GetSignatureForError): Returns
1867         correct name even if was not defined.
1868
1869 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1870
1871         Fix #65816.
1872         * class.cs (TypeContainer.EmitContext): New property.
1873         (DefineNestedTypes): Create an emitcontext for each part.
1874         (MethodCore.DoDefineParameters): Use container's emitcontext.
1875         Pass type array to InternalParameters.
1876         (MemberBase.DoDefine): Use container's emitcontext.
1877         (FieldMember.Define): Likewise.
1878         (Event.Define): Likewise.
1879         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1880         Pass type array to InternalParameters.
1881         (SetIndexerMethod.GetParameterInfo): Likewise.
1882         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1883         * delegate.cs (Define): Pass emitcontext to
1884         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1885         array to InternalParameters.
1886         * expression.cs (ParameterReference.DoResolveBase): Pass
1887         emitcontext to GetParameterInfo.
1888         (ComposedCast.DoResolveAsTypeStep): Remove check on
1889         ec.ResolvingTypeTree.
1890         * parameter.cs (Parameter.Resolve): Change argument to
1891         EmitContext.  Use ResolveAsTypeTerminal.
1892         (Parameter.GetSignature): Change argument to EmitContext.
1893         (Parameters.ComputeSignature): Likewise.
1894         (Parameters.ComputeParameterTypes): Likewise.
1895         (Parameters.GetParameterInfo): Likewise.
1896         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1897         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1898         * support.cs (InternalParameters..ctor): Remove variant that takes
1899         a DeclSpace.
1900         * typemanager.cs (system_intptr_expr): New.
1901         (InitExpressionTypes): Initialize it.
1902
1903 2004-10-12  Chris Toshok  <toshok@ximian.com>
1904
1905         * cs-parser.jay: fix location for try_statement and catch_clause.
1906
1907 2004-10-18  Martin Baulig  <martin@ximian.com>
1908
1909         * class.cs (FieldMember.Define): Don't access the TypeExpr's
1910         `Type' directly, but call ResolveType() on it.
1911         (MemberBase.DoDefine): Likewise.
1912
1913         * expression.cs (New.DoResolve): Don't access the TypeExpr's
1914         `Type' directly, but call ResolveType() on it.
1915         (ComposedCast.DoResolveAsTypeStep): Likewise.
1916
1917         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
1918         `Type' directly, but call ResolveType() on it.
1919
1920 2004-10-17  John Luke  <john.luke@gmail.com>
1921
1922         * class.cs (Operator.GetSignatureForError): use CSharpName
1923
1924         * parameter.cs (Parameter.GetSignatureForError): Returns
1925         correct name even if was not defined.
1926
1927 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1928
1929         Fix #65816.
1930         * class.cs (TypeContainer.EmitContext): New property.
1931         (DefineNestedTypes): Create an emitcontext for each part.
1932         (MethodCore.DoDefineParameters): Use container's emitcontext.
1933         Pass type array to InternalParameters.
1934         (MemberBase.DoDefine): Use container's emitcontext.
1935         (FieldMember.Define): Likewise.
1936         (Event.Define): Likewise.
1937         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1938         Pass type array to InternalParameters.
1939         (SetIndexerMethod.GetParameterInfo): Likewise.
1940         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1941         * delegate.cs (Define): Pass emitcontext to
1942         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1943         array to InternalParameters.
1944         * expression.cs (ParameterReference.DoResolveBase): Pass
1945         emitcontext to GetParameterInfo.
1946         (ComposedCast.DoResolveAsTypeStep): Remove check on
1947         ec.ResolvingTypeTree.
1948         * parameter.cs (Parameter.Resolve): Change argument to
1949         EmitContext.  Use ResolveAsTypeTerminal.
1950         (Parameter.GetSignature): Change argument to EmitContext.
1951         (Parameters.ComputeSignature): Likewise.
1952         (Parameters.ComputeParameterTypes): Likewise.
1953         (Parameters.GetParameterInfo): Likewise.
1954         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1955         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1956         * support.cs (InternalParameters..ctor): Remove variant that takes
1957         a DeclSpace.
1958         * typemanager.cs (system_intptr_expr): New.
1959         (InitExpressionTypes): Initialize it.
1960
1961 2004-10-12  Chris Toshok  <toshok@ximian.com>
1962
1963         * cs-parser.jay: fix location for try_statement and catch_clause.
1964
1965 2004-10-07  Raja R Harinath  <rharinath@novell.com>
1966
1967         More DeclSpace.ResolveType avoidance.
1968         * decl.cs (MemberCore.InUnsafe): New property.
1969         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
1970         with newly created EmitContext.
1971         (FieldMember.Define): Likewise.
1972         * delegate.cs (Delegate.Define): Likewise.
1973         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
1974         only if normal name-lookup fails.
1975         (TypeExpr.DoResolve): Enable error-checking.
1976         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
1977         (SizeOf.DoResolve): Likewise.
1978         (ComposedCast.DoResolveAsTypeStep): Likewise.
1979         (StackAlloc.DoResolve): Likewise.
1980         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
1981         (Block.Unsafe): New property.
1982         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
1983         (Unsafe): Set 'unsafe' flag of contained block.
1984         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
1985         (Fixed.Resolve): Likewise.
1986         (Catch.Resolve): Likewise.
1987         (Using.ResolveLocalVariableDecls): Likewise.
1988         (Foreach.Resolve): Likewise.
1989
1990 2004-10-05  John Luke <john.luke@gmail.com>
1991
1992         * cs-parser.jay: add location to error CS0175
1993
1994 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
1995
1996         * ecore.cs (Expression.Constantity): Add support for turning null
1997         into a constant.
1998
1999         * const.cs (Const.Define): Allow constants to be reference types
2000         as long as the value is Null.
2001
2002 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2003
2004         * namespace.cs (NamespaceEntry.Using): No matter which warning
2005         level is set, check if this namespace name has already been added.
2006
2007 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2008
2009         * expression.cs: reftype [!=]= null should always use br[true,false].
2010         # 67410
2011
2012 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2013
2014         Fix #67108
2015         * attribute.cs: Enum conversion moved to 
2016         GetAttributeArgumentExpression to be applied to the all
2017         expressions.
2018
2019 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2020
2021         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2022         * class.c (TypeContainer.DefineType): Flag error if
2023         base types aren't accessible due to access permissions.
2024         * decl.cs (DeclSpace.ResolveType): Move logic to
2025         Expression.ResolveAsTypeTerminal.
2026         (DeclSpace.ResolveTypeExpr): Thin layer over
2027         Expression.ResolveAsTypeTerminal.
2028         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2029         Refactor code into NestedAccess.  Use it.
2030         (DeclSpace.NestedAccess): New.
2031         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2032         argument to silence errors.  Check access permissions.
2033         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2034         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2035         (Cast.DoResolve): Likewise.
2036         (New.DoResolve): Likewise.
2037         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2038         (TypeOf.DoResolve): Likewise.
2039
2040         * expression.cs (Invocation.BetterConversion): Return the Type of
2041         the better conversion.  Implement section 14.4.2.3 more faithfully.
2042         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2043         section 14.4.2.2 explicit.
2044         (Invocation.OverloadResolve): Update.
2045         (Invocation): Remove is_base field.
2046         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2047         (Invocation.Emit): Likewise.
2048
2049 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2050
2051         * cs-parser.jay: Reverted 642 warning fix.
2052
2053 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2054
2055         Fix bug #66615
2056         * decl.cs (FindMemberWithSameName): Indexer can have more than
2057         1 argument.
2058
2059 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2060
2061         * expression.cs (LocalVariableReference.DoResolveLValue):
2062         Do not report warning 219 for out values.
2063         (EmptyExpression.Null): New member to avoid extra allocations.
2064
2065 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2066
2067         * cs-parser.jay: Fix wrong warning 642 report.
2068
2069         * cs-tokenizer.cs (CheckNextToken): New helper;
2070         Inspect next character if is same as expected.
2071
2072 2004-09-23  Martin Baulig  <martin@ximian.com>
2073
2074         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2075         (Convert.ImplicitReferenceConversionExists): Likewise.
2076
2077 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2078
2079         * Makefile (DISTFILES): Comment out a few missing files.
2080
2081 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2082
2083         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2084         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2085         (gmcs.exe): Invoke bootstrap-libs.
2086         (clean-local): Clean the net_2_0_bootstrap profile too.
2087         (PROGRAM_INSTALL_DIR): New.
2088         (install-local): Use it.
2089
2090 2004-10-13  Martin Baulig  <martin@ximian.com>
2091
2092         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2093         (TypeParameter.DefineType): If we're a method type parameter and
2094         that method is overriding something, "inflate" its constraints.
2095
2096 2004-10-12  Martin Baulig  <martin@ximian.com>
2097
2098         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2099         and have type arguments, create and resolve a ConstructedType.
2100
2101 2004-10-12  Martin Baulig  <martin@ximian.com>
2102
2103         * decl.cs (MemberCache.FindMemberToOverride): Use
2104         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2105         to compare the invocationType.
2106
2107         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2108         When comparing two type parameters, only do the signature-only
2109         comparision for method type parameters.
2110
2111 2004-10-11  Martin Baulig  <martin@ximian.com>
2112
2113         * report.cs: Don't make --fatal abort on warnings, we have
2114         -warnaserror for that.
2115
2116 2004-10-11  Martin Baulig  <martin@ximian.com>
2117
2118         * typemanager.cs
2119         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2120         (TypeManager.IsEqual): Call ourself recursively instead of using
2121         Type.IsEqual(). 
2122
2123 2004-10-11  Martin Baulig  <martin@ximian.com>
2124
2125         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2126         on our own type parameters, not on the ones we inherit from a containing
2127         class.
2128
2129         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2130         the comparision.
2131
2132         * generic.cs (TypeParameter.Define): We may only be called once.
2133
2134         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2135         instead of TypeManager.IsEqual().
2136
2137 2004-09-28  Martin Baulig  <martin@ximian.com>
2138
2139         * generic.cs
2140         (GenericConstraints.EffectiveBaseClass): New public property.
2141         (TypeParameter.GenericConstraints): New public property.
2142         (ConstructedType.CheckConstraints): Improved.
2143
2144         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2145         (Convert.TypeParameterConversion): New private method; use this in
2146         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2147         for all conversions related to type parameters.
2148
2149 2004-09-24  Martin Baulig  <martin@ximian.com>
2150
2151         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2152         type parameter conversions for type parameters which are known to
2153         be reference types.
2154
2155 2004-09-24  Martin Baulig  <martin@ximian.com>
2156
2157         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2158         `IsValueType' properties.
2159
2160         * support.cs (ReflectionConstraints): Use
2161         Type.GetGenericParameterConstraints() instead of the old hack.
2162
2163 2004-09-24  Martin Baulig  <martin@ximian.com>
2164
2165         * generic.cs (GenericConstraints): Moved here and made it an
2166         abstract class.
2167
2168         * support.cs (GenericConstraints): Moved to generic.cs.
2169
2170 2004-09-24  Martin Baulig  <martin@ximian.com>
2171
2172         * support.cs
2173         (ReflectionConstraints): Un-nested this class and made it public.
2174
2175         * typemanager.cs
2176         (TypeManager.GetTypeParameterConstraints): New public method.
2177         (TypeManager.HasConstructorConstraint): Use the attributes.
2178
2179 2004-09-24  Martin Baulig  <martin@ximian.com>
2180
2181         * support.cs (GenericConstraints): Replaced `HasConstructor',
2182         `IsReferenceType' and `IsValueType' with `Attributes'.
2183         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2184         method and made the .ctor public.
2185
2186         * generic.cs (Constraints.Attributes): New public property.
2187         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2188         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2189         `IsValueType' -> `HasValueTypeConstraint'.
2190
2191 2004-09-23  Martin Baulig  <martin@ximian.com>
2192
2193         * generic.cs (Constraints): Reflect latest runtime changes.
2194
2195 2004-09-23  Martin Baulig  <martin@ximian.com>
2196
2197         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2198         (Convert.ImplicitReferenceConversionExists): Likewise.
2199
2200 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2201
2202         * class.cs (Operator.Define): Add error 448 and 559 report.
2203         
2204 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2205
2206         * class.cs (MemberBase.IsTypePermitted): New protected
2207         method for checking error CS0610.
2208
2209 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2210
2211         * class.cs (TypeContainer.HasExplicitLayout): New property
2212         Returns whether container has StructLayout attribute set Explicit.
2213         (FieldMember): New abstract class for consts and fields.
2214         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2215         (Field): Reuse FieldMember.
2216
2217         * const.cs (Const): Reuse FieldMember.
2218
2219         * rootcontext.cs: EmitConstants call moved to class.
2220
2221 2004-09-22  Martin Baulig  <martin@ximian.com>
2222
2223         Marek and me just fixed one of our oldest bugs: #28562 :-)
2224
2225         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2226
2227         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2228         we're an EnumConstant, just return that.
2229         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2230         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2231         to get the value which'll actually be written into the attribute.
2232         However, we have to use GetValue() to access the attribute's value
2233         in the compiler.        
2234
2235 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2236
2237         * constant.cs (Constant.IsNegative): New abstract property
2238         IsNegative.
2239
2240         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2241         (StackAlloc.DoResolve): Reused IsNegative.
2242
2243 2004-09-22  Martin Baulig  <martin@ximian.com>
2244
2245         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2246         public method; like LookupTypeContainer, but also works for
2247         generic instances.
2248
2249         * report.cs (Report.SymbolRelatedToPreviousError): Use
2250         TypeManager.LookupGenericTypeContainer().       
2251
2252 2004-09-22  Martin Baulig  <martin@ximian.com>
2253
2254         Thanks to Peter Sestoft for this bug report.
2255
2256         * expression.cs (Conditional): If both the `trueExpr' and the
2257         `falseExpr' is a NullLiteral, return a NullLiteral.
2258
2259 2004-09-22  Martin Baulig  <martin@ximian.com>
2260
2261         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2262         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2263         for the "get_Current" call.
2264
2265 2004-09-21  Martin Baulig  <martin@ximian.com>
2266
2267         * convert.cs (Convert.ImplicitReferenceConversion): When
2268         converting to an interface type, first check whether we're
2269         converting from a reference type.
2270
2271 2004-09-14  Martin Baulig  <martin@ximian.com>
2272
2273         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2274
2275 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2276
2277         Fixed bug #61902
2278         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2279         called and is obsolete then this member suppress message
2280         when call is inside next [Obsolete] method or type.
2281
2282         * expression.cs: Use TestObsoleteMethodUsage member.
2283
2284 2004-09-14  Martin Baulig  <martin@ximian.com>
2285
2286         * genericparser.cs: Removed.
2287
2288 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2289
2290         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2291
2292 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2293
2294         * attribute.cs (Attribute.Resolve): Add error 653 report.
2295
2296         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2297         report.
2298         (Method.ApplyAttributeBuilder): Add error 685 report.
2299         (Operator.Define): Add error 564 report.
2300
2301         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2302
2303         * expression.cs (Invocation.DoResolve): Add error
2304         245 and 250 report.
2305
2306         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2307         error 674 report.
2308
2309 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2310
2311         * class.cs (ConstructorInitializer.Resolve):
2312         Wrong error number (515->516).
2313
2314 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2315
2316         * class.cs (Indexer.Define): Add error 631 report.
2317
2318 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2319
2320         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2321
2322 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2323
2324         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2325
2326 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2327
2328         * cs-parser.jay: Added error CS0241 report.
2329
2330 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2331
2332         * cs-parser.jay (fixed_statement): Introduce a scope for the
2333         declaration in the 'fixed' statement.
2334
2335 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2336
2337         * cs-parser.jay: Added CS0230 error report.
2338
2339 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2340
2341         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2342
2343 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2344
2345         * expression.cs (Argument.Resolve): Added error CS0192 and
2346         CS0199 report.
2347
2348 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2349
2350         C# 2.0 #pragma warning feature
2351
2352         * cs-tokenizer.cs (PreProcessPragma): New method; 
2353         Handles #pragma directive.
2354
2355         * report.cs (WarningRegions): New class; Support
2356         class for #pragma warning directive. It tests whether
2357         warning is enabled for a given line.
2358
2359 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2360
2361         * const.cs: Add more descriptive error report, tahnks to
2362         Sebastien. 
2363
2364 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2365
2366         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2367
2368 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2369
2370         * expression.cs: Apply patch from Ben: Remove dead code from
2371         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2372         as that code just threw an exception anwyays.
2373
2374         * const.cs: Remove the call to the turnintoconstant, for details
2375         see bug: #63144
2376         
2377         * literal.cs: The type of the null-literal is the null type;  So
2378         we use a placeholder type (literal.cs:System.Null, defined here)
2379         for it.
2380
2381         * expression.cs (Conditional.DoResolve): Remove some old code that
2382         is no longer needed, conversions have been fixed.
2383
2384         (ArrayCreationExpression.DoResolve): Return false if we fail to
2385         resolve the inner expression.
2386
2387 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2388
2389         Fix test-290.cs.
2390         * cs-parser.jay (delegate_declaration): Record a delegate
2391         declaration as a type declaration.
2392         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2393
2394 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2395
2396         * parameter.cs: Do not crash if the type can not be resolved. 
2397
2398         * expression.cs: Report errors with unsafe pointers, fixes #64896
2399
2400 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2401
2402         * expression.cs: Pointer arith always needs to do a conv.i
2403         if the operand is a long. fix 65320
2404
2405 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2406
2407         Fixed cs0619-37.cs, cs0619-38.cs
2408
2409         * enum.cs (GetObsoleteAttribute): Removed.
2410
2411         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2412         on Enum member is double staged. The first is tested member
2413         and then enum.
2414
2415 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2416
2417         Fixed #56986, #63631, #65231
2418
2419         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2420         adds member to name container.
2421         (TypeContainer.AddToTypeContainer): New method, adds type to
2422         name container.
2423         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2424         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2425         AddOperator): Simplified by reusing AddToMemberContainer.
2426         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2427         instead of field.
2428         (Method.CheckForDuplications): Fixed implementation to test all
2429         possibilities.
2430         (MemberBase): Detection whether member is explicit interface
2431         implementation is now in constructor.
2432         (MemberBase.UpdateMemberName): Handles IndexerName.
2433         (Accessor): Changed to keep also location information.
2434         (AbstractPropertyEventMethod): Is derived from MemberCore.
2435         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2436         will be emited or not.
2437         (PropertyBase.AreAccessorsDuplicateImplementation):
2438         Tests whether accessors are not in collision with some method.
2439         (Operator): Is derived from MethodCore to simplify common
2440         operations.
2441
2442         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2443         must be performed.
2444         (DeclSpace.AddToContainer): Adds the member to defined_names
2445         table. It tests for duplications and enclosing name conflicts.
2446
2447         * enum.cs (EnumMember): Clean up to reuse the base structures
2448
2449 2004-09-03  Martin Baulig  <martin@ximian.com>
2450
2451         Merged latest changes into gmcs.  Please keep this comment in
2452         here, it makes it easier for me to see what changed in MCS since
2453         the last time I merged.
2454
2455 2004-09-03  Martin Baulig  <martin@ximian.com>
2456
2457         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2458         into TypeContainer, to make partial classes work again.
2459
2460 2004-09-03  Martin Baulig  <martin@ximian.com>
2461
2462         * rootcontext.cs (RootContext.V2): Removed.
2463
2464 2004-03-23  Martin Baulig  <martin@ximian.com>
2465
2466         * expression.cs (Invocation.OverloadResolve): Added `bool
2467         may_fail' argument and use it instead of the Location.IsNull() hack.
2468
2469 2004-09-09  Martin Baulig  <martin@ximian.com>
2470
2471         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2472
2473 2004-09-09  Martin Baulig  <martin@ximian.com>
2474
2475         * generic.cs (TypeParameter.DefineType): Added support for
2476         explicit interface methods.
2477
2478 2004-09-09  Martin Baulig  <martin@ximian.com>
2479
2480         * README.Changes: New document.  Started to list important changes
2481         between MCS and GMCS here.
2482
2483 2004-09-08  Martin Baulig  <martin@ximian.com>
2484
2485         * class.cs
2486         (TypeContainer.CheckRecursiveDefinition): New protected method.
2487         (TypeContainer.DefineType): Move the CS0146 check into
2488         CheckRecursiveDefinition().     
2489
2490 2004-09-06  Martin Baulig  <martin@ximian.com>
2491
2492         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2493         types for the constructor constraint.
2494
2495 2004-09-03  Martin Baulig  <martin@ximian.com>
2496
2497         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2498         into TypeContainer, to make partial classes work again.
2499
2500 2004-09-03  Martin Baulig  <martin@ximian.com>
2501
2502         * rootcontext.cs (RootContext.V2): Removed.
2503
2504 2004-03-23  Martin Baulig  <martin@ximian.com>
2505
2506         * expression.cs (Invocation.OverloadResolve): Added `bool
2507         may_fail' argument and use it instead of the Location.IsNull() hack.
2508
2509 2004-09-03  Martin Baulig  <martin@ximian.com>
2510
2511         Merged latest changes into gmcs.  Please keep this comment in
2512         here, it makes it easier for me to see what changed in MCS since
2513         the last time I merged.
2514
2515 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2516
2517         Fix #61128.
2518         * expression.cs (BetterConversion): Don't allow either conversion 
2519         to be null.  Remove redundant implicit conversion test when 'q ==
2520         null' -- when this function is invoked, we already know that the
2521         implicit conversion exists.
2522         (BetterFunction): Assume that 'best' is non-null.  Remove
2523         redundant reimplementation of IsApplicable when 'best' is null.
2524         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2525         number of arguments.
2526         (IsAncestralType): Extract from OverloadResolve.
2527         (OverloadResolve): Make robust to the MethodGroupExpr being
2528         unsorted.  Implement all the logic of Section 14.5.5.1, and
2529         support overloading of methods from multiple applicable types.
2530         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2531
2532         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2533         (RealError, Warning): Append type of report to related symbol.
2534
2535 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2536
2537         * enum.cs: Fixed CLS-Compliance checks for enum members.
2538         Error tests cs3008-8.cs, cs3014-8.cs
2539
2540 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2541
2542         Fixed bug #62342, #63102
2543         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2544         like ImplementMethod.
2545
2546 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2547
2548         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2549         Fixed bug #65170.
2550
2551 2004-09-02  Martin Baulig  <martin@ximian.com>
2552
2553         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2554         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2555         on the MethodBase.
2556
2557 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2558
2559         C# 2.0 Static classes implemented
2560
2561         * class.cs (TypeContainer): instance_constructors,
2562         initialized_fields, initialized_static_fields,
2563         default_constructor, base_inteface_types are protected to be
2564         accessible from StaticClass.
2565         (TypeContainer.DefineDefaultConstructor): New virtual method
2566         for custom default constructor generating
2567         (StaticClass): New class to handle "Static classes" feature.
2568
2569         * cs-parser.jay: Handle static keyword on class like instance
2570         of StaticClass.
2571
2572         * driver.cs: Added "/langversion" command line switch with two
2573         options (iso-1, default).
2574
2575 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2576
2577         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2578
2579 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2580
2581         * delegate.cs: Style.
2582
2583 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2584
2585         * delegate.cs: Add seperate instance expr field for miguel.
2586
2587 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2588
2589         * PointerArithmetic (Resolve): make sure we are not doing
2590         pointer arith on void*. Also, make sure we are resolved
2591         by not setting eclass until resolve.
2592
2593         All callers: Make sure that PointerArithmetic gets resolved.
2594
2595 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2596
2597         * ArrayCreation (LookupType): If the type does not resolve 
2598         to an array, give an error.
2599
2600 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2601
2602         * statement.cs (Try.Resolve): Fixed bug #64222
2603
2604 2004-08-27  Martin Baulig  <martin@ximian.com>
2605
2606         * class.cs
2607         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2608         crash here.     
2609
2610 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2611
2612         * ecore.cs (Constantify): Get underlying type via
2613         System.Enum.GetUnderlyingType to avoid StackOverflow on the
2614         Windows in special cases.
2615
2616 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2617
2618         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
2619         for obtaining also private methods.
2620         (GetRemoveMethod): Used GetRemoveMethod (true)
2621         for obtaining also private methods.
2622
2623 2004-09-02  Martin Baulig  <martin@ximian.com>
2624
2625         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2626         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2627         on the MethodBase.
2628
2629 2004-08-27  Martin Baulig  <martin@ximian.com>
2630
2631         * class.cs
2632         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2633         crash here.     
2634
2635 2004-08-25  Martin Baulig  <martin@ximian.com>
2636
2637         * support.cs (ReflectionParameters..ctor): If this is a generic
2638         method, retrieve and store its type parameters.
2639         (InternalParameters..ctor): Added `TypeParameter[]' argument.
2640         (ReflectionParameters.GenericConstraints): The argument specifies
2641         the type parameter, not the method parameter.
2642         (InternalParameters.GenericConstraints): Likewise.
2643
2644         * generic.cs (TypeParameter.DefineType): Correctly handle
2645         constraints wrt. generic methods in interfaces and their
2646         implementations.        
2647
2648 2004-08-24  Martin Baulig  <martin@ximian.com>
2649
2650         * generic.cs (TypeParameter.IsSubclassOf): New public method.
2651         (Constraints.IsSubclassOf): New internal method.
2652
2653         * typemanager.cs (TypeManager.FindMembers): Added special support
2654         for GenericTypeParameterBuilder's.      
2655         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
2656         type parameters.
2657
2658 2004-08-24  Martin Baulig  <martin@ximian.com>
2659
2660         * typemanager.cs
2661         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2662         this for accessibility checks.
2663         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
2664         IsNestedFamilyAccessible.
2665         (TypeManager.IsSubclassOf): New method, do what the name actually
2666         says.   
2667
2668 2004-08-24  Martin Baulig  <martin@ximian.com>
2669
2670         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
2671         as a SimpleName, include the generic arity.
2672
2673 2004-08-24  Martin Baulig  <martin@ximian.com>
2674
2675         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
2676         MethodAttributes.HideBySig for operators.
2677
2678 2004-08-23  Martin Baulig  <martin@ximian.com>
2679
2680         Back to the old error reporting system :-)
2681
2682         * report.cs (Message): Removed.
2683         (Report.MessageData, ErrorData, WarningData): Removed.
2684         (Report.Error, Warning): Back to the old system.
2685
2686 2004-08-23  Martin Baulig  <martin@ximian.com>
2687
2688         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
2689
2690         * class.cs (TypeContainer.ParentContainer): New public virtual
2691         method; replaces the explicit interface implementation.
2692         (ClassPart.ParentContainer): Override.
2693
2694 2004-08-23  Martin Baulig  <martin@ximian.com>
2695
2696         * statement.cs (Switch): Added support for constant switches; see
2697         #59428 or test-285.cs.
2698
2699 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2700
2701         Fixed bug #62740.
2702         * statement.cs (GetEnumeratorFilter): Removed useless
2703         logic because C# specs is strict. GetEnumerator must be
2704         public.
2705
2706 2004-08-22  Martin Baulig  <martin@ximian.com>
2707
2708         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2709         a switch and may break, reset the barrier.  Fixes #59867.
2710
2711 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2712
2713         CLS-Compliance speed up (~5% for corlib)
2714
2715         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
2716         New method. Tests container for CLS-Compliant names
2717
2718         * class.cs (TypeContainer.VerifyClsName): New method.
2719         Checks whether container name is CLS Compliant.
2720         (Constructor): Implements IMethodData.
2721
2722         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
2723         low-case table for CLS Compliance test.
2724         (MemberCache.VerifyClsParameterConflict): New method.
2725         Checks method parameters for CS3006 error.
2726
2727         * enum.cs (EnumMember): Is derived from MemberCore.
2728         (Enum.VerifyClsName): Optimized for better performance.
2729
2730 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2731
2732         * report.cs: Renamed Error_T to Error and changed all
2733         references.
2734
2735 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2736
2737         * class.cs (TypeContainer.IndexerArrayList): New inner class
2738         container for indexers.
2739         (TypeContainer.DefaultIndexerName): New constant for default
2740         indexer name. Replaced all "Item" with this constant.
2741         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
2742
2743         * typemanager.cs (TypeManager.default_member_ctor): Cache here
2744         DefaultMemberAttribute constructor.
2745
2746 2004-08-05  Martin Baulig  <martin@ximian.com>
2747
2748         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2749         Fix bug #59429.
2750
2751 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
2752
2753         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
2754         multi platforms problem.
2755
2756         * compiler.csproj: Included shared files.
2757
2758 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2759
2760         Fix bug 60333, 55971 in the more general way
2761         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2762         Added arg_type argument for constant conversion.
2763         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
2764
2765 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2766
2767         Fix bug #59760
2768         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
2769         OperatorArrayList, MethodCoreArrayList for typecontainer
2770         containers. Changed class member types to these new types.
2771         (MethodArrayList.DefineMembers): Added test for CS0659.
2772
2773 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
2774
2775         * cfold.cs: Synchronize the folding with the code in expression.cs
2776         Binary.DoNumericPromotions for uint operands.
2777
2778         * attribute.cs: Revert patch from Raja, it introduced a regression
2779         while building Blam-1.2.1 (hard to isolate a test case).
2780
2781 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2782
2783         Fix for #55382
2784         * class.cs:
2785         (TypeContainer.Define): Renamed to DefineContainerMembers because of
2786         name collision.
2787         (MethodCore.parent_method): New member. The method we're overriding
2788         if this is an override method.
2789         (MethodCore.CheckBase): Moved from Method class and made common.
2790         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
2791         private.
2792         (MethodCore.CheckForDuplications): New abstract method. For custom
2793         member duplication search in a container
2794         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
2795         method and its return type.
2796         (Event.conflict_symbol): New member. Symbol with same name in the
2797         parent class.
2798
2799         * decl.cs:
2800         (MemberCache.FindMemberWithSameName): New method. The method
2801         is looking for conflict with inherited symbols.
2802
2803 2004-08-04  Martin Baulig  <martin@ximian.com>
2804
2805         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2806
2807         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2808
2809 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2810
2811         * report.cs (Message): New enum for better error, warning reference in
2812         the code.
2813         (MessageData): New inner abstract class. It generally handles printing of
2814         error and warning messages.
2815         Removed unused Error, Warning, Message methods.
2816
2817 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2818
2819         Fix for cs0592-8.cs test
2820         * attribute.cs
2821         (Attributable.ValidAttributeTargets): Made public.
2822         (Attribute.ExplicitTarget): New member for explicit target value.
2823         (Attribute.CheckTargets): Now we translate explicit attribute
2824         target to Target here.
2825
2826 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
2827
2828         * ecore.cs (MethodGroupExpr): new IsBase property.
2829
2830         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
2831
2832         * delegate.cs (DelegateCreation): store a MethodGroupExpr
2833         rather than an instance expr.
2834
2835         (DelegateCreation.Emit): Use the method group rather than
2836         the instance expression. Also, if you have base.Foo as the
2837         method for a delegate, make sure to emit ldftn, not ldftnvirt.
2838
2839         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
2840
2841         (NewDelegate.DoResolve): Only check for the existance of Invoke
2842         if the method is going to be needed. Use MethodGroupExpr.
2843
2844         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
2845
2846         * expression.cs: For pointer arith., make sure to use
2847         the size of the type, not the size of the pointer to
2848         the type.
2849
2850 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2851
2852         Fix for #60722
2853         * class.cs (Class): Added error CS0502 test.
2854
2855 2004-08-03  John Luke  <jluke@cfl.rr.com>
2856             Raja R Harinath  <rharinath@novell.com>
2857
2858         Fix for #60997.
2859         * attribute.cs (Attribute.complained_before): New flag.
2860         (Attribute.ResolveType, Attribute.Resolve),
2861         (Attribute.DefinePInvokeMethod): Set it.
2862         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
2863         
2864 2004-08-03  Martin Baulig  <martin@ximian.com>
2865
2866         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2867         use a user-defined operator; we still need to do numeric
2868         promotions in case one argument is a builtin type and the other
2869         one has an implicit conversion to that type.  Fixes #62322.
2870
2871 2004-08-18  Martin Baulig  <martin@ximian.com>
2872
2873         * class.cs (Method.Define): Use the correct method name when
2874         creating the MethodBuilder for a generic method.
2875
2876 2004-08-17  Martin Baulig  <martin@ximian.com>
2877
2878         * generic.cs (Constraints): Support type parameter constraints.
2879
2880 2004-08-16  Martin Baulig  <martin@ximian.com>
2881
2882         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
2883         (Token.GENERIC_DIMENSION): New token; this is returned if we
2884         encounter an unbound generic type in a typeof() expression.
2885
2886         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
2887         this token is only generated while parsing a typeof() expression.
2888         (typeof_expression): Removed the old unbound_type hack.
2889
2890         * generic.cs (TypeArguments.IsUnbound): New public property.
2891
2892         * decl.cs (MemberName): Added support for unbound types.
2893
2894 2004-08-14  Martin Baulig  <martin@ximian.com>
2895
2896         * typemanager.cs
2897         (TypeManager.IsEqualGenericInstance): New static method.
2898         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
2899         just used to check accessibility, so follow the rules of 26.1.6.        
2900
2901         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
2902         ConstructedType instead of a TypeExpression if we have type arguments.
2903
2904         * cs-parser.jay (typeof_expression): Support unbound generic types.
2905
2906         * ecore.cs (UnboundTypeExpression): New public class.
2907
2908 2004-08-12  Martin Baulig  <martin@ximian.com>
2909
2910         * typemanager.cs (TypeManager.IsNestedChildOf): Use
2911         TypeManager.IsEqual() rather than `=='.
2912
2913         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
2914         generic instances as well.
2915
2916 2004-08-12  Martin Baulig  <martin@ximian.com>
2917
2918         * expression.cs (Invocation.InferType): We can only infer method
2919         type parameters.  Fixes #62647.
2920
2921 2004-08-11  Martin Baulig  <martin@ximian.com>
2922
2923         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
2924         before resolving the base classes.
2925
2926 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2927
2928         * Makefile: install .mdb file too.
2929
2930 2004-08-05  Martin Baulig  <martin@ximian.com>
2931
2932         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
2933         initializer, the current type is just the TypeBuilder, not the
2934         instantiated generic type.
2935         (FieldExpr.IsFieldInitializer): New public property.
2936
2937 2004-08-04  Martin Baulig  <martin@ximian.com>
2938
2939         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2940
2941         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2942
2943 2004-08-03  Martin Baulig  <martin@ximian.com>
2944
2945         * class.cs (MethodData.Define): If we're an explicit
2946         implementation, remove the generic arity from the type name.
2947
2948 2004-08-03  Martin Baulig  <martin@ximian.com>
2949
2950         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2951         use a user-defined operator; we still need to do numeric
2952         promotions in case one argument is a builtin type and the other
2953         one has an implicit conversion to that type.  Fixes #62322.
2954
2955 2004-08-02  Martin Baulig  <martin@ximian.com>
2956
2957         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
2958         `TypeExpr[]' array.
2959         (TypeContainer.GetClassBases): Return the unexpanded list of
2960         interfaces; we expand them later.
2961         (TypeContainer.DefineType): After creating the TypeBuilder, call
2962         TypeManager.ExpandInterfaces() to get an expanded and resolved
2963         list of interfaces.
2964
2965         * ecore.cs (TypeExpr.GetInterfaces): Removed
2966
2967         * generics.cs (Constraints.InterfaceConstraints): Remove.
2968         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
2969         register the interface constraints.
2970
2971         * typemanager.cs
2972         (TypeManager.AddUserType): Removed the `ifaces' argument.
2973         (TypeManager.AddTypeParameter): Likewise.
2974         (TypeManager.AddUserInterface): Removed, was unused.
2975         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
2976         `TypeExpr[]' array for the interfaces.
2977         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
2978         has been defined, returns a list of the resolved interfaces types.
2979         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
2980         (TypeManager.GetExplicitInterfaces): Likewise.  
2981
2982 2004-08-02  Martin Baulig  <martin@ximian.com>
2983
2984         * expression.cs (Invocation.EmitCall): If we're invoking a method
2985         on a type parameter, use the new `Constrained' prefix opcode.
2986
2987 2004-08-02  Martin Baulig  <martin@ximian.com>
2988
2989         * statement.cs (LocalInfo.Flags): Added `IsThis'.
2990         (LocalInfo.IsThis): New public property.
2991         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
2992
2993 2004-08-01  Martin Baulig  <martin@ximian.com>
2994
2995         * class.cs (TypeContainer.GetClassBases): Don't set the default
2996         here since we may get called from GetPartialBases().
2997         (TypeContainer.DefineType): If GetClassBases() didn't return a
2998         parent, use the default one.
2999
3000 2004-07-30  Martin Baulig  <martin@ximian.com>
3001
3002         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3003
3004         * class.cs (SourceMethod): New public class, derive from the
3005         symbol writer's ISourceMethod.
3006         (Method): Use the new symbol writer API.
3007
3008         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3009         as argument and use the new symbol writer.
3010
3011         * location.cs
3012         (SourceFile): Implement the symbol writer's ISourceFile.
3013         (Location.SymbolDocument): Removed.
3014         (Location.SourceFile): New public property.
3015
3016         * symbolwriter.cs: Use the new symbol writer API.
3017
3018 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3019
3020         * Makefile (install-local): Remove.  Functionality moved to
3021         executable.make.
3022
3023 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3024
3025         * Makefile: Install mcs.exe.config file together with mcs.exe.
3026         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3027         correct runtime version.
3028         
3029 2004-07-25  Martin Baulig  <martin@ximian.com>
3030
3031         * class.cs
3032         (TypeContainer.RegisterOrder): Removed, this was unused.
3033         (TypeContainer, interface_order): Removed.
3034         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3035         TypeContainer as argument since we can also be called with a
3036         `PartialContainer' for a partial class/struct/interface.
3037         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3038         of checking whether we're an `Interface' - we could be a
3039         `PartialContainer'.
3040         (PartialContainer.Register): Override; call
3041         AddClass()/AddStruct()/AddInterface() on our parent.
3042
3043         * cs-parser.jay (interface_member_declaration): Add things to the
3044         `current_container', not the `current_class'.
3045
3046         * rootcontext.cs (RegisterOrder): The overloaded version which
3047         takes an `Interface' was unused, removed.
3048
3049         * typemanager.cs (TypeManager.LookupInterface): Return a
3050         `TypeContainer', not an `Interface'.
3051         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3052         contain a `PartialContainer' for an interface, so check it's
3053         `Kind' to figure out what it is.
3054
3055 2004-07-25  Martin Baulig  <martin@ximian.com>
3056
3057         * class.cs (Class.DefaultTypeAttributes): New public constant.
3058         (Struct.DefaultTypeAttributes): Likewise.
3059         (Interface.DefaultTypeAttributes): Likewise.
3060         (PartialContainer.TypeAttr): Override this and add the
3061         DefaultTypeAttributes.
3062
3063 2004-07-25  Martin Baulig  <martin@ximian.com>
3064
3065         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3066         we can just use the `Parent' field instead.
3067
3068 2004-07-25  Martin Baulig  <martin@ximian.com>
3069
3070         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3071
3072 2004-07-25  Martin Baulig  <martin@ximian.com>
3073
3074         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3075         our parts before defining any methods.
3076         (TypeContainer.VerifyImplements): Make this virtual.
3077         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3078         on our PartialContainer.
3079
3080 2004-07-25  Martin Baulig  <martin@ximian.com>
3081
3082         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3083
3084         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3085         argument, we can just use the `Parent' field instead.
3086
3087         * class.cs
3088         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3089         (MemberBase.DoDefine): Likewise.
3090
3091 2004-07-24  Martin Baulig  <martin@ximian.com>
3092
3093         * decl.cs (MemberCore.Parent): New public field.
3094         (DeclSpace.Parent): Moved to MemberCore.
3095
3096         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3097         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3098         parent's .ctor.
3099         (FieldBase, Field, Operator): Likewise.
3100         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3101         (EventField, Event): Likewise.
3102
3103 2004-07-23  Martin Baulig  <martin@ximian.com>
3104
3105         * class.cs (PartialContainer): New public class.
3106         (ClassPart): New public class.
3107         (TypeContainer): Added support for partial classes.
3108         (TypeContainer.GetClassBases): Splitted some of the functionality
3109         out into GetNormalBases() and GetPartialBases().
3110
3111         * cs-tokenizer.cs (Token.PARTIAL): New token.
3112         (Tokenizer.consume_identifier): Added some hacks to recognize
3113         `partial', but only if it's immediately followed by `class',
3114         `struct' or `interface'.
3115
3116         * cs-parser.jay: Added support for partial clases.
3117
3118 2004-07-23  Martin Baulig  <martin@ximian.com>
3119
3120         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3121         a `DeclSpace' and also made it readonly.
3122         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3123         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3124         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3125
3126         * cs-parser.jay: Pass the `current_class', not the
3127         `current_container' (at the moment, this is still the same thing)
3128         to a new Method, Property, Event, Indexer or Constructor.
3129
3130 2004-07-23  Martin Baulig  <martin@ximian.com>
3131
3132         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3133         and removed the `current_interface' one.
3134         (struct_declaration, class_declaration, interface_declaration):
3135         Set `current_class' to the newly created class/struct/interface;
3136         set their `Bases' and call Register() before parsing their body.
3137
3138 2004-07-23  Martin Baulig  <martin@ximian.com>
3139
3140         * class.cs (Kind): New public enum.
3141         (TypeContainer): Made this class abstract.
3142         (TypeContainer.Kind): New public readonly field.
3143         (TypeContainer.CheckDef): New public method; moved here from
3144         cs-parser.jay.
3145         (TypeContainer.Register): New public abstract method.
3146         (TypeContainer.GetPendingImplementations): New public abstract
3147         method.
3148         (TypeContainer.GetClassBases): Removed the `is_class' and
3149         `is_iface' parameters.
3150         (TypeContainer.DefineNestedTypes): Formerly known as
3151         DoDefineType().
3152         (ClassOrStruct): Made this class abstract.
3153
3154         * tree.cs (RootTypes): New public type. 
3155
3156 2004-07-20  Martin Baulig  <martin@ximian.com>
3157
3158         * tree.cs (Tree.RecordNamespace): Removed.
3159         (Tree.Namespaces): Removed.
3160
3161         * rootcontext.cs (RootContext.IsNamespace): Removed.
3162
3163         * cs-parser.jay (namespace_declaration): Just create a new
3164         NamespaceEntry here.
3165
3166 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3167
3168         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3169         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3170         entry to make sure it runs in the correct runtime version.
3171         
3172 2004-07-18  Martin Baulig  <martin@ximian.com>
3173
3174         * generic.cs (ConstructedType.CheckConstraints): Improved
3175         constraints checking.
3176
3177 2004-07-18  Martin Baulig  <martin@ximian.com>
3178
3179         * expression.cs (Invocation.BetterMethod): Call
3180         TypeManager.TypeToCoreType() on all types and removed my previous
3181         hack; we're already doig the right thing here.
3182
3183 2004-07-17  Martin Baulig  <martin@ximian.com>
3184
3185         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3186
3187 2004-07-16  Martin Baulig  <martin@ximian.com>
3188
3189         * iterators.cs: Added generics support.
3190
3191 2004-07-16  Martin Baulig  <martin@ximian.com>
3192
3193         * iterators.cs: Rewrote this.  We're now using one single Proxy
3194         class for both the IEnumerable and the IEnumerator interface and
3195         `Iterator' derives from Class so we can use the high-level API.
3196
3197         * class.cs (TypeContainer.AddIterator): New method.
3198         (TypeContainer.DoDefineType): New protected virtual method, which
3199         is called from DefineType().
3200         (TypeContainer.DoDefineMembers): Call DefineType() and
3201         DefineMembers() on all our iterators.
3202         (TypeContainer.Emit): Call Emit() on all our iterators.
3203         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3204
3205         * codegen.cs (EmitContext.CurrentIterator): New public field.
3206
3207 2004-07-15  Martin Baulig  <martin@ximian.com>
3208
3209         * typemanager.cs
3210         (TypeManager.not_supported_exception_type): New type.   
3211
3212 2004-07-14  Martin Baulig  <martin@ximian.com>
3213
3214         * typemanager.cs
3215         (TypeManager.generic_ienumerable_type): New type.
3216         (TypeManager.generic_ienumerator_type): New type.
3217
3218         * rootcontext.cs
3219         (RootContext.interfaces_first_stage): Added
3220         "System.Collections.Generic.IEnumerator`1" and
3221         "System.Collections.Generic.IEnumerable`1".     
3222
3223 2004-07-14  Martin Baulig  <martin@ximian.com>
3224
3225         * iterators.cs: Use real error numbers.
3226
3227 2004-07-14  Martin Baulig  <martin@ximian.com>
3228
3229         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3230         requires this to be a System.Collection.IEnumerable and not a
3231         class implementing that interface.
3232         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3233
3234 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3235
3236         * class.cs: Fixed previous fix, it broke some error tests.
3237
3238 2004-07-12  Martin Baulig  <martin@ximian.com>
3239
3240         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3241         Fixes #61293.
3242
3243 2004-07-14  Martin Baulig  <martin@ximian.com>
3244
3245         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3246         an exclamation mark (!) for the generic arity to reflect the
3247         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3248
3249 2004-07-13  Martin Baulig  <martin@ximian.com>
3250
3251         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3252         specifiers being part of a type argument.
3253
3254 2004-07-13  Martin Baulig  <martin@ximian.com>
3255
3256         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3257         name for generic types.
3258
3259 2004-07-13  Martin Baulig  <martin@ximian.com>
3260
3261         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3262         bit to fix #60119.
3263
3264 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3265
3266         * assign.cs (LocalTemporary): Add new argument: is_address,If
3267         `is_address' is true, then the value that we store is the address
3268         to the real value, and not the value itself.
3269         
3270         * ecore.cs (PropertyExpr): use the new local temporary
3271         stuff to allow us to handle X.Y += z (where X is a struct)
3272
3273 2004-07-08  Martin Baulig  <martin@ximian.com>
3274
3275         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3276         not always return, just like we're doing in Using.Resolve().
3277
3278 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3279
3280         * cs-parser.jay (fixed_statement): flag this as Pinned.
3281
3282 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3283
3284         * typemanager.cs (TypeManager): Removed MakePinned method, this
3285         mechanism is replaced with the .NET 2.x compatible mechanism of
3286         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3287
3288         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3289         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3290         `IsFixed' property which has a different meaning.
3291
3292 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3293
3294         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3295         visible from inside a nested class, not just the names of the
3296         immediately enclosing class.
3297         Fix for bug #60730.
3298
3299 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3300
3301         * expression.cs (BetterConversion): Remove buggy special-case
3302         handling of "implicit constant expression conversions".  At this
3303         point, we already know that the conversion is possible -- we're
3304         only checking to see which is better.
3305
3306 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3307
3308         * cs-parser.jay: Added error CS0210 test.
3309
3310 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3311
3312         * cs-parser.jay: Added error CS0134 test.
3313
3314 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3315
3316         Fix bug #52507
3317         * cs-parser.jay: Added error CS0145 test.
3318
3319 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3320
3321         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3322
3323 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3324         
3325         * expression.cs (StackAlloc.Resolve): The argument may not
3326         be a constant; deal with this case.
3327         
3328 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3329
3330         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3331         GetIndexerAttributeValue.
3332         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3333
3334         * class.cs (Indexer.Define): Added error tests for CS0415,
3335         CS0609.
3336
3337 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3338
3339         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3340         property code.
3341
3342 2004-06-23  Martin Baulig  <martin@ximian.com>
3343
3344         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3345         neither return nor throw, reset the barrier as well.  Fixes #60457.
3346
3347 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3348
3349         * class.cs : EventAttributes is now set to None by default.
3350           This fixes bug #60459.
3351
3352 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3353
3354         Fix bug #60219
3355         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3356         Don't throw exception but return null (it's sufficient now).
3357
3358 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3359
3360         * typemanager.cs (GetArgumentTypes): Faster implementation.
3361
3362 2004-06-18  Martin Baulig  <martin@ximian.com>
3363
3364         * attribute.cs (Attribute.Resolve): Check whether we're an
3365         EmptyCast which a Constant child.  Fixes #60333.
3366
3367 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3368
3369         * statement.cs (EmitCollectionForeach): Account for the fact that
3370         not all valuetypes are in areas which we can take the address of.
3371         For these variables, we store to a temporary variable. Also, make
3372         sure that we dont emit a `callvirt' on a valuetype method.
3373
3374 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3375
3376         * expression.cs (StackAlloc.DoReSolve): Added test for
3377         negative parameter (CS0247).
3378
3379 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3380
3381         Fix bug #59792
3382         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3383
3384 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3385
3386         Fix bug #59781
3387         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3388         ulong.
3389
3390 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3391
3392         Fix bug #58254 & cs1555.cs, cs1556.cs
3393         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3394
3395 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3396
3397         * cs-parser.jay: Added error CS1669 test for indexers.
3398
3399 2004-06-18  Martin Baulig  <martin@ximian.com>
3400
3401         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3402         argument.  Fixes #60441.
3403
3404 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3405         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3406         The name needs to have the actual name of the method in order
3407         for other tests (such as the one in OverloadResolve for Invoke
3408         on a delegate) to work. As well, it does not really help
3409         error reporting because the method group had multiple methods.
3410         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3411         Make profiling work.
3412         
3413 2004-06-13  Martin Baulig  <martin@ximian.com>
3414
3415         * cs-parser.jay: Don't allow generic attributes.
3416
3417 2004-06-13  Martin Baulig  <martin@ximian.com>
3418
3419         * class.cs (MemberBase.DoDefineBase): New protected method.
3420         (MemberBase.DoDefine): Compute the `flags' in the new
3421         DoDefineBase() which must be called first.
3422         (Method.Define): Call DoDefineBase() first so we have the flags
3423         when defining the generic method.
3424
3425         * cs-parser.jay (interface_method_declaration): Support generic methods.
3426
3427 2004-06-13  Martin Baulig  <martin@ximian.com>
3428
3429         * decl.cs (TypeName): Removed.
3430         (MemberName): Removed TypeName and MemberNow; now we just have
3431         MemberName.
3432
3433         * cs-parser.jay: Don't distinguish between type arguments and type
3434         parameters in the grammar and simplified the rules a bit.  The
3435         reduce/reduce conflicts are now gone (except the one we inherited
3436         from mcs).
3437
3438 2004-06-11  Martin Baulig  <martin@ximian.com>
3439
3440         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3441         call this twice: for params and varargs methods.
3442
3443 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3444
3445         * class.cs:
3446         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3447
3448 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3449
3450         * attribute.cs (Attribute.GetValidTargets): Made public.
3451
3452         * class.cs: 
3453         (AbstractPropertyEventMethod): New class for better code sharing.
3454         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3455         CS1667 report.
3456         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3457
3458 2004-06-09  Martin Baulig  <martin@ximian.com>
3459
3460         * cs-parser.jay: Removed a reduce/reduce conflict.
3461
3462 2004-06-03  Martin Baulig  <martin@ximian.com>
3463
3464         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3465         GetSimpleName() and return a SimpleName.
3466
3467         * ecore.cs (SimpleName.Arguments): New public field.
3468         (SimpleName): Added overloaded ctor which takes an additional
3469         TypeArguments argument.
3470         (SimpleName.SimpleNameResolve): Added support for generic methods.
3471         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3472         formerly in MemberAccess.DoResolve(), but we also need it in
3473         SimpleNameResolve().
3474
3475         * expression.cs (MemberAccess.DoResolve): Use the new
3476         MethodGroupExpr.ResolveGeneric().       
3477
3478 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3479
3480         * decl.cs: If possible, use lookuptypedirect here. We can only do
3481         this if there is no `.' after the namespace. Avoids using
3482         LookupType, which does lots of slow processing.
3483         (FindNestedType) New method, does what it says :-).
3484         * namespace.cs: use LookupTypeDirect.
3485         * rootcontext.cs: use membercache, if possible.
3486         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3487
3488 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3489
3490         * expression.cs:
3491         According to the spec, 
3492
3493         In a member access of the form E.I, if E is a single identifier,
3494         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3495         field, property, localvariable, or parameter with the same type as
3496         the meaning of E as a type-name (§3.8), then both possible
3497         meanings of E are permitted.
3498
3499         We did not check that E as a simple-name had the same type as E as
3500         a type name.
3501
3502         This trivial check gives us 5-7% on bootstrap time.
3503
3504 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3505
3506         * expression.cs (Invocation.OverloadResolve): Avoid the
3507         use of hashtables and boxing here by allocating on demand.
3508
3509 2004-05-30  Martin Baulig  <martin@ximian.com>
3510
3511         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3512         we're doing a silent lookup.  Don't try to lookup nested types in
3513         TypeManager.object_type (thanks to Ben Maurer).
3514
3515 2004-05-30  Martin Baulig  <martin@ximian.com>
3516
3517         Committing a patch from Ben Maurer.
3518
3519         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3520
3521 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3522
3523         * convert.cs: add a trivial cache for overload operator resolution.
3524
3525 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3526
3527         * attribute.cs
3528         (AttributeTester.GetObsoleteAttribute): Returns instance of
3529         ObsoleteAttribute when type is obsolete.
3530
3531         * class.cs
3532         (TypeContainer.VerifyObsoleteAttribute): Override.
3533         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3534         (MethodCode.VerifyObsoleteAttribute): Override.
3535         (MemberBase.VerifyObsoleteAttribute): Override.
3536
3537         * decl.cs
3538         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3539         and report proper error.
3540
3541         *delegate.cs
3542         (Delegate.VerifyObsoleteAttribute): Override.
3543
3544         * ecore.cs
3545         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3546         and report proper error.
3547         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3548
3549         * enum.cs
3550         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3551         and enum member.
3552
3553         * expression.cs
3554         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3555         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3556         Added test for ObsoleteAttribute.
3557
3558         * statement.cs
3559         (Catch): Derived from Statement.
3560
3561 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3562
3563         * decl.cs: If possible, use lookuptypedirect here. We can only do
3564         this if there is no `.' after the namespace. Avoids using
3565         LookupType, which does lots of slow processing.
3566         (FindNestedType) New method, does what it says :-).
3567         * namespace.cs: use LookupTypeDirect.
3568         * rootcontext.cs: use membercache, if possible.
3569         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3570
3571 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3572
3573         * expression.cs:
3574         According to the spec, 
3575
3576         In a member access of the form E.I, if E is a single identifier,
3577         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3578         field, property, localvariable, or parameter with the same type as
3579         the meaning of E as a type-name (§3.8), then both possible
3580         meanings of E are permitted.
3581
3582         We did not check that E as a simple-name had the same type as E as
3583         a type name.
3584
3585         This trivial check gives us 5-7% on bootstrap time.
3586
3587 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3588
3589         Fixed bug #59071 & cs0160.cs
3590         * statement.cs (Try.Resolve): Check here whether order of catch
3591         clauses matches their dependencies.
3592
3593 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3594
3595         Fixed bug #58624
3596         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
3597         unsafe type.
3598
3599 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3600
3601         * expression.cs (Invocation.OverloadResolve): Avoid the
3602         use of hashtables and boxing here by allocating on demand.
3603
3604 2004-05-30  Martin Baulig  <martin@ximian.com>
3605
3606         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3607         we're doing a silent lookup.  Don't try to lookup nested types in
3608         TypeManager.object_type (thanks to Ben Maurer).
3609
3610 2004-05-30  Martin Baulig  <martin@ximian.com>
3611
3612         Committing a patch from Ben Maurer.
3613
3614         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
3615
3616 2004-05-29  Martin Baulig  <martin@ximian.com>
3617
3618         * class.cs (IMethodData.ShouldIgnore): New method.
3619
3620         * typemanager.cs (TypeManager.MethodFlags): Don't take a
3621         `Location' argument, we don't need it anywhere.  Use
3622         `IMethodData.ShouldIgnore ()' instead of
3623         `MethodData.GetMethodFlags ()'.
3624         (TypeManager.AddMethod): Removed.
3625         (TypeManager.AddMethod2): Renamed to AddMethod.
3626
3627 2004-05-29  Martin Baulig  <martin@ximian.com>
3628
3629         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
3630
3631         * convert.cs (Convert.ImplicitReferenceConversion): If we're
3632         converting from a class type S to an interface type and we already
3633         have an object on the stack, don't box it again.  Fixes #52578.
3634
3635 2004-05-29  Martin Baulig  <martin@ximian.com>
3636
3637         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3638         Added support for `params' parameters.  Fixes #59267.
3639
3640 2004-05-29  Martin Baulig  <martin@ximian.com>
3641
3642         * literal.cs (NullPointer): Provide a private .ctor which sets
3643         `type' to TypeManager.object_type.  Fixes #59048.
3644
3645 2004-05-29  Martin Baulig  <martin@ximian.com>
3646
3647         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
3648         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
3649
3650         * ecore.cs (EventExpr.instance_expr): Make the field private.
3651
3652 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
3653
3654         Fixed bug #50080 & cs0214-2.cs
3655         * expression.cs (Cast.DoResolve): Check unsafe context here.
3656         
3657         * statement.cs (Resolve.DoResolve): Likewise.
3658
3659 2004-05-26  Martin Baulig  <martin@ximian.com>
3660
3661         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
3662
3663         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
3664         (RootContext.LookupType): Pass down the `silent' flag.
3665
3666 2004-05-25  Martin Baulig  <martin@ximian.com>
3667
3668         * expression.cs
3669         (MethodGroupExpr.IdenticalTypeName): New public property.
3670         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
3671         expression actually refers to a type.
3672
3673 2004-05-25  Martin Baulig  <martin@ximian.com>
3674
3675         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
3676         for #56176 and made it actually work.
3677
3678 2004-05-25  Martin Baulig  <martin@ximian.com>
3679
3680         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
3681         (FieldExpr, PropertyExpr): Override and implement
3682         CacheTemporaries.  Fixes #52279.
3683
3684 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
3685
3686         * location.cs: In the new compiler listing a file twice is a
3687         warning, not an error.
3688
3689 2004-05-24  Martin Baulig  <martin@ximian.com>
3690
3691         * enum.cs (Enum.DefineType): For the `BaseType' to be a
3692         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
3693
3694 2004-05-24  Martin Baulig  <martin@ximian.com>
3695
3696         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
3697         walking the `using' list.  Fixes #53921.
3698
3699 2004-05-24  Martin Baulig  <martin@ximian.com>
3700
3701         * const.cs (Const.LookupConstantValue): Added support for
3702         EmptyCast's; fixes #55251.
3703
3704 2004-05-24  Martin Baulig  <martin@ximian.com>
3705
3706         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
3707         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
3708         which does the CS0135 check.  The reason is that we first need to
3709         check whether the variable actually exists.
3710
3711 2004-05-24  Martin Baulig  <martin@ximian.com>
3712
3713         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
3714         than RootContext.LookupType() to find the explicit interface
3715         type.  Fixes #58584.
3716
3717 2004-05-24  Raja R Harinath  <rharinath@novell.com>
3718
3719         * Makefile: Simplify.  Use executable.make.
3720         * mcs.exe.sources: New file.  List of sources of mcs.exe.
3721
3722 2004-05-24  Anders Carlsson  <andersca@gnome.org>
3723
3724         * decl.cs:
3725         * enum.cs:
3726         Use the invariant culture when doing String.Compare for CLS case
3727         sensitivity.
3728         
3729 2004-05-23  Martin Baulig  <martin@ximian.com>
3730
3731         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
3732         don't have any dots.  Fixes #52622, added cs0246-8.cs.
3733
3734         * namespace.cs (NamespaceEntry.Lookup): Likewise.
3735
3736 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3737
3738         * class.cs (MemberBase.Define): Reuse MemberType member for 
3739         resolved type. Other methods can use it too.
3740
3741 2004-05-23  Martin Baulig  <martin@ximian.com>
3742
3743         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
3744         the variable also exists in the current block (otherwise, we need
3745         to report a CS0103).  Fixes #58670.
3746
3747 2004-05-23  Martin Baulig  <martin@ximian.com>
3748
3749         * flowanalysis.cs (Reachability.Reachable): Compute this
3750         on-the-fly rather than storing it as a field.
3751
3752 2004-05-23  Martin Baulig  <martin@ximian.com>
3753
3754         * flowanalysis.cs (Reachability.And): Manually compute the
3755         resulting `barrier' from the reachability.      
3756        
3757 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3758
3759         Fix bug #57835
3760         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
3761         instance of ObsoleteAttribute when symbol is obsolete.
3762
3763         * class.cs
3764         (IMethodData): Extended interface for ObsoleteAttribute support.
3765
3766 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3767
3768         * attribute.cs: Fix bug #55970
3769
3770 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3771
3772         Fix bug #52705
3773         * attribute.cs
3774         (GetObsoleteAttribute): New method. Creates the instance of
3775         ObsoleteAttribute.
3776         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
3777         ObsoleteAttribute when member is obsolete.
3778         (AttributeTester.Report_ObsoleteMessage): Common method for
3779         Obsolete error/warning reporting.
3780
3781         * class.cs
3782         (TypeContainer.base_classs_type): New member for storing parent type.
3783
3784         * decl.cs
3785         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
3786         for this MemberCore.
3787
3788 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3789
3790         * attribute.cs, const.cs: Fix bug #58590
3791
3792 2004-05-21  Martin Baulig  <martin@ximian.com>
3793
3794         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
3795         out parameters if the end of the method is unreachable.  Fixes
3796         #58098. 
3797
3798 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3799
3800         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
3801         Hari was right, why extra method.
3802
3803 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3804
3805         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
3806
3807 2004-05-20  Martin Baulig  <martin@ximian.com>
3808
3809         * delegate.cs: Convert this file to Unix mode - like the original
3810         version in mcs is.
3811
3812 2004-05-20  Martin Baulig  <martin@ximian.com>
3813
3814         * attribute.cs: Convert this file to Unix mode - like the original
3815         version in mcs is.
3816
3817 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
3818
3819        Fix bug #58688 (MCS does not report error when the same attribute
3820        is assigned twice)
3821
3822        * attribute.cs (Attribute.Emit): Distinction between null and default.
3823
3824 2004-05-19  Raja R Harinath  <rharinath@novell.com>
3825
3826        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
3827        of a top-level attribute without an attribute target.
3828        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
3829        Make non-static.
3830        (Attribute.Conditional_GetConditionName), 
3831        (Attribute.Obsolete_GetObsoleteMessage): Update.
3832        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
3833        part of ScanForIndexerName.
3834        (Attribute.CanIgnoreInvalidAttribute): New function.
3835        (Attribute.ScanForIndexerName): Move to ...
3836        (Attributes.ScanForIndexerName): ... here.
3837        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
3838        (Attributes.Search): New internal variant that can choose not to
3839        complain if types aren't resolved.  The original signature now
3840        complains.
3841        (Attributes.GetClsCompliantAttribute): Use internal variant, with
3842        complaints suppressed.
3843        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
3844        only if it not useful.
3845        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
3846        top-level for attributes that are shared between the assembly
3847        and a top-level class.
3848        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
3849        * class.cs: Update to reflect changes.
3850        (DefineIndexers): Fuse loops.
3851        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
3852        a couple more variants of attribute names.
3853
3854 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
3855
3856         Fix bug #52585 (Implemented explicit attribute declaration)
3857
3858         * attribute.cs:
3859         (Attributable.ValidAttributeTargets): New abstract method. It gets
3860         list of valid attribute targets for explicit target declaration.
3861         (Attribute.Target): It holds target itself.
3862         (AttributeSection): Removed.
3863         (Attribute.CheckTargets): New method. It checks whether attribute
3864         target is valid for the current element.
3865
3866         * class.cs:
3867         (EventProperty): New class. For events that are declared like
3868         property (with add and remove accessors).
3869         (EventField): New class. For events that are declared like field.
3870         class.cs
3871
3872         * cs-parser.jay: Implemented explicit attribute target declaration.
3873
3874         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
3875         Override ValidAttributeTargets.
3876
3877         * parameter.cs:
3878         (ReturnParameter): Class for applying custom attributes on 
3879         the return type.
3880         (ParameterAtribute): New class. Class for applying custom
3881         attributes on the parameter type.
3882
3883 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
3884
3885         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
3886         definitions. 
3887
3888         (Method): Allow UNSAFE here.
3889
3890         * modifiers.cs: Support unsafe reporting.
3891
3892 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
3893
3894         * decl.cs: Fix bug #58478.
3895
3896 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3897
3898         * statement.cs: When checking for unreachable code on an EmptyStatement,
3899         set the location. Fixes bug #58488.
3900
3901 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
3902
3903         * driver.cs: Add -pkg handling.
3904
3905         From Gonzalo: UseShelLExecute=false
3906
3907 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
3908
3909         * attribute.cs:
3910         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
3911         for attribute.
3912         (Attribute.IsClsCompliaceRequired): Moved to base for better
3913         accesibility.
3914         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
3915         when attribute is AttributeUsageAttribute.
3916         (Attribute.GetValidTargets): Simplified.
3917         (Attribute.GetAttributeUsage): New method returns AttributeUsage
3918         attribute for this type.
3919         (Attribute.ApplyAttributes): Method renamed to Emit and make
3920         non-static.
3921         (GlobalAttributeSection): New class for special handling of global
3922         attributes (assembly, module).
3923         (AttributeSection.Emit): New method.
3924
3925         * class.cs: Implemented Attributable abstract methods.
3926         (MethodCore.LabelParameters): Moved to Parameter class.
3927         (Accessor): Is back simple class.
3928         (PropertyMethod): Implemented Attributable abstract class.
3929         (DelegateMethod): Implemented Attributable abstract class.
3930         (Event): New constructor for disctintion between normal Event
3931         and Event with accessors.
3932
3933         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
3934
3935         * codegen.cs, const.cs, decl.cs, delegate.cs:
3936         (CommonAssemblyModulClass): Implemented Attributable abstract class
3937         and simplified.
3938
3939         * enum.cs: Implement IAttributeSupport interface.
3940         (EnumMember): New class for emum members. Implemented Attributable
3941         abstract class
3942
3943         * parameter.cs:
3944         (ParameterBase): Is abstract.
3945         (ReturnParameter): New class for easier [return:] attribute handling.
3946
3947         * typemanager.cs: Removed builder_to_attr.
3948
3949 2004-05-11  Raja R Harinath  <rharinath@novell.com>
3950
3951         Fix bug #57151.
3952         * attribute.cs (Attribute.GetPositionalValue): New function.
3953         * class.cs (TypeContainer.VerifyMembers): New function.
3954         (TypeContainer.Emit): Use it.
3955         (ClassOrStruct): New base class for Class and Struct.
3956         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
3957         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
3958         class.
3959         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
3960         then each non-static field should have a FieldOffset attribute.
3961         Otherwise, none of the fields should have a FieldOffset attribute.
3962         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
3963         and FieldOffset attributes.
3964         * typemanager.cs (TypeManager.struct_layout_attribute_type)
3965         (TypeManager.field_offset_attribute_type): New core types.
3966         (TypeManager.InitCoreTypes): Initialize them.
3967
3968 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
3969
3970         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
3971         Return correct type.
3972         From bug #58270.
3973
3974 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
3975
3976         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
3977         be implicitly converted to ulong.
3978         
3979         * expression.cs: The logic for allowing operator &, | and ^ worked
3980         was wrong, it worked before because we did not report an error in
3981         an else branch.  Fixes 57895.
3982
3983         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
3984         allow volatile fields to be reference types.
3985
3986 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
3987
3988         * driver.cs: Add support for /debug-
3989
3990 2004-05-07  Raja R Harinath  <rharinath@novell.com>
3991
3992         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
3993         Add a 'complain' parameter to silence errors.
3994         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
3995         silently overlooked type-resolutions.
3996         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
3997         to reflect changes.
3998         (Attributes.Search): New function.
3999         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4000         (Attributes.GetAttributeFullName): Remove hack.
4001         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4002         Update to reflect changes.
4003         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4004         Use Attributes.Search instead of nested loops.
4005
4006 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4007
4008         * decl.cs:
4009         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4010         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4011         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4012
4013         * report.cs: (Report.Warning): Renamed to Warning_T because of
4014         parameter collision.
4015
4016 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4017
4018         * expression.cs (MemberAccess.ResolveMemberAccess):
4019         Exit with non-zero status after Report.Error.
4020         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4021         Likewise.
4022         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4023
4024 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4025
4026         * support.cs: Don't hang when the file is empty.
4027
4028 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4029
4030         * support.cs: In SeekableStreamReader, compute the preamble size of the
4031           underlying stream. Position changes should take into account that initial
4032           count of bytes.
4033
4034 2004-05-03  Todd Berman  <tberman@sevenl.net>
4035
4036         * driver.cs: remove unused GetSysVersion function.
4037
4038 2004-05-03  Todd Berman  <tberman@sevenl.net>
4039
4040         * driver.cs: Remove the hack from saturday, as well as the hack
4041         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4042         link_paths to get that bit proper.
4043
4044 2004-05-01  Todd Berman  <tberman@sevenl.net>
4045
4046         * driver.cs: Try a LoadFrom before a Load, this checks the current
4047         path. This is currently a bug in mono that is be fixed, however, this
4048         provides a workaround for now. This will be removed when the bug
4049         is fixed.
4050
4051 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4052
4053         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4054         incomplete key pairs (#57941).
4055
4056 2004-05-01  Todd Berman  <tberman@sevenl.net>
4057
4058         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4059         from the GAC
4060
4061 2004-04-30  Jackson Harper  <jackson@ximian.com>
4062
4063         * codegen.cs: Open keys readonly.
4064         
4065 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4066
4067         * typemanager.cs: don't report cyclic struct layout when a struct
4068         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4069         which has 2 Pango.Rectangle fields.
4070
4071 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4072
4073         * expression.cs: Handle IntPtr comparisons with IL code
4074         rather than a method call.
4075
4076 2004-04-29  Martin Baulig  <martin@ximian.com>
4077
4078         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4079         the list of PropertyInfo's in class hierarchy and find the
4080         accessor.  Fixes #56013.
4081
4082 2004-04-29  Martin Baulig  <martin@ximian.com>
4083
4084         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4085
4086 2004-04-29  Martin Baulig  <martin@ximian.com>
4087
4088         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4089
4090         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4091
4092 2004-04-29  Martin Baulig  <martin@ximian.com>
4093
4094         * class.cs (ConstructorInitializer.Resolve): Check whether the
4095         parent .ctor is accessible.  Fixes #52146.
4096
4097 2004-04-29  Martin Baulig  <martin@ximian.com>
4098
4099         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4100
4101         * statement.cs (Using.EmitLocalVariableDecls): Use
4102         TypeManager.idisposable_type, not typeof (IDisposable).
4103         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4104
4105 2004-04-29  Martin Baulig  <martin@ximian.com>
4106
4107         * class.cs (Event.Define): Don't emit the field and don't set
4108         RTSpecialName and SpecialName for events on interfaces.  Fixes
4109         #57703. 
4110
4111 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4112
4113         Refactor Attribute.ApplyAttributes.
4114         * attribute.cs (Attributable): New base class for objects that can
4115         have Attributes applied on them.
4116         (Attribute): Make AttributeUsage fields public.
4117         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4118         (Attribute.IsInternalCall): New property.
4119         (Attribute.UsageAttr): Convert to a public read-only property.
4120         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4121         (Attribute.ResolveType, Attribute.Resolve)
4122         (Attribute.ScanForIndexerName): Update to reflect changes.
4123         (Attribute.CheckAttributeTarget): Re-format.
4124         (Attribute.ApplyAttributes): Refactor, to various
4125         Attributable.ApplyAttributeBuilder methods.
4126         * decl.cs (MemberCore): Make Attributable.
4127         * class.cs (Accessor): Make Attributable.
4128         (MethodData.ApplyAttributes): Use proper attribute types, not
4129         attribute names.
4130         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4131         (TypeContainer.ApplyAttributeBuilder)
4132         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4133         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4134         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4135         (Operator.ApplyAttributeBuilder): New factored-out methods.
4136         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4137         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4138         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4139         * parameter.cs (ParameterBase): New Attributable base class
4140         that can also represent Return types.
4141         (Parameter): Update to the changes.
4142
4143 2004-04-29  Jackson Harper  <jackson@ximian.com>
4144
4145         * driver.cs: Prefer the corlib system version when looking for
4146         assemblies in the GAC. This is still a hack, but its a better hack
4147         now.
4148         
4149 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4150
4151         * decl.cs, enum.cs: Improved error 3005 reporting.
4152   
4153         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4154         (related_symbols): New private member for list of symbols
4155         related to reported error/warning.
4156         
4157         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4158
4159 2004-04-29  Martin Baulig  <martin@ximian.com>
4160
4161         * ecore.cs (Expression.Constantify): If we're an enum and
4162         TypeManager.TypeToCoreType() doesn't give us another type, use
4163         t.UnderlyingSystemType.  Fixes #56178.  
4164
4165 2004-04-29  Martin Baulig  <martin@ximian.com>
4166
4167         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4168         interfaces and for each interface, only add members directly
4169         declared in that interface.  Fixes #53255.
4170
4171 2004-04-28  Martin Baulig  <martin@ximian.com>
4172
4173         * expression.cs (ConditionalLogicalOperator): Use a temporary
4174         variable for `left' to avoid that we evaluate it more than once;
4175         bug #52588.
4176
4177 2004-04-28  Martin Baulig  <martin@ximian.com>
4178
4179         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4180         `void[]' (CS1547).
4181
4182 2004-04-28  Martin Baulig  <martin@ximian.com>
4183
4184         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4185         void (CS1547).
4186
4187         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4188         whether the type is not void (CS1547).
4189
4190 2004-04-28  Martin Baulig  <martin@ximian.com>
4191
4192         * expression.cs (Unary.DoResolveLValue): Override this and report
4193         CS0131 for anything but Operator.Indirection.
4194
4195 2004-04-28  Martin Baulig  <martin@ximian.com>
4196
4197         Committing a patch from Ben Maurer; see bug #50820.
4198
4199         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4200         check for classes.
4201
4202         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4203         classes.        
4204
4205 2004-04-28  Martin Baulig  <martin@ximian.com>
4206
4207         Committing a patch from Ben Maurer; see bug #50820.
4208
4209         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4210         check for classes.
4211
4212         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4213         classes.        
4214
4215 2004-04-28  Martin Baulig  <martin@ximian.com>
4216
4217         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4218         (Block.AddLabel): Call DoLookupLabel() to only search in the
4219         current block.
4220
4221 2004-04-28  Martin Baulig  <martin@ximian.com>
4222
4223         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4224         comparing StringConstants and NullLiterals in Equality and Inequality.
4225
4226 2004-04-28  Jackson Harper  <jackson@ximian.com>
4227
4228         * driver.cs: Attempt to load referenced assemblies from the
4229         GAC. This is the quick and dirty version of this method that
4230         doesnt take into account versions and just takes the first
4231         canidate found. Will be good enough for now as we will not have more
4232         then one version installed into the GAC until I update this method.
4233
4234 2004-04-28  Martin Baulig  <martin@ximian.com>
4235
4236         * typemanager.cs (TypeManager.CheckStructCycles): New public
4237         static method to check for cycles in the struct layout.
4238
4239         * rootcontext.cs (RootContext.PopulateTypes): Call
4240         TypeManager.CheckStructCycles() for each TypeContainer.
4241         [Note: We only need to visit each type once.]
4242
4243 2004-04-28  Martin Baulig  <martin@ximian.com>
4244
4245         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4246
4247         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4248         success and added `out object value'.  Use a `bool resolved' field
4249         to check whether we've already been called rather than
4250         `ConstantValue != null' since this breaks for NullLiterals.
4251
4252 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4253
4254         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4255         setting of this flag, since the 'set' method may be non-public.
4256
4257 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4258
4259         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4260         check on current_vector.Block.
4261
4262 2004-04-27  Martin Baulig  <martin@ximian.com>
4263
4264         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4265         a field initializer.  Fixes #56459.
4266
4267 2004-04-27  Martin Baulig  <martin@ximian.com>
4268
4269         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4270         we're not attempting to use an indexer.  Fixes #52154.
4271
4272 2004-04-27  Martin Baulig  <martin@ximian.com>
4273
4274         * statement.cs (Return): Don't create a return label if we don't
4275         need it; reverts my change from January 20th.  Thanks to Ben
4276         Maurer for this.
4277
4278 2004-04-27  Martin Baulig  <martin@ximian.com>
4279
4280         According to the spec, `goto' can only leave a nested scope, but
4281         never enter it.
4282
4283         * statement.cs (Block.LookupLabel): Only lookup in the current
4284         block, don't recurse into parent or child blocks.
4285         (Block.AddLabel): Check in parent and child blocks, report
4286         CS0140/CS0158 if we find a duplicate.
4287         (Block): Removed this indexer for label lookups.
4288         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4289         this already does the error reporting for us.
4290
4291         * flowanalysis.cs
4292         (FlowBranching.UsageVector.Block): New public variable; may be null.
4293         (FlowBranching.CreateSibling): Added `Block' argument.
4294         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4295         label for the target of a `goto' and check whether we're not
4296         leaving a `finally'.
4297
4298 2004-04-27  Martin Baulig  <martin@ximian.com>
4299
4300         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4301         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4302         just for returns).
4303
4304 2004-04-27  Martin Baulig  <martin@ximian.com>
4305
4306         * statement.cs (Block.AddLabel): Also check for implicit blocks
4307         and added a CS0158 check.
4308
4309 2004-04-27  Martin Baulig  <martin@ximian.com>
4310
4311         * flowanalysis.cs (FlowBranchingLoop): New class.
4312         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4313         UsageVector's instead of an ArrayList.
4314         (FlowBranching.Label): Likewise.
4315         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4316         (FlowBranching.AddBreakVector): New method.
4317
4318 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4319
4320         * attribute.cs: Small regression fix: only convert the type if we
4321         the type is different, fixes System.Drawing build.
4322
4323 2004-04-27  Martin Baulig  <martin@ximian.com>
4324
4325         * attribute.cs (Attribute.Resolve): If we have a constant value
4326         for a named field or property, implicity convert it to the correct
4327         type.
4328
4329 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4330
4331         * statement.cs (Block.Block): Implicit blocks share
4332         'child_variable_names' fields with parent blocks.
4333         (Block.AddChildVariableNames): Remove.
4334         (Block.AddVariable): Mark variable as "used by a child block" in
4335         every surrounding block.
4336         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4337         been used in a child block, complain about violation of "Invariant
4338         meaning in blocks" rule.
4339         * cs-parser.jay (declare_local_variables): Don't use
4340         AddChildVariableNames.
4341         (foreach_statement): Don't create an implicit block: 'foreach'
4342         introduces a scope.
4343
4344 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4345
4346         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4347         converting from 0L to ulong.  Fixes 57522.
4348
4349 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4350
4351         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4352         derived class hides via 'new' keyword field from base class (test-242.cs).
4353         TODO: Handle this in the more general way.
4354         
4355         * class.cs (CheckBase): Ditto.
4356
4357 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4358
4359         * decl.cs (caching_flags): New member for storing cached values
4360         as bit flags.
4361         (MemberCore.Flags): New enum where bit flags for caching_flags
4362         are defined.
4363         (MemberCore.cls_compliance): Moved to caching_flags.
4364         (DeclSpace.Created): Moved to caching_flags.
4365
4366         * class.cs: Use caching_flags instead of DeclSpace.Created
4367         
4368 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4369
4370         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4371         if we are only a derived class, not a nested class.
4372
4373         * typemanager.cs: Same as above, but do this at the MemberLookup
4374         level (used by field and methods, properties are handled in
4375         PropertyExpr).   Allow for the qualified access if we are a nested
4376         method. 
4377
4378 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4379
4380         * class.cs: Refactoring.
4381         (IMethodData): New inteface; Holds links to parent members
4382         to avoid member duplication (reduced memory allocation).
4383         (Method): Implemented IMethodData interface.
4384         (PropertyBase): New inner classes for get/set methods.
4385         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4386         (Event): New inner classes for add/remove methods.
4387         (Event.DelegateMethod): Implemented IMethodData interface.
4388
4389         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4390         EmitContext (related to class.cs refactoring).
4391
4392 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4393
4394         * delegate.cs (Delegate.VerifyApplicability): If the number of
4395         arguments are the same as the number of parameters, first try to
4396         verify applicability ignoring  any 'params' modifier on the last
4397         parameter.
4398         Fixes #56442.
4399
4400 2004-04-08  Martin Baulig  <martin@ximian.com>
4401
4402         Merged latest changes into gmcs.  Please keep this comment in
4403         here, it makes it easier for me to see what changed in MCS since
4404         the last time I merged.
4405
4406 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4407
4408         * class.cs (TypeContainer.AddIndexer): Use
4409         'ExplicitInterfaceName' to determine if interface name was
4410         explicitly specified.  'InterfaceType' is not initialized at this time.
4411         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4412         Indexers array is already in the required order.  Initialize
4413         'IndexerName' only if there are normal indexers.
4414         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4415         (TypeContainer.Emit): Emit DefaultMember attribute only if
4416         IndexerName is initialized.
4417         Fixes #56300.
4418
4419 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4420
4421         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4422         Fixes #57007
4423
4424 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4425
4426         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4427         attributes.
4428         Fix for #56456.
4429
4430         * attribute.cs (Attribute.Resolve): Check for duplicate named
4431         attributes.
4432         Fix for #56463.
4433
4434 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4435
4436         * iterators.cs (MarkYield): track whether we are in an exception,
4437         and generate code accordingly.  Use a temporary value to store the
4438         result for our state.
4439
4440         I had ignored a bit the interaction of try/catch with iterators
4441         since their behavior was not entirely obvious, but now it is
4442         possible to verify that our behavior is the same as MS .NET 2.0
4443
4444         Fixes 54814
4445
4446 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4447
4448         * iterators.cs: Avoid creating temporaries if there is no work to
4449         do. 
4450
4451         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4452         Enumerations, use TypeManager.EnumToUnderlying and call
4453         recursively. 
4454
4455         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4456         bug #57013
4457
4458         (This.Emit): Use EmitContext.EmitThis to emit our
4459         instance variable.
4460
4461         (This.EmitAssign): Ditto.
4462
4463         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4464         codepaths, we will move all the functionality into
4465         Mono.CSharp.This 
4466
4467         (FieldExpr.EmitAssign): Ditto.
4468
4469         This fixes several hidden bugs that I uncovered while doing a code
4470         review of this today.
4471
4472         * codegen.cs (EmitThis): reworked so the semantics are more clear
4473         and also support value types "this" instances.
4474
4475         * iterators.cs: Changed so that for iterators in value types, we
4476         do not pass the value type as a parameter.  
4477
4478         Initialization of the enumerator helpers is now done in the caller
4479         instead of passing the parameters to the constructors and having
4480         the constructor set the fields.
4481
4482         The fields have now `assembly' visibility instead of private.
4483
4484 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4485
4486         * expression.cs (Argument.Resolve): Check if fields passed as ref
4487         or out are contained in a MarshalByRefObject.
4488
4489         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4490         another compiler type.
4491
4492 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4493
4494         * class.cs (Indexer.Define): use the new name checking method.
4495         Also, return false on an error.
4496         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4497         (is_identifier_[start/part]_character): make static.
4498
4499 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4500
4501         * expression.cs (Binary.ResolveOperator): Do no append strings
4502         twice: since we can be invoked more than once (array evaluation)
4503         on the same concatenation, take care of this here.  Based on a fix
4504         from Ben (bug #56454)
4505
4506 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4507
4508         * codegen.cs: Fix another case where CS1548 must be reported (when 
4509         delay-sign isn't specified and no private is available #56564). Fix
4510         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4511         error when MCS is used on the MS runtime and we need to delay-sign 
4512         (which seems unsupported by AssemblyBuilder - see #56621).
4513
4514 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4515
4516         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4517         (TypeManager.ComputeNamespaces): Faster implementation for
4518         Microsoft runtime.
4519
4520         * compiler.csproj: Updated AssemblyName to mcs.
4521
4522 2004-05-11  Jackson Harper  <jackson@ximian.com>
4523
4524         * Makefile: Preserve MONO_PATH
4525         
4526 2004-05-11  Jackson Harper  <jackson@ximian.com>
4527
4528         * Makefile: Use mono and mcs to build gmcs
4529         
4530 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4531
4532         * codegen.cs: Add patch from Robert Shade
4533         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4534         sync with mcs.
4535
4536 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4537
4538         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4539         incomplete key pairs (#57941).
4540
4541 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4542
4543         * codegen.cs: Fix another case where CS1548 must be reported (when 
4544         delay-sign isn't specified and no private is available #56564). Fix
4545         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4546         error when MCS is used on the MS runtime and we need to delay-sign 
4547         (which seems unsupported by AssemblyBuilder - see #56621).
4548
4549 2004-04-29  Jackson Harper  <jackson@ximian.com>
4550
4551         * Makefile: Set MONO_PATH to use the bootstrap corlib
4552         * driver.cs: Check the GAC for referenced assemblies.
4553                 
4554 2004-04-29  Martin Baulig  <martin@ximian.com>
4555
4556         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4557
4558 2004-04-07  Martin Baulig  <martin@ximian.com>
4559
4560         * expression.cs (Binary.ResolveOperator): Added special case for
4561         Equality/Inequality between a type parameter and a null literal.
4562
4563 2004-04-07  Martin Baulig  <martin@ximian.com>
4564
4565         * convert.cs: Check null literal -> type parameter conversions.
4566
4567 2004-04-07  Martin Baulig  <martin@ximian.com>
4568
4569         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4570         `class' and `struct' constraints.
4571
4572 2004-04-07  Martin Baulig  <martin@ximian.com>
4573
4574         * generic.cs (SpecialConstraint): New public enum.
4575         (Constraints.Resolve): Added support for the `class' and `struct'
4576         constraints.
4577
4578         * cs-parser.jay (type_parameter_constraint): Added support for the
4579         `class' and `struct' constraints.
4580
4581 2004-04-07  Martin Baulig  <martin@ximian.com>
4582
4583         * support.cs (GenericConstraints): Replaced `Types' by
4584         `ClassConstraint' and `InterfaceConstraints'; added
4585         `HasClassConstraint'.   
4586
4587 2004-04-07  Martin Baulig  <martin@ximian.com>
4588
4589         * generic.cs
4590         (Constraints.InterfaceConstraints): New public property.
4591         (Constraints.Types): Make this property public
4592         (TypeParameter): Implement IMemberContainer.
4593         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
4594         instead of a TypeBuilder/MethodBuilder; pass the interface
4595         constraints to TypeManager.AddTypeParameter().
4596         (TypeParameter.DefineType): Just take an EmitContext and no
4597         TypeBuilder/MethodBuilder.  Use the new public API.
4598
4599         * typemanager.cs (TypeManager.AddTypeParameter): Added
4600         `TypeExpr[]' argument; add the interfaces to the
4601         `builder_to_ifaces' hash.
4602         (TypeManager.LookupMemberContainer): For
4603         GenericTypeParameterBuilders, get the TypeParameter from the
4604         `builder_to_type_param'.
4605         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
4606         the TypeParameter and call FindMembers on it.
4607
4608 2004-04-07  Martin Baulig  <martin@ximian.com>
4609
4610         * class.cs
4611         (MethodCore.GenericMethod): Moved this field here from Method.
4612         (MethodCore.IsDuplicateImplementation): Take the number of type
4613         parameters into account if we're a generic method.
4614
4615         * expression.cs (Invocation.InferTypeArguments): Don't return true
4616         if `arguments' is null; we still need to check whether we actually
4617         don't need to infer anything in this case.
4618         (MemberAccess): Merged the functionality from GenericMemberAccess
4619         into this class.
4620
4621         * generic.cs (GenericMemberAccess): Removed.
4622
4623 2004-04-05  Martin Baulig  <martin@ximian.com>
4624
4625         * decl.cs (MemberCore): For generic classes, interfaces and
4626         structs, `Name' now includes the number of type parameters
4627         ("Stack!1.Node!1").
4628         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
4629         encode the number of type arguments in the type name.
4630
4631         * expression.cs (Expression.MemberLookup): Removed the
4632         `num_type_args' argument; we now encode the number of type
4633         arguments in the type name.
4634
4635         * ecore.cs (SimpleName): Encode the number of type arguments in
4636         the type name itself.
4637
4638         * generic.cs (ConstructedType): Likewise.
4639
4640         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
4641         `MemberName'; we now include the number of type parameters in the
4642         type name.
4643
4644         * typemanager.cs (TypeManager.CheckGeneric): Removed.
4645         (TypeManager.MemberLookup): Removed the
4646         `num_type_args' argument; we now encode the number of type
4647         arguments in the type name.     
4648
4649 2004-04-03  Martin Baulig  <martin@ximian.com>
4650
4651         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
4652         (MemberCore.MemberName): Moved here from MemberBase.
4653         (DeclSpace.SetParameterInfo): Just take the constraints as an
4654         ArrayList; we already have the type parameters in our
4655         `MemberName'; also do the CS0080 reporting here.
4656
4657         * cs-parser.jay (struct_declaration): Use `member_name' instead of
4658         `IDENTIFIER opt_type_parameter_list'; when constructing our
4659         `MemberName', it'll already include our type parameters.
4660         (class_declaration, interface_declaration): Likewise.
4661         (delegate_declaration): Likewise.
4662         (MakeName): Take a MemberName and return a MemberName.
4663         The following two changes are required to avoid shift/reduce conflicts:
4664         (member_name): Don't include a TypeName anymore; ie. this is now
4665         just 'IDENTIFIER opt_type_parameter_list'.
4666         (property_declaration, event_declaration): Use a
4667         `namespace_or_type_name' instead of a `member_name'.            
4668
4669 2004-04-03  Martin Baulig  <martin@ximian.com>
4670
4671         * decl.cs (MemberName): Renamed to `TypeName' and created a new
4672         `MemberName' class.
4673         (TypeName): Formerly known as MemberName.
4674
4675         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
4676         instead of a `MemberName'.
4677
4678         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
4679         (member_name): New rule; create a MemberName.
4680
4681 2004-04-02  Martin Baulig  <martin@ximian.com>
4682
4683         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
4684         (CS0305 and CS0308).
4685
4686 2004-04-02  Martin Baulig  <martin@ximian.com>
4687
4688         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
4689         support for nested types.
4690
4691 2004-04-02  Martin Baulig  <martin@ximian.com>
4692
4693         * ecore.cs (IAlias): New public interface.
4694         (TypeExpr, TypeExpression): Implement IAlias.
4695         (TypeAliasExpression): New public class.
4696
4697         * namespace.cs (Namespace): Implement IAlias.
4698         (Namespace.Lookup): Return an IAlias instead on an object.
4699         (Namespace.DefineName): Take an IAlias instead of an object.
4700         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
4701         an object.
4702         (NamespaceEntry.UsingAlias): Take a Membername instead of an
4703         Expression.
4704         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
4705         object.
4706         (NamespaceEntry.Lookup): Likewise.
4707
4708         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
4709         instead of a Type.      
4710
4711         * decl.cs (DeclSpace): Implement IAlias.
4712         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
4713
4714         * generic.cs (ConstructedType): Improved error checking.
4715
4716 2004-04-02  Martin Baulig  <martin@ximian.com>
4717
4718         * convert.cs: Added type parameter conversions.
4719
4720         * ecore.cs
4721         (UnboxCast.Emit): Emit an `unbox.any' for type params.
4722         (ClassCast.Emit): If the source type is a type parameter, box it.
4723         If the target type is a type parameter, emit an `unbox.any'
4724         instead of a `classcast'.1      
4725
4726 2004-04-01  Martin Baulig  <martin@ximian.com>
4727
4728         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
4729
4730 2004-04-01  Martin Baulig  <martin@ximian.com>
4731
4732         * generic.cs (ConstructedType.CheckConstraints): Use
4733         Convert.ImplicitStandardConversionExists(); user-defined implicit
4734         conversions are not allowed according to the spec.
4735
4736 2004-03-30  Martin Baulig  <martin@ximian.com>
4737
4738         * expression.cs (New): Added support for type parameters.
4739
4740         * typemanager.cs
4741         (TypeManager.activator_type): New public static field.
4742         (TypeManager.activator_create_instance): Likewise.
4743
4744 2004-03-30  Martin Baulig  <martin@ximian.com>
4745
4746         * typemanager.cs (TypeManager.HasConstructorConstraint): New
4747         public method.
4748
4749 2004-03-30  Martin Baulig  <martin@ximian.com>
4750
4751         * generic.cs (ConstructedType.CheckConstraints): Actually follow
4752         the spec here: the argument type must be convertible to the
4753         constraints.
4754
4755 2004-03-30  Martin Baulig  <martin@ximian.com>
4756
4757         * generic.cs
4758         (TypeParameter.Define, TypeParameter.DefineMethod): Call
4759         TypeManager.AddTypeParameter().
4760         (ConstructedType.CheckConstraints): Re-enable this and actually
4761         check whether we have a constructor constraint.
4762
4763         * typemanager.cs
4764         (TypeManager.builder_to_type_param): New static field.
4765         (TypeManager.AddTypeParameter): New static method.
4766         (TypeManager.LookupTypeParameter): New public method.
4767
4768 2004-03-30  Martin Baulig  <martin@ximian.com>
4769
4770         * generic.cs (TypeParameter.DefineType): Return a boolean and use
4771         the new API to actually define the constructor constraint.
4772
4773         * typemanager.cs
4774         (TypeManager.new_constraint_attr_type): New static field.
4775         (TypeManager.InitCoreTypes): Initialize it.
4776
4777 2004-03-30  Martin Baulig  <martin@ximian.com>
4778
4779         * generic.cs (Constraints): Completed error checking, use correct
4780         error numbers.
4781
4782 2004-03-29  Martin Baulig  <martin@ximian.com>
4783
4784         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
4785
4786         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4787         public version which takes a `ParameterData pd' instead of an
4788         `ArrayList args'.
4789
4790 2004-03-29  Martin Baulig  <martin@ximian.com>
4791
4792         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
4793         not a MethodInfo.       
4794
4795 2004-03-29  Martin Baulig  <martin@ximian.com>
4796
4797         * expression.cs (Argument.ResolveMethodGroup): If we're a
4798         ConstructedType, call GetMemberAccess() on it.  
4799
4800 2004-03-29  Martin Baulig  <martin@ximian.com>
4801
4802         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
4803         (MethodCore.CheckGenericOverride): When overriding a generic
4804         method, check whether the constraints match.
4805
4806         * support.cs (GenericConstraints): New public interface.
4807         (ParameterData.GenericConstraints): New public method.
4808
4809         * parameter.cs (Parameter.Resolve): Check whether we're a generic
4810         method parameter and compute our constraints if appropriate.
4811         (Parameter.GenericConstraints): New public property.
4812
4813         * generic.cs (Constraints): Implement GenericConstraints.
4814
4815 2004-03-29  Martin Baulig  <martin@ximian.com>
4816
4817         * decl.cs (MemberCache.FindMemberToOverride): Use
4818         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
4819
4820 2004-03-29  Martin Baulig  <martin@ximian.com>
4821
4822         * generic.cs (GenericMethod.Define): Resolve our type parameters.
4823
4824 2004-03-29  Martin Baulig  <martin@ximian.com>
4825
4826         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
4827         not allowed on non-generic declarations").
4828
4829 2004-03-29  Martin Baulig  <martin@ximian.com>
4830
4831         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4832         public version of this method.
4833
4834         * class.cs (MethodCore.IsDuplicateImplementation): Use
4835         Invocation.InferTypeArguments() to check this.
4836
4837 2004-03-29  Martin Baulig  <martin@ximian.com>
4838
4839         * convert.cs: Use TypeManager.IsDelegateType() instead of
4840         comparing types correctly.
4841
4842 2004-03-29  Martin Baulig  <martin@ximian.com>
4843
4844         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
4845         types directly to make it work for generic instances.
4846
4847         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
4848
4849 2004-03-29  Martin Baulig  <martin@ximian.com>
4850
4851         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
4852         support for arrays.     
4853
4854 2004-03-24  Martin Baulig  <martin@ximian.com>
4855
4856         * decl.cs (DeclSpace.FindType): Also use
4857         TypeManager.CheckGeneric() for types from the using clauses.
4858
4859 2004-03-23  Martin Baulig  <martin@ximian.com>
4860
4861         * expression.cs (Invocation.OverloadResolve): Added `bool
4862         may_fail' argument and use it instead of the Location.IsNull() hack.
4863
4864 2004-03-23  Martin Baulig  <martin@ximian.com>
4865
4866         * expression.cs (Invocation.InferType): Use correct type inference
4867         rules here.     
4868
4869 2004-03-23  Martin Baulig  <martin@ximian.com>
4870
4871         * ecore.cs (MethodGroupExpr.Name): Use
4872         TypeManager.CSharpSignature() instead of just the name.
4873
4874         * expression.cs (Invocation.OverloadResolve): Provide better error
4875         reporting.
4876         (Invocation.DoResolve): OverloadResolve() never returns null
4877         without reporting an error, so removed the error -6 reporting here.
4878
4879 2004-03-23  Martin Baulig  <martin@ximian.com>
4880
4881         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
4882         generic methods.
4883
4884         * cs-parser.jay (delegate_declaration): Support generic delegates.
4885
4886         * delegate.cs: Support generic delegates.
4887
4888 2004-03-22  Martin Baulig  <martin@ximian.com>
4889
4890         * expression.cs (Invocation.InferParamsTypeArguments): New static
4891         method; does type inference for params arguments.
4892
4893 2004-03-21  Martin Baulig  <martin@ximian.com>
4894
4895         * typemanager.cs (TypeManager.IsGenericMethod): New public static
4896         method; checks whether a method is a generic method.    
4897
4898         * expression.cs (Invocation.InferTypeArguments): New static method;
4899         infer type arguments for generic method invocation.
4900
4901         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
4902         property; we set this to true if we're resolving a generic method
4903         invocation and the user specified type arguments, ie. we're not
4904         doing type inference.
4905
4906 2004-03-20  Martin Baulig  <martin@ximian.com>
4907
4908         * class.cs (MethodData.DeclaringType): New public property.
4909         (MethodData.Define): Set DeclaringType here.
4910         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
4911         instead of OperatorMethodBuilder.DeclaringType.
4912
4913 2004-03-20  Martin Baulig  <martin@ximian.com>
4914
4915         * cs-tokenizer.cs (xtoken): Return a special
4916         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
4917
4918         * cs-parser.jay (default_value_expression): Switch to the new
4919         syntax (14.5.13).
4920
4921 2004-03-19  Martin Baulig  <martin@ximian.com>
4922
4923         * decl.cs (MemberName): New class.  We use this to "construct"
4924         namespace_or_type_name's.
4925
4926         * generics.cs (TypeArguments.GetDeclarations): New public method;
4927         returns the type arguments as a string[] and reports a CS0081 if
4928         one of them is not an identifier.
4929
4930         * class.cs (MemberBase): The .ctor now takes the name as a
4931         MemberName instead of a string.
4932         (MemberBase.ExplicitInterfaceName): Changed type from string to
4933         Expression.
4934         (MemberBase.DoDefine): If we're an explicit implementation, the
4935         InterfaceType may be a generic instance.
4936
4937         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
4938         (namespace_name): Call MemberName.GetName () to transform the
4939         MemberName into a string and ensure we don't have any type
4940         arguments.
4941         (type_name): Call MemberName.GetTypeExpression() to transfrom the
4942         MemberName into an expression.
4943         (method_header): Use namespace_or_type_name instead of member_name.     
4944
4945 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
4946
4947         * rootcontext.cs: Add new types to the boot resolution.
4948
4949         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
4950         MulticastDelegate is not allowed.
4951
4952         * typemanager.cs: Add new types to lookup: System.TypedReference
4953         and ArgIterator.
4954
4955         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
4956         check for TypedReference or ArgIterator, they are not allowed. 
4957
4958         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
4959         makes us properly catch 1510 in some conditions (see bug 56016 for
4960         details). 
4961
4962 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
4963
4964         * CryptoConvert.cs: update from corlib version
4965         with endian fixes.
4966
4967 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
4968
4969         * class.cs (Indexer.Define): Check indexername declaration
4970
4971 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
4972
4973         * attribute.cs (IsClsCompliant): Fixed problem with handling
4974         all three states (compliant, not-compliant, undetected).
4975
4976 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
4977
4978         * attribute.cs (Attribute): Location is now public.
4979         (Resolve): Store resolved arguments (pos_values) in attribute class.
4980         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
4981         (GetClsCompliantAttributeValue): New method that gets
4982         CLSCompliantAttribute value.
4983         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
4984         if exists else null.
4985         (AttributeTester): New class for CLS-Compliant verification routines.
4986
4987         * class.cs (Emit): Add CLS-Compliant verification.
4988         (Method.GetSignatureForError): Implemented.
4989         (Constructor.GetSignatureForError): Implemented
4990         (Constructor.HasCompliantArgs): Returns if constructor has
4991         CLS-Compliant arguments.
4992         (Constructor.Emit): Override.
4993         (Construcor.IsIdentifierClsCompliant): New method; For constructors
4994         is needed to test only parameters.
4995         (FieldBase.GetSignatureForError): Implemented.
4996         (TypeContainer): New member for storing base interfaces.
4997         (TypeContainer.FindMembers): Search in base interfaces too.
4998
4999         * codegen.cs (GetClsComplianceAttribute): New method that gets
5000         assembly or module CLSCompliantAttribute value.
5001         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5002         for assembly.
5003         (ModuleClass.Emit): Add error 3012 test.
5004
5005         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5006
5007         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5008         state for all decl types.
5009         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5010         if CLS-Compliant tests are required.
5011         (IsClsCompliaceRequired): New method. Analyze whether code
5012         must be CLS-Compliant.
5013         (IsExposedFromAssembly): New method. Returns true when MemberCore
5014         is exposed from assembly.
5015         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5016         value or gets cached value.
5017         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5018         is explicitly marked with CLSCompliantAttribute.
5019         (IsIdentifierClsCompliant): New abstract method. This method is
5020         used to testing error 3005.
5021         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5022         for identifier and parameters CLS-Compliant testing.
5023         (VerifyClsCompliance): New method. The main virtual method for
5024         CLS-Compliant verifications.
5025         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5026         null. I don't know why is null (too many public members !).
5027         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5028         and get value of first CLSCompliantAttribute that found.
5029
5030         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5031         (VerifyClsCompliance): Override and add extra tests.
5032
5033         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5034         clscheck- disable CLS-Compliant verification event if assembly is has
5035         CLSCompliantAttribute(true).
5036
5037         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5038         ApllyAttribute is now called in emit section as in the other cases.
5039         Possible future Emit integration.
5040         (IsIdentifierClsCompliant): New override.
5041         (VerifyClsCompliance): New override.
5042         (GetEnumeratorName): Returns full enum name.
5043
5044         * parameter.cs (GetSignatureForError): Implemented.
5045
5046         * report.cs (WarningData): New struct for Warning message information.
5047         (LocationOfPreviousError): New method.
5048         (Warning): New method. Reports warning based on the warning table.
5049         (Error_T): New method. Reports error based on the error table.
5050
5051         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5052         verifications are done here.
5053
5054         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5055
5056         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5057         CLSCompliantAttribute.
5058         (all_imported_types): New member holds all imported types from other
5059         assemblies.
5060         (LoadAllImportedTypes): New method fills static table with exported types
5061         from all referenced assemblies.
5062         (Modules): New property returns all assembly modules.
5063
5064 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5065
5066         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5067         throwing a parser error.
5068
5069         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5070         which removes the hardcoded get_/set_ prefixes for properties, as
5071         IL allows for the properties to be named something else.  
5072
5073         Bug #56013
5074
5075         * expression.cs: Do not override operand before we know if it is
5076         non-null.  Fix 56207
5077
5078 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5079
5080         * typemanager.cs: support for pinned variables.
5081
5082 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5083
5084         * decl.cs, typemanager.cs: Avoid using an arraylist
5085         as a buffer if there is only one result set.
5086
5087 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5088
5089         * expression.cs: Make sure you cant call a static method
5090         with an instance expression, bug #56174.
5091
5092 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5093
5094         * class.cs (IsDuplicateImplementation): Improve error reporting to
5095         flag 663 (method only differs in parameter modifier).
5096
5097         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5098         in preprocessor directives.
5099
5100         * location.cs (LookupFile): Allow for the empty path.
5101
5102         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5103         better approach for some of that patch, but its failing with the
5104         CharSet enumeration.  For now try/catch will do.
5105
5106         * typemanager.cs: Do not crash if a struct does not have fields.
5107         Fixes 56150.
5108
5109 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5110
5111         * expression.cs: cs0213, cant fix a fixed expression.
5112         fixes 50231.
5113
5114 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5115
5116         * cs-parser.jay: detect invalid embeded statements gracefully.
5117         bug #51113.
5118
5119 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5120
5121         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5122         As a regex:
5123         s/
5124         the invocation type may not be a subclass of the tye of the item/
5125         The type of the item must be a subclass of the invocation item.
5126         /g
5127
5128         Fixes bug #50820.
5129
5130 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5131
5132         * attribute.cs: Added methods to get a string and a bool from an
5133         attribute. Required to information from AssemblyKeyFileAttribute,
5134         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5135         * codegen.cs: Modified AssemblyName creation to include support for
5136         strongnames. Catch additional exceptions to report them as CS1548.
5137         * compiler.csproj: Updated include CryptoConvert.cs.
5138         * compiler.csproj.user: Removed file - user specific configuration.
5139         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5140         Mono.Security assembly. The original class is maintained and tested in
5141         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5142         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5143         like CSC 8.0 (C# v2) supports.
5144         * Makefile: Added CryptoConvert.cs to mcs sources.
5145         * rootcontext.cs: Added new options for strongnames.
5146
5147 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5148
5149         * driver.cs: For --expect-error, report error code `2'
5150         if the program compiled with no errors, error code `1' if
5151         it compiled with an error other than the one expected.
5152
5153 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5154
5155         * compiler.csproj: Updated for Visual Studio .NET 2003.
5156         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5157         * compiler.sln: Updated for Visual Studio .NET 2003.
5158
5159 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5160
5161         * expression.cs: Fix bug #47234. We basically need to apply the
5162         rule that we prefer the conversion of null to a reference type
5163         when faced with a conversion to 'object' (csc behaviour).
5164
5165 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5166
5167         * statement.cs: Shorter form for foreach, eliminates
5168         a local variable. r=Martin.
5169
5170 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5171
5172         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5173         checks if we can use brtrue/brfalse to test for 0.
5174         * expression.cs: use the above in the test for using brtrue/brfalse.
5175         cleanup code a bit.
5176
5177 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5178
5179         * expression.cs: Rewrite string concat stuff. Benefits:
5180
5181         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5182         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5183         rather than a concat chain.
5184
5185         * typemanager.cs: Add lookups for more concat overloads.
5186
5187 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5188
5189         * expression.cs: Emit shorter il code for array init.
5190
5191         newarr
5192         dup
5193         // set 1
5194
5195         // set 2
5196
5197         newarr
5198         stloc.x
5199
5200         ldloc.x
5201         // set 1
5202
5203         ldloc.x
5204         // set 2
5205
5206 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5207
5208         * statement.cs: Before, two switch blocks would be merged if the
5209         total size of the blocks (end_item - begin_item + 1) was less than
5210         two times the combined sizes of the blocks.
5211
5212         Now, it will only merge if after the merge at least half of the
5213         slots are filled.
5214
5215         fixes 55885.
5216
5217 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5218
5219         * class.cs : csc build fix for GetMethods(). See bug #52503.
5220
5221 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5222
5223         * expression.cs: Make sure fp comparisons work with NaN.
5224         This fixes bug #54303. Mig approved this patch a long
5225         time ago, but we were not able to test b/c the runtime
5226         had a related bug.
5227
5228 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5229
5230         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5231
5232 2004-03-19  Martin Baulig  <martin@ximian.com>
5233
5234         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5235         two overloads may unify for some type parameter substitutions and
5236         report a CS0408 if appropriate.
5237
5238 2004-03-19  Martin Baulig  <martin@ximian.com>
5239
5240         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5241         error here and not in our caller.
5242
5243 2004-03-19  Martin Baulig  <martin@ximian.com>
5244
5245         * interface.cs: Completely killed this file.
5246         (Interface): We're now a TypeContainer and live in class.cs.
5247
5248         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5249         argument; we're now also called for interfaces.
5250         (TypeContainer.DefineMembers): Allow this method being called
5251         multiple times.
5252         (TypeContainer.GetMethods): New public method; formerly known as
5253         Interface.GetMethod().  This is used by PendingImplementation.
5254         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5255         it's now private and non-static.
5256         (Interface): Moved this here; it's now implemented similar to
5257         Class and Struct.
5258         (Method, Property, Event, Indexer): Added `bool is_interface'
5259         argument to their .ctor's.
5260         (MemberBase.IsInterface): New public field.
5261
5262         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5263         instances instead of InterfaceMethod, InterfaceProperty, etc.
5264         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5265         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5266
5267 2004-03-19  Martin Baulig  <martin@ximian.com>
5268
5269         * class.cs (MethodCore.IsDuplicateImplementation): New private
5270         method which does the CS0111 checking.
5271         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5272         Use IsDuplicateImplementation().
5273
5274 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5275
5276         * decl.cs (FindMemberToOverride): New method to find the correct
5277         method or property to override in the base class.
5278         * class.cs
5279             - Make Method/Property use the above method to find the
5280               version in the base class.
5281             - Remove the InheritableMemberSignatureCompare as it is now
5282               dead code.
5283
5284         This patch makes large code bases much faster to compile, as it is
5285         O(n) rather than O(n^2) to do this validation.
5286
5287         Also, it fixes bug 52458 which is that nested classes are not
5288         taken into account when finding the base class member.
5289
5290         Reviewed/Approved by Martin.
5291
5292 2004-03-17  Martin Baulig  <martin@ximian.com>
5293
5294         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5295         of type arguments into account; use the `real_num_type_args'
5296         approach like in DoResolveAsTypeStep().
5297
5298         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5299         nested types.
5300
5301 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5302
5303         * interface.cs: In all interface classes removed redundant
5304         member initialization.
5305
5306 2004-03-16  Martin Baulig  <martin@ximian.com>
5307
5308         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5309
5310 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5311
5312         * decl.cs (DefineTypeAndParents): New helper method to define a
5313         type's containers before the type itself is defined;  This is a
5314         bug exposed by the recent changes to Windows.Forms when an
5315         implemented interface was defined inside a class that had not been
5316         built yet.   
5317
5318         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5319
5320         (Check): Loop correctly to report errors modifiers
5321         (UNSAFE was not in the loop, since it was the same as TOP).
5322
5323         * interface.cs: Every interface member now takes a ModFlags,
5324         instead of a "is_new" bool, which we set on the base MemberCore. 
5325
5326         Every place where we called "UnsafeOk" in the interface, now we
5327         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5328         the unsafe settings from the member declaration instead of the
5329         container interface. 
5330
5331         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5332
5333         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5334         `set_indexer_name' to the pending bits (one per type).
5335
5336         We fixed a bug today that was picking the wrong method to
5337         override, since for properties the existing InterfaceMethod code
5338         basically ignored the method name.  Now we make sure that the
5339         method name is one of the valid indexer names.
5340
5341 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5342  
5343         * support.cs (SeekableStreamReader): Keep track of stream byte
5344         positions and don't mix them with character offsets to the buffer.
5345
5346         Patch from Gustavo Giráldez
5347
5348 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5349
5350         * interface.cs (InterfaceSetGetBase): Removed double member
5351         initialization, base class does it as well.
5352
5353 2004-03-13  Martin Baulig  <martin@ximian.com>
5354
5355         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5356         when compiling corlib.
5357
5358 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5359
5360         * convert.cs (ExplicitConversion): We were reporting an error on
5361         certain conversions (object_type source to a value type, when the
5362         expression was `null') before we had a chance to pass it through
5363         the user defined conversions.
5364
5365         * driver.cs: Replace / and \ in resource specifications to dots.
5366         Fixes 50752
5367
5368         * class.cs: Add check for duplicate operators.  Fixes 52477
5369
5370 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5371
5372         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5373         that are in the middle of the statements, not only at the end.
5374         Fixes #54987
5375
5376         * class.cs (TypeContainer.AddField): No longer set the
5377         `HaveStaticConstructor' flag, now we call it
5378         `UserDefineStaticConstructor' to diferentiate the slightly
5379         semantic difference.
5380
5381         The situation is that we were not adding BeforeFieldInit (from
5382         Modifiers.TypeAttr) to classes that could have it.
5383         BeforeFieldInit should be set to classes that have no static
5384         constructor. 
5385
5386         See:
5387
5388         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5389
5390         And most importantly Zoltan's comment:
5391
5392         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5393
5394         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5395          before its static fields are used', i.e. initialization does not need
5396          to be triggered by the first access to the type. Setting this flag
5397          helps the JIT to compile better code, since it can run the static
5398          constructor at JIT time, and does not need to generate code to call it
5399          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5400          this flag for lots of classes like String. 
5401          
5402          csc sets this flag if the type does not have an explicit static 
5403          constructor. The reasoning seems to be that if there are only static
5404          initalizers for a type, and no static constructor, then the programmer
5405          does not care when this initialization happens, so beforefieldinit
5406          can be used.
5407          
5408          This bug prevents the AOT compiler from being usable, since it 
5409          generates so many calls to mono_runtime_class_init that the AOT code
5410          is much slower than the JITted code. The JITted code is faster, 
5411          because it does not generate these calls if the vtable is type is
5412          already initialized, which is true in the majority of cases. But the
5413          AOT compiler can't do this."
5414
5415 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5416
5417         * class.cs (MethodData.Emit): Refactor the code so symbolic
5418         information is generated for destructors;  For some reasons we
5419         were taking a code path that did not generate symbolic information
5420         before. 
5421
5422 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5423
5424         * class.cs: Create a Constructor.CheckBase method that
5425         takes care of all validation type code. The method
5426         contains some code that was moved from Define.
5427
5428         It also includes new code that checks for duplicate ctors.
5429         This fixes bug #55148.
5430
5431 2004-03-09  Joshua Tauberer <tauberer@for.net>
5432
5433         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5434         a { ... }-style array creation invokes EmitStaticInitializers
5435         which is not good for reference-type arrays.  String, decimal
5436         and now null constants (NullCast) are not counted toward
5437         static initializers.
5438
5439 2004-03-05  Martin Baulig  <martin@ximian.com>
5440
5441         * location.cs (SourceFile.HasLineDirective): New public field;
5442         specifies whether the file contains or is referenced by a "#line"
5443         directive.
5444         (Location.DefineSymbolDocuments): Ignore source files which
5445         either contain or are referenced by a "#line" directive.        
5446
5447 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5448
5449         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5450         direct access to our parent, so check the method inline there.
5451
5452 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5453
5454         * expression.cs (Invocation.EmitCall): Miguel's last commit
5455         caused a regression. If you had:
5456
5457             T t = null;
5458             t.Foo ();
5459
5460         In Foo the implict this would be null.
5461
5462 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5463
5464         * expression.cs (Invocation.EmitCall): If the method is not
5465         virtual, do not emit a CallVirt to it, use Call.
5466
5467         * typemanager.cs (GetFullNameSignature): Improve the method to
5468         cope with ".ctor" and replace it with the type name.
5469
5470         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5471         as an argument the ConstructorBuilder where it is being defined,
5472         to catch the recursive constructor invocations.
5473
5474 2004-03-16  Martin Baulig  <martin@ximian.com>
5475
5476         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5477         ConstructedType, call ResolveType() on it to get the type rather
5478         than just using `expr.Type'.
5479
5480 2004-03-16  Martin Baulig  <martin@ximian.com>
5481
5482         * generics.cs (ConstructedType.GetMemberAccess): Take the
5483         EmitContext instead on the TypeExpr and use
5484         ec.TypeContainer.CurrentType/ec.ContainerType.
5485
5486 2004-03-16  Martin Baulig  <martin@ximian.com>
5487
5488         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5489         parameters before aliases.
5490
5491 2004-03-16  Martin Baulig  <martin@ximian.com>
5492
5493         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5494         New oublic function; checks whether two generic instances may become
5495         equal under some instantiations (26.3.1).
5496
5497         * class.cs (TypeContainer.Define): Call
5498         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5499         error.
5500
5501 2004-03-16  Martin Baulig  <martin@ximian.com>
5502
5503         * class.cs (TypeContainer.GetClassBases): Moved
5504         Error_TypeParameterAsBase() here and also check whether the base
5505         class is not an attribute.
5506
5507 2004-03-16  Martin Baulig  <martin@ximian.com>
5508
5509         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5510
5511 2004-03-16  Martin Baulig  <martin@ximian.com>
5512
5513         * class.cs (Error_TypeParameterAsBase): Use correct error number
5514         here (CS0689).  
5515
5516 2004-03-16  Martin Baulig  <martin@ximian.com>
5517
5518         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5519         for generics.
5520
5521         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5522         error reporting.
5523
5524 2004-03-15  Martin Baulig  <martin@ximian.com>
5525
5526         * typemanager.cs (TypeManager.GetFullName): New public method.
5527         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5528         argument; only return members with the correct number of type
5529         arguments.
5530         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5531         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5532         whether the number of type arguments matches.
5533
5534         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5535         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5536
5537         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5538         field; it's set by the protected .ctor when we're actually a
5539         GenericMemberAccess.
5540         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5541         arguments and pass it to MemberLookupFinal ().
5542
5543         * ecore.cs (Expression.MemberLookup): Added `int
5544         num_type_arguments' argument; only return members with the correct
5545         number of type arguments.
5546         (Expression.MemberLookupFailed): Check whether the MemberLookup
5547         failed because we did not have the correct number of type
5548         arguments; report CS0305 in this case.
5549
5550         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5551         `e.ResolveAsTypeTerminal()' already did so.
5552
5553 2004-03-15  Martin Baulig  <martin@ximian.com>
5554
5555         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5556         we're a ConstructedType; in this case, the caller must report an
5557         error (for instance CS0131).
5558
5559         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5560         (TypeArguments.Resolve): Actually report errors here.
5561
5562 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5563
5564         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5565         `set_indexer_name' to the pending bits (one per type).
5566
5567         We fixed a bug today that was picking the wrong method to
5568         override, since for properties the existing InterfaceMethod code
5569         basically ignored the method name.  Now we make sure that the
5570         method name is one of the valid indexer names.
5571
5572 2004-03-15  Martin Baulig  <martin@ximian.com>
5573
5574         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5575         for generic instances.
5576
5577 2004-03-13  Martin Baulig  <martin@ximian.com>
5578
5579         * class.cs (TypeContainer.DefineType): Call
5580         TypeManager.AddUserType() immediately after creating the
5581         TypeBuilder; pass all type parameters when creating the
5582         CurrentType.
5583
5584         * decl.cs (DeclSpace.FindNestedType): New public method.
5585         (DeclSpace.FindType): Added `int num_type_args' argument; only
5586         return types with the correct number of type parameters.
5587         (DeclSpace.CountTypeParams): New public property.
5588
5589         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
5590         the number of type parameters; defaults to zero.
5591
5592         * generic.cs (TypeArguments.Count): New public property.
5593         (ConstructedType.DoResolveAsTypeStep): First call
5594         ds.FindNestedType() to find out whether we're nested in the
5595         current generic type; in this case, we inherit all type parameters
5596         from the current class.
5597
5598         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
5599         num_type_args' argument.
5600         (RootContext.LookupType): Added overloaded version which takes the
5601         number of type arguments; only return types with the correct
5602         number of type arguments.
5603
5604         * typemanager.cs (TypeManager.CheckGeneric): New public function;
5605         checks whether `Type t' has `int num_type_args'.
5606
5607 2004-03-13  Martin Baulig  <martin@ximian.com>
5608
5609         * generic.cs (GenericMethod.DefineType): New method; calls
5610         DefineType() on all the type parameters.
5611
5612         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
5613         (MethodData.Define): If we're a generic method, call
5614         GenericMethod.DefineType() to define the type parameters.       
5615
5616 2004-03-10  Martin Baulig  <martin@ximian.com>
5617
5618         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
5619         instead of IsAssignableFrom.    
5620
5621 2004-03-10  Martin Baulig  <martin@ximian.com>
5622
5623         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
5624
5625         * support.cs (ParameterData.HasArrayParameter): New property.
5626         (ReflectionParameters.ctor): Take a MethodBase instead of a
5627         ParameterInfo[].  If we have any type parameters, get the generic
5628         method definition and ask it whether we have variable arguments.
5629
5630 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5631
5632         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5633         routines to check if a type is an enumerable/enumerator allow
5634         classes that implement the IEnumerable or IEnumerator interfaces.
5635
5636         * class.cs (Property, Operator): Implement IIteratorContainer, and
5637         implement SetYields.
5638
5639         (Property.Define): Do the block swapping for get_methods in the
5640         context of iterators.   We need to check if Properties also
5641         include indexers or not.
5642
5643         (Operator): Assign the Block before invoking the
5644         OperatorMethod.Define, so we can trigger the Iterator code
5645         replacement. 
5646
5647         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5648         Property and Operator classes are not created when we parse the
5649         declarator but until we have the block completed, so we use a
5650         singleton SimpleIteratorContainer.Simple to flag whether the
5651         SetYields has been invoked.
5652
5653         We propagate this setting then to the Property or the Operator to
5654         allow the `yield' to function.
5655
5656 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5657
5658         * codegen.cs: Implemented attribute support for modules.
5659         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5660         Assembly/Module functionality.
5661
5662         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5663         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5664         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5665
5666 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5667
5668         * interface.cs (FindMembers): The operation is performed on all base
5669         interfaces and not only on the first. It is required for future CLS Compliance patch.
5670
5671 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5672
5673         * statement.cs, codegen.cs:
5674         This patch deals with patterns such as:
5675
5676         public class List : IEnumerable {
5677
5678                 public MyEnumerator GetEnumerator () {
5679                         return new MyEnumerator(this);
5680                 }
5681
5682                 IEnumerator IEnumerable.GetEnumerator () {
5683                         ...
5684                 }
5685                 
5686                 public struct MyEnumerator : IEnumerator {
5687                         ...
5688                 }
5689         }
5690
5691         Before, there were a few things we did wrong:
5692         1) we would emit callvirt on a struct, which is illegal
5693         2) we emited ldarg when we needed to emit ldarga
5694         3) we would mistakenly call the interface methods on an enumerator
5695         type that derived from IEnumerator and was in another assembly. For example:
5696
5697         public class MyEnumerator : IEnumerator
5698
5699         Would have the interface methods called, even if there were public impls of the
5700         method. In a struct, this lead to invalid IL code.
5701
5702 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5703
5704         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5705           renamed to Emit.
5706
5707         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5708
5709 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5710
5711         * cs-parser.jay: Fix small regression: we were not testing V2
5712         compiler features correctly.
5713
5714         * interface.cs: If the emit context is null, then create one
5715
5716 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5717
5718         * decl.cs (GetSignatureForError): New virtual method to get full name
5719           for error messages.
5720
5721         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5722           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5723
5724         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5725           Duplicated members and code in these classes has been removed.
5726           Better encapsulation in these classes.
5727
5728 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5729
5730         * assign.cs (Assign.DoResolve): When dealing with compound
5731         assignments, there is a new rule in ECMA C# 2.4 (might have been
5732         there before, but it is documented here) that states that in:
5733
5734         a op= b;
5735
5736         If b is of type int, and the `op' is a shift-operator, then the
5737         above is evaluated as:
5738
5739         a = (int) a op b 
5740
5741         * expression.cs (Binary.ResolveOperator): Instead of testing for
5742         int/uint/long/ulong, try to implicitly convert to any of those
5743         types and use that in pointer arithmetic.
5744
5745         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5746         method to print information for from the type, not from the
5747         null-method we were given.
5748
5749 2004-02-01  Duncan Mak  <duncan@ximian.com>
5750
5751         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
5752         parsing for cmd, fixes bug #53694.
5753
5754 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
5755
5756         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
5757         in the member name duplication tests. Property and operator name duplication
5758         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
5759
5760 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
5761
5762         * interface.cs (PopulateMethod): Fixed crash when interface method
5763         returns not existing type (error test cs0246-3.cs).
5764
5765 2004-02-02  Ravi Pratap M <ravi@ximian.com>
5766
5767         * cs-parser.jay (interface_accessors): Re-write actions to also
5768         store attributes attached to get and set methods. Fix spelling
5769         while at it.
5770
5771         (inteface_property_declaration): Modify accordingly.
5772
5773         (InterfaceAccessorInfo): New helper class to store information to pass
5774         around between rules that use interface_accessors.
5775
5776         * interface.cs (Emit): Apply attributes on the get and set
5777         accessors of properties and indexers too.
5778
5779         * attribute.cs (ApplyAttributes): Modify accordingly to use the
5780         right MethodBuilder when applying attributes to the get and set accessors.
5781
5782 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
5783
5784         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
5785
5786 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
5787
5788         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
5789
5790 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
5791
5792         * cs-parser.jay: Remove YIELD token, instead use the new grammar
5793         changes that treat `yield' specially when present before `break'
5794         or `return' tokens.
5795
5796         * cs-tokenizer.cs: yield is no longer a keyword.
5797
5798 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
5799
5800         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
5801         setting for default constructors.
5802         For default constructors are almost every time set wrong Modifier. The
5803         generated IL code has been alright. But inside mcs this values was
5804         wrong and this was reason why several of my CLS Compliance tests
5805         failed.
5806
5807 2004-02-27  Martin Baulig  <martin@ximian.com>
5808
5809         * generics.cs (ConstructedType.ResolveType): Make the nested type
5810         stuff actually work.
5811
5812 2004-02-25  Martin Baulig  <martin@ximian.com>
5813
5814         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
5815         property; returns the type parameters just from the current type,
5816         ie. with the ones from outer classes.
5817         (DeclSpace.LookupGeneric): First search in the current class, then
5818         in outer classes.
5819         (DeclSpace.initialize_type_params): When hiding a type parameter
5820         from an outer class, put it into the `type_param_list' anyways.
5821
5822         * expression.cs (MemberAccess.expr): Made this field protected.
5823
5824         * class.cs (TypeContainer.Define): The `CurrentType' just contains
5825         the type parameters from the current class.
5826
5827         * generic.cs (ConstructedType.ResolveType): Support nested generic
5828         types by taking the type parameters which we inherit from outer
5829         classes into account.
5830         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
5831         support for nested generic types.
5832
5833 2004-02-23  Martin Baulig  <martin@ximian.com>
5834
5835         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
5836         field and check whether we're nested inside a generic type.
5837         (DeclSpace.ResolveType): If we're resolving to a generic type
5838         definition, create a ConstructedType and return its resolved type.
5839         (DeclSpace.initialize_type_params): New private method;
5840         initializes the `type_param_list' field from the type parameters
5841         from this and all enclosing classes.
5842         (DeclSpace.TypeParameters): Call initialize_type_params() unless
5843         we're already initialized.
5844
5845 2004-02-23  Martin Baulig  <martin@ximian.com>
5846
5847         * class.cs (Method.Define): Create the generic method before
5848         calling DoDefine().
5849         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
5850         the TypeContainer one); we use this for generic methods.
5851
5852         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
5853         parent's TypeBuilder.
5854
5855 2004-02-18  Martin Baulig  <martin@ximian.com>
5856
5857         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
5858         to check for equality.
5859
5860 2004-02-05  Martin Baulig  <martin@ximian.com>
5861
5862         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
5863         `ec.TypeContainer.CurrentType', use it instead of
5864         `ec.ContainerType' to check whether we're in the type's ctor.
5865
5866 2004-01-29  Martin Baulig  <martin@ximian.com>
5867
5868         * expression.cs (Invocation.DoResolve): If we're a
5869         `ConstructedType', then we're actually a generic method, so
5870         rewrite the expr as a GenericMemberAccess.
5871
5872         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
5873         here; manually parse it into a string.
5874
5875 2004-01-28  Martin Baulig  <martin@ximian.com>
5876
5877         * typemanager.cs (TypeManager.IsEqual): New static method.
5878         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
5879         check for equality instead of using `=='.
5880
5881 2004-01-26  Martin Baulig  <martin@ximian.com>
5882
5883         * decl.cs (DeclSpace.CurrentType): New public field.
5884
5885         * expression.cs (This.ResolveBase): If we have an
5886         `ec.TypeContainer.CurrentType', use it instead of
5887         `ec.ContainerType'.
5888
5889         * class.cs (TypeContainer.DefineType): If we're a generic type,
5890         create the `CurrentType' (unresolved).
5891         (TypeContainer.GenericType): New private field.
5892         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
5893         it and store it in `GenericType' before creating the MemberCache.
5894         (TypeContainer.GetMembers): If we have a `GenericType', call
5895         TypeManager.FindMembers() on it.
5896
5897         * interface.cs (Interface.GenericType): New private field.
5898         (Interface.DefineType): If we're a generic type, create the
5899         `CurrentType' (unresolved).
5900         (Interface.DefineMembers): If we have a `CurrentType', resolve it
5901         and store it in `GenericType' before creating the MemberCache.
5902         (Interface.GetMembers): If we have a `GenericType', call
5903         TypeManager.FindMembers() on it.
5904
5905 2004-01-22  Martin Baulig  <martin@ximian.com>
5906
5907         * cs-parser.jay (namespace_or_type_name): Return an Expression,
5908         not a QualifiedIdentifier.  This is what `type_name_expression'
5909         was previously doing.
5910         (type_name_expression): Removed; the code is now in
5911         `namespace_or_type_name'.
5912         (qualified_identifier): Removed, use `namespace_or_type_name'
5913         instead.
5914         (QualifiedIdentifier): Removed this class.      
5915
5916 2004-01-22  Martin Baulig  <martin@ximian.com>
5917
5918         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
5919         not a string as alias name.
5920
5921 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
5922
5923         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
5924         #52730 bug, and instead compute correctly the need to use a
5925         temporary variable when requesting an address based on the
5926         static/instace modified of the field and the constructor.
5927  
5928 2004-01-21  Martin Baulig  <martin@ximian.com>
5929
5930         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
5931         class and namespace before looking up aliases.  Fixes #52517.
5932
5933 2004-01-21  Martin Baulig  <martin@ximian.com>
5934
5935         * flowanalysis.cs (UsageVector.Merge): Allow variables being
5936         assinged in a 'try'; fixes exception4.cs.
5937
5938 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5939         * class.cs : Implemented parameter-less constructor for TypeContainer
5940
5941         * decl.cs: Attributes are now stored here. New property OptAttributes
5942
5943         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
5944
5945         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
5946
5947 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5948
5949         * typemanager.cs (CSharpSignature): Now reports also inner class name.
5950           (CSharpSignature): New method for indexer and property signature.
5951
5952 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5953
5954         * pending.cs (IsVirtualFilter): Faster implementation.
5955
5956 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5957
5958         * typemanager.cs: Avoid inclusion of same assembly more than once.
5959
5960 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5961
5962         * cs-parser.jay: Fixed problem where the last assembly attribute
5963           has been applied also to following declaration (class, struct, etc.)
5964           
5965 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5966
5967         * class.cs: Added error CS0538, CS0539 reporting.
5968         Fixed crash on Microsoft runtime when field type is void.
5969
5970         * cs-parser.jay: Added error CS0537 reporting.
5971
5972         * pending.cs: Added error CS0535 reporting.
5973         Improved error report for errors CS0536, CS0534.
5974
5975 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
5976
5977         Merge a few bits from the Anonymous Method MCS tree.
5978
5979         * statement.cs (ToplevelBlock): New class for toplevel methods,
5980         will hold anonymous methods, lifted variables.
5981
5982         * cs-parser.jay: Create toplevel blocks for delegates and for
5983         regular blocks of code. 
5984
5985 2004-01-20  Martin Baulig  <martin@ximian.com>
5986
5987         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
5988         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
5989         and `NeedExplicitReturn'; added `IsLastStatement'.
5990         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
5991         have a `ReturnLabel' or we're not unreachable.
5992
5993         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
5994         child's reachability; don't just override ours with it.  Fixes
5995         #58058 (lluis's example).
5996         (FlowBranching): Added public InTryOrCatch(), InCatch(),
5997         InFinally(), InLoop(), InSwitch() and
5998         BreakCrossesTryCatchBoundary() methods.
5999
6000         * statement.cs (Return): Do all error checking in Resolve().
6001         Unless we are the last statement in a top-level block, always
6002         create a return label and jump to it.
6003         (Break, Continue): Do all error checking in Resolve(); also make
6004         sure we aren't leaving a `finally'.
6005         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6006         statement in a top-level block.
6007         (Block.Flags): Added `IsDestructor'.
6008         (Block.IsDestructor): New public property.
6009
6010 2004-01-20  Martin Baulig  <martin@ximian.com>
6011
6012         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6013
6014 2004-01-20  Martin Baulig  <martin@ximian.com>
6015
6016         * statement.cs (Statement.ResolveUnreachable): New public method.
6017         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6018         (Block.Resolve): Resolve unreachable statements.
6019
6020 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6021
6022         * expression.cs: We need to fix the case where we do
6023         not have a temp variable here.
6024
6025         * assign.cs: Only expression compound assignments need
6026         temporary variables.
6027
6028 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6029
6030         * flowanalysis.cs: Reduce memory allocation in a few ways:
6031           - A block with no variables should not allocate a bit
6032             vector for itself.
6033           - A method with no out parameters does not need any tracking
6034             for assignment of the parameters, so we need not allocate
6035             any data for it.
6036           - The arrays:
6037                 public readonly Type[] VariableTypes;
6038                 public readonly string[] VariableNames;
6039             Are redundant. The data is already stored in the variable
6040             map, so we need not allocate another array for it.
6041           - We need to add alot of checks for if (params | locals) == null
6042             due to the first two changes.
6043
6044 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6045
6046         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6047         implement IMemoryLocation, we store a copy on a local variable and
6048         take the address of it.  Patch from Benjamin Jemlich
6049
6050         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6051         to use a special "type_name_expression" rule which reduces the
6052         number of "QualifiedIdentifier" classes created, and instead
6053         directly creates MemberAccess expressions.
6054
6055 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6056
6057         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6058         that fixes #52853.  Null literal assignment to ValueType
6059
6060         * class.cs (MethodData.Emit): Instead of checking the name of the
6061         method to determine if its a destructor, create a new derived
6062         class from Method called Destructor, and test for that.  
6063
6064         * cs-parser.jay: Create a Destructor object instead of a Method.  
6065
6066         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6067
6068         Fixes: 52933
6069
6070 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6071
6072         * expression.cs (Binary.ResolveOperator): Perform an implicit
6073         conversion from MethodGroups to their delegate types on the
6074         Addition operation.
6075
6076         * delegate.cs: Introduce a new class DelegateCreation that is the
6077         base class for `NewDelegate' and `ImplicitDelegateCreation',
6078         factor some code in here.
6079
6080         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6081         conversion from MethodGroups to compatible delegate types. 
6082
6083         * ecore.cs (Expression.Resolve): Do not flag error 654
6084         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6085         we allow conversions from MethodGroups to delegate types now.
6086
6087         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6088         assignments in v2 either.
6089
6090 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6091
6092         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6093         static read-only fields in ctors.
6094
6095         Applied patch from Benjamin Jemlich 
6096
6097         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6098
6099 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6100
6101         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6102         here to return true, as they can be used like this:
6103
6104                 (XXX) int.MEMBER ()
6105
6106         Fixed 49836 and all the other dups
6107
6108 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6109
6110         * driver.cs: Implement /win32res and /win32icon.
6111
6112 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6113
6114         * cs-parser.jay: Add a rule to improve error handling for the
6115         common mistake of placing modifiers after the type.
6116
6117 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6118
6119         * cs-parser.jay (interface_event_declaration): Catch
6120         initialization of events on interfaces, and report cs0068
6121
6122         * cs-parser.jay (interface_event_declaration): Catch
6123         initialization of events. 
6124
6125         * ecore.cs: Better report missing constructors.
6126
6127         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6128         the error reporting done in the wrong place.  Fix.
6129
6130         * expression.cs (Binary.ResolveOperator): Catch the 
6131         operator + (E x, E y) error earlier, and later allow for implicit
6132         conversions in operator +/- (E e, U x) from U to the underlying
6133         type of E.
6134
6135         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6136         52596, if the container class is abstract, the default constructor
6137         is protected otherwise its public (before, we were always public).
6138
6139         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6140         fixed statement.
6141
6142         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6143         Jemlich that fixes bug #52597, MCS was generating invalid code for
6144         idisposable structs.   Thanks to Ben for following up with this
6145         bug as well.
6146
6147 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6148
6149         * driver.cs: Allow assemblies without code to be generated, fixes
6150         52230.
6151
6152 2004-01-07  Nick Drochak <ndrochak@gol.com>
6153
6154         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6155
6156 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6157
6158         * cs-parser.jay: Add rules to improve error reporting if fields or
6159         methods are declared at the namespace level (error 116)
6160
6161         * Add rules to catch event add/remove
6162
6163 2004-01-04  David Sheldon <dave-mono@earth.li>
6164
6165   * expression.cs: Added matching ")" to error message for 
6166   CS0077
6167
6168 2004-01-03 Todd Berman <tberman@gentoo.org>
6169
6170         * ecore.cs, attribute.cs:
6171         Applying fix from #52429.
6172
6173 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6174
6175         * ecore.cs, expression.cs, statement.cs:
6176         Total rewrite of how we handle branching. We
6177         now handle complex boolean expressions with fewer
6178         jumps. As well if (x == 0) no longer emits a ceq.
6179
6180         if (x is Foo) is much faster now, because we generate
6181         better code.
6182
6183         Overall, we get a pretty big improvement on our benchmark
6184         tests. The code we generate is smaller and more readable.
6185
6186         I did a full two-stage bootstrap. The patch was reviewed
6187         by Martin and Miguel.
6188
6189 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6190
6191         * cs-parser.jay: Make primary_expression not take a QI.
6192         we dont need this because the member_access rule covers
6193         us here. So we replace the rule with just IDENTIFIER.
6194
6195         This has two good effects. First, we remove a s/r conflict.
6196         Second, we allocate many fewer QualifiedIdentifier objects.
6197
6198 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6199
6200         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6201         set the correct information via SRE. This prevents
6202         hanging on the MS runtime. Fixes #29374.
6203
6204 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6205
6206         * convert.cs: correctly handle conversions to value types
6207         from Enum and ValueType as unboxing conversions.
6208
6209         Fixes bug #52569. Patch by Benjamin Jemlich.
6210
6211 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6212
6213         * expression.cs (BetterConversion): Prefer int -> uint
6214         over int -> ulong (csc's behaviour). This fixed bug #52046.
6215
6216 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6217
6218         * decl.cs (MemberCache.FindMembers): now returns a
6219         MemberInfo [].
6220
6221         * typemanager.cs: In general, go with with ^^.
6222         (CopyNewMethods): take an IList.
6223         (RealMemberLookup): Only allocate an arraylist
6224         if we copy from two sets of methods.
6225
6226         This change basically does two things:
6227         1) Fewer array lists allocated due to CopyNewMethods.
6228         2) the explicit cast in MemberList costed ALOT.
6229
6230 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6231
6232         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6233         a hashtable to avoid needless string allocations when an identifier is
6234         used more than once (the common case).
6235
6236 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6237
6238         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6239         is broken, it will not return anything. So, we
6240         have to use the information we have in mcs to
6241         do the task.
6242
6243         * typemanager.cs: Add a cache for GetInterfaces,
6244         since this will now be used more often (due to ^^)
6245
6246         (GetExplicitInterfaces) New method that gets the
6247         declared, not effective, interfaces on a type
6248         builder (eg, if you have interface IFoo, interface
6249         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6250         { IBar }.
6251
6252         This patch makes MCS able to bootstrap itself on
6253         Windows again.
6254
6255 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6256
6257         * expression.cs: Remove the Nop's that Miguel put
6258         in by mistake.
6259
6260 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6261
6262         * report.cs, codegen.cs: Give the real stack trace to
6263         the error when an exception is thrown.
6264
6265 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6266
6267         * decl.cs: only allocate hashtables for ifaces if 
6268         it is an iface!
6269
6270 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6271
6272         * expression.cs: fix the error from cs0121-2.cs
6273         (a parent interface has two child interfaces that
6274         have a function with the same name and 0 params
6275         and the function is called through the parent).
6276
6277 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6278
6279         * class.cs, rootcontext.cs, typmanager.cs: do not
6280         leak pointers.
6281
6282 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6283
6284         * codegen.cs: remove stack for the ec flow branching.
6285         It is already a linked list, so no need.
6286
6287 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6288
6289         * Makefile: Allow custom profiler here.
6290
6291 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6292
6293         * typemanager.cs (LookupType):
6294           - Use a static char [], because split takes
6295             a param array for args, so it was allocating
6296             every time.
6297           - Do not store true in a hashtable, it boxes.
6298
6299 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6300
6301         * flowanalysis.cs: bytify common enums.
6302
6303 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6304
6305         * modifiers.cs: Add a new set of flags for the
6306         flags allowed on explicit interface impls.
6307         * cs-parser.jay: catch the use of modifiers in
6308         interfaces correctly.
6309         * class.cs: catch private void IFoo.Blah ().
6310
6311         All related to bug #50572.
6312
6313 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6314
6315         * decl.cs: Rewrite the consistant accessability checking.
6316         Accessability is not linear, it must be implemented in
6317         a tableish way. Fixes #49704.
6318
6319 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6320
6321         * expression.cs: Handle negation in a checked context.
6322         We must use subtraction from zero. Fixes #38674.
6323
6324 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6325
6326         * class.cs: Ignore static void main in DLLs.
6327         * rootcontext.cs: Handle the target type here,
6328         since we are have to access it from class.cs
6329         * driver.cs: account for the above.
6330
6331 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6332
6333         * report.cs: Give line numbers and files if available.
6334
6335 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6336
6337         * driver.cs: Implement /addmodule.
6338
6339         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6340         ModuleBuilders.
6341
6342 2003-12-20  Martin Baulig  <martin@ximian.com>
6343
6344         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6345         (FieldBase.IsAssigned): Removed this field.
6346         (FieldBase.SetAssigned): New public method.
6347         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6348
6349 2003-12-20  Martin Baulig  <martin@ximian.com>
6350
6351         * expression.cs (LocalVariableReference.DoResolve): Don't set
6352         `vi.Used' if we're called from DoResolveLValue().
6353
6354         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6355         returns the usage vector it just merged into the current one -
6356         pass this one to UsageWarning().
6357         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6358         of the `EmitContext', don't call this recursively on our children.
6359
6360 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6361
6362         * driver.cs: Implement /target:module.
6363
6364 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6365
6366         * support.cs (CharArrayHashtable): New helper class.
6367
6368         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6369         char arrays, not strings, so we can avoid creating a string in
6370         consume_identifier if the identifier is a keyword.
6371
6372 2003-12-16  Martin Baulig  <martin@ximian.com>
6373
6374         * statement.cs (LocalInfo.Assigned): Removed this property.
6375         (LocalInfo.Flags): Removed `Assigned'.
6376         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6377         and uses flow analysis.
6378         (Block.UsageWarning): Made this method private.
6379         (Block.Resolve): Call UsageWarning() if appropriate.
6380
6381         * expression.cs (LocalVariableReference.DoResolve): Always set
6382         LocalInfo.Used here.
6383
6384 2003-12-13  Martin Baulig  <martin@ximian.com>
6385
6386         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6387         any value here; we're now using flow analysis to figure out
6388         whether a statement/block returns a value.
6389
6390 2003-12-13  Martin Baulig  <martin@ximian.com>
6391
6392         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6393         working again.
6394         (FlowBranching.MergeFinally): Don't call
6395         `branching.CheckOutParameters()' here, this is called in
6396         MergeTopBlock().
6397         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6398         when adding the `finally' vector.       
6399
6400 2003-12-13  Martin Baulig  <martin@ximian.com>
6401
6402         * flowanalysis.cs
6403         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6404         actually work and also fix #48962.
6405
6406 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6407
6408         * decl.cs: Do not check System.Object for nested types,
6409         since we know it does not have any. Big bang for buck:
6410
6411         BEFORE:
6412            Run 1:   8.35 seconds
6413            Run 2:   8.32 seconds
6414            corlib:  17.99 seconds
6415         AFTER:
6416            Run 1:   8.17 seconds
6417            Run 2:   8.17 seconds
6418            corlib:  17.39 seconds
6419
6420 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6421
6422         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6423         time we are returning 0 members, so we save alot here.
6424
6425 2003-12-11  Martin Baulig  <martin@ximian.com>
6426
6427         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6428         `MergeChild()', also just take the `FlowBranching' as argument;
6429         call Merge() on it and return the result.
6430         (FlowBranching.Merge): We don't need to do anything if we just
6431         have one sibling.
6432
6433 2003-12-11  Martin Baulig  <martin@ximian.com>
6434
6435         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6436         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6437         Maurer for this idea.
6438
6439 2003-12-11  Martin Baulig  <martin@ximian.com>
6440
6441         * flowanalysis.cs (MergeResult): This class is now gone; we now
6442         use the `UsageVector' for this.  The reason for this is that if a
6443         branching just has one sibling, we don't need to "merge" them at
6444         all - that's the next step to do.
6445         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6446         `MergeResult'.
6447
6448 2003-12-11  Martin Baulig  <martin@ximian.com>
6449
6450         Reworked flow analyis and made it more precise and bug-free.  The
6451         most important change is that we're now using a special `Reachability'
6452         class instead of having "magic" meanings of `FlowReturns'.  I'll
6453         do some more cleanups and optimizations and also add some more
6454         documentation this week.
6455
6456         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6457         largely reworked this class.
6458         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6459         the new `Reachability' class instead of having "magic" values here.
6460         (FlowBranching): We're now using an instance of `Reachability'
6461         instead of having separate `Returns', `Breaks' etc. fields.
6462
6463         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6464         based on flow analysis; ignore the return value of block.Emit ().
6465
6466 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6467
6468         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6469         if they are private.
6470
6471 2003-12-09  Martin Baulig  <martin@ximian.com>
6472
6473         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6474         call them directly on the UsageVector.
6475
6476 2003-12-09  Martin Baulig  <martin@ximian.com>
6477
6478         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6479         Changed return type from `FlowReturns' to `Reachability'.
6480
6481 2003-12-09  Martin Baulig  <martin@ximian.com>
6482
6483         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6484         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6485         `Reachable' fields with a single `Reachability' one.
6486
6487 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6488
6489         * class.cs (FindMembers): Remove foreach's.
6490
6491         Bootstrap times:
6492
6493         BEFORE
6494                 Run 1:   8.74 seconds
6495                 Run 2:   8.71 seconds
6496
6497         AFTER
6498                 Run 1:   8.64 seconds
6499                 Run 2:   8.58 seconds
6500
6501
6502 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6503
6504         * cs-parser.jay:
6505         * gen-treedump.cs:
6506         * statement.cs:
6507         This patch does a few things:
6508                 1. EmptyStatement is now a singleton, so it is never reallocated.
6509                 2. All blah is EmptyStatement constructs have been changed to
6510                    blah == EmptyStatement.Value, which is much faster and valid
6511                    now that EmptyStatement is a singleton.
6512                 3. When resolving a block, rather than allocating a new array for
6513                    the non-empty statements, empty statements are replaced with
6514                    EmptyStatement.Value
6515                 4. Some recursive functions have been made non-recursive.
6516         Mainly the performance impact is from (3), however (1) and (2) are needed for
6517         this to work. (4) does not make a big difference in normal situations, however
6518         it makes the profile look saner.
6519
6520         Bootstrap times:
6521
6522         BEFORE
6523         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6524         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6525         Total memory allocated: 56397 KB
6526
6527         AFTER
6528         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6529         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6530         Total memory allocated: 55666 KB
6531
6532 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6533
6534         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6535         than the hashtable in a hashtable version
6536
6537         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6538         we always end up concating a string. This results in a huge perf
6539         loss, because many strings have to be tracked by the GC. In this
6540         patch, we first use a hashtable that works with two keys, so that
6541         the strings do not need to be concat'ed.
6542
6543         Bootstrap times:
6544         BEFORE
6545                 Run 1:   8.74 seconds
6546                 Run 2:   8.71 seconds
6547
6548         AFTER
6549                 Run 1:   8.65 seconds
6550                 Run 2:   8.56 seconds
6551
6552 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6553
6554         * Makefile: Add a new target `do-time' that does a quick and simple
6555         profile, leaving easy to parse output.
6556
6557 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6558
6559         * codegen.cs (Init): Create the dynamic assembly with 
6560         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6561
6562 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6563
6564         * support.cs: Make the PtrHashtable use only one
6565         instance of its comparer.
6566
6567 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6568
6569         * typemanager.cs: Fix lookup of GetNamespaces.
6570
6571 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6572
6573         * expression.cs: Removed redundant line.
6574
6575         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6576         ArrayLists, use for loops with bounds.  
6577
6578         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6579         arraylist.
6580
6581         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6582         arraylists, use for loop with bounds.
6583
6584         The above three changes give us a 0.071 second performance
6585         improvement out of 3.294 seconds down to 3.223.  On my machine
6586         the above changes reduced the memory usage by 1,387 KB during
6587         compiler bootstrap.
6588
6589         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6590         QualifiedIdentifiers.  Before we created a new string through
6591         concatenation, and mostly later on, the result would be
6592         manipulated by DecomposeQI through string manipulation.
6593
6594         This reduced the compiler memory usage for bootstrapping from
6595         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6596         compile times in 0.05 seconds.
6597
6598 2003-11-28  Dick Porter  <dick@ximian.com>
6599
6600         * support.cs: Do string compares with the Invariant culture.
6601
6602         * rootcontext.cs: 
6603         * gen-treedump.cs: 
6604         * expression.cs: 
6605         * driver.cs: 
6606         * decl.cs: 
6607         * codegen.cs: 
6608         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6609         the comparison is done with the Invariant culture.
6610
6611 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6612
6613         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6614         GetEnumerator method.
6615
6616         (ProbeCollectionType): Iterate starting at the most specific type
6617         upwards looking for a GetEnumerator
6618
6619         * expression.cs: Shift count can be up to 31 for int/uint and 63
6620         for long/ulong.
6621
6622 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6623
6624         * statement.cs (Block.LookupLabel): Also look for the label on the
6625         children blocks.  Use a hash table to keep track of visited
6626         nodes. 
6627
6628         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6629         we actually did transform the other operand, otherwise fall back
6630         to the common codepath that casts to long.
6631
6632         * cs-tokenizer.cs: Use the same code pattern as the int case.
6633         Maybe I should do the parsing myself, and avoid depending on the
6634         Parse routines to get this done.
6635
6636 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6637
6638         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6639         which fixes bug 51347.  This time test it.
6640
6641         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6642         attributes for example can not tell the difference between these.
6643         The difference was only a syntax feature of the language. 
6644
6645         * attribute.cs: Apply attributes to delegates.
6646
6647         * delegate.cs: Call the apply attributes method.
6648
6649 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6650
6651         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6652         comparing 0 vs Byte.MinValue, not the value
6653
6654         (ImplicitConversionRequired): When reporting a conversion error,
6655         use error 31 to print out the constant error instead of the
6656         simpler 29.
6657
6658         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6659         which fixes bug 51347.
6660
6661 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6662
6663         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6664         which fixes the -warnaserror command line option.
6665
6666 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6667
6668         * cfold.cs (DoNumericPromotions): During constant folding of
6669         additions on UIntConstant, special case intconstants with
6670         IntConstants like we do on the expression binary operator. 
6671
6672 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6673
6674         * convert.cs (ImplicitReferenceConversion): We were missing a case
6675         (System.Enum are not value types or class types, so we need to
6676         classify them separatedly).
6677
6678         * driver.cs: We do not support error 2007.
6679
6680 2003-11-12 Jackson Harper <jackson@ximian.com>
6681
6682         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6683         system directory. Also use the full file name so users can
6684         libraries names mscorlib-o-tron.dll in a non system dir.
6685         
6686 2004-01-04  David Sheldon <dave-mono@earth.li>
6687
6688         * expression.cs: Added matching ")" to error message for CS0077.
6689
6690 2003-12-19  Martin Baulig  <martin@ximian.com>
6691
6692         * typemanager.cs (TypeManager.IsEqualGenericType): New public
6693         static method; see documentation in the method.
6694         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
6695
6696         * convert.cs (Convert.ImplicitReferenceConversion,
6697         Convert.ImplicitReferenceConversionExists): Add support for
6698         generic type declarations; see gen-36.cs.
6699
6700 2003-12-19  Martin Baulig  <martin@ximian.com>
6701
6702         * pending.cs (Pending.InterfaceMethod): Use
6703         `Type.IsAssignableFrom()' instead of `=='.
6704
6705 2003-12-18  Martin Baulig  <martin@ximian.com>
6706
6707         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
6708         byref types first.
6709
6710         * convert.cs (Convert.ImplicitStandardConversionExists): Use
6711         `expr_type.Equals (target_type)' instead of `=='.
6712
6713 2003-12-08  Martin Baulig  <martin@ximian.com>
6714
6715         * generics.cs (Constraints.Types): Removed.
6716         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
6717         to Type's.
6718         (Constraints.ResolveTypes): New public method; resolves the
6719         TypeExpr's to Type's.
6720         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
6721         longer takes the constraints.
6722         (TypeParameter.DefineMethod): Likewise.
6723         (TypeParameter.DefineType): New public method.  Calls
6724         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
6725         the constraints.
6726
6727 2003-12-08  Martin Baulig  <martin@ximian.com>
6728
6729         * convert.cs (Convert.ImplicitConversionStandard): Use
6730         `expr_type.Equals (target_type)' instead of `=='.
6731
6732 2003-12-08  Martin Baulig  <martin@ximian.com>
6733
6734         * typemanager.cs (TypeManager.GetReferenceType): Call
6735         `Type.MakeByRefType ()'.
6736
6737 2003-12-08  Martin Baulig  <martin@ximian.com>
6738
6739         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
6740         just has some special meaning in some situations.  For instance,
6741         it is allowed to use `where' as the name of a variable etc.
6742
6743 2003-12-04  Martin Baulig  <martin@ximian.com>
6744
6745         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6746         `Type.MakeArrayType()' for array types.
6747
6748 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
6749
6750         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
6751         debugging message.
6752
6753         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
6754         corlib to compile.
6755
6756 2003-11-16  Martin Baulig  <martin@ximian.com>
6757
6758         * codegen.cs (EmitContext.IsGeneric): Removed.
6759
6760         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
6761         ResolveGeneric() on the DeclSpace.
6762
6763 2003-11-16  Martin Baulig  <martin@ximian.com>
6764
6765         * generic.cs (TypeArguments.Resolve):
6766         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
6767         `ResolveType()' on it to get the Type.
6768
6769 2003-11-15  Martin Baulig  <martin@ximian.com>
6770
6771         * generic.cs (ConstructedType.GetInterfaces): Override this.
6772
6773 2003-11-14  Martin Baulig  <martin@ximian.com>
6774
6775         * interface.cs (Interface.DefineType): Define all type parameters
6776         before adding the interfaces we inherit.
6777
6778 2003-11-11  Martin Baulig  <martin@ximian.com>
6779
6780         * generic.cs (ConstructedType.ResolveType): Always call
6781         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
6782
6783 2003-11-10  Martin Baulig  <martin@ximian.com>
6784
6785         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6786         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6787         calling `ResolveType()' on them, directly assign their `Type'.
6788
6789 2003-11-08  Martin Baulig  <martin@ximian.com>
6790
6791         * generic.cs (ConstructedType): Override `IsClass' etc.
6792
6793 2003-11-08  Martin Baulig  <martin@ximian.com>
6794
6795         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6796         return value and the `out parent' parameter.
6797         (TypeContainer.DefineType): Moved the CS0644 check into
6798         GetClassBases().  Don't pass the interface types to the
6799         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6800         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6801
6802         * ecore.cs (TypeExpr.IsAttribute): New property.
6803         (TypeExpr.GetInterfaces): New method.
6804
6805         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6806         TypeExpr instead of a Type.
6807         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6808         (Interface.DefineType): Don't pass the interface types to the
6809         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6810         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6811
6812         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6813         instead of a `Type[]'.
6814         (TypeManager.RegisterBuilder): Likewise.
6815         (TypeManager.AddUserInterface): Likewise.
6816         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6817         `Type[]' and also return a `TypeExpr[]'.
6818         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6819
6820 2003-11-08  Martin Baulig  <martin@ximian.com>
6821
6822         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6823         Expression.     
6824
6825 2003-11-08  Martin Baulig  <martin@ximian.com>
6826
6827         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6828         TypeManager.ResolveExpressionTypes().
6829
6830         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6831         instead of an Expression.
6832         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6833         (TypeExpression): New public class; formerly known as `TypeExpr'.
6834
6835         * expression.cs (ComposedCast): Derive from TypeExpr.
6836
6837         * typemanager.cs (TypeManager.system_*_expr): These are now
6838         TypExpr's instead of Expression's.
6839         (TypeManager.ResolveExpressionTypes): New public static function;
6840         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6841         of them.        
6842
6843 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6844
6845         * expression.cs (New.DoResolve): Do not dereference value that
6846         might be a null return.
6847
6848         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6849         sure that the constant value has the right type.  Fixes an
6850         unreported bug, similar to 50425.
6851
6852         * const.cs (Const.LookupConstantValue): Call
6853         ImplicitStandardConversionExists before doing a conversion to
6854         avoid havng the TypeManager.ChangeType do conversions.
6855
6856         Reduced the number of casts used
6857
6858         (Const.ChangeType): New routine to enable reuse of the constant
6859         type changing code from statement.
6860
6861         * typemanager.cs (ChangeType): Move common initialization to
6862         static global variables.
6863
6864         Fixes #50425.
6865
6866         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6867         every value type to go through, even if it was void.  Fix that. 
6868
6869         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6870         character of the define, and the is_identifier_part_character for
6871         the rest of the string.
6872
6873 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6874
6875         * expression.cs (UnaryMutator.EmitCode): When I updated
6876         LocalVariableReference.DoResolve, I overdid it, and dropped an
6877         optimization done on local variable references.
6878
6879 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6880
6881         * ecore.cs: Convert the return from Ldlen into an int.
6882
6883 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6884
6885         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6886         the accessibility, this is a special case for toplevel non-public
6887         classes (internal for instance).
6888
6889 2003-10-20  Nick Drochak <ndrochak@gol.com>
6890
6891         * ecore.cs: Fix typo and build.  Needed another right paren.
6892
6893 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6894
6895         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6896         `internal' case regular and protected, but not allowing protected
6897         to be evaluated later.  Bug 49840
6898
6899 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6900
6901         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6902         to kb.Nlast, and not the kb.nFirst to isolate the switch
6903         statement.
6904
6905         Extract the underlying type, so enumerations of long/ulong are
6906         treated like long/ulong.
6907
6908 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6909
6910         * expression.cs (New): Overload the meaning of RequestedType to
6911         track the possible creation of the NewDelegate type, since
6912         DoResolve is invoked more than once for new constructors on field
6913         initialization.
6914
6915         See bugs: #48800 and #37014
6916
6917         * cs-parser.jay (declare_local_constants): Take an arraylist
6918         instead of a single constant.
6919
6920         (local_constant_declaration): It should take a
6921         constant_declarators, not a constant_declarator.  Fixes 49487
6922
6923         * convert.cs: Fix error report.
6924
6925 2003-10-13 Jackson Harper <jackson@ximian.com>
6926
6927         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6928         bug #49611
6929         
6930 2003-11-03  Martin Baulig  <martin@ximian.com>
6931
6932         * expression.cs (ArrayAccess.GetStoreOpcode): Added
6933         `out bool has_type_arg'; if set, we need to pass the type to
6934         ig.Emit().
6935         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
6936         Stelem_Any/Ldelem_Any for generic parameters.   
6937
6938 2003-11-02  Martin Baulig  <martin@ximian.com>
6939
6940         * expression.cs (Invocation.EmitCall): Use
6941         `TypeManager.IsValueType()' to check whether it's a value type.
6942         Don't set `struct_call' when calling a method on a type parameter.
6943
6944 2003-11-02  Martin Baulig  <martin@ximian.com>
6945
6946         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
6947         and removed the TypeBuilder argument.
6948
6949         * typemanager.cs (TypeManager.IsValueType): Return
6950         `t.IsGenericParameter || t.IsValueType'.
6951
6952 2003-10-25  Martin Baulig  <martin@ximian.com>
6953
6954         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
6955         call ConstructedType.Resolve() on it.
6956
6957         * generic.cs (ConstructedType.Resolve): Set `type' on success.
6958
6959 2003-10-25  Martin Baulig  <martin@ximian.com>
6960
6961         * class.cs (TypeContainer.GetClassBases): Changed
6962         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
6963         CS8214 reporting here.
6964         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
6965         instead of a `Type' for our parent.  In case of a recursive
6966         declaration (see tests/gen-23.cs for an example), our parent is a
6967         ConstructedType and it doesn't have its type set.  So, first
6968         create our own TypeBuilder, then call constructed.Resolve() to get
6969         the parent's type and finally TypeBuilder.SetParent() it.
6970
6971         * ecore.cs (TypeExpr.Name): New public virtual property.
6972
6973         * generic.cs
6974         (ConstructedType): We're now a TypeExpr and not just an Expression.
6975         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
6976         arguments here; this is done later.
6977         (ConstructedType.Resolve): New public method to resolve the type
6978         arguments and bind them.
6979
6980 2003-10-21  Martin Baulig  <martin@ximian.com>
6981
6982         * convert.cs: Use `TypeManager.IsValueType' instead of
6983         'type.IsValueType' everywhere.
6984
6985         * typemanager.cs (TypeManager.IsValueType): Return true for type
6986         parameters.  The reason for this is that we need to box a type
6987         parameter when converting it to a reference type.
6988
6989         * cs-parser.jay: Added support for default value expressions.
6990
6991         * generics.cs (DefaultValueExpression): New public class.       
6992
6993 2003-10-17  Martin Baulig  <martin@ximian.com>
6994
6995         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
6996         TypeContainer so we can also use this for Interfaces.
6997         (TypeParameter.Resolve): Likewise.
6998
6999         * interface.cs (Interface.DefineType): Added support for generic
7000         interfaces.
7001
7002         * cs-parser.jay: Added support for generic structs and interfaces.
7003
7004 2003-10-17  Martin Baulig  <martin@ximian.com>
7005
7006         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7007         call generic methods :-)
7008
7009 2003-10-16  Martin Baulig  <martin@ximian.com>
7010
7011         * cs-parser.jay (namespace_or_type_name): Only create a
7012         GenericMemberAccess if we actually have type arguments.
7013
7014 2003-10-13  Martin Baulig  <martin@ximian.com>
7015
7016         * class.cs (Method.Define): If we're a generic method, call
7017         TypeBuilder.DefineGenericMethod () before resolving
7018         the parameters.
7019         (MethodData): Added .ctor which takes an additional MethodBuilder
7020         argument; this is used for generic methods.
7021         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7022         we already have a MethodBuilder.
7023
7024 2003-10-10  Martin Baulig  <martin@ximian.com>
7025
7026         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7027         instead of a `DeclSpace'.  This is used for generic methods.
7028
7029         * cs-parser.jay (method_header): Added support for generic
7030         methods; create a `GenericMethod' instance and pass it to the
7031         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7032         parameters and locals.
7033
7034         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7035         since we already have the location.  Check whether we're a generic
7036         type declaration or a generic method and create the correct type
7037         parameter.
7038
7039         * generic.cs (TypeParameter.DefineMethod): New public method.
7040         (GenericMethod): New public class; derives from DeclSpace and is
7041         used for generic methods.       
7042
7043 2003-10-09  Martin Baulig  <martin@ximian.com>
7044
7045         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7046         to the .ctor.
7047         (MethodCore.DoDefineParameters): Removed the TypeContainer
7048         argument; use the DeclSpace which was passed to the .ctor instead.
7049         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7050         TypeContainer; we only need a DeclSpace here.
7051
7052 2003-10-09  Martin Baulig  <martin@ximian.com>
7053
7054         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7055         to the .ctor.
7056         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7057         EmitContext's .ctor.    
7058
7059 2003-10-09  Martin Baulig  <martin@ximian.com>
7060
7061         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7062         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7063         AsAccessible(), moved them as well.
7064
7065         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7066
7067 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7068
7069         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7070         generation for >=, as spotted by Paolo, bug 48679.  
7071         Patch from David Waite.
7072
7073         * cs-tokenizer.cs: Add handling for #pragma.
7074
7075         * cs-parser.jay: Allow for both yield and yield return in the
7076         syntax.  The anti-cobolization of C# fight will go on!
7077
7078         * class.cs (TypeBuilder.DefineType): Catch error condition here
7079         (Parent.DefineType erroring out and returning null).
7080
7081         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7082         coping with enumerations variables, we were mistakenly processing
7083         them as a regular value type instead of built-in types.  Fixes the
7084         bug #48063
7085
7086         * typemanager.cs (IsBuiltinOrEnum): New method.
7087
7088 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7089
7090         * cs-parser.jay: Upgrade: yield now needs the return clause.
7091
7092 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7093
7094         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7095
7096 2003-09-29  Martin Baulig  <martin@ximian.com>
7097
7098         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7099         inflated generic methods.
7100
7101         * generics.cs (ConstructedType): Distinguish between open and
7102         closed constructed types; correctly resolve the arguments.
7103
7104 2003-09-22  Martin Baulig  <martin@ximian.com>
7105
7106         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7107         all type arguments meet their constraints.
7108
7109 2003-09-19  Martin Baulig  <martin@ximian.com>
7110
7111         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7112         `MemberCache parent' argument.  Normally, an interface doesn't
7113         have a parent type except System.Object, but we use this in gmcs
7114         for generic type parameters.
7115
7116 2003-09-18  Martin Baulig  <martin@ximian.com>
7117
7118         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7119         on `type.IsInterface'; don't check whether the type has a parent
7120         to determine whether it's an interface.
7121
7122 2003-09-17  Martin Baulig  <martin@ximian.com>
7123
7124         * generic.cs (ConstructedType.ToString): Always use `name' as the
7125         type name.
7126
7127 2003-09-15  Martin Baulig  <martin@ximian.com>
7128
7129         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7130
7131         * generic.cs (Constraints.Resolve): New public method; this is
7132         called to resolve the constraint types and to check whether all
7133         the constraints are correct.
7134         (Constraints.Types): New public property.
7135         (TypeParameter.Resolve): New public method; resolves all the
7136         type's constraints.
7137
7138         * class.cs (TypeContainer.DefineType): Call
7139         TypeParameter.Resolve() before actually defining the type.
7140
7141 2003-09-15  Martin Baulig  <martin@ximian.com>
7142
7143         * class.cs (TypeContainer.DefineType): Added an error flag to
7144         avoid reporting duplicate CS0146's ("class definition is
7145         circular.").
7146
7147         * driver.cs (Driver.MainDriver): Abort if
7148         RootContext.ResolveTree() reported any errors.
7149
7150 2003-09-07  Martin Baulig  <martin@ximian.com>
7151
7152         * report.cs (Error, Warning): Added overloaded versions which take
7153         a `params object[] args' and call String.Format().
7154
7155 2003-09-07  Martin Baulig  <martin@ximian.com>
7156
7157         * decl.cs (DeclSpace..ctor): Don't call
7158         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7159         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7160         (DeclSpace.RecordDecl): New method.
7161
7162         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7163
7164 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7165
7166         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7167         value attributes to be applied to ParameterBuilders.
7168
7169         * class.cs (MethodCore.LabelParameters): Make static and more
7170         generic so that it can be used from other places - like interface
7171         methods, for instance.
7172
7173         * interface.cs (Interface.Emit): Call LabelParameters before
7174         emitting attributes on the InterfaceMethod.
7175
7176 2003-09-07  Martin Baulig  <martin@ximian.com>
7177
7178         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7179         if the number of type parameters doesn't match.
7180
7181 2003-09-04  Martin Baulig  <martin@ximian.com>
7182
7183         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7184         for arrays of generic type params (ie. `!0[]').
7185
7186 2003-09-04  Martin Baulig  <martin@ximian.com>
7187
7188         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7189         for the moment.
7190
7191 2003-09-04  Martin Baulig  <martin@ximian.com>
7192
7193         * decl.cs (DeclSpace.LookupGeneric): New method.
7194         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7195         moment.
7196
7197         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7198         argument, not just a string.
7199         (TypeParameter.Define): New public method; this is called to
7200         actually define the generic parameter; after this, you can use the
7201         new `Type' property to get the type.
7202
7203 2003-09-04  Martin Baulig  <martin@ximian.com>
7204
7205         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7206         is now an ArrayList; initialize the result of the `TypeParameters'
7207         property here.
7208         (DeclSpace.GetGenericData): Removed.
7209         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7210         implement this in a different way.
7211         (DeclSpace.GetTypeParameters): Removed; there's now a
7212         `TypeParameters' property.
7213         (DeclSpace.TypeParameters): New public property.
7214
7215         * generic.cs (Constraints): Make this class public.
7216         (TypeParameter): New public class.
7217
7218 2003-09-04  Martin Baulig  <martin@ximian.com>
7219
7220         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7221         generic parameters.
7222
7223         * class.cs (TypeContainer.DefineType): Call
7224         TypeBuilder.DefineGenericParameter () on all generic parameters if
7225         this is a generic type.
7226
7227 2003-08-28  Martin Baulig  <martin@ximian.com>
7228
7229         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7230         sample-stack.il".
7231
7232         * sample-hello.cs: Compile this with gmcs: "gmcs
7233         /r:sample-stack.dll sample-hello.cs".
7234
7235 2003-08-28  Martin Baulig  <martin@ximian.com>
7236
7237         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7238         the parameters to the generic type.
7239
7240 2003-08-28  Martin Baulig  <martin@ximian.com>
7241
7242         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7243
7244 2003-08-28  Martin Baulig  <martin@ximian.com>
7245
7246         * cs-parser.jay (opt_type_argument_list): Use
7247         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7248         (primary_expression): Replace `qualified_identifier' with `type_name'.
7249         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7250
7251         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7252         parser to check whether it is syntactically a type parameter list;
7253         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7254         this case.
7255
7256 2003-08-26  Martin Baulig  <martin@ximian.com>
7257
7258         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7259         resolving aliases; fixes #47927.
7260
7261 2003-08-26  Martin Baulig  <martin@ximian.com>
7262
7263         * statement.cs (Using.DoResolve): This is internally emitting a
7264         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7265         do not always return.  Fixes #47681.
7266
7267 2003-08-26  Martin Baulig  <martin@ximian.com>
7268
7269         * decl.cs (MemberCore): Moved WarningNotHiding(),
7270         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7271         into MemberBase.
7272         (AdditionResult): Make this nested in DeclSpace.
7273         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7274         argument; call NamespaceEntry.Define() unless we're nested in a
7275         class or struct.
7276
7277         * namespace.cs (Namespace.DefineName): New public function.  This
7278         is called from DeclSpace's .ctor to add 
7279         (Namespace.Lookup): Include DeclSpaces in the lookup.
7280
7281         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7282
7283         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7284
7285 2003-08-25  Martin Baulig  <martin@ximian.com>
7286
7287         * convert.cs (Convert.ExplicitReferenceConversion): When
7288         converting from an interface type to a class, unbox if the target
7289         type is a struct type.  Fixes #47822.
7290
7291 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7292
7293         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7294         #47854.
7295
7296 2003-08-22  Martin Baulig  <martin@ximian.com>
7297
7298         * class.cs (TypeManager.DefineType): When defining a nested type,
7299         call DefineType() on our parent; fixes #47801.
7300
7301 2003-08-22  Martin Baulig  <martin@ximian.com>
7302
7303         * class.cs (MethodData.Define): While checking if a method is an
7304         interface implementation, improve the test a bit more to fix #47654.
7305
7306 2003-08-22  Martin Baulig  <martin@ximian.com>
7307
7308         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7309         correctly; fixes #47722.
7310
7311 2003-08-22  Martin Baulig  <martin@ximian.com>
7312
7313         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7314         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7315
7316         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7317
7318 2003-08-22  Martin Baulig  <martin@ximian.com>
7319
7320         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7321         can only be assigned in static constructors.  Fixes #47161.
7322
7323 2003-08-22  Martin Baulig  <martin@ximian.com>
7324
7325         Rewrote and improved the flow analysis code.
7326
7327         * flowbranching.cs (FlowBranching): Make this class abstract.
7328         (FlowBranching.CreateBranching): New static function to create a
7329         new flow branching.
7330         (FlowBranchingBlock, FlowBranchingException): New classes.
7331         (FlowBranching.UsageVector.Type): New public readonly field.
7332         (FlowBranching.UsageVector.Breaks): Removed the setter.
7333         (FlowBranching.UsageVector.Returns): Removed the setter.
7334         (FlowBranching.UsageVector): Added Break(), Return(),
7335         NeverReachable() and Throw() methods to modify the reachability.
7336         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7337         done by FlowBranching.Merge().
7338         (FlowBranching.UsageVector.MergeChild): New method; merges the
7339         merge result into the current vector.
7340         (FlowBranching.Merge): New abstract method to merge a branching.
7341
7342 2003-08-12  Martin Baulig  <martin@ximian.com>
7343
7344         * expression.cs (Indirection.CacheTemporaries): Create the
7345         LocalTemporary with the pointer type, not its element type.
7346
7347 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7348
7349         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7350         token was a keyword or not.
7351
7352         Add `error' options where an IDENTIFIER was expected;  Provide
7353         CheckToken and CheckIdentifierToken convenience error reporting
7354         functions. 
7355
7356         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7357
7358         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7359         NameSpaceEntry NameSpaceEntry.
7360
7361         (LookupInterfaceOrClass): Avoid creating a full qualified name
7362         from namespace and name: avoid doing lookups when we know the
7363         namespace is non-existant.   Use new Tree.LookupByNamespace which
7364         looks up DeclSpaces based on their namespace, name pair.
7365
7366         * driver.cs: Provide a new `parser verbose' to display the
7367         exception thrown during parsing.  This is turned off by default
7368         now, so the output of a failure from mcs is more graceful.
7369
7370         * namespace.cs: Track all the namespaces defined in a hashtable
7371         for quick lookup.
7372
7373         (IsNamespace): New method
7374
7375 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7376
7377         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7378         we know that we need to concatenate (full typename can never be
7379         null). 
7380
7381         * class.cs: ditto.
7382
7383         * statement.cs: Use a bitfield;  Do not initialize to null things
7384         which are done by the constructor by default.
7385
7386         * cs-parser.jay: bug fix, parameter was 4, not 3.
7387
7388         * expression.cs: Just use the property;
7389
7390         * statement.cs: No need for GetVariableInfo method.
7391
7392 2003-08-08  Martin Baulig  <martin@ximian.com>
7393
7394         * flowanalysis.cs (FlowReturns): This is now nested in the
7395         `FlowBranching' class.
7396         (MyBitVector): Moved this here from statement.cs.
7397         (FlowBranching.SiblingType): New enum type.
7398         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7399
7400 2003-08-07  Martin Baulig  <martin@ximian.com>
7401
7402         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7403         `FlowBranching' class and called `BranchingType'.
7404
7405 2003-08-07  Martin Baulig  <martin@ximian.com>
7406
7407         * flowanalysis.cs: Moved all the control flow analysis code into
7408         its own file.
7409
7410 2003-08-07  Martin Baulig  <martin@ximian.com>
7411
7412         * assign.cs (Assign.DoResolve): `target' must either be an
7413         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7414         #37319.
7415
7416 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7417
7418         * expression.cs (BinaryMethod): This kind of expression is created by the
7419         Binary class if it determines that the operator has to be handled
7420         by a method.
7421
7422         (BinaryDelegate): This kind of expression is created if we are
7423         dealing with a + or - operator on delegates.
7424
7425         (Binary): remove method, argumetns, and DelegateOperator: when
7426         dealing with methods, 
7427
7428         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7429
7430         * statement.cs (Block): use bitfields for the three extra booleans
7431         we had in use.   Remove unused topblock parameter.
7432
7433         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7434
7435         * assign.cs: Drop extra unneeded tests.
7436
7437 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7438
7439         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7440
7441         * statement.cs (Foreach): Use VariableStorage instead of
7442         LocalBuilders.   
7443
7444         * codegen.cs (VariableStorage): New class used by clients that
7445         require a variable stored: locals or fields for variables that
7446         need to live across yield.
7447
7448         Maybe provide a convenience api for EmitThis+EmitLoad?
7449
7450         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7451         these bad boys.
7452
7453 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7454
7455         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7456         RemapParameterLValue): New methods that are used to turn a
7457         precomputed FieldInfo into an expression like this:
7458
7459                 instance.FieldInfo
7460
7461         The idea is to use this instead of making LocalVariableReference
7462         have more than one meaning.
7463
7464         * cs-parser.jay: Add error production to BASE.
7465
7466         * ecore.cs: Deal with TypeManager.GetField returning null, which
7467         is now a valid return value.
7468
7469         (FieldExprNoAddress): New expression for Fields whose address can
7470         not be taken.
7471
7472         * expression.cs (LocalVariableReference): During the resolve
7473         phases, create new expressions if we are in a remapping context.
7474         Remove code that dealt with remapping here.
7475
7476         (ParameterReference): same.
7477
7478         (ProxyInstance): New expression, like the `This' expression, but
7479         it is born fully resolved.  We know what we are doing, so remove
7480         the errors that are targeted to user-provided uses of `this'.
7481
7482         * statement.cs (Foreach): our variable is now stored as an
7483         Expression;  During resolution, follow the protocol, dont just
7484         assume it will return this.
7485
7486 2003-08-06  Martin Baulig  <martin@ximian.com>
7487
7488         * support.cs (SeekableStreamReader.cs): New public class.
7489
7490         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7491         SeekableStreamReader instead of the normal StreamReader.
7492
7493 2003-08-04  Martin Baulig  <martin@ximian.com>
7494
7495         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7496         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7497         deambiguate casts and delegate invocations.
7498         (parenthesized_expression): Use the new tokens to ensure this is
7499         not a cast of method invocation.
7500
7501         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7502         when reading a `)' and Deambiguate_CloseParens () was previously
7503         called.
7504
7505         * expression.cs (ParenthesizedExpression): New class.  This is
7506         just used for the CS0075 test.
7507         (Binary.DoResolve): Check for CS0075.   
7508
7509 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7510
7511         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7512         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7513         reference comparison.
7514
7515         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7516         examine the ReturnType for equality - this is necessary in the
7517         cases of implicit and explicit operators whose signature also
7518         includes the return type.
7519
7520 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7521
7522         * namespace.cs: Cache the result of the namespace computation,
7523         instead of computing it every time.
7524
7525 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7526
7527         * decl.cs: Use a global arraylist that we reuse over invocations
7528         to avoid excesive memory consumption.  Reduces memory usage on an
7529         mcs compile by one meg (45 average).
7530
7531         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7532         private, work around that.
7533
7534 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7535
7536         * literal.cs (IntLiteral): Define Zero and One static literals. 
7537
7538         * cs-parser.jay (integer_literal): use static literals to reduce
7539         memory usage for the most used literals (0, 1 and -1).  211kb
7540         reduced in memory usage.
7541
7542         Replace all calls to `new ArrayList' with `new
7543         ArrayList(4)' which is a good average number for most allocations,
7544         and also requires only 16 bytes of memory for its buffer by
7545         default. 
7546
7547         This reduced MCS memory usage in seven megabytes for the RSS after
7548         bootstrapping.
7549
7550 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7551
7552         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7553         handle params methods the correct way by forming only one
7554         applicable set with params and normal methods in them. Earlier we
7555         were looking at params methods only if we found no normal methods
7556         which was not the correct thing to do.
7557
7558         (Invocation.BetterFunction): Take separate arguments indicating
7559         when candidate and the best method are params methods in their
7560         expanded form.
7561
7562         This fixes bugs #43367 and #46199.
7563
7564         * attribute.cs: Documentation updates.
7565
7566         (CheckAttribute): Rename to CheckAttributeTarget.
7567         (GetValidPlaces): Rename to GetValidTargets.
7568
7569         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7570         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7571
7572         Fixes bug #44468.
7573
7574 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7575
7576         * codegen.cs: Compute IsGeneric correctly.
7577
7578         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7579         resolution. 
7580
7581         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7582         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7583         regressions, and I was chasing more bugs than I required.
7584
7585         * interface.cs: Use expressions for base type names (like classes
7586         and structs have been doing for a while now), and resolve that.
7587         This patch should probably go into head as well.
7588
7589         This makes it one less user of FindType.
7590
7591 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7592
7593         This compiler can not self host currently.  Need to fix that.
7594         
7595         * Makefile: compile to `gmcs.exe'
7596
7597         * driver.cs: Turn on v2 by default on gmcs.
7598
7599         * generic.cs (ConstructedType): Does no longer take a container
7600         type argument;  That will be taken care of later.
7601
7602         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
7603         Use SimpleName to resolve for now, so we can continue the work on
7604         the parser, until we get Type.GetType that understands generics.
7605
7606         (ConstructedType.ToString): Implement
7607
7608         (TypeArguments.Resolve): Resolve the child expressions as types. 
7609         
7610         * cs-parser.jay: Rename interface_constraints to
7611         type_parameter_constraints
7612
7613         (namespace_or_type_name): Only use constructed types for the basic
7614         construction, we will deal with identifier<...> later.
7615
7616         (type/type_name): No longer call DecomposeQI, as
7617         namespace_or_type_name is always decoded now.
7618         
7619 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7620
7621         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7622         closely: we eliminate methods in base types when we have an
7623         applicable method in a top-level type.
7624
7625         Please see section 14.5.5.1 for an exact description of what goes
7626         on. 
7627
7628         This fixes bug #45127 and a host of other related to corlib compilation.
7629
7630         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7631         array is the method corresponding to the top-level type (this is
7632         because of the changes made to icall.c) so we change this
7633         accordingly.
7634
7635         (MethodGroupExpr.Name): This too.
7636
7637         * typemanager.cs (GetElementType): New method which does the right
7638         thing when compiling corlib. 
7639
7640         * everywhere: Make use of the above in the relevant places.
7641
7642 2003-07-22  Martin Baulig  <martin@ximian.com>
7643
7644         * cs-parser.jay (invocation_expression): Moved
7645         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7646         `cast_expression', but create a InvocationOrCast which later
7647         resolves to either an Invocation or a Cast.
7648
7649         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7650         method; call this before EmitStatement() to make sure that this
7651         expression can be used as a statement.
7652
7653         * expression.cs (InvocationOrCast): New class; resolves to either
7654         an Invocation or a Cast.
7655
7656         * statement.cs (StatementExpression): Call ResolveStatement() on
7657         the ExpressionStatement before emitting it.
7658
7659 2003-07-21  Martin Baulig  <martin@ximian.com>
7660
7661         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7662         `ref' and `out' attributes match; fixes #46220.
7663         (MemberAccess.ResolveMemberAccess): You can't reference a type
7664         through an expression; fixes #33180.
7665         (Indexers.GetIndexersForType): Don't return the indexers from
7666         interfaces the class implements; fixes #46502.
7667
7668 2003-07-21  Martin Baulig  <martin@ximian.com>
7669
7670         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7671         CS0661 checks; fixes bug #30442.
7672
7673 2003-07-21  Martin Baulig  <martin@ximian.com>
7674
7675         * decl.cs (AdditionResult): Added `Error'.
7676
7677         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7678
7679         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
7680         cs0031.cs actually work.
7681
7682  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7683  
7684         * cs-parser.jay (namespace_name): do not use
7685         namespace_or_type_name, use qualified_identifier, because
7686         namespace_or_type_name will soon return a composed expression
7687         instead of a string.
7688  
7689         (namespace_or_type_name): Instead of returning a string, now this
7690         production returns an expression.
7691  
7692         * codegen.cs (EmitContext): Setup IsGeneric property based on
7693         whether our DeclSpace is generic, our the method is generic.
7694  
7695         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
7696         the method is generic.
7697  
7698         * cs-parser.jay (type_arguments, opt_type_argument_list,
7699         type_parameters, type_parameter_list, opt_type_parameter_list,
7700         type_parameter,, opt_type_parameter_constraints_clauses,
7701         type_parameter_constraints_clauses,
7702         type_parameter_constraint_clause, type_parameter_constraint,
7703         interface_constraints): Add new production
7704  
7705         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
7706         DeclSpace is generic or not.
7707  
7708         (DeclSpace.SetParameterInfo): New routine, used to set the
7709         parameter info for a type.
7710  
7711         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
7712         returns a GenericTypeExpr
7713  
7714         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
7715         generic, lookup the generic argument.
7716  
7717         * attribute.cs: Do not allow TypeParameterExpressions in
7718         Attributes.
7719  
7720         * class.cs: Do not allow the Main method to be defined in a
7721         Generic container.
7722  
7723         * expression.cs (SizeOf): Do not allow generic types to be used as
7724         arguments to sizeof.
7725  
7726         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
7727         it: whether a type is generic or not.  Only works for types we are
7728         currently building for now.
7729         
7730 2003-07-20  Martin Baulig  <martin@ximian.com>
7731
7732         * namespace.cs: Fixed that bug which caused a crash when compiling
7733         the debugger's GUI.
7734
7735 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7736
7737         * typemanager.cs (LookupTypeReflection): Never expose types which
7738         are NotPublic, NestedPrivate, NestedAssembly, or
7739         NestedFamANDAssem.  We used to return these, and later do a check
7740         that would report a meaningful error, but the problem is that we
7741         would not get the real match, if there was a name override.
7742
7743 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7744
7745         * namespace.cs (Namespace, Name): Do not compute the namespace
7746         name dynamically, compute it in the constructor.  This reduced
7747         memory usage by 1697 KB.
7748
7749         * driver.cs: Use --pause to pause at the end.
7750
7751 2003-07-17  Peter Williams  <peter@newton.cx>
7752
7753         * Makefile: Change the name of the test target so that it doesn't
7754         conflict with the recursive test target.
7755
7756 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7757
7758         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7759         AddressOf): Do not use EmitThis, that was wrong, use the actual
7760         this pointer.
7761
7762 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7763
7764         * class.cs (MethodData.Define): While checking if a method is an
7765         interface implementation, improve the test: If we are not public
7766         (use new test here: use the computed MethodAttributes directly,
7767         instead of the parsed modifier flags) check if the `implementing'
7768         method comes from an interface or not.
7769
7770         * pending.cs (VerifyPendingMethods): Slightly better error
7771         message.
7772
7773         * makefile: add test target that does the mcs bootstrap.
7774
7775 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7776
7777         * interface.cs (Define): Do nothing here since there are no
7778         members to populate etc. Move the attribute emission out of here
7779         since this was just totally the wrong place to put it. Attribute
7780         application happens during the 'Emit' phase, not in the 'Define'
7781         phase.
7782
7783         (Emit): Add this method and move the attribute emission here
7784
7785         * rootcontext.cs (EmitCode): Call the Emit method on interface
7786         types too.
7787
7788 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7789
7790         * expression.cs (OverloadResolve): Report error only if Location
7791         is not 'Null' which means that there was a probe going on.
7792
7793 2003-07-14  Martin Baulig  <martin@ximian.com>
7794
7795         * expression.cs (ConditionalLogicalOperator): New public class to
7796         implement user defined conditional logical operators.
7797         This is section 14.11.2 in the spec and bug #40505.
7798
7799 2003-07-14  Martin Baulig  <martin@ximian.com>
7800
7801         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7802
7803 2003-07-14  Martin Baulig  <martin@ximian.com>
7804
7805         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7806
7807         * ecore.cs (IVariable.VerifyFixed): New interface method.
7808
7809         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7810         operator, check whether the variable is actually fixed.  Fixes bug
7811         #36055.  Set a variable definitely assigned when taking its
7812         address as required by the spec.
7813
7814         * statement.cs (LocalInfo.IsFixed): New field.
7815         (LocalInfo.MakePinned): Set `IsFixed' to true.
7816
7817 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7818
7819         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7820         for .ctors, ensure that we only ask for members declared in the
7821         attribute type (BindingFlags.DeclaredOnly).
7822
7823         Fixes bug #43632.
7824
7825         * expression.cs (Error_WrongNumArguments): Report error 1501
7826         correctly the way CSC does.
7827
7828 2003-07-13  Martin Baulig  <martin@ximian.com>
7829
7830         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7831         lookup on the fully qualified name, to make things like "X.X" work
7832         where "X.X" is a fully qualified type name, but we also have a
7833         namespace "X" in the using list.  Fixes #41975.
7834
7835 2003-07-13  Martin Baulig  <martin@ximian.com>
7836
7837         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7838         function. If we're a CompoundAssign, we need to create an embedded
7839         CompoundAssign, not an embedded Assign.
7840         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7841         Fixes #45854.
7842
7843 2003-07-13  Martin Baulig  <martin@ximian.com>
7844
7845         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7846         work to fix bug #46088.
7847
7848 2003-07-13  Ravi Pratap <ravi@ximian.com>
7849
7850         * class.cs (Operator.Emit): Do not emit attributes here - it is
7851         taken care of by the Method class that we delegate too. This takes
7852         care of bug #45876.
7853
7854 2003-07-10  Martin Baulig  <martin@ximian.com>
7855
7856         * expression.cs (TypeOfVoid): New class.
7857         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7858
7859 2003-07-10  Martin Baulig  <martin@ximian.com>
7860
7861         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7862         bug #35957.
7863
7864 2003-07-10  Martin Baulig  <martin@ximian.com>
7865
7866         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7867         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7868
7869         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7870
7871         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7872
7873 2003-07-10  Martin Baulig  <martin@ximian.com>
7874
7875         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7876         of decimal.  Fixes #42850.
7877
7878         NOTE: I also fixed the created byte blob, but this doesn't work on
7879         the MS runtime and csc never produces any byte blobs for decimal
7880         arrays.
7881
7882 2003-07-10  Martin Baulig  <martin@ximian.com>
7883
7884         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7885         structs; fixes #32068.
7886         (Block.AddChildVariableNames): Fixed #44302.
7887
7888 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7889
7890         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7891
7892 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7893
7894         * attribute.cs: And this test is onger needed.
7895
7896 2003-07-08  Martin Baulig  <martin@ximian.com>
7897
7898         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7899         inaccessible types.  Fixes #36313.
7900
7901         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7902
7903         * namespace.cs (NamespaceEntry): Create implicit entries for all
7904         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7905         implicit entries for N1.N2 and N1.
7906
7907 2003-07-08  Martin Baulig  <martin@ximian.com>
7908
7909         Rewrote the handling of namespaces to fix a lot of the issues
7910         wrt. `using' aliases etc.
7911
7912         * namespace.cs (Namespace): Splitted this class into a
7913         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7914
7915         * typemanager.cs (TypeManager.IsNamespace): Removed.
7916         (TypeManager.ComputeNamespaces): Only compute namespaces from
7917         loaded assemblies here, not the namespaces from the assembly we're
7918         currently compiling.
7919
7920 2003-07-08  Martin Baulig  <martin@ximian.com>
7921
7922         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7923
7924 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7925
7926         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7927         already fixed it.  
7928
7929         I thought about the memory savings here, but LookupTypeReflection
7930         is used under already very constrained scenarios.  Compiling
7931         corlib or mcs only exposes one hit, so it would not really reduce
7932         any memory consumption.
7933
7934 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7935
7936         * typemanager.cs: fixes bug #45889 by only adding public types from
7937         other assemblies to the list of known types.
7938
7939 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7940
7941         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7942         on the type we resolved.
7943
7944 2003-07-05  Martin Baulig  <martin@ximian.com>
7945
7946         * pending.cs (PendingImplementation.ParentImplements): Don't
7947         create the proxy if the parent is abstract.
7948
7949         * class.cs (TypeContainer.DefineIndexers): Process explicit
7950         interface implementations first.  Fixes #37714.
7951
7952 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7953
7954         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7955         defined recursively;  but since we modify the input parameters
7956         (left is set to `this' temporarily), we reset this value if the
7957         left_is_explicit is false, which gives the original semantics to
7958         the code.  
7959
7960         * literal.cs (NullPointer): new class used to represent a null
7961         literal in a pointer context.
7962
7963         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7964         type is a pointer, use a NullPointer object instead of a
7965         NullLiteral.   Closes 43687
7966
7967         (ExplicitConversion): Convert pointer values using
7968         the conv opcode to the proper type.
7969
7970         * ecore.cs (New): change ValueTypeVariable property into a method,
7971         that returns whether the valuetype is suitable for being used.
7972
7973         * expression.cs (Binary.DoNumericPromotions): Only return if we
7974         the int constant was a valid uint, and we can return both left and
7975         right as uints.  If not, we continue processing, to trigger the
7976         type conversion.  This fixes 39018.
7977
7978         * statement.cs (Block.EmitMeta): During constant resolution, set
7979         the CurrentBlock property on the emitcontext, so that we resolve
7980         constants propertly.
7981
7982 2003-07-02  Martin Baulig  <martin@ximian.com>
7983
7984         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7985         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7986
7987         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7988         than emitting it here.
7989
7990         * statement.cs: Fixed some more flow analysis bugs.
7991
7992 2003-07-02  Martin Baulig  <martin@ximian.com>
7993
7994         * class.cs (MethodData.Define): When implementing interface
7995         methods, set Final unless we're Virtual.
7996
7997         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7998         check work for interface methods.
7999
8000 2003-07-01  Martin Baulig  <martin@ximian.com>
8001
8002         * ecore.cs (EmitContext.This): Replaced this property with a
8003         GetThis() method which takes a Location argument.  This ensures
8004         that we get the correct error location for a CS0188.
8005
8006 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8007
8008         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8009         ImplicitStandardConversion.
8010
8011         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8012
8013 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8014
8015         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8016         optimization.
8017
8018 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8019
8020         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8021         constructors.
8022
8023         (MethodData.Define): Turn off initlocals for unsafe methods.
8024
8025 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8026
8027         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8028         complete;  Fixes #37521.
8029
8030         * delegate.cs: Use Modifiers.TypeAttr to compute the
8031         TypeAttributes, instead of rolling our own.  This makes the flags
8032         correct for the delegates.
8033
8034 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8035
8036         * class.cs (Constructor.Define): Set the private flag for static
8037         constructors as well.
8038
8039         * cs-parser.jay (statement_expression): Set the return value to
8040         null, to avoid a crash when we catch an error.
8041
8042 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8043
8044         * cs-parser.jay: Applied patch from Jackson that adds support for
8045         extern and unsafe modifiers to destructor declarations.
8046
8047         * expression.cs: Report error 21 if the user is trying to index a
8048         System.Array.
8049
8050         * driver.cs: Add an error message, suggested by the bug report.
8051
8052         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8053         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8054
8055 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8056
8057         * namespace.cs: Add some information to reduce FAQs.
8058
8059 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8060
8061         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8062         underlying enumeration types.  Fixes #43915.
8063
8064         * expression.cs: Treat ushort/short as legal values to be used in
8065         bitwise operations.
8066
8067 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8068
8069         * delegate.cs: transfer custom attributes for paramenters from
8070         the delegate declaration to Invoke and BeginInvoke.
8071
8072 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8073
8074         * attribute.cs: handle custom marshalers and emit marshal info
8075         for fields, too.
8076
8077 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8078
8079         * makefile.gnu: Added anonymous.cs to the compiler sources.
8080
8081 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8082
8083         * iterators.cs: Change the name of the proxy class to include two
8084         underscores.
8085
8086         * cs-parser.jay: Update grammar to include anonymous methods.
8087
8088         * anonymous.cs: new file.
8089
8090 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8091
8092         * class.cs (Field.Define): Add missing test for pointers and
8093         safety. 
8094
8095 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8096
8097         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8098         we use the stobj opcode.
8099
8100         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8101         since it wasn't the correct fix. 
8102
8103         It still is puzzling that we are required to use stobj for IntPtr
8104         which seems to be a ValueType.
8105
8106 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8107
8108         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8109         during regular simple name resolution.   Now, the trick is that
8110         instead of returning for processing the simplename, we do a
8111         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8112         contextual lookup type).   If a match is found, return that, if
8113         not, return for further composition.
8114
8115         This fixes long-standing 30485.
8116
8117         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8118         using the address to initialize an object, do an Stobj instead of
8119         using the regular Stelem.
8120
8121         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8122         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8123         Because if we are a BaseIndexerAccess that value will be true.
8124         Fixes 43643.
8125
8126         * statement.cs (GotoCase.Resolve): Return after reporting an
8127         error, do not attempt to continue. 
8128
8129         * expression.cs (PointerArithmetic.Emit): If our operand is a
8130         long, convert our constants to match the operand before
8131         multiplying.  Convert to I type before adding.   Fixes 43670.
8132
8133 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8134
8135         * enum.cs (ImplicitConversionExists) : Rename to
8136         ImplicitEnumConversionExists to remove ambiguity. 
8137
8138         * ecore.cs (NullCast): New type of cast expression class which
8139         basically is very similar to EmptyCast with the difference being
8140         it still is a constant since it is used only to cast a null to
8141         something else
8142         (eg. (string) null)
8143
8144         * convert.cs (ImplicitReferenceConversion): When casting a null
8145         literal, we return a NullCast.
8146
8147         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8148         should be around anymore.
8149
8150         The renaming (reported was slightly wrong). Corrections:
8151
8152         ConvertImplicitStandard -> ImplicitConversionStandard
8153         ConvertExplicitStandard -> ExplicitConversionStandard
8154
8155         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8156         before passing them in !
8157
8158         * convert.cs (ImplicitConversionStandard): When comparing for
8159         equal expr and target types, ensure that expr is not a
8160         NullLiteral.
8161
8162         In general, we must not be checking (expr_type ==
8163         target_type) in the top level conversion methods
8164         (ImplicitConversion, ExplicitConversion etc). This checking is
8165         done in the methods that they delegate to.
8166
8167 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8168
8169         * convert.cs: Move Error_CannotConvertType,
8170         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8171         ImplicitNumericConversion, ImplicitConversionExists,
8172         ImplicitUserConversionExists, StandardConversionExists,
8173         FindMostEncompassedType, FindMostSpecificSource,
8174         FindMostSpecificTarget, ImplicitUserConversion,
8175         ExplicitUserConversion, GetConversionOperators,
8176         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8177         TryImplicitIntConversion, Error_CannotConvertImplicit,
8178         ConvertImplicitRequired, ConvertNumericExplicit,
8179         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8180         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8181         its own file.
8182
8183         Perform the following renames:
8184
8185         StandardConversionExists -> ImplicitStandardConversionExists
8186         ConvertImplicit -> ImplicitConversion
8187         ConvertImplicitStandard -> ImplicitStandardConversion
8188         TryImplicitIntConversion -> ImplicitIntConversion
8189         ConvertImplicitRequired -> ImplicitConversionRequired
8190         ConvertNumericExplicit -> ExplicitNumericConversion
8191         ConvertReferenceExplicit -> ExplicitReferenceConversion
8192         ConvertExplicit -> ExplicitConversion
8193         ConvertExplicitStandard -> ExplicitStandardConversion
8194
8195 2003-05-19  Martin Baulig  <martin@ximian.com>
8196
8197         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8198         (TypeInfo): Added support for structs having structs as fields.
8199
8200         * ecore.cs (FieldExpr): Implement IVariable.
8201         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8202         VariableInfo for the field.
8203
8204 2003-05-18  Martin Baulig  <martin@ximian.com>
8205
8206         * expression.cs (This.DoResolve): Report a CS0027 if we're
8207         emitting a field initializer.
8208
8209 2003-05-18  Martin Baulig  <martin@ximian.com>
8210
8211         * expression.cs (This.ResolveBase): New public function.
8212         (This.DoResolve): Check for CS0188.
8213
8214         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8215         This.Resolve().
8216
8217         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8218         `instance_expression' to null if we don't have any non-static
8219         methods.
8220
8221 2003-05-18  Martin Baulig  <martin@ximian.com>
8222
8223         Reworked the way how local variables and parameters are handled by
8224         the flow analysis code.
8225
8226         * statement.cs (TypeInfo, VariableMap): New public classes.
8227         (VariableInfo): New public class.  This is now responsible for
8228         checking whether a variable has been assigned.  It is used for
8229         parameters and local variables.
8230         (Block.EmitMeta): Take the InternalParameters as argument; compute
8231         the layout of the flow vectors here.
8232         (Block.LocalMap, Block.ParameterMap): New public properties.
8233         (FlowBranching): The .ctor doesn't get the InternalParameters
8234         anymore since Block.EmitMeta() now computes the layout of the flow
8235         vector.
8236         (MyStructInfo): This class is now known as `StructInfo' and nested
8237         in `TypeInfo'; we don't access this directly anymore.
8238
8239         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8240         property and removed IsAssigned(), IsFieldAssigned(),
8241         SetAssigned() and SetFieldAssigned(); we now call them on the
8242         VariableInfo so we don't need to duplicate this code everywhere.
8243
8244         * expression.cs (ParameterReference): Added `Block block' argument
8245         to the .ctor.
8246         (LocalVariableReference, ParameterReference, This): The new
8247         VariableInfo class is now responsible for all the definite
8248         assignment stuff.
8249
8250         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8251         IsParameterAssigned, SetParameterAssigned): Removed.
8252
8253 2003-05-18  Martin Baulig  <martin@ximian.com>
8254
8255         * typemanager.cs (InitCoreTypes): Try calling
8256         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8257         the 3-args-version.  Corlib now also needs our `void_type'.
8258         (GetMethod): Added overloaded version which takes an optional
8259         `bool report_errors' to allow lookups of optional methods.
8260
8261 2003-05-12  Martin Baulig  <martin@ximian.com>
8262
8263         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8264         only used for locals and not for parameters.
8265
8266 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8267
8268         * support.cs (InternalParameters.ParameterType): Return the
8269         ExternalType of the parameter.
8270
8271         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8272         they were unused.
8273
8274 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8275
8276         * class.cs (MethodData.Define): Do not set the `newslot' on
8277         interface members, if they are also flagged as "override".
8278
8279         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8280         better code for ++i and i++.  This only works for static fields
8281         and local variables.
8282
8283         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8284         want to pull the DeclSpace out of the builder_to_declspace instead
8285         of the TypeBuilder (like in TypeContainer.FindMembers).
8286
8287         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8288         instead of LookupTypeContainer.  Fixes the crash on .NET for
8289         looking up interface members.
8290
8291         * const.cs: Create our own emit context during the Definition
8292         stage, so that constants are evaluated in the proper context, when
8293         a recursive definition happens.
8294
8295 2003-05-11  Martin Baulig  <martin@ximian.com>
8296
8297         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8298         new block for a switch section.
8299         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8300         the adding/lookup in the switch block.  Fixes #39828.
8301
8302 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8303
8304         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8305         functionality: I needed to convert the data after I had performed
8306         the add/sub operation into the operands type size.
8307
8308         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8309         pass the type for the box operation, otherwise the resulting
8310         object would have been of type object.
8311
8312         (BoxedCast): Add constructor to specify the type to box as.
8313
8314 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8315
8316         * iterators.cs: I was reusing the `count' variable inadvertently,
8317         take steps to not allow this to happen.
8318
8319 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8320
8321         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8322         by creating an array at the point where the params starts and
8323         putting all those arguments there, then adjusting the size of the
8324         array.
8325
8326 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8327
8328         * expression.cs (New.AddressOf): Implement interface
8329         IMemoryLocation.  This is used when the `new' operator is used in
8330         the context of an invocation to a method on a value type.
8331
8332         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8333         example. 
8334
8335         * namespace.cs: Also check the using aliases here.
8336
8337         * driver.cs: Move the test for using validity after the types have
8338         been entered, so we do a single pass that also includes the using
8339         aliases. 
8340
8341         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8342         in the regular case.   CreateSiblingForFinally is doing extra
8343         error checking.
8344
8345         * attribute.cs (GetAttributeArgumentExpression): Store the result
8346         on an out value, and use the return value to indicate failure
8347         instead of using null (which is a valid return for Constant.GetValue).
8348
8349         * statement.cs: Perform the analysis flow for the increment
8350         portion after the statement, because this will be the real flow of
8351         execution.  Fixes #42385
8352
8353         * codegen.cs (EmitContext.EmitArgument,
8354         EmitContext.EmitStoreArgument): New helper functions when the
8355         RemapToProxy flag is set.
8356
8357         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8358         function.
8359
8360         Add support for remapping parameters. 
8361
8362         * iterators.cs: Propagate parameter values;  Store parameter
8363         values in the proxy classes.
8364
8365 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8366
8367         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8368         need a proxy reference;  I do not know what I was thinking
8369
8370         * cs-parser.jay (constructor_initializer): catch another error,
8371         and display nice message.
8372
8373         (field_declaration): catch void field declaration
8374         to flag a better error. 
8375
8376         * class.cs (MemberBase.CheckBase): Report an error instead of a
8377         warning if a new protected member is declared in a struct. 
8378         (Field.Define): catch the error of readonly/volatile.
8379
8380         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8381
8382         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8383         volatile variable is taken
8384
8385 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8386
8387         * statement.cs (Fixed.Resolve): Report an error if we are not in
8388         an unsafe context.
8389
8390 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8391
8392         * typemanager.cs: reuse the code that handles type clashes for
8393         delegates and enumerations.
8394
8395         * class.cs (Report28): Always report.
8396
8397         * expression.cs (EncodeAsAttribute): Allow nulls here.
8398
8399 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8400
8401         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8402         the functionality for testing whether an expression is valid for
8403         an attribute here.  Also handle the case of arrays of elements
8404         being stored. 
8405
8406         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8407         encoding a linear array into an array of objects that are suitable
8408         to be passed to an CustomAttributeBuilder.
8409
8410         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8411
8412         * ecore.cs: (FieldExpr): Handle field remapping here.
8413
8414         * iteratators.cs: Pass the instance variable (if the method is an
8415         instance method) to the constructors, so we can access the field
8416         variables on the class.
8417
8418         TODO: Test this with structs.  I think the THIS variable on
8419         structs might have to be a pointer, and not a refenrece
8420
8421 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8422
8423         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8424         local variables to fields in a proxy class.
8425
8426         * iterators.cs (PopulateProxy): Rename our internal fields to
8427         <XXX>.  
8428         Create a <THIS> field if we are an instance method, so we can
8429         reference our parent container variables.
8430         (MapVariable): Called back from the EmitContext code to enter a
8431         new variable to field mapping into the proxy class (we just create
8432         a FieldBuilder).
8433
8434         * expression.cs
8435         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8436         for using the remapped locals to fields.
8437
8438         I placed the code here, because that gives the same semantics to
8439         local variables, and only changes the Emit code.
8440
8441         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8442         statements inside iterators.
8443         (VariableInfo): Add a FieldBuilder for the cases when we are
8444         remapping local variables to fields in a proxy class
8445
8446         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8447         current_block != null.
8448
8449         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8450         not cope with strings, as it has been moved to the
8451         TableSwitchEmit.  Fixed bug in switch generation.
8452
8453         * expression.cs (New.DoResolve): Provide more context for the user
8454         when reporting an error.
8455
8456         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8457         pointers. 
8458
8459         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8460         check the permissions for it.  Note than in a type-resolution
8461         context the check was already present in DeclSpace.ResolveType,
8462         but was missing from the MemberAccess.
8463
8464         (ArrayCreation.CheckIndices): warn if the user has
8465         more nested levels of expressions, but there are no more
8466         dimensions specified.  Avoids crash on bug 41906.
8467
8468 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8469
8470         * statement.cs (Block): replace Implicit bool, for a generic
8471         flags.   
8472         New flag: `Unchecked'.  This is used during the EmitMeta phase
8473         (which is out-of-line with the regular Resolve/Emit process for a
8474         statement, as this is done ahead of time, but still gets a chance
8475         to call constant resolve).
8476
8477         (Block.Flags): new enum for adding a new flag.
8478
8479         (Block.EmitMeta): track the state of unchecked.
8480
8481         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8482         to enable constant resolution to work there as well.
8483
8484 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8485
8486         * typemanager.cs (ienumerable_type): Also look up
8487         System.Collections.IEnumerable. 
8488
8489 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8490
8491         TODO: Test more than one conditional per method.
8492
8493         * class.cs (Indexer.Define): Report the location where the user is
8494         referencing the unsupported feature.
8495
8496         (MethodData): Overload the use of `conditionals' to
8497         minimize the creation of needless ArrayLists.   This saves roughly
8498         212kb on my machine.
8499
8500         (Method): Implement the new IIteratorContainer interface.
8501         (Method.SetYields): Implement the method by setting the ModFlags
8502         to contain METHOD_YIELDS.
8503
8504         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8505         which just got set to null.
8506
8507         * iterators.cs: New file.
8508
8509         (Yield, YieldBreak): New statements.
8510
8511         * statement.cs (Return.Resolve): Flag an error if we are used in
8512         an iterator method.
8513
8514         * codegen.cs (InIterator): New flag set if the code is being
8515         compiled in an iterator method.
8516
8517         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8518         internal modifier, and we just use it to avoid adding extra
8519         fields, as this is seldom used.  
8520
8521         * cs-parser.jay: Add yield_statement (yield and yield break).
8522
8523         * driver.cs: New flag -v2 to turn on version 2 features. 
8524
8525         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8526         hashtable when v2 is enabled.
8527
8528 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8529
8530         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8531         there is already a namespace defined with this name.
8532
8533         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8534         people upgraded their corlibs.
8535
8536         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8537         always use fully qualified types, no need to use the compiler
8538         front end.
8539
8540         (TypeManager.IsNamespace): Use binarysearch.
8541
8542         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8543         AddDelegate): I did not quite use the new IsValid API properly: I
8544         have to pass the short-name and the fullname.  I was passing only
8545         the basename instead of the fullname sometimes. 
8546
8547         (TypeContainer.DefineType): call NamespaceClash.
8548
8549         * interface.cs (Interface.DefineType): use NamespaceClash before
8550         defining the type.
8551
8552         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8553         defining the type.
8554
8555         * enum.cs: (Enum.DefineType): use NamespaceClash before
8556         defining the type.
8557
8558         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8559         speed increase.  First, use the negative_hits cache when we get a
8560         negative.  Second, add the type with its full original name
8561         instead of the new . and + encoded name (reflection uses + to
8562         separate type from a nested type).  Use LookupTypeReflection
8563         directly which bypasses the type->name hashtable (that we already
8564         know does not contain the type.
8565
8566         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8567         location/container type. 
8568
8569         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8570
8571 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8572
8573         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8574
8575         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8576         method is being referenced in the method group from a static
8577         context, and report error 120 if so.
8578
8579         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8580         Error118. 
8581
8582         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8583         is created, we create the A namespace).
8584
8585         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8586         Fixes #41591
8587
8588 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8589
8590         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8591         invocation to ModuleBuilder.GetType with the same values will
8592         return a new type instance, so we need to cache its return
8593         values. 
8594
8595         * expression.cs (Binary.ResolveOperator): Only allow the compare
8596         operators on enums if they are of the same type.
8597
8598         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8599         types of ValueType on their own case.  Before we were giving them
8600         the same treatment as objects.
8601
8602         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8603         fullname.  Short name is used to compare against container name.
8604         Fullname is used to check against defined namespace names.
8605
8606         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8607         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8608
8609         (Method.CheckBase): Call parent.
8610         (MemberBase.CheckBase): Check for protected members on sealed
8611         classes.
8612         (PropertyBase.CheckBase): Call parent.
8613         (Field.Define): Call parent.
8614
8615         * report.cs: Negative error codes are now mapped to 8000 - code,
8616         so that the display is render more nicely.
8617
8618         * typemanager.cs: Do not use try/catch, instead report a regular
8619         error. 
8620
8621         (GetPointerType, GetReferenceType): These methods provide
8622         mechanisms to obtain the T* and T& from a T.  We had the code
8623         previously scattered around the code base, and it also used
8624         TypeManager.LookupType that would go through plenty of caches.
8625         This one goes directly to the type source.
8626
8627         In some places we did the Type.GetType followed by
8628         ModuleBuilder.GetType, but not in others, so this unifies the
8629         processing as well.
8630
8631         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8632         statements now that we have namespace information.
8633
8634         * typemanager.cs (IsNamespace): New method, returns whether the
8635         string presented is a namespace or not.
8636
8637         (ComputeNamespaces): New public entry point, computes the list of
8638         available namespaces, using the GetNamespaces API call in Mono, or
8639         the slower version in MS.NET.   
8640
8641         Now before we start the semantic analysis phase, we have a
8642         complete list of namespaces including everything that the user has
8643         provided.
8644
8645         Deleted old code to cache namespaces in .nsc files.
8646
8647 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8648
8649         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8650         class/struct location definition Location for the implicit
8651         constructor location.
8652
8653         (Operator.Define): Use the location of the operator for the
8654         implicit Method definition.
8655
8656         (Constructor.Emit): use the constructor location for the implicit
8657         base initializer constructor.
8658
8659         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8660         and the Expression class now contains two new methods:
8661
8662         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8663         isolate type lookup from the rest of the resolution process.
8664
8665         Since we use Expressions to hold type definitions due to the way
8666         we parse the input we have historically overloaded Resolve to
8667         perform the Type lookups if a special flag is passed.  Now this is
8668         eliminated and two methods take their place. 
8669
8670         The differences in the two methods between xStep and xTerminal is
8671         that xStep is involved in our current lookup system that uses
8672         SimpleNames to compose a name, while xTerminal is used just to
8673         catch the case where the simplename lookup failed.
8674
8675 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8676
8677         * expression.cs (ResolveMemberAccess): Remove redundant code.
8678         TypeExpr expressions are always born fully resolved.
8679
8680         * interface.cs (PopulateMethod): Do not lookup the types twice.
8681         We were doing it once during SemanticAnalysis and once during
8682         PopulateMethod.
8683
8684         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8685         in local variable type definitions, were being returned as a
8686         SimpleName (we decomposed everything into a string), that is
8687         because primary_expression was being used instead of a type in the
8688         grammar (reduce/reduce conflicts).
8689
8690         The part that was wrong is that we converted the expression into a
8691         string (an oversimplification in one hand, compounded with primary
8692         expressions doing string concatenation).
8693
8694         So things like:
8695
8696         A.B.C [] x;
8697
8698         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8699         using clauses from working on this particular context.  And a type
8700         was being matched directly against "A.B.C[]".
8701
8702         We now use the correct approach, and allow for ComposedCast to be
8703         part of the unary expression.  So the "A.B.C []" become a composed
8704         cast of "A.B.C" (as a nested group of MemberAccess with a
8705         SimpleName at the end) plus the rank composition "[]". 
8706
8707         Also fixes 35567
8708
8709 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8710
8711         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8712         for the access level checking.
8713
8714         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8715         `TypeContainer container', because I kept getting confused when I
8716         was debugging this code.
8717
8718         * expression.cs (Indexers): Instead of tracking getters/setters,
8719         we now track them in parallel.  We create one arraylist less, but
8720         most importantly it is possible now for the LValue code to find a
8721         matching get for a set.
8722
8723         (IndexerAccess.DoResolveLValue): Update the code.
8724         GetIndexersForType has been modified already to extract all the
8725         indexers from a type.  The code assumed it did not.
8726
8727         Also make the code set the correct return type for the indexer.
8728         This was fixed a long time ago for properties, but was missing for
8729         indexers.  It used to be void_type.
8730
8731         (Binary.Emit): Test first for doubles instead of
8732         floats, as they are more common.
8733
8734         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8735         when dealing with floats and the <=, >= operators.  This fixes bug
8736         #39314 
8737
8738         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8739         to load the array value by emitting a load on the foreach variable
8740         type.  This was incorrect.  
8741
8742         We now emit the code to load an element using the the array
8743         variable type, and then we emit the conversion operator.
8744
8745         Fixed #40176
8746
8747 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8748
8749         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8750
8751 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8752
8753         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8754         test for protection before we test for signatures. 
8755
8756         (MethodSignature.ToString): implement.
8757
8758         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8759         to the case where we reduced into a LongConstant.
8760
8761         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8762         depend on whether the information is acurrate, because the
8763         Microsoft runtime will always claim that the array type is public,
8764         regardless of the real state.
8765
8766         If the type is a pointer, another problem happens: the type is
8767         reported as non-public in Microsoft.  
8768
8769         In both cases we have to call CheckAccessLevel recursively with
8770         the underlying type as the argument to be tested.
8771
8772 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8773
8774         * assign.cs (Assign.Emit): If we are dealing with a compound
8775         assignment expression, we should use the code path that stores the
8776         intermediate result in a temporary value.  This fixes #40903.
8777
8778         *expression.cs (Indirection.ToString): Provide ToString method for
8779         debugging. 
8780
8781 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8782
8783         * class.cs: Null out fields holding references to Block objects so
8784         they can be garbage collected.
8785
8786         * expression.cs (OverloadResolve): Remove unused local.
8787
8788 2003-04-07  Martin Baulig  <martin@ximian.com>
8789
8790         * codegen.cs (EmitContext.CurrentFile): New public field.
8791         (EmitContext.Mark): Use the CurrentFile to check whether the
8792         location is in the correct file.
8793         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8794
8795 2003-04-07  Martin Baulig  <martin@ximian.com>
8796
8797         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8798
8799         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8800         location.  [FIXME: The location argument which gets passed to this
8801         method is sometimes wrong!]
8802
8803 2003-04-07  Nick Drochak <ndrochak@gol.com>
8804
8805         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8806
8807 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8808
8809         * expression.cs (Indirection.EmitAssign): We were using the
8810         temporary, but returning immediately instead of continuing the
8811         EmitAssing flow.
8812
8813 2003-04-06  Martin Baulig  <martin@ximian.com>
8814
8815         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8816         if it's a nested child, but also deriving from the outer class.
8817         See test 190.cs.
8818
8819         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8820         nested child, but also deriving from the outer class.  See
8821         test-190.cs.
8822         (FilterWithClosure): We may access private members of the outer
8823         class if we're a nested child and deriving from the outer class.
8824         (RealMemberLookup): Only set `closure_private_ok' if the
8825         `original_bf' contained BindingFlags.NonPublic.
8826
8827 2003-04-05  Martin Baulig  <martin@ximian.com>
8828
8829         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
8830         probe if its a type parameter, and if so, flag an error.
8831
8832         * decl.cs: Move here the SetParameterInfo code from class.cs.
8833         Handle IsGeneric here.
8834
8835         Handle a variety of errors in the parameter info definition.
8836
8837         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
8838         type parameters here.
8839
8840         * cs-parser.jay (class_declaration): report errors for parameters
8841         here as well.
8842
8843 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
8844
8845         * generic.cs: New file, contains support code for generics.
8846
8847         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
8848         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
8849
8850         Update parser for the above removals.
8851
8852         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
8853         now taken care of in the parser.
8854
8855 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8856
8857         * class.cs (Event.Define): Do not allow abstract events to have
8858         initializers. 
8859
8860 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8861
8862         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8863         block in event declarations.
8864
8865         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8866         value type, get its address.
8867
8868         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8869         leaving a class on the stack instead of a boolean value (int
8870         0/1).  Change the code so we compare against null, and then the
8871         result against zero.
8872
8873         * class.cs (TypeContainer.GetClassBases): We were checking for the
8874         parent class being sealed too late.
8875
8876         * expression.cs (Binary.Emit): For <= and >= when dealing with
8877         floating point values, use cgt.un and clt.un instead of cgt and
8878         clt alone.
8879
8880 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8881
8882         * statement.cs: Apply the same optimization as MS: skip the 
8883         GetEnumerator returning an IEnumerator, and use the one returning a 
8884         CharEnumerator instead. This allows us to avoid the try-finally block 
8885         and the boxing.
8886
8887 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8888
8889         * cs-parser.jay: Attributes cannot be applied to
8890                          namespaces. Fixes #40473
8891
8892 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8893
8894         * class.cs:
8895         (Add*): check if the name is valid using the full name for constants,
8896         fields, properties and events.
8897
8898 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8899
8900         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8901         char constants to be part of the enumeration.
8902
8903         * expression.cs (Conditional.DoResolve): Add support for operator
8904         true. Implements the missing functionality from 14.12
8905
8906         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8907         operator true/false as required by the spec.
8908
8909         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8910         implicit conversion to boolean.
8911
8912         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8913         also one where the type implements `operator true'. 
8914
8915         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8916         get an expression that will invoke operator true based on an
8917         expression.  
8918
8919         (GetConversionOperators): Removed the hack that called op_True
8920         here.  
8921
8922         (Expression.ResolveBoolean): Move this from Statement.
8923
8924 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8925
8926         * ecore.cs (FieldExpr): do not allow initialization of initonly
8927         fields on derived classes
8928
8929 2003-03-13  Martin Baulig  <martin@ximian.com>
8930
8931         * statement.cs (Block.Emit): Call ig.BeginScope() and
8932         ig.EndScope() when compiling with debugging info; call
8933         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8934
8935 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8936
8937         * expression.cs (Indexers): Do not construct immediately, allow
8938         for new members to be appended as we go.  Fixes 38143
8939
8940 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8941
8942         * expression.cs: save/restore context when resolving an unchecked
8943         expression.
8944
8945 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8946
8947         * cfold.cs: Catch division by zero in modulus operator during
8948         constant folding.
8949
8950 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8951
8952         * interface.cs (Interface.DefineMembers): Avoid defining members
8953         twice. 
8954
8955 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8956
8957         * driver.cs: handle the +/- options for -noconfig
8958
8959         * statement.cs (Unckeched.Resolve): Also track the state of
8960         unchecked in the Resolve phase.
8961
8962 2003-02-27  Martin Baulig  <martin@ximian.com>
8963
8964         * ecore.cs (Expression.MemberLookup): Don't create a
8965         MethodGroupExpr for something which is not a method.  Fixes #38291.
8966
8967 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8968
8969         * class.cs (MemberBase.CheckParameters): Also check that the type
8970         is unmanaged if it is a pointer.
8971
8972         * expression.cs (SizeOf.Resolve): Add location information.
8973
8974         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8975         a managed type is declared.
8976
8977         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8978         parameter modifiers as well.  Fixes bug 38606
8979
8980         * class.cs: Very sad.  Am backing out the speed up changes
8981         introduced by the ArrayList -> Array in the TypeContainer, as they
8982         were not actually that much faster, and introduced a bug (no error
8983         reports on duplicated methods).
8984
8985         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8986         source first, this will guarantee that we have a valid expression
8987         before calling in lower levels functions that will require a
8988         resolved object.  Then use this original_source in the
8989         target.ResolveLValue instead of the original source that was
8990         passed to us.
8991
8992         Another change.  Use target.Resolve instead of LValueResolve.
8993         Although we are resolving for LValues, we will let the Assign code
8994         take care of that (it will be called again from Resolve).  This
8995         basically allows code like this:
8996
8997         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8998         class Y { void A (X x) { x [0] += o; }
8999
9000         The problem was that the indexer was trying to resolve for
9001         set_Item (idx, object o) and never finding one.  The real set_Item
9002         was set_Item (idx, X).  By delaying the process we get the right
9003         semantics. 
9004
9005         Fixes bug 36505
9006
9007 2003-02-23  Martin Baulig  <martin@ximian.com>
9008
9009         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9010         while calling DoEmit ().
9011
9012         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9013         source files; if you use the #line directive inside a method, the
9014         compiler stops emitting line numbers for the debugger until it
9015         reaches the end of the method or another #line directive which
9016         restores the original file.
9017
9018 2003-02-23  Martin Baulig  <martin@ximian.com>
9019
9020         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9021
9022 2003-02-23  Martin Baulig  <martin@ximian.com>
9023
9024         * statement.cs (Block.AddChildVariableNames): We need to call this
9025         recursively, not just for our immediate children.
9026
9027 2003-02-23  Martin Baulig  <martin@ximian.com>
9028
9029         * class.cs (Event.Define): Always make the field private, like csc does.
9030
9031         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9032         actually work, fixes bug #37521.
9033
9034 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9035
9036         * delegate.cs: When creating the various temporary "Parameters"
9037         classes, make sure that we call the ComputeAndDefineParameterTypes
9038         on those new parameters (just like we do with the formal ones), to
9039         allow them to be resolved in the context of the DeclSpace.
9040
9041         This fixes the bug that Dick observed in Bugzilla #38530.
9042
9043 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9044
9045         * expression.cs (ResolveMemberAccess): When resolving a constant,
9046         do not attempt to pull a constant if the value was not able to
9047         generate a valid constant.
9048
9049         * const.cs (LookupConstantValue): Do not report more errors than required.
9050
9051 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9052
9053         * expression.cs: fixes bug #38328.
9054
9055 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9056
9057         * class.cs: Changed all the various members that can be part of a
9058         class from being an ArrayList to be an Array of the right type.
9059         During the DefineType type_list, interface_list, delegate_list and
9060         enum_list are turned into types, interfaces, delegates and enums
9061         arrays.  
9062
9063         And during the member population, indexer_list, event_list,
9064         constant_list, field_list, instance_constructor_list, method_list,
9065         operator_list and property_list are turned into their real arrays.
9066
9067         Although we could probably perform this operation earlier, for
9068         good error reporting we need to keep the lists and remove the
9069         lists for longer than required.
9070
9071         This optimization was triggered by Paolo profiling the compiler
9072         speed on the output of `gen-sample-program.pl' perl script. 
9073
9074         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9075         not crash in methods like MemberLookupFailed that use this field.  
9076
9077         This problem arises when the compiler fails to resolve a type
9078         during interface type definition for example.
9079
9080 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9081
9082         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9083         inherit from System.Object, so we have to stop at null, not only
9084         when reaching System.Object.
9085
9086 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9087
9088         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9089         DeclaredOnly because the parent indexer might have had a different
9090         name, but did not loop until the top of the hierarchy was reached.
9091
9092         The problem this one fixes is 35492: when a class implemented an
9093         indexer from an interface, we were getting the interface method
9094         (which was abstract) and we were flagging an error (can not invoke
9095         abstract method).
9096
9097         This also keeps bug 33089 functioning, and test-148 functioning.
9098
9099         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9100         out if a method is special is to see if it is declared in a
9101         property or event, or whether it is one of the predefined operator
9102         names.   This should fix correctly #36804.
9103
9104 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9105
9106         The goal here is to remove the dependency on EmptyCast.Peel ().
9107         Killing it completely.
9108
9109         The problem is that currently in a number of places where
9110         constants are expected, we have to "probe" for an EmptyCast, and
9111         Peel, which is not the correct thing to do, as this will be
9112         repetitive and will likely lead to errors. 
9113
9114         The idea is to remove any EmptyCasts that are used in casts that
9115         can be reduced to constants, so we only have to cope with
9116         constants. 
9117
9118         This bug hunt was triggered by Bug 37363 and the desire to remove
9119         the duplicate pattern where we were "peeling" emptycasts to check
9120         whether they were constants.  Now constants will always be
9121         constants.
9122
9123         * ecore.cs: Use an enumconstant here instead of wrapping with
9124         EmptyCast.  
9125
9126         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9127         throwing me off.  By handling this we can get rid of a few hacks.
9128
9129         * statement.cs (Switch): Removed Peel() code.
9130
9131 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9132
9133         * class.cs: Location information for error 508
9134
9135         * expression.cs (New.DoResolve): Add a guard against double
9136         resolution of an expression.  
9137
9138         The New DoResolve might be called twice when initializing field
9139         expressions (see EmitFieldInitializers, the call to
9140         GetInitializerExpression will perform a resolve on the expression,
9141         and later the assign will trigger another resolution
9142
9143         This leads to bugs (#37014)
9144
9145         * delegate.cs: The signature for EndInvoke should contain any ref
9146         or out parameters as well.  We were not doing this in the past. 
9147
9148         * class.cs (Field.Define): Do not overwrite the type definition
9149         inside the `volatile' group.  Turns out that volatile enumerations
9150         were changing the type here to perform a validity test, which
9151         broke conversions. 
9152
9153 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9154
9155         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9156         and structs, we do not want to load the instance variable
9157
9158         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9159         enum_type has to be handled like an object reference (implicit
9160         conversions exists from this to object), but the regular IsClass
9161         and IsValueType tests will never return true for this one.
9162
9163         Also we use TypeManager.IsValueType instead of type.IsValueType,
9164         just for consistency with the rest of the code (this is only
9165         needed if we ever use the construct exposed by test-180.cs inside
9166         corlib, which we dont today).
9167
9168 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9169
9170         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9171         just InternalCall.
9172
9173 2003-02-09  Martin Baulig  <martin@ximian.com>
9174
9175         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9176         (Namespace.DefineNamespaces): New static public method; this is
9177         called when we're compiling with debugging to add all namespaces
9178         to the symbol file.
9179
9180         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9181         pass it to the Namespace's .ctor.
9182
9183         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9184         and MethodBase arguments; pass the namespace ID to the symwriter;
9185         pass the MethodBase instead of the token to the symwriter.
9186         (SymbolWriter.DefineNamespace): New method to add a namespace to
9187         the symbol file.
9188
9189 2003-02-09  Martin Baulig  <martin@ximian.com>
9190
9191         * symbolwriter.cs: New file.  This is a wrapper around
9192         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9193         methods here in near future.
9194
9195 2003-02-09  Martin Baulig  <martin@ximian.com>
9196
9197         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9198         ILGenerator.MarkSequencePoint() which are actually used by the
9199         symbol writer.
9200
9201 2003-02-09  Martin Baulig  <martin@ximian.com>
9202
9203         * location.cs (SourceFile): New public sealed class.  This
9204         contains the name and an index which is used in the location's token.
9205         (Location): Reserve an appropriate number of bits in the token for
9206         the source file instead of walking over that list, this gives us a
9207         really huge performance improvement when compiling with debugging.
9208
9209         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9210         `SourceFile' argument instead of a string.
9211         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9212         but don't parse/tokenize here, we need to generate the list of all
9213         source files before we do that.
9214         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9215         the files.
9216
9217         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9218         instead of a string.
9219
9220         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9221         of a string.
9222
9223 2003-02-09  Martin Baulig  <martin@ximian.com>
9224
9225         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9226         filename on `#line default'.
9227
9228 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9229
9230         * statement.cs: don't clear the pinned var when the fixed statement
9231         returns from the method (fixes bug#37752).
9232
9233 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9234
9235         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9236         to IsValueType.
9237
9238 2003-02-07  Martin Baulig  <martin@ximian.com>
9239
9240         * driver.cs: Removed the `--debug-args' command line argument.
9241
9242         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9243         automatically by the AsssemblyBuilder.
9244         (CodeGen.InitializeSymbolWriter): We don't need to call any
9245         initialization function on the symbol writer anymore.  This method
9246         doesn't take any arguments.
9247
9248 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9249
9250         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9251         from referenced assemblies as well.
9252
9253 2003-02-02  Martin Baulig  <martin@ximian.com>
9254
9255         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9256
9257 2003-02-02  Martin Baulig  <martin@ximian.com>
9258
9259         * class.cs (Constructor.Emit): Open the symbol writer before
9260         emitting the constructor initializer.
9261         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9262         single-stepping through constructor initializers.
9263
9264 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9265
9266         * class.cs: Handle error 549: do not allow virtual methods in
9267         sealed classes. 
9268
9269 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9270
9271         * decl.cs: Check access levels when resolving types
9272
9273 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9274
9275         * statement.cs: Add parameters and locals set in catch blocks that might 
9276         return to set vector
9277
9278 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9279
9280         * class.cs (Operator): Set the SpecialName flags for operators.
9281
9282         * expression.cs (Invocation.DoResolve): Only block calls to
9283         accessors and operators on SpecialName methods.
9284
9285         (Cast.TryReduce): Handle conversions from char constants.
9286
9287
9288 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9289
9290         * statement.cs: small memory and time optimization in FlowBranching.
9291
9292 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9293
9294         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9295         problem that the last fix but in the other sid (Set).
9296
9297         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9298         access when there is no indexer in the hierarchy.
9299
9300 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9301
9302         * class.cs: Combine some if statements.
9303
9304 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9305
9306         * driver.cs: fixed bug #37187.
9307
9308 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9309
9310         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9311         any indexer, it's needed to build a list with all the indexers in the
9312         hierarchy (AllGetters), else we have problems. Fixes #35653.
9313
9314 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9315
9316         * class.cs (MethodData.Define): It is wrong for an interface
9317         implementation to be static in both cases: explicit and implicit.
9318         We were only handling this in one case.
9319
9320         Improve the if situation there to not have negations.
9321
9322         * class.cs (Field.Define): Turns out that we do not need to check
9323         the unsafe bit on field definition, only on usage.  Remove the test.
9324
9325 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9326
9327         * driver.cs: use assembly.Location instead of Codebase (the latest
9328         patch made mcs fail when using MS assemblies).
9329
9330 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9331
9332         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9333         get the path to *corlib.dll.
9334
9335 2003-01-21  Nick Drochak <ndrochak@gol.com>
9336
9337         * cs-tokenizer.cs:
9338         * pending.cs:
9339         * typemanager.cs: Remove compiler warnings
9340
9341 2003-01-20  Duncan Mak  <duncan@ximian.com>
9342
9343         * AssemblyInfo.cs: Bump the version number to 0.19.
9344
9345 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9346
9347         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9348
9349 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9350
9351         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9352
9353 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9354
9355         * cs-parser.jay: Small fix: we were not comparing the constructor
9356         name correctly.   Thanks to Zoltan for the initial pointer.
9357
9358 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9359
9360         * cs-tokenizer.cs: Set file name when specified with #line
9361
9362 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9363
9364         * cs-parser.jay: Only perform the constructor checks here if we
9365         are named like the class;  This will help provider a better
9366         error.  The constructor path is taken when a type definition is
9367         not found, but most likely the user forgot to add the type, so
9368         report that rather than the constructor error.
9369
9370 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9371
9372         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9373         allocations.
9374
9375 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9376
9377         * cs-parser.jay: Add cleanup call.
9378
9379 2003-01-13  Duncan Mak  <duncan@ximian.com>
9380
9381         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9382         consistent with other methods.
9383
9384 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9385
9386         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9387
9388 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9389
9390         * attribute.cs: only set GuidAttr to true when we have a
9391         GuidAttribute.
9392
9393 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9394
9395         * ecore.cs:
9396         * expression.cs:
9397         * typemanager.cs: fixes to allow mcs compile corlib with the new
9398         Type.IsSubclassOf fix.
9399
9400 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9401
9402         * expression.cs (LocalVariableReference.DoResolve): Classify a
9403         constant as a value, not as a variable.   Also, set the type for
9404         the variable.
9405
9406         * cs-parser.jay (fixed_statement): take a type instead of a
9407         pointer_type, so we can produce a better error message later.
9408
9409         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9410         as an error.  
9411
9412         (For.DoEmit): Make inifinite loops have a
9413         non-conditional branch back.
9414
9415         (Fixed.DoEmit): First populate the pinned variables, then emit the
9416         statement, then clear the variables.  Before I was emitting the
9417         code once for each fixed piece.
9418
9419
9420 2003-01-08  Martin Baulig  <martin@ximian.com>
9421
9422         * statement.cs (FlowBranching.MergeChild): A break in a
9423         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9424
9425 2003-01-08  Martin Baulig  <martin@ximian.com>
9426
9427         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9428         lives in the same number space than `param_map'.  Fixes #36154.
9429
9430 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9431
9432         * cs-parser.jay (constructor_declaration): Set the
9433         Constructor.ModFlags before probing for it.  This makes the
9434         compiler report 514, 515 and 132 (the code was there, but got
9435         broken). 
9436
9437         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9438         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9439         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9440
9441 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9442
9443         * enum.cs: create the enum static fields using the enum type.
9444
9445 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9446
9447         * class.cs: don't try to create the ParamBuilder for the return
9448         type if it's not needed (and handle it breaking for the ms runtime
9449         anyway).
9450
9451 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9452
9453         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9454
9455 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9456
9457         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9458         the command.   This showed up while compiling the JANET source
9459         code, which used \r as its only newline separator.
9460
9461 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9462
9463         * class.cs (Method.Define): If we are an operator (because it
9464         reuses our code), then set the SpecialName and HideBySig.  #36128
9465
9466 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9467
9468         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9469         exception, report error 120 `object reference required'.
9470
9471         * driver.cs: Add --pause option, used during to measure the size
9472         of the process as it goes with --timestamp.
9473
9474         * expression.cs (Invocation.DoResolve): Do not allow methods with
9475         SpecialName to be invoked.
9476
9477 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9478
9479         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9480         number before adding it.
9481
9482 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9483
9484         * ecore.cs (StandardImplicitConversion): When in an unsafe
9485         context, we allow conversion between void * to any other pointer
9486         type. This fixes bug #35973.
9487
9488 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9489
9490         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9491         is not thrown when extensionless outputs are used 
9492
9493 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9494
9495         * rootcontext.cs: fixed compilation of corlib.
9496
9497 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9498
9499         * attribute.cs (Attributes.Contains): Add new method.
9500
9501         * class.cs (MethodCore.LabelParameters): if the parameter is an
9502         `out' parameter, check that no attribute `[In]' has been passed.
9503
9504         * enum.cs: Handle the `value__' name in an enumeration.
9505
9506 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9507
9508         * decl.cs: Added special case to allow overrides on "protected
9509         internal" methods
9510
9511 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9512
9513         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9514         since it makes much more sense.
9515
9516         (Attributes.ctor): Don't require a Location parameter.
9517
9518         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9519
9520         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9521         since we already have that information per attribute.
9522
9523         * everywhere : make appropriate changes.
9524
9525         * class.cs (LabelParameters): Write the code which actually
9526         applies attributes to the return type. We can't do this on the MS
9527         .NET runtime so we flag a warning in the case an exception is
9528         thrown.
9529
9530 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * const.cs: Handle implicit null conversions here too.
9533
9534 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9535
9536         * class.cs (MethodCore.LabelParameters): Remove the extra
9537         Type [] parameter since it is completely unnecessary. Instead
9538         pass in the method's attributes so that we can extract
9539         the "return" attribute.
9540
9541 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9542
9543         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9544         of ignoring it and letting the compile continue.
9545
9546         * typemanager.cs (ChangeType): use an extra argument to return an
9547         error condition instead of throwing an exception.
9548
9549 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9550
9551         * expression.cs (Unary.TryReduce): mimic the code for the regular
9552         code path.  Perform an implicit cast in the cases where we can
9553         implicitly convert to one of the integral types, and then reduce
9554         based on that constant.   This fixes bug #35483.
9555
9556 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9557
9558         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9559
9560 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9561
9562         * namespace.cs: fixed bug #35489.
9563
9564 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9565
9566         * class.cs: Remove some dead code.
9567
9568         * cs-parser.jay: Estimate the number of methods needed
9569         (RootContext.MethodCount);
9570
9571         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9572         numbers instead of StringBuilders.
9573
9574         * support.cs (PtrHashtable): Add constructor with initial size;
9575         We can now reduce reallocations of the method table.
9576
9577 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9578
9579         * attribute.cs (ApplyAttributes): Keep track of the emitted
9580         attributes on a per-target basis. This fixes bug #35413.
9581
9582 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9583
9584         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9585         default to the Windows 1252 encoding.
9586
9587         (UnixParseOption): Support version, thanks to Alp for the missing
9588         pointer. 
9589
9590         * AssemblyInfo.cs: Add nice assembly information.
9591
9592         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9593         (bug 35169).
9594
9595         * cs-parser.jay: Allow a trailing comma before the close bracked
9596         in the attribute_section production.
9597
9598         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9599         address of the instance was being taken, I will take this out,
9600         because we take the address of the object immediately here.
9601
9602 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9603
9604         * typemanager.cs (AreMultipleAllowed): Take care of the most
9605         obvious case where attribute type is not in the current assembly -
9606         stupid me ;-)
9607
9608 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9609
9610         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9611         definitions, instead of doing that afterwards.  
9612
9613         Also we use a nice little hack, depending on the constructor, we
9614         know if we are a "composed" name or a simple name.  Hence, we
9615         avoid the IndexOf test, and we avoid 
9616
9617         * codegen.cs: Add code to assist in a bug reporter to track down
9618         the source of a compiler crash. 
9619
9620 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9621
9622         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9623         types have been emitted for a given element and flag an error
9624         if something which does not have AllowMultiple set is used more
9625         than once.
9626
9627         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9628         attribute types and their corresponding AllowMultiple properties
9629
9630         (AreMultipleAllowed): Check the property for a given type.
9631
9632         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9633         property in the case we have a TypeContainer.
9634
9635         (Attributes.AddAttribute): Detect duplicates and just skip on
9636         adding them. This trivial fix catches a pretty gross error in our
9637         attribute emission - global attributes were being emitted twice!
9638
9639         Bugzilla bug #33187 is now fixed.
9640
9641 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9642
9643         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9644         instead of pp_and).
9645
9646         * expression.cs (Binary.ResolveOperator): I can only use the
9647         Concat (string, string, string) and Concat (string, string,
9648         string, string) if the child is actually a concatenation of
9649         strings. 
9650
9651 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9652
9653         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9654         context where we need a 2-character lookahead.
9655
9656         * pending.cs (PendingImplementation): Rework so we can keep track
9657         of interface types all the time, and flag those which were
9658         implemented by parents as optional.
9659
9660 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9661
9662         * expression.cs (Binary.ResolveOperator): Use
9663         String.Concat(string,string,string) or
9664         String.Concat(string,string,string,string) when possible. 
9665
9666         * typemanager: More helper methods.
9667
9668
9669 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9670
9671         * pending.cs: remove the bogus return from GetMissingInterfaces()
9672         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9673
9674 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9675
9676         * namespace.cs: avoid duplicated 'using xxx' being added to
9677         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9678         when we get more than one 'using' statement for the same namespace.
9679         Report a CS0105 warning for it.
9680
9681 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9682
9683         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9684         of calling getChar/putback, uses internal knowledge of it.    
9685
9686         (xtoken): Reorder tokenizer so most common patterns are checked
9687         first.  This reduces the compilation time in another 5% (from 8.11s
9688         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9689
9690         The parsing time is 22% of the compilation in mcs, and from that
9691         64% is spent on the tokenization process.  
9692
9693         I tried using a binary search for keywords, but this is slower
9694         than the hashtable.  Another option would be to do a couple of
9695         things:
9696
9697                 * Not use a StringBuilder, instead use an array of chars,
9698                   with a set value.  Notice that this way we could catch
9699                   the 645 error without having to do it *afterwards*.
9700
9701                 * We could write a hand-parser to avoid the hashtable
9702                   compares altogether.
9703
9704         The identifier consumption process takes 37% of the tokenization
9705         time.  Another 15% is spent on is_number.  56% of the time spent
9706         on is_number is spent on Int64.Parse:
9707
9708                 * We could probably choose based on the string length to
9709                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9710                   computations. 
9711
9712         Another 3% is spend on wrapping `xtoken' in the `token' function.
9713
9714         Handle 0xa0 as whitespace (#34752)
9715
9716 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9717
9718         * typemanager.cs (IsCLRType): New routine to tell whether a type
9719         is one of the builtin types.  
9720
9721         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9722         typecode in more places instead of doing pointer comparissions.
9723         We could leverage some knowledge about the way the typecodes are
9724         laid out.
9725
9726         New code to cache namespaces in assemblies, it is currently not
9727         invoked, to be used soon.
9728
9729         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9730
9731         * expression.cs (Binary.ResolveOperator): specially handle
9732         strings, and do not perform user-defined operator overloading for
9733         built-in types.
9734
9735 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9736
9737         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9738         internalcall as it is a pretty simple operation;  Avoid whenever
9739         possible to call Char.IsLetter.
9740
9741         (consume_identifier): Cut by half the number of
9742         hashtable calls by merging the is_keyword and GetKeyword behavior.
9743
9744         Do not short-circuit, because if we do, we
9745         report errors (ie, #if false && true would produce an invalid
9746         directive error);
9747
9748
9749 2002-11-24  Martin Baulig  <martin@ximian.com>
9750
9751         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9752         check constant ranges and report a CS0221.  Fixes #33186.
9753
9754 2002-11-24  Martin Baulig  <martin@ximian.com>
9755
9756         * cs-parser.jay: Make this work for uninitialized variable
9757         declarations in the `for' initializer.  Fixes #32416.
9758
9759 2002-11-24  Martin Baulig  <martin@ximian.com>
9760
9761         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9762         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9763
9764 2002-11-24  Martin Baulig  <martin@ximian.com>
9765
9766         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9767         argument; if true, we also check for user-defined conversions.
9768         This is only needed if both arguments are of a user-defined type.
9769         Fixes #30443, added test-175.cs.
9770         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9771
9772         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9773
9774 2002-11-24  Martin Baulig  <martin@ximian.com>
9775
9776         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9777         function to get the store opcode.
9778         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9779         only emit the Ldelema if the store opcode is Stobj.  You must run
9780         both test-34 and test-167 to test this.  Fixes #34529.
9781
9782 2002-11-23  Martin Baulig  <martin@ximian.com>
9783
9784         * ecore.cs (Expression.MemberLookup): Added additional
9785         `qualifier_type' argument which is used when we're being called
9786         from MemberAccess.DoResolve() and null if we're called from a
9787         SimpleName lookup.
9788         (Expression.MemberLookupFailed): New method to report errors; this
9789         does the CS1540 check and reports the correct error message.
9790
9791         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9792         argument for the CS1540 check and redone the way how we're dealing
9793         with private members.  See the comment in the source code for details.
9794         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9795         `closure_start_type' to `closure_qualifier_type' and check whether
9796         it's not null.  It was not this filter being broken, it was just
9797         being called with the wrong arguments.
9798
9799         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9800         and pass it the correct `qualifier_type'; this also does the error
9801         handling for us.
9802
9803 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9804
9805         * expression.cs (Invocation.EmitParams): If the we are dealing
9806         with a non-built-in value type, load its address as well.
9807
9808         (ArrayCreation): Use a a pretty constant instead
9809         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9810         static initializers.  
9811
9812         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9813         because they are not really value types, just glorified integers. 
9814
9815         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9816
9817         * ecore.cs: Remove redundant code for enumerations, make them use
9818         the same code path as everything else, fixes the casting issue
9819         with enumerations in Windows.Forms.
9820
9821         * attribute.cs: Do only cast to string if it is a string, the
9822         validation happens later.
9823
9824         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9825         people upgrade their corlibs.
9826
9827         * ecore.cs: Oops, enumerations were not following the entire code path
9828
9829 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9830
9831         * typemanager.cs (FilterWithClosure): Commented out the test for
9832         1540 in typemanager.cs, as it has problems when accessing
9833         protected methods from a parent class (see test-174.cs). 
9834
9835         * attribute.cs (Attribute.ValidateGuid): new method.
9836         (Attribute.Resolve): Use above.
9837
9838 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9839
9840         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9841
9842         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9843         handling for enumerations, as we only needed the TypeContainer
9844         functionality to begin with (this is required for the fix below to
9845         work for enums that reference constants in a container class for
9846         example). 
9847
9848         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9849
9850         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9851         a valid TypeBuilder to perform lookups on.o
9852
9853         * class.cs (InheritableMemberSignatureCompare): Use true in the
9854         call to GetGetMethod and GetSetMethod, because we are comparing
9855         the signature, and we need to get the methods *even* if they are
9856         private. 
9857
9858         (PropertyBase.CheckBase): ditto.
9859
9860         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9861         GotoCase.Resolve): Use Peel on EmpytCasts.
9862
9863         * ecore.cs (EmptyCast): drop child, add Peel method.
9864
9865 2002-11-17  Martin Baulig  <martin@ximian.com>
9866
9867         * ecore.cs (EmptyCast.Child): New public property.
9868
9869         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9870         label resolved to an EmptyCast.  Fixes #34162.
9871         (GotoCase.Resolve): Likewise.
9872         (Block.EmitMeta): Likewise.
9873
9874 2002-11-17  Martin Baulig  <martin@ximian.com>
9875
9876         * expression.cs (Invocation.BetterConversion): Prefer int over
9877         uint; short over ushort; long over ulong for integer literals.
9878         Use ImplicitConversionExists instead of StandardConversionExists
9879         since we also need to check for user-defined implicit conversions.
9880         Fixes #34165.  Added test-173.cs.
9881
9882 2002-11-16  Martin Baulig  <martin@ximian.com>
9883
9884         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9885         with the `true' and `false' literals.  Fixes #33151.
9886
9887 2002-11-16  Martin Baulig  <martin@ximian.com>
9888
9889         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9890         October 22nd; don't do the cs1540 check for static members.
9891
9892         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9893         now using our own filter here and doing the cs1540 check again.
9894
9895 2002-11-16  Martin Baulig  <martin@ximian.com>
9896
9897         * support.cs (InternalParameters): Don't crash if we don't have
9898         any fixed parameters.  Fixes #33532.
9899
9900 2002-11-16  Martin Baulig  <martin@ximian.com>
9901
9902         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9903         when looking up static methods to make this work on Windows.
9904         Fixes #33773.
9905
9906 2002-11-16  Martin Baulig  <martin@ximian.com>
9907
9908         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9909         a setter rather than using PropertyInfo.CanWrite.
9910
9911 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9912
9913         * class.cs: Allow acces to block member by subclasses. Fixes build
9914         breaker.
9915
9916 2002-11-14  Martin Baulig  <martin@ximian.com>
9917
9918         * class.cs (Constructor.Emit): Added the extern/block check.
9919         Fixes bug #33678.
9920
9921 2002-11-14  Martin Baulig  <martin@ximian.com>
9922
9923         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9924         iteration while looking for indexers, this is needed because the
9925         indexer may have a different name in our base classes.  Fixed the
9926         error reporting (no indexers at all, not get accessor, no
9927         overloaded match).  Fixes bug #33089.
9928         (IndexerAccess.DoResolveLValue): Likewise.
9929
9930 2002-11-14  Martin Baulig  <martin@ximian.com>
9931
9932         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9933         indexers.  Fixes the first part of bug #33089.
9934         (MethodSignature.InheritableMemberSignatureCompare): Added support
9935         for properties.
9936
9937 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9938
9939         * attribute.cs (Attribute.Resolve): Catch the
9940         NullReferenceException and report it since it isn't supposed to
9941         happen. 
9942
9943 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9944
9945         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9946         LogicalOr and LogicalAnd that can benefit from recursively
9947         handling EmitBranchable.  The code now should be nice for Paolo.
9948
9949 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9950
9951         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9952         the Type lookups, as we perform quite a number of lookups on
9953         non-Types.  This can be removed once we can deterministically tell
9954         whether we have a type or a namespace in advance.
9955
9956         But this might require special hacks from our corlib.
9957
9958         * TODO: updated.
9959
9960         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9961         and double which avoids a conversion from an integer to a double.
9962
9963         * expression.cs: tiny optimization, avoid calling IsConstant,
9964         because it effectively performs the lookup twice.
9965
9966 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9967
9968         But a bogus return here to keep the semantics of the old code
9969         until the Mono runtime is fixed.
9970
9971         * pending.cs (GetMissingInterfaces): New method used to remove all
9972         the interfaces that are already implemented by our parent
9973         classes from the list of pending methods. 
9974
9975         * interface.cs: Add checks for calls after ResolveTypeExpr.
9976
9977 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9978
9979         * class.cs (Class.Emit): Report warning 67: event not used if the
9980         warning level is beyond 3.
9981
9982         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9983         being a NullLiteral.
9984
9985         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9986         specifiers. 
9987
9988         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9989         path that might fail if a type can not be resolved.
9990
9991         * expression.cs (Binary.Emit): Emit unsigned versions of the
9992         operators. 
9993
9994         * driver.cs: use error 5.
9995
9996 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9997
9998         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9999
10000 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10001
10002         * cs-parser.jay (switch_section): A beautiful patch from Martin
10003         Baulig that fixed 33094.
10004
10005 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10006
10007         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10008         Check whether the base is abstract and report an error if so.
10009
10010         * expression.cs (IndexerAccess.DoResolveLValue,
10011         IndexerAccess.DoResolve): ditto. 
10012
10013         (Invocation.DoResolve): ditto.
10014
10015         (Invocation.FullMethodDesc): Improve the report string.
10016
10017         * statement.cs (Block): Eliminate IsVariableDefined as it is
10018         basically just a wrapper for GetVariableInfo.
10019
10020         * ecore.cs (SimpleName): Use new 
10021
10022         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10023         type, as we return the actual parameter ref/unref state on a
10024         different call.
10025
10026 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10027
10028         * support.cs: Return proper flags REF/OUT fixing the previous
10029         commit.  
10030
10031         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10032         not used to mean `ref' but `ref or out' in ParameterReference
10033
10034         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10035         full type signature instead of calling TypeManger.CSharpName
10036         ourselves. 
10037
10038         * support.cs (InternalParameters.ParameterDesc): Do not compare
10039         directly to the modflags, because REF/OUT will actually be bitsets
10040         if set. 
10041
10042         * delegate.cs (VerifyMethod): Check also the modifiers.
10043
10044         * cs-tokenizer.cs: Fix bug where floating point values with an
10045         exponent where a sign was missing was ignored.
10046
10047         * driver.cs: Allow multiple assemblies to be specified in a single
10048         /r: argument
10049
10050 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10051
10052         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10053         because identifiers after a parenthesis would end up in this kind
10054         of production, and we needed to desamiguate it for having casts
10055         like:
10056
10057                 (UserDefinedType *) xxx
10058
10059 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10060
10061         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10062         we should set on the Bindingflags.NonPublic, but not turn on
10063         private_ok.  private_ok controls whether a Private member is
10064         returned (this is chekced on the filter routine), while the
10065         BindingFlags.NonPublic just controls whether private/protected
10066         will be allowed.   This fixes the problem part of the problem of
10067         private properties being allowed to be used in derived classes.
10068
10069         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10070         so we can call the children DoResolveLValue method (this will
10071         properly signal errors on lvalue assignments to base properties)
10072
10073         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10074         getter are null, and we have a property info, we know that this
10075         happened because the lookup failed, so we report an error 122 for
10076         protection level violation.
10077
10078         We also silently return if setter and getter are null in the
10079         resolve functions, this condition only happens if we have flagged
10080         the error before.  This is the other half of the problem. 
10081
10082         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10083         not have accessibility information, that is why we were returning
10084         true in the filter function in typemanager.cs.
10085
10086         To properly report 122 (property is inaccessible because of its
10087         protection level) correctly, we report this error in ResolveAccess
10088         by failing if both the setter and the getter are lacking (ie, the
10089         lookup failed). 
10090
10091         DoResolve and DoLResolve have been modified to check for both
10092         setter/getter being null and returning silently, the reason being
10093         that I did not want to put the knowledge about this error in upper
10094         layers, like:
10095
10096         int old = Report.Errors;
10097         x = new PropertyExpr (...);
10098         if (old != Report.Errors)
10099                 return null;
10100         else
10101                 return x;
10102
10103         So the property expr is returned, but it is invalid, so the error
10104         will be flagged during the resolve process. 
10105
10106         * class.cs: Remove InheritablePropertySignatureCompare from the
10107         class, as we no longer depend on the property signature to compute
10108         whether it is possible to implement a method or not.
10109
10110         The reason is that calling PropertyInfo.GetGetMethod will return
10111         null (in .NET, in Mono it works, and we should change this), in
10112         cases where the Get Method does not exist in that particular
10113         class.
10114
10115         So this code:
10116
10117         class X { public virtual int A { get { return 1; } } }
10118         class Y : X { }
10119         class Z : Y { public override int A { get { return 2; } } }
10120
10121         Would fail in Z because the parent (Y) would not have the property
10122         defined.  So we avoid this completely now (because the alternative
10123         fix was ugly and slow), and we now depend exclusively on the
10124         method names.
10125
10126         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10127         reference method, instead of using the property.
10128
10129         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10130         routines are gone now.
10131
10132         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10133         names, they were incorrectly named.
10134
10135         * cs-tokenizer.cs: Return are more gentle token on failure. 
10136
10137         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10138         had an out-of-sync index variable, which caused it to remove from
10139         the list of pending methods the wrong method sometimes.
10140
10141 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10144         CanWrite, because those refer to this particular instance of the
10145         property, and do not take into account the fact that we can
10146         override single members of a property.
10147
10148         Constructor requires an EmitContext.  The resolution process does
10149         not happen here, but we need to compute the accessors before,
10150         because the resolution does not always happen for properties.
10151
10152         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10153         subclass, before we did not update this flag, but we did update
10154         bindingflags. 
10155
10156         (GetAccessors): Drop this routine, as it did not work in the
10157         presence of partially overwritten set/get methods. 
10158
10159         Notice that this broke the cs1540 detection, but that will require
10160         more thinking. 
10161
10162 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10163
10164         * class.cs:
10165         * codegen.cs:
10166         * driver.cs: issue a warning instead of an error if we don't support
10167         debugging for the platform. Also ignore a couple of errors that may
10168         arise when trying to write the symbols. Undo my previous patch.
10169
10170 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10171
10172         * driver.cs: ignore /debug switch except for Unix platforms.
10173
10174 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10175
10176         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10177
10178 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * driver.cs: Do not make mcs-debug conditional, so we do not break
10181         builds that use it.
10182
10183         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10184         review this patch.  But basically after all the children variables
10185         have been merged, the value of "Breaks" was not being set to
10186         new_breaks for Switch blocks.  I think that it should be set after
10187         it has executed.  Currently I set this to the value of new_breaks,
10188         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10189         conservative, but I do not understand this code very well.
10190
10191         I did not break anything in the build, so that is good ;-)
10192
10193         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10194
10195 2002-10-20  Mark Crichton  <crichton@gimp.org>
10196
10197         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10198
10199 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10200
10201         * cfold.cs: Fixed compile blocker.
10202
10203 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10204
10205         * driver.cs: I was chekcing the key, not the file.
10206
10207 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10208
10209         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10210         message that we were generating - we just need to silently return
10211         a null.
10212
10213 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10214
10215         * class.cs (Event.Define): Change my previous commit, as this
10216         breaks the debugger.  This is a temporary hack, as it seems like
10217         the compiler is generating events incorrectly to begin with.
10218
10219         * expression.cs (Binary.ResolveOperator): Added support for 
10220         "U operator - (E x, E y)"
10221
10222         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10223         y)".
10224
10225         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10226         init-only variables, but this path did not take into account that
10227         there might be also instance readonly variables.  Correct this
10228         problem. 
10229
10230         This fixes bug 32253
10231
10232         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10233         delegates as well.
10234
10235         * driver.cs: Change the extension for modules to `netmodule'
10236
10237         * cs-parser.jay: Improved slightly the location tracking for
10238         the debugger symbols.
10239
10240         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10241         modifiers that were specified instead of the hardcoded value
10242         (FamAndAssem).  This was basically ignoring the static modifier,
10243         and others.  Fixes 32429.
10244
10245         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10246         fixed a bug in the process (32476)
10247
10248         * expression.cs (ArrayAccess.EmitAssign): Patch from
10249         hwang_rob@yahoo.ca that fixes bug 31834.3
10250
10251 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10252
10253         * driver.cs: Make the module extension .netmodule.
10254
10255 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10256
10257         * driver.cs: Report an error if the resource file is not found
10258         instead of crashing.
10259
10260         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10261         false, like Emit does.
10262
10263 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10264
10265         * typemanager.cs: Remove unused private member.  Also reported mcs
10266         bug to report this as a warning like csc.
10267
10268 2002-10-15  Martin Baulig  <martin@gnome.org>
10269
10270         * statement.cs (Statement.Emit): Made this a virtual method; emits
10271         the line number info and calls DoEmit().
10272         (Statement.DoEmit): New protected abstract method, formerly knows
10273         as Statement.Emit().
10274
10275         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10276
10277 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10280         have fixed a remaining problem: not every AddXXXX was adding a
10281         fully qualified name.  
10282
10283         Now everyone registers a fully qualified name in the DeclSpace as
10284         being defined instead of the partial name.  
10285
10286         Downsides: we are slower than we need to be due to the excess
10287         copies and the names being registered this way.  
10288
10289         The reason for this is that we currently depend (on the corlib
10290         bootstrap for instance) that types are fully qualified, because
10291         we dump all the types in the namespace, and we should really have
10292         types inserted into the proper namespace, so we can only store the
10293         basenames in the defined_names array.
10294
10295 2002-10-10  Martin Baulig  <martin@gnome.org>
10296
10297         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10298         from bug #31834, see the bug report for a testcase which is
10299         miscompiled.
10300
10301 2002-10-10  Martin Baulig  <martin@gnome.org>
10302
10303         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10304         flow analysis code for this.
10305
10306         * statement.cs (Do, While, For): Tell the flow analysis code about
10307         infinite loops.
10308         (FlowBranching.UsageVector): Added support for infinite loops.
10309         (Block.Resolve): Moved the dead code elimination here and use flow
10310         analysis to do it.
10311
10312 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * class.cs (Field.Define): Catch cycles on struct type
10315         definitions. 
10316
10317         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10318         fields if the fields are static.  We only need to check instance
10319         fields. 
10320
10321         * expression.cs (As.DoResolve): Test for reference type.
10322
10323         * statement.cs (Using.ResolveExpression): Use
10324         ConvertImplicitRequired, not ConvertImplicit which reports an
10325         error on failture
10326         (Using.ResolveLocalVariableDecls): ditto.
10327
10328         * expression.cs (Binary.ResolveOperator): Report errors in a few
10329         places where we had to.
10330
10331         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10332
10333 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10334
10335         * expression.cs: Use StoreFromPtr instead of extracting the type
10336         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10337
10338         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10339         an enumeration value to a System.Enum, but System.Enum is not a
10340         value type, but an class type, so we need to box.
10341
10342         (Expression.ConvertExplicit): One codepath could return
10343         errors but not flag them.  Fix this.  Fixes #31853
10344
10345         * parameter.cs (Resolve): Do not allow void as a parameter type.
10346
10347 2002-10-06  Martin Baulig  <martin@gnome.org>
10348
10349         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10350         if it's a class type and not a struct.  Fixes #31815.
10351
10352 2002-10-06  Martin Baulig  <martin@gnome.org>
10353
10354         * statement.cs: Reworked the flow analysis code a bit to make it
10355         usable for dead code elimination.
10356
10357 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10358
10359         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10360
10361 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10362
10363         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10364         to fix the test 165, will investigate deeper.
10365
10366 2002-10-04  Martin Baulig  <martin@gnome.org>
10367
10368         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10369         finally blocks actually work.
10370         (Try.Resolve): We don't need to create a sibling for `finally' if
10371         there is no finally block.
10372
10373 2002-10-04  Martin Baulig  <martin@gnome.org>
10374
10375         * class.cs (Constructor.Define): The default accessibility for a
10376         non-default constructor is private, not public.
10377
10378 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10379
10380         * class.cs (Constructor): Make AllowedModifiers public, add
10381         EXTERN.
10382
10383         * cs-parser.jay: Perform the modifiers test here, as the
10384         constructor for the Constructor class usually receives a zero
10385         because of the way we create it (first we create, later we
10386         customize, and we were never checking the modifiers).
10387
10388         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10389         is a version of LookupTypeReflection that includes the type-name
10390         cache.  This can be used as a fast path for functions that know
10391         the fully qualified name and are only calling into *.GetType() to
10392         obtain a composed type.
10393
10394         This is also used by TypeManager.LookupType during its type
10395         composition.
10396
10397         (LookupType): We now also track the real type name, as sometimes
10398         we can get a quey for the real type name from things like
10399         ComposedCast.  This fixes bug 31422.
10400
10401         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10402         complete type fullname, it does not have to go through the type
10403         resolution system to obtain the composed version of the type (for
10404         obtaining arrays or pointers).
10405
10406         (Conditional.Emit): Use the EmitBoolExpression to
10407         generate nicer code, as requested by Paolo.
10408
10409         (ArrayCreation.CheckIndices): Use the patch from
10410         hwang_rob@yahoo.ca to validate the array initializers. 
10411
10412 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10413
10414         * class.cs (ConstructorInitializer.Emit): simplify code by using
10415         Invocation.EmitCall, and at the same time, fix the bugs in calling
10416         parent constructors that took variable arguments. 
10417
10418         * ecore.cs (Expression.ConvertNumericExplicit,
10419         Expression.ImplicitNumericConversion): Remove the code that
10420         manually wrapped decimal (InternalTypeConstructor call is now gone
10421         as well).
10422
10423         * expression.cs (Cast.TryReduce): Also handle decimal types when
10424         trying to perform a constant fold on the type.
10425
10426         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10427
10428         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10429         that only turned off an error report, and did nothing else. 
10430
10431 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10432
10433         * driver.cs: Handle and ignore /fullpaths
10434
10435 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10436
10437         * expression.cs (Binary.ResolveOperator): Catch the case where
10438         DoNumericPromotions returns true, 
10439
10440         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10441
10442 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10443
10444         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10445         report error 70.
10446
10447 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10448
10449         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10450         conversion exists, but it is also required that the conversion be
10451         performed.  This manifested in "(Type64Enum) 2".  
10452
10453         * class.cs (TypeManager.AddMethod): The fix is not to change
10454         AddEnum, because that one was using a fully qualified name (every
10455         DeclSpace derivative does), but to change the AddMethod routine
10456         that was using an un-namespaced name.  This now correctly reports
10457         the duplicated name.
10458
10459         Revert patch until I can properly fix it.  The issue
10460         is that we have a shared Type space across all namespaces
10461         currently, which is wrong.
10462
10463         Options include making the Namespace a DeclSpace, and merge
10464         current_namespace/current_container in the parser.
10465
10466 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10467
10468         * cs-parser.jay: Improve error reporting when we get a different
10469         kind of expression in local_variable_type and
10470         local_variable_pointer_type. 
10471
10472         Propagate this to avoid missleading errors being reported.
10473
10474         * ecore.cs (ImplicitReferenceConversion): treat
10475         TypeManager.value_type as a target just like object_type.   As
10476         code like this:
10477
10478         ValueType v = 1;
10479
10480         Is valid, and needs to result in the int 1 being boxed before it
10481         is assigned to the value type v.
10482
10483         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10484         to validate the enumeration name.
10485
10486         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10487         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10488         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10489
10490         * ecore.cs (TryImplicitIntConversion): When doing an
10491         implicit-enumeration-conversion, check if the type is 64-bits and
10492         perform a conversion before passing to EnumConstant.
10493
10494 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10495
10496         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10497         report ambiguous type references.  Unlike the MS version, we
10498         report what the ambiguity is.   Innovation at work ;-)
10499
10500         (DeclSpace.FindType): Require a location argument to
10501         display when we display an ambiguous error.
10502
10503         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10504
10505         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10506
10507         * expression.cs (EmitDynamicInitializers): Apply patch from
10508         hwang_rob@yahoo.ca that fixes the order in which we emit our
10509         initializers. 
10510
10511 2002-09-21  Martin Baulig  <martin@gnome.org>
10512
10513         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10514         delegate takes no arguments.
10515
10516 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10517
10518         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10519         from integers.
10520
10521         * expression.cs: Extract the underlying type.
10522
10523         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10524
10525         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10526
10527 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * class.cs (TypeContainer.DefineType): We can not use the nice
10530         PackingSize with the size set to 1 DefineType method, because it
10531         will not allow us to define the interfaces that the struct
10532         implements.
10533
10534         This completes the fixing of bug 27287
10535
10536         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10537         means also structs.  This fixes part of the problem. 
10538         (Expresion.ImplicitReferenceConversionExists): ditto.
10539
10540         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10541         error if there were no errors reported during the type lookup
10542         process, to avoid duplicates or redundant errors.  Without this
10543         you would get an ambiguous errors plus a type not found.  We have
10544         beaten the user enough with the first error.  
10545
10546         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10547         reference. 
10548
10549         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10550         during the resolution process, stop the lookup, this avoids
10551         repeated error reports (same error twice).
10552
10553         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10554
10555         * typemanager.cs (LookupType): Redo the type lookup code to match
10556         the needs of System.Reflection.  
10557
10558         The issue is that System.Reflection requires references to nested
10559         types to begin with a "+" sign instead of a dot.  So toplevel
10560         types look like: "NameSpace.TopLevelClass", and nested ones look
10561         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10562         levels. 
10563
10564 2002-09-19  Martin Baulig  <martin@gnome.org>
10565
10566         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10567         says that a method always returns or always throws an exception,
10568         don't report the CS0161.
10569
10570         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10571         set `Returns = new_returns'.
10572
10573 2002-09-19  Martin Baulig  <martin@gnome.org>
10574
10575         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10576         to an enum constant, check for a CS0176.
10577
10578 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10579
10580         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10581         for operators that must be in pairs and report errors.
10582
10583         * ecore.cs (SimpleName.DoResolveType): During the initial type
10584         resolution process, when we define types recursively, we must
10585         check first for types in our current scope before we perform
10586         lookups in the enclosing scopes.
10587
10588         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10589
10590         (Invocation.VerifyArgumentsCompat): Call
10591         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10592         I thought we were supposed to always call this, but there are a
10593         few places in the code where we dont do it.
10594
10595 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10596
10597         * driver.cs: Add support in -linkres and -resource to specify the
10598         name of the identifier.
10599
10600 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10601
10602         * ecore.cs (StandardConversionExists): Sync with the conversion
10603         code: allow anything-* to void* conversions.
10604
10605         (FindMostSpecificSource): Use an Expression argument
10606         instead of a Type, because we might be handed over a Literal which
10607         gets a few more implicit conversions that plain types do not.  So
10608         this information was being lost.
10609
10610         Also, we drop the temporary type-holder expression when not
10611         required.
10612
10613 2002-09-17  Martin Baulig  <martin@gnome.org>
10614
10615         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10616         this is an explicit interface implementation.
10617
10618 2002-09-17  Martin Baulig  <martin@gnome.org>
10619
10620         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10621         different `IndexerName' attributes.
10622
10623         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10624         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10625         virtual CommonResolve().
10626
10627 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10628
10629         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10630         and convert that to the UnderlyingType.
10631
10632         * statement.cs (Foreach.Resolve): Indexers are just like variables
10633         or PropertyAccesses.
10634
10635         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10636         inside quoted strings, we were not doing this before.
10637
10638 2002-09-16  Martin Baulig  <martin@gnome.org>
10639
10640         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10641         resolve it.  This is needed for the definite assignment check of the
10642         instance expression, fixes bug #29846.
10643         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10644
10645 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10646
10647         * parameter.cs: Fix compile error.  Cannot reference static member
10648         from an instance object.  Is this an mcs bug?
10649
10650 2002-09-14  Martin Baulig  <martin@gnome.org>
10651
10652         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10653         multiple times.  Fixes bug #30295, added test-166.cs.
10654
10655 2002-09-14  Martin Baulig  <martin@gnome.org>
10656
10657         * statement.cs (Block.Emit): Don't emit unreachable code.
10658         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10659         `break' statements.
10660         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10661
10662 2002-09-14  Martin Baulig  <martin@gnome.org>
10663
10664         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10665         is set.
10666
10667 2002-09-14  Martin Baulig  <martin@gnome.org>
10668
10669         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10670         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10671         be false on the ms runtime.
10672
10673 2002-09-13  Martin Baulig  <martin@gnome.org>
10674
10675         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10676         the CS0038 error message.
10677
10678 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10679
10680         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10681         constant inside, return it.
10682
10683 2002-09-12  Martin Baulig  <martin@gnome.org>
10684
10685         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10686         implicit conversion can be done between enum types.
10687
10688         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10689         check whether an implicit conversion to the current enum's UnderlyingType
10690         exists and report an error if not.
10691
10692         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10693         without debugging support.
10694
10695         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10696         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10697
10698 2002-09-12  Martin Baulig  <martin@gnome.org>
10699
10700         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10701
10702         * ecore.cs (IMemberExpr.DeclaringType): New property.
10703         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10704         nonstatic member of an outer type (CS0038).
10705
10706 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10707
10708         * driver.cs: Activate the using-error detector at warning level
10709         4 (at least for MS-compatible APIs).
10710
10711         * namespace.cs (VerifyUsing): Small buglett fix.
10712
10713         * pending.cs (PendingImplementation): pass the container pointer. 
10714
10715         * interface.cs (GetMethods): Allow for recursive definition.  Long
10716         term, I would like to move every type to support recursive
10717         definitions, not the current ordering mechanism that we have right
10718         now.
10719
10720         The situation is this: Attributes are handled before interfaces,
10721         so we can apply attributes to interfaces.  But some attributes
10722         implement interfaces, we will now handle the simple cases
10723         (recursive definitions will just get an error).  
10724
10725         * parameter.cs: Only invalidate types at the end if we fail to
10726         lookup all types.  
10727
10728 2002-09-09  Martin Baulig  <martin@gnome.org>
10729
10730         * ecore.cs (PropertyExpr.Emit): Also check for
10731         TypeManager.system_int_array_get_length so this'll also work when
10732         compiling corlib.  Fixes #30003.
10733
10734 2002-09-09  Martin Baulig  <martin@gnome.org>
10735
10736         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10737         and throw an exception if we can't get the type's size.  Fixed #30040,
10738         added test-165.cs.
10739
10740 2002-09-09  Martin Baulig  <martin@gnome.org>
10741
10742         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10743
10744         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10745         context.  Fixes bug #30027.
10746
10747         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10748         virtual functions.  Fixes bug #30043, added test-164.cs.
10749
10750 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10751
10752         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10753
10754 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10755
10756         * driver.cs: Use an object to get the windows codepage since it's not a
10757         static property.
10758
10759 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10760
10761         * statement.cs (For.Emit): for infinite loops (test == null)
10762         return whether there is a break inside, not always "true".
10763
10764         * namespace.cs (UsingEntry): New struct to hold the name of the
10765         using definition, the location where it is defined, and whether it
10766         has been used in a successful type lookup.
10767
10768         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10769         strings.
10770
10771         * decl.cs: ditto.
10772
10773 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10774
10775         * attribute.cs : Fix incorrect code which relied on catching
10776         a NullReferenceException to detect a null being passed in
10777         where an object was expected.
10778
10779 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10780
10781         * statement.cs (Try): flag the catch variable as assigned
10782
10783         * expression.cs (Cast): Simplified by using ResolveType instead of
10784         manually resolving.
10785
10786         * statement.cs (Catch): Fix bug by using ResolveType.
10787
10788 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10789
10790         * expression.cs (BetterConversion): Special case for when we have
10791         a NullLiteral as the argument and we have to choose between string
10792         and object types - we choose string the way csc does.
10793
10794         * attribute.cs (Attribute.Resolve): Catch the
10795         NullReferenceException and report error #182 since the Mono
10796         runtime no more has the bug and having this exception raised means
10797         we tried to select a constructor which takes an object and is
10798         passed a null.
10799
10800 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10801
10802         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10803         message (1502, 1503) when we can't locate a method after overload
10804         resolution. This is much more informative and closes the bug
10805         Miguel reported.
10806
10807         * interface.cs (PopulateMethod): Return if there are no argument
10808         types. Fixes a NullReferenceException bug.
10809
10810         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10811         expressions too. Previously we were checking only in one place for
10812         positional arguments leaving out named arguments.
10813
10814         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10815         type to the enum type is not allowed. Remove code corresponding to
10816         that.
10817
10818         (ConvertNumericExplicit): Allow explicit conversions from
10819         the underlying type to enum type. This precisely follows the spec
10820         and closes a bug filed by Gonzalo.
10821
10822 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10823
10824         * compiler.csproj:
10825         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10826
10827 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10828
10829         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10830         it was important that we stored the right value after the
10831         reduction in `converted'.
10832
10833 2002-09-04  Martin Baulig  <martin@gnome.org>
10834
10835         * location.cs (Location.SymbolDocument): Use full pathnames for the
10836         source files.
10837
10838 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10839
10840         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10841         of the expression resolve mechanism, because that will catch the
10842         SimpleName error failures.
10843
10844         (Conditional): If we can not resolve the
10845         expression, return, do not crash.
10846
10847 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10848
10849         * cs-tokenizer.cs:
10850         (location): display token name instead of its number.
10851
10852 2002-08-28  Martin Baulig  <martin@gnome.org>
10853
10854         * expression.cs (Binary.ResolveOperator): Don't silently return
10855         but return an error if an operator cannot be applied between two
10856         enum types.
10857
10858 2002-08-28  Martin Baulig  <martin@gnome.org>
10859
10860         * class.cs (Constructor.Define): Set the permission attributes
10861         correctly instead of making all constructors public.
10862
10863 2002-08-28  Martin Baulig  <martin@gnome.org>
10864
10865         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10866         for private members before reporting a CS0103; if we find anything,
10867         it's a CS0122.
10868
10869 2002-08-28  Martin Baulig  <martin@gnome.org>
10870
10871         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10872         to check whether `closure_start_type == closure_invocation_type',
10873         we also need to check whether `m.DeclaringType == closure_invocation_type'
10874         before bypassing the permission checks.  We might be accessing
10875         protected/private members from the base class.
10876         (TypeManager.RealMemberLookup): Only set private_ok if private
10877         members were requested via BindingFlags.NonPublic.
10878
10879         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10880
10881         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10882         MethodGroupExpr.IsExplicitImpl if appropriate.
10883         (Invocation.DoResolve): Don't report the CS0120 for explicit
10884         interface implementations.
10885
10886 2002-08-27  Martin Baulig  <martin@gnome.org>
10887
10888         * expression.cs (Invocation.DoResolve): If this is a static
10889         method and we don't have an InstanceExpression, we must report
10890         a CS0120.
10891
10892 2002-08-25  Martin Baulig  <martin@gnome.org>
10893
10894         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10895         `==' between a valuetype and an object.
10896
10897 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10898
10899         * ecore.cs (TypeExpr): Provide a ToString method.
10900
10901 2002-08-24  Martin Baulig  <martin@gnome.org>
10902
10903         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10904         now called proggie.dbg and it's a binary file.
10905
10906 2002-08-23  Martin Baulig  <martin@gnome.org>
10907
10908         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10909
10910 2002-08-23  Martin Baulig  <martin@gnome.org>
10911
10912         * struct.cs (MyStructInfo.ctor): Make this work with empty
10913         structs; it's not allowed to use foreach() on null.
10914
10915 2002-08-23  Martin Baulig  <martin@gnome.org>
10916
10917         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10918         writer the full pathname of the generated assembly.
10919
10920 2002-08-23  Martin Baulig  <martin@gnome.org>
10921
10922         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10923         A `finally' block never returns or breaks; improved handling of
10924         unreachable code.
10925
10926 2002-08-23  Martin Baulig  <martin@gnome.org>
10927
10928         * statement.cs (Throw.Resolve): Allow `throw null'.
10929
10930 2002-08-23  Martin Baulig  <martin@gnome.org>
10931
10932         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10933         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10934         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10935         MemberLookup would return a wrong event if this is an explicit
10936         interface implementation and the class has an event with the same
10937         name.
10938
10939 2002-08-23  Martin Baulig  <martin@gnome.org>
10940
10941         * statement.cs (Block.AddChildVariableNames): New public method.
10942         (Block.AddChildVariableName): Likewise.
10943         (Block.IsVariableNameUsedInChildBlock): Likewise.
10944         (Block.AddVariable): Check whether a variable name has already
10945         been used in a child block.
10946
10947         * cs-parser.jay (declare_local_variables): Mark all variable names
10948         from the current block as being used in a child block in the
10949         implicit block.
10950
10951 2002-08-23  Martin Baulig  <martin@gnome.org>
10952
10953         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10954         find the symbol writer.
10955
10956         * driver.cs: csc also allows the arguments to /define being
10957         separated by commas, not only by semicolons.
10958
10959 2002-08-23  Martin Baulig  <martin@gnome.org>
10960
10961         * interface.cs (Interface.GetMembers): Added static check for events.
10962
10963 2002-08-15  Martin Baulig  <martin@gnome.org>
10964
10965         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10966         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10967
10968         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10969         why the MethodData.EmitDestructor() change was necessary.
10970
10971 2002-08-20  Martin Baulig  <martin@gnome.org>
10972
10973         * class.cs (TypeContainer.FindMembers): Added static check for events.
10974
10975         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10976
10977         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10978         use Type.GetEvents(), not Type.FindMembers().
10979
10980 2002-08-20  Martin Baulig  <martin@gnome.org>
10981
10982         * decl.cs (MemberCache): Added a special method cache which will
10983         be used for method-only searched.  This ensures that a method
10984         search will return a MethodInfo with the correct ReflectedType for
10985         inherited methods.      
10986
10987 2002-08-20  Martin Baulig  <martin@gnome.org>
10988
10989         * decl.cs (DeclSpace.FindMembers): Made this public.
10990
10991 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10992
10993         * delegate.cs: fixed build on windows.
10994         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10995
10996 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10997
10998         * ecore.cs (StandardConversionExists): Return a false
10999         if we are trying to convert the void type to anything else
11000         since that is not allowed.
11001
11002         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11003         we flag error 70 in the event an event is trying to be accessed
11004         directly from outside the declaring type.
11005
11006 2002-08-20  Martin Baulig  <martin@gnome.org>
11007
11008         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11009         MemberCache from typemanager.cs to decl.cs.
11010
11011 2002-08-19  Martin Baulig  <martin@gnome.org>
11012
11013         * class.cs (TypeContainer): Implement IMemberContainer.
11014         (TypeContainer.DefineMembers): Create the MemberCache.
11015         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11016         return public members if BindingFlags.Public was given, check
11017         whether members are static.
11018
11019 2002-08-16  Martin Baulig  <martin@gnome.org>
11020
11021         * decl.cs (DeclSpace.Define): Splitted this in Define and
11022         DefineMembers.  DefineMembers is called first and initializes the
11023         MemberCache.
11024
11025         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11026         DefineMembers() on all our DeclSpaces.
11027
11028         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11029         but call DefineMembers() on all nested interfaces.  We call their
11030         Define() in our new Define() function.
11031
11032         * interface.cs (Interface): Implement IMemberContainer.
11033         (Interface.Define): Moved all code except the attribute stuf to
11034         DefineMembers().
11035         (Interface.DefineMembers): Initialize the member cache.
11036
11037         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11038         need this anymore since we can use MemberCache.FindMembers directly.
11039
11040 2002-08-19  Martin Baulig  <martin@gnome.org>
11041
11042         * typemanager.cs (MemberCache): When creating the cache for an
11043         interface type, add all inherited members.
11044         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11045         to `out bool used_cache' and documented it.
11046         (TypeManager.MemberLookup): If we already used the cache in the first
11047         iteration, we don't need to do the interfaces check.
11048
11049 2002-08-19  Martin Baulig  <martin@gnome.org>
11050
11051         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11052         here from IMemberFinder and don't implement this interface anymore.
11053         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11054
11055         * typemanager.cs (IMemberFinder): This interface is now only used by
11056         classes which actually support the member cache.
11057         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11058         since we only put DeclSpaces into this Hashtable.
11059         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11060         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11061
11062 2002-08-16  Martin Baulig  <martin@gnome.org>
11063
11064         * typemanager.cs (ICachingMemberFinder): Removed.
11065         (IMemberFinder.MemberCache): New property.
11066         (TypeManager.FindMembers): Merged this with RealFindMembers().
11067         This function will never be called from TypeManager.MemberLookup()
11068         so we can't use the cache here, just the IMemberFinder.
11069         (TypeManager.MemberLookup_FindMembers): Check whether the
11070         IMemberFinder has a MemberCache and call the cache's FindMembers
11071         function.
11072         (MemberCache): Rewrote larger parts of this yet another time and
11073         cleaned it up a bit.
11074
11075 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11076
11077         * driver.cs (LoadArgs): Support quoting.
11078
11079         (Usage): Show the CSC-like command line arguments.
11080
11081         Improved a few error messages.
11082
11083 2002-08-15  Martin Baulig  <martin@gnome.org>
11084
11085         * typemanager.cs (IMemberContainer.Type): New property.
11086         (IMemberContainer.IsInterface): New property.
11087
11088         The following changes are conditional to BROKEN_RUNTIME, which is
11089         defined at the top of the file.
11090
11091         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11092         class'es members, but add all members from TypeHandle.ObjectType
11093         if we're an interface.
11094         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11095         is the current type.
11096         (MemberCache.CacheEntry.Container): Removed this field.
11097         (TypeHandle.GetMembers): Include inherited members.
11098
11099 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11100
11101         * typemanager.cs: fixed compilation and added a comment on a field that
11102         is never used.
11103
11104 2002-08-15  Martin Baulig  <martin@gnome.org>
11105
11106         * class.cs (ConstructorInitializer.Resolve): In the
11107         Expression.MemberLookup call, use the queried_type as
11108         invocation_type.
11109
11110         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11111         declared' attribute, it's always true.
11112         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11113         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11114         temporary wrapper for FindMembers which tells MemberLookup whether
11115         members from the base classes are included in the return value.
11116         This will go away soon.
11117         (TypeManager.MemberLookup): Use this temporary hack here; once the
11118         new MemberCache is completed, we don't need to do the DeclaredOnly
11119         looping here anymore since the MemberCache will take care of this.
11120         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11121         (MemberCache): When creating the MemberCache for a class, get
11122         members from the current class and all its base classes.
11123         (MemberCache.CacheEntry.Container): New field.  This is a
11124         temporary hack until the Mono runtime is fixed to distinguish
11125         between ReflectedType and DeclaringType.  It allows us to use MCS
11126         with both the MS runtime and the unfixed Mono runtime without
11127         problems and without accecting performance.
11128         (MemberCache.SearchMembers): The DeclaredOnly looping from
11129         TypeManager.MemberLookup is now done here.      
11130
11131 2002-08-14  Martin Baulig  <martin@gnome.org>
11132
11133         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11134         Type.GetFields on dynamic types but get the fields from the
11135         corresponding TypeContainer.
11136         (MyStructInfo.GetStructInfo): Added check for enum types.
11137
11138         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11139         (MemberList.SyncRoot): Implemented.
11140         (TypeManager.FilterWithClosure): No need to check permissions if
11141         closure_start_type == closure_invocation_type, don't crash if
11142         closure_invocation_type is null.
11143
11144 2002-08-13  Martin Baulig  <martin@gnome.org>
11145
11146         Rewrote TypeContainer.FindMembers to use a member cache.  This
11147         gives us a speed increase of about 35% for the self-hosting MCS
11148         build and of about 15-20% for the class libs (both on GNU/Linux).
11149
11150         * report.cs (Timer): New class to get enhanced profiling.  This
11151         whole class is "TIMER" conditional since it remarkably slows down
11152         compilation speed.
11153
11154         * class.cs (MemberList): New class.  This is an IList wrapper
11155         which we're now using instead of passing MemberInfo[]'s around to
11156         avoid copying this array unnecessarily.
11157         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11158         (ICachingMemberFinder, IMemberContainer): New interface.
11159         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11160         has already been checked, otherwise use it for the name comparision.
11161         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11162         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11163         if possible.  Returns a MemberList, not a MemberInfo [].
11164         (TypeHandle): New class, implements IMemberContainer.  We create
11165         one instance of this class per type, it contains a MemberCache
11166         which is used to do the member lookups.
11167         (MemberCache): New class.  Each instance of this class contains
11168         all members of a type and a name-based hash table.
11169         (MemberCache.FindMembers): This is our new member lookup
11170         function.  First, it looks up all members of the requested name in
11171         the hash table.  Then, it walks this list and sorts out all
11172         applicable members and returns them.
11173
11174 2002-08-13  Martin Baulig  <martin@gnome.org>
11175
11176         In addition to a nice code cleanup, this gives us a performance
11177         increase of about 1.4% on GNU/Linux - not much, but it's already
11178         half a second for the self-hosting MCS compilation.
11179
11180         * typemanager.cs (IMemberFinder): New interface.  It is used by
11181         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11182         Enum, Delegate or Interface.
11183         (TypeManager.finder_to_member_finder): New PtrHashtable.
11184         (TypeManager.finder_to_container): Removed.
11185         (TypeManager.finder_to_delegate): Removed.
11186         (TypeManager.finder_to_interface): Removed.
11187         (TypeManager.finder_to_enum): Removed.
11188
11189         * interface.cs (Interface): Implement IMemberFinder.
11190
11191         * delegate.cs (Delegate): Implement IMemberFinder.
11192
11193         * enum.cs (Enum): Implement IMemberFinder.
11194
11195         * class.cs (TypeContainer): Implement IMemberFinder.
11196
11197 2002-08-12  Martin Baulig  <martin@gnome.org>
11198
11199         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11200
11201 2002-08-12  Martin Baulig  <martin@gnome.org>
11202
11203         * ecore.cs (ITypeExpression): New interface for expressions which
11204         resolve to a type.
11205         (TypeExpression): Renamed to TypeLookupExpression.
11206         (Expression.DoResolve): If we're doing a types-only lookup, the
11207         expression must implement the ITypeExpression interface and we
11208         call DoResolveType() on it.
11209         (SimpleName): Implement the new ITypeExpression interface.
11210         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11211         hack, the situation that we're only looking up types can't happen
11212         anymore when this method is called.  Moved the type lookup code to
11213         DoResolveType() and call it.
11214         (SimpleName.DoResolveType): This ITypeExpression interface method
11215         is now doing the types-only lookup.
11216         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11217         (ResolveFlags): Added MaskExprClass.
11218
11219         * expression.cs (MemberAccess): Implement the ITypeExpression
11220         interface.
11221         (MemberAccess.DoResolve): Added support for a types-only lookup
11222         when we're called via ITypeExpression.DoResolveType().
11223         (ComposedCast): Implement the ITypeExpression interface.
11224
11225         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11226         Expression.Resolve() with ResolveFlags.Type instead.
11227
11228 2002-08-12  Martin Baulig  <martin@gnome.org>
11229
11230         * interface.cs (Interface.Define): Apply attributes.
11231
11232         * attribute.cs (Attribute.ApplyAttributes): Added support for
11233         interface attributes.
11234
11235 2002-08-11  Martin Baulig  <martin@gnome.org>
11236
11237         * statement.cs (Block.Emit): Only check the "this" variable if we
11238         do not always throw an exception.
11239
11240         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11241         whether the property has a set accessor.
11242
11243 2002-08-11  Martin Baulig  <martin@gnome.org>
11244
11245         Added control flow analysis support for structs.
11246
11247         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11248         with control flow analysis turned off.
11249         (IVariable): New interface.
11250         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11251         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11252         (FieldExpr.DoResolve): Resolve the instance expression with flow
11253         analysis turned off and do the definite assignment check after the
11254         resolving when we know what the expression will resolve to.
11255
11256         * expression.cs (LocalVariableReference, ParameterReference):
11257         Implement the new IVariable interface, only call the flow analysis
11258         code if ec.DoFlowAnalysis is true.
11259         (This): Added constructor which takes a Block argument.  Implement
11260         the new IVariable interface.
11261         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11262         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11263         This does the definite assignment checks for struct members.
11264
11265         * class.cs (Constructor.Emit): If this is a non-static `struct'
11266         constructor which doesn't have any initializer, call
11267         Block.AddThisVariable() to tell the flow analysis code that all
11268         struct elements must be initialized before control returns from
11269         the constructor.
11270
11271         * statement.cs (MyStructInfo): New public class.
11272         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11273         argument to this indexer.  If non-zero, check an individual struct
11274         member, not the whole struct.
11275         (FlowBranching.CheckOutParameters): Check struct members.
11276         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11277         overloaded versions of these methods which take an additional
11278         `int field_idx' argument to check struct members.
11279         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11280         overloaded versions of these methods which take an additional
11281         `string field_name' argument to check struct member.s
11282         (VariableInfo): Implement the IVariable interface.
11283         (VariableInfo.StructInfo): New public property.  Returns the
11284         MyStructInfo instance of the variable if it's a struct or null.
11285         (Block.AddThisVariable): New public method.  This is called from
11286         Constructor.Emit() for non-static `struct' constructor which do
11287         not have any initializer.  It creates a special variable for the
11288         "this" instance variable which will be checked by the flow
11289         analysis code to ensure that all of the struct's fields are
11290         initialized before control returns from the constructor.
11291         (UsageVector): Added support for struct members.  If a
11292         variable/parameter is a struct with N members, we reserve a slot
11293         in the usage vector for each member.  A struct is considered fully
11294         initialized if either the struct itself (slot 0) or all its
11295         members are initialized.
11296
11297 2002-08-08  Martin Baulig  <martin@gnome.org>
11298
11299         * driver.cs (Driver.MainDriver): Only report an error CS5001
11300         if there were no compilation errors.
11301
11302         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11303         `UnsafeContext' property to determine whether the parent is in
11304         unsafe context rather than checking the parent's ModFlags:
11305         classes nested in an unsafe class are unsafe as well.
11306
11307 2002-08-08  Martin Baulig  <martin@gnome.org>
11308
11309         * statement.cs (UsageVector.MergeChildren): Distinguish between
11310         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11311         we return.  Added test17() and test18() to test-154.cs.
11312
11313 2002-08-08  Martin Baulig  <martin@gnome.org>
11314
11315         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11316         Family access, make sure the invoking type isn't a subclass of the
11317         queried type (that'd be a CS1540).
11318
11319         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11320         this method which takes an additional `Type invocation_type'.
11321
11322         * expression.cs (BaseAccess.DoResolve): Use the base type as
11323         invocation and query type.
11324         (MemberAccess.DoResolve): If the lookup failed and we're about to
11325         report a CS0122, try a lookup with the ec.ContainerType - if this
11326         succeeds, we must report a CS1540.
11327
11328 2002-08-08  Martin Baulig  <martin@gnome.org>
11329
11330         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11331         (MethodGroupExpr): Implement the IMemberExpr interface.
11332
11333         * expression (MemberAccess.ResolveMemberAccess): No need to have
11334         any special code for MethodGroupExprs anymore, they're now
11335         IMemberExprs.   
11336
11337 2002-08-08  Martin Baulig  <martin@gnome.org>
11338
11339         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11340         Family, FamANDAssem and FamORAssem permissions.
11341         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11342
11343 2002-08-08  Martin Baulig  <martin@gnome.org>
11344
11345         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11346         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11347         or loop block.
11348
11349 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11350
11351         * driver.cs: implemented /resource option to embed managed resources.
11352
11353 2002-08-07  Martin Baulig  <martin@gnome.org>
11354
11355         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11356         (FieldBase.HasFieldInitializer): New public property.
11357         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11358         returns the field initializer and makes sure it is only resolved once.
11359         (TypeContainer.EmitFieldInitializers): Call
11360         FieldBase.GetInitializerExpression to get the initializer, this ensures
11361         that it isn't resolved multiple times.
11362
11363         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11364         the resolving process (SimpleName/MemberLookup) that we're currently
11365         emitting a field initializer (which must not access any instance members,
11366         this is an error CS0236).
11367
11368         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11369         argument, if the `IsFieldInitializer' flag is set, we must report and
11370         error CS0236 and not an error CS0120.   
11371
11372 2002-08-07  Martin Baulig  <martin@gnome.org>
11373
11374         * ecore.cs (IMemberExpr): New public interface.
11375         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11376         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11377         if the expression is an IMemberExpr.
11378
11379         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11380         to be null, implicitly default to `this' if we're non-static in
11381         this case.  Simplified the code a lot by using the new IMemberExpr
11382         interface.  Also fixed bug #28176 here.
11383
11384 2002-08-06  Martin Baulig  <martin@gnome.org>
11385
11386         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11387         ParameterReferences during semantic analysis so that we can do a
11388         type-only search when resolving Cast, TypeOf and SizeOf.
11389         (block): Pass the `current_local_parameters' to the Block's
11390         constructor.
11391
11392         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11393         argument to the constructor.
11394         (ConstructorInitializer.Resolve): Create a temporary implicit
11395         block with the parameters.
11396
11397         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11398         references here if we aren't doing a type-only search.
11399
11400         * statement.cs (Block): Added constructor which takes a
11401         `Parameters parameters' argument.
11402         (Block.Parameters): New public property.
11403
11404         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11405         to `Parameters' and made it public readonly.
11406
11407 2002-08-06  Martin Baulig  <martin@gnome.org>
11408
11409         * ecore.cs (Expression.Warning): Made this public as well.
11410
11411         * report.cs (Report.Debug): Print the contents of collections.
11412
11413 2002-08-06  Martin Baulig  <martin@gnome.org>
11414
11415         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11416         used to tell Resolve() which kinds of expressions it may return.
11417         (Expression.Resolve): Added overloaded version of this method which
11418         takes a `ResolveFlags flags' argument.  This can be used to tell
11419         Resolve() which kinds of expressions it may return.  Reports a
11420         CS0118 on error.
11421         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11422         ResolveFlags.SimpleName.
11423         (Expression.Error118): Added overloaded version of this method which
11424         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11425         which kinds of expressions are allowed.
11426
11427         * expression.cs (Argument.ResolveMethodGroup): New public method.
11428         Resolves an argument, but allows a MethodGroup to be returned.
11429         This is used when invoking a delegate.
11430
11431         * TODO: Updated a bit.
11432
11433 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11434
11435         Fixed compilation with csc.
11436
11437         * ecore.cs: Expression.Error made public. Is this correct? Should
11438         Warning be made public too?
11439
11440         * expression.cs: use ea.Location instead of ea.loc.
11441         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11442
11443 2002-08-06  Martin Baulig  <martin@gnome.org>
11444
11445         * ecore.cs (Expression.loc): Moved the location here instead of
11446         duplicating it in all derived classes.
11447         (Expression.Location): New public property.
11448         (Expression.Error, Expression.Warning): Made them non-static and
11449         removed the location argument.
11450         (Expression.Warning): Added overloaded version which takes an
11451         `int level' argument.
11452         (Expression.Error118): Make this non-static and removed the
11453         expression and location arguments.
11454         (TypeExpr): Added location argument to the constructor.
11455
11456         * expression.cs (StaticCallExpr): Added location argument to
11457         the constructor.
11458         (Indirection, PointerArithmetic): Likewise.
11459         (CheckedExpr, UnCheckedExpr): Likewise.
11460         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11461         (StringPtr): Likewise.
11462
11463
11464 2002-08-05  Martin Baulig  <martin@gnome.org>
11465
11466         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11467
11468         * assign.cs (Assign.DoResolve): Check whether the source
11469         expression is a value or variable.
11470
11471         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11472         while resolving the corresponding blocks.
11473
11474         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11475         an error, don't silently return null.
11476
11477         * statement.cs (Block.AddVariable): Do the error reporting here
11478         and distinguish between CS0128 and CS0136.
11479         (Block.DoResolve): Report all unused labels (warning CS0164).
11480         (LabeledStatement): Pass the location to the constructor.
11481         (LabeledStatement.HasBeenReferenced): New property.
11482         (LabeledStatement.Resolve): Set it to true here.
11483
11484         * statement.cs (Return.Emit): Return success even after reporting
11485         a type mismatch error (CS0126 or CS0127), this is what csc does and
11486         it avoids confusing the users with any consecutive errors.
11487
11488 2002-08-05  Martin Baulig  <martin@gnome.org>
11489
11490         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11491
11492         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11493
11494         * expression.cs (MemberAccess.DoResolve): Silently return if an
11495         error has already been reported.
11496
11497         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11498         error has already been reported.
11499
11500 2002-08-05  Martin Baulig  <martin@gnome.org>
11501
11502         * statement.cs (UsageVector): Only initialize the `parameters'
11503         vector if we actually have any "out" parameters.
11504
11505 2002-08-05  Martin Baulig  <martin@gnome.org>
11506
11507         * expression.cs (Binary.ResolveOperator): When combining delegates,
11508         they must have the same type.
11509
11510 2002-08-05  Martin Baulig  <martin@gnome.org>
11511
11512         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11513         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11514         work with the ms runtime and we also don't need it: if we're a
11515         PropertyBuilder and not in the `indexer_arguments' hash, then we
11516         are a property and not an indexer.
11517
11518         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11519         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11520         since the latter one doesn't work with the ms runtime.
11521
11522 2002-08-03  Martin Baulig  <martin@gnome.org>
11523
11524         Fixed bugs #27998 and #22735.
11525
11526         * class.cs (Method.IsOperator): New public field.
11527         (Method.CheckBase): Report CS0111 if there's already a method
11528         with the same parameters in the current class.  Report CS0508 when
11529         attempting to change the return type of an inherited method.
11530         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11531         and it's not marked abstract or extern.
11532         (PropertyBase): New abstract base class for Property and Indexer.
11533         (PropertyBase.CheckBase): Moved here from Property and made it work
11534         for indexers.
11535         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11536         the same so we can reuse it there.
11537         (Property, Indexer): Derive from PropertyBase.
11538         (MethodSignature.inheritable_property_signature_filter): New delegate
11539         to find properties and indexers.
11540
11541         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11542         argument and improved error reporting.
11543
11544         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11545         EmptyReadOnlyParameters and made it a property.
11546
11547         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11548         version of this method which takes a `PropertyInfo indexer'.
11549         (TypeManager.RegisterIndexer): New method.
11550
11551         * class.cs: Added myself as author of this file :-)
11552
11553 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11554
11555         * class.cs: fixed compilation on windoze.
11556
11557 2002-08-03  Martin Baulig  <martin@gnome.org>
11558
11559         * interface.cs (Interface.GetInterfaceBases): Check whether all
11560         base interfaces are at least as accessible than the current one.
11561
11562         * class.cs (TypeContainer.GetClassBases): Check whether base types
11563         are at least as accessible than the current type.
11564         (TypeContainer.AsAccessible): Implemented and made non-static.
11565         (MemberBase.CheckParameters): Report errors if the accessibility
11566         checks fail.
11567
11568         * delegate.cs (Delegate.Delegate): The default visibility is
11569         internal for top-level types and private for nested types.
11570         (Delegate.Define): Report errors if the accessibility checks fail.
11571
11572         * enum.cs (Enum.Enum): The default visibility is internal for
11573         top-level types and private for nested types.
11574         (Enum.DefineType): Compute the correct visibility.
11575
11576         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11577         function which takes a `bool is_toplevel' instead of a TypeContainer.
11578
11579         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11580         builtin type.
11581
11582 2002-08-02  Martin Baulig  <martin@gnome.org>
11583
11584         * expression.cs (LocalVariableReferenc): Added constructor which
11585         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11586         (LocalVariableReference.IsReadOnly): New property.
11587         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11588         variable is readonly, use our own readonly flag to do this; you can
11589         use the new constructor to get a writable reference to a read-only
11590         variable.
11591
11592         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11593         reference to the local variable.
11594
11595 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11596
11597         * rootcontext.cs (ResolveCore): Also include System.Exception
11598
11599         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11600         we reach an EmptyStatement.
11601
11602         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11603         is also fine.
11604
11605         * expression.cs (Binary.ResolveOperator): Check error result in
11606         two places.
11607
11608         use brtrue/brfalse directly and avoid compares to null.
11609
11610 2002-08-02  Martin Baulig  <martin@gnome.org>
11611
11612         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11613         Fixes bug #28407, added test-155.cs.
11614
11615 2002-08-01  Martin Baulig  <martin@gnome.org>
11616
11617         * class.cs (Event.EmitDefaultMethod): Make this work with static
11618         events.  Fixes #28311, added verify-3.cs.
11619
11620 2002-08-01  Martin Baulig  <martin@gnome.org>
11621
11622         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11623         `is_disposable' fields.
11624         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11625         `hm.is_disposable' if we're using the collection pattern.
11626         (Foreach.EmitCollectionForeach): Use the correct type for the
11627         enumerator's local variable, only emit the try/finally block if
11628         necessary (fixes #27713).
11629
11630 2002-08-01  Martin Baulig  <martin@gnome.org>
11631
11632         * ecore.cs (Expression.report118): Renamed to Error118 and made
11633         it public static.
11634
11635         * statement.cs (Throw.Resolve): Check whether the expression is of
11636         the correct type (CS0118) and whether the type derives from
11637         System.Exception (CS0155).
11638         (Catch.Resolve): New method.  Do the type lookup here and check
11639         whether it derives from System.Exception (CS0155).
11640         (Catch.CatchType, Catch.IsGeneral): New public properties.
11641
11642         * typemanager.cs (TypeManager.exception_type): Added.
11643
11644 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11645
11646         * driver.cs: Updated About function.
11647
11648 2002-07-31  Martin Baulig  <martin@gnome.org>
11649
11650         Implemented Control Flow Analysis.
11651
11652         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11653         (EmitContext.CurrentBranching): Added.
11654         (EmitContext.StartFlowBranching): Added.
11655         (EmitContext.EndFlowBranching): Added.
11656         (EmitContext.KillFlowBranching): Added.
11657         (EmitContext.IsVariableAssigned): Added.
11658         (EmitContext.SetVariableAssigned): Added.
11659         (EmitContext.IsParameterAssigned): Added.
11660         (EmitContext.SetParameterAssigned): Added.
11661         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11662         Added control flow analysis stuff here.
11663
11664         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11665         resolve the expression as lvalue.
11666         (LocalVariableReference.DoResolve): Check whether the variable has
11667         already been assigned.
11668         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11669         the parameter as assigned here.
11670         (ParameterReference.DoResolve): Check whether the parameter has already
11671         been assigned.
11672         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11673         expression as lvalue.
11674
11675         * statement.cs (FlowBranching): New class for the flow analysis code.
11676         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11677         (LabeledStatement.IsDefined): New public property.
11678         (LabeledStatement.AddUsageVector): New public method to tell flow
11679         analyis that the label may be reached via a forward jump.
11680         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11681         flow analysis.
11682         (VariableInfo.Number): New public field.  This is used by flow analysis
11683         to number all locals of a block.
11684         (Block.CountVariables): New public property.  This is the number of
11685         local variables in this block (including the locals from all parent
11686         blocks).
11687         (Block.EmitMeta): Number all the variables.
11688
11689         * statement.cs: Added flow analysis support to all classes.
11690
11691 2002-07-31  Martin Baulig  <martin@gnome.org>
11692
11693         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11694         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11695         then use this argument.
11696
11697         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11698
11699         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11700         use this to specify /define options.
11701
11702 2002-07-29  Martin Baulig  <martin@gnome.org>
11703
11704         * statement.cs (Fixed): Moved all code that does variable lookups
11705         and resolvings from Emit to Resolve.
11706
11707         * statement.cs (For): Moved all code that does variable lookups
11708         and resolvings from Emit to Resolve.
11709
11710         * statement.cs (Using): Moved all code that does variable lookups
11711         and resolvings from Emit to Resolve.
11712
11713 2002-07-29  Martin Baulig  <martin@gnome.org>
11714
11715         * attribute.cs (Attribute.Resolve): Explicitly catch a
11716         System.NullReferenceException when creating the
11717         CustromAttributeBuilder and report a different warning message.
11718
11719 2002-07-29  Martin Baulig  <martin@gnome.org>
11720
11721         * support.cs (ParameterData.ParameterName): Added method to
11722         get the name of a parameter.
11723
11724         * typemanager.cs (TypeManager.IsValueType): New public method.
11725
11726 2002-07-29  Martin Baulig  <martin@gnome.org>
11727
11728         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11729         is a flag which specifies that it's either ref or out.
11730         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11731         the out parameter to `out Parameter.Modifier mod', also set the
11732         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11733
11734         * support.cs (InternalParameters.ParameterModifier): Distinguish
11735         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11736         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11737
11738         * expression.cs (Argument.GetParameterModifier): Distinguish
11739         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11740         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11741
11742 2002-07-29  Martin Baulig  <martin@gnome.org>
11743
11744         * expression.cs (ParameterReference.ParameterReference): Added
11745         `Location loc' argument to the constructor.
11746
11747         * cs-parser.jay: Pass location to ParameterReference.
11748
11749 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11750
11751         * statement.cs (Try): Initialize the location.
11752
11753         * cs-parser.jay: pass location to Try.
11754
11755         * expression.cs (Unary.Reduce): Change the prototype to return
11756         whether a constant fold could be performed or not.  The result is
11757         returned in an out parameters.  In the case of Indirection and
11758         AddressOf, we want to perform the full tests.
11759
11760 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11761
11762         * statement.cs (Statement.Emit): Flag dead code.
11763
11764 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11765
11766         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11767
11768 2002-07-27  Martin Baulig  <martin@gnome.org>
11769
11770         * class.cs (MethodData.Define): Put back call to
11771         TypeManager.AddMethod(), accidentally commented this out.
11772
11773         * report.cs (Debug): New public method to print debugging information,
11774         this is `[Conditional ("DEBUG")]'.
11775
11776 2002-07-26  Martin Baulig  <martin@gnome.org>
11777
11778         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11779         (switch_statement): Push the current_block to the switch_stack and
11780         pop it again when we're done with the switch.
11781         (switch_section): The new block is a child of the current_block.
11782         Fixes bug #24007, added test-152.cs.
11783
11784 2002-07-27  Martin Baulig  <martin@gnome.org>
11785
11786         * expression.cs (Invocation.EmitArguments): When calling a varargs
11787         function with only its fixed arguments, we need to pass an empty
11788         array.
11789
11790 2002-07-27  Martin Baulig  <martin@gnome.org>
11791
11792         Mono 0.13 has been released.
11793
11794 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11795
11796         * driver.cs: Rename --resource to --linkres, because that is what
11797         we do currently, we dont support --resource yet.
11798
11799         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11800
11801 2002-07-25  Martin Baulig  <martin@gnome.org>
11802
11803         * class.cs (MethodData): New public class.  This is a `method builder'
11804         class for a method or one accessor of a Property/Indexer/Event.
11805         (MethodData.GetMethodFlags): Moved here from MemberBase.
11806         (MethodData.ApplyAttributes): Likewise.
11807         (MethodData.ApplyObsoleteAttribute): Likewise.
11808         (MethodData.ApplyConditionalAttribute): Likewise.
11809         (MethodData.ApplyDllImportAttribute): Likewise.
11810         (MethodData.CheckAbstractAndExternal): Likewise.
11811         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11812         (MethodData.Emit): Formerly known as Method.Emit().
11813         (MemberBase): Moved everything which was specific to a single
11814         accessor/method to MethodData.
11815         (Method): Create a new MethodData and call Define() and Emit() on it.
11816         (Property, Indexer, Event): Create a new MethodData objects for each
11817         accessor and call Define() and Emit() on them.
11818
11819 2002-07-25  Martin Baulig  <martin@gnome.org>
11820
11821         Made MethodCore derive from MemberBase to reuse the code from there.
11822         MemberBase now also checks for attributes.
11823
11824         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11825         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11826         as virtual.
11827         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11828         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11829         (MemberBase.ApplyAttributes): New virtual method; applies the
11830         attributes to a method or accessor.
11831         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11832         (MemberBase.ApplyConditionalAttribute): Likewise.
11833         (MemberBase.ApplyDllImportAttribute): Likewise.
11834         (MemberBase.CheckAbstractAndExternal): Likewise.
11835         (MethodCore.ParameterTypes): This is now a property instead of a
11836         method, it's initialized from DoDefineParameters().
11837         (MethodCore.ParameterInfo): Removed the set accessor.
11838         (MethodCore.DoDefineParameters): New protected virtual method to
11839         initialize ParameterTypes and ParameterInfo.
11840         (Method.GetReturnType): We can now simply return the MemberType.
11841         (Method.GetMethodFlags): Override the MemberBase version and add
11842         the conditional flags.
11843         (Method.CheckBase): Moved some code from Define() here, call
11844         DoDefineParameters() here.
11845         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11846         here to avoid some larger code duplication.
11847         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11848         ensure that abstract and external accessors don't declare a body.
11849
11850         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11851         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11852         lookup in the attribute's parent classes, so we need to abort as soon
11853         as we found the first match.
11854         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11855         the attribute has no arguments.
11856
11857         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11858         of a Method.
11859
11860 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11861
11862         * cs-parser.jay: reverted previous patch.
11863
11864 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11865
11866         * cs-parser.jay: fixed bug #22119.
11867
11868 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11869
11870         * attribute.cs: fixed compilation. The error was:
11871         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11872         be assigned to before control leaves the current method."
11873         [FIXME:  Filed as bug #28186: MCS must report this error.]
11874
11875 2002-07-25  Martin Baulig  <martin@gnome.org>
11876
11877         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11878         method to pull the condition name ouf of a Conditional attribute.
11879         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11880         the obsolete message and error flag out of an Obsolete attribute.
11881
11882         * class.cs (Method.GetMethodFlags): New public method to get the
11883         TypeManager.MethodFlags for this method.
11884         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11885         private methods.
11886         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11887         if we're overriding a virtual function, set the new private variable
11888         `parent_method'; call the new TypeManager.AddMethod().
11889
11890         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11891         the MethodBuilder and the Method in a PtrHashtable.
11892         (TypeManager.builder_to_method): Added for this purpose.
11893         (TypeManager.MethodFlags): Added IsObsoleteError.
11894         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11895         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11896         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11897         the message from the attribute.
11898
11899 2002-07-24  Martin Baulig  <martin@gnome.org>
11900
11901         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11902         preprocessor directives, ensure that the argument to #define/#undef is
11903         exactly one identifier and that it's actually an identifier.
11904
11905         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11906         did not work ....
11907
11908 2002-07-24  Martin Baulig  <martin@gnome.org>
11909
11910         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11911         initialize it to TypeManager.object_type in the constructor.
11912         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11913         of the `hm.get_current' method if we're using the collection pattern.
11914         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11915         for the explicit conversion to make it work when we're using the collection
11916         pattern and the `Current' property has a different return type than `object'.
11917         Fixes #27713.
11918
11919 2002-07-24  Martin Baulig  <martin@gnome.org>
11920
11921         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11922         does not match, but don't report any errors.  This method is called in
11923         order for all methods in a MethodGroupExpr until a matching method is
11924         found, so we don't want to bail out if the first method doesn't match.
11925         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11926         matches, report the 123.  Fixes #28070.
11927
11928 2002-07-24  Martin Baulig  <martin@gnome.org>
11929
11930         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11931         TypeManager.TypeToCoreType() to the top of the method so the
11932         following equality checks will work.  Fixes #28107.
11933
11934 2002-07-24  Martin Baulig  <martin@gnome.org>
11935
11936         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11937         operand is of type uint, and the other operand is of type sbyte,
11938         short or int, the operands are converted to type long." -
11939         Actually do what this comment already told us.  Fixes bug #28106,
11940         added test-150.cs.
11941
11942 2002-07-24  Martin Baulig  <martin@gnome.org>
11943
11944         * class.cs (MethodBase): New abstract class.  This is now a base
11945         class for Property, Indexer and Event to avoid some code duplication
11946         in their Define() and DefineMethods() methods.
11947         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11948         generic methods for Define() and DefineMethods().
11949         (FieldBase): Derive from MemberBase, not MemberCore.
11950         (Property): Derive from MemberBase, not MemberCore.
11951         (Property.DefineMethod): Moved all the code from this method to the
11952         new MethodBase.DefineAccessor(), just call it with appropriate
11953         argumetnts.
11954         (Property.Define): Call the new Property.DoDefine(), this does some
11955         sanity checks and we don't need to duplicate the code everywhere.
11956         (Event): Derive from MemberBase, not MemberCore.
11957         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11958         accessors, this will also make them work with interface events.
11959         (Indexer): Derive from MemberBase, not MemberCore.
11960         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11961         (Indexer.Define): Use the new MethodBase functions.
11962
11963         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11964         argument to the constructor.
11965         (Interface.FindMembers): Added support for interface events.
11966         (Interface.PopluateEvent): Implemented.
11967
11968         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11969
11970 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11971
11972         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11973         but this is required to check for a method name being the same as
11974         the containing class.  
11975
11976         Handle this now.
11977
11978 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11979
11980         * interface.cs: initialize variable.
11981
11982 2002-07-23  Martin Baulig  <martin@gnome.org>
11983
11984         Implemented the IndexerName attribute in interfaces.
11985
11986         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11987         name if this is an explicit interface implementation.
11988         (Indexer.InterfaceIndexerName): New public variable.  If we're
11989         implementing an interface indexer, this is the IndexerName in that
11990         interface.  Otherwise, it's the IndexerName.
11991         (Indexer.DefineMethod): If we're implementing interface indexer,
11992         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11993         and Pending.ImplementIndexer methods.
11994         (Indexer.Define): Also define the PropertyBuilder if we're
11995         implementing an interface indexer and this is neither an explicit
11996         interface implementation nor do the IndexerName match the one in
11997         the interface.
11998
11999         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12000         If a method is defined here, then we always need to create a proxy
12001         for it.  This is used when implementing interface indexers.
12002         (Pending.IsInterfaceIndexer): New public method.
12003         (Pending.ImplementIndexer): New public method.
12004         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12005         This is used when implementing interface indexers to define a proxy
12006         if necessary.
12007         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12008         define a proxy if necessary.
12009
12010         * interface.cs (Interface.IndexerName): New public variable.
12011         (Interface.PopulateIndexer): Set the IndexerName.
12012         (Interface.DefineIndexers): New private method.  Populate all the
12013         indexers and make sure their IndexerNames match.
12014
12015         * typemanager.cs (IndexerPropertyName): Added support for interface
12016         indexers.
12017
12018 2002-07-22  Martin Baulig  <martin@gnome.org>
12019
12020         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12021         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12022         ret if HasReturnLabel.
12023         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12024         variables.
12025
12026         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12027         and set the ec.LoopBeginTryCatchLevel.
12028         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12029         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12030         the current ec.TryCatchLevel, the branch goes out of an exception
12031         block.  In this case, we need to use Leave and not Br.
12032
12033 2002-07-22  Martin Baulig  <martin@gnome.org>
12034
12035         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12036         block unless the block does not always return or it is contained in
12037         another try { ... } catch { ... } block.  Fixes bug #26506.
12038         Added verify-1.cs to the test suite.
12039
12040 2002-07-22  Martin Baulig  <martin@gnome.org>
12041
12042         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12043         then we do not always return.  Fixes bug #24985.
12044
12045 2002-07-22  Martin Baulig  <martin@gnome.org>
12046
12047         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12048         lookup on a per-class level; ie. walk up the class hierarchy until we
12049         found at least one applicable method, then choose the best among them.
12050         Fixes bug #24463 and test-29.cs.
12051
12052 2002-07-22  Martin Baulig  <martin@gnome.org>
12053
12054         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12055         return types of the methods.  The return type is not part of the
12056         signature and we must not check it to make the `new' modifier work.
12057         Fixes bug #27999, also added test-147.cs.
12058         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12059
12060         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12061         on the method's return type.
12062
12063 2002-07-21  Martin Baulig  <martin@gnome.org>
12064
12065         * assign.cs: Make this work if the rightmost source is a constant and
12066         we need to do an implicit type conversion.  Also adding a few more tests
12067         to test-38.cs which should have caught this.
12068
12069         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12070         target in the makefile for this.  The makefile.gnu is primarily intended
12071         for end-users who don't want to debug the compiler.
12072
12073 2002-07-21  Martin Baulig  <martin@gnome.org>
12074
12075         * assign.cs: Improved the Assign class so it can now handle embedded
12076         assignments (X = Y = Z = something).  As a side-effect this'll now also
12077         consume less local variables.  test-38.cs now passes with MCS, added
12078         a few new test cases to that test.
12079
12080 2002-07-20  Martin Baulig  <martin@gnome.org>
12081
12082         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12083         instructions.  Fixes bug #27977, also added test-146.cs.
12084
12085 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12086
12087         * cs-tokenizer.cs: fixed getHex ().
12088
12089 2002-07-19  Martin Baulig  <martin@gnome.org>
12090
12091         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12092         not Type.GetType() to lookup the array type.  This is needed when
12093         we're constructing an array of a user-defined type.
12094         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12095         single-dimensional arrays, but also for single-dimensial arrays of
12096         type decimal.
12097
12098 2002-07-19  Martin Baulig  <martin@gnome.org>
12099
12100         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12101         this function is called, it's not allowed to share LocalBuilders
12102         among ILGenerators.
12103
12104 2002-07-19  Martin Baulig  <martin@gnome.org>
12105
12106         * expression.cs (Argument.Resolve): Report an error 118 when trying
12107         to pass a type as argument.
12108
12109 2002-07-18  Martin Baulig  <martin@gnome.org>
12110
12111         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12112         Conv_R_Un for the signed `long' type.
12113
12114 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12115
12116         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12117         `expr' for the temporary result, as that will fail if we do
12118         multiple resolves on the same expression.
12119
12120 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12121
12122         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12123         ec.TypeContainer for looking up aliases. 
12124
12125         * class.cs (TypeContainer): Remove LookupAlias from here.
12126
12127         * decl.cs (DeclSpace); Move here.
12128
12129 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12130
12131         * class.cs (FindMembers): Only call filter if the constructor
12132         bulider is not null.
12133
12134         Also handle delegates in `NestedTypes' now.  Now we will perform
12135         type lookups using the standard resolution process.  This also
12136         fixes a bug.
12137
12138         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12139         This uses Expressions (the limited kind that can be parsed by the
12140         tree) instead of strings.
12141
12142         * expression.cs (ComposedCast.ToString): Implement, used to flag
12143         errors since now we have to render expressions.
12144
12145         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12146         FormArrayType. 
12147
12148         * ecore.cs (SimpleName.ToString): ditto.
12149
12150         * cs-parser.jay: Instead of using strings to assemble types, use
12151         Expressions to assemble the type (using SimpleName, ComposedCast,
12152         MemberAccess).  This should fix the type lookups in declarations,
12153         because we were using a different code path for this.
12154
12155         * statement.cs (Block.Resolve): Continue processing statements
12156         even when there is an error.
12157
12158 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12159
12160         * class.cs (Event.Define): Also remove the `remove' method from
12161         the list of pending items.
12162
12163         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12164         generate more compact code. 
12165
12166 2002-07-17  Martin Baulig  <martin@gnome.org>
12167
12168         * const.cs (Const.LookupConstantValue): Add support for constant
12169         `unchecked' and `checked' expressions.
12170         Also adding test case test-140.cs for this.
12171
12172 2002-07-17  Martin Baulig  <martin@gnome.org>
12173
12174         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12175         check whether mi.ReturnType implements the IEnumerator interface; the
12176         `==' and the IsAssignableFrom() will fail in this situation.
12177
12178 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12179
12180         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12181         here too.
12182
12183 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12184
12185         * expression.cs: fixed bug #27811.
12186
12187 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12188
12189         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12190         Molaro: when we are a ref, the value already contains a pointer
12191         value, do not take the address of it.
12192
12193 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12194         * removed mb-parser.jay and mb-tokenizer.cs
12195
12196 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12197
12198         * expression.cs: check against the building corlib void type.
12199
12200 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12201
12202         * ecore.cs: fix for valuetype static readonly fields: when 
12203         initializing them, we need their address, not the address of a copy.
12204
12205 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12206
12207         * typemanager.cs: register also enum_type in corlib.
12208
12209 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12210
12211         * class.cs: allow calling this (but not base) initializers in structs.
12212
12213 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12214
12215         * ecore.cs: make sure we compare against the building base types
12216         in GetTypeSize ().
12217
12218 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12219
12220         * typemanager.cs: fix TypeToCoreType() to handle void and object
12221         (corlib gets no more typerefs after this change).
12222
12223 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12224
12225         * expression.cs (ArrayCreation.EmitArrayArguments): use
12226         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12227
12228         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12229         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12230         array indexes, the runtime actually forbids them.
12231
12232         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12233         for array arguments here.
12234
12235         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12236         instead of the default for ValueTypes.
12237
12238         (New.DoEmit): Use IsValueType instead of
12239         IsSubclassOf (value_type)
12240         (New.DoResolve): ditto.
12241         (Invocation.EmitCall): ditto.
12242
12243         * assign.cs (Assign): ditto.
12244
12245         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12246         Statements *are* currently doing part of their resolution during
12247         Emit.  
12248
12249         Expressions do always resolve during resolve, but statements are
12250         only required to propagate resolution to their children.
12251
12252 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12253
12254         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12255
12256         (LoadAssembly): Do not add the dll if it is already specified
12257
12258         (MainDriver): Add the System directory to the link path at the end,
12259         after all the other -L arguments. 
12260
12261         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12262         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12263         ldelem.u1) and using the opposite for sbytes.
12264
12265         This fixes Digger, and we can finally run it.
12266
12267         * driver.cs (UnixParseOption): Move the option parsing here.  
12268         (CSCParseOption): Implement CSC-like parsing of options.
12269
12270         We now support both modes of operation, the old Unix way, and the
12271         new CSC-like way.  This should help those who wanted to make cross
12272         platform makefiles.
12273
12274         The only thing broken is that /r:, /reference: and /lib: are not
12275         implemented, because I want to make those have the same semantics
12276         as the CSC compiler has, and kill once and for all the confussion
12277         around this.   Will be doing this tomorrow.
12278
12279         * statement.cs (Unsafe.Resolve): The state is checked during
12280         resolve, not emit, so we have to set the flags for IsUnsfe here.
12281
12282 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12283
12284         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12285         not catch the Error_ObjectRefRequired in SimpleName (as it is
12286         possible to have a class/instance variable name that later gets
12287         deambiguated), we have to check this here.      
12288
12289 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12290
12291         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12292         make static and put into Expression.
12293
12294         (Event.Define): Register the private field of the event with the 
12295         TypeManager so that GetFieldFromEvent can get at it.
12296
12297         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12298         keep track of the private field associated with an event which
12299         has no accessors.
12300
12301         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12302         private field.
12303
12304         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12305
12306 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12307
12308         * expression.cs (Binary.EmitBranchable): this routine emits the
12309         Binary expression in a branchable context.  This basically means:
12310         we need to branch somewhere, not just get the value on the stack.
12311
12312         This works together with Statement.EmitBoolExpression.
12313
12314         * statement.cs (Statement.EmitBoolExpression): Use
12315         EmitBranchable. 
12316
12317 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12318
12319         * statement.cs (For): Reduce the number of jumps in loops.
12320
12321         (For): Implement loop inversion for the For statement.
12322
12323         (Break): We can be breaking out of a Try/Catch controlled section
12324         (foreach might have an implicit try/catch clause), so we need to
12325         use Leave instead of Br.
12326
12327         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12328         now).  If the instace expression supports IMemoryLocation, we use
12329         the AddressOf method from the IMemoryLocation to extract the
12330         address instead of emitting the instance.
12331
12332         This showed up with `This', as we were emitting the instance
12333         always (Emit) instead of the Address of This.  Particularly
12334         interesting when This is a value type, as we dont want the Emit
12335         effect (which was to load the object).
12336
12337 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12338
12339         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12340
12341         * statement.cs (Checked): Set the CheckedState during the resolve
12342         process too, as the ConvCast operations track the checked state on
12343         the resolve process, and not emit.
12344
12345         * cs-parser.jay (namespace_member_declaration): Flag that we have
12346         found a declaration when we do.  This is used to flag error 1529
12347
12348         * driver.cs: Report ok when we display the help only.
12349
12350 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12351
12352         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12353
12354 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12355
12356         * cs-tokenizer.cs (define): We also have to track locally the
12357         defines.  AllDefines is just used for the Conditional Attribute,
12358         but we also need the local defines for the current source code. 
12359
12360 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12361
12362         * statement.cs (While, For, Do): These loops can exit through a
12363         Break statement, use this information to tell whether the
12364         statement is the last piece of code.
12365
12366         (Break): Flag that we break.
12367
12368         * codegen.cs (EmitContexts): New `Breaks' state variable.
12369
12370 2002-07-03  Martin Baulig  <martin@gnome.org>
12371
12372         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12373         modifiers in method declarations in structs.  Otherwise, you won't
12374         be able to override things like Object.Equals().
12375
12376 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12377
12378         * class.cs (Method, Property, Indexer): Do not allow the public
12379         modifier to be used in explicit interface implementations.
12380
12381         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12382         override modifiers in method declarations in structs
12383
12384 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12385
12386         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12387         integer or real overflow, report an error
12388
12389 2002-07-02  Martin Baulig  <martin@gnome.org>
12390
12391         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12392         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12393         to tell the runtime about our newly created System.Object and
12394         System.ValueType types.
12395
12396 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12397
12398         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12399         struct instead of Ldarg/Starg.
12400
12401 2002-07-02  Martin Baulig  <martin@gnome.org>
12402
12403         * expression.cs (Indirection.Indirection): Call
12404         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12405
12406 2002-07-02  Martin Baulig  <martin@gnome.org>
12407
12408         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12409         ValueType, call TypeManager.TypeToCoreType() on it.
12410         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12411         the OpCodes.Newarr argument.
12412
12413 2002-07-02  Martin Baulig  <martin@gnome.org>
12414
12415         * expression.cs (Invocation.EmitCall): When compiling corlib,
12416         replace all calls to the system's System.Array type to calls to
12417         the newly created one.
12418
12419         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12420         System.Array methods.
12421         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12422         from the system's System.Array type which must be replaced.
12423
12424 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12425
12426         * typemanager.cs: load unverifiable_code_ctor so we can build
12427         corlib using the correct type. Avoid using GetTypeCode() with
12428         TypeBuilders.
12429         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12430         TypeManager.object_type to allow building corlib.
12431
12432 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12433
12434         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12435
12436 2002-07-01  Martin Baulig  <martin@gnome.org>
12437
12438         * class.cs: Make the last change actually work, we need to check
12439         whether `ifaces != null' to avoid a crash.
12440
12441 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12442
12443         * class.cs: when we build structs without fields that implement
12444         interfaces, we need to add the interfaces separately, since there is
12445         no API to both set the size and add the interfaces at type creation
12446         time.
12447
12448 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12449
12450         * expression.cs: the dimension arguments to the array constructors
12451         need to be converted if they are a long.
12452
12453 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12454
12455         * class.cs: don't emit ldarg.0 if there is no parent constructor
12456         (fixes showstopper for corlib).
12457
12458 2002-06-29  Martin Baulig  <martin@gnome.org>
12459
12460         MCS now compiles corlib on GNU/Linux :-)
12461
12462         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12463         ie. check for MethodImplOptions.InternalCall.
12464
12465         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12466         and TypeManager.attribute_type are null, so we must explicitly check
12467         whether parent is not null to find out whether it's an attribute type.
12468         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12469         and SetBuilder, not only if the property is neither abstract nor external.
12470         This is necessary to set the MethodImplOptions on the accessor methods.
12471         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12472         SetBuilder, see Property.Emit().
12473
12474         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12475         populate "System.Object", "System.ValueType" and "System.Attribute" since
12476         they've already been populated from BootCorlib_PopulateCoreTypes().
12477
12478 2002-06-29  Martin Baulig  <martin@gnome.org>
12479
12480         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12481         is the NullLiteral, we also need to make sure that target_type is not
12482         an enum type.   
12483
12484 2002-06-29  Martin Baulig  <martin@gnome.org>
12485
12486         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12487         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12488         before calling BootstrapCorlib_ResolveDelegate ().
12489
12490 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12491
12492         * statement.cs: fixed build-breaker. All tests passed ok.
12493
12494 2002-06-27  Martin Baulig  <martin@gnome.org>
12495
12496         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12497         for System.Decimal when compiling corlib.
12498
12499 2002-06-27  Martin Baulig  <martin@gnome.org>
12500
12501         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12502         switch blocks which contain nothing but a default clause.
12503
12504 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12505
12506        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12507
12508 2002-06-27  Martin Baulig  <martin@gnome.org>
12509
12510         * ecore.cs (PropertyExpr.PropertyExpr): Call
12511         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12512
12513         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12514         is already a TypeBuilder.
12515
12516 2002-06-27  Martin Baulig  <martin@gnome.org>
12517
12518         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12519         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12520         the "from an array-type to System.Array" case.  This makes it work
12521         when compiling corlib.
12522
12523 2002-06-27  Martin Baulig  <martin@gnome.org>
12524
12525         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12526         non-static PropertyExpr, set its InstanceExpression.  This makes
12527         the `ICollection.Count' property work in System/Array.cs.
12528
12529 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12530
12531         * driver.cs: Made error handling more consistent.  Errors now
12532         tracked by Report class, so many methods which used to return int
12533         now return void.  Main() now prints success/failure and 
12534         errors/warnings message.
12535
12536         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12537         the magic number return values (123 and 124).  Now, if the
12538         expected error occurs, the compiler exits with success (exit value
12539         0).  If the compilation completes without seeing that particular
12540         error, the compiler exits with failure (exit value 1).  The
12541         makefile in mcs/errors has been changed to handle the new behaviour.
12542
12543         * report.cs: Made 'expected error' number a property and renamed
12544         it from 'Probe' to 'ExpectedError'.
12545
12546         * genericparser.cs: Removed error handling support, since it is
12547         now all done by Report class.
12548
12549         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12550         class, so parse() no longer returns an int.
12551
12552         * namespace.cs: Use Report.Error instead of GenericParser.error
12553
12554 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12555
12556         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12557         TypeContainer.AddOperator): At the front of the list put the
12558         explicit implementations, so they get resolved/defined first. 
12559
12560 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12561
12562         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12563         interface type is implemented by this TypeContainer.  Used during
12564         explicit interface implementation.
12565
12566         (Property.Define, Indexer.Define, Method.Define): Validate that
12567         the given interface in the explicit implementation is one of the
12568         base classes for the containing type.
12569
12570         Also if we are explicitly implementing an interface, but there is
12571         no match in the pending implementation table, report an error.
12572
12573         (Property.Define): Only define the property if we are
12574         not explicitly implementing a property from an interface.  Use the
12575         correct name also for those properties (the same CSC uses,
12576         although that is really not needed).
12577
12578         (Property.Emit): Do not emit attributes for explicitly implemented
12579         properties, as there is no TypeBuilder.
12580
12581         (Indexer.Emit): ditto.
12582
12583         Hiding then means that we do not really *implement* a pending
12584         implementation, which makes code fail.
12585
12586 2002-06-22  Martin Baulig  <martin@gnome.org>
12587
12588         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12589         the return value of Object.GetType().  [FIXME: we need to do this whenever
12590         we get a type back from the reflection library].
12591
12592 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12593
12594         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12595
12596 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12597
12598         * attribute.cs: Return null if we can not look up the type.
12599
12600         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12601         the interface types found.
12602
12603         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12604         interface types found.
12605
12606         * typemanager.cs (GetInterfaces): Make this routine returns alll
12607         the interfaces and work around the lame differences between
12608         System.Type and System.Reflection.Emit.TypeBuilder in the results
12609         result for GetInterfaces.
12610
12611         (ExpandInterfaces): Given an array of interface types, expand and
12612         eliminate repeated ocurrences of an interface.  This expands in
12613         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12614         be IA, IB, IC.
12615
12616 2002-06-21  Martin Baulig  <martin@gnome.org>
12617
12618         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12619         on System.Enum.
12620
12621 2002-06-21  Martin Baulig  <martin@gnome.org>
12622
12623         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12624         and called with one of the core types, return the corresponding typebuilder for
12625         that type.
12626
12627         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12628         element type.
12629
12630 2002-06-21  Martin Baulig  <martin@gnome.org>
12631
12632         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12633         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12634         (Expression.ConvertReferenceExplicit): Likewise.
12635
12636         * expression.cs (ElementAccess.DoResolve): Likewise.
12637         (ElementAccess.DoResolveLValue): Likewise.
12638
12639 2002-06-10  Martin Baulig  <martin@gnome.org>
12640
12641         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12642         add the "value" parameter to the parameter list.
12643
12644         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12645         to our caller.
12646
12647 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12648
12649         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12650         the argument to an int, uint, long or ulong, per the spec.  Also
12651         catch negative constants in array creation.
12652
12653 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12654
12655         * class.cs: do not allow the same interface to appear twice in
12656         the definition list.
12657
12658 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12659
12660         * ecore.cs: don't use ldlen with System.Array.
12661
12662 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12663
12664         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12665
12666 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12667
12668         * modifiers.cs: produce correct field attributes for protected
12669         internal. Easy fix so miguel can work on ther harder stuff:-)
12670
12671 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * pending.cs: New file.  Move the code from class.cs here.
12674         Support clearning the pending flag for all methods (when not doing
12675         explicit interface implementation).
12676
12677 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12678
12679         * rootcontext.cs: added a couple more types needed to bootstrap.
12680
12681 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12682
12683         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12684         constructor in the type, instead of any constructor in the type
12685         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12686         a bug in the Mono runtime when applying the params attribute). 
12687
12688 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12689         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12690
12691 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12692
12693         * expression.cs (Unary.ResolveOperator): Use TypeManager
12694         to resolve the type.
12695
12696 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12697
12698         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12699         attached.
12700
12701         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12702         with each member too.
12703
12704         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12705         field builders too - this takes care of the enum member case.
12706
12707 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12708
12709         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12710         address-of operator on both value types and pointers.
12711
12712 2002-06-10  Martin Baulig  <martin@gnome.org>
12713
12714         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12715         PropertyBuilder to the `property_builders' list.
12716
12717         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12718         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12719         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12720         find any indexers which are inherited from an interface.
12721
12722 2002-06-09  Martin Baulig  <martin@gnome.org>
12723
12724         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12725         the same type as the constant if necessary.  There's also a test-130.cs
12726         for this.
12727
12728         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12729
12730         * typemanager.cs (TypeManager.ChangeType): Previously known as
12731         Enum.ChangeEnumType().
12732
12733 2002-06-09  Martin Baulig  <martin@gnome.org>
12734
12735         * expression.cs (Cast.TryReduce): Added support for consts.
12736
12737 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12738
12739         * class.cs (Accessor): Hold attributes information so we can pass
12740         it along.
12741
12742         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12743         Modify to pass in attributes attached to the methods.
12744
12745         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12746
12747         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12748         to handle the Accessor kind :-)
12749
12750         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12751
12752 2002-06-08  Martin Baulig  <martin@gnome.org>
12753
12754         * expression.cs (Unary.TryReduceNegative): Added support for
12755         ULongConstants.
12756
12757 2002-06-08  Martin Baulig  <martin@gnome.org>
12758
12759         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12760         name can't be found in the `defined_names' - the caller will do a
12761         MemberLookup in this case and thus find methods in System.Enum
12762         such as Enum.IsDefined().
12763
12764 2002-06-08  Martin Baulig  <martin@gnome.org>
12765
12766         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12767         Convert.ChangeType() which works with TypeBuilder created types.
12768         (Enum.LookupEnumValue, Enum.Define): Use it here.
12769
12770         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12771         `TypeBuilder.BaseType != null' check.
12772         (TypeContainer.FindMembers): Only lookup parent members if we
12773         actually have a parent.
12774         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12775         (ConstructorInitializer.Resolve): Likewise.
12776
12777         * interface.cs (Interface.FindMembers): Added
12778         `TypeBuilder.BaseType != null' check.
12779
12780         * rootcontext.cs (RootContext.ResolveCore): Added
12781         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12782         classes_second_stage.
12783
12784         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12785         debug_type and trace_type when compiling with --nostdlib.       
12786
12787 2002-06-07  Martin Baulig  <martin@gnome.org>
12788
12789         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12790         (AddField): Set it to true when adding a non-static field.
12791         (DefineType): Use `have_nonstatic_fields' to find out whether we
12792         have non-static fields, not `Fields != null'.
12793
12794 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12795
12796         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12797         dereferencing a null on the static-field code path)
12798
12799 2002-05-30  Martin Baulig  <martin@gnome.org>
12800
12801         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12802         to take command line arguments.  Use reflection to call the new
12803         custom `Initialize' function on the symbol writer and pass it the
12804         command line arguments.
12805
12806         * driver.cs (--debug-args): New command line argument to pass command
12807         line arguments to the symbol writer.
12808
12809 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12810
12811         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12812         the target type for indexers and properties.  Thanks to Joe for
12813         catching this.
12814
12815 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12816
12817         * typemanager.cs (MethodFlags): returns the method flags
12818         (Obsolete/ShouldIgnore) that control warning emission and whether
12819         the invocation should be made, or ignored. 
12820
12821         * expression.cs (Invocation.Emit): Remove previous hack, we should
12822         not do this on matching a base type, we should do this based on an attribute
12823
12824         Only emit calls to System.Diagnostics.Debug and
12825         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12826         on the command line.
12827
12828         * rootcontext.cs: Global settings for tracing and debugging.
12829
12830         * cs-tokenizer.cs (define): New utility function to track
12831         defines.   Set the global settings for TRACE and DEBUG if found.
12832
12833 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12834
12835         * interface.cs (Populate*): Pass in the TypeContainer as well as
12836         the DeclSpace as parameters so that we can create EmitContexts and
12837         then use that to apply attributes etc.
12838
12839         (PopulateMethod, PopulateEvent, PopulateProperty)
12840         (PopulateIndexer): Apply attributes everywhere.
12841
12842         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12843         etc.
12844
12845         (ApplyAttributes): Update accordingly.
12846
12847         We now apply interface attributes for all members too.
12848
12849 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12850
12851         * class.cs (Indexer.Define); Correctly check if we are explicit
12852         implementation (instead of checking the Name for a ".", we
12853         directly look up if the InterfaceType was specified).
12854
12855         Delay the creation of the PropertyBuilder.
12856
12857         Only create the PropertyBuilder if we are not an explicit
12858         interface implementation.   This means that explicit interface
12859         implementation members do not participate in regular function
12860         lookups, and hence fixes another major ambiguity problem in
12861         overload resolution (that was the visible effect).
12862
12863         (DefineMethod): Return whether we are doing an interface
12864         implementation. 
12865
12866         * typemanager.cs: Temporary hack until we get attributes in
12867         interfaces (Ravi is working on that) and we get IndexerName
12868         support in interfaces.
12869
12870         * interface.cs: Register the indexers as properties.
12871
12872         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12873         warning, I have verified that this is a bug in the .NET runtime
12874         (JavaScript suffers of the same problem).
12875
12876         * typemanager.cs (MemberLookup): When looking up members for
12877         interfaces, the parent of an interface is the implicit
12878         System.Object (so we succeed in searches of Object methods in an
12879         interface method invocation.  Example:  IEnumerable x;  x.ToString
12880         ()) 
12881
12882 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12883
12884         * class.cs (Event): Events should also register if they do
12885         implement the methods that an interface requires.
12886
12887         * typemanager.cs (MemberLookup); use the new GetInterfaces
12888         method. 
12889
12890         (GetInterfaces): The code used to lookup interfaces for a type is
12891         used in more than one place, factor it here. 
12892
12893         * driver.cs: Track the errors at the bottom of the file, we kept
12894         on going.
12895
12896         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12897         instance if the method we are calling is static!
12898
12899 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12900
12901         * attribute.cs (ApplyAttributes): Make this function filter out
12902         the IndexerName attribute (as that attribute in reality is never
12903         applied) and return the string constant for the IndexerName
12904         attribute. 
12905
12906         * class.cs (TypeContainer.Emit): Validate that all the indexers
12907         have the same IndexerName attribute, and if so, set the
12908         DefaultName attribute on the class. 
12909
12910         * typemanager.cs: The return value might contain other stuff (not
12911         only methods).  For instance, consider a method with an "Item"
12912         property and an Item method.
12913
12914         * class.cs: If there is a problem with the parameter types,
12915         return. 
12916
12917 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12918
12919         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12920         looks at user defined conversion after making a call to 
12921         StandardConversionExists - we need this for overload resolution.
12922
12923         * expression.cs : Update accordingly the various method calls.
12924
12925         This fixes 2 bugs filed against implicit user defined conversions 
12926
12927 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12928
12929         * statement.cs: Track the result of the assignment.
12930
12931 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12932
12933         * expression.cs (MemberAccess): Improved error reporting for
12934         inaccessible members.
12935
12936 2002-05-22  Martin Baulig  <martin@gnome.org>
12937
12938         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12939         itself with debugging support.
12940
12941 2002-05-22  Martin Baulig  <martin@gnome.org>
12942
12943         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12944         Removed, this isn't needed anymore.
12945
12946 2002-05-20  Martin Baulig  <martin@gnome.org>
12947
12948         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12949         be underlying type for an enum.
12950
12951 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12952
12953         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12954         that splits out the loading of just the core types.
12955
12956         * rootcontext.cs (ResolveCore): Split the struct resolution in
12957         two, so we can load the enumeration underlying types before any
12958         enums are used.
12959
12960         * expression.cs (Is): Bandaid until we fix properly Switch (see
12961         bug #24985 for details).
12962
12963         * typemanager.cs (ImplementsInterface): The hashtable will contain
12964         a null if there are no interfaces implemented.
12965
12966 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12967
12968         * cs-parser.jay (indexer_declarator): It is fine to have array
12969         parameters
12970
12971 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12972
12973         * typemanager.cs: (RegisterBuilder): New function used to register
12974         TypeBuilders that implement interfaces.  Since
12975         TypeBuilder.GetInterfaces (as usual) does not work with lame
12976         Reflection.Emit. 
12977         (AddUserType): register interfaces.
12978
12979         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12980         dealing with TypeBuilder.  Also, arrays are showing up as
12981         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12982         methods can not be invoked on them!
12983
12984         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12985         (ImplicitReferenceConversionExists): Split out from
12986         StandardConversionExists. 
12987
12988         * expression.cs (As): We were only implementing one of the three
12989         cases for the as operator.  We now implement them all.
12990         (Is): Implement the various other cases for Is as well.
12991
12992         * typemanager.cs (CACHE): New define used to control if we want or
12993         not the FindMembers cache.  Seems to have a negative impact on
12994         performance currently
12995
12996         (MemberLookup): Nested types have full acess to
12997         enclosing type members
12998
12999         Remove code that coped with instance/static returns for events, we
13000         now catch this in RealFindMembers.
13001
13002         (RealFindMembers): only perform static lookup if the instance
13003         lookup did not return a type or an event.  
13004
13005 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13006
13007         * assign.cs (CompoundAssign): We pass more semantic information
13008         now to Compound Assignments than we did before: now we have all
13009         the information at hand, and now we resolve the target *before* we
13010         do the expression expansion, which allows the "CacheValue" method
13011         to have the effect we intended (before, a [x] += 1 would generate
13012         two differen ArrayAccess expressions from the ElementAccess,
13013         during the resolution process).
13014
13015         (CompoundAssign.DoResolve): Resolve target and original_source here.
13016
13017 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13018
13019         * expression.cs (ArrayAccess): dropped debugging information. 
13020
13021         * typemanager.cs: Small bug fix: I was always returning i_members,
13022         instead of one of i_members or s_members (depending on which had
13023         the content).
13024
13025         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13026         method is invoked before any code generation takes place, and it
13027         is a mechanism to inform that the expression will be invoked more
13028         than once, and that the method should use temporary values to
13029         avoid having side effects
13030
13031         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13032
13033         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13034         implementation.
13035
13036         * expression.cs (Indirection, ArrayAccess): Add support for
13037         CacheTemporaries in these two bad boys. 
13038
13039         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13040         ldobj or ldind_ref.  
13041         (StoreFromPtr): Handle stobj as well.
13042
13043         * expression.cs (UnaryMutator): Share more code.
13044
13045         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13046         down: I was not tracking the Filter function as well, which
13047         was affecting the results of the cache.
13048
13049 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13050
13051         * attribute.cs: Remove the hack to handle the CharSet property on
13052         StructLayouts. 
13053
13054 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13055
13056         * attribute.cs (DoResolve): More uglyness, we now only try to
13057         resolve the attribute partially, to extract the CharSet
13058         information (only if we are a StructLayout attribute).  Otherwise 
13059
13060         (GetExtraTypeInfo): Add some code to conditionally kill in the
13061         future this.   I am more and more convinced that the .NET
13062         framework has special code to handle the attribute setting on
13063         certain elements.
13064
13065         * expression.cs (IsParamsMethodApplicable): Revert my previous
13066         foreach change here, it was wrong.
13067
13068 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13069
13070         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13071         (pp_expr): do not abort on unknown input, just return.
13072         (eval): abort if there are pending chars.
13073
13074         * attribute.cs (Attribute.Resolve): Positional parameters are
13075         optional.  Deal with that case.
13076
13077         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13078         the Ansi/Unicode/Auto information for the type.
13079
13080         (TypeContainer.DefineType): instantiate the EmitContext here, as
13081         we will be using it during the type definition (to resolve
13082         attributes) and during the emit phase.
13083
13084         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13085         to pull type information out of the attributes
13086
13087         (Attribute.Resolve): track the constructor builder, and allow for
13088         multiple invocations (structs and classes will use this).
13089
13090         * ecore.cs (MemberLookupFinal): new version with all the
13091         parameters customizable.
13092
13093         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13094         constructors.  Return if the result value is null (as the error
13095         would have been flagged already by MemberLookupFinal)
13096
13097         Do not allow instances of abstract classes or interfaces to be
13098         created.
13099
13100         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13101         We have to compare the assembly property here when dealing with
13102         FamANDAssem and Assembly access modifiers, because we might be
13103         creating an assembly from *modules* (that means that we are not
13104         getting TypeBuilders for types defined in other modules that are
13105         part of this assembly).
13106
13107         (Method.Emit): If the method is marked abstract and has a body,
13108         emit an error. 
13109
13110         (TypeContainer.DefineMembers): If both the defined member and the
13111         parent name match are methods, then do not emit any warnings: let
13112         the Method.Define routine take care of flagging warnings.  But if
13113         there is a mismatch (method overrides something else, or method is
13114         overriwritten by something, then emit warning).
13115
13116         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13117         set to null, this means `do not check for the return type on the
13118         signature'. 
13119
13120         (Method.Define): set the return type for the method signature to
13121         null, so that we get methods with the same name and parameters and
13122         different return types.  This is used to flag warning 114 (you are
13123         hiding a method, and you probably want to use the new/override
13124         keywords instead).
13125
13126         * typemanager.cs (MemberLookup): Implemented proper access
13127         control, closing a long standing set of bug reports.  The problem
13128         was that the Framework only has two bits: Public and NonPublic,
13129         and NonPublic includes private and protected methods, but we need
13130         to enforce the FamANDAssem, FamOrAssem and Family. 
13131
13132 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13133
13134         * statement.cs (GotoCase): Return true: Ammounts to giving up
13135         knowledge on whether we return or not, and letting the other case
13136         be responsible for it.
13137
13138 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13139
13140         * driver.cs: Do not load directories for each file processed, only
13141         do it if there is a pattern.
13142
13143         * ecore.cs: Report readonly assigns here as well, as we might have
13144         been resolved only by MemberAccess.
13145
13146         (SimpleName.SimpleNameResolve): Also be useful for LValue
13147         resolution.   We need this to propagate assign to local readonly variables
13148
13149         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13150         do not want to reuse potential criteria memory.
13151
13152         * class.cs (MyEventBuilder): Set reflected_type;
13153
13154         * ecore.cs (Constantify): Added support for constifying bools.
13155
13156         (RootContext.LookupType): Added a cache for values looked up in
13157         the declaration space.
13158
13159         * typemanager.cs (FindMembers): Now is a front-end to
13160         RealFindMembers, and provides a two-level hashtable-based cache to
13161         the request.  
13162
13163         15% performance improvement: from 22.5 to 19.2 seconds.
13164
13165         * expression.cs (IsParamsMethodApplicable): use foreach.
13166         (Invocation.DoResolve): ditto.
13167         (New.DoResolve): ditto.
13168         (ArrayCreation.DoResolve): ditto.
13169
13170         * ecore.cs (FindMostEncompassingType): use foreach.
13171
13172         * delegate.cs (NewDelegate.DoResolve): Use foreach
13173
13174         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13175         (RemoveMethods): use foreach.
13176
13177         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13178         nested foreach statements instead of for, and also break out of
13179         the inner loop once a match is found.
13180
13181         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13182
13183 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13186         we actually unwrap the expression to allow for extra information
13187         to be extracted. 
13188
13189         * expression.cs: Use Shr_Un on unsigned operations. 
13190
13191 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13192
13193         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13194         applicable operators was not being considered correctly. This closes
13195         the bug Miguel reported.
13196
13197 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13198
13199         * attribute.cs: check that the type derives from System.Attribute
13200         and report the correct error in that case (moved the duplicate code to
13201         its own method, too).
13202
13203 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13204
13205         * attribute.cs: lookup attribute type name as the spec says: first the
13206         bare attribute name and then name + "Attribute" (nant compiles with
13207         mcs after this fix).
13208
13209 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13210
13211         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13212         Because of the way we parse things, we should try to see if a
13213         UIntConstant can fit in an integer.
13214
13215 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13216
13217         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13218         when we are in an explicit context.
13219
13220         (ConvertReferenceExplicit): When converting from Iface type S to Class
13221         T make sure the rules are implemented as an OR.
13222
13223         * parameter.cs (ParameterType): Make it a property for now although the
13224         purpose really isn't anything immediate.
13225
13226         * expression.cs (Is*Applicable): Do better checking on the parameter type
13227         of a ref/out parameter. The ones from the system assemblies are already 
13228         marked with the correct type so we don't need to do any correction.
13229
13230         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13231         the object type is standard too so include that.
13232
13233 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13234
13235         * ecore.cs (StandardConversionExists): Augment with missing code:
13236         deal with IntConstant, LongConstants and Enumerations.
13237
13238         * assign.cs: Report the error, instead of failing silently
13239
13240         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13241         typecontainer that they are declared, because the
13242         typecontainer/namespace will have the list of using clauses that
13243         need to be applied.
13244
13245         Assembly Attributes were escaping the normal registration
13246         mechanism. 
13247
13248         (EmitCode): Apply attributes within an EmitContext that represents
13249         the container they were declared on.
13250
13251         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13252
13253 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13254
13255         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13256         Revamp completely - make much cleaner as we now operate only
13257         on a set of Types.
13258
13259         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13260         to implement the logic detailed in the spec more correctly.
13261
13262         (UserDefinedConversion): Update accordingly.
13263
13264 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13265
13266         * statement.cs: Return flow analysis information up.
13267
13268         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13269         and the default.
13270
13271         (token): Do not consume an extra character before calling
13272         decimal_digits.
13273
13274 2002-05-06  Piers Haken <piersh@friskit.com>
13275
13276         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13277
13278 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13279
13280         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13281         EmitContext during the instance constructor initializer
13282         resolution, to stop access to instance variables.
13283
13284         This is mandated by the spec, last paragraph of the `constructor
13285         initializers' section. 
13286
13287 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13288
13289         * cs-parser.jay, class.cs (Accessor): new class used to represent
13290         an accessor (get or set).  In the past we used `null' to represent
13291         a missing accessor.  But this is ambiguous because there was no
13292         way to tell in abstract indexers/properties if one of them was
13293         specified.
13294
13295         Now there is a way of addressing that.
13296
13297         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13298         instead of FindMembers.
13299
13300         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13301         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13302
13303         * attribute.cs: Treat indexers and properties as the same in terms
13304         of applying attributes
13305
13306         * ecore.cs (FindMostEncompassedType): Use statically initialized
13307         EmptyExpressions()s like we do elsewhere to avoid creating useless
13308         objects (and we take this out of the tight loop).
13309
13310         (GetConversionOperators): Move the code to extract the actual
13311         operators to a separate routine to clean things up.
13312
13313 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13314
13315         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13316         events are always registered FieldBuilders.
13317
13318         * class.cs (FieldBase): New class shared by Fields 
13319
13320         * delegate.cs: If we are a toplevel delegate, use our full name.
13321         If we are a nested delegate, then only use our tail name.
13322
13323 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13324
13325         * expression.cs (IsApplicable): Ensure that we add the "&" to
13326         ref/out types before comparing it with the type of the argument.
13327
13328         (IsParamsMethodApplicable): Ditto.
13329
13330         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13331         silly me ;-)
13332
13333         * delegate.cs : Handle the case when we have more than one applicable
13334         method. Flag an error only when we finish checking all.
13335
13336 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * expression.cs: Add support for boolean static initializers.
13339
13340 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13341
13342         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13343
13344         * parameter.cs (ComputeParameterTypes,
13345         ComputeAndDefineParameterTypes): Better error handling: now we
13346         clear the `types' cache if we fail during any of the type lookups.
13347         We also return the status code correctly to our caller
13348
13349         * delegate.cs: If we fail to define a delegate, abort the extra
13350         steps. 
13351
13352         * expression.cs (Binary.ResolveOperator): for
13353         operator==(object,object) and operator !=(object, object) we also
13354         have to verify that there is an implicit conversion from one to
13355         the other.
13356
13357         (ArrayAccess.DoResolve): Array Access can operate on
13358         non-variables. 
13359
13360 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13361
13362         * assign.cs (CompoundAssign): A new class used as a "flag" that
13363         the assignment actually is happening as part of a compound
13364         assignment operator.
13365
13366         During compound assignment, a few new rules exist to enable things
13367         like:
13368
13369         byte b |= 1 + 2
13370
13371         From the spec:
13372
13373         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13374         to the type of x) if y is implicitly convertible to the type of x,
13375         and the operator is a builtin operator and the return type of the
13376         operator is explicitly convertible to the type of x. 
13377
13378         * rootcontext.cs: Reset warning level to 2.  4 catches various
13379         "interesting" features in mcs, we must clean this up at some
13380         point, but currently am trying to kill other bugs ;-)
13381
13382         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13383         in container classes as well.  
13384
13385         * expression.cs (Binary.ResolveOperator): Handle string case
13386         before anything else (as operator overloading does emit an error
13387         before doing anything else).
13388
13389         This code could go away when we move to a table driven model, but
13390         i could not come up with a good plan last night.
13391
13392 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13393
13394         * typemanager.cs (CSharpName): reimplementation using regex.
13395         * class.cs: added null check for fields in Emit
13396         * rootcontext.cs: set warninglevel to 4
13397
13398 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * typemanager.cs (CSharpName): reimplemented with Lupus
13401         suggestion.
13402
13403 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * statement.cs (If): correclty implement Resolve, because we were
13406         not catching sem errors in there.  The same process is needed
13407         everywhere else. 
13408         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13409
13410
13411         (Statement.Warning_DeadCodeFound): Factorize code.
13412         (While): Report dead code here too.
13413
13414         (Statement): Added Resolve virtual method to allow
13415         for resolution split from the emit code.
13416
13417 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13418
13419         * statement.cs (EmitBoolExpression): No longer try to resolve the
13420         expression here.    
13421         (MakeBoolean): New utility function that resolve, implicitly
13422         converts to boolean and tags the expression. 
13423
13424
13425         (If, Do): Implement dead code elimination.
13426         (While): Implement loop inversion
13427
13428         (Do, While, For, If): Resolve the expression prior to calling our
13429         code generation.
13430
13431 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13432
13433         * class.cs:
13434           - added method Report28 (warning: program has more than one entry point)
13435           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13436           - modified method Method.Define, the part at the end of the method
13437
13438         * rootcontext.cs: added static public Location EntryPointLocation;
13439           
13440         * ../errors/cs0028.cs : Add test case for the above warning.              
13441
13442         * typemanager.cs:
13443           - modified method CSharpName to allow arrays of primitive type to
13444             be printed nicely (e.g. instead of System.Int32[][] it now prints
13445             int[][])
13446           - added method CSharpSignature: returns the signature of a method
13447             in string format to be used in reporting errors, warnings, etc.
13448
13449         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13450         with String.Empty.
13451
13452 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13453
13454         * delegate.cs (Define): Fix extremely silly bug where I was
13455         setting the type of the 'object' parameter of the BeginInvoke
13456         method to System.IAsyncResult instead of System.Object ;-)
13457
13458 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13459
13460         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13461         here. 
13462
13463         (Constructor.Emit): return if we fail to initialize the
13464         constructor.  Another door closed!  
13465
13466         * expression.cs (New.DoResolve): Improve error message (from -6 to
13467         1501).  Use DeclaredOnly lookup to find the exact constructor.
13468
13469         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13470         loop.  This is useful.
13471
13472         * cs-parser.jay: Adjust the default parameters so that destructors
13473         have the proper signature.
13474
13475 2002-04-26  Martin Baulig  <martin@gnome.org>
13476
13477         * driver.cs (LoadAssembly): If `assembly' contains any characters
13478         which are only valid in path names and not in assembly names
13479         (currently slash, backslash and point), use Assembly.LoadFrom ()
13480         instead of Assembly.Load () on the `assembly' (before iteration
13481         over the link_paths).
13482
13483 2002-04-26  Martin Baulig  <martin@gnome.org>
13484
13485         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13486
13487 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13488
13489         * class.cs (Property): use the new typemanager.MemberLookup
13490
13491         (TypeContainer.MemberLookup): Implement using the
13492         TypeManager.MemberLookup now. 
13493
13494         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13495         and return MemberInfos, so that these can be used without an
13496         EmitContext (what we had before).
13497
13498 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13499
13500         * expression.cs: Fix the case where the argument to params if the
13501         type of the params.  I omitted handling this before.   Fixed
13502
13503 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13504
13505         * driver.cs: Call BootCorlib_PopulateCoreType
13506
13507         * class.cs (Property.CheckBase): Check for properties only, not
13508         for all members. 
13509
13510         * interface.cs: Temporary hack: try/catch around the
13511         CustomAttributeBuilder, because I am getting an exception that I
13512         do not understand.
13513
13514         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13515         types whose definitions are required to be there (attributes are
13516         defined before standard types).
13517
13518         Compute definitions as we boot the various types, as they are used
13519         immediately (value_type class will need object_type, but if we do
13520         not initialize object_type, we will pass a null, which will let
13521         the runtime pick the System.Object from the existing corlib, which
13522         is not what we want).
13523
13524 2002-04-22  Patrik Torstensson <totte@labs2.com>
13525
13526         * cs-tokenizer.cs: fixed a number of trim() issues.
13527
13528 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13529
13530         * expression.cs (Argument.Type): Ensure that we return the correct
13531         type when we have out or ref parameters [in which case we 
13532         append a "&"].
13533
13534 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13535
13536         * class.cs (Property, Indexer): Allow extern modifier in there. 
13537
13538         * typemanager.cs (InitBaseTypes): Initializes object_type and
13539         value_type, since those will be used early on during the bootstrap
13540         process to compile corlib.
13541
13542         (InitCoreTypes): Move code from here to InitBaseTypes.
13543
13544 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13545
13546         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13547         single-dimension arrays as using the ldlen opcode.  
13548
13549         Daniel Lewis discovered this optimization.  
13550
13551         * typemanager.cs: Add signature for System.Array::get_Length
13552
13553 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13554
13555         * statement.cs: report the error when the foreach does not apply to an
13556         array nor a collection.
13557
13558 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13559
13560         * expression.cs: Add implicit conversions to the operator ~.
13561
13562         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13563
13564         * typemanager.cs: Locate the decimal constructor.
13565
13566 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13567
13568         * attribute.cs: use the new property of TypeOf.
13569         * expression.cs: added 'get' property around typearg.
13570
13571         These changes fix a build breaker reported by NickD. Is this the
13572         correct way to fix?  If not, please, revert my changes and make it
13573         work :-).
13574
13575 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13576
13577         * attribute.cs: Add support for typeof in attribute invocations.
13578         I am not sure that this is right though.
13579
13580 2002-04-14  Duncan Mak  <duncan@ximian.com>
13581
13582         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13583         Binary.Operator.Division case.
13584
13585 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13586
13587         * class.cs (DefineType): Ensure that we do a proper check on
13588         attribute types and also register it with the TypeManager.
13589
13590         (TypeContainer.Targets): The default for attribute types is
13591         AttributeTargets.All.
13592
13593         * attribute.cs (ApplyAttributes): Registering the attribute type
13594         is done elsewhere, not when we discover we have a Usage attribute.
13595
13596 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13597
13598         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13599         and get rid of is_delegate parameter.
13600
13601         * everywhere : update.
13602
13603 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13604
13605         * cs-parser.jay (compilation_unit): Revamp completely to use
13606         some new ideas that I got from Rhys' grammar to solve the problems
13607         with assembly level attributes.
13608
13609         (outer_declaration): New grammar production.
13610
13611         (attribute_sections): Add.
13612
13613         (opt_attributes): Base on attribute_sections
13614
13615         (namespace_declaration): Allow opt_attributes to tackle the case
13616         when we have assembly level attributes - we are clever in this
13617         regard now ;-)
13618
13619         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13620         attributes in the non-global context.
13621
13622         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13623         instead of SetGlobalAttributes.
13624
13625         * class.cs, rootcontext.cs : Ensure we define and generate 
13626         attribute types before anything else.
13627
13628         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13629         and flag the new error -20 for the case when the attribute type
13630         does not have valid targets specified. csc does not catch this.
13631
13632         * ../errors/errors.txt : update for error # -20
13633
13634 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13635
13636         * support.cs (InternalParameters.ParameterModifier): Do some null
13637         checking and return sane values.
13638
13639         * class.cs (Method.Define): If we are a PInvoke method, ensure
13640         that we are static and extern. Report error # 601
13641
13642         * ../errors/cs0601.cs : Add test case for the above error.
13643
13644 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13645
13646         * rootcontext.cs (attribute_types): We need to keep type of
13647         all attribute types separately and emit code for them first.
13648
13649         (RegisterAttribute) : Implement.
13650
13651         * class.cs (DefineType): Check if the current Type is a custom
13652         attribute type and register it accordingly.
13653
13654         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13655         adding the first attribute twice and rename to
13656
13657         (SetGlobalAttributes): this.
13658
13659         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13660         lookups.
13661
13662         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13663         if we are processing global arguments. Hmm, I am unsure of this.
13664
13665 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13666
13667         * expression.cs: added static array of strings to avoid calling
13668         Enum.ToString () for Operator in Binary. Significant recover of
13669         performance.
13670
13671 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13672
13673         * class.cs (FindMembers): Allow the Builders of the various
13674         members to be null.  If they are skip them.  This only happens
13675         during the PInvoke declaration.
13676
13677 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13680         failure, so we do not keep going afterwards.
13681
13682         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13683         wanted to pass `false' as the `is_delegate' argument.  If this is
13684         the case, why not use delegate_type == null to mean `is_delegate =
13685         false' and anything else as is_delegate = true.
13686
13687 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13688
13689         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13690         code for the section, not the beginning of the tests.
13691
13692 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13693
13694         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13695
13696         * expression.cs (Binary): same.  Warn about errors where we have
13697         Enum/Enum in operator + as well.
13698
13699 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13700
13701         * statement.cs:
13702                 - added support for switch(bool)
13703                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13704                 - add TableSwitchEmit() to handle table-based switch statements
13705
13706 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13707
13708         * expression.cs (Invocation.OverloadResolve): Factor out code which
13709         does parameter compatibility checking with arguments so that we can 
13710         re-use the code even from Delegate.VerifyApplicability
13711
13712         (VerifyArgumentsCompat): Move above code here.
13713
13714         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13715         and instead make a call to the above method.
13716
13717 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13718
13719         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13720         We use it to keep track of classes which are attribute types.
13721
13722 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13723
13724         * delegate.cs (Delegate.Define): Correctly define the types in the
13725         presence of fixed and array parameters.
13726
13727         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13728         doing FindMembers.
13729
13730         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13731         include NonPublic after the first iteration.
13732
13733         * class.cs (Indexer.CheckBase): Only check if both parents are
13734         non-null. 
13735
13736         * cs-parser.jay (accessor_body): If empty, set to null.
13737
13738         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13739         same code path here to resolve constants names that we did have in
13740         MemberAccess.DoResolve.  There is too much code duplicated here.
13741
13742 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13743
13744         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13745
13746         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13747         to MakeUnionSet.
13748
13749         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13750         tokens, numbers and strings.
13751
13752         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13753         parenthesis.
13754
13755         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13756         asyncronous parameters and the regular parameters.  
13757
13758         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13759         specify the target directory.
13760
13761         * expression.cs: (This.DoResolve): Simplify
13762         (As.Emit): Optimize, do not generate IsInst if the expression is
13763         always of the given type.
13764
13765         (Is.DoResolve): Bug fix, we were reporting both always/never for
13766         the is expression.
13767
13768         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13769         creating too many unnecessary arrays.
13770
13771 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13772
13773         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13774         fields instead of rolling our own initializer.   Takes care of all
13775         implicit conversions, and drops unnecessary static checks/argument.
13776
13777 2002-03-31  Dick Porter  <dick@ximian.com>
13778
13779         * driver.cs: use the GetDirectories() return values properly, and
13780         use "/" as path separator.
13781
13782 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13783
13784         * expression.cs (Unary): Optimize - - expr into expr.
13785         (Binary): Optimize a + (-b) into a -b.
13786
13787         * codegen.cs (CodeGen): Made all methods static.
13788
13789 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13790
13791         * rootcontext.cs: 
13792
13793         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13794         TypeBuilder property.
13795
13796         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13797         instead. 
13798
13799         * tree.cs: Removed the various RecordXXXX, and replaced with a
13800         single RecordDecl.  Removed all the accessor methods, and just
13801         left a single access point Type 
13802
13803         * enum.cs: Rename DefineEnum to DefineType.
13804
13805         * decl.cs: New abstract method `DefineType' used to unify the
13806         Defines for Enumerations, Interfaces, TypeContainers and
13807         Delegates.
13808
13809         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13810         LookupBaseClasses method that used to live in class.cs and
13811         interface.cs here, and renamed to FindType.
13812
13813         * delegate.cs: Implement DefineType.  Take advantage of the
13814         refactored pattern for locating the parent builder without taking
13815         the parent_builder argument (which we know does not work if we are
13816         nested, and triggering a toplevel definition).
13817
13818 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13819
13820         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13821         accessibility of a member has changed during override and report
13822         an error if so.
13823
13824         * class.cs (Method.Define, Property.Define): Only complain on
13825         overrides if the method is private, any other accessibility is
13826         fine (and since we just checked the permission is the same, we are
13827         good to go).
13828
13829         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13830         and elif are processed always.  The other pre-processing
13831         directives are only processed if we are "taking" the path
13832
13833 2002-03-29  Martin Baulig  <martin@gnome.org>
13834
13835         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13836         current location is not Null.
13837
13838         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13839         a separate method so we can profile it.
13840
13841         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13842         `span.Seconds' are just seconds, but no minutes or hours.
13843         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13844
13845 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13846
13847         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13848         Remove the gratuitous set of Final:
13849
13850                                 // If an interface implementation, then we can set Final.
13851                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13852                                     implementing.DeclaringType.IsInterface)
13853                                         flags |= MethodAttributes.Final;
13854
13855         I do not know what I was smoking when I used that.
13856
13857
13858         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13859         step into fixing the name resolution issues for delegates and
13860         unifying the toplevel name resolution.
13861
13862 2002-03-28  Martin Baulig  <martin@gnome.org>
13863
13864         * class.cs (Method.Emit): If we have a symbol writer, call its
13865         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13866         tell it about the current method.
13867
13868         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13869         writer that we're going to emit the first byte of IL code for a new
13870         statement (a new source line).
13871         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13872         EmitContext.Mark() before emitting any code.
13873
13874         * location.cs (SymbolDocument): Return null when we're Null.
13875
13876         * statement.cs (Statement): Moved the `Location loc' variable here.
13877         (Statement.EmitBoolExpression): If we have a symbol writer, call
13878         ec.Mark() before emitting any code to tell it that we're at the
13879         beginning of a new statement.
13880         (StatementExpression): Added `Location' argument to the constructor.
13881         (Block): Added public readonly variable `StartLocation' and public
13882         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13883         (Block): Added constructor which takes a start and end location.
13884         (Block.SetEndLocation): New method. This sets the end location.
13885         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13886         local variables we create.
13887         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13888         each statement and do also mark the begin and end of the block.
13889
13890         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13891         tell it the current lexer.Location, use Location.Null for the end of the
13892         block.
13893         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13894         current block, set its end location using SetEndLocation().
13895         (statement_expression): StatementExpression constructor now takes the
13896         lexer.Location as additional argument.
13897         (for_statement, declare_local_variables): Likewise.
13898         (declare_local_variables): When creating a new implicit block, use the
13899         new Block constructor and pass it the lexer.Location.
13900
13901 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13904         members also on the parent interfaces recursively.
13905
13906 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13907
13908         * report.cs: Use new formats, since Gonzalo finished the missing
13909         bits. 
13910
13911         * expression.cs (Binary.ResolveOperator): added missing operator|
13912         operator& and operator^ for bool/bool.
13913
13914         * cs-parser.jay: CheckDef now takes a Location argument that is
13915         used to report errors more precisly (instead of reporting the end
13916         of a definition, we try to track something which is a lot closer
13917         to the source of the problem).
13918
13919         * cs-tokenizer.cs: Track global token use, so we can properly flag
13920         the use of #define/#undef after the first token has been seen.
13921
13922         Also, rename the reportXXXX to Error_DescriptiveName
13923
13924         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13925         TypeContainer, so that Enum and Interface can use this too.
13926
13927         * class.cs (TypeContainer.LookupInterfaceOrClass,
13928         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13929         `builder' argument.  Typically this was used to pass the parent
13930         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13931         the definition).  
13932
13933         The problem is that a nested class could trigger the definition of
13934         a toplevel class, and the builder would be obviously wrong in that
13935         case. 
13936
13937         So we drop this argument, and we compute dynamically the
13938         TypeBuilder/ModuleBuilder (the correct information was available
13939         to us anyways from DeclSpace.Parent)
13940
13941         * interface.cs (Interface.DefineInterface): Drop builder
13942         parameter cleanup like class.cs
13943
13944         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13945         like class.cs
13946
13947         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13948         values. 
13949
13950         (Try.Emit): Propagate the returns value from the statement.
13951
13952         (Return.Emit): Even if we are leavning 
13953
13954         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13955
13956         * modifiers.cs: Fix the computation of MethodAttributes flags.
13957
13958 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13959
13960         * driver.cs: allow compilation of files that start with '/'.
13961         Add a default case when checking the argument of --target.
13962
13963 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13964
13965         * interface.cs: Implement the same search algorithm for types in
13966         the interface code.
13967
13968         * delegate.cs: Do not allow multiple definition.
13969
13970         * Recovered ChangeLog that got accidentally amputated
13971
13972         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13973
13974         * rootcontext.cs: Load manually enum to allow core classes to
13975         contain enumerations.
13976
13977         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13978         Update to new static methods in TypeManager.
13979
13980         * typemanager.cs (GetMethod, GetConstructor): Use our
13981         implementation of FindMembers to find the members, since during
13982         corlib compilation, the types are TypeBuilders and GetMethod and
13983         GetConstructor do not work.
13984
13985         Make all methods in TypeManager static.
13986
13987         (InitCodeHelpers): Split the functionality from
13988         the InitCodeTypes function.
13989
13990         * driver.cs: Call InitCodeHelpers after we have populated the
13991         types. 
13992
13993         * cs-parser.jay (delegate_declaration): we did not used to compute
13994         the delegate name correctly for void delegates.
13995
13996 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13997
13998         * rootcontext.cs (RootContext): Init the interface_resolve_order
13999         and type_container_resolve_order always.
14000
14001         (ResolveCore, BootstrapCorlib_ResolveClass,
14002         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14003         compiler when compiling with --nostdlib
14004
14005         * class.cs (TypeContainer.DefineType): Check that our parent is
14006         not null.  This test is most important when we are bootstraping
14007         the core types.
14008
14009         * codegen.cs: Split out the symbol writing code.
14010
14011 2002-03-25  Martin Baulig  <martin@gnome.org>
14012
14013         * driver.cs (-g): Made -g an alias for --debug.
14014
14015 2002-03-24  Martin Baulig  <martin@gnome.org>
14016
14017         * codegen.cs (SymbolWriter): New public variable. Returns the
14018         current symbol writer.
14019         (CodeGen): Added `bool want_debugging_support' argument to the
14020          constructor. If true, tell the ModuleBuild that we want debugging
14021         support and ask it for the ISymbolWriter.
14022         (Save): If we have a symbol writer, call it's Close() method after
14023         saving the assembly.
14024
14025         * driver.c (--debug): New command line argument to create a
14026         debugger information file.
14027
14028         * location.cs (SymbolDocument): New public property. Returns an
14029         ISymbolDocumentWriter object for the current source file or null
14030         if we don't have a symbol writer.
14031
14032 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14033
14034         * driver.cs (LoadAssembly): Correctly return when all the paths
14035         have been tried and not before.
14036
14037         * statement.cs (Switch.Emit): return the actual coverage for this
14038         statement (returns/not-returns)
14039
14040         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14041         switch of the statement if we are the last switch section.  That
14042         kills two problems: try/catch problems (we used to emit an empty
14043         nop at the end) and switch statements where all branches would
14044         return. 
14045
14046 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14047
14048         * driver.cs: Add default assemblies (the equivalent to the
14049         Microsoft CSC.RSP file)
14050
14051         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14052         also update tokens_seen and set it to false.
14053
14054         * driver.cs: Implement --recurse for Mike.
14055
14056         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14057         correctly splitting out the paths.
14058
14059 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14060
14061         * interface.cs (Interface.PopulateProperty): Instead of using
14062         `parent' as the declaration space for the set parameters, use
14063         `this' 
14064
14065         * support.cs (InternalParameters): InternalParameters constructor
14066         takes a DeclSpace instead of a TypeContainer.
14067
14068         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14069         types are being initialized, load the address of it before calling
14070         the function.  
14071
14072         (New): Provide a mechanism to disable the generation of local
14073         value type temporaries when the caller will be providing us with
14074         an address to store it.
14075
14076         (ArrayCreation.EmitDynamicInitializers): Use it.
14077
14078 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14079
14080         * expression.cs (Invocation.EmitArguments): Only probe for array
14081         property if there is more than one argument.  Sorry about that.
14082
14083         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14084         empty param arrays.
14085
14086         * class.cs (Method.LabelParameters): Fix incorrect code path that
14087         prevented the `ParamArrayAttribute' from being applied to the
14088         params attribute.
14089
14090 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14091
14092         * support.cs (ReflectionParameters): Correctly compute whether the
14093         last argument is a params array.  Fixes the problem with
14094         string.Split ('a')
14095
14096         * typemanager.cs: Make the assemblies array always be non-null
14097         (empty, but non-null)
14098
14099         * tree.cs (RecordDecl): New function that abstracts the recording
14100         of names.  This reports error 101, and provides a pointer to the
14101         previous declaration.  Fixes a crash in the compiler.
14102
14103         * cs-parser.jay (constructor_declaration): Update to new grammar,
14104         and provide a constructor_body that can be empty.
14105
14106 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * driver.cs: Add support for --resources.
14109
14110         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14111         Make all types for the various array helper methods be integer.
14112
14113         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14114         CheckState to ConvCast.
14115
14116         (ConvCast): Now it takes a `checked' state argument, to avoid
14117         depending on the emit context for the conversion, and just using
14118         the resolve time setting.
14119
14120         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14121         instead of Invocation.EmitArguments.  We do not emit the original
14122         arguments, instead we emit those which have been converted to
14123         unsigned int expressions.
14124
14125         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14126
14127         * codegen.cs: ditto.
14128
14129         * expression.cs (LocalVariableReference): Drop the use of the
14130         Store function that depended on the variable index.
14131
14132         * statement.cs (VariableInfo): Drop the `Idx' property from this
14133         class, as this is not taking into account the indexes for
14134         temporaries tat we generate during the execution, getting the
14135         indexes wrong.
14136
14137         * class.cs: First emit class initializers, then call the parent
14138         constructor. 
14139
14140         * expression.cs (Binary): Fix opcode emision.
14141         (UnaryMutator.EmitCode): Support checked code generation
14142
14143         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14144         matches for events for both the Static and Instance scans,
14145         pointing to the same element.   Fix that.
14146
14147 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14148
14149         * rootcontext.cs (ResolveTree): Always set the
14150         interface_resolve_order, because nested interfaces will be calling
14151         into us.
14152
14153         * class.cs (GetInterfaceOrClass): Track the same resolution
14154         process used by TypeManager.LookupType.  This fixes the nested
14155         type lookups in class declarations (separate path from
14156         LookupType). 
14157
14158         (TypeContainer.DefineType): Also define nested interfaces.
14159         (TypeContainer.RegisterOrder): New public function used to
14160         register the order in which child interfaces need to be closed.
14161
14162         Nested interfaces need to be closed after their parents have been
14163         created. 
14164
14165         * interface.cs (InterfaceAttr): Put all the logic for computing
14166         the interface attribute here. 
14167
14168         (DefineInterface): Register our interface order with the
14169         RootContext or with the TypeContainer depending on the case.
14170
14171 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14172
14173         * cs-parser.jay: rework foreach statement to work with the new
14174         changes to the policy on SimpleNames.
14175
14176         * report.cs: support Stacktrace on warnings as well.
14177
14178         * makefile: drop --unsafe and /unsafe from the compile.
14179
14180 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14181
14182         * ecore.cs (StandardConversionExists): Modify to take an Expression
14183         as the first parameter. Ensure we do null -> reference type conversion
14184         checking.
14185
14186         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14187         temporary Expression objects.
14188
14189 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14190
14191         * interface.cs: workaround bug in method overloading resolution
14192         (there is already a bugzilla bug for it).
14193
14194 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14195
14196         We could also solve this problem by having a separate path for
14197         performing type lookups, instead of DoResolve, we could have a
14198         ResolveType entry point, and only participating pieces of the
14199         production (simplename, deref, array) would implement this. 
14200
14201         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14202         signal SimpleName to only resolve type names and not attempt to
14203         resolve anything else.
14204
14205         * expression.cs (Cast): Set the flag.
14206
14207         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14208
14209         * class.cs: Only report 108 if there is no `new' modifier.
14210
14211         * cs-parser.jay: rework foreach statement to work with the new
14212         changes to the policy on SimpleNames.
14213         
14214         * report.cs: support Stacktrace on warnings as well.
14215
14216         * makefile: drop --unsafe and /unsafe from the compile.
14217
14218 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14219
14220         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14221         lookups here, instead of doing that at parse time.  This means
14222         that our grammar will not introduce `LocalVariableReferences' as
14223         expressions at this point.  That solves the problem of code like
14224         this:
14225
14226         class X {
14227            static void Main ()
14228            { int X = 1;
14229             { X x = null }}}
14230
14231         This is only half the fix.  The full fix requires parameters to
14232         also be handled in this way.
14233
14234         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14235         makes the use more obvious of the DeclSpace.  The
14236         ec.TypeContainer.TypeBuilder is now only used to pull the
14237         TypeBuilder for it.
14238
14239         My theory is that I can get rid of the TypeBuilder completely from
14240         the EmitContext, and have typecasts where it is used (from
14241         DeclSpace to where it matters).  
14242
14243         The only pending problem is that the code that implements Aliases
14244         is on TypeContainer, and probably should go in DeclSpace.
14245
14246         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14247         lookups here, instead of doing that at parse time.  This means
14248         that our grammar will not introduce `LocalVariableReferences' as
14249         expressions at this point.  That solves the problem of code like
14250         this:
14251
14252         class X {
14253            static void Main ()
14254            { int X = 1;
14255             { X x = null }}}
14256
14257         This is only half the fix.  The full fix requires parameters to
14258         also be handled in this way.
14259
14260         * class.cs (Property.DefineMethod): When implementing an interface
14261         method, set newslot, when implementing an abstract method, do not
14262         set the flag (before we tried never setting it, or always setting
14263         it, which is the difference).
14264         (Indexer.DefineMethod): same.
14265         (Method.DefineMethod): same.
14266
14267         * ecore.cs: Only set the status used flag if we get back a Field.
14268
14269         * attribute.cs: Temporary hack, so Paolo can keep working.
14270
14271 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14272
14273         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14274         the unmanaged type in the case we have a MarshalAs attribute.
14275
14276         (Resolve): Handle the case when we are parsing the special MarshalAs
14277         attribute [we need to store the unmanaged type to use later]
14278
14279         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14280         MarshalAs Attribute.
14281
14282         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14283         on parameters and accordingly set the marshalling info.
14284
14285 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14286
14287         * class.cs: Optimizing slightly by removing redundant code after
14288         we switched to the `NoTypes' return value.
14289         (Property.DefineMethod): use NoTypes here too.
14290
14291         This fixes the bug I introduced in my last batch of changes.
14292
14293 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14294
14295         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14296
14297         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14298         Enums since those are types too. 
14299
14300         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14301
14302         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14303         thanks to a call during the lookup process.
14304
14305 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14306
14307         * statement.cs (Foreach): Lots of work to accomodate a particular
14308         kind of foreach statement that I had not kept in mind.  It is
14309         possible to have foreachs on classes that provide a GetEnumerator
14310         method that return objects that implement the "pattern" for using
14311         a foreach, there is no need to support GetEnumerator
14312         specifically. 
14313
14314         This is needed to compile nant.
14315
14316         * decl.cs: Only report 114 if the member is not `Finalize' and if
14317         the warning level is at least 2.
14318
14319         * class.cs: Moved the compare function from Method to
14320         MethodSignature. 
14321
14322         (MethodSignature.InheritableMemberSignatureCompare): Add new
14323         filter function that is used to extract inheritable methods from a
14324         class. 
14325
14326         (Method.Define): Use the new `inheritable_method_signature_filter'
14327         delegate
14328
14329         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14330         command. 
14331
14332 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14335
14336         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14337
14338         * expression.cs: Pass location information to
14339         ConvertImplicitStandard. 
14340
14341         * class.cs: Added debugging code to track return values from
14342         interfaces. 
14343
14344 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14345
14346         * expression.cs (Is.DoResolve): If either side of the `is' is an
14347         interface, do not flag the warning.
14348
14349         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14350         for interfaces
14351
14352         * report.cs: Allow for --fatal to be used with --probe.
14353
14354         * typemanager.cs (NoTypes): Move the definition for the empty Type
14355         array here. 
14356
14357         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14358         properties. 
14359         (TypeContainer.DefineProxy): New function used to proxy to parent
14360         implementations when implementing interfaces.
14361         (TypeContainer.ParentImplements): used to lookup if our parent
14362         implements a public function that is required by an interface.
14363         (TypeContainer.VerifyPendingMethods): Hook this up.
14364
14365         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14366         `modules' and `assemblies' arraylists into arrays.  We only grow
14367         these are the very early start up of the program, so this improves
14368         the speedof LookupType (nicely measured).
14369
14370         * expression.cs (MakeByteBlob): Replaced unsafe code with
14371         BitConverter, as suggested by Paolo.
14372
14373         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14374         folding of string concatenation, but if either side is a string,
14375         and the other is not, then return null, and let the runtime use
14376         the concatenation on the string plus the object (using
14377         `Object.ToString'). 
14378
14379 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14380
14381         Constant Folding has been implemented now.
14382
14383         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14384         the error instead on types that are not supported in one's
14385         complement. 
14386
14387         * constant.cs (Constant and all children): New set of functions to
14388         perform implict and explicit conversions.
14389
14390         * ecore.cs (EnumConstant): Implement the new functions to perform
14391         conversion by proxying to the child expression.
14392
14393         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14394         own separate setting that can not be turned off from the command
14395         line using --unchecked or --checked and is only controlled using
14396         the checked/unchecked statements and expressions.  This setting is
14397         used by the constant folder to flag errors.
14398
14399         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14400         ConstantCheckState as well.   
14401
14402         During Resolve, they also have to flag the state, because the
14403         constant folder runs completely in the Resolve phase.
14404
14405         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14406         well.
14407
14408 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14409
14410         * cfold.cs: New file, this file contains the constant folder.
14411
14412         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14413         argument to track whether we are using the resulting address to
14414         load or store a value and provide better error messages. 
14415
14416         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14417         new AddressOf arguments.
14418
14419         * statement.cs (Foreach.EmitCollectionForeach): Update
14420
14421         * expression.cs (Argument.Emit): Call AddressOf with proper
14422         arguments to track usage.
14423
14424         (New.DoEmit): Call AddressOf with new arguments.
14425
14426         (Unary.Emit): Adjust AddressOf call.
14427
14428 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14429
14430         * cs-parser.jay (member_access): Change the case for pre-defined types
14431         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14432         this suggestion.
14433
14434         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14435         a method body.
14436
14437         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14438         essentially like methods and apply attributes like MethodImplOptions to them too.
14439
14440         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14441         not being null.
14442
14443         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14444         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14445         is the DeclSpace.
14446
14447         * Update code everywhere accordingly.
14448
14449         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14450
14451         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14452
14453 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14454
14455         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14456         try performing lookups against those instead of jumping straight into using
14457         the 'using' clauses.
14458
14459         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14460
14461         (LookupType): Perform lookups in implicit parents too.
14462
14463         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14464         sequence as RootContext.LookupType. 
14465
14466         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14467         the various cases of namespace lookups into this method.
14468
14469 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14470
14471         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14472         in positional arguments)
14473
14474         * class.cs (Operator): Update the AllowedModifiers to contain
14475         extern. 
14476
14477         * cs-parser.jay: Update operator declaration to allow for the
14478         operator body to be empty.
14479
14480         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14481         values. 
14482
14483 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14484
14485         * class.cs (Method.Emit): Label parameters.
14486
14487         * driver.cs: Return 1 or 0 as the program exit code.
14488
14489 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14490
14491         * expression.cs: Special case the `null' object when trying to
14492         auto-compute the type, as anything can be explicitly converted to
14493         that. 
14494
14495         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14496         spotting this Paolo.
14497
14498         (Expression.ImplicitNumericConversion): Perform comparissions of
14499         the type using the underlying type in the case of an enumeration
14500         rather than using the enumeration type for the compare.
14501
14502         Cope with the underlying == type case, which is not possible to
14503         catch before. 
14504
14505         (Expression.ConvertNumericExplicit): Perform comparissions of
14506         the type using the underlying type in the case of an enumeration
14507         rather than using the enumeration type for the compare.
14508
14509         * driver.cs: If the user does not supply an extension, assume .exe
14510
14511         * cs-parser.jay (if_statement): Rewrote so that we can track the
14512         location for the if statement.
14513
14514         * expression.cs (Binary.ConstantFold): Only concat strings when
14515         the operation is "+", not everything ;-)
14516
14517         * statement.cs (Statement.EmitBoolExpression): Take a location
14518         argument. 
14519         (If, While, Do): Track location.
14520
14521         * expression.cs (Binary.ResolveOperator): In the object + string
14522         case, I was missing a call to ConvertImplicit
14523
14524 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14525
14526         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14527         Location arguments. Ensure we use RootContext.LookupType to do our work
14528         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14529
14530         * interface.cs (PopulateMethod): Handle the type of the parameter being
14531         null gracefully.
14532
14533         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14534         have a params method with no fixed arguments and a call is made with no
14535         arguments.
14536
14537 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14538
14539         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14540         the verbatim-string-literal
14541
14542         * support.cs (InternalParameters.ParameterModifier): handle null
14543         fixed parameters.
14544         (InternalParameters.ParameterType): ditto.
14545
14546         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14547         duplicating the name of the variable parameter.
14548         (GetParameterByName): Fix bug where we were not looking up array
14549         paramters if they were the only present (thanks Paolo!).
14550         (GetParameterInfo): We only have an empty set of types if both
14551         fixed and array are set to null.
14552         (GetParameterInfo-idx): Handle FixedParameter == null
14553
14554         * cs-parser.jay: Handle the case where there is no catch
14555         statements (missing null test).
14556
14557 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * driver.cs (MainDriver): Be conservative on our command line
14560         handling.
14561
14562         Catch DirectoryNotFoundException when calling GetFiles.
14563
14564         (SplitPathAndPattern): Used to split the input specification into
14565         a path and a pattern that we can feed to Directory.GetFiles.
14566
14567 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14568
14569         * statement.cs (Fixed): Implement the last case of the Fixed
14570         statement (string handling).
14571
14572         * expression.cs (StringPtr): New class used to return a char * to
14573         a string;  Used by the Fixed statement.
14574
14575         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14576
14577         * expression.cs (Binary.ResolveOperator): Remove redundant
14578         MemberLookup pn parent type.
14579         Optimize union call, we do not need a union if the types are the same.
14580         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14581         type.
14582
14583         Specialize the use of MemberLookup everywhere, instead of using
14584         the default settings. 
14585
14586         (StackAlloc): Implement stackalloc keyword.
14587
14588         * cs-parser.jay: Add rule to parse stackalloc.
14589
14590         * driver.cs: Handle /h, /help, /?
14591
14592         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14593         before we supported unsafe code.
14594
14595         * makefile: add --unsafe to the self compilation of mcs.
14596
14597 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14598
14599         * expression.cs (PointerArithmetic): New class that is used to
14600         perform pointer arithmetic.
14601         (Binary.Resolve): Handle pointer arithmetic
14602         Handle pointer comparission.
14603         (ArrayPtr): Utility expression class that is used to take the
14604         address of an array.
14605
14606         (ElementAccess): Implement array access for pointers
14607
14608         * statement.cs (Fixed): Implement fixed statement for arrays, we
14609         are missing one more case before we are done.
14610
14611         * expression.cs (Indirection): Implement EmitAssign and set the
14612         ExprClass to Variable.  This allows pointer dereferences to be
14613         treated as variables, and to have values assigned to them.
14614
14615         * ecore.cs (Expression.StoreFromPtr): New utility function to
14616         store values dereferencing.
14617
14618 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14619
14620         * expression.cs (Binary.ResolveOperator): Ensure that we are
14621         not trying to operate on a void type - this fixes the reported
14622         bug.
14623
14624         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14625         the parent implementation is sealed.
14626
14627         * ../errors/cs0239.cs : Add.
14628
14629         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14630
14631         * typemanager.cs (unverifiable_code_type): Corresponds to 
14632         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14633         which have unsafe code in them.
14634
14635         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14636         unsafe context.
14637
14638 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14639
14640         * cs-tokenizer.cs: Add support for @"litreal strings"
14641
14642         Make tokenizer accept pre-processor directives
14643         on any column (remove the old C-like limitation). 
14644
14645         * rootcontext.cs (EmitCode): Emit any global attributes.
14646         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14647
14648         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14649
14650         * cs-parser.jay: Add support for global attributes.  
14651
14652 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14653
14654         * expression.cs (Indirection): New helper class.  Unary will
14655         create Indirection classes to be able to implement the
14656         IMemoryLocation interface on it.
14657
14658 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14659
14660         * cs-parser.jay (fixed_statement): reference the right statement.
14661
14662         * statement.cs (Fixed.Emit): Finish implementing the fixed
14663         statement for the &x case.
14664
14665 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14666
14667         * class.cs (Property.Define, Method.Define): Remove newslot when
14668         `implementing'.  
14669
14670         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14671         wrong.  NewSlot should only be used if the `new' keyword is present.
14672
14673         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14674         locating our system dir.  Sorry about this.
14675
14676 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14677
14678         * driver.cs (GetSystemDir): Compute correctly the location of our
14679         system assemblies.  I was using the compiler directory instead of
14680         the library directory.
14681
14682 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14683
14684         * expression.cs (BetterFunction): Put back in what Miguel commented out
14685         since it is the correct fix. The problem is elsewhere ;-)
14686
14687         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14688         parameters of the parms method are themselves compatible or not !
14689
14690         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14691         to check that a class implements an interface before saying that an implicit
14692         conversion was allowed. Use ImplementsInterface to do the checking.
14693
14694 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14695
14696         * class.cs (Method.Define): Track whether we are an explicit
14697         implementation or not.  And only call DefineMethodOverride if we
14698         are an explicit implementation.
14699
14700         (Property.DefineMethod): Ditto.
14701
14702 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14703
14704         * expression.cs (BetterFunction): Catch hideous bug which was
14705          preventing us from detecting ambiguous calls due to implicit casts i.e
14706         cs0121.
14707
14708 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14709
14710         * support.cs (Pair): Remove un-needed method.  I figured why I was
14711         getting the error in cs-parser.jay, the variable in a foreach loop
14712         is readonly, and the compiler does not really treat this as a variable.
14713
14714         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14715         instead of EQUALS in grammar.  
14716
14717         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14718
14719         * expression.cs (Unary.DoResolve): Check whether the argument is
14720         managed or not.
14721
14722 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * support.cs: Api for Pair to set a value.  Despite the fact that
14725         the variables are public the MS C# compiler refuses to compile
14726         code that accesses the field if the variable is part of a foreach
14727         statement. 
14728
14729         * statement.cs (Fixed): Begin implementation of the fixed
14730         statement.
14731
14732         (Block.AddVariable): Return the VariableInfo on success and null
14733         on failure instead of true/false. 
14734
14735         * cs-parser.jay (foreach): Catch errors on variables already
14736         defined (we were ignoring this value before) and properly unwind
14737         the block hierarchy
14738
14739         (fixed_statement): grammar for the fixed statement.
14740
14741 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14742
14743         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14744         pointer types to be incretemented.
14745
14746         (SizeOf): Implement.
14747
14748         * cs-parser.jay (pointer_member_access): Implement
14749         expr->IDENTIFIER production.
14750
14751         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14752         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14753         on safe contexts.
14754
14755         (Unary): Implement indirection.
14756
14757         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14758         use in non-unsafe context).
14759
14760         (SimpleName.DoResolve): Check for pointers in field access on safe
14761         contexts. 
14762
14763         (Expression.LoadFromPtr): Factor the load-indirect code in this
14764         function.  This was duplicated in UnboxCast and ParameterReference
14765
14766 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14767
14768         * expression.cs (ComposedCast): report an error if a pointer cast
14769         is used in a safe region.
14770
14771         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14772         pointer type casts in unsafe context.
14773
14774         * codegen.cs (EmitContext): Set up IsUnsafe.
14775
14776         * cs-parser.jay (non_expression_type): Add productions for pointer
14777         casts. 
14778
14779         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14780         code.  We should not use force into static mode if the method is
14781         not virtual.  Fixes bug in MIS
14782
14783         * statement.cs (Do.Emit, While.Emit, For.Emit,
14784         Statement.EmitBoolExpression): Add support to Do and While to
14785         propagate infinite loop as `I do return' semantics.
14786
14787         Improve the For case to also test for boolean constants.
14788
14789         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14790         to the list of attributes we can add.
14791
14792         Remove `EmitContext' argument.
14793
14794         * class.cs (Method.Define): Apply parameter attributes.
14795         (Constructor.Define): Apply parameter attributes.
14796         (MethodCore.LabelParameters): Move here the core of labeling
14797         parameters. 
14798
14799         * support.cs (ReflectionParameters.ParameterModifier,
14800         InternalParameters.ParameterModifier): Use IsByRef on the type and
14801         only return the OUT bit for these parameters instead of in/out/ref
14802         flags.
14803
14804         This is because I miss-understood things.  The ParameterInfo.IsIn
14805         and IsOut represent whether the parameter has the [In] and [Out]
14806         attributes set.  
14807
14808 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14809
14810         * ecore.cs (FieldExpr.Emit): Release temporaries.
14811
14812         * assign.cs (LocalTemporary.Release): new function.
14813
14814         * codegen.cs (EmitContext.GetTemporaryStorage,
14815         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14816         temporary storage.  Now we can "put back" localbuilders when we
14817         are done with them
14818
14819 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14820
14821         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14822         need to make a copy of the variable to generate verifiable code.
14823
14824 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14825
14826         * driver.cs: Compute dynamically the system directory.
14827
14828         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14829         Slower, but more generally useful.  Used by the abstract
14830         registering implementation. 
14831
14832         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14833         the rules for the special rule on Type/instances.  First check if
14834         we have the same name, and if so, try that special static path
14835         rather than the instance path.
14836
14837 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14838
14839         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14840         for, while and if.
14841
14842         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14843         Enum, ValueType, Delegate or Array for non-corlib compiles.
14844
14845         * cs-tokenizer.cs: Catch long identifiers (645)
14846
14847         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14848         piece of code.
14849
14850         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14851         fix, we were returning too early, so we were not registering
14852         pending methods from abstract classes.
14853
14854         Do not register pending methods if the class is abstract.
14855
14856         * expression.cs (Conditional.DoResolve): Report circular implicit
14857         conversions when we neecd to compute it for conditional
14858         expressions. 
14859
14860         (Is.DoResolve): If the expression is always of the provided type,
14861         flag warning 183.  If the expression can not ever be of the
14862         provided type flag warning 184.
14863
14864         * class.cs: Catch 169 as well.
14865
14866         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14867         read. 
14868
14869 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14870
14871         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14872
14873 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14874
14875         * interface.cs: (PopulateMethod): Check for pointers being defined
14876         only if the unsafe context is active.
14877         (PopulateProperty): ditto.
14878         (PopulateIndexer): ditto.
14879
14880         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14881         specified.  If pointers are present, make sure that they are
14882         present in an unsafe context.
14883         (Constructor, Constructor.Define): ditto.
14884         (Field, Field.Define): ditto.
14885         (Property, Property.Define): ditto.
14886         (Event, Event.Define): ditto.
14887
14888         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14889         hashtable if there are classes or structs defined.
14890
14891         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14892         code, as the constant resolution moved.
14893
14894         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14895         the metadata, so we can flag error 133. 
14896
14897         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14898         pointer is being declared in an unsafe context.
14899
14900 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14901
14902         * modifiers.cs (Modifiers.Check): Require a Location argument.
14903         Report error 227 for Unsafe use.
14904
14905         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14906
14907         * statement.cs (For.Emit): If the test is null, then report that
14908         we do `return', as we wont reach anything afterwards.
14909
14910         (Switch.SwitchGoverningType): Track the expression that matched
14911         the conversion.
14912
14913         * driver.cs: Allow negative numbers as an error code to flag.
14914
14915         * cs-parser.jay: Handle 1551.
14916
14917         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14918
14919 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14920
14921         * cs-parser.jay: Report 1518 (type declaration can only contain
14922         class, struct, interface, enum or delegate)
14923
14924         (switch_label): Report 1523 (keywords `case' or `default' must
14925         preced code)
14926
14927         (opt_switch_sections): Report 1522 (empty switch)
14928
14929         * driver.cs: Report 1515 (response file specified multiple times)
14930         Report 1516 (Source file specified multiple times).
14931
14932         * expression.cs (Argument.Resolve): Signal 1510
14933
14934         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14935         access not allowed in static code)
14936
14937 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14938
14939         * typemanager.cs (IsPointerType): Utility method which we are going
14940         to need a lot.
14941
14942         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14943         the object type, so we take care of that.
14944
14945         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14946
14947         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14948         added to non-params parameters :-)
14949
14950         * typemanager.cs (CSharpName): Include 'void' type too. 
14951
14952         (void_ptr_type): Include in the set of core types.
14953
14954         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14955         duplicating code.
14956
14957         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14958         an unsafe context.
14959
14960         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14961         completely forgotten about it.
14962
14963 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14964
14965         * cs-parser.jay (pointer_type): Add. This begins our implementation
14966         of parsing rules for unsafe code.
14967
14968         (unsafe_statement): Implement.
14969
14970         (embedded_statement): Modify to include the above.
14971
14972         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14973
14974         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14975         if the current context is an unsafe one.
14976
14977         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14978         are handled differently, we need separate rules for them.
14979
14980         (local_variable_declaration): Update to use local_variable_pointer_type
14981         to allow variable declarations of unmanaged pointer types.
14982
14983         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14984         in unsafe contexts.
14985
14986         * ../errors/cs0214.cs : Add.
14987
14988 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14989
14990         * makefile: remove 'response' file when cleaning.
14991
14992 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14993
14994         * cs-parser.jay: Report 1524.
14995
14996 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14997
14998         * typemanager.cs (RegisterMethod): drop checking if we have
14999         registered this from here
15000
15001 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * class.cs (Method.EmitDestructor): Implement calling our base
15004         destructor. 
15005
15006         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15007         value of InFinally.
15008
15009         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15010         this routine and will wrap the call in a try/catch block.  Deal
15011         with the case.
15012
15013 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15014
15015         * ecore.cs (Expression.MemberLookup): instead of taking a
15016         parameter `same_type' that was used to tell whether we could
15017         access private members we compute our containing type from the
15018         EmitContext.
15019
15020         (FieldExpr): Added partial support for volatile fields.  This does
15021         not work for volatile fields exposed from assemblies, as I can not
15022         figure out how to extract the modreq from it.
15023
15024         Updated all the source files to use this.
15025
15026         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15027         because it is referenced by MemberLookup very often. 
15028
15029 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15030
15031         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15032         TypeBuilder.GetCustomAttributes to retrieve what we need.
15033
15034         Get rid of redundant default_member_attr_type as this is the same as
15035         default_member_type which already exists.
15036
15037         * interface.cs, attribute.cs : Update accordingly.
15038
15039 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15040
15041         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15042         work for TYpeBuilders though.  Ravi, can you please fix this?
15043
15044         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15045
15046         * expression.cs (Argument.Emit): Handle the case of ref objects
15047         being passed to ref functions;  
15048
15049         (ParameterReference.EmitLoad): Loads the content of the pointer
15050         without dereferencing.
15051
15052 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15053
15054         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15055
15056 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15057
15058         * class.cs (Indexer.DefineMethod): Incorporate the interface
15059         type in the name of the method if we are doing explicit interface
15060         implementation.
15061
15062         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15063
15064         (BetterConversion): Fix extremely trivial bug where we were referring to
15065         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15066         again !
15067
15068         * ../errors/bug16.cs : Add although we have fixed it.
15069
15070 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15071
15072         * expression.cs (BaseIndexer): Begin implementation.
15073
15074         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15075
15076         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15077         production directly to remove a shift/reduce, and implement
15078         explicit interface implementation.
15079
15080         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15081         after a floating point suffix.
15082
15083         * expression.cs (DoNumericPromotions): Improved the conversion for
15084         uint/uint.  If we have a constant, we avoid doing a typecast to a
15085         larger type.
15086
15087         * class.cs (Indexer): Implement explicit interface implementation
15088         for indexers.
15089
15090 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15091
15092         * class.cs: make the default instance constructor public and hidebysig.
15093
15094 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15095
15096         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15097         so we can call it from elsewhere.
15098
15099         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15100         we emit it internally if the class has a defined indexer; otherwise the user
15101         emits it by decorating the class definition with the DefaultMemberAttribute.
15102
15103         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15104         attribute is not used on a type which defines an indexer.
15105
15106         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15107         character when we skip whitespace.
15108
15109         * ../errors/cs0646.cs : Add.
15110
15111 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15112
15113         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15114         again. 
15115
15116         * makefile: Add practical target `mcs3.exe' which builds the third
15117         generation compiler. 
15118
15119         * expression.cs (New): Fix structures constructor calling.
15120
15121         * class.cs (Property, Method, Indexer): Emit Final flag on the
15122         method if we are an interface implementation and we are not
15123         abstract. 
15124
15125         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15126         whether this property is referencing a `base' method.
15127
15128         * expression.cs (Invocation.EmitCall): take an extra argument:
15129         is_base, this is used to determine whether the `call' or
15130         `callvirt' opcode should be used.
15131
15132
15133         * delegate.cs: update EmitCall.
15134
15135         * class.cs (Method.Define): Set NewSlot for the cases where we are
15136         not implementing an interface method.
15137
15138         (Property.Define): ditto.
15139
15140 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15141
15142         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15143         'r'.  Allows mcs to parse itself fully.
15144
15145 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15146
15147         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15148         of the number of initializers that require the InitializeArray method.
15149
15150         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15151         update the above field where necessary.
15152
15153         (MakeByteBlob): Update accordingly.
15154
15155         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15156         greater than 2.
15157
15158         (EmitDynamicInitializers): Update in accordance with the new optimization.
15159
15160         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15161         same OpCode applies.
15162
15163         * cs-parser.jay : Fix some glaring errors I introduced.
15164
15165 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15166
15167         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15168         so that we can check for name clashes there too.
15169
15170         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15171         for interface indexers.
15172
15173         * interfaces.cs (Define): Emit the default member attribute.
15174
15175         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15176         variable was being referred to while setting the value ;-)
15177
15178 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15179
15180         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15181         byte-by-byte information when we know the data is zero.
15182
15183         Make the block always a multiple of 4, because
15184         DefineInitializedData has a bug.
15185
15186         * assign.cs: Fix, we should assign from the temporary, not from
15187         the source. 
15188
15189         * expression.cs (MakeByteBlob): Fix my incorrect code.
15190
15191 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * typemanager.cs (EnumToUnderlying): This function is used to get
15194         the underlying type from an enumeration, because it does not
15195         always work. 
15196
15197         * constant.cs: Use the I4_S form for values between -128 and 127.
15198
15199         * statement.cs (Block.LookupLabel): Looks up a label.
15200         (Block): Drop support for labeled blocks.
15201
15202         (LabeledStatement): New kind of statement that represents a label
15203         only.
15204
15205         (Goto): Finally implement this bad boy.
15206
15207         * cs-parser.jay: Update to reflect new mechanism to implement
15208         labels.
15209
15210 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15211
15212         * codegen.cs (EmitContext.This): a codegen property that keeps the
15213         a single instance of this instead of creating many different this
15214         instances. 
15215
15216         * delegate.cs (Delegate.DoResolve): Update to use the property;
15217
15218         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15219
15220         * expression.cs (BaseAccess.DoResolve): Ditto.
15221
15222 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15223
15224         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15225         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15226
15227         (InitCoreTypes): Update accordingly.
15228
15229         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15230         so we can quickly store the state.
15231
15232         (ApplyAttributes): Set the correct implementation flags
15233         for InternalCall methods.
15234
15235 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15236
15237         * expression.cs (EmitCall): if a method is not virtual, then do
15238         not use callvirt on it.
15239
15240         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15241         user defined stuff) requires the use of stobj, which takes an
15242         address on the stack instead of an array and an index.  So emit
15243         the Ldelema operation for it.
15244
15245         (EmitStoreOpcode): Use stobj for valuetypes.
15246
15247         (UnaryMutator.EmitCode): Use the right 1 value depending on
15248         whether we are dealing with int64/uint64, float or doubles.
15249
15250         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15251         constructors that I implemented last night.
15252
15253         (Constructor.IsDefault): Fix to work properly for static
15254         constructors.
15255
15256         * cs-parser.jay (CheckDef): report method signature errors.
15257         Update error number 103 to be 132.
15258
15259         * decl.cs: New AdditionResult enumeration value: MethodExists.
15260         Although we do this check for methods later on in the semantic
15261         analysis, catching repeated default constructors is so easy that
15262         we catch these here. 
15263
15264         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15265         promotions code.
15266
15267         (ParameterReference.EmitAssign, Emit): handle
15268         bools as bytes.
15269
15270         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15271         (ArrayAccess.EmitStoreOpcode): ditto.
15272
15273         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15274
15275         * expression.cs (MakeByteBlob): Complete all the missing types
15276         (uint, short, ushort, byte, sbyte)
15277
15278         * class.cs: Only init instance field initializers on instance
15279         constructors. 
15280
15281         Rename `constructors' to instance_constructors. 
15282
15283         (TypeContainer.AddConstructor): Only add constructors to the list
15284         if it is not static.
15285
15286         Make sure that we handle default_static_constructor independently
15287         everywhere where we handle instance_constructors
15288
15289 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15290
15291         * class.cs: Do not lookup or create a base initializer for a
15292         static constructor.
15293
15294         (ConstructorInitializer.Resolve): use the proper type to lookup
15295         for constructors.
15296
15297         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15298
15299         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15300         in DeclSpace. 
15301
15302         * decl.cs: CloseType is now an virtual method, the default
15303         implementation just closes this type.
15304
15305 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15306
15307         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15308         to PreserveSig by default. Also emit HideBySig on such methods.
15309
15310         Basically, set the defaults to standard values.
15311
15312         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15313         argument, if candidate is better, it can't be worse than the best !
15314
15315         (Invocation): Re-write bits to differentiate between methods being
15316         applicable in their expanded form and their normal form - for params
15317         methods of course.
15318
15319         Get rid of use_standard everywhere as only standard conversions are allowed
15320         in overload resolution. 
15321
15322         More spec conformance.
15323
15324 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15325
15326         * driver.cs: Add --timestamp, to see where the compiler spends
15327         most of its time.
15328
15329         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15330         `this' in static code.
15331
15332         (SimpleName.DoResolve): Implement in terms of a helper function
15333         that allows static-references to be passed upstream to
15334         MemberAccess.
15335
15336         (Expression.ResolveWithSimpleName): Resolve specially simple
15337         names when called by MemberAccess to implement the special
15338         semantics. 
15339
15340         (Expression.ImplicitReferenceConversion): Handle conversions from
15341         Null to reference types before others, as Null's type is
15342         System.Object. 
15343
15344         * expression.cs (Invocation.EmitCall): Handle the special case of
15345         calling methods declared on a reference type from a ValueType
15346         (Base classes System.Object and System.Enum)
15347
15348         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15349         the left hand side is a TypeExpr, not on every enumeration. 
15350
15351         (Binary.Resolve): If types are reference types, then do a cast to
15352         object on operators != and == of both arguments.
15353
15354         * typemanager.cs (FindMembers): Extract instance and static
15355         members if requested.
15356
15357         * interface.cs (PopulateProperty): Use void_type instead of null
15358         as the return type for the setter method.
15359
15360         (PopulateIndexer): ditto.
15361
15362 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15363
15364         * support.cs (ReflectionParameters): Fix minor bug where we
15365         were examining the wrong parameter for the ParamArray attribute.
15366
15367         Cope with requests for the type of the parameter at position
15368         greater than the params parameter's. We now return the element
15369         type of the params array as that makes more sense.
15370
15371         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15372         accordingly as we no longer have to extract the element type
15373         ourselves.
15374
15375         (Invocation.OverloadResolve): Update.
15376
15377 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15378
15379         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15380         against IEnumerator, test whether the return value is a descendant
15381         of the IEnumerator interface.
15382
15383         * class.cs (Indexer.Define): Use an auxiliary method to implement
15384         the other bits of the method definition.  Begin support for
15385         explicit interface implementation.
15386
15387         (Property.DefineMethod): Use TypeManager.void_type instead of null
15388         for an empty return value.
15389
15390 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15393         dealing with a FieldExpr which is composed of a FieldBuilder, in
15394         the code path we did extract the constant, but we should have
15395         obtained the underlying value to be able to cast it (otherwise we
15396         end up in an infinite loop, this is what Ravi was running into).
15397
15398         (ArrayCreation.UpdateIndices): Arrays might be empty.
15399
15400         (MemberAccess.ResolveMemberAccess): Add support for section
15401         14.5.4.1 that deals with the special case of E.I when E is a type
15402         and something else, that I can be a reference to a static member.
15403
15404         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15405         handle a particular array type to create byte blobs, it is just
15406         something we dont generate byteblobs for.
15407
15408         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15409         arguments. 
15410
15411         * location.cs (Push): remove the key from the hashtable that we
15412         are about to add.   This happens for empty files.
15413
15414         * driver.cs: Dispose files after we have parsed them.
15415
15416         (tokenize): new function that only runs the tokenizer on its
15417         input, for speed testing.
15418
15419 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15420
15421         * class.cs (Event.Define): Define the private field only if there
15422         are no accessors defined.
15423
15424         * expression.cs (ResolveMemberAccess): If there is no associated
15425         field with the event, that means we have an event defined with its
15426         own accessors and we should flag error cs0070 since transforming
15427         ourselves into a field is not valid in that case.
15428
15429         * ecore.cs (SimpleName.DoResolve): Same as above.
15430
15431         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15432         and charset to sane values.
15433
15434 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15435
15436         * assign.cs (DoResolve): Perform check on events only if they 
15437         are being accessed outside the declaring type.
15438
15439         * cs-parser.jay (event_declarations): Update rules to correctly
15440         set the type of the implicit parameter etc.
15441
15442         (add_accessor, remove_accessor): Set current local parameters.
15443
15444         * expression.cs (Binary): For delegate addition and subtraction,
15445         cast the return value from the method into the appropriate delegate
15446         type.
15447
15448 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15449
15450         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15451         of these as the workaround is unnecessary.
15452
15453         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15454         delegate data - none of that is needed at all.
15455
15456         Re-write bits to extract the instance expression and the delegate method
15457         correctly.
15458
15459         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15460         on delegates too.
15461
15462         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15463         of attaching attributes instead of duplicating code everywhere.
15464
15465         * everywhere : Update code to do attribute emission using the above method.
15466
15467 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * expression.cs (IsParamsMethodApplicable): if there are not
15470         parameters, return immediately.
15471
15472         * ecore.cs: The 0 literal can be implicity converted to an enum
15473         type. 
15474
15475         (SimpleName.DoResolve): First lookup the type, then lookup the
15476         members. 
15477
15478         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15479         want to get its address.  If the InstanceExpression is not
15480         addressable, store the result in a temporary variable, then get
15481         the address of it.
15482
15483         * codegen.cs: Only display 219 errors on warning level or above. 
15484
15485         * expression.cs (ArrayAccess): Make it implement the
15486         IMemoryLocation interface.
15487
15488         (Binary.DoResolve): handle the operator == (object a, object b)
15489         and operator != (object a, object b) without incurring into a
15490         BoxedCast (because 5 != o should never be performed).
15491
15492         Handle binary enumerator operators.
15493
15494         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15495         value type, otherwise use Ldelem_ref.
15496
15497         Use precomputed names;
15498
15499         (AddressOf): Implement address of
15500
15501         * cs-parser.jay (labeled_statement): Fix recursive block
15502         addition by reworking the production.
15503
15504         * expression.cs (New.DoEmit): New has a special case:
15505                 
15506                  If we are dealing with a ValueType, we have a few
15507                  situations to deal with:
15508                 
15509                     * The target of New is a ValueType variable, that is
15510                       easy, we just pass this as the variable reference
15511                 
15512                     * The target of New is being passed as an argument,
15513                       to a boxing operation or a function that takes a
15514                       ValueType.
15515                 
15516                       In this case, we need to create a temporary variable
15517                       that is the argument of New.
15518
15519
15520 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15521
15522         * rootcontext.cs (LookupType): Check that current_type is not null before
15523         going about looking at nested types.
15524
15525         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15526         not implement the IAssignMethod interface any more.
15527
15528         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15529         where we tranform them into FieldExprs if they are being resolved from within
15530         the declaring type.
15531
15532         * ecore.cs (SimpleName.DoResolve): Do the same here.
15533
15534         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15535
15536         * ../errors/bug10.cs : Add.
15537
15538         * ../errors/cs0070.cs : Add.
15539
15540         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15541
15542         * assign.cs : Get rid of EventIsLocal everywhere.
15543
15544 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * ecore.cs (ConvertIntLiteral): finished the implementation.
15547
15548         * statement.cs (SwitchLabel): Convert the value we are using as a
15549         key before looking up the table.
15550
15551 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15552
15553         * codegen.cs (EmitTopBlock): Require a Location argument now.
15554
15555         * cs-parser.jay (constructor_declarator): We need to setup
15556         current_local_parameters before we parse the
15557         opt_constructor_initializer, to allow the variables to be bound
15558         to the constructor arguments.
15559
15560         * rootcontext.cs (LookupType): First lookup nested classes in our
15561         class and our parents before we go looking outside our class.
15562
15563         * expression.cs (ConstantFold): Extract/debox the values at the
15564         beginnning. 
15565
15566         * rootcontext.cs (EmitCode): Resolve the constants first before we
15567         resolve the types.  This is not really needed, but it helps debugging.
15568
15569         * statement.cs: report location.
15570
15571         * cs-parser.jay: pass location to throw statement.
15572
15573         * driver.cs: Small bug fix.
15574
15575         * report.cs: Updated format to be 4-zero filled digits.
15576
15577 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15578
15579         * expression.cs (CheckIndices): Fix minor bug where the wrong
15580         variable was being referred to ;-)
15581
15582         (DoEmit): Do not call EmitStaticInitializers when the 
15583         underlying type is System.Object.
15584
15585 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15586
15587         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15588         and do the usual workaround for SRE.
15589
15590         * class.cs (MyEventBuilder.EventType): New member to get at the type
15591         of the event, quickly.
15592
15593         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15594
15595         * assign.cs (Assign.DoResolve): Handle the case when the target
15596         is an EventExpr and perform the necessary checks.
15597
15598         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15599         interface.
15600
15601         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15602
15603         (EventExpr): Set the type in the constructor itself since we 
15604         are meant to be born fully resolved.
15605
15606         (EventExpr.Define): Revert code I wrote earlier.
15607                 
15608         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15609         instance expression is null. The instance expression is a This in that case
15610         or a null, depending on whether it is a static method or not.
15611
15612         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15613         refers to more than one method.
15614
15615         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15616         and accordingly flag errors.
15617
15618 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15619
15620         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15621
15622 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15623
15624         * location.cs (ToString): Provide useful rutine.
15625
15626 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15629         objects, return the actual integral boxed.
15630
15631         * statement.cs (SwitchLabel): define an ILLabel for each
15632         SwitchLabel. 
15633
15634         (Switch.CheckSwitch): If the value is a Literal, extract
15635         the underlying literal.
15636
15637         Also in the unused hashtable we had, add the SwitchLabel so we can
15638         quickly look this value up.
15639
15640         * constant.cs: Implement a bunch of new constants.  Rewrite
15641         Literal based on this.  Made changes everywhere to adapt to this.
15642
15643         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15644         dereferencing array only once, and also copes with enumrations.
15645
15646         bytes are two bytes wide, not one.
15647
15648         (Cast): Perform constant conversions.
15649
15650         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15651         wrappers to the literals here.
15652
15653         * expression.cs (DoNumericPromotions): long literals can converted
15654         to ulong implicity (this is taken care of elsewhere, but I was
15655         missing this spot).
15656
15657         * ecore.cs (Expression.Literalize): Make the return type Literal,
15658         to improve type checking.
15659
15660         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15661
15662 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15663
15664         * literal.cs: Revert code from ravi that checked the bounds.  The
15665         bounds are sane by the definition of the type itself. 
15666
15667         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15668         need to actually look up in our parent hierarchy for interfaces
15669         implemented. 
15670
15671         * const.cs: Use the underlying type for enumerations
15672
15673         * delegate.cs: Compute the basename for the delegate creation,
15674         that should fix the delegate test case, and restore the correct
15675         Type Lookup semantics in rootcontext
15676
15677         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15678         referencing a nested type with the Reflection API is using the "+"
15679         sign. 
15680
15681         * cs-parser.jay: Do not require EOF token at the end.
15682
15683 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15684
15685         * rootcontext.cs (LookupType): Concatenate type names with
15686         a '.' instead of a '+' The test suite passes again.
15687
15688         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15689         field of the enumeration.
15690
15691         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15692         the case when the member is an EventExpr.
15693
15694         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15695         static has an associated instance expression.
15696
15697         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15698
15699         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15700
15701         * class.cs (Event.Define): Register event and perform appropriate checks
15702         for error #111.
15703
15704         We define the Add and Remove methods even if the use provides none because
15705         in that case, we provide default implementations ourselves.
15706
15707         Define a private field of the type of the event. This is done by the CSC compiler
15708         and we should be doing it too ;-)
15709
15710         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15711         More methods we use in code we generate.
15712
15713         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15714         is important.
15715
15716         (InitCoreTypes): Update accordingly for the above.
15717
15718         * class.cs (Event.Emit): Generate code for default accessors that we provide
15719
15720         (EmitDefaultMethod): Do the job in the above.
15721
15722         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15723         appropriate place.
15724
15725 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15726
15727         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15728         builders even if we were missing one.
15729
15730         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15731         pass the Basename as our class name instead of the Name.  The
15732         basename will be correctly composed for us.
15733
15734         * parameter.cs (Paramters): Now takes a Location argument.
15735
15736         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15737         make all the code call directly LookupType in RootContext and take
15738         this chance to pass the Location information everywhere.
15739
15740         * Everywhere: pass Location information.
15741
15742 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15743
15744         * class.cs (Constructor.Define): Updated way of detecting the
15745         length of the parameters.
15746
15747         (TypeContainer.DefineType): Use basename as the type name for
15748         nested types.
15749
15750         (TypeContainer.Define): Do not recursively define types here, as
15751         definition is taken care in order by the RootContext.
15752
15753         * tree.cs: Keep track of namespaces in a per-file basis.
15754
15755         * parameter.cs (Parameter.ComputeSignature): Update to use
15756         DeclSpace. 
15757
15758         (Parameters.GetSignature): ditto.
15759
15760         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15761         instead of a TypeContainer.
15762
15763         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15764         resolve names.  Because we need to be resolve in our context, not
15765         our parents.
15766
15767         * driver.cs: Implement response files.
15768
15769         * class.cs (TypeContainer.DefineType): If we are defined, do not
15770         redefine ourselves.
15771
15772         (Event.Emit): Emit the code for add/remove handlers.
15773         (Event.Define): Save the MethodBuilders for add/remove.
15774
15775         * typemanager.cs: Use pair here too.
15776
15777         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15778         DictionaryEntry requires the first argument to be non-null.  
15779
15780         (enum_declaration): Compute full name for registering the
15781         enumeration.
15782
15783         (delegate_declaration): Instead of using
15784         formal_parameter_list, use opt_formal_parameter_list as the list
15785         can be empty.
15786
15787         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15788         (EventParsing): New property that controls whether `add' and
15789         `remove' are returned as tokens or identifiers (for events);
15790
15791 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15792
15793         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15794         use MyEventBuilder only and let it wrap the real builder for us.
15795
15796         (MyEventBuilder): Revamp constructor etc.
15797
15798         Implement all operations that we perform on EventBuilder in precisely the same
15799         way here too.
15800
15801         (FindMembers): Update to use the EventBuilder member.
15802
15803         (Event.Emit): Update accordingly.
15804
15805 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15806
15807         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15808         by calling the appropriate methods.
15809
15810         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15811         useful.
15812
15813         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15814
15815 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15816
15817         * delegate.cs (Delegate.Populate): Check that the return type
15818         and various parameters types are indeed accessible.
15819
15820         * class.cs (Constructor.Define): Same here.
15821
15822         (Field.Define): Ditto.
15823
15824         (Event.Define): Ditto.
15825
15826         (Operator.Define): Check that the underlying Method defined itself
15827         correctly - so it's MethodBuilder should not be null.
15828
15829         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15830         expression happens to be null.
15831
15832         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15833         members but as of now we don't seem to be able to do anything really useful with it.
15834
15835         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15836         not the EventBuilder.
15837
15838 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * cs-tokenizer.cs: Add support for defines.
15841         Add support for #if, #elif, #else, #endif
15842
15843         (eval_var): evaluates a variable.
15844         (eval): stubbed for evaluating functions.
15845
15846         * cs-parser.jay: Pass the defines information
15847
15848         * driver.cs: Add --define command line option.
15849
15850         * decl.cs: Move MemberCore here.
15851
15852         Make it the base class for DeclSpace.  This allows us to catch and
15853         report 108 and 109 for everything now.
15854
15855         * class.cs (TypeContainer.Define): Extract all the members
15856         before populating and emit the warning 108 (new keyword required
15857         to override) instead of having each member implement this.
15858
15859         (MemberCore.Define): New abstract method, we will be using this in
15860         the warning reporting engine in Populate.
15861
15862         (Operator.Define): Adjust to new MemberCore protocol. 
15863
15864         * const.cs (Const): This does not derive from Expression, it is a
15865         temporary object we use to create fields, it is a MemberCore. 
15866
15867         * class.cs (Method.Define): Allow the entry point to be in a
15868         specific class.
15869
15870         * driver.cs: Rewrite the argument handler to clean it up a bit.
15871
15872         * rootcontext.cs: Made it just an auxiliary namespace feature by
15873         making everything static.
15874
15875         * driver.cs: Adapt code to use RootContext type name instead of
15876         instance variable.
15877
15878         * delegate.cs: Remove RootContext argument.
15879
15880         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15881         argument. 
15882
15883         * class.cs (Event.Define): The lookup can fail.
15884
15885         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15886
15887         * expression.cs: Resolve the this instance before invoking the code.
15888
15889 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * cs-parser.jay: Add a production in element_access that allows
15892         the thing to become a "type" reference.  This way we can parse
15893         things like "(string [])" as a type.
15894
15895         Note that this still does not handle the more complex rules of
15896         casts. 
15897
15898
15899         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15900
15901         * ecore.cs: (CopyNewMethods): new utility function used to
15902         assemble the list of methods from running FindMembers.
15903
15904         (MemberLookup): Rework FindMembers so that 
15905
15906 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15907
15908         * class.cs (TypeContainer): Remove Delegates who fail to be
15909         defined.
15910
15911         * delegate.cs (Populate): Verify that we dont get null return
15912         values.   TODO: Check for AsAccessible.
15913
15914         * cs-parser.jay: Use basename to emit error 574 (destructor should
15915         have the same name as container class), not the full name.
15916
15917         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15918         possible representation.  
15919
15920         Also implements integer type suffixes U and L.
15921
15922 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15923
15924         * expression.cs (ArrayCreation.DoResolve): We need to do the
15925         argument resolution *always*.
15926
15927         * decl.cs: Make this hold the namespace.  Hold the root context as
15928         well.
15929         (LookupType): Move here.
15930
15931         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15932
15933         * location.cs (Row, Name): Fixed the code, it was always returning
15934         references to the first file.
15935
15936         * interface.cs: Register properties defined through interfaces.
15937
15938         * driver.cs: Add support for globbing on the command line
15939
15940         * class.cs (Field): Make it derive from MemberCore as well.
15941         (Event): ditto.
15942
15943 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15944
15945         * class.cs (Event::Define): Check that the type of the event is a delegate
15946         type else flag error #66.
15947
15948         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15949         same.
15950
15951         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15952         values of EntryPoint, CharSet etc etc.
15953
15954         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15955
15956         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15957         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15958         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15959         which needs this to do its work.
15960
15961         * ../errors/cs0066.cs : Add.
15962
15963 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15964
15965         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15966         helper functions.
15967
15968         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15969         clears out the parameters field.
15970         (MemberSignatureCompare): Cleanup
15971
15972         (MemberCore): New base class used to share code between MethodCore
15973         and Property.
15974
15975         (RegisterRequiredImplementations) BindingFlags.Public requires
15976         either BindingFlags.Instace or Static.  Use instance here.
15977
15978         (Property): Refactored code to cope better with the full spec.
15979
15980         * parameter.cs (GetParameterInfo): Return an empty array instead
15981         of null on error.
15982
15983         * class.cs (Property): Abstract or extern properties have no bodies.
15984
15985         * parameter.cs (GetParameterInfo): return a zero-sized array.
15986
15987         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15988         method modifier validation to the typecontainer so we can reuse
15989         this on properties.
15990
15991         (MethodCore.ParameterTypes): return an empty sized array of types.
15992
15993         (Property.Define): Test property modifier validity.
15994
15995         Add tests for sealed/override too.
15996
15997         (Method.Emit): abstract or extern methods have no bodies.
15998
15999 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16000
16001         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16002         thing.
16003
16004         (Method::Define, ::Emit): Modify accordingly.
16005
16006         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16007
16008         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16009
16010         * makefile: Pass in /unsafe.
16011
16012 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * class.cs (MakeKey): Kill routine.
16015
16016         * class.cs (TypeContainer.Define): Correctly define explicit
16017         method implementations (they require the full interface name plus
16018         the method name).
16019
16020         * typemanager.cs: Deply the PtrHashtable here and stop using the
16021         lame keys.  Things work so much better.
16022
16023         This of course broke everyone who depended on `RegisterMethod' to
16024         do the `test for existance' test.  This has to be done elsewhere.
16025
16026         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16027         the object stupid Equals method (because, that like fails all over
16028         the place).  We still do not use it.
16029
16030         * class.cs (TypeContainer.SetRequiredInterface,
16031         TypeContainer.RequireMethods): Killed these two routines and moved
16032         all the functionality to RegisterRequiredImplementations.
16033
16034         (TypeContainer.RegisterRequiredImplementations): This routine now
16035         registers all the implementations required in an array for the
16036         interfaces and abstract methods.  We use an array of structures
16037         which can be computed ahead of time to reduce memory usage and we
16038         also assume that lookups are cheap as most classes will not
16039         implement too many interfaces.
16040
16041         We also avoid creating too many MethodSignatures.
16042
16043         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16044         clear the "pending" bit if we find that there are problems with
16045         the declaration.
16046
16047         (TypeContainer.VerifyPendingMethods): Update to report errors of
16048         methods that look like implementations but are not.
16049
16050         (TypeContainer.Define): Add support for explicit interface method
16051         implementation. 
16052
16053 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * typemanager.cs: Keep track of the parameters here instead of
16056         being a feature of the TypeContainer.
16057
16058         * class.cs: Drop the registration of parameters here, as
16059         InterfaceMethods are also interface declarations.
16060
16061         * delegate.cs: Register methods with the TypeManager not only with
16062         the TypeContainer.  This code was buggy.
16063
16064         * interface.cs: Full registation here.
16065
16066 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * expression.cs: Remove reducer for binary expressions, it can not
16069         be done this way.
16070
16071         * const.cs: Put here the code that used to go into constant.cs
16072
16073         * constant.cs: Put here the code for constants, this is a new base
16074         class for Literals.
16075
16076         * literal.cs: Make Literal derive from Constant.
16077
16078 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16079
16080         * statement.cs (Return.Emit): Report error 157 if the user
16081         attempts to return from a finally block.
16082
16083         (Return.Emit): Instead of emitting a return, jump to the end of
16084         the function.
16085
16086         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16087         LocalBuilder to store the result of the function.  ReturnLabel is
16088         the target where we jump.
16089
16090
16091 2001-12-09  Radek Doulik  <rodo@ximian.com>
16092
16093         * cs-parser.jay: remember alias in current namespace
16094
16095         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16096         namespaces
16097
16098         * class.cs (LookupAlias): lookup alias in my_namespace
16099
16100         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16101         aliases hashtable
16102         (LookupAlias): lookup alias in this and if needed in parent
16103         namespaces
16104
16105 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16106
16107         * support.cs: 
16108
16109         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16110         making things static.  I need this to avoid passing the
16111         TypeContainer when calling ParameterType.
16112
16113         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16114         that did string manipulation to compute the type and then call
16115         GetType.  Use Parameter.ParameterType instead.
16116
16117         * cs-tokenizer.cs: Consume the suffix for floating values.
16118
16119         * expression.cs (ParameterReference): figure out whether this is a
16120         reference parameter or not.  Kill an extra variable by computing
16121         the arg_idx during emission.
16122
16123         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16124         function that returns whether a parameter is an out/ref value or not.
16125
16126         (Parameter.ParameterType): The type of the parameter (base,
16127         without ref/out applied).
16128
16129         (Parameter.Resolve): Perform resolution here.
16130         (Parameter.ExternalType): The full type (with ref/out applied).
16131
16132         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16133         support for expressions on the using statement.
16134
16135 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16136
16137         * statement.cs (Using.EmitLocalVariableDecls): Split the
16138         localvariable handling of the using statement.
16139
16140         (Block.EmitMeta): Keep track of variable count across blocks.  We
16141         were reusing slots on separate branches of blocks.
16142
16143         (Try.Emit): Emit the general code block, we were not emitting it. 
16144
16145         Check the type of the declaration to be an IDisposable or
16146         something that can be implicity converted to it. 
16147
16148         Emit conversions if required.
16149
16150         * ecore.cs (EmptyExpression): New utility class.
16151         (Expression.ImplicitConversionExists): New utility function.
16152
16153 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * statement.cs (Using): Implement.
16156
16157         * expression.cs (LocalVariableReference): Support read only variables.
16158
16159         * statement.cs: Remove the explicit emit for the Leave opcode.
16160         (VariableInfo): Add a readonly field.
16161
16162 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * ecore.cs (ConvCast): new class used to encapsulate the various
16165         explicit integer conversions that works in both checked and
16166         unchecked contexts.
16167
16168         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16169         properly generate the overflow opcodes.
16170
16171 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16172
16173         * statement.cs: The correct type for the EmptyExpression is the
16174         element_type, not the variable type.  Ravi pointed this out.
16175
16176 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16177
16178         * class.cs (Method::Define): Handle PInvoke methods specially
16179         by using DefinePInvokeMethod instead of the usual one.
16180
16181         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16182         above to do the task of extracting information and defining the method.
16183
16184 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16185
16186         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16187         of the condition for string type.
16188
16189         (Emit): Move that here. 
16190
16191         (ArrayCreation::CheckIndices): Keep string literals in their expression
16192         form.
16193
16194         (EmitDynamicInitializers): Handle strings appropriately.
16195
16196 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16197
16198         * codegen.cs (EmitContext): Replace multiple variables with a
16199         single pointer to the current Switch statement.
16200
16201         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16202         EmitContext.
16203
16204 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16205
16206         * statement.cs 
16207
16208         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16209         default'.
16210
16211         (Foreach.Emit): Foreach on arrays was not setting
16212         up the loop variables (for break/continue).
16213
16214         (GotoCase): Semi-implented.
16215
16216 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16217
16218         * attribute.cs (CheckAttribute): Handle system attributes by using
16219         Attribute.GetAttributes to examine information we need.
16220
16221         (GetValidPlaces): Same here.
16222
16223         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16224
16225         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16226
16227         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16228
16229         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16230
16231         (Method::Emit): Handle the case when we are a PInvoke method.
16232
16233 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16234
16235         * expression.cs: Use ResolveWithSimpleName on compound names.
16236
16237 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16238
16239         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16240         before trying to reduce it.
16241
16242         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16243
16244         * constant.cs (LookupConstantValue): Implement.
16245
16246         (EmitConstant): Use the above in emitting the constant.
16247
16248         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16249         that are user-defined by doing a LookupConstantValue on them.
16250
16251         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16252         too, like above.
16253
16254 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16255
16256         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16257
16258         (BaseAccess.DoResolve): Implement.
16259
16260         (MemberAccess.DoResolve): Split this routine into a
16261         ResolveMemberAccess routine that can be used independently
16262
16263 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16266         As that share bits of the implementation.  Is returns a boolean,
16267         while As returns the Type that is being probed.
16268
16269 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16270
16271         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16272         instead of a Literal - much easier.
16273
16274         (EnumInTransit): Remove - utterly useless :-)
16275
16276         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16277
16278         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16279
16280         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16281         chain when we have no associated expression.
16282
16283 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16284
16285         * constant.cs (Define): Use Location while reporting the errror.
16286
16287         Also emit a warning when 'new' is used and there is no inherited
16288         member to hide.
16289
16290         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16291         populated.
16292
16293         (LookupEnumValue): Implement to lookup an enum member's value and define it
16294         if necessary.
16295
16296         (Populate): Re-write accordingly to use the above routine.
16297
16298 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16299
16300         * expression.cs (This): Fix prototype for DoResolveLValue to
16301         override the base class DoResolveLValue.
16302
16303         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16304         declarations) 
16305
16306         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16307         (we need to load the address of the field here).  This fixes
16308         test-22. 
16309
16310         (FieldExpr.DoResolveLValue): Call the DoResolve
16311         function to initialize the Instance expression.
16312
16313         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16314         correctly the GetEnumerator operation on a value type.
16315
16316         * cs-parser.jay: Add more simple parsing error catches.
16317
16318         * statement.cs (Switch): Add support for string switches.
16319         Handle null specially.
16320
16321         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16322
16323 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16324
16325         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16326
16327         (declare_local_constant): New helper function.
16328
16329         * statement.cs (AddConstant): Keep a separate record of constants
16330
16331         (IsConstant): Implement to determine if a variable is a constant.
16332
16333         (GetConstantExpression): Implement.
16334
16335         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16336
16337         * statement.cs (IsVariableDefined): Re-write.
16338
16339 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16340
16341         * class.cs (TypeContainer::FindMembers): Look for constants
16342         in the case when we are looking for MemberTypes.Field
16343
16344         * expression.cs (MemberAccess::DoResolve): Check that in the
16345         case we are a FieldExpr and a Literal, we are not being accessed
16346         by an instance reference.
16347
16348         * cs-parser.jay (local_constant_declaration): Implement.
16349
16350         (declaration_statement): Implement for constant declarations.
16351
16352 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16353
16354         * statement.cs (Switch): Catch double defaults.
16355
16356         (Switch): More work on the switch() statement
16357         implementation.  It works for integral values now, need to finish
16358         string support.
16359
16360
16361 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16364         integer literals into other integer literals.  To be used by
16365         switch. 
16366
16367 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16368
16369         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16370         some memory.
16371
16372         (EmitDynamicInitializers): Cope with the above since we extract data
16373         directly from ArrayData now.
16374
16375         (ExpectInitializers): Keep track of whether initializers are mandatory
16376         or not.
16377
16378         (Bounds): Make it a hashtable to prevent the same dimension being 
16379         recorded for every element in that dimension.
16380
16381         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16382         from being found.
16383
16384         Also fix bug which was causing the indices to be emitted in the reverse
16385         order.
16386
16387 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16388
16389         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16390         unfinished.  They do not work, because the underlying code is
16391         sloppy.
16392
16393 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16394
16395         * cs-parser.jay: Remove bogus fixme.
16396
16397         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16398         on Switch statement.
16399
16400 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16401
16402         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16403         the same. 
16404
16405         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16406         parameter. Apparently, any expression is allowed. 
16407
16408         (ValidateInitializers): Update accordingly.
16409
16410         (CheckIndices): Fix some tricky bugs thanks to recursion.
16411
16412         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16413         I was being completely brain-dead.
16414
16415         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16416         and re-write acordingly.
16417
16418         (DelegateInvocation): Re-write accordingly.
16419
16420         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16421
16422         (MakeByteBlob): Handle types more correctly.
16423
16424         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16425         initialization from expressions but it is incomplete because I am a complete
16426         Dodo :-|
16427
16428 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16429
16430         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16431         on If.  Basically, we have to return `true' (ie, we do return to
16432         our caller) only if both branches of the if return.
16433
16434         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16435         short-circuit operators, handle them as short circuit operators. 
16436
16437         (Cast.DoResolve): Resolve type.
16438         (Cast.Cast): Take an expression as the target type.
16439
16440         * cs-parser.jay (cast_expression): Remove old hack that only
16441         allowed a limited set of types to be handled.  Now we take a
16442         unary_expression and we resolve to a type during semantic
16443         analysis.
16444
16445         Use the grammar productions from Rhys to handle casts (this is
16446         not complete like Rhys syntax yet, we fail to handle that corner
16447         case that C# has regarding (-x), but we will get there.
16448
16449 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16450
16451         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16452         field which is an array type.
16453
16454         * cs-parser.jay (declare_local_variables): Support array initialization too.
16455
16456         * typemanager.cs (MakeKey): Implement.
16457
16458         (everywhere): Use the above appropriately.
16459
16460         * cs-parser.jay (for_statement): Update for array initialization while
16461         declaring variables.
16462
16463         * ecore.cs : The error message was correct, it's the variable's names that
16464         were misleading ;-) Make the code more readable.
16465
16466         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16467         the correct type etc.
16468
16469         (ConvertExplicit): Handle Enum types by examining the underlying type.
16470
16471 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16472
16473         * parameter.cs (GetCallingConvention): Always return
16474         CallingConventions.Standard for now.
16475
16476 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16477
16478         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16479         and `r' after calling DoNumericPromotions.
16480
16481         * ecore.cs: Fix error message (the types were in the wrong order).
16482
16483         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16484         BindingFlags.Instance as well 
16485
16486         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16487         implicit int literal conversion in an empty cast so that we
16488         propagate the right type upstream.
16489
16490         (UnboxCast): new class used to unbox value types.
16491         (Expression.ConvertExplicit): Add explicit type conversions done
16492         by unboxing.
16493
16494         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16495         the target type before applying the implicit LongLiterals to ULong
16496         literal cast.
16497
16498 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16499
16500         * cs-parser.jay (for_statement): Reworked the way For works: now
16501         we declare manually any variables that are introduced in
16502         for_initializer to solve the problem of having out-of-band code
16503         emition (that is what got for broken).
16504
16505         (declaration_statement): Perform the actual variable declaration
16506         that used to be done in local_variable_declaration here.
16507
16508         (local_variable_declaration): Do not declare anything, just pass
16509         the information on a DictionaryEntry
16510
16511 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16512
16513         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16514         re-write of the logic to now make it recursive.
16515
16516         (UpdateIndices): Re-write accordingly.
16517
16518         Store element data in a separate ArrayData list in the above methods.
16519
16520         (MakeByteBlob): Implement to dump the array data into a byte array.
16521
16522 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16523
16524         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16525         into CheckIndices.
16526
16527         * constant.cs (Define): Implement.
16528
16529         (EmitConstant): Re-write fully.
16530
16531         Pass in location info.
16532
16533         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16534         respectively.
16535
16536         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16537         DictionaryEntry since we need location info too.
16538
16539         (constant_declaration): Update accordingly.
16540
16541         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16542         code into another method : UpdateIndices.
16543
16544 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16545
16546         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16547         some type checking etc.
16548
16549 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16550
16551         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16552         bits to provide dimension info if the user skips doing that.
16553
16554         Update second constructor to store the rank correctly.
16555
16556 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16557
16558         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16559         and try to implement.
16560
16561         * ../errors/cs0150.cs : Add.
16562
16563         * ../errors/cs0178.cs : Add.
16564
16565 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16566
16567         * statement.cs: Implement foreach on multi-dimensional arrays. 
16568
16569         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16570         name of the params argument.
16571
16572         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16573         initializing the array.
16574
16575         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16576         we can use this elsewhere.
16577
16578         * statement.cs: Finish implementation of foreach for single
16579         dimension arrays.
16580
16581         * cs-parser.jay: Use an out-of-band stack to pass information
16582         around, I wonder why I need this.
16583
16584         foreach_block: Make the new foreach_block the current_block.
16585
16586         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16587         function used to return a static Parameters structure.  Used for
16588         empty parameters, as those are created very frequently.
16589
16590         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16591
16592 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16593
16594         * interface.cs : Default modifier is private, not public. The
16595         make verify test passes again.
16596
16597 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16598
16599         * support.cs (ReflectionParameters): Fix logic to determine
16600         whether the last parameter is a params one. Test 9 passes again.
16601
16602         * delegate.cs (Populate): Register the builders we define with
16603         RegisterParameterForBuilder. Test 19 passes again.
16604
16605         * cs-parser.jay (property_declaration): Reference $6 instead
16606         of $$ to get at the location.
16607
16608         (indexer_declaration): Similar stuff.
16609
16610         (attribute): Ditto.
16611
16612         * class.cs (Property): Register parameters for the Get and Set methods
16613         if they exist. Test 23 passes again.
16614
16615         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16616         call to EmitArguments as we are sure there aren't any params arguments. 
16617         Test 32 passes again.
16618
16619         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16620         IndexOutOfRangeException. 
16621
16622         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16623         Test 33 now passes again.
16624
16625 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16626
16627         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16628         broke a bunch of things.  Will have to come up with a better way
16629         of tracking locations.
16630
16631         * statement.cs: Implemented foreach for single dimension arrays.
16632
16633 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16634
16635         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16636         an error.  This removes the lookup from the critical path.
16637
16638         * cs-parser.jay: Removed use of temporary_loc, which is completely
16639         broken. 
16640
16641 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16642
16643         * support.cs (ReflectionParameters.ParameterModifier): Report
16644         whether the argument is a PARAMS argument or not.
16645
16646         * class.cs: Set the attribute `ParamArrayAttribute' on the
16647         parameter argument.
16648
16649         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16650         and cons_param_array_attribute (ConstructorInfo for
16651         ParamArrayAttribute)., 
16652
16653         * codegen.cs: Emit the return using the `Return' statement, that
16654         way we can report the error correctly for missing return values. 
16655
16656         * class.cs (Method.Emit): Clean up.
16657
16658         * expression.cs (Argument.Resolve): Take another argument: the
16659         location where this argument is used.  Notice that this is not
16660         part of the "Argument" class as to reduce the size of the
16661         structure (we know the approximate location anyways).
16662
16663         Test if the argument is a variable-reference, if not, then
16664         complain with a 206.
16665
16666         (Argument.Emit): Emit addresses of variables.
16667
16668         (Argument.FullDesc): Simplify.
16669
16670         (Invocation.DoResolve): Update for Argument.Resolve.
16671
16672         (ElementAccess.DoResolve): ditto.
16673
16674         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16675         method should be virtual, as this method is always virtual.
16676
16677         (NewDelegate.DoResolve): Update for Argument.Resolve.
16678
16679         * class.cs (ConstructorInitializer.DoResolve): ditto.
16680
16681         * attribute.cs (Attribute.Resolve): ditto.
16682
16683 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16684
16685         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16686
16687         * expression.cs (ParameterReference): Drop IStackStorage and implement
16688         IAssignMethod instead. 
16689
16690         (LocalVariableReference): ditto.
16691
16692         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16693         IAssignMethod instead. 
16694
16695 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16696
16697         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16698         enumerations that are used in heavily used structures derive from
16699         byte in a laughable and pathetic attempt to reduce memory usage.
16700         This is the kind of pre-optimzations that you should not do at
16701         home without adult supervision.
16702
16703         * expression.cs (UnaryMutator): New class, used to handle ++ and
16704         -- separatedly from the other unary operators.  Cleans up the
16705         code, and kills the ExpressionStatement dependency in Unary.
16706
16707         (Unary): Removed `method' and `Arguments' from this class, making
16708         it smaller, and moving it all to SimpleCall, so I can reuse this
16709         code in other locations and avoid creating a lot of transient data
16710         strucutres when not required.
16711
16712         * cs-parser.jay: Adjust for new changes.
16713
16714 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16715
16716         * enum.cs (Enum.Populate): If there is a failure during
16717         definition, return
16718
16719         * cs-parser.jay (opt_enum_base): we used to catch type errors
16720         here, but this is really incorrect.  The type error should be
16721         catched during semantic analysis.
16722
16723 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16724
16725         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16726         current_local_parameters as expected since I, in my stupidity, had forgotten
16727         to do this :-)
16728
16729         * attribute.cs (GetValidPlaces): Fix stupid bug.
16730
16731         * class.cs (Method::Emit): Perform check on applicability of attributes.
16732
16733         (Constructor::Emit): Ditto.
16734
16735         (Field::Emit): Ditto.
16736
16737         (Field.Location): Store location information.
16738
16739         (Property, Event, Indexer, Operator): Ditto.
16740
16741         * cs-parser.jay (field_declaration): Pass in location for each field.
16742
16743         * ../errors/cs0592.cs : Add.
16744
16745 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16746
16747         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16748
16749         (InitCoreTypes): Update accordingly.
16750
16751         (RegisterAttrType, LookupAttr): Implement.
16752
16753         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16754         info about the same.
16755
16756         (Resolve): Update to populate the above as necessary.
16757
16758         (Error592): Helper.
16759
16760         (GetValidPlaces): Helper to the above.
16761
16762         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16763
16764         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16765
16766 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16767
16768         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16769
16770         * ../errors/cs0617.cs : Add.
16771
16772 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16773
16774         * enum.cs (Emit): Rename to Populate to be more consistent with what
16775         we expect it to do and when exactly it is called.
16776
16777         * class.cs, rootcontext.cs : Update accordingly.
16778
16779         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16780         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16781
16782         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16783
16784         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16785         of a fieldinfo using the above, when dealing with a FieldBuilder.
16786
16787 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16788
16789         * ../errors/cs0031.cs : Add.
16790
16791         * ../errors/cs1008.cs : Add.
16792
16793         * ../errrors/cs0543.cs : Add.
16794
16795         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16796         enum type.
16797
16798         (FindMembers): Implement.
16799
16800         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16801         enums and delegates too.
16802
16803         (enum_types): Rename to builder_to_enum.
16804
16805         (delegate_types): Rename to builder_to_delegate.
16806
16807         * delegate.cs (FindMembers): Implement.
16808
16809 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16810
16811         * typemanager.cs (IsEnumType): Implement.
16812
16813         * enum.cs (Emit): Re-write parts to account for the underlying type
16814         better and perform checking etc.
16815
16816         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16817         of the underlying type.
16818
16819         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16820         value
16821
16822         * enum.cs (error31): Helper to report error #31.
16823
16824         * cs-parser.jay (enum_declaration): Store location of each member too.
16825
16826         * enum.cs (member_to_location): New hashtable. 
16827
16828         (AddEnumMember): Update location hashtable.
16829
16830         (Emit): Use the location of each member while reporting errors.
16831
16832 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16833
16834         * cs-parser.jay: A for_initializer if is a
16835         local_variable_declaration really ammount to have an implicit
16836         block with the variable declaration and no initializer for for.
16837
16838         * statement.cs (For.Emit): Cope with null initializers.
16839
16840         This fixes the infinite loop on for initializers.
16841
16842 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16843
16844         * enum.cs: More cleanup.
16845
16846         * ecore.cs: Remove dead code.
16847
16848         * class.cs (Property.Emit): More simplification.
16849         (Event.Emit): ditto.
16850
16851         Reworked to have less levels of indentation.
16852
16853 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16854
16855         * class.cs (Property): Emit attributes.
16856
16857         (Field): Ditto.
16858
16859         (Event): Ditto.
16860
16861         (Indexer): Ditto.
16862
16863         (Operator): Ditto.
16864
16865         * enum.cs (Emit): Ditto.
16866
16867         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16868         Enums too.
16869
16870         * class.cs (Field, Event, etc.): Move attribute generation into the
16871         Emit method everywhere.
16872
16873         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16874         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16875         as we had no way of defining nested enums !
16876
16877         * rootcontext.cs : Adjust code accordingly.
16878
16879         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16880
16881 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16882
16883         * expression.cs (EvalConstantExpression): Move into ecore.cs
16884
16885         * enum.cs (Enum): Rename some members and make them public and readonly
16886         according to our convention.
16887
16888         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16889         nothing else.
16890
16891         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16892
16893         (Enum::Emit): Write a simple version for now which doesn't try to compute
16894         expressions. I shall modify this to be more robust in just a while.
16895
16896         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16897
16898         (TypeContainer::CloseType): Create the Enum types too.
16899
16900         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16901
16902         * expression.cs (EvalConstantExpression): Get rid of completely.
16903
16904         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16905         user-defined values and other cases.
16906
16907         (IsValidEnumLiteral): Helper function.
16908
16909         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16910         out there in the case we had a literal FieldExpr.
16911
16912         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16913
16914         (Literalize): Revamp a bit to take two arguments.
16915
16916         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16917
16918 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16919
16920         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16921
16922         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16923
16924         (Resolve): Use the above to ensure we have proper initializers.
16925
16926 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16927
16928         * expression.cs (Expression::EvalConstantExpression): New method to 
16929         evaluate constant expressions.
16930
16931         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16932
16933 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16934
16935         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16936         in an array.
16937
16938         (Binary.ResolveOperator): Handle operator != (object a, object b)
16939         and operator == (object a, object b);
16940
16941         (Binary.DoNumericPromotions): Indicate whether the numeric
16942         promotion was possible.
16943
16944         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16945         Implement.  
16946
16947         Made the ArrayAccess implement interface IAssignMethod instead of
16948         IStackStore as the order in which arguments are passed reflects
16949         this.
16950
16951         * assign.cs: Instead of using expr.ExprClass to select the way of
16952         assinging, probe for the IStackStore/IAssignMethod interfaces.
16953
16954         * typemanager.cs: Load InitializeArray definition.
16955
16956         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16957         static data that can be used to initialize arrays. 
16958
16959 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * expression.cs: Handle operator== and operator!= for booleans.
16962
16963         (Conditioal.Reduce): Implement reducer for the ?: operator.
16964
16965         (Conditional.Resolve): Implement dead code elimination.
16966
16967         (Binary.Resolve): Catch string literals and return a new
16968         concatenated string.
16969
16970         (Unary.Reduce): Implement reduction of unary expressions.
16971
16972         * ecore.cs: Split out the expression core handling here.
16973
16974         (Expression.Reduce): New method used to perform constant folding
16975         and CSE.  This is needed to support constant-expressions. 
16976
16977         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16978         targets, and optimize for !x.
16979
16980 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16981
16982         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16983         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16984         set custom atttributes.
16985
16986         * literal.cs (Literal::GetValue): New abstract method to return the actual
16987         value of the literal, cast as an object.
16988
16989         (*Literal): Implement GetValue method.
16990
16991         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16992         expressions to the arraylist but objects of type Argument.
16993
16994         * class.cs (TypeContainer::Emit): Emit our attributes too.
16995
16996         (Method::Emit, Constructor::Emit): Ditto.
16997
16998         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16999         to be ignoring earlier.
17000
17001 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17002
17003         * attribute.cs (AttributeSection::Define): Implement to do the business
17004         of constructing a CustomAttributeBuilder.
17005
17006         (Attribute): New trivial class. Increases readability of code.  
17007
17008         * cs-parser.jay : Update accordingly.
17009
17010         (positional_argument_list, named_argument_list, named_argument): New rules
17011
17012         (attribute_arguments): Use the above so that we are more correct.
17013
17014 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17015
17016         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17017         to perform all checks for a method with a params parameter.
17018
17019         (Invocation::OverloadResolve): Update to use the above method and therefore
17020         cope correctly with params method invocations.
17021
17022         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17023         params too.
17024
17025         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17026         constructors in our parent too because we can't afford to miss out on 
17027         protected ones ;-)
17028
17029         * attribute.cs (AttributeSection): New name for the class Attribute
17030
17031         Other trivial changes to improve readability.
17032
17033         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17034         use the new class names.
17035
17036 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17037
17038         * class.cs (Method::Define): Complete definition for params types too
17039
17040         (Indexer::Define): Ditto.
17041
17042         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17043         Cope everywhere with a request for info about the array parameter.
17044
17045 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17046
17047         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17048
17049         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17050         local_variable_type to extract the string corresponding to the type.
17051
17052         (local_variable_type): Fixup the action to use the new helper method.
17053
17054         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17055         go.
17056
17057         * expression.cs : Clean out code which uses the above.
17058
17059 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17060
17061         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17062         and bale out if necessary by returning a false.
17063
17064         (RegisterProperty): Ditto.
17065
17066         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17067         and print out appropriate error messages.
17068
17069         * interface.cs (everywhere): Ditto.
17070
17071         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17072         location to constructor.
17073
17074         * class.cs (Property, Event, Indexer): Update accordingly.
17075
17076         * ../errors/cs111.cs : Added.
17077
17078         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17079         of a method, as laid down by the spec.
17080
17081         (Invocation::OverloadResolve): Use the above method.
17082
17083 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17084
17085         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17086         now take a TypeContainer and a Parameters object.
17087
17088         (ParameterData): Modify return type of ParameterModifier method to be 
17089         Parameter.Modifier and not a string.
17090
17091         (ReflectionParameters, InternalParameters): Update accordingly.
17092
17093         * expression.cs (Argument::GetParameterModifier): Same here.
17094
17095         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17096         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17097         symbol in it at all so maybe this is only for now.
17098
17099 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17100
17101         * support.cs (InternalParameters): Constructor now takes an extra argument 
17102         which is the actual Parameters class.
17103
17104         (ParameterDesc): Update to provide info on ref/out modifiers.
17105
17106         * class.cs (everywhere): Update call to InternalParameters to pass in
17107         the second argument too.
17108
17109         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17110         to return the modifier info [ref/out etc]
17111
17112         (InternalParameters, ReflectionParameters): Implement the above.
17113
17114         * expression.cs (Argument::ParameterModifier): Similar function to return
17115         info about the argument's modifiers.
17116
17117         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17118         too.
17119
17120         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17121         a new SetFormalParameters object which we pass to InternalParameters.
17122
17123 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17124
17125         * expression.cs (NewArray): Merge into the ArrayCreation class.
17126
17127 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17128
17129         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17130         NewUserdefinedArray into one as there wasn't much of a use in having
17131         two separate ones.
17132
17133         * expression.cs (Argument): Change field's name to ArgType from Type.
17134
17135         (Type): New readonly property which returns the proper type, taking into 
17136         account ref/out modifiers.
17137
17138         (everywhere): Adjust code accordingly for the above.
17139
17140         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17141         whether we are emitting for a ref or out parameter.
17142
17143         * expression.cs (Argument::Emit): Use the above field to set the state.
17144
17145         (LocalVariableReference::Emit): Update to honour the flag and emit the
17146         right stuff.
17147
17148         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17149
17150         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17151
17152         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17153
17154         (ReflectionParameters, InternalParameters): Implement the above method.
17155
17156         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17157         reporting errors.
17158
17159         (Invocation::FullMethodDesc): Ditto. 
17160
17161 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17162
17163         * cs-parser.jay: Add extra production for the second form of array
17164         creation. 
17165
17166         * expression.cs (ArrayCreation): Update to reflect the above
17167         change. 
17168
17169         * Small changes to prepare for Array initialization.
17170
17171 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17172
17173         * typemanager.cs (ImplementsInterface): interface might be null;
17174         Deal with this problem;
17175
17176         Also, we do store negative hits on the cache (null values), so use
17177         this instead of calling t.GetInterfaces on the type everytime.
17178
17179 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17180
17181         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17182
17183         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17184         split functionality out into different classes.
17185
17186         (New::FormArrayType): Move into NewBuiltinArray.
17187
17188         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17189         quite useless.
17190
17191         (NewBuiltinArray): New class to handle creation of built-in arrays.
17192
17193         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17194         account creation of one-dimensional arrays.
17195
17196         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17197
17198         (NewUserdefinedArray::DoResolve): Implement.
17199
17200         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17201
17202         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17203         we maintain inside the TypeManager. This is necessary to perform lookups on the
17204         module builder.
17205
17206         (LookupType): Update to perform GetType on the module builders too.     
17207
17208         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17209
17210         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17211
17212 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17213
17214         * expression.cs (New::DoResolve): Implement guts of array creation.
17215
17216         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17217
17218 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17219
17220         * expression.cs: Fix bug I introduced lsat night that broke
17221         Delegates. 
17222
17223         (Expression.Resolve): Report a 246 error (can not resolve name)
17224         if we find a SimpleName in the stream.
17225
17226         (Expression.ResolveLValue): Ditto.
17227
17228         (Expression.ResolveWithSimpleName): This function is a variant of
17229         ResolveName, this one allows SimpleNames to be returned without a
17230         warning.  The only consumer of SimpleNames is MemberAccess
17231
17232 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17233
17234         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17235         might arrive here.  I have my doubts that this is correct.
17236
17237         * statement.cs (Lock): Implement lock statement.
17238
17239         * cs-parser.jay: Small fixes to support `lock' and `using'
17240
17241         * cs-tokenizer.cs: Remove extra space
17242
17243         * driver.cs: New flag --checked, allows to turn on integer math
17244         checking. 
17245
17246         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17247         Threading.Monitor.Exit 
17248
17249 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17250
17251         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17252         Expression Class to be IndexerAccess.
17253
17254         Notice that Indexer::DoResolve sets the eclass to Value.
17255
17256 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17257
17258         * class.cs (TypeContainer::Emit): Emit code for indexers.
17259
17260         * assign.cs (IAssignMethod): New interface implemented by Indexers
17261         and Properties for handling assignment.
17262
17263         (Assign::Emit): Simplify and reuse code. 
17264
17265         * expression.cs (IndexerAccess, PropertyExpr): Implement
17266         IAssignMethod, clean up old code. 
17267
17268 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17269
17270         * typemanager.cs (ImplementsInterface): New method to determine if a type
17271         implements a given interface. Provides a nice cache too.
17272
17273         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17274         method.
17275
17276         (ConvertReferenceExplicit): Ditto.
17277
17278         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17279         various methods, with correct names etc.
17280
17281         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17282         Operator.UnaryNegation.
17283
17284         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17285         we have a unary plus or minus operator.
17286
17287         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17288         UnaryMinus.
17289
17290         * everywhere : update accordingly.
17291
17292         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17293         respectively.
17294
17295         * class.cs (Method::Define): For the case where we are implementing a method
17296         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17297         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17298
17299 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17300
17301         * interface.cs (FindMembers): Implement to work around S.R.E
17302         lameness.
17303
17304         * typemanager.cs (IsInterfaceType): Implement.
17305
17306         (FindMembers): Update to handle interface types too.
17307
17308         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17309         use IsAssignableFrom as that is not correct - it doesn't work.
17310
17311         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17312         and accordingly override EmitStatement.
17313
17314         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17315         using the correct logic :-)
17316
17317 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17318
17319         * ../errors/cs-11.cs : Add to demonstrate error -11 
17320
17321 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17322
17323         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17324         then pass this as a hint to ResolveLValue.
17325
17326         * expression.cs (FieldExpr): Add Location information
17327
17328         (FieldExpr::LValueResolve): Report assignment to readonly
17329         variable. 
17330
17331         (Expression::ExprClassFromMemberInfo): Pass location information.
17332
17333         (Expression::ResolveLValue): Add new method that resolves an
17334         LValue. 
17335
17336         (Expression::DoResolveLValue): Default invocation calls
17337         DoResolve. 
17338
17339         (Indexers): New class used to keep track of indexers in a given
17340         Type. 
17341
17342         (IStackStore): Renamed from LValue, as it did not really describe
17343         what this did.  Also ResolveLValue is gone from this interface and
17344         now is part of Expression.
17345
17346         (ElementAccess): Depending on the element access type
17347
17348         * typemanager.cs: Add `indexer_name_type' as a Core type
17349         (System.Runtime.CompilerServices.IndexerNameAttribute)
17350
17351         * statement.cs (Goto): Take a location.
17352
17353 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17354
17355         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17356         if two delegates are compatible.
17357
17358         (NewDelegate::DoResolve): Update to take care of the case when
17359         we instantiate a delegate from another delegate.
17360
17361         * typemanager.cs (FindMembers): Don't even try to look up members
17362         of Delegate types for now.
17363
17364 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17365
17366         * delegate.cs (NewDelegate): New class to take care of delegate
17367         instantiation.
17368
17369         * expression.cs (New): Split the delegate related code out into 
17370         the NewDelegate class.
17371
17372         * delegate.cs (DelegateInvocation): New class to handle delegate 
17373         invocation.
17374
17375         * expression.cs (Invocation): Split out delegate related code into
17376         the DelegateInvocation class.
17377
17378 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17379
17380         * expression.cs (New::DoResolve): Implement delegate creation fully
17381         and according to the spec.
17382
17383         (New::DoEmit): Update to handle delegates differently.
17384
17385         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17386         because of which we were printing out arguments in reverse order !
17387
17388         * delegate.cs (VerifyMethod): Implement to check if the given method
17389         matches the delegate.
17390
17391         (FullDelegateDesc): Implement.
17392
17393         (VerifyApplicability): Implement.
17394
17395         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17396         delegate invocations too.
17397
17398         (Invocation::Emit): Ditto.
17399
17400         * ../errors/cs1593.cs : Added.
17401
17402         * ../errors/cs1594.cs : Added.
17403
17404         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17405
17406 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17407
17408         * typemanager.cs (intptr_type): Core type for System.IntPtr
17409
17410         (InitCoreTypes): Update for the same.
17411
17412         (iasyncresult_type, asynccallback_type): Ditto.
17413
17414         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17415         correct.
17416
17417         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17418         too.
17419
17420         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17421         the builders for the 4 members of a delegate type :-)
17422
17423         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17424         type.
17425
17426         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17427
17428         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17429
17430 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17431
17432         * statement.cs (Break::Emit): Implement.   
17433         (Continue::Emit): Implement.
17434
17435         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17436         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17437         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17438         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17439         end loop
17440
17441         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17442         properties that track the label for the current loop (begin of the
17443         loop and end of the loop).
17444
17445 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17446
17447         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17448         use of emitting anything at all.
17449
17450         * class.cs, rootcontext.cs : Get rid of calls to the same.
17451
17452         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17453
17454         (Populate): Define the constructor correctly and set the implementation
17455         attributes.
17456
17457         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17458         have been defined.
17459
17460         (AddDelegateType): Implement.
17461
17462         (IsDelegateType): Implement helper method.
17463
17464         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17465
17466         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17467         and accordingly handle it.
17468
17469         * delegate.cs (Populate): Take TypeContainer argument.
17470         Implement bits to define the Invoke method. However, I still haven't figured out
17471         how to take care of the native int bit :-(
17472
17473         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17474         Qualify the name of the delegate, not its return type !
17475
17476         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17477         conversion.
17478
17479         (StandardConversionExists): Checking for array types turns out to be recursive.
17480
17481         (ConvertReferenceExplicit): Implement array conversion.
17482
17483         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17484
17485 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17486
17487         * cs-parser.jay (delegate_declaration): Store the fully qualified
17488         name as it is a type declaration.
17489
17490         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17491         readonly.
17492
17493         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17494         as TypeContainer::DefineType.
17495
17496         (Populate): Method in which all the definition of the various methods (Invoke)
17497         etc is done.
17498
17499         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17500         see.
17501
17502         (CloseDelegate): Finally creates the delegate.
17503
17504         * class.cs (TypeContainer::DefineType): Update to define delegates.
17505         (Populate, Emit and CloseType): Do the same thing here too.
17506
17507         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17508         delegates in all these operations.
17509
17510 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * expression.cs: LocalTemporary: a new expression used to
17513         reference a temporary that has been created.
17514
17515         * assign.cs: Handle PropertyAccess back here, so that we can
17516         provide the proper semantic access to properties.
17517
17518         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17519         a few more explicit conversions. 
17520
17521         * modifiers.cs: `NEW' modifier maps to HideBySig.
17522
17523         * expression.cs (PropertyExpr): Make this into an
17524         ExpressionStatement, and support the EmitStatement code path. 
17525
17526         Perform get/set error checking, clean up the interface.
17527
17528         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17529         them into toplevel access objects.
17530
17531 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17532
17533         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17534         SRE.
17535
17536         * typemanager.cs: Keep track here of our PropertyBuilders again to
17537         work around lameness in SRE.
17538
17539 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17540
17541         * expression.cs (LValue::LValueResolve): New method in the
17542         interface, used to perform a second resolution pass for LValues. 
17543
17544         (This::DoResolve): Catch the use of this in static methods.
17545
17546         (This::LValueResolve): Implement.
17547
17548         (This::Store): Remove warning, assigning to `this' in structures
17549         is 
17550
17551         (Invocation::Emit): Deal with invocation of
17552         methods on value types.  We need to pass the address to structure
17553         methods rather than the object itself.  (The equivalent code to
17554         emit "this" for structures leaves the entire structure on the
17555         stack instead of a pointer to it). 
17556
17557         (ParameterReference::DoResolve): Compute the real index for the
17558         argument based on whether the method takes or not a `this' pointer
17559         (ie, the method is static).
17560
17561         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17562         value types returned from functions when we need to invoke a
17563         method on the sturcture.
17564
17565
17566 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17567
17568         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17569         defining the type in the Modulebuilder or Typebuilder. This is to take
17570         care of nested types which need to be defined on the TypeBuilder using
17571         DefineNestedMethod.
17572
17573         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17574         methods in RootContext, only ported to be part of TypeContainer.
17575
17576         (TypeContainer::GetInterfaceOrClass): Ditto.
17577
17578         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17579
17580         * interface.cs (Interface::DefineInterface): New method. Does exactly
17581         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17582         too.
17583
17584         (Interface::GetInterfaces): Move from RootContext here and port.
17585
17586         (Interface::GetInterfaceByName): Same here.
17587
17588         * rootcontext.cs (ResolveTree): Re-write.
17589
17590         (PopulateTypes): Re-write.
17591
17592         * class.cs (TypeContainer::Populate): Populate nested types too.
17593         (TypeContainer::Emit): Emit nested members too.
17594
17595         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17596         instead just use the name argument passed in as it is already fully
17597         qualified.
17598
17599         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17600         to TypeContainer mapping to see if a type is user-defined.
17601
17602         * class.cs (TypeContainer::CloseType): Implement. 
17603
17604         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17605         the default constructor.
17606
17607         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17608         twice.
17609
17610         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17611
17612         * interface.cs (CloseType): Create the type here.
17613
17614         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17615         the hierarchy.
17616
17617         Remove all the methods which are now in TypeContainer.
17618
17619 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17620
17621         * delegate.cs (Define): Re-write bits to define the delegate
17622         correctly.
17623
17624 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17625
17626         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17627
17628         * expression.cs (ImplicitReferenceConversion): handle null as well
17629         as a source to convert to any reference type.
17630
17631         * statement.cs (Return): Perform any implicit conversions to
17632         expected return type.  
17633
17634         Validate use of return statement.  
17635
17636         * codegen.cs (EmitContext): Pass the expected return type here.
17637
17638         * class.cs (Method, Constructor, Property): Pass expected return
17639         type to EmitContext.
17640
17641 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * expression.cs: Make DoResolve take an EmitContext instead of a
17644         TypeContainer.
17645
17646         Replaced `l' and `location' for `loc', for consistency.
17647
17648         (Error, Warning): Remove unneeded Tc argument.
17649
17650         * assign.cs, literal.cs, constant.cs: Update to new calling
17651         convention. 
17652
17653         * codegen.cs: EmitContext now contains a flag indicating whether
17654         code is being generated in a static method or not.
17655
17656         * cs-parser.jay: DecomposeQI, new function that replaces the old
17657         QualifiedIdentifier.  Now we always decompose the assembled
17658         strings from qualified_identifier productions into a group of
17659         memberaccesses.
17660
17661 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17662
17663         * rootcontext.cs: Deal with field-less struct types correctly now
17664         by passing the size option to Define Type.
17665
17666         * class.cs: Removed hack that created one static field. 
17667
17668 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17669
17670         * statement.cs: Moved most of the code generation here. 
17671
17672 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17673
17674         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17675         seem very right.
17676
17677         (ElementAccess): Remove useless bits for now - keep checks as the spec
17678         says.
17679
17680 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17681
17682         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17683         and start performing checks according to the spec.
17684
17685 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17686
17687         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17688         rank_specifiers instead.
17689
17690         (rank_specifiers): Change the order in which the rank specifiers are stored
17691
17692         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17693
17694         * expression.cs (ElementAccess): Implement the LValue interface too.
17695
17696 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17697
17698         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17699         except that user defined conversions are not included.
17700
17701         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17702         perform the conversion of the return type, if necessary.
17703
17704         (New::DoResolve): Check whether we are creating an array or an object
17705         and accordingly do the needful.
17706
17707         (New::Emit): Same here.
17708
17709         (New::DoResolve): Implement guts of array creation.
17710
17711         (New::FormLookupType): Helper function.
17712
17713 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17714
17715         * codegen.cs: Removed most of the code generation here, and move the
17716         corresponding code generation bits to the statement classes. 
17717
17718         Added support for try/catch/finalize and throw.
17719
17720         * cs-parser.jay: Added support for try/catch/finalize.
17721
17722         * class.cs: Catch static methods having the flags override,
17723         virtual or abstract.
17724
17725         * expression.cs (UserCast): This user cast was not really doing
17726         what it was supposed to do.  Which is to be born in fully resolved
17727         state.  Parts of the resolution were being performed at Emit time! 
17728
17729         Fixed this code.
17730
17731 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17732
17733         * expression.cs: Implicity convert the result from UserCast.
17734
17735 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17736
17737         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17738         prevented it from working correctly. 
17739
17740         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17741         merely ConvertImplicit.
17742
17743 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17744
17745         * typemanager.cs: Make the LookupTypeContainer function static,
17746         and not per-instance.  
17747
17748         * class.cs: Make static FindMembers (the one that takes a Type
17749         argument). 
17750
17751         * codegen.cs: Add EmitForeach here.
17752
17753         * cs-parser.jay: Make foreach a toplevel object instead of the
17754         inline expansion, as we need to perform semantic analysis on it. 
17755
17756 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17757
17758         * expression.cs (Expression::ImplicitUserConversion): Rename to
17759         UserDefinedConversion.
17760
17761         (Expression::UserDefinedConversion): Take an extra argument specifying 
17762         whether we look for explicit user conversions too.
17763
17764         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17765
17766         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17767
17768         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17769         with the appropriate arguments.
17770
17771         * cs-parser.jay (cast_expression): Record location too.
17772
17773         * expression.cs (Cast): Record location info.
17774
17775         (Expression::ConvertExplicit): Take location argument.
17776
17777         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17778         to determine if we are doing explicit conversions.
17779
17780         (UserCast::Emit): Update accordingly.
17781
17782         (Expression::ConvertExplicit): Report an error if everything fails.
17783
17784         * ../errors/cs0030.cs : Add.
17785
17786 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17787
17788         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17789         virtual and newslot bits. 
17790
17791         * class.cs (TypeContainer::RegisterRequiredImplementations):
17792         Record methods we need.
17793
17794         (TypeContainer::MakeKey): Helper function to make keys for
17795         MethodBases, since the Methodbase key is useless.
17796
17797         (TypeContainer::Populate): Call RegisterRequiredImplementations
17798         before defining the methods.   
17799
17800         Create a mapping for method_builders_to_methods ahead of time
17801         instead of inside a tight loop.
17802
17803         (::RequireMethods):  Accept an object as the data to set into the
17804         hashtable so we can report interface vs abstract method mismatch.
17805
17806 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17807
17808         * report.cs: Make all of it static.
17809
17810         * rootcontext.cs: Drop object_type and value_type computations, as
17811         we have those in the TypeManager anyways.
17812
17813         Drop report instance variable too, now it is a global.
17814
17815         * driver.cs: Use try/catch on command line handling.
17816
17817         Add --probe option to debug the error reporting system with a test
17818         suite. 
17819
17820         * report.cs: Add support for exiting program when a probe
17821         condition is reached.
17822
17823 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17824
17825         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17826         we do a forcible conversion regardless of type, to check if 
17827         ForceConversion returns a null.
17828
17829         (Binary::error19): Use location to report error.
17830
17831         (Unary::error23): Use location here too.
17832
17833         * ../errors/cs0019.cs : Check in.
17834
17835         * ../errors/cs0023.cs : Check in.
17836
17837         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17838         case of a non-null MethodInfo object with a length of 0 !
17839
17840         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17841         an applicable member - according to the spec :-)
17842         Also fix logic to find members in base types.
17843
17844         (Unary::ResolveOperator): Same here.
17845
17846         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17847         as I was getting thoroughly confused between this and error19 :-)
17848
17849         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17850         (::FindMostEncompassedType): Implement.
17851         (::FindMostEncompassingType): Implement.
17852         (::StandardConversionExists): Implement.
17853
17854         (UserImplicitCast): Re-vamp. We now need info about most specific
17855         source and target types so that we can do the necessary conversions.
17856
17857         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17858         mathematical union with no duplicates.
17859
17860 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17861
17862         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17863         in order from base classes to child classes, so that we can in
17864         child classes look up in our parent for method names and
17865         attributes (required for handling abstract, virtual, new, override
17866         constructs: we need to instrospect our base class, and if we dont
17867         populate the classes in order, the introspection might be
17868         incorrect.  For example, a method could query its parent before
17869         the parent has any methods and would determine that the parent has
17870         no abstract methods (while it could have had them)).
17871
17872         (RootContext::CreateType): Record the order in which we define the
17873         classes.
17874
17875 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17876
17877         * class.cs (TypeContainer::Populate): Also method definitions can
17878         fail now, keep track of this.
17879
17880         (TypeContainer::FindMembers): Implement support for
17881         DeclaredOnly/noDeclaredOnly flag.
17882
17883         (Constructor::Emit) Return the ConstructorBuilder.
17884
17885         (Method::Emit) Return the MethodBuilder. 
17886         Check for abstract or virtual methods to be public.
17887
17888         * rootcontext.cs (RootContext::CreateType): Register all the
17889         abstract methods required for the class to be complete and the
17890         interface methods that must be implemented. 
17891
17892         * cs-parser.jay: Report error 501 (method requires body if it is
17893         not marked abstract or extern).
17894
17895         * expression.cs (TypeOf::Emit): Implement.
17896
17897         * typemanager.cs: runtime_handle_type, new global type.
17898
17899         * class.cs (Property::Emit): Generate code for properties.
17900
17901 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17902
17903         * expression.cs (Unary::ResolveOperator): Find operators on base type
17904         too - we now conform exactly to the spec.
17905
17906         (Binary::ResolveOperator): Same here.
17907
17908         * class.cs (Operator::Define): Fix minor quirk in the tests.
17909
17910         * ../errors/cs0215.cs : Added.
17911
17912         * ../errors/cs0556.cs : Added.
17913
17914         * ../errors/cs0555.cs : Added.
17915
17916 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17917
17918         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17919         single integer which is really efficient
17920
17921 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17922
17923         *  expression.cs (Expression::ImplicitUserConversion): Use location
17924         even in the case when we are examining True operators.
17925  
17926         * class.cs (Operator::Define): Perform extensive checks to conform
17927         with the rules for operator overloading in the spec.
17928
17929         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17930         some of the other conversions mentioned in the spec.
17931
17932         * typemanager.cs (array_type): New static member for the System.Array built-in
17933         type.
17934
17935         (cloneable_interface): For System.ICloneable interface.
17936
17937         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17938         we start resolving the tree and populating types.
17939
17940         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17941  
17942 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17943
17944         * expression.cs (Expression::ExprClassFromMemberInfo,
17945         Expression::Literalize): Create literal expressions from
17946         FieldInfos which are literals.
17947
17948         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17949         type casts, because they were wrong.  The test suite in tests
17950         caught these ones.
17951
17952         (ImplicitNumericConversion): ushort to ulong requires a widening
17953         cast. 
17954
17955         Int32 constant to long requires widening cast as well.
17956
17957         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17958         for integers because the type on the stack is not i4.
17959
17960 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * expression.cs (report118): require location argument. 
17963
17964         * parameter.cs: Do not dereference potential null value.
17965
17966         * class.cs: Catch methods that lack the `new' keyword when
17967         overriding a name.  Report warnings when `new' is used without
17968         anything being there to override.
17969
17970         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17971
17972         * class.cs: Only add constructor to hashtable if it is non-null
17973         (as now constructors can fail on define).
17974
17975         (TypeManager, Class, Struct): Take location arguments.
17976
17977         Catch field instance initialization in structs as errors.
17978
17979         accepting_filter: a new filter for FindMembers that is static so
17980         that we dont create an instance per invocation.
17981
17982         (Constructor::Define): Catch errors where a struct constructor is
17983         parameterless 
17984
17985         * cs-parser.jay: Pass location information for various new
17986         constructs. 
17987
17988         * delegate.cs (Delegate): take a location argument.
17989
17990         * driver.cs: Do not call EmitCode if there were problesm in the
17991         Definition of the types, as many Builders wont be there. 
17992
17993         * decl.cs (Decl::Decl): Require a location argument.
17994
17995         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17996         into integers, and find the most appropiate integer for it.
17997
17998         * literal.cs: Implement ULongLiteral.
17999
18000         * rootcontext.cs: Provide better information about the location of
18001         failure when CreateType fails.
18002
18003 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18004
18005         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18006         as well.
18007
18008         * expression.cs (Binary::CheckShiftArguments): Add missing type
18009         computation.
18010         (Binary::ResolveOperator): Add type to the logical and and logical
18011         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18012         before.
18013
18014         (Binary::DoNumericPromotions): In the case where either argument
18015         is ulong (and most signed types combined with ulong cause an
18016         error) perform implicit integer constant conversions as well.
18017
18018 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18019
18020         * expression.cs (UserImplicitCast): Method should always be
18021         non-null. 
18022         (Invocation::BetterConversion): Simplified test for IntLiteral.
18023
18024         (Expression::ImplicitNumericConversion): Split this routine out.
18025         Put the code that performs implicit constant integer conversions
18026         here. 
18027
18028         (Expression::Resolve): Become a wrapper around DoResolve so we can
18029         check eclass and type being set after resolve.
18030
18031         (Invocation::Badness): Remove this dead function
18032
18033         (Binary::ResolveOperator): Do not compute the expensive argumnets
18034         unless we have a union for it.
18035
18036         (Probe::Emit): Is needs to do an isinst and then
18037         compare against null.
18038
18039         (::CanConvert): Added Location argument.  If the Location argument
18040         is null (Location.Null), then we do not report errors.  This is
18041         used by the `probe' mechanism of the Explicit conversion.  We do
18042         not want to generate an error for something that the user
18043         explicitly requested to be casted.  But the pipeline for an
18044         explicit cast first tests for potential implicit casts.
18045
18046         So for now, if the Location is null, it means `Probe only' to
18047         avoid adding another argument.   Might have to revise this
18048         strategy later.
18049
18050         (ClassCast): New class used to type cast objects into arbitrary
18051         classes (used in Explicit Reference Conversions).
18052
18053         Implement `as' as well.
18054
18055         Reverted all the patches from Ravi below: they were broken:
18056
18057                 * The use of `level' as a mechanism to stop recursive
18058                   invocations is wrong.  That was there just to catch the
18059                   bug with a strack trace but not as a way of addressing
18060                   the problem.
18061
18062                   To fix the problem we have to *understand* what is going
18063                   on and the interactions and come up with a plan, not
18064                   just get things going.
18065
18066                 * The use of the type conversion cache that I proposed
18067                   last night had an open topic: How does this work across
18068                   protection domains.  A user defined conversion might not
18069                   be public in the location where we are applying the
18070                   conversion, a different conversion might be selected
18071                   (ie, private A->B (better) but public B->A (worse),
18072                   inside A, A->B applies, but outside it, B->A will
18073                   apply).
18074
18075                 * On top of that (ie, even if the above is solved),
18076                   conversions in a cache need to be abstract.  Ie, `To
18077                   convert from an Int to a Short use an OpcodeCast', not
18078                   `To convert from an Int to a Short use the OpcodeCast on
18079                   the variable 5' (which is what this patch was doing).
18080
18081 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18082
18083         * expression.cs (Invocation::ConversionExists): Re-write to use
18084         the conversion cache
18085
18086         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18087         cache all conversions done, not just user-defined ones.
18088
18089         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18090         to determine if a conversion exists instead of acutually trying to 
18091         perform the conversion. It's faster too.
18092
18093         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18094         and only then attempt the implicit conversion.
18095
18096 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18097
18098         * expression.cs (ConvertImplicit): Use a cache for conversions
18099         already found. Check level of recursion and bail out if necessary.
18100
18101 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18104         Export standard methods that we expect for string operations.
18105
18106         * statement.cs (Block::UsageWarning): Track usage of variables and
18107         report the errors for not used variables.
18108
18109         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18110         operator. 
18111
18112 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18113
18114         * codegen.cs: remove unnneded code 
18115
18116         * expression.cs: Removed BuiltinTypeAccess class
18117
18118         Fix the order in which implicit conversions are
18119         done.  
18120
18121         The previous fixed dropped support for boxed conversions (adding a
18122         test to the test suite now)
18123
18124         (UserImplicitCast::CanConvert): Remove test for source being null,
18125         that code is broken.  We should not feed a null to begin with, if
18126         we do, then we should track the bug where the problem originates
18127         and not try to cover it up here.
18128
18129         Return a resolved expression of type UserImplicitCast on success
18130         rather than true/false.  Ravi: this is what I was talking about,
18131         the pattern is to use a static method as a "constructor" for
18132         objects. 
18133
18134         Also, do not create arguments until the very last minute,
18135         otherwise we always create the arguments even for lookups that
18136         will never be performed. 
18137
18138         (UserImplicitCast::Resolve): Eliminate, objects of type
18139         UserImplicitCast are born in a fully resolved state. 
18140
18141         * typemanager.cs (InitCoreTypes): Init also value_type
18142         (System.ValueType). 
18143
18144         * expression.cs (Cast::Resolve): First resolve the child expression.
18145
18146         (LValue): Add new method AddressOf to be used by
18147         the `&' operator.  
18148
18149         Change the argument of Store to take an EmitContext instead of an
18150         ILGenerator, because things like FieldExpr need to be able to call
18151         their children expression to generate the instance code. 
18152
18153         (Expression::Error, Expression::Warning): Sugar functions for
18154         reporting errors.
18155
18156         (Expression::MemberLookup): Accept a TypeContainer instead of a
18157         Report as the first argument.
18158
18159         (Expression::ResolvePrimary): Killed.  I still want to improve
18160         this as currently the code is just not right.
18161
18162         (Expression::ResolveMemberAccess): Simplify, but it is still
18163         wrong. 
18164
18165         (Unary::Resolve): Catch errors in AddressOf operators.
18166
18167         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18168         index to a byte for the short-version, or the compiler will choose
18169         the wrong Emit call, which generates the wrong data.
18170
18171         (ParameterReference::Emit, ::Store): same.
18172
18173         (FieldExpr::AddressOf): Implement.
18174
18175         * typemanager.cs: TypeManager: made public variable instead of
18176         property.
18177
18178         * driver.cs: document --fatal.
18179
18180         * report.cs (ErrorMessage, WarningMessage): new names for the old
18181         Error and Warning classes.
18182
18183         * cs-parser.jay (member_access): Turn built-in access to types
18184         into a normal simplename
18185
18186 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18187
18188         * expression.cs (Invocation::BetterConversion): Fix to cope
18189         with q being null, since this was introducing a bug.
18190
18191         * expression.cs (ConvertImplicit): Do built-in conversions first.
18192
18193 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18194
18195         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18196
18197 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18198
18199         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18200         I had introduced long ago (what's new ?).
18201
18202         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18203         the work of all the checking. 
18204         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18205         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18206
18207         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18208         that is the right way. 
18209
18210         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18211         overloading resolution. Use everywhere instead of cutting and pasting code.
18212
18213         (Binary::ResolveOperator): Use MakeUnionSet.
18214
18215         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18216         we have to convert to bool types. Not complete yet.
18217
18218 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18219
18220         * typemanager.cs (TypeManager::CSharpName): support ushort.
18221
18222         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18223         to provide an expression that performsn an implicit constant int
18224         conversion (section 6.1.6).
18225         (Expression::ConvertImplicitRequired): Reworked to include
18226         implicit constant expression conversions.
18227
18228         (Expression::ConvertNumericExplicit): Finished.
18229
18230         (Invocation::Emit): If InstanceExpression is null, then it means
18231         that we perform a call on this.
18232
18233 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18234
18235         * expression.cs (Unary::Emit): Remove some dead code.
18236         (Probe): Implement Resolve and Emit for `is'.
18237         (Expression::ConvertImplicitRequired): Attempt to do constant
18238         expression conversions here.  Maybe should be moved to
18239         ConvertImplicit, but I am not sure.
18240         (Expression::ImplicitLongConstantConversionPossible,
18241         Expression::ImplicitIntConstantConversionPossible): New functions
18242         that tell whether is it possible to apply an implicit constant
18243         expression conversion.
18244
18245         (ConvertNumericExplicit): Started work on explicit numeric
18246         conversions.
18247
18248         * cs-parser.jay: Update operator constants.
18249
18250         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18251         (Parameters::GetSignature): Hook up VerifyArgs here.
18252         (Parameters::VerifyArgs): Verifies that no two arguments have the
18253         same name. 
18254
18255         * class.cs (Operator): Update the operator names to reflect the
18256         ones that the spec expects (as we are just stringizing the
18257         operator names).
18258
18259         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18260         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18261         previous usage did only work for our methods.
18262         (Expression::ConvertImplicit): Handle decimal implicit numeric
18263         conversions as well.
18264         (Expression::InternalTypeConstructor): Used to invoke constructors
18265         on internal types for default promotions.
18266
18267         (Unary::Emit): Implement special handling for the pre/post
18268         increment/decrement for overloaded operators, as they need to have
18269         the same semantics as the other operators.
18270
18271         (Binary::ResolveOperator): ditto.
18272         (Invocation::ConversionExists): ditto.
18273         (UserImplicitCast::Resolve): ditto.
18274
18275 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18276
18277         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18278         operator, return after emitting body. Regression tests pass again !
18279
18280         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18281         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18282         (Invocation::OverloadResolve): Ditto.
18283         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18284
18285         * everywhere : update calls to the above methods accordingly.
18286
18287 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18288
18289         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18290
18291         * expression.cs (ExpressionStatement): New base class used for
18292         expressions that can appear in statements, so that we can provide
18293         an alternate path to generate expression that do not leave a value
18294         on the stack.
18295
18296         (Expression::Emit, and all the derivatives): We no longer return
18297         whether a value is left on the stack or not.  Every expression
18298         after being emitted leaves a single value on the stack.
18299
18300         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18301         facilties of ExpressionStatement if possible.
18302
18303         * cs-parser.jay: Update statement_expression.
18304
18305 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18306
18307         * driver.cs: Change the wording of message
18308
18309 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18310
18311         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18312         the type of the expression to the return type of the method if
18313         we have an overloaded operator match ! The regression tests pass again !
18314         (Unary::ResolveOperator): Ditto.
18315
18316         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18317         to find "op_Implicit", not "implicit" ;-)
18318         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18319         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18320
18321         * everywhere : Correct calls to the above accordingly.
18322
18323         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18324         (ConvertImplicit): Do user-defined conversion if it exists.
18325
18326 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18327
18328         * assign.cs: track location.
18329         (Resolve): Use implicit conversions on assignment.
18330
18331         * literal.cs: Oops.  Not good, Emit of short access values should
18332         pass (Bytes) or the wrong argument will be selected.
18333
18334         * expression.cs (Unary::Emit): Emit code for -expr.
18335
18336         (Unary::ResolveOperator): Handle `Substract' for non-constants
18337         (substract from zero from the non-constants).
18338         Deal with Doubles as well. 
18339
18340         (Expression::ConvertImplicitRequired): New routine that reports an
18341         error if no implicit conversion exists. 
18342
18343         (Invocation::OverloadResolve): Store the converted implicit
18344         expressions if we make them
18345
18346 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18347
18348         * class.cs (ConstructorInitializer): Take a Location argument.
18349         (ConstructorBaseInitializer): Same here.
18350         (ConstructorThisInitializer): Same here.
18351
18352         * cs-parser.jay : Update all calls accordingly.
18353
18354         * expression.cs (Unary, Binary, New): Take location argument.
18355         Update accordingly everywhere.
18356
18357         * cs-parser.jay : Update all calls to the above to take a location
18358         argument.
18359
18360         * class.cs : Ditto.
18361
18362 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18363
18364         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18365         (Invocation::BetterConversion): Same here
18366         (Invocation::ConversionExists): Ditto.
18367
18368         (Invocation::ConversionExists): Implement.
18369
18370 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18371
18372         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18373         Also take an additional TypeContainer argument.
18374
18375         * All over : Pass in TypeContainer as argument to OverloadResolve.
18376
18377         * typemanager.cs (CSharpName): Update to check for the string type and return
18378         that too.
18379
18380         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18381         a given method.
18382
18383 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18384
18385         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18386         (Invocation::BetterFunction): Implement.
18387         (Invocation::BetterConversion): Implement.
18388         (Invocation::ConversionExists): Skeleton, no implementation yet.
18389
18390         Okay, things work fine !
18391
18392 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18393
18394         * typemanager.cs: declare and load enum_type, delegate_type and
18395         void_type. 
18396
18397         * expression.cs (Expression::Emit): Now emit returns a value that
18398         tells whether a value is left on the stack or not.  This strategy
18399         might be reveted tomorrow with a mechanism that would address
18400         multiple assignments.
18401         (Expression::report118): Utility routine to report mismatches on
18402         the ExprClass.
18403
18404         (Unary::Report23): Report impossible type/operator combination
18405         utility function.
18406
18407         (Unary::IsIncrementableNumber): Whether the type can be
18408         incremented or decremented with add.
18409         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18410         complemented. 
18411         (Unary::ResolveOperator): Implement ++, !, ~,
18412
18413         (Invocation::Emit): Deal with new Emit convetion.
18414
18415         * All Expression derivatives: Updated their Emit method to return
18416         whether they leave values on the stack or not.
18417
18418         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18419         stack for expressions that are statements. 
18420
18421 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18422
18423         * expression.cs (LValue): New interface.  Must be implemented by
18424         LValue objects.
18425         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18426         LValue interface.
18427
18428         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18429         interface for generating code, simplifies the code.
18430
18431 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18432
18433         * expression.cs (everywhere): Comment out return statements in ::Resolve
18434         methods to avoid the warnings.
18435
18436 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * driver.cs (parse): Report error 2001 if we can not open the
18439         source file.
18440
18441         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18442         not resolve it.
18443
18444         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18445         object. 
18446
18447         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18448         otherwise nested blocks end up with the same index.
18449
18450         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18451
18452         * expression.cs:  Instead of having FIXMEs in the Resolve
18453         functions, throw exceptions so it is obvious that we are facing a
18454         bug. 
18455
18456         * cs-parser.jay (invocation_expression): Pass Location information.
18457
18458         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18459         Use a basename for those routines because .NET does not like paths
18460         on them. 
18461
18462         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18463         already defined.
18464
18465 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18466
18467         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18468         are loading the correct data types (throws an exception if not).
18469         (TypeManager::InitCoreTypes): Use CoreLookupType
18470
18471         * expression.cs (Unary::ResolveOperator): return the child
18472         expression for expressions which are just +expr.
18473         (Unary::ResolveOperator): Return negative literals for -LITERAL
18474         expressions (otherwise they are Unary {Literal}).
18475         (Invocation::Badness): Take into account `Implicit constant
18476         expression conversions'.
18477
18478         * literal.cs (LongLiteral): Implement long literal class.
18479         (IntLiteral): export the `Value' of the intliteral. 
18480
18481 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18482
18483         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18484
18485         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18486         instead of 'Operator'
18487
18488         * expression.cs (Binary::ResolveOperator): Update accordingly.
18489         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18490         and 'Minus'
18491
18492         * cs-parser.jay (unary_expression): Update to use the new names.
18493
18494         * gen-treedump.cs (GetUnary): Same here.
18495
18496         * expression.cs (Unary::Resolve): Implement.
18497         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18498         operators are found instead of making noise ;-)
18499         (Unary::ResolveOperator): New method to do precisely the same thing which
18500         Binary::ResolveOperator does for Binary expressions.
18501         (Unary.method, .Arguments): Add.
18502         (Unary::OperName): Implement.   
18503         (Unary::ForceConversion): Copy and Paste !
18504
18505         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18506         a unary operator.
18507
18508         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18509         for the inbuilt operators. Only overloading works for now ;-)
18510
18511 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18512
18513         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18514         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18515
18516         * expression.cs (This::Emit): Implement. 
18517         (This::Resolve): Implement.
18518         (TypeOf:Resolve): Implement.
18519         (Expression::ResolveSimpleName): Add an implicit this to instance
18520         field references. 
18521         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18522         Bind instance variable to Field expressions.
18523         (FieldExpr::Instance): New field used to track the expression that
18524         represents the object instance.
18525         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18526         binding 
18527         (FieldExpr::Emit): Implement.
18528
18529         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18530         the last instruction contains a return opcode to avoid generating
18531         the last `ret' instruction (this generates correct code, and it is
18532         nice to pass the peverify output).
18533
18534         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18535         initializer for static and instance variables.
18536         (Constructor::Emit): Allow initializer to be null in the case of
18537         static constructors.  Only emit initializer for instance
18538         constructors. 
18539
18540         (TypeContainer::FindMembers): Return a null array if there are no
18541         matches.
18542
18543         Also fix the code for the MemberTypes.Method branch, as it was not
18544         scanning that for operators (or tried to access null variables before).
18545
18546         * assign.cs (Assign::Emit): Handle instance and static fields. 
18547
18548         * TODO: Updated.
18549
18550         * driver.cs: Stop compilation if there are parse errors.
18551
18552         * cs-parser.jay (constructor_declaration): Provide default base
18553         initializer for non-static constructors.
18554         (constructor_declarator): Do not provide a default base
18555         initializers if none was specified.
18556         Catch the fact that constructors should not have parameters.
18557
18558         * class.cs: Do not emit parent class initializers for static
18559         constructors, that should be flagged as an error.
18560
18561 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18562
18563         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18564         Move back code into TypeContainer::Populate.
18565
18566 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18567
18568         * class.cs (TypeContainer::AddConstructor): Fix the check to
18569         compare against Name, not Basename. 
18570         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18571
18572         * cs-parser.jay : Update accordingly.
18573
18574         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18575         for methods, don't forget to look into the operators too.
18576         (RegisterMethodBuilder): Helper method to take care of this for
18577         methods, constructors and operators.
18578         (Operator::Define): Completely revamp.
18579         (Operator.OperatorMethod, MethodName): New fields.
18580         (TypeContainer::Populate): Move the registering of builders into
18581         RegisterMethodBuilder.
18582         (Operator::Emit): Re-write.
18583
18584         * expression.cs (Binary::Emit): Comment out code path to emit method
18585         invocation stuff for the case when we have a user defined operator. I am
18586         just not able to get it right !
18587
18588 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18589
18590         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18591         argument. 
18592
18593         (Expression::MemberLookup): Provide a version that allows to
18594         specify the MemberTypes and BindingFlags. 
18595
18596         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18597         so it was not fetching variable information from outer blocks.
18598
18599         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18600         Beforefieldinit as it was buggy.
18601
18602         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18603         that Ravi put here.  
18604
18605         * class.cs (Constructor::Emit): Only emit if block is not null.
18606         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18607         deal with this by semantically definining it as if the user had
18608         done it.
18609
18610         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18611         constructors as we now "emit" them at a higher level.
18612
18613         (TypeContainer::DefineDefaultConstructor): Used to define the
18614         default constructors if none was provided.
18615
18616         (ConstructorInitializer): Add methods Resolve and Emit. 
18617
18618         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18619
18620 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18621
18622         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18623         the default constructor builder with our hashtable for methodbuilders
18624         to methodcores.
18625
18626         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18627         and argument_count is 0 in which case we have a match.
18628         (Binary::ResolveOperator): More null checking and miscellaneous coding
18629         style cleanup.
18630
18631 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18632
18633         * rootcontext.cs (IsNameSpace): Compare against null.
18634
18635         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18636
18637         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18638         and Unary::Operator.
18639
18640         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18641         accordingly.
18642
18643         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18644         we have overloaded operators.
18645         (Binary::ResolveOperator): Implement the part which does the operator overload
18646         resolution.
18647
18648         * class.cs (Operator::Emit): Implement.
18649         (TypeContainer::Emit): Emit the operators we have too.
18650
18651         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18652         the case when we have a user-defined operator.
18653
18654 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18657
18658 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18659
18660         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18661         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18662         (Constructor::Emit): Implement.
18663         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18664         if we have no work to do. 
18665         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18666         Emit method.
18667
18668         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18669         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18670
18671         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18672         of parent.parent.
18673
18674 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18675
18676         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18677         in the source.
18678         (Tree::RecordNamespace): Method to do what the name says ;-)
18679         (Tree::Namespaces): Property to get at the namespaces hashtable.
18680
18681         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18682         keep track.
18683
18684         * rootcontext.cs (IsNamespace): Fixed it :-)
18685
18686 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * class.cs (TypeContainer::FindMembers): Add support for
18689         constructors. 
18690         (MethodCore): New class that encapsulates both the shared aspects
18691         of a Constructor and a Method.  
18692         (Method, Constructor): Factored pieces into MethodCore.
18693
18694         * driver.cs: Added --fatal which makes errors throw exceptions.
18695         Load System assembly as well as part of the standard library.
18696
18697         * report.cs: Allow throwing exceptions on errors for debugging.
18698
18699         * modifiers.cs: Do not use `parent', instead use the real type
18700         container to evaluate permission settings.
18701
18702         * class.cs: Put Ravi's patch back in.  He is right, and we will
18703         have to cope with the
18704
18705 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18706
18707         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18708         FamORAssem, not FamANDAssem.
18709
18710 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18711
18712         * driver.cs: Added --parse option that only parses its input files
18713         and terminates.
18714
18715         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18716         incorrect.  IsTopLevel is not used to tell whether an object is
18717         root_types or not (that can be achieved by testing this ==
18718         root_types).  But to see if this is a top-level *class* (not
18719         necessarly our "toplevel" container). 
18720
18721 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18722
18723         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18724         parent instead of a direct call to GetType.
18725
18726 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18727
18728         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18729         Modifiers.TypeAttr. This should just be a call to that method.
18730
18731         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18732         object so that we can determine if we are top-level or not.
18733
18734         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18735         TypeContainer too.
18736
18737         * enum.cs (Enum::Define): Ditto.
18738
18739         * modifiers.cs (FieldAttr): Re-write.
18740
18741         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18742         (TypeContainer::HaveStaticConstructor): New property to provide access
18743         to precisely that info.
18744
18745         * modifiers.cs (MethodAttr): Re-write.
18746         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18747
18748         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18749         of top-level types as claimed.
18750
18751 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18752
18753         * expression.cs (MemberLookup): Fruitless attempt to lookup
18754         constructors.  Maybe I need to emit default constructors?  That
18755         might be it (currently .NET emits this for me automatically).
18756         (Invocation::OverloadResolve): Cope with Arguments == null.
18757         (Invocation::EmitArguments): new function, shared by the new
18758         constructor and us.
18759         (Invocation::Emit): Handle static and instance methods.  Emit
18760         proper call instruction for virtual or non-virtual invocations.
18761         (New::Emit): Implement.
18762         (New::Resolve): Implement.
18763         (MemberAccess:Resolve): Implement.
18764         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18765         to track instances.
18766         (FieldExpr::Resolve): Set type.
18767
18768         * support.cs: Handle empty arguments.
18769                 
18770         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18771         SimpleLookup): Auxiliary routines to help parse a qualifier
18772         identifier.  
18773
18774         Update qualifier_identifier rule.
18775
18776         * codegen.cs: Removed debugging messages.
18777
18778         * class.cs: Make this a global thing, this acts just as a "key" to
18779         objects that we might have around.
18780
18781         (Populate): Only initialize method_builders_to_methods once.
18782
18783         * expression.cs (PropertyExpr): Initialize type from the
18784         PropertyType. 
18785
18786         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18787         Resolve pattern.  Attempt to implicitly convert value to boolean.
18788         Emit code.
18789
18790         * expression.cs: Set the type for the int32/int32 argument case.
18791         (Binary::ResolveOperator): Set the return type to boolean for
18792         comparission operators
18793
18794         * typemanager.cs: Remove debugging print code.
18795
18796         (Invocation::Resolve): resolve type.
18797
18798         * class.cs: Allocate a MemberInfo of the correct size, as the code
18799         elsewhere depends on the test to reflect the correct contents.
18800
18801         (Method::) Keep track of parameters, due to System.Reflection holes
18802
18803         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18804         mapping here.
18805
18806         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18807         of the exact size and return that.
18808
18809         (Class::LookupMethodByBuilder): New function that maps
18810         MethodBuilders to its methods.  Required to locate the information
18811         on methods because System.Reflection bit us again.
18812
18813         * support.cs: New file, contains an interface ParameterData and
18814         two implementations: ReflectionParameters and InternalParameters
18815         used to access Parameter information.  We will need to grow this
18816         as required.
18817
18818         * expression.cs (Invocation::GetParameterData): implement a cache
18819         and a wrapper around the ParameterData creation for methods. 
18820         (Invocation::OverloadResolve): Use new code.
18821
18822 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18823
18824         * class.cs (TypeContainer::EmitField): Remove and move into 
18825         (Field::Define): here and modify accordingly.
18826         (Field.FieldBuilder): New member.
18827         (TypeContainer::Populate): Update accordingly.
18828         (TypeContainer::FindMembers): Implement.
18829
18830 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * statement.cs: (VariableInfo::VariableType): New field to be
18833         initialized with the full type once it is resolved. 
18834
18835 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * parameter.cs (GetParameterInfo): Use a type cache to compute
18838         things only once, and to reuse this information
18839
18840         * expression.cs (LocalVariableReference::Emit): Implement.
18841         (OpcodeCast::Emit): fix.
18842
18843         (ParameterReference::Resolve): Implement.
18844         (ParameterReference::Emit): Implement.
18845
18846         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18847         that are expressions need to stay as Expressions.
18848
18849         * typemanager.cs (CSharpName): Returns the C# name of a type if
18850         possible. 
18851
18852         * expression.cs (Expression::ConvertImplicit): New function that
18853         implements implicit type conversions.
18854
18855         (Expression::ImplicitReferenceConversion): Implements implicit
18856         reference conversions.
18857
18858         (EmptyCast): New type for transparent casts.
18859
18860         (OpcodeCast): New type for casts of types that are performed with
18861         a sequence of bytecodes.
18862
18863         (BoxedCast): New type used for casting value types into reference
18864         types.  Emits a box opcode.
18865
18866         (Binary::DoNumericPromotions): Implements numeric promotions of
18867         and computation of the Binary::Type.
18868
18869         (Binary::EmitBranchable): Optimization.
18870
18871         (Binary::Emit): Implement code emission for expressions.
18872
18873         * typemanager.cs (TypeManager): Added two new core types: sbyte
18874         and byte.
18875
18876 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18877
18878         * class.cs (TypeContainer::FindMembers): Method which does exactly
18879         what Type.FindMembers does, only we don't have to use reflection. No
18880         implementation yet.
18881
18882         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18883         typecontainer objects as we need to get at them.
18884         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18885
18886         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18887         typecontainer object.
18888
18889         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18890         of just a Report object.
18891
18892 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18893
18894         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18895         "remove_"
18896         (TypeContainer::Populate): Now define the delegates of the type too.
18897         (TypeContainer.Delegates): Property to access the list of delegates defined
18898         in the type.
18899
18900         * delegates.cs (Delegate::Define): Implement partially.
18901
18902         * modifiers.cs (TypeAttr): Handle more flags.
18903
18904 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18905
18906         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18907         and not <=
18908         (Operator::Define): Re-write logic to get types by using the LookupType method
18909         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18910         (Indexer::Define): Ditto.
18911         (Event::Define): Ditto.
18912         (Property::Define): Ditto.
18913
18914 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18915
18916         * class.cs (TypeContainer::Populate): Now define operators too. 
18917         (TypeContainer.Operators): New property to access the list of operators
18918         in a type.
18919         (Operator.OperatorMethodBuilder): New member to hold the method builder
18920         for the operator we are defining.
18921         (Operator::Define): Implement.
18922
18923 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18924
18925         * class.cs (Event::Define): Make the prefixes of the accessor methods
18926         addOn_ and removeOn_ 
18927
18928         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18929         of the location being passed in too. Ideally, this should go later since all
18930         error reporting should be done through the Report object.
18931
18932         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18933         (Populate): Iterate thru the indexers we have and define them too.
18934         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18935         for the get and set accessors.
18936         (Indexer::Define): Implement.
18937
18938 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18939
18940         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18941         my previous implementation, did not work.
18942
18943         * typemanager.cs: Add a couple of missing types (the longs).
18944
18945         * literal.cs: Use TypeManager.bool_type instead of getting it.
18946
18947         * expression.cs (EventExpr): New kind of expressions.
18948         (Expressio::ExprClassFromMemberInfo): finish
18949
18950 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18951
18952         * assign.cs: Emit stores to static fields differently.
18953
18954 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18955
18956         * Merge in changes and adjust code to tackle conflicts. Backed out my
18957         code in Assign::Resolve ;-) 
18958
18959 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18960
18961         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18962         instead Report.Error and also pass in the location.
18963         (CSharpParser::Lexer): New readonly property to return the reference
18964         to the Tokenizer object.
18965         (declare_local_variables): Use Report.Error with location instead of plain 
18966         old error.
18967         (CheckDef): Ditto.
18968
18969         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18970         (Operator.CheckBinaryOperator): Ditto.
18971
18972         * cs-parser.jay (operator_declarator): Update accordingly.
18973
18974         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18975         (CheckBinaryOperator): Same here.
18976
18977         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18978         on the name without any prefixes of namespace names etc. This is because we
18979         already might have something already fully qualified like 
18980         'System.Console.WriteLine'
18981
18982         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18983
18984 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18985
18986         * cs-tokenizer.cs (location): Return a string which also contains
18987         the file name.
18988
18989         * expression.cs (ElementAccess): New class for expressions of the
18990         type 'element access.'
18991         (BaseAccess): New class for expressions of the type 'base access.'
18992         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18993         respectively.
18994
18995         * cs-parser.jay (element_access): Implement action.
18996         (base_access): Implement actions.
18997         (checked_expression, unchecked_expression): Implement.
18998
18999         * cs-parser.jay (local_variable_type): Correct and implement.
19000         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19001
19002         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19003
19004         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19005         name and the specifiers.
19006
19007         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19008
19009         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19010         making them all public ;-)
19011
19012         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19013         class anyways.
19014
19015 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19016
19017         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19018         PropertyExprs.
19019         (FieldExpr, PropertyExprs): New resolved expressions.
19020         (SimpleName::MemberStaticCheck): Perform static checks for access
19021         to non-static fields on static methods. Maybe this should be
19022         generalized for MemberAccesses. 
19023         (SimpleName::ResolveSimpleName): More work on simple name
19024         resolution. 
19025
19026         * cs-parser.jay (primary_expression/qualified_identifier): track
19027         the parameter index.
19028
19029         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19030         (EmitContext::EmitBoolExpression): Chain to expression generation
19031         instead of temporary hack.
19032         (::EmitStatementExpression): Put generic expression code generation.
19033
19034         * assign.cs (Assign::Emit): Implement variable assignments to
19035         local variables, parameters and fields.
19036
19037 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19038
19039         * statement.cs (Block::GetVariableInfo): New method, returns the
19040         VariableInfo for a variable name in a block.
19041         (Block::GetVariableType): Implement in terms of GetVariableInfo
19042
19043         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19044         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19045
19046 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19047
19048         * cs-parser.jay (operator_declaration): Continue on my quest : update
19049         to take attributes argument.
19050         (event_declaration): Ditto.
19051         (enum_declaration): Ditto.
19052         (indexer_declaration): Ditto.
19053
19054         * class.cs (Operator::Operator): Update constructor accordingly.
19055         (Event::Event): Ditto.
19056
19057         * delegate.cs (Delegate::Delegate): Same here.
19058
19059         * enum.cs (Enum::Enum): Same here.
19060
19061 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19062
19063         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19064
19065         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19066
19067         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19068         being passed around as an arraylist.
19069         (Attributes::AddAttribute): Method to add attribute sections.
19070
19071         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19072         (struct_declaration): Update accordingly.
19073         (constant_declaration): Update.
19074         (field_declaration): Update.
19075         (method_header): Update.
19076         (fixed_parameter): Update.
19077         (parameter_array): Ditto.
19078         (property_declaration): Ditto.
19079         (destructor_declaration): Ditto.
19080
19081         * class.cs (Struct::Struct): Update constructors accordingly.
19082         (Class::Class): Ditto.
19083         (Field::Field): Ditto.
19084         (Method::Method): Ditto.
19085         (Property::Property): Ditto.
19086         (TypeContainer::OptAttribute): update property's return type.
19087
19088         * interface.cs (Interface.opt_attributes): New member.
19089         (Interface::Interface): Update to take the extra Attributes argument.
19090
19091         * parameter.cs (Parameter::Parameter): Ditto.
19092
19093         * constant.cs (Constant::Constant): Ditto.
19094
19095         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19096         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19097         the attributes as a parameter.
19098         (InterfaceProperty): Update constructor call.
19099         (InterfaceEvent): Ditto.
19100         (InterfaceMethod): Ditto.
19101         (InterfaceIndexer): Ditto.
19102
19103         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19104         pass the attributes too.
19105         (interface_event_declaration): Ditto.
19106         (interface_property_declaration): Ditto.
19107         (interface_method_declaration): Ditto.
19108         (interface_declaration): Ditto.
19109
19110 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19111
19112         * class.cs (Method::Define): Track the "static Main" definition to
19113         create an entry point. 
19114
19115         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19116         EntryPoint if we find it. 
19117
19118         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19119         (EmitContext::ig): Make this variable public.
19120
19121         * driver.cs: Make the default output file be the first file name
19122         with the .exe extension.  
19123
19124         Detect empty compilations
19125
19126         Handle various kinds of output targets.  Handle --target and
19127         rename -t to --dumper.
19128
19129         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19130         methods inherited from Expression return now an Expression.  This
19131         will is used during the tree rewriting as we resolve them during
19132         semantic analysis.
19133
19134         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19135         the spec.  Missing entirely is the information about
19136         accessability of elements of it.
19137
19138         (Expression::ExprClassFromMemberInfo): New constructor for
19139         Expressions that creates a fully initialized Expression based on
19140         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19141         a Type.
19142
19143         (Invocation::Resolve): Begin implementing resolution of invocations.
19144
19145         * literal.cs (StringLiteral):  Implement Emit.
19146
19147 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19148
19149         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19150         member.
19151
19152 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19153
19154         * cs-parser.jay (attribute_arguments): Implement actions.
19155         (attribute): Fix bug in production. Implement action.
19156         (attribute_list): Implement.
19157         (attribute_target): Implement.
19158         (attribute_target_specifier, opt_target_specifier): Implement
19159         (CheckAttributeTarget): New method to check if the attribute target
19160         is valid.
19161         (attribute_section): Implement.
19162         (opt_attributes): Implement.
19163
19164         * attribute.cs : New file to handle attributes.
19165         (Attribute): Class to hold attribute info.
19166
19167         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19168         (attribute_section): Modify production to use 2 different rules to 
19169         achieve the same thing. 1 s/r conflict down !
19170         Clean out commented, useless, non-reducing dimension_separator rules.
19171
19172         * class.cs (TypeContainer.attributes): New member to hold list
19173         of attributes for a type.
19174         (Struct::Struct): Modify to take one more argument, the attribute list.
19175         (Class::Class): Ditto.
19176         (Field::Field): Ditto.
19177         (Method::Method): Ditto.
19178         (Property::Property): Ditto.
19179
19180         * cs-parser.jay (struct_declaration): Update constructor call to
19181         pass in the attributes too.
19182         (class_declaration): Ditto.
19183         (constant_declaration): Ditto.
19184         (field_declaration): Ditto.
19185         (method_header): Ditto.
19186         (fixed_parameter): Ditto.
19187         (parameter_array): Ditto.
19188         (property_declaration): Ditto.
19189
19190         * constant.cs (Constant::Constant): Update constructor similarly.
19191         Use System.Collections.
19192
19193         * parameter.cs (Parameter::Parameter): Update as above.
19194
19195 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19196
19197         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19198         (TypeContainer.delegates): New member to hold list of delegates.
19199
19200         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19201         this time as I seem to be on crack ;-)
19202
19203 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19204
19205         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19206         tell whether an identifier represents a namespace.
19207
19208         * expression.cs (NamespaceExpr): A namespace expression, used only
19209         temporarly during expression resolution.
19210         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19211         utility functions to resolve names on expressions.
19212
19213 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19214
19215         * codegen.cs: Add hook for StatementExpressions. 
19216
19217         * class.cs: Fix inverted test for static flag in methods.
19218
19219 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19220
19221         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19222         to make it coincide with MS' number.
19223         (Operator::CheckBinaryOperator): Ditto.
19224
19225         * ../errors/errors.txt : Remove error numbers added earlier.
19226
19227         * ../errors/cs1019.cs : Test case for error # 1019
19228
19229         * ../errros/cs1020.cs : Test case for error # 1020
19230
19231         * cs-parser.jay : Clean out commented cruft.
19232         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19233         used anywhere - non-reducing rule.
19234         (namespace_declarations): Non-reducing rule - comment out.
19235
19236         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19237         with TypeContainer::AddEnum.
19238
19239         * delegate.cs : New file for delegate handling classes.
19240         (Delegate): Class for declaring delegates.
19241
19242         * makefile : Update.
19243
19244         * cs-parser.jay (delegate_declaration): Implement.
19245
19246 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19247
19248         * class.cs (Event::Define): Implement.
19249         (Event.EventBuilder): New member.
19250
19251         * class.cs (TypeContainer::Populate): Update to define all enums and events
19252         we have.
19253         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19254         readonly fields for all these cases ?
19255
19256 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19257
19258         * class.cs (Property): Revamp to use the convention of making fields readonly.
19259         Accordingly modify code elsewhere.
19260
19261         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19262         the Define method of the Property class.
19263
19264         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19265         trivial bug.
19266         (TypeContainer::Populate): Update to define all the properties we have. Also
19267         define all enumerations.
19268
19269         * enum.cs (Define): Implement.
19270
19271 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19272
19273         * cs-parser.jay (overloadable_operator): The semantic value is an
19274         enum of the Operator class.
19275         (operator_declarator): Implement actions.
19276         (operator_declaration): Implement.
19277
19278         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19279         validity of definitions.
19280         (Operator::CheckBinaryOperator): Static method to check for binary operators
19281         (TypeContainer::AddOperator): New method to add an operator to a type.
19282
19283         * cs-parser.jay (indexer_declaration): Added line to actually call the
19284         AddIndexer method so it gets added ;-)
19285
19286         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19287         already taken care of by the MS compiler ?  
19288
19289 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19290
19291         * class.cs (Operator): New class for operator declarations.
19292         (Operator::OpType): Enum for the various operators.
19293
19294 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19295
19296         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19297         ostensibly handle this in semantic analysis.
19298
19299         * cs-parser.jay (general_catch_clause): Comment out
19300         (specific_catch_clauses, specific_catch_clause): Ditto.
19301         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19302         (catch_args, opt_catch_args): New productions.
19303         (catch_clause): Rewrite to use the new productions above
19304         (catch_clauses): Modify accordingly.
19305         (opt_catch_clauses): New production to use in try_statement
19306         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19307         and re-write the code in the actions to extract the specific and
19308         general catch clauses by being a little smart ;-)
19309
19310         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19311         Hooray, try and catch statements parse fine !
19312
19313 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19314
19315         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19316         string from the hashtable of variables.
19317
19318         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19319         I end up making that mistake ;-)
19320         (catch_clauses): Fixed gross error which made Key and Value of the 
19321         DictionaryEntry the same : $1 !!
19322
19323 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19324
19325         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19326
19327         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19328         when the add and remove accessors are specified. 
19329
19330 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19331
19332         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19333         information about indexer_declarator.
19334         (indexer_declarator): Implement actions.
19335         (parsing_indexer): New local boolean used to keep track of whether
19336         we are parsing indexers or properties. This is necessary because 
19337         implicit_parameters come into picture even for the get accessor in the 
19338         case of an indexer.
19339         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19340
19341         * class.cs (Indexer): New class for indexer declarations.
19342         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19343         (TypeContainer::indexers): New member to hold list of indexers for the
19344         type.
19345
19346 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19347
19348         * cs-parser.jay (add_accessor_declaration): Implement action.
19349         (remove_accessor_declaration): Implement action.
19350         (event_accessors_declaration): Implement
19351         (variable_declarators): swap statements for first rule - trivial.
19352
19353         * class.cs (Event): New class to hold information about event
19354         declarations.
19355         (TypeContainer::AddEvent): New method to add an event to a type
19356         (TypeContainer::events): New member to hold list of events.
19357
19358         * cs-parser.jay (event_declaration): Implement actions.
19359
19360 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19361
19362         * cs-parser.jay (dim_separators): Implement. Make it a string
19363         concatenating all the commas together, just as they appear.
19364         (opt_dim_separators): Modify accordingly
19365         (rank_specifiers): Update accordingly. Basically do the same
19366         thing - instead, collect the brackets here.
19367         (opt_rank_sepcifiers): Modify accordingly.
19368         (array_type): Modify to actually return the complete type string
19369         instead of ignoring the rank_specifiers.
19370         (expression_list): Implement to collect the expressions
19371         (variable_initializer): Implement. We make it a list of expressions
19372         essentially so that we can handle the array_initializer case neatly too.
19373         (variable_initializer_list): Implement.
19374         (array_initializer): Make it a list of variable_initializers
19375         (opt_array_initializer): Modify accordingly.
19376
19377         * expression.cs (New::NType): Add enumeration to help us
19378         keep track of whether we have an object/delegate creation
19379         or an array creation.
19380         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19381         members to hold data about array creation.
19382         (New:New): Modify to update NewType
19383         (New:New): New Overloaded contructor for the array creation
19384         case.
19385
19386         * cs-parser.jay (array_creation_expression): Implement to call
19387         the overloaded New constructor.
19388
19389 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19390
19391         * class.cs (TypeContainer::Constructors): Return member
19392         constructors instead of returning null.
19393
19394 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19395
19396         * typemanager.cs (InitCoreTypes): Initialize the various core
19397         types after we have populated the type manager with the user
19398         defined types (this distinction will be important later while
19399         compiling corlib.dll)
19400
19401         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19402         on Expression Classification.  Now all expressions have a method
19403         `Resolve' and a method `Emit'.
19404
19405         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19406         generation from working.     Also add some temporary debugging
19407         code. 
19408
19409 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19410
19411         * codegen.cs: Lots of code generation pieces.  This is only the
19412         beginning, will continue tomorrow with more touches of polish.  We
19413         handle the fundamentals of if, while, do, for, return.  Others are
19414         trickier and I need to start working on invocations soon.
19415
19416         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19417         s.InitStatement. 
19418
19419         * codegen.cs (EmitContext): New struct, used during code
19420         emission to keep a context.   Most of the code generation will be
19421         here. 
19422
19423         * cs-parser.jay: Add embedded blocks to the list of statements of
19424         this block.  So code generation proceeds in a top down fashion.
19425
19426 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19427
19428         * statement.cs: Add support for multiple child blocks.
19429
19430 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * codegen.cs (EmitCode): New function, will emit the code for a
19433         Block of code given a TypeContainer and its ILGenerator. 
19434
19435         * statement.cs (Block): Standard public readonly optimization.
19436         (Block::Block constructors): Link children. 
19437         (Block::Child): Child Linker.
19438         (Block::EmitVariables): Emits IL variable declarations.
19439
19440         * class.cs: Drop support for MethodGroups here, delay until
19441         Semantic Analysis.
19442         (Method::): Applied the same simplification that I did before, and
19443         move from Properties to public readonly fields.
19444         (Method::ParameterTypes): Returns the parameter types for the
19445         function, and implements a cache that will be useful later when I
19446         do error checking and the semantic analysis on the methods is
19447         performed.
19448         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19449         and made a method, optional argument tells whether this is a class
19450         or a structure to apply the `has-this' bit.
19451         (Method::GetCallingConvention): Implement, returns the calling
19452         convention. 
19453         (Method::Define): Defines the type, a second pass is performed
19454         later to populate the methods.
19455
19456         (Constructor::ParameterTypes): implement a cache similar to the
19457         one on Method::ParameterTypes, useful later when we do semantic
19458         analysis. 
19459
19460         (TypeContainer::EmitMethod):  New method.  Emits methods.
19461
19462         * expression.cs: Removed MethodGroup class from here.
19463
19464         * parameter.cs (Parameters::GetCallingConvention): new method.
19465
19466 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19467
19468         * class.cs (TypeContainer::Populate): Drop RootContext from the
19469         argument. 
19470
19471         (Constructor::CallingConvention): Returns the calling convention.
19472         (Constructor::ParameterTypes): Returns the constructor parameter
19473         types. 
19474
19475         (TypeContainer::AddConstructor): Keep track of default constructor
19476         and the default static constructor.
19477
19478         (Constructor::) Another class that starts using `public readonly'
19479         instead of properties. 
19480
19481         (Constructor::IsDefault): Whether this is a default constructor. 
19482
19483         (Field::) use readonly public fields instead of properties also.
19484
19485         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19486         track of static constructors;  If none is used, turn on
19487         BeforeFieldInit in the TypeAttributes. 
19488
19489         * cs-parser.jay (opt_argument_list): now the return can be null
19490         for the cases where there are no arguments. 
19491
19492         (constructor_declarator): If there is no implicit `base' or
19493         `this', then invoke the default parent constructor. 
19494
19495         * modifiers.cs (MethodAttr): New static function maps a set of
19496         modifiers flags into a MethodAttributes enum
19497         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19498         MethodAttr, TypeAttr to represent the various mappings where the
19499         modifiers are used.
19500         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19501
19502 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19503
19504         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19505         method arguments.
19506
19507         * interface.cs (PopulateIndexer): Implemented the code generator
19508         for interface indexers.
19509
19510 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * interface.cs (InterfaceMemberBase): Now we track the new status
19513         here.  
19514
19515         (PopulateProperty): Implement property population.  Woohoo!  Got
19516         Methods and Properties going today. 
19517
19518         Removed all the properties for interfaces, and replaced them with
19519         `public readonly' fields. 
19520
19521 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19522
19523         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19524         initialize their hashtables/arraylists only when they are needed
19525         instead of doing this always.
19526
19527         * parameter.cs: Handle refs and out parameters.
19528
19529         * cs-parser.jay: Use an ArrayList to construct the arguments
19530         instead of the ParameterCollection, and then cast that to a
19531         Parameter[] array.
19532
19533         * parameter.cs: Drop the use of ParameterCollection and use
19534         instead arrays of Parameters.
19535
19536         (GetParameterInfo): Use the Type, not the Name when resolving
19537         types. 
19538
19539 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19540
19541         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19542         and instead use public readonly fields.
19543
19544         * class.cs: Put back walking code for type containers.
19545
19546 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19547
19548         * class.cs (MakeConstant): Code to define constants.
19549
19550         * rootcontext.cs (LookupType): New function.  Used to locate types 
19551
19552
19553 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19554
19555         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19556         this System.Reflection code is.  Kudos to Microsoft
19557
19558         * typemanager.cs: Implement a type cache and avoid loading all
19559         types at boot time.  Wrap in LookupType the internals.  This made
19560         the compiler so much faster.  Wow.  I rule!
19561
19562         * driver.cs: Make sure we always load mscorlib first (for
19563         debugging purposes, nothing really important).
19564
19565         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19566         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19567
19568         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19569         on namespaces that have been imported using the `using' keyword.
19570
19571         * class.cs (TypeContainer::TypeAttr): Virtualize.
19572         (Class::TypeAttr): Return attributes suitable for this bad boy.
19573         (Struct::TypeAttr): ditto.
19574         Handle nested classes.
19575         (TypeContainer::) Remove all the type visiting code, it is now
19576         replaced with the rootcontext.cs code
19577
19578         * rootcontext.cs (GetClassBases): Added support for structs. 
19579
19580 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19581
19582         * interface.cs, statement.cs, class.cs, parameter.cs,
19583         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19584         Drop use of TypeRefs, and use strings instead.
19585
19586 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19587
19588         * rootcontext.cs: 
19589
19590         * class.cs (Struct::Struct): set the SEALED flags after
19591         checking the modifiers.
19592         (TypeContainer::TypeAttr): new property, returns the
19593         TypeAttributes for a class.  
19594
19595         * cs-parser.jay (type_list): Oops, list production was creating a
19596         new list of base types.
19597
19598         * rootcontext.cs (StdLib): New property.
19599         (GetInterfaceTypeByName): returns an interface by type name, and
19600         encapsulates error handling here.
19601         (GetInterfaces): simplified.
19602         (ResolveTree): Encapsulated all the tree resolution here.
19603         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19604         types. 
19605
19606         * driver.cs: Add support for --nostdlib, to avoid loading the
19607         default assemblies.
19608         (Main): Do not put tree resolution here. 
19609
19610         * rootcontext.cs: Beginning of the class resolution.
19611
19612 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19613
19614         * rootcontext.cs: Provide better error reporting. 
19615
19616         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19617
19618         * rootcontext.cs (CreateInterface): Handle the case where there
19619         are no parent interfaces.
19620
19621         (CloseTypes): Routine to flush types at the end.
19622         (CreateInterface): Track types.
19623         (GetInterfaces): Returns an array of Types from the list of
19624         defined interfaces.
19625
19626         * typemanager.c (AddUserType): Mechanism to track user types (puts
19627         the type on the global type hash, and allows us to close it at the
19628         end). 
19629
19630 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19631
19632         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19633         RecordInterface instead.
19634
19635         * cs-parser.jay: Updated to reflect changes above.
19636
19637         * decl.cs (Definition): Keep track of the TypeBuilder type that
19638         represents this type here.  Not sure we will use it in the long
19639         run, but wont hurt for now.
19640
19641         * driver.cs: Smaller changes to accomodate the new code.
19642
19643         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19644         when done. 
19645
19646         * rootcontext.cs (CreateInterface):  New method, used to create
19647         the System.TypeBuilder type for interfaces.
19648         (ResolveInterfaces): new entry point to resolve the interface
19649         hierarchy. 
19650         (CodeGen): Property, used to keep track of the code generator.
19651
19652 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19653
19654         * cs-parser.jay: Add a second production for delegate_declaration
19655         with `VOID'.
19656
19657         (enum_body): Put an opt_comma here instead of putting it on
19658         enum_body or enum_member_declarations so we can handle trailing
19659         commas on enumeration members.  Gets rid of a shift/reduce.
19660
19661         (type_list): Need a COMMA in the middle.
19662
19663         (indexer_declaration): Tell tokenizer to recognize get/set
19664
19665         * Remove old targets.
19666
19667         * Re-add the parser target.
19668
19669 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19670
19671         * cs-parser.jay: Add precendence rules for a number of operators
19672         ot reduce the number of shift/reduce conflicts in the grammar.
19673
19674 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19675
19676         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19677         and put it here.
19678
19679         Get rid of old crufty code.
19680
19681         * rootcontext.cs: Use this to keep track of the parsed
19682         representation and the defined types available to the program. 
19683
19684         * gen-treedump.cs: adjust for new convention.
19685
19686         * type.cs: Split out the type manager, and the assembly builder
19687         from here. 
19688
19689         * typemanager.cs: the type manager will live here now.
19690
19691         * cil-codegen.cs: And the code generator here. 
19692
19693 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19694
19695         * makefile: Fixed up for easy making.
19696
19697 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19698
19699         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19700         the 
19701
19702         (unary_expression): Expand pre_increment_expression and
19703         post_decrement_expression to reduce a shift/reduce.
19704
19705 2001-07-11  Simon Cozens
19706
19707         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19708
19709         Improve allow_keyword_as_indent name.
19710
19711 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19712
19713         * Adjustments for Beta2. 
19714
19715 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19716
19717         * decl.cs: Added `Define' abstract method.
19718         (InTransit): new property, used to catch recursive definitions. 
19719
19720         * interface.cs: Implement `Define'. 
19721
19722         * modifiers.cs: Map Modifiers.constants to
19723         System.Reflection.TypeAttribute flags.
19724
19725         * class.cs: Keep track of types and user-defined types.
19726         (BuilderInit): New method for creating an assembly
19727         (ResolveType): New function to launch the resolution process, only
19728         used by interfaces for now.
19729
19730         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19731         that are inserted into the name space. 
19732
19733 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19734
19735         * ARGH.  I have screwed up my tree so many times due to the use of
19736         rsync rather than using CVS.  Going to fix this at once. 
19737
19738         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19739         load types.
19740
19741 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19742
19743         * Experiment successful: Use System.Type rather that our own
19744         version of Type.  
19745
19746 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19747
19748         * cs-parser.jay: Removed nsAliases from here.
19749
19750         Use new namespaces, handle `using XXX;' 
19751
19752         * namespace.cs: Reimplemented namespace handling, use a recursive
19753         definition of the class.  Now we can keep track of using clauses
19754         and catch invalid using clauses.
19755
19756 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19757
19758         * gen-treedump.cs: Adapted for all the renaming.
19759
19760         * expression.cs (Expression): this class now has a Type property
19761         which returns an expression Type.
19762
19763         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19764         `Type', as this has a different meaning now in the base
19765
19766 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * interface.cs, class.cs: Removed from all the sources the
19769         references to signature computation, as we can not do method
19770         signature computation during the parsing time, as we are not
19771         trying to solve at that point distinguishing:
19772
19773         class X {
19774                 void a (Blah x) {}
19775                 void a (NS.Blah x) {}
19776         }
19777
19778         Which depending on the context might be valid or not, as we do not
19779         know if Blah is the same thing as NS.Blah at that point.
19780
19781         * Redid everything so the code uses TypeRefs now instead of
19782         Types.  TypeRefs are just temporary type placeholders, that need
19783         to be resolved.  They initially have a pointer to a string and the
19784         current scope in which they are used.  This is used later by the
19785         compiler to resolve the reference to an actual Type. 
19786
19787         * DeclSpace is no longer a CIR.Type, and neither are
19788         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19789         are all DeclSpaces, but no Types. 
19790
19791         * type.cs (TypeRefManager): This implements the TypeRef manager,
19792         which keeps track of all the types that need to be resolved after
19793         the parsing has finished. 
19794
19795 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19796
19797         * ARGH.  We are going to have to store `foreach' as a class rather
19798         than resolving it, as we need to verify error 1579 after name
19799         resolution.   *OR* we could keep a flag that says `This request to
19800         IEnumerator comes from a foreach statement' which we can then use
19801         to generate the error.
19802
19803 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19804
19805         * class.cs (TypeContainer.AddMethod): we now add methods to the
19806         MethodGroup instead of the method hashtable.  
19807
19808         * expression.cs: Add MethodGroup abstraction, which gets us one
19809         step closer to the specification in the way we handle method
19810         declarations.  
19811
19812         * cs-parser.jay (primary_expression): qualified_identifier now
19813         tried to match up an identifier to a local variable reference or
19814         to a parameter reference.
19815
19816         current_local_parameters is now a parser global variable that
19817         points to the current parameters for the block, used during name
19818         lookup.
19819
19820         (property_declaration): Now creates an implicit `value' argument to
19821         the set accessor.
19822
19823 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19824
19825         * parameter.cs: Do not use `param' arguments as part of the
19826         signature, per the spec.
19827
19828 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19829
19830         * decl.cs: Base class for classes, structs and interfaces.  This
19831         is the "Declaration Space" 
19832
19833         * cs-parser.jay: Use CheckDef for checking declaration errors
19834         instead of having one on each function.
19835
19836         * class.cs: Factor out some code for handling error handling in
19837         accordance to the "Declarations" section in the "Basic Concepts"
19838         chapter in the ECMA C# spec.
19839
19840         * interface.cs: Make all interface member classes derive from
19841         InterfaceMemberBase.
19842
19843 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19844
19845         * Many things: all interfaces are parsed and generated in
19846         gen-treedump.  Support for member variables, constructors,
19847         destructors, properties, constants is there.
19848
19849         Beginning of the IL backend, but very little done, just there for
19850         testing purposes. 
19851
19852 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19853
19854         * cs-parser.jay: Fix labeled statement.
19855
19856         * cs-tokenizer.cs (escape): Escape " and ' always.
19857         ref_line, ref_name: keep track of the line/filename as instructed
19858         by #line by the compiler.
19859         Parse #line.
19860
19861 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19862
19863         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19864         to match the values in System.CodeDOM.
19865
19866         Divid renamed to Divide.
19867
19868         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19869         statements. 
19870         (Statements.set): remove.
19871
19872         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19873         statements. 
19874
19875         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19876         falseStatements always have valid values. 
19877
19878         * cs-parser.jay: Use System.CodeDOM now.
19879