f6445b2eeaf98b3d9c52db518da9eddbd2bbdc45
[mono.git] / mcs / gmcs / ChangeLog
1 2005-01-26  Martin Baulig  <martin@ximian.com>
2
3         * class.cs (TypeContainer.AttributeTargets): Return the correct
4         AttributeTargets depending on our `Kind' instead of throwing an
5         exception; fixes #71632.
6
7 2005-01-26  Martin Baulig  <martin@ximian.com>
8
9         * delegate.cs (Delegate.DefineType): Correctly define our type
10         parameters.  Fixes #71483.
11
12 2005-01-25  Raja R Harinath  <rharinath@novell.com>
13
14         Fix #71602.
15         * expression.cs (MemberAccess.DoResolve): Don't complain with
16         cs0572 when the LHS of a member access has identical name and type
17         name.
18
19 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
20
21         Fix #71651, #71675
22         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
23         CreatePermission.
24         Create custom PermissionSet only for PermissionSetAttribute.
25
26 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
27
28         Fix #71649
29         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
30         delegates in static class.
31
32 2005-01-24  Martin Baulig  <martin@ximian.com>
33
34         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
35         merging an implicit block, just use its reachability.
36
37         * statement.cs (Block.Resolve): Make the unreachable code check
38         work wrt. implicit blocks; see test-337 from #63842.
39
40 2005-01-21  Alp Toker  <alp@atoker.com>
41  
42         * cs-parser.jay: destructor_declaration's container is PartialContainer
43         not Class when partial types are used, so use Kind prop instead of
44         'is'.
45         
46 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
47
48         * cs-parser.jay: Improve error reporting when an interface
49         declares new types.
50
51 2005-01-20  Dick Porter  <dick@ximian.com>
52
53         * support.cs: SeekableStreamReader fix from Sandor Dobos
54         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
55         chars are read.  Fixes bug 70369.
56
57 2005-01-20  Raja R Harinath  <rharinath@novell.com>
58
59         * cs-parser.jay (catch_clause): Simplify current_block handling
60         somewhat.
61
62 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
63
64         * convert.cs (ImplicitStandardConversionExists): Synchronize the
65         code with ImplicitStandardConversion to handle the implicit
66         conversion of method groups into valid delegate invocations. 
67
68         The problem is that in parameter handling we were using this code
69         path.  Fixes bug #64698
70
71 2005-01-19  Raja R Harinath  <rharinath@novell.com>
72
73         * cs-parser.jay: Fix several infelicities.
74         - Avoid assigning to the parser value stack.  Code like 
75           '$3 = null' is unclean.  Synthesize a value for the code block
76           instead. 
77         - Avoid using oob_stack for storing location information.  Use ...
78         (_mark_): ... this.  New (empty) rule.  Saves the current location
79         in $$.
80         (foreach_statement): Avoid using oob_stack for current_block
81         handling.  Use technique used in for_statement and
82         using_statement.  Synthesize a value for the code block to store
83         additional intermediate information.
84
85 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
86
87         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
88         of a different type is only allowed to private fields of a
89         containing type, not on fields of a base class.
90
91         See test-174.cs and error cs0122-9.cs
92
93 2005-01-13  Raja R Harinath  <rharinath@novell.com>
94
95         Fix test-335.cs (bug #58126).
96         * cs-parser.jay (argument): Split out non-expression parts of the
97         rule into 'non_simple_argument'.
98         (invocation_expression): Support parenthesized invocations with
99         multiple arguments, and with single non-simple arguments.
100
101 2005-01-13  Raja R Harinath  <rharinath@novell.com>
102
103         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
104         places.
105
106 2005-01-12  Raja R Harinath  <rharinath@novell.com>
107
108         Fix cs0038-1.cs, cs1640-6.cs.
109         * ecore.cs (Expression.Resolve): Remove special-case for
110         SimpleName in error-handling.
111         (Expression.almostMatchedMembers): Relax access permission to
112         protected.
113         (Expression.MemberLookupFailed): Handle duplicates in
114         almostMatchedMembers list.
115         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
116         * expression.cs (New.DoResolve): Report CS1540 for more cases.
117         * typemanager.cs (GetFullNameSignature): Use the MethodBase
118         overload if the passed in MemberInfo is a MethodBase.
119
120 2005-01-25  Martin Baulig  <martin@ximian.com>
121
122         * doc.cs
123         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
124
125 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
126
127         Fix #70749
128         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
129         for non-CAS & merge permission sets properly.
130
131 2005-01-11  Raja R Harinath  <rharinath@novell.com>
132
133         Improve standard-compliance of simple name and member access 
134         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
135         * ecore.cs (FullNamedExpression): New abstract base class 
136         for Namespaces and TypeExpressions.
137         (ResolveFlags.SimpleName): Remove.
138         (SimpleName): Remove support for dotted names.
139         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
140         DeclSpace.FindType and DeclSpace.LookupType.
141         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
142         (Expression.ExprClassName): Make member function.
143         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
144         a namespace.  Remove creation of dotted "SimpleName"s.
145         (MemberAccess.DoResolve): Likewise.
146         * decl.cs (DeclSpace.Cache): Make private.
147         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
148         (DeclSpace.FindType): Update.
149         (DeclSpace.LookupType): Move here from RootContext.  Return a 
150         FullNamedExpression.
151         * namespace.cs (Namespace): Derive from FullNamedExpression
152         so that it can be part of expression resolution.
153         (Namespace.Lookup): Return an FullNamedExpression.
154         (NamespaceEntry.LookupAlias): Lookup aliases only in current
155         namespace.
156         * rootcontext.cs (NamespaceLookup): Remove.
157         (LookupType): Move to DeclSpace.
158         * attribute.cs (CheckAttributeType): Update.
159         * doc.cs (FindDocumentedType): Remove allowAlias argument.
160         (FindDocumentedTypeNonArray): Likewise.
161
162 2005-01-11  Raja R Harinath  <rharinath@novell.com>
163
164         Fix cs0509.cs, cs1632.cs.
165         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
166         is the same as IsInterface.
167         (TypeContainer.GetClassBases): Likewise.
168         * statement.cs (LabeledStatement.ig): New field.
169         (LabeledStatement.LabelTarget): Save ILGenerator which created the
170         label.
171         (LabeledStatement.DoEmit): Check that the label was created with
172         the same ILGenerator.
173
174 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
175
176         Fix #71058
177         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
178         accessors to its properties.
179
180         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
181         from accessors to property.
182         
183 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
184
185         Fix #70722
186         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
187         only for overrides.
188         
189 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
190
191         * attribute.cs: Check for null and empty strings.  
192
193         I have lost another battle to Paolo.
194
195 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
196
197         Fix #70942
198         * class.cs (PropertyMethod): Set Parent field in ctors.
199         (SetMethod.InternalParameters): Add unsafe switch hack.
200         Override MarkForDuplicationCheck where it is appropriate.
201
202         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
203         It says whether container allows members with the same name.
204         Base default is no.
205         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
206         Removed is_method parameter.
207
208 2005-01-06  Duncan Mak  <duncan@ximian.com>
209
210         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
211         because the previous change led to incorrect reporting of CS1032
212         ("Cannot define/undefine preprocessor symbols after first token in
213         file"). Instead of using `tokens_seen' as the only flag that
214         triggers CS1040, introduce `comments_seen'. This new flag is used
215         to signify having seen comments on the current line, so it is
216         unset after a newline.
217
218 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
219
220         * doc.cs : When searching for a type, find nested type too.
221           This fixes bug #71040.
222
223 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
224
225         * doc.cs :
226           - Warn missing member comment on those classes which also does not
227             have doc comments. Fixed bug #71041.
228           - Don't warn missing doc comment on default constructor.
229             Fixed bug #71042.
230
231 2005-01-06  Duncan Mak  <duncan@ximian.com>
232
233         * cs-tokenizer.cs (xtoken): After handling traditional C-style
234         comments, set `tokens_seen' to true. This allows us to detect
235         misplaced preprocessor directives (i.e. not at the beginning of
236         the a line, nor after whitespaces). In that case, report error
237         CS1040. This fixes bug #56460.
238
239         * cs-parser.jay (interface_member_declaration): Add checks for
240         IsExplicitImpl, and report CS0541 error if an interface member is
241         defined as an explicit interface declaration.
242
243 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
244
245         Fix #70817
246         * class.cs (PropertyMethod): Set Parent field in ctors.
247         (SetMethod.InternalParameters): Add unsafe switch hack.
248         
249         * decl.cs (MemberCore.Parent): Cannot be readonly.
250
251 2005-01-06  Raja R Harinath  <rharinath@novell.com>
252
253         * decl.cs (DeclSpace.ResolveType): Remove.
254         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
255         Merge in code from ...
256         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
257         * class.cs, enum.cs: Update to changes.
258
259 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
260
261         * anonymous.cs: Ensure that we init the scope of our parent if it
262         has not been initialized yet.
263
264 2004-12-30  Duncan Mak  <duncan@ximian.com>
265
266         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
267         if field.FieldBuilder is null. Fixes #70758.
268
269         * convert.cs: Fixed some typos and updated some of the comments.
270         (ImplicitStandardConversionExists):
271         (TryImplicitIntConversion): If `target_type' is an interface and
272         the type of `ic' implements this interface, return true or a new
273         BoxedCast instead of null. This fixes #70468.
274
275 2004-12-29  Duncan Mak  <duncan@ximian.com>
276
277         * expression.cs (Argument.Emit): Check that Expr is
278         IMemoryLocation before casting to it, and report CS1510 otherwise.
279
280         This fixes #70402.
281
282 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
283
284         * statement.cs (Block.ThisVariable): remove the recursion here, to
285         make the --profile more sane.
286
287 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
288
289         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
290         assembly, by JB Evain.
291
292 2004-12-17  Raja R Harinath  <rharinath@novell.com>
293
294         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
295           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
296         "parent" refers to enclosing type/class.  "base" refers to superclass.
297
298 2004-12-17  Raja R Harinath  <rharinath@novell.com>
299
300         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
301         Ensure that we only have GlobalAttributes.
302         * attribute.cs (Attribute.Emit): Make non-virtual.
303         (GlobalAttribute.Emit): Remove.
304         (Attribute.Resolve): Make virtual.
305         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
306         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
307         the argument. Don't create one.
308         (Attribute.GetObsoleteAttribute): Likewise.
309         (Attribute.GetClsCompliantAttributeValue): Likewise.
310         * class.cs, decl.cs: Update to changes.
311
312 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
313
314         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
315         
316         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
317         
318         * statement.cs (Foreach.Resolve): Add error 186 report.
319
320 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
321
322         * expression.cs (Conditional.DoResolve): Add warning 429.
323         
324         * statement.cs (If.Resolve): Add warning 665.
325
326 2004-12-16  Raja R Harinath  <rharinath@novell.com>
327
328         New invariant: RootContext.Tree.Types.NamespaceEntry == null
329         except when in the parser, and in GlobalAttribute.
330         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
331         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
332         RootContext.Tree.Types.NamespaceEntry once work is done.
333         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
334         and resets RootContext.Tree.Types.NamespaceEntry.
335
336 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
337
338         * cs-parser.jay: Don't create a block for every variable.
339
340 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
341
342         * location.cs: Provide extra information.
343
344         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
345         variables from the captured environment, it is the ldarg_0.
346
347 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
348
349         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
350         find a conclusion.
351         
352         * class.cs: Changed warning level for 169 to avoid developer
353         displeasure from warning flooding. It will be changed back when they
354         fix most of current BCL warnings.
355         
356         * RootContext.cs: Pushed default WarningLevel to 3.
357         
358         * statement.cs: Removed unused variable.
359
360 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
361
362         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
363         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
364         Add error 502 report.
365         (StaticClass.DefineType): Add error 441 report.
366         (Class.AllowedModifiersProp): New virtual property as temporary
367         extension to AllowedModifiers.
368         (Class.DefineType): Add error 418 report. Moved ModFlags check here
369         to share implementation with StaticClass and don't call virtual
370         methods from ctor.
371         
372         * driver.cs (MainDriver): Add error 1558 test.
373
374         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
375         report. Moved error 36 test here.
376
377         * statement.cs (Throw.Resolve): Add error 724 report.
378
379         * typemanager.cs: Add out_attribute_type core type.
380         
381 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
382
383         * class.cs (TypeContainer.VerifyClsCompliance): Add error
384         3018 report.
385         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
386
387         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
388         3017 report.
389         
390         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
391
392         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
393         Add error 3023 report.
394         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
395
396         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
397         implementation.
398
399 2004-12-12  John Luke  <john.luke@gmail.com>
400
401         * driver.cs (AddArgs): take -- into account when
402         adding arguments, fixes bug 65710 
403
404 2004-12-12  Martin Baulig  <martin@ximian.com>
405
406         * expression.cs (Unary.TryReduceNegative): Added support for
407         SByteConstant and ByteConstant.
408         (Unary.Reduce): Check error values from TryReduceNegative().
409
410 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
411
412         * attributes.cs (Attribute.Resolve): Avoid multiple error report
413         and report exception as error 182.
414
415 2004-12-10  Raja R Harinath  <rharinath@novell.com>
416
417         * driver.cs (Main): Fix message when there are warnings.
418
419 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
420
421         * delegate.cs: Fixed my fix from yesterday, sorry about that.
422
423 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
424
425         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
426         Reduced number of warnings.
427         
428         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
429
430 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
431
432         * driver.cs: Removed message.
433
434         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
435
436 2004-12-08    <vargaz@freemail.hu>
437
438         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
439
440 2004-12-08  Martin Baulig  <martin@ximian.com>
441
442         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
443         instead of a CS3002 for properties and indexer.
444
445 2004-12-08  Martin Baulig  <martin@ximian.com>
446
447         * decl.cs (MemberName.ToString): Make this work again.
448
449 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
450
451         * attribute.cs (Resolve): Add error 591 detection.
452
453         * class.cs (FieldMember.Define): Add error 1547 detection.
454         (Indexer.Define): Add error 620 detection.
455         (Operator.Define): Add error 590 detection.
456
457         * ecore.cs: Missing argument for error 79.
458
459         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
460         detection.
461
462 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
463
464         Fix #70106
465         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
466         only.
467
468 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
469
470         * cs-parser.jay : handle doc comments on implicit/explicit operators.
471           Some operator comments were suppressed.
472         * doc.cs : Implicit/explicit operator name in doc comments are like
473           "op_Explicit(type)~returnType", so added suffix handling.
474
475 2005-01-21  Alp Toker  <alp@atoker.com>
476
477         * cs-parser.jay: destructor_declaration's container is PartialContainer
478         not Class when partial types are used, so use Kind prop instead of 'is'.
479
480 2004-12-12  Martin Baulig  <martin@ximian.com>
481
482         * expression.cs (Unary.TryReduceNegative): Added support for
483         SByteConstant and ByteConstant.
484         (Unary.Reduce): Check error values from TryReduceNegative().
485
486 2004-12-11  Martin Baulig  <martin@ximian.com>
487
488         * support.cs (ReflectionParameters.ParameterName): If we have a
489         `gpd', call `ParameterName' on it.
490
491         * parameter.cs (Parameter.GetParameterAttributes): New static method.
492
493         * pending.cs (PendingImplementation.DefineProxy): Call
494         DefineParameter() for all of the MethodBuilder's arguments.
495
496 2004-12-09  Martin Baulig  <martin@ximian.com>
497
498         * doc.cs (DocUtil): Make this a static class.
499
500 2004-12-09  Martin Baulig  <martin@ximian.com>
501
502         * expression.cs (Invocation.InferType): Moved the type inference
503         implementation into TypeManager.
504
505         * generics.cs (TypeManager): Moved the type inference
506         implementation here.
507
508 2004-12-09  Martin Baulig  <martin@ximian.com>
509
510         * typemanager.cs (TypeManager): Make this a partial class.
511
512         * generics.cs
513         (TypeManager): Move the generics part of `TypeManager' here.
514
515 2004-12-08  Martin Baulig  <martin@ximian.com>
516
517         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
518         instead of a CS3002 for properties and indexer.  Added CS3024
519         check for generic interfaces.
520
521         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
522         instances are not CLS-compliant.
523
524 2004-12-08  Martin Baulig  <martin@ximian.com>
525
526         * cs-parser.jay
527         (void_pointer_expression): New rule for `void*', `void**' etc.
528         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
529
530 2004-12-08  Martin Baulig  <martin@ximian.com>
531
532         * expression.cs (Invocation.InferType): Removed the hack for
533         MethodCore.MayUnify().  
534
535         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
536         this actually work.
537
538         * class.cs (MethodCore.MayUnify): Use
539         TypeManager.MayBecomeEqualGenericTypes().       
540
541 2004-12-08  Martin Baulig  <martin@ximian.com>
542
543         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
544         parameter, box it.  Fixes #69233.
545
546 2004-12-08  Martin Baulig  <martin@ximian.com>
547
548         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
549         have the ctor constraint.  Fixes #68326.
550
551 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
552
553         * cs-parser.jay : interface comment was not consumed because of
554           extra opt_semicolon before doc handling.
555
556 2004-12-03  Raja R Harinath  <rharinath@novell.com>
557
558         Fix test-327.cs, test-328.cs, and put in early infrastructure
559         for eventually fixing #52697.
560         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
561         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
562         from other methods.
563         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
564         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
565         (VerifyUsing, error246): Update.
566         * rootcontext.cs (RootContext.NamespaceLookup): Just use
567         'NamespaceEntry.LookupNamespaceOrType'.
568
569 2004-12-07  Martin Baulig  <martin@ximian.com>
570
571         * driver.cs: Call it "BETA SOFTWARE" :-)
572
573 2004-12-06  Raja R Harinath  <rharinath@novell.com>
574
575         Fix crash on cs0657-17.cs.
576         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
577         Use RootContext.Tree.Types, not 'new RootTypes ()'.
578         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
579         the case where the NamespaceEntry gets overwritten.
580
581 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
582
583         Fixed #69195, #56821
584         * ecore.cs (ResolveBoolean): Tiny refactoring.
585
586         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
587         of right expression resolving when left is false constant and
588         operator is LogicalAnd OR true constant and operator is LogicalOr.
589
590         * statement.cs (ResolveUnreachable): Always reports warning.
591
592 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
593
594         * class.cs: Distinguish between 1721 and 1722 (just a little help
595         for the programmer).
596
597 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
598
599         * delegate.cs: Only allow this on new versions of the language. 
600
601 2004-12-02  Duncan Mak  <duncan@ximian.com>
602
603         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
604         Expression class.
605         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
606         here as a static method. Take an additional bool out parameter
607         `must_do_cs1540_check' for signaling to InstanceResolve.
608         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
609         member field from PropertyExpr class and made it an argument of
610         the method instead.
611         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
612         check for MarshalByRefObject, and report CS0122 instead of CS1540.
613         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
614         and `remove_accessor' as well as InstanceResolve: report CS0122
615         where applicable.
616
617         Fixes #70129.
618
619 2004-12-07  Martin Baulig  <martin@ximian.com>
620
621         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
622         and CS0692 where appropriate.
623
624 2004-12-06  Martin Baulig  <martin@ximian.com>
625
626         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
627         IsDuplicateImplementation() and improved it.
628
629         * expression.cs (Invocation.InferTypeArguments): Added
630         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
631         and removed the "ref" modifier from `infered_types'.
632
633         * decl.cs (MemberName.ToString): Removed the exception.
634
635 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
636
637         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
638           comments are allowed.
639
640 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
641
642         * delegate.cs: Add checks for subtypes in paramaters and return values
643         in VerifyMethod () to add support for Covariance/Contravariance
644         in delegates.
645         
646 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
647
648         * report.cs: Remove extra closing parenthesis.
649
650         * convert.cs (Error_CannotImplicitConversion): If the name of the
651         types are the same, provide some extra information.
652
653 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
654
655         Fix bug #70102
656         * attribute.cs (Resolve): Improved implementation of params
657         attribute arguments.
658
659         * support.cs (ParameterData): Add HasParams to be faster.
660
661 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
662
663         all things are for /doc support:
664
665         * doc.cs: new file that supports XML documentation generation.
666         * mcs.exe.sources: added doc.cs.
667         * driver.cs:
668           Handle /doc command line option.
669           Report error 2006 instead of 5 for missing file name for /doc.
670           Generate XML documentation when required, after type resolution.
671         * cs-tokenizer.cs:
672           Added support for picking up documentation (/// and /** ... */),
673           including a new XmlCommentState enumeration.
674         * cs-parser.jay:
675           Added lines to fill Documentation element for field, constant,
676           property, indexer, method, constructor, destructor, operator, event
677           and class, struct, interface, delegate, enum.
678           Added lines to warn incorrect comment.
679         * rootcontext.cs :
680           Added Documentation field (passed only when /doc was specified).
681         * decl.cs:
682           Added DocComment, DocCommentHeader, GenerateDocComment() and
683           OnGenerateDocComment() and some supporting private members for
684           /doc feature to MemberCore.
685         * class.cs:
686           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
687         * delegate.cs:
688           Added overriden DocCommentHeader.
689         * enum.cs:
690           Added overriden DocCommentHeader and GenerateDocComment().
691
692 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
693
694         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
695         unwrapping the enumeration values, chain to
696         DoConstantNumericPromotions again, so we can promote things to the
697         fundamental types (takes care of enums that are bytes, sbytes).
698
699         Fixes bug #62054.
700
701 2004-12-01  Raja R Harinath  <rharinath@novell.com>
702
703         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
704         Fix long-standing bug in type-lookup.  Use FindType instead of
705         LookupType when ec.ResolvingTypeTree.
706         (Attribute.ResolveType, Attribute.Resolve)
707         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
708         Update to changes.
709         (Attributes.Search): Remove internal version.  Update.
710         (Attributes.SearchMulti): Update.
711         (Attributes.GetClsCompliantAttribute): Remove.
712         (Attributes.GetIndexerNameAttribute): Remove.
713         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
714         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
715         * class.cs (Indexer.Define): Likewise.
716
717 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
718
719         Fix bug #68790
720         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
721         MarshallByReference members access.
722
723         * expression.cs: Use CheckMarshallByRefAccess;
724         Better error CS0197 message.
725
726         * report.cs: Print whole related error message.
727
728 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
729
730         * class (GetClassBases): Better error 60 report.
731         (EventProperty): Disabled warning 67 detection.
732
733 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
734
735         Fix bug #60324
736         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
737
738         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
739         precise values.
740
741 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
742
743         Fix bug #49488
744         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
745
746         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
747
748 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
749
750         * attribute.cs (Attribute.Resolve): Refine error reporting and
751         report a cs0117 if the identifier does not exist, to distinguish
752         from 0617 which is a miss-use of the actual identifier.
753
754         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
755         between cs0070 and cs0079.
756
757         * class.cs (MemberBase.DoDefine): When reporting a wrong
758         accessibility level, we use MethodCore to compare instead of
759         Method (this was a regression in some refactoring effort).
760
761         So now we correctly report cs0056 again.
762
763         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
764         testing the target_type (which was known to be object_type) and
765         not the source type (which is anonymous_method).
766
767         Fixed reporting of error cs1660.
768
769         * expression.cs (UserCast.Source): Expose the underlying cast.
770
771         * statement.cs (Switch.SwitchGoverningType): Sort the list of
772         allowed types to find a match to int32 first (most common).
773
774         In addition, it ignores any ImplicitUserConversions that did an
775         internal implicit conversion (as the switch statement allows only
776         one integral conversion to exist).
777
778         * class.cs (PartialContainer.Create): rename `name' to
779         `member_name' for clarity.  Then replace the string calls with a
780         call to MemberName.GetPartialName, as now using
781         MemberName.ToString is an error (this is due to the side effects
782         it had, that were fixed in the past).
783
784         This will restore the error reporting on a number of partial class
785         errors that were missusing this (and getting an exception as a
786         results, which is now just a plain textual warning, because
787         yyparse debug output would crash otherwise).
788
789 2004-11-26  Raja R Harinath  <rharinath@novell.com>
790
791         * Makefile (PROGRAM_INSTALL_DIR): Remove.
792
793 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
794
795         * rootcontext.cs (LookupType): Make sure to cache lookups that
796         don't give us a negative result. This saves about 5% of corlib
797         compilation time.
798
799 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
800
801         * report.cs (AbstractMessage.Print): messages are sent to stderr
802
803         * class.cs (TypeContainer.GetClassBases): It is an error to have a
804         non-interface in the list of interfaces (at this point, either
805         parent was properly set, or a base class is being listed in the
806         interfaces section).
807
808         This flags error 1722, and resolves the crash from bug 69259.
809
810 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
811
812         * statement.cs (Using.EmitExpressionFinally): make this work right
813         for valuetypes. Fixes 69926.
814
815 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
816
817         * const.cs (Const.ChangeType): Cope with the "0 literal can be
818         converted to an enum" here, before we try to change the underlying
819         type.  This code exists, but it is a different code path than the
820         one used while encoding constants.
821
822         (ImplicitReferenceConversionExists): In addition, resynchronized
823         the code here, so it matches the same code in
824         ImplicitReferenceConversionExists for the `from any class-type S
825         to any interface-type T'.       
826
827 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
828
829         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
830
831 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
832
833         * cs-parser.jay: Use verbosity accordingly. 
834
835 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
836
837         * expression.cs (Unary.ResolveOperator): Do not report warning;
838         AddressOf reads from variable.
839         
840         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
841
842 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
843
844         Fix bug #69462
845
846         * attribute.cs (Attributable): Removed CheckTargets.
847         (Attributes.Emit): Explicit attribute targets are tested here.
848
849         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
850         not enabled for interfaces.
851
852         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
853         (GetAssemblyName): Ouch next bug there.
854
855 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
856
857         * expression.cs: Error 275 added.
858         
859 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
860
861         Fix bug #69177 (Implemented decimal constant support)
862
863         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
864         (BinaryFold): Add DecimalConstant.
865
866         * const.cs (Define): Decimal constant 
867         (is not constant.
868         (ChangeType): Add decimal type handling.
869         (LookupConstantValue): Don't set value for decimal type but
870         emit DecimalConstantAttribute. Needed for constant optimization.
871
872         * constant.cs (ToDecimal): New method.
873         (ConvertToDecimal): New method.
874         (IntConstant): Implemented ConvertToDecimal.
875         (DecimalConstant.Emit): Emit optimized version for decimals in
876         int range.
877
878         * expression.cs (ResolveOperator): Changed order of constant
879         reduction to work correctly with native types which have
880         overloaded operators.
881         (ResolveMemberAccess): Extract constant value from attribute
882         for decimal type.
883
884         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
885
886         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
887         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
888         (ChangeType): Decimal is special.
889         (TypeToCoreType): Add decimal type.
890
891 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
892
893         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
894         decimal types.
895
896 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
897
898         * class.cs (EventField.ApplyAttributeBuilder): Fix error
899         test cs1667-5.cs.
900
901 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
902
903         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
904
905         * pending.cs (PendingImplementation): Grab only interfaces.
906
907 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
908
909         * statement.cs (ForeachHelperMethods): Add location member and
910         error 202 detection.
911
912 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
913
914         * expression.cs (DoResolveBase): Fixed wrong warning for out
915         variables.
916
917 2004-12-04  Martin Baulig  <martin@ximian.com>
918
919         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
920         to check whether the conversion is ok.
921
922         * typemanager.cs (TypeManager.GetTypeArguments): Just return
923         `Type.EmptyTypes' if we're not a generic TypeContainer.
924
925 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
926
927         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
928         old bug: when converting from the null literal to a pointer,
929         return an EmptyCast, not the NullLiteral.
930
931         This fixes #69921, the recent null_type changes probably made this
932         bug more prominent.
933
934 2004-12-03  Martin Baulig  <martin@ximian.com>
935
936         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
937         method as our child, call AnonymousMethod.Compatible() on it.
938
939 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
940
941         * class.cs (FieldBase): Use an unused bit field from the field to
942         encode the `has_offset' property from the FieldMember.  This saves
943         a couple of Ks on bootstrap compilation.
944
945         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
946         method as our child, return the AnonymousMethod resolved
947         expression.
948
949         * expression.cs (New.DoResolve): Allow return values from
950         NewDelegate to also include AnonymousMethods.
951
952         Fixes #70150.
953
954 2004-11-29  Raja R Harinath  <rharinath@novell.com>
955
956         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
957         cs1648 report.
958         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
959         System.Runtime.InteropServices._Exception, since it's a base
960         interface of the core type System.Exception in the net_2_0 profile.
961
962 2004-11-27  Martin Baulig  <martin@ximian.com>
963
964         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
965
966 2004-11-26  Raja R Harinath  <rharinath@novell.com>
967
968         * Makefile: Convert to use executable.make.
969         * gmcs.exe.sources: New.
970
971 2004-11-25  Martin Baulig  <martin@ximian.com>
972
973         * expression.cs (Invocation.InferType): Added support for byref types.
974
975 2004-11-25  Martin Baulig  <martin@ximian.com>
976
977         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
978         in TypeManager.TypeToCoreType().
979
980 2004-11-25  Martin Baulig  <martin@ximian.com>
981
982         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
983         "Dispose" method from the `current_type'.
984         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
985         DoDefineMembers() instead of using the MethodBuilder; this is
986         required for generic iterators.
987
988         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
989
990 2004-11-24  Martin Baulig  <martin@ximian.com>
991
992         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
993
994 2004-11-20  Martin Baulig  <martin@ximian.com>
995
996         * expression.cs (Invocation.InferType): Correctly infer generic
997         instances; see gen-103.cs.
998         (Invocation.InferTypeArguments): If a generic method doesn't have
999         any unbound type parameters, we don't need to infer anything.
1000
1001 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1002
1003         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1004
1005 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1006
1007         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1008         (TypeHandle.GetMemberCache): New.
1009         (TypeHandle.TypeHandle): Update.
1010         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1011         (TypeManager.LookupParentInterfacesCache):
1012         Rename from LookupInterfaceCache.  Optimize slightly.
1013         (TypeManager.MemberLookup_FindMembers): Update.
1014         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1015         multi-type variant.
1016         (AddCacheContents): Rename from AddHashtable.
1017         * class.cs (TypeContainer.parent_container): Remove.
1018         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1019         (TypeContainer.DoDefineMembers): Don't initialize it.
1020         Update to name changes.
1021         
1022 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1023
1024         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1025         that factors the code to check access modifiers on override.  
1026
1027         (PropertyBase): Use the code here.
1028
1029         Patch from Lluis S'anchez, fixes bug #69361.
1030
1031 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1032
1033         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1034         routine that is used to report the use of a captured variable
1035         whose address has been taken.
1036
1037         There are two checks: one when variables are being captured and
1038         the other check is when the address of a variable is taken. 
1039         
1040         (because an anonymous methods might be resolved before *or* after
1041         the address has been taken) and 
1042
1043         * expression.cs (Conditional.DoResolve): Remove the special
1044         casing that Martin added to trueExpr and falseExpr being both
1045         NullLiteral.  We get the right behavior now just by introducing
1046         the null_type into the compiler. 
1047
1048         * convert.cs (ExplicitConversion): Change the code to use
1049         null_type instead of testing `expr is NullLiteral'.
1050         (ImplicitConversionStandard): use null_type too.
1051         (ImplicitReferenceConversionExists): use null_type too.
1052         (ImplicitReferenceConversion): use null_type too.
1053
1054         * literal.cs: The type of `NullLiteral' is now null_type instead
1055         of object_type. 
1056         (Resolve): Set the type here.
1057
1058         * typemanager.cs: Introduce null_type.
1059
1060 2004-11-18  Martin Baulig  <martin@ximian.com>
1061
1062         * rootcontext.cs
1063         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1064
1065 2004-11-18  Martin Baulig  <martin@ximian.com>
1066
1067         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1068
1069 2004-11-18  Martin Baulig  <martin@ximian.com>
1070
1071         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1072         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1073         call ResolveConstructedType() on it to resolve it without checking
1074         constraints.
1075         (Constraints.ResolveTypes): Check them here.
1076         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1077         but don't check constraints.
1078         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1079         check constraints here.
1080         (ConstructedType.ResolveConstructedType): New public method.  This
1081         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1082         resolve ourselves without checking constraints.
1083
1084         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1085
1086 2004-11-18  Martin Baulig  <martin@ximian.com>
1087
1088         * decl.cs
1089         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1090
1091         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1092
1093 2004-11-18  Martin Baulig  <martin@ximian.com>
1094
1095         * ecore.cs (TypeExpr.ResolveType): Removed.
1096         (Expression.ResolveAsTypeTerminal): We always return a fully
1097         resolved `TypeExpr', so we can just access its `Type'.
1098
1099         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1100
1101 2004-11-17  Martin Baulig  <martin@ximian.com>
1102
1103         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1104         sure we don't return any unresolved TypeExpr's.
1105         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1106         a `TypeExpr'.
1107         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1108
1109         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1110         unresolved `ConstructedType's.
1111
1112 2004-11-17  Martin Baulig  <martin@ximian.com>
1113
1114         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1115
1116 2004-11-17  Martin Baulig  <martin@ximian.com>
1117
1118         * ecore.cs
1119         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1120
1121         * decl.cs (DeclSpace.ResolveType): Removed.
1122         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1123
1124 2004-11-17  Martin Baulig  <martin@ximian.com>
1125
1126         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1127         direction, like FindMembers() does.  Fixes #69546, testcase is in
1128         test-315.cs.    
1129
1130 2004-11-16  Martin Baulig  <martin@ximian.com>
1131
1132         This is based on a patch from Marek Safar, see bug #69082.
1133         Fixes bugs #63705 and #67130.
1134
1135         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1136         method; create a MemberCache for an interface type and cache the
1137         result.
1138
1139         * decl.cs (IMemberContainer.ParentContainer): Removed.
1140         (IMemberContainer.ParentCache): New property.
1141         (MemberCache.SetupCacheForInterface): Removed.
1142         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1143         to create a cache for an interface's "parent".
1144
1145         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1146         interfaces too.
1147
1148 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1149
1150         * statement.cs: Avoid adding bools to a hashtable.
1151
1152 2004-11-15  Martin Baulig  <martin@ximian.com>
1153
1154         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1155
1156 2004-11-11  Martin Baulig  <martin@ximian.com>
1157
1158         * typemanager.cs (TypeManager.GetMethodName): New method.
1159
1160         * class.cs (MethodData.Define): Include the generic arity in the
1161         name of an explicit interface; also add it to the method name.
1162
1163         * pending.cs (PendingImplementation.InterfaceMethod): The method
1164         name now includes the generic arity.
1165
1166 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1167
1168         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1169         calling an unsafe method from a safe location.
1170
1171 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1172
1173         Fix #69167
1174         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1175
1176 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1177
1178         * namespace.cs (VerifyUsing): use GetPartialName instead of
1179         ToString. 
1180
1181 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1182
1183         * statement.cs (Return.Resolve): Fix regression in typo: if
1184         `in_exc', we have to request a NeedReturnLabel, this was a typo
1185         introduced in the anonymous method check-in.  Fixes #69131.
1186
1187         * Indexers were using the ShortName when defining themselves,
1188         causing a regression in the compiler bootstrap when applying the
1189         patch from 2004-11-02 (first part), now they use their full name
1190         and the bug is gone.
1191
1192 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1193
1194         * driver.cs: Strip the path from the names of embedded resources. Fixes
1195         #68519.
1196
1197 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1198
1199         Fix error message regression: cs0104-2.cs.
1200         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1201         (AliasEntry.Resolve): Update.
1202         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1203         'silent' flag.
1204         (RootContext.LookupType): Update.
1205
1206 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1207
1208         * cs-parser.jay: Add support for handling accessor modifiers
1209         * class: Add support port accessor modifiers and error checking,
1210         define PropertyMethod.Define as virtual (not abstract anymore)
1211         * ecore.cs: Add checking for proeprties access with access modifiers
1212         * iterators.cs: Modify Accessor constructor call based in the modified
1213         constructor
1214 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1215
1216         * expression.cs (StringConcat): Handle being called twice,
1217         as when we have a concat in a field init with more than two
1218         ctors in the class
1219
1220 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1221
1222         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1223         special case explicit implementations, we should always produce
1224         the .property or .event declaration.
1225         
1226         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1227         since it will not return correct data if people use this
1228         unresolved in the presence of using statements (see test-313).
1229
1230         * class.cs (MethodData.Define): If we are an explicit interface
1231         implementation, set the method name to the full name of the
1232         interface plus the name of the method.  
1233
1234         Notice that using the method.MethodName.GetFullName() does not
1235         work, as it will only contain the name as declared on the source
1236         file (it can be a shorthand in the presence of using statements)
1237         and not the fully qualifed type name, for example:
1238
1239         using System;
1240
1241         class D : ICloneable {
1242                 object ICloneable.Clone ()  {
1243                 }
1244         }
1245
1246         Would produce a method called `ICloneable.Clone' instead of
1247         `System.ICloneable.Clone'.
1248
1249         * namespace.cs (Alias.Resolve): Use GetPartialName.
1250         
1251 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1252
1253         * cs-parser.jay: Add error 1055 report.
1254
1255 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1256
1257         * assign.cs (Assign.DoResolve): Only do the transform of
1258         assignment into a New if the types are compatible, if not, fall
1259         through and let the implicit code deal with the errors and with
1260         the necessary conversions. 
1261
1262 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1263
1264         * cs-parser.jay: Add error 1031 report.
1265
1266         * cs-tokenizer.cs: Add location for error 1038.
1267
1268 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1269
1270         * cs-parser.jay: Add error 1016 report.
1271
1272 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1273
1274         * cs-parser.jay: Add errors 1575,1611 report.
1275
1276 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1277
1278         * cs-parser.jay: Add error 1001 report.
1279
1280 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1281
1282         Fix #68850
1283         * attribute.cs (GetMarshal): Add method argument for
1284         caller identification.
1285
1286         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1287         agument for GetMarshal and RuntimeMissingSupport.
1288
1289 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1290
1291         * attribute.cs (ExtractSecurityPermissionSet): Removed
1292         TypeManager.code_access_permission_type.
1293
1294         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1295
1296 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1297
1298         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1299         for obsolete use of a variable here.   Fixes regression on errors
1300         cs0619-25 and cs0619-26.
1301
1302 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1303
1304         Fix #62358, implemented security attribute encoding.
1305
1306         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1307         Tests permitted SecurityAction for assembly or other types.
1308         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1309         data from SecurityPermissionAttribute to PermisionSet class.
1310
1311         * class.cs (ApplyAttributeBuilder): Added special handling
1312         for System.Security.Permissions.SecurityAttribute based types.
1313
1314         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1315         special handling for System.Security.Permissions.SecurityAttribute
1316         based types.
1317
1318         * enum.cs (ApplyAttributeBuilder): Added special handling
1319         for System.Security.Permissions.SecurityAttribute based types.
1320
1321         * parameter.cs (ApplyAttributeBuilder): Added special handling
1322         for System.Security.Permissions.SecurityAttribute based types.
1323
1324         * rootcontext.cs: Next 2 core types.
1325
1326         * typemanager.cs (TypeManager.security_permission_attr_type):
1327         Built in type for the SecurityPermission Attribute.
1328         (code_access_permission_type): Build in type.
1329
1330 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1331
1332         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1333         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1334         all of this information into
1335         EmitContext.EmitCapturedVariableInstance.
1336         
1337         * codegen.cs (EmitCapturedVariableInstance): move here the
1338         funcionality of emitting an ldarg.0 in the presence of a
1339         remapping.   This centralizes the instance emit code.
1340
1341         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1342         then emit a load of this: it means that we have reached the
1343         topmost ScopeInfo: the one that contains the pointer to the
1344         instance of the class hosting the anonymous method.
1345
1346         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1347         captures to the topmost CaptureContext.
1348
1349 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1350
1351         * expression.cs (LocalVariableReference): Move the knowledge about
1352         the iterators into codegen's EmitCapturedVariableInstance.
1353
1354 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1355
1356         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1357         all code paths return a value from an anonymous method (it is the
1358         same as the 161 error, but for anonymous methods).
1359
1360 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1361
1362         The introduction of anonymous methods in the compiler changed
1363         various ways of doing things in the compiler.  The most
1364         significant one is the hard split between the resolution phase
1365         and the emission phases of the compiler.
1366
1367         For instance, routines that referenced local variables no
1368         longer can safely create temporary variables during the
1369         resolution phase: they must do so from the emission phase,
1370         since the variable might have been "captured", hence access to
1371         it can not be done with the local-variable operations from the runtime.
1372         
1373         * statement.cs 
1374
1375         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1376         is a toplevel block.
1377
1378         (ToplevelBlock): A new kind of Block, these are the blocks that
1379         are created by the parser for all toplevel method bodies.  These
1380         include methods, accessors and anonymous methods.
1381
1382         These contain some extra information not found in regular blocks:
1383         A pointer to an optional CaptureContext (for tracking captured
1384         local variables and parameters).  A pointer to the parent
1385         ToplevelBlock.
1386         
1387         (Return.Resolve): Catch missmatches when returning a value from an
1388         anonymous method (error 1662).
1389         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1390         phase.
1391
1392         (Break.Resolve): ditto.
1393
1394         (SwitchLabel): instead of defining the labels during the
1395         resolution phase, we now turned the public ILLabel and ILLabelCode
1396         labels into methods called GetILLabelCode() and GetILLabel() that
1397         only define the label during the Emit phase.
1398
1399         (GotoCase): Track the SwitchLabel instead of the computed label
1400         (its contained therein).  Emit the code by using
1401         SwitchLabel.GetILLabelCode ().
1402
1403         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1404         whether the Local has been captured or not.
1405
1406         (LocalInfo.IsCaptured): New property, used to tell whether the
1407         local has been captured.
1408         
1409         * anonymous.cs: Vastly updated to contain the anonymous method
1410         support.
1411
1412         The main classes here are: CaptureContext which tracks any
1413         captured information for a toplevel block and ScopeInfo used to
1414         track the activation frames for various local variables.   
1415
1416         Each toplevel block has an optional capture context associated
1417         with it.  When a method contains an anonymous method both the
1418         toplevel method and the anonymous method will create a capture
1419         context.   When variables or parameters are captured, they are
1420         recorded on the CaptureContext that owns them, for example:
1421
1422         void Demo () {
1423              int a;
1424              MyDelegate d = delegate {
1425                  a = 1;
1426              }
1427         }
1428
1429         Here `a' will be recorded as captured on the toplevel
1430         CapturedContext, the inner captured context will not have anything
1431         (it will only have data if local variables or parameters from it
1432         are captured in a nested anonymous method.
1433
1434         The ScopeInfo is used to track the activation frames for local
1435         variables, for example:
1436
1437         for (int i = 0; i < 10; i++)
1438                 for (int j = 0; j < 10; j++){
1439                    MyDelegate d = delegate {
1440                         call (i, j);
1441                    }
1442                 }
1443
1444         At runtime this captures a single captured variable `i', but it
1445         captures 10 different versions of the variable `j'.  The variable
1446         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
1447         recorded on a child.  
1448
1449         The toplevel ScopeInfo will also track information like the `this'
1450         pointer if instance variables were referenced (this is necessary
1451         as the anonymous method lives inside a nested class in the host
1452         type of the method). 
1453
1454         (AnonymousMethod): Expanded to track the Toplevel, implement
1455         `AnonymousMethod.Compatible' to tell whether an anonymous method
1456         can be converted to a target delegate type. 
1457
1458         The routine now also produces the anonymous method content
1459
1460         (AnonymousDelegate): A helper class that derives from
1461         DelegateCreation, this is used to generate the code necessary to
1462         produce the delegate for the anonymous method that was created. 
1463
1464         * assign.cs: API adjustments for new changes in
1465         Convert.ImplicitStandardConversionExists.
1466
1467         * class.cs: Adjustments to cope with the fact that now toplevel
1468         blocks are of type `ToplevelBlock'. 
1469
1470         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
1471         insteda of standard blocks.
1472
1473         Flag errors if params arguments are passed to anonymous methods.
1474
1475         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
1476         `CurrentAnonymousMethod' which points to the current Anonymous
1477         Method.  The variable points to the AnonymousMethod class that
1478         holds the code being compiled.  It is set in the new EmitContext
1479         created for the anonymous method.
1480
1481         (EmitContext.Phase): Introduce a variable and an enumeration to
1482         assist in enforcing some rules about when and where we are allowed
1483         to invoke certain methods (EmitContext.NeedsReturnLabel is the
1484         only one that enfonces this right now).
1485
1486         (EmitContext.HaveCaptureInfo): new helper method that returns
1487         whether we have a CapturedContext initialized.
1488
1489         (EmitContext.CaptureVariable): New method used to register that a
1490         LocalInfo must be flagged for capturing. 
1491
1492         (EmitContext.CapturedParameter): New method used to register that a
1493         parameters must be flagged for capturing. 
1494         
1495         (EmitContext.CapturedField): New method used to register that a
1496         field must be flagged for capturing. 
1497
1498         (EmitContext.HaveCapturedVariables,
1499         EmitContext.HaveCapturedFields): Return whether there are captured
1500         variables or fields. 
1501
1502         (EmitContext.EmitMethodHostInstance): This is used to emit the
1503         instance for the anonymous method.  The instance might be null
1504         (static methods), this (for anonymous methods that capture nothing
1505         and happen to live side-by-side with the current method body) or a
1506         more complicated expression if the method has a CaptureContext.
1507
1508         (EmitContext.EmitTopBlock): Routine that drives the emission of
1509         code: it will first resolve the top block, then emit any metadata
1510         and then emit the code.  The split is done so that we can extract
1511         any anonymous methods and flag any captured variables/parameters.
1512         
1513         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
1514         during this phase, the ILGenerator should not be used as labels
1515         and local variables declared here might not be accessible to any
1516         code that is part of an anonymous method.  
1517
1518         Exceptions to this include the temporary variables that are
1519         created by some statements internally for holding temporary
1520         variables. 
1521         
1522         (EmitContext.EmitMeta): New routine, in charge of emitting all the
1523         metadata for a cb
1524
1525         (EmitContext.TemporaryReturn): This method is typically called
1526         from the Emit phase, and its the only place where we allow the
1527         ReturnLabel to be defined other than the EmitMeta.  The reason is
1528         that otherwise we would have to duplicate a lot of logic in the
1529         Resolve phases of various methods that today is on the Emit
1530         phase. 
1531
1532         (EmitContext.NeedReturnLabel): This no longer creates the label,
1533         as the ILGenerator is not valid during the resolve phase.
1534
1535         (EmitContext.EmitThis): Extended the knowledge in this class to
1536         work in anonymous methods in addition to iterators. 
1537
1538         (EmitContext.EmitCapturedVariableInstance): This emits whatever
1539         code is necessary on the stack to access the instance to a local
1540         variable (the variable will be accessed as a field).
1541
1542         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
1543         EmitContext.EmitAddressOfParameter): Routines to support
1544         parameters (not completed at this point). 
1545         
1546         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
1547         will also remove the parameters.
1548
1549         * convert.cs (Convert): Define a `ConstantEC' which points to a
1550         null.  This is just to prefity some code that uses
1551         ImplicitStandardConversion code and do not have an EmitContext
1552         handy.
1553
1554         The idea is to flag explicitly that at that point in time, it is
1555         known that the conversion will not trigger the delegate checking
1556         code in implicit conversions (which requires a valid
1557         EmitContext). 
1558
1559         Everywhere: pass new EmitContext parameter since
1560         ImplicitStandardConversionExists now requires it to check for
1561         anonymous method conversions. 
1562
1563         (Convert.ImplicitStandardConversionExists): If the type of an
1564         expression is the anonymous_method_type, and the type is a
1565         delegate, we invoke the AnonymousMethod.Compatible method to check
1566         whether an implicit conversion is possible. 
1567
1568         (Convert.ImplicitConversionStandard): Only do implicit method
1569         group conversions if the language level is not ISO_1.
1570
1571         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
1572         MethodInfo for the Invoke method.  used by Delegate and
1573         AnonymousDelegate.
1574
1575         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
1576         method conversions if the target type is a delegate.
1577
1578         Removed extra debugging nops.
1579
1580         (LocalVariableReference): Turn the `local_info' into a public
1581         field. 
1582
1583         Add `prepared' field, the same hack used for FieldExprs to cope
1584         with composed assignments, as Local variables do not necessarily
1585         operate purely on the stack as they used to: they can be captured
1586         fields. 
1587
1588         Add `temp' for a temporary result, like fields.
1589
1590         Refactor DoResolve and DoResolveLValue into DoResolveBase.
1591
1592         It now copes with Local variables that are captured and emits the
1593         proper instance variable to load it from a field in the captured
1594         case. 
1595
1596         (ParameterReference.DoResolveBase): During the resolve phase,
1597         capture parameters if we are in an anonymous method.
1598
1599         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
1600         anonymous method, use the EmitContext helper routines to emit the
1601         parameter reference.
1602
1603         * iterators.cs: Set RemapToProxy to true/false during the
1604         EmitDispose class.
1605
1606         * parameters.cs (GetParameterByName): New helper method. 
1607
1608         * typemanager.cs (anonymous_method_type) a new type that
1609         represents an anonyous method.  This is always an internal type,
1610         used as a fencepost to test against the anonymous-methodness of an
1611         expression. 
1612         
1613 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
1614
1615         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
1616         561 report.
1617         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
1618
1619 2004-11-10  Martin Baulig  <martin@ximian.com>
1620
1621         * expression.cs (Invocation.BetterFunction): If two methods have
1622         equal parameter types, but only one of them is generic, the
1623         non-generic one wins.
1624         (New.DoResolve): Don't set `is_struct' to false if we're a generic
1625         instance; just use `Type.IsValueType' to determine whether
1626         something is a struct or not.
1627         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
1628         so we can be called multiple times.
1629
1630 2004-11-10  Martin Baulig  <martin@ximian.com>
1631
1632         * generic.cs (TypeParameter.DefineConstraints): New public method.
1633         (TypeParameter.CheckAccessLevel): Override this and return true.
1634         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
1635         override ResolveType() anymore.
1636         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
1637
1638 2004-11-10  Martin Baulig  <martin@ximian.com>
1639
1640         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
1641         call DeclSpace.ResolveNestedType() on it.
1642
1643 2004-11-10  Martin Baulig  <martin@ximian.com>
1644
1645         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
1646         non-null, call ParameterModifier() on it.
1647
1648 2004-11-10  Martin Baulig  <martin@ximian.com>
1649
1650         * iterators.cs
1651         (Iterators): Added `current_type' and `this_type' fields.
1652         (Iterators.DefineIterator): Create a new EmitContext and store it
1653         in `ec'; compute `this_type'.
1654
1655 2004-11-10  Martin Baulig  <martin@ximian.com>
1656
1657         * typemanager.cs
1658         (TypeManager.IsPrivateAccessible): New public method.
1659         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
1660
1661 2004-11-10  Martin Baulig  <martin@ximian.com>
1662
1663         * class.cs (TypeContainer.DefineType): Call
1664         TypeBuilder.DefineGenericParameters() before resolving the type
1665         parameters.
1666         (MethodData.parent_method): New protected field.
1667         (MethodData..ctor): Added `MethodInfo parent_method' argument.
1668         (MethodData.Define): Compute `parent_method'.
1669
1670         * decl.cs
1671         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1672         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1673         (DeclSpace.ec): New protected field; store the EmitContext here.
1674         (DeclSpace.EmitContext): New public property.
1675         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
1676         (DeclSpace.ResolveNestedType): New public method.
1677         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
1678         (DeclSpace.NestedAccessible): Added `Type tb' argument.
1679         (DeclSpace.FamilyAccessible): Likewise.
1680         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
1681         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1682         EmitContext.
1683
1684         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
1685         field.
1686
1687         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1688         (Enum.Emit): Don't create a new EmitContext.
1689
1690 2004-10-18  Martin Baulig  <martin@ximian.com>
1691
1692         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
1693         `Type' directly, but call ResolveType() on it.
1694         (Catch.Resolve): Likewise.
1695         (Foreach.Resolve): Likewise.
1696
1697 2004-10-18  Martin Baulig  <martin@ximian.com>
1698
1699         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
1700         `Type' directly, but call ResolveType() on it.
1701         (Probe.DoResolve): Likewise.
1702         (ArrayCreation.LookupType): Likewise.
1703         (TypeOf.DoResolve): Likewise.
1704         (SizeOf.DoResolve): Likewise.
1705
1706 2004-10-18  Raja R Harinath  <rharinath@novell.com>
1707
1708         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
1709         the ResolveType.
1710
1711 2004-10-17  John Luke  <john.luke@gmail.com>
1712
1713         * class.cs (Operator.GetSignatureForError): use CSharpName
1714
1715         * parameter.cs (Parameter.GetSignatureForError): Returns
1716         correct name even if was not defined.
1717
1718 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1719
1720         Fix #65816.
1721         * class.cs (TypeContainer.EmitContext): New property.
1722         (DefineNestedTypes): Create an emitcontext for each part.
1723         (MethodCore.DoDefineParameters): Use container's emitcontext.
1724         Pass type array to InternalParameters.
1725         (MemberBase.DoDefine): Use container's emitcontext.
1726         (FieldMember.Define): Likewise.
1727         (Event.Define): Likewise.
1728         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1729         Pass type array to InternalParameters.
1730         (SetIndexerMethod.GetParameterInfo): Likewise.
1731         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1732         * delegate.cs (Define): Pass emitcontext to
1733         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1734         array to InternalParameters.
1735         * expression.cs (ParameterReference.DoResolveBase): Pass
1736         emitcontext to GetParameterInfo.
1737         (ComposedCast.DoResolveAsTypeStep): Remove check on
1738         ec.ResolvingTypeTree.
1739         * parameter.cs (Parameter.Resolve): Change argument to
1740         EmitContext.  Use ResolveAsTypeTerminal.
1741         (Parameter.GetSignature): Change argument to EmitContext.
1742         (Parameters.ComputeSignature): Likewise.
1743         (Parameters.ComputeParameterTypes): Likewise.
1744         (Parameters.GetParameterInfo): Likewise.
1745         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1746         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1747         * support.cs (InternalParameters..ctor): Remove variant that takes
1748         a DeclSpace.
1749         * typemanager.cs (system_intptr_expr): New.
1750         (InitExpressionTypes): Initialize it.
1751
1752 2004-10-12  Chris Toshok  <toshok@ximian.com>
1753
1754         * cs-parser.jay: fix location for try_statement and catch_clause.
1755
1756 2004-10-18  Martin Baulig  <martin@ximian.com>
1757
1758         * class.cs (FieldMember.Define): Don't access the TypeExpr's
1759         `Type' directly, but call ResolveType() on it.
1760         (MemberBase.DoDefine): Likewise.
1761
1762         * expression.cs (New.DoResolve): Don't access the TypeExpr's
1763         `Type' directly, but call ResolveType() on it.
1764         (ComposedCast.DoResolveAsTypeStep): Likewise.
1765
1766         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
1767         `Type' directly, but call ResolveType() on it.
1768
1769 2004-10-17  John Luke  <john.luke@gmail.com>
1770
1771         * class.cs (Operator.GetSignatureForError): use CSharpName
1772
1773         * parameter.cs (Parameter.GetSignatureForError): Returns
1774         correct name even if was not defined.
1775
1776 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1777
1778         Fix #65816.
1779         * class.cs (TypeContainer.EmitContext): New property.
1780         (DefineNestedTypes): Create an emitcontext for each part.
1781         (MethodCore.DoDefineParameters): Use container's emitcontext.
1782         Pass type array to InternalParameters.
1783         (MemberBase.DoDefine): Use container's emitcontext.
1784         (FieldMember.Define): Likewise.
1785         (Event.Define): Likewise.
1786         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1787         Pass type array to InternalParameters.
1788         (SetIndexerMethod.GetParameterInfo): Likewise.
1789         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1790         * delegate.cs (Define): Pass emitcontext to
1791         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1792         array to InternalParameters.
1793         * expression.cs (ParameterReference.DoResolveBase): Pass
1794         emitcontext to GetParameterInfo.
1795         (ComposedCast.DoResolveAsTypeStep): Remove check on
1796         ec.ResolvingTypeTree.
1797         * parameter.cs (Parameter.Resolve): Change argument to
1798         EmitContext.  Use ResolveAsTypeTerminal.
1799         (Parameter.GetSignature): Change argument to EmitContext.
1800         (Parameters.ComputeSignature): Likewise.
1801         (Parameters.ComputeParameterTypes): Likewise.
1802         (Parameters.GetParameterInfo): Likewise.
1803         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1804         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1805         * support.cs (InternalParameters..ctor): Remove variant that takes
1806         a DeclSpace.
1807         * typemanager.cs (system_intptr_expr): New.
1808         (InitExpressionTypes): Initialize it.
1809
1810 2004-10-12  Chris Toshok  <toshok@ximian.com>
1811
1812         * cs-parser.jay: fix location for try_statement and catch_clause.
1813
1814 2004-10-07  Raja R Harinath  <rharinath@novell.com>
1815
1816         More DeclSpace.ResolveType avoidance.
1817         * decl.cs (MemberCore.InUnsafe): New property.
1818         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
1819         with newly created EmitContext.
1820         (FieldMember.Define): Likewise.
1821         * delegate.cs (Delegate.Define): Likewise.
1822         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
1823         only if normal name-lookup fails.
1824         (TypeExpr.DoResolve): Enable error-checking.
1825         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
1826         (SizeOf.DoResolve): Likewise.
1827         (ComposedCast.DoResolveAsTypeStep): Likewise.
1828         (StackAlloc.DoResolve): Likewise.
1829         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
1830         (Block.Unsafe): New property.
1831         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
1832         (Unsafe): Set 'unsafe' flag of contained block.
1833         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
1834         (Fixed.Resolve): Likewise.
1835         (Catch.Resolve): Likewise.
1836         (Using.ResolveLocalVariableDecls): Likewise.
1837         (Foreach.Resolve): Likewise.
1838
1839 2004-10-05  John Luke <john.luke@gmail.com>
1840
1841         * cs-parser.jay: add location to error CS0175
1842
1843 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
1844
1845         * ecore.cs (Expression.Constantity): Add support for turning null
1846         into a constant.
1847
1848         * const.cs (Const.Define): Allow constants to be reference types
1849         as long as the value is Null.
1850
1851 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
1852
1853         * namespace.cs (NamespaceEntry.Using): No matter which warning
1854         level is set, check if this namespace name has already been added.
1855
1856 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
1857
1858         * expression.cs: reftype [!=]= null should always use br[true,false].
1859         # 67410
1860
1861 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
1862
1863         Fix #67108
1864         * attribute.cs: Enum conversion moved to 
1865         GetAttributeArgumentExpression to be applied to the all
1866         expressions.
1867
1868 2004-10-01  Raja R Harinath  <rharinath@novell.com>
1869
1870         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
1871         * class.c (TypeContainer.DefineType): Flag error if
1872         base types aren't accessible due to access permissions.
1873         * decl.cs (DeclSpace.ResolveType): Move logic to
1874         Expression.ResolveAsTypeTerminal.
1875         (DeclSpace.ResolveTypeExpr): Thin layer over
1876         Expression.ResolveAsTypeTerminal.
1877         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
1878         Refactor code into NestedAccess.  Use it.
1879         (DeclSpace.NestedAccess): New.
1880         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
1881         argument to silence errors.  Check access permissions.
1882         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
1883         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
1884         (Cast.DoResolve): Likewise.
1885         (New.DoResolve): Likewise.
1886         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
1887         (TypeOf.DoResolve): Likewise.
1888
1889         * expression.cs (Invocation.BetterConversion): Return the Type of
1890         the better conversion.  Implement section 14.4.2.3 more faithfully.
1891         (Invocation.BetterFunction): Make boolean.  Make correspondence to
1892         section 14.4.2.2 explicit.
1893         (Invocation.OverloadResolve): Update.
1894         (Invocation): Remove is_base field.
1895         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
1896         (Invocation.Emit): Likewise.
1897
1898 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
1899
1900         * cs-parser.jay: Reverted 642 warning fix.
1901
1902 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1903
1904         Fix bug #66615
1905         * decl.cs (FindMemberWithSameName): Indexer can have more than
1906         1 argument.
1907
1908 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1909
1910         * expression.cs (LocalVariableReference.DoResolveLValue):
1911         Do not report warning 219 for out values.
1912         (EmptyExpression.Null): New member to avoid extra allocations.
1913
1914 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1915
1916         * cs-parser.jay: Fix wrong warning 642 report.
1917
1918         * cs-tokenizer.cs (CheckNextToken): New helper;
1919         Inspect next character if is same as expected.
1920
1921 2004-09-23  Martin Baulig  <martin@ximian.com>
1922
1923         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
1924         (Convert.ImplicitReferenceConversionExists): Likewise.
1925
1926 2004-11-09  Raja R Harinath  <rharinath@novell.com>
1927
1928         * Makefile (DISTFILES): Comment out a few missing files.
1929
1930 2004-10-29  Raja R Harinath  <rharinath@novell.com>
1931
1932         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
1933         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
1934         (gmcs.exe): Invoke bootstrap-libs.
1935         (clean-local): Clean the net_2_0_bootstrap profile too.
1936         (PROGRAM_INSTALL_DIR): New.
1937         (install-local): Use it.
1938
1939 2004-10-13  Martin Baulig  <martin@ximian.com>
1940
1941         * generic.cs (TypeManager.InflatedConstraints): New nested class.
1942         (TypeParameter.DefineType): If we're a method type parameter and
1943         that method is overriding something, "inflate" its constraints.
1944
1945 2004-10-12  Martin Baulig  <martin@ximian.com>
1946
1947         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
1948         and have type arguments, create and resolve a ConstructedType.
1949
1950 2004-10-12  Martin Baulig  <martin@ximian.com>
1951
1952         * decl.cs (MemberCache.FindMemberToOverride): Use
1953         TypeManager.IsEqual() to compare the parameters and Type.Equals()
1954         to compare the invocationType.
1955
1956         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
1957         When comparing two type parameters, only do the signature-only
1958         comparision for method type parameters.
1959
1960 2004-10-11  Martin Baulig  <martin@ximian.com>
1961
1962         * report.cs: Don't make --fatal abort on warnings, we have
1963         -warnaserror for that.
1964
1965 2004-10-11  Martin Baulig  <martin@ximian.com>
1966
1967         * typemanager.cs
1968         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
1969         (TypeManager.IsEqual): Call ourself recursively instead of using
1970         Type.IsEqual(). 
1971
1972 2004-10-11  Martin Baulig  <martin@ximian.com>
1973
1974         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
1975         on our own type parameters, not on the ones we inherit from a containing
1976         class.
1977
1978         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
1979         the comparision.
1980
1981         * generic.cs (TypeParameter.Define): We may only be called once.
1982
1983         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
1984         instead of TypeManager.IsEqual().
1985
1986 2004-09-28  Martin Baulig  <martin@ximian.com>
1987
1988         * generic.cs
1989         (GenericConstraints.EffectiveBaseClass): New public property.
1990         (TypeParameter.GenericConstraints): New public property.
1991         (ConstructedType.CheckConstraints): Improved.
1992
1993         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
1994         (Convert.TypeParameterConversion): New private method; use this in
1995         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
1996         for all conversions related to type parameters.
1997
1998 2004-09-24  Martin Baulig  <martin@ximian.com>
1999
2000         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2001         type parameter conversions for type parameters which are known to
2002         be reference types.
2003
2004 2004-09-24  Martin Baulig  <martin@ximian.com>
2005
2006         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2007         `IsValueType' properties.
2008
2009         * support.cs (ReflectionConstraints): Use
2010         Type.GetGenericParameterConstraints() instead of the old hack.
2011
2012 2004-09-24  Martin Baulig  <martin@ximian.com>
2013
2014         * generic.cs (GenericConstraints): Moved here and made it an
2015         abstract class.
2016
2017         * support.cs (GenericConstraints): Moved to generic.cs.
2018
2019 2004-09-24  Martin Baulig  <martin@ximian.com>
2020
2021         * support.cs
2022         (ReflectionConstraints): Un-nested this class and made it public.
2023
2024         * typemanager.cs
2025         (TypeManager.GetTypeParameterConstraints): New public method.
2026         (TypeManager.HasConstructorConstraint): Use the attributes.
2027
2028 2004-09-24  Martin Baulig  <martin@ximian.com>
2029
2030         * support.cs (GenericConstraints): Replaced `HasConstructor',
2031         `IsReferenceType' and `IsValueType' with `Attributes'.
2032         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2033         method and made the .ctor public.
2034
2035         * generic.cs (Constraints.Attributes): New public property.
2036         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2037         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2038         `IsValueType' -> `HasValueTypeConstraint'.
2039
2040 2004-09-23  Martin Baulig  <martin@ximian.com>
2041
2042         * generic.cs (Constraints): Reflect latest runtime changes.
2043
2044 2004-09-23  Martin Baulig  <martin@ximian.com>
2045
2046         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2047         (Convert.ImplicitReferenceConversionExists): Likewise.
2048
2049 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2050
2051         * class.cs (Operator.Define): Add error 448 and 559 report.
2052         
2053 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2054
2055         * class.cs (MemberBase.IsTypePermitted): New protected
2056         method for checking error CS0610.
2057
2058 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2059
2060         * class.cs (TypeContainer.HasExplicitLayout): New property
2061         Returns whether container has StructLayout attribute set Explicit.
2062         (FieldMember): New abstract class for consts and fields.
2063         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2064         (Field): Reuse FieldMember.
2065
2066         * const.cs (Const): Reuse FieldMember.
2067
2068         * rootcontext.cs: EmitConstants call moved to class.
2069
2070 2004-09-22  Martin Baulig  <martin@ximian.com>
2071
2072         Marek and me just fixed one of our oldest bugs: #28562 :-)
2073
2074         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2075
2076         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2077         we're an EnumConstant, just return that.
2078         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2079         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2080         to get the value which'll actually be written into the attribute.
2081         However, we have to use GetValue() to access the attribute's value
2082         in the compiler.        
2083
2084 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2085
2086         * constant.cs (Constant.IsNegative): New abstract property
2087         IsNegative.
2088
2089         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2090         (StackAlloc.DoResolve): Reused IsNegative.
2091
2092 2004-09-22  Martin Baulig  <martin@ximian.com>
2093
2094         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2095         public method; like LookupTypeContainer, but also works for
2096         generic instances.
2097
2098         * report.cs (Report.SymbolRelatedToPreviousError): Use
2099         TypeManager.LookupGenericTypeContainer().       
2100
2101 2004-09-22  Martin Baulig  <martin@ximian.com>
2102
2103         Thanks to Peter Sestoft for this bug report.
2104
2105         * expression.cs (Conditional): If both the `trueExpr' and the
2106         `falseExpr' is a NullLiteral, return a NullLiteral.
2107
2108 2004-09-22  Martin Baulig  <martin@ximian.com>
2109
2110         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2111         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2112         for the "get_Current" call.
2113
2114 2004-09-21  Martin Baulig  <martin@ximian.com>
2115
2116         * convert.cs (Convert.ImplicitReferenceConversion): When
2117         converting to an interface type, first check whether we're
2118         converting from a reference type.
2119
2120 2004-09-14  Martin Baulig  <martin@ximian.com>
2121
2122         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2123
2124 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2125
2126         Fixed bug #61902
2127         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2128         called and is obsolete then this member suppress message
2129         when call is inside next [Obsolete] method or type.
2130
2131         * expression.cs: Use TestObsoleteMethodUsage member.
2132
2133 2004-09-14  Martin Baulig  <martin@ximian.com>
2134
2135         * genericparser.cs: Removed.
2136
2137 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2138
2139         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2140
2141 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2142
2143         * attribute.cs (Attribute.Resolve): Add error 653 report.
2144
2145         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2146         report.
2147         (Method.ApplyAttributeBuilder): Add error 685 report.
2148         (Operator.Define): Add error 564 report.
2149
2150         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2151
2152         * expression.cs (Invocation.DoResolve): Add error
2153         245 and 250 report.
2154
2155         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2156         error 674 report.
2157
2158 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2159
2160         * class.cs (ConstructorInitializer.Resolve):
2161         Wrong error number (515->516).
2162
2163 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2164
2165         * class.cs (Indexer.Define): Add error 631 report.
2166
2167 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2168
2169         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2170
2171 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2172
2173         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2174
2175 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2176
2177         * cs-parser.jay: Added error CS0241 report.
2178
2179 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2180
2181         * cs-parser.jay (fixed_statement): Introduce a scope for the
2182         declaration in the 'fixed' statement.
2183
2184 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2185
2186         * cs-parser.jay: Added CS0230 error report.
2187
2188 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2189
2190         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2191
2192 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2193
2194         * expression.cs (Argument.Resolve): Added error CS0192 and
2195         CS0199 report.
2196
2197 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2198
2199         C# 2.0 #pragma warning feature
2200
2201         * cs-tokenizer.cs (PreProcessPragma): New method; 
2202         Handles #pragma directive.
2203
2204         * report.cs (WarningRegions): New class; Support
2205         class for #pragma warning directive. It tests whether
2206         warning is enabled for a given line.
2207
2208 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2209
2210         * const.cs: Add more descriptive error report, tahnks to
2211         Sebastien. 
2212
2213 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2214
2215         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2216
2217 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2218
2219         * expression.cs: Apply patch from Ben: Remove dead code from
2220         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2221         as that code just threw an exception anwyays.
2222
2223         * const.cs: Remove the call to the turnintoconstant, for details
2224         see bug: #63144
2225         
2226         * literal.cs: The type of the null-literal is the null type;  So
2227         we use a placeholder type (literal.cs:System.Null, defined here)
2228         for it.
2229
2230         * expression.cs (Conditional.DoResolve): Remove some old code that
2231         is no longer needed, conversions have been fixed.
2232
2233         (ArrayCreationExpression.DoResolve): Return false if we fail to
2234         resolve the inner expression.
2235
2236 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2237
2238         Fix test-290.cs.
2239         * cs-parser.jay (delegate_declaration): Record a delegate
2240         declaration as a type declaration.
2241         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2242
2243 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2244
2245         * parameter.cs: Do not crash if the type can not be resolved. 
2246
2247         * expression.cs: Report errors with unsafe pointers, fixes #64896
2248
2249 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2250
2251         * expression.cs: Pointer arith always needs to do a conv.i
2252         if the operand is a long. fix 65320
2253
2254 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2255
2256         Fixed cs0619-37.cs, cs0619-38.cs
2257
2258         * enum.cs (GetObsoleteAttribute): Removed.
2259
2260         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2261         on Enum member is double staged. The first is tested member
2262         and then enum.
2263
2264 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2265
2266         Fixed #56986, #63631, #65231
2267
2268         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2269         adds member to name container.
2270         (TypeContainer.AddToTypeContainer): New method, adds type to
2271         name container.
2272         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2273         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2274         AddOperator): Simplified by reusing AddToMemberContainer.
2275         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2276         instead of field.
2277         (Method.CheckForDuplications): Fixed implementation to test all
2278         possibilities.
2279         (MemberBase): Detection whether member is explicit interface
2280         implementation is now in constructor.
2281         (MemberBase.UpdateMemberName): Handles IndexerName.
2282         (Accessor): Changed to keep also location information.
2283         (AbstractPropertyEventMethod): Is derived from MemberCore.
2284         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2285         will be emited or not.
2286         (PropertyBase.AreAccessorsDuplicateImplementation):
2287         Tests whether accessors are not in collision with some method.
2288         (Operator): Is derived from MethodCore to simplify common
2289         operations.
2290
2291         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2292         must be performed.
2293         (DeclSpace.AddToContainer): Adds the member to defined_names
2294         table. It tests for duplications and enclosing name conflicts.
2295
2296         * enum.cs (EnumMember): Clean up to reuse the base structures
2297
2298 2004-09-03  Martin Baulig  <martin@ximian.com>
2299
2300         Merged latest changes into gmcs.  Please keep this comment in
2301         here, it makes it easier for me to see what changed in MCS since
2302         the last time I merged.
2303
2304 2004-09-03  Martin Baulig  <martin@ximian.com>
2305
2306         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2307         into TypeContainer, to make partial classes work again.
2308
2309 2004-09-03  Martin Baulig  <martin@ximian.com>
2310
2311         * rootcontext.cs (RootContext.V2): Removed.
2312
2313 2004-03-23  Martin Baulig  <martin@ximian.com>
2314
2315         * expression.cs (Invocation.OverloadResolve): Added `bool
2316         may_fail' argument and use it instead of the Location.IsNull() hack.
2317
2318 2004-09-09  Martin Baulig  <martin@ximian.com>
2319
2320         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2321
2322 2004-09-09  Martin Baulig  <martin@ximian.com>
2323
2324         * generic.cs (TypeParameter.DefineType): Added support for
2325         explicit interface methods.
2326
2327 2004-09-09  Martin Baulig  <martin@ximian.com>
2328
2329         * README.Changes: New document.  Started to list important changes
2330         between MCS and GMCS here.
2331
2332 2004-09-08  Martin Baulig  <martin@ximian.com>
2333
2334         * class.cs
2335         (TypeContainer.CheckRecursiveDefinition): New protected method.
2336         (TypeContainer.DefineType): Move the CS0146 check into
2337         CheckRecursiveDefinition().     
2338
2339 2004-09-06  Martin Baulig  <martin@ximian.com>
2340
2341         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2342         types for the constructor constraint.
2343
2344 2004-09-03  Martin Baulig  <martin@ximian.com>
2345
2346         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2347         into TypeContainer, to make partial classes work again.
2348
2349 2004-09-03  Martin Baulig  <martin@ximian.com>
2350
2351         * rootcontext.cs (RootContext.V2): Removed.
2352
2353 2004-03-23  Martin Baulig  <martin@ximian.com>
2354
2355         * expression.cs (Invocation.OverloadResolve): Added `bool
2356         may_fail' argument and use it instead of the Location.IsNull() hack.
2357
2358 2004-09-03  Martin Baulig  <martin@ximian.com>
2359
2360         Merged latest changes into gmcs.  Please keep this comment in
2361         here, it makes it easier for me to see what changed in MCS since
2362         the last time I merged.
2363
2364 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2365
2366         Fix #61128.
2367         * expression.cs (BetterConversion): Don't allow either conversion 
2368         to be null.  Remove redundant implicit conversion test when 'q ==
2369         null' -- when this function is invoked, we already know that the
2370         implicit conversion exists.
2371         (BetterFunction): Assume that 'best' is non-null.  Remove
2372         redundant reimplementation of IsApplicable when 'best' is null.
2373         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2374         number of arguments.
2375         (IsAncestralType): Extract from OverloadResolve.
2376         (OverloadResolve): Make robust to the MethodGroupExpr being
2377         unsorted.  Implement all the logic of Section 14.5.5.1, and
2378         support overloading of methods from multiple applicable types.
2379         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2380
2381         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2382         (RealError, Warning): Append type of report to related symbol.
2383
2384 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2385
2386         * enum.cs: Fixed CLS-Compliance checks for enum members.
2387         Error tests cs3008-8.cs, cs3014-8.cs
2388
2389 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2390
2391         Fixed bug #62342, #63102
2392         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2393         like ImplementMethod.
2394
2395 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2396
2397         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2398         Fixed bug #65170.
2399
2400 2004-09-02  Martin Baulig  <martin@ximian.com>
2401
2402         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2403         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2404         on the MethodBase.
2405
2406 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2407
2408         C# 2.0 Static classes implemented
2409
2410         * class.cs (TypeContainer): instance_constructors,
2411         initialized_fields, initialized_static_fields,
2412         default_constructor, base_inteface_types are protected to be
2413         accessible from StaticClass.
2414         (TypeContainer.DefineDefaultConstructor): New virtual method
2415         for custom default constructor generating
2416         (StaticClass): New class to handle "Static classes" feature.
2417
2418         * cs-parser.jay: Handle static keyword on class like instance
2419         of StaticClass.
2420
2421         * driver.cs: Added "/langversion" command line switch with two
2422         options (iso-1, default).
2423
2424 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2425
2426         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2427
2428 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2429
2430         * delegate.cs: Style.
2431
2432 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2433
2434         * delegate.cs: Add seperate instance expr field for miguel.
2435
2436 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2437
2438         * PointerArithmetic (Resolve): make sure we are not doing
2439         pointer arith on void*. Also, make sure we are resolved
2440         by not setting eclass until resolve.
2441
2442         All callers: Make sure that PointerArithmetic gets resolved.
2443
2444 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2445
2446         * ArrayCreation (LookupType): If the type does not resolve 
2447         to an array, give an error.
2448
2449 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2450
2451         * statement.cs (Try.Resolve): Fixed bug #64222
2452
2453 2004-08-27  Martin Baulig  <martin@ximian.com>
2454
2455         * class.cs
2456         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2457         crash here.     
2458
2459 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2460
2461         * ecore.cs (Constantify): Get underlying type via
2462         System.Enum.GetUnderlyingType to avoid StackOverflow on the
2463         Windows in special cases.
2464
2465 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2466
2467         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
2468         for obtaining also private methods.
2469         (GetRemoveMethod): Used GetRemoveMethod (true)
2470         for obtaining also private methods.
2471
2472 2004-09-02  Martin Baulig  <martin@ximian.com>
2473
2474         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2475         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2476         on the MethodBase.
2477
2478 2004-08-27  Martin Baulig  <martin@ximian.com>
2479
2480         * class.cs
2481         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2482         crash here.     
2483
2484 2004-08-25  Martin Baulig  <martin@ximian.com>
2485
2486         * support.cs (ReflectionParameters..ctor): If this is a generic
2487         method, retrieve and store its type parameters.
2488         (InternalParameters..ctor): Added `TypeParameter[]' argument.
2489         (ReflectionParameters.GenericConstraints): The argument specifies
2490         the type parameter, not the method parameter.
2491         (InternalParameters.GenericConstraints): Likewise.
2492
2493         * generic.cs (TypeParameter.DefineType): Correctly handle
2494         constraints wrt. generic methods in interfaces and their
2495         implementations.        
2496
2497 2004-08-24  Martin Baulig  <martin@ximian.com>
2498
2499         * generic.cs (TypeParameter.IsSubclassOf): New public method.
2500         (Constraints.IsSubclassOf): New internal method.
2501
2502         * typemanager.cs (TypeManager.FindMembers): Added special support
2503         for GenericTypeParameterBuilder's.      
2504         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
2505         type parameters.
2506
2507 2004-08-24  Martin Baulig  <martin@ximian.com>
2508
2509         * typemanager.cs
2510         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2511         this for accessibility checks.
2512         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
2513         IsNestedFamilyAccessible.
2514         (TypeManager.IsSubclassOf): New method, do what the name actually
2515         says.   
2516
2517 2004-08-24  Martin Baulig  <martin@ximian.com>
2518
2519         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
2520         as a SimpleName, include the generic arity.
2521
2522 2004-08-24  Martin Baulig  <martin@ximian.com>
2523
2524         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
2525         MethodAttributes.HideBySig for operators.
2526
2527 2004-08-23  Martin Baulig  <martin@ximian.com>
2528
2529         Back to the old error reporting system :-)
2530
2531         * report.cs (Message): Removed.
2532         (Report.MessageData, ErrorData, WarningData): Removed.
2533         (Report.Error, Warning): Back to the old system.
2534
2535 2004-08-23  Martin Baulig  <martin@ximian.com>
2536
2537         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
2538
2539         * class.cs (TypeContainer.ParentContainer): New public virtual
2540         method; replaces the explicit interface implementation.
2541         (ClassPart.ParentContainer): Override.
2542
2543 2004-08-23  Martin Baulig  <martin@ximian.com>
2544
2545         * statement.cs (Switch): Added support for constant switches; see
2546         #59428 or test-285.cs.
2547
2548 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2549
2550         Fixed bug #62740.
2551         * statement.cs (GetEnumeratorFilter): Removed useless
2552         logic because C# specs is strict. GetEnumerator must be
2553         public.
2554
2555 2004-08-22  Martin Baulig  <martin@ximian.com>
2556
2557         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2558         a switch and may break, reset the barrier.  Fixes #59867.
2559
2560 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2561
2562         CLS-Compliance speed up (~5% for corlib)
2563
2564         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
2565         New method. Tests container for CLS-Compliant names
2566
2567         * class.cs (TypeContainer.VerifyClsName): New method.
2568         Checks whether container name is CLS Compliant.
2569         (Constructor): Implements IMethodData.
2570
2571         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
2572         low-case table for CLS Compliance test.
2573         (MemberCache.VerifyClsParameterConflict): New method.
2574         Checks method parameters for CS3006 error.
2575
2576         * enum.cs (EnumMember): Is derived from MemberCore.
2577         (Enum.VerifyClsName): Optimized for better performance.
2578
2579 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2580
2581         * report.cs: Renamed Error_T to Error and changed all
2582         references.
2583
2584 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2585
2586         * class.cs (TypeContainer.IndexerArrayList): New inner class
2587         container for indexers.
2588         (TypeContainer.DefaultIndexerName): New constant for default
2589         indexer name. Replaced all "Item" with this constant.
2590         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
2591
2592         * typemanager.cs (TypeManager.default_member_ctor): Cache here
2593         DefaultMemberAttribute constructor.
2594
2595 2004-08-05  Martin Baulig  <martin@ximian.com>
2596
2597         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2598         Fix bug #59429.
2599
2600 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
2601
2602         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
2603         multi platforms problem.
2604
2605         * compiler.csproj: Included shared files.
2606
2607 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2608
2609         Fix bug 60333, 55971 in the more general way
2610         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2611         Added arg_type argument for constant conversion.
2612         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
2613
2614 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2615
2616         Fix bug #59760
2617         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
2618         OperatorArrayList, MethodCoreArrayList for typecontainer
2619         containers. Changed class member types to these new types.
2620         (MethodArrayList.DefineMembers): Added test for CS0659.
2621
2622 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
2623
2624         * cfold.cs: Synchronize the folding with the code in expression.cs
2625         Binary.DoNumericPromotions for uint operands.
2626
2627         * attribute.cs: Revert patch from Raja, it introduced a regression
2628         while building Blam-1.2.1 (hard to isolate a test case).
2629
2630 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2631
2632         Fix for #55382
2633         * class.cs:
2634         (TypeContainer.Define): Renamed to DefineContainerMembers because of
2635         name collision.
2636         (MethodCore.parent_method): New member. The method we're overriding
2637         if this is an override method.
2638         (MethodCore.CheckBase): Moved from Method class and made common.
2639         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
2640         private.
2641         (MethodCore.CheckForDuplications): New abstract method. For custom
2642         member duplication search in a container
2643         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
2644         method and its return type.
2645         (Event.conflict_symbol): New member. Symbol with same name in the
2646         parent class.
2647
2648         * decl.cs:
2649         (MemberCache.FindMemberWithSameName): New method. The method
2650         is looking for conflict with inherited symbols.
2651
2652 2004-08-04  Martin Baulig  <martin@ximian.com>
2653
2654         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2655
2656         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2657
2658 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2659
2660         * report.cs (Message): New enum for better error, warning reference in
2661         the code.
2662         (MessageData): New inner abstract class. It generally handles printing of
2663         error and warning messages.
2664         Removed unused Error, Warning, Message methods.
2665
2666 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2667
2668         Fix for cs0592-8.cs test
2669         * attribute.cs
2670         (Attributable.ValidAttributeTargets): Made public.
2671         (Attribute.ExplicitTarget): New member for explicit target value.
2672         (Attribute.CheckTargets): Now we translate explicit attribute
2673         target to Target here.
2674
2675 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
2676
2677         * ecore.cs (MethodGroupExpr): new IsBase property.
2678
2679         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
2680
2681         * delegate.cs (DelegateCreation): store a MethodGroupExpr
2682         rather than an instance expr.
2683
2684         (DelegateCreation.Emit): Use the method group rather than
2685         the instance expression. Also, if you have base.Foo as the
2686         method for a delegate, make sure to emit ldftn, not ldftnvirt.
2687
2688         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
2689
2690         (NewDelegate.DoResolve): Only check for the existance of Invoke
2691         if the method is going to be needed. Use MethodGroupExpr.
2692
2693         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
2694
2695         * expression.cs: For pointer arith., make sure to use
2696         the size of the type, not the size of the pointer to
2697         the type.
2698
2699 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2700
2701         Fix for #60722
2702         * class.cs (Class): Added error CS0502 test.
2703
2704 2004-08-03  John Luke  <jluke@cfl.rr.com>
2705             Raja R Harinath  <rharinath@novell.com>
2706
2707         Fix for #60997.
2708         * attribute.cs (Attribute.complained_before): New flag.
2709         (Attribute.ResolveType, Attribute.Resolve),
2710         (Attribute.DefinePInvokeMethod): Set it.
2711         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
2712         
2713 2004-08-03  Martin Baulig  <martin@ximian.com>
2714
2715         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2716         use a user-defined operator; we still need to do numeric
2717         promotions in case one argument is a builtin type and the other
2718         one has an implicit conversion to that type.  Fixes #62322.
2719
2720 2004-08-18  Martin Baulig  <martin@ximian.com>
2721
2722         * class.cs (Method.Define): Use the correct method name when
2723         creating the MethodBuilder for a generic method.
2724
2725 2004-08-17  Martin Baulig  <martin@ximian.com>
2726
2727         * generic.cs (Constraints): Support type parameter constraints.
2728
2729 2004-08-16  Martin Baulig  <martin@ximian.com>
2730
2731         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
2732         (Token.GENERIC_DIMENSION): New token; this is returned if we
2733         encounter an unbound generic type in a typeof() expression.
2734
2735         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
2736         this token is only generated while parsing a typeof() expression.
2737         (typeof_expression): Removed the old unbound_type hack.
2738
2739         * generic.cs (TypeArguments.IsUnbound): New public property.
2740
2741         * decl.cs (MemberName): Added support for unbound types.
2742
2743 2004-08-14  Martin Baulig  <martin@ximian.com>
2744
2745         * typemanager.cs
2746         (TypeManager.IsEqualGenericInstance): New static method.
2747         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
2748         just used to check accessibility, so follow the rules of 26.1.6.        
2749
2750         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
2751         ConstructedType instead of a TypeExpression if we have type arguments.
2752
2753         * cs-parser.jay (typeof_expression): Support unbound generic types.
2754
2755         * ecore.cs (UnboundTypeExpression): New public class.
2756
2757 2004-08-12  Martin Baulig  <martin@ximian.com>
2758
2759         * typemanager.cs (TypeManager.IsNestedChildOf): Use
2760         TypeManager.IsEqual() rather than `=='.
2761
2762         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
2763         generic instances as well.
2764
2765 2004-08-12  Martin Baulig  <martin@ximian.com>
2766
2767         * expression.cs (Invocation.InferType): We can only infer method
2768         type parameters.  Fixes #62647.
2769
2770 2004-08-11  Martin Baulig  <martin@ximian.com>
2771
2772         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
2773         before resolving the base classes.
2774
2775 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2776
2777         * Makefile: install .mdb file too.
2778
2779 2004-08-05  Martin Baulig  <martin@ximian.com>
2780
2781         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
2782         initializer, the current type is just the TypeBuilder, not the
2783         instantiated generic type.
2784         (FieldExpr.IsFieldInitializer): New public property.
2785
2786 2004-08-04  Martin Baulig  <martin@ximian.com>
2787
2788         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2789
2790         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2791
2792 2004-08-03  Martin Baulig  <martin@ximian.com>
2793
2794         * class.cs (MethodData.Define): If we're an explicit
2795         implementation, remove the generic arity from the type name.
2796
2797 2004-08-03  Martin Baulig  <martin@ximian.com>
2798
2799         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2800         use a user-defined operator; we still need to do numeric
2801         promotions in case one argument is a builtin type and the other
2802         one has an implicit conversion to that type.  Fixes #62322.
2803
2804 2004-08-02  Martin Baulig  <martin@ximian.com>
2805
2806         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
2807         `TypeExpr[]' array.
2808         (TypeContainer.GetClassBases): Return the unexpanded list of
2809         interfaces; we expand them later.
2810         (TypeContainer.DefineType): After creating the TypeBuilder, call
2811         TypeManager.ExpandInterfaces() to get an expanded and resolved
2812         list of interfaces.
2813
2814         * ecore.cs (TypeExpr.GetInterfaces): Removed
2815
2816         * generics.cs (Constraints.InterfaceConstraints): Remove.
2817         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
2818         register the interface constraints.
2819
2820         * typemanager.cs
2821         (TypeManager.AddUserType): Removed the `ifaces' argument.
2822         (TypeManager.AddTypeParameter): Likewise.
2823         (TypeManager.AddUserInterface): Removed, was unused.
2824         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
2825         `TypeExpr[]' array for the interfaces.
2826         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
2827         has been defined, returns a list of the resolved interfaces types.
2828         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
2829         (TypeManager.GetExplicitInterfaces): Likewise.  
2830
2831 2004-08-02  Martin Baulig  <martin@ximian.com>
2832
2833         * expression.cs (Invocation.EmitCall): If we're invoking a method
2834         on a type parameter, use the new `Constrained' prefix opcode.
2835
2836 2004-08-02  Martin Baulig  <martin@ximian.com>
2837
2838         * statement.cs (LocalInfo.Flags): Added `IsThis'.
2839         (LocalInfo.IsThis): New public property.
2840         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
2841
2842 2004-08-01  Martin Baulig  <martin@ximian.com>
2843
2844         * class.cs (TypeContainer.GetClassBases): Don't set the default
2845         here since we may get called from GetPartialBases().
2846         (TypeContainer.DefineType): If GetClassBases() didn't return a
2847         parent, use the default one.
2848
2849 2004-07-30  Martin Baulig  <martin@ximian.com>
2850
2851         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
2852
2853         * class.cs (SourceMethod): New public class, derive from the
2854         symbol writer's ISourceMethod.
2855         (Method): Use the new symbol writer API.
2856
2857         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
2858         as argument and use the new symbol writer.
2859
2860         * location.cs
2861         (SourceFile): Implement the symbol writer's ISourceFile.
2862         (Location.SymbolDocument): Removed.
2863         (Location.SourceFile): New public property.
2864
2865         * symbolwriter.cs: Use the new symbol writer API.
2866
2867 2004-07-30  Raja R Harinath  <rharinath@novell.com>
2868
2869         * Makefile (install-local): Remove.  Functionality moved to
2870         executable.make.
2871
2872 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
2873
2874         * Makefile: Install mcs.exe.config file together with mcs.exe.
2875         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
2876         correct runtime version.
2877         
2878 2004-07-25  Martin Baulig  <martin@ximian.com>
2879
2880         * class.cs
2881         (TypeContainer.RegisterOrder): Removed, this was unused.
2882         (TypeContainer, interface_order): Removed.
2883         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
2884         TypeContainer as argument since we can also be called with a
2885         `PartialContainer' for a partial class/struct/interface.
2886         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
2887         of checking whether we're an `Interface' - we could be a
2888         `PartialContainer'.
2889         (PartialContainer.Register): Override; call
2890         AddClass()/AddStruct()/AddInterface() on our parent.
2891
2892         * cs-parser.jay (interface_member_declaration): Add things to the
2893         `current_container', not the `current_class'.
2894
2895         * rootcontext.cs (RegisterOrder): The overloaded version which
2896         takes an `Interface' was unused, removed.
2897
2898         * typemanager.cs (TypeManager.LookupInterface): Return a
2899         `TypeContainer', not an `Interface'.
2900         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
2901         contain a `PartialContainer' for an interface, so check it's
2902         `Kind' to figure out what it is.
2903
2904 2004-07-25  Martin Baulig  <martin@ximian.com>
2905
2906         * class.cs (Class.DefaultTypeAttributes): New public constant.
2907         (Struct.DefaultTypeAttributes): Likewise.
2908         (Interface.DefaultTypeAttributes): Likewise.
2909         (PartialContainer.TypeAttr): Override this and add the
2910         DefaultTypeAttributes.
2911
2912 2004-07-25  Martin Baulig  <martin@ximian.com>
2913
2914         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
2915         we can just use the `Parent' field instead.
2916
2917 2004-07-25  Martin Baulig  <martin@ximian.com>
2918
2919         * class.cs (TypeContainer.Emit): Renamed to EmitType().
2920
2921 2004-07-25  Martin Baulig  <martin@ximian.com>
2922
2923         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
2924         our parts before defining any methods.
2925         (TypeContainer.VerifyImplements): Make this virtual.
2926         (ClassPart.VerifyImplements): Override and call VerifyImplements()
2927         on our PartialContainer.
2928
2929 2004-07-25  Martin Baulig  <martin@ximian.com>
2930
2931         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
2932
2933         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
2934         argument, we can just use the `Parent' field instead.
2935
2936         * class.cs
2937         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
2938         (MemberBase.DoDefine): Likewise.
2939
2940 2004-07-24  Martin Baulig  <martin@ximian.com>
2941
2942         * decl.cs (MemberCore.Parent): New public field.
2943         (DeclSpace.Parent): Moved to MemberCore.
2944
2945         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
2946         (MemberBase.ctor): Added TypeContainer argument, pass it to our
2947         parent's .ctor.
2948         (FieldBase, Field, Operator): Likewise.
2949         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
2950         (EventField, Event): Likewise.
2951
2952 2004-07-23  Martin Baulig  <martin@ximian.com>
2953
2954         * class.cs (PartialContainer): New public class.
2955         (ClassPart): New public class.
2956         (TypeContainer): Added support for partial classes.
2957         (TypeContainer.GetClassBases): Splitted some of the functionality
2958         out into GetNormalBases() and GetPartialBases().
2959
2960         * cs-tokenizer.cs (Token.PARTIAL): New token.
2961         (Tokenizer.consume_identifier): Added some hacks to recognize
2962         `partial', but only if it's immediately followed by `class',
2963         `struct' or `interface'.
2964
2965         * cs-parser.jay: Added support for partial clases.
2966
2967 2004-07-23  Martin Baulig  <martin@ximian.com>
2968
2969         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
2970         a `DeclSpace' and also made it readonly.
2971         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
2972         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
2973         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
2974
2975         * cs-parser.jay: Pass the `current_class', not the
2976         `current_container' (at the moment, this is still the same thing)
2977         to a new Method, Property, Event, Indexer or Constructor.
2978
2979 2004-07-23  Martin Baulig  <martin@ximian.com>
2980
2981         * cs-parser.jay (CSharpParser): Added a new `current_class' field
2982         and removed the `current_interface' one.
2983         (struct_declaration, class_declaration, interface_declaration):
2984         Set `current_class' to the newly created class/struct/interface;
2985         set their `Bases' and call Register() before parsing their body.
2986
2987 2004-07-23  Martin Baulig  <martin@ximian.com>
2988
2989         * class.cs (Kind): New public enum.
2990         (TypeContainer): Made this class abstract.
2991         (TypeContainer.Kind): New public readonly field.
2992         (TypeContainer.CheckDef): New public method; moved here from
2993         cs-parser.jay.
2994         (TypeContainer.Register): New public abstract method.
2995         (TypeContainer.GetPendingImplementations): New public abstract
2996         method.
2997         (TypeContainer.GetClassBases): Removed the `is_class' and
2998         `is_iface' parameters.
2999         (TypeContainer.DefineNestedTypes): Formerly known as
3000         DoDefineType().
3001         (ClassOrStruct): Made this class abstract.
3002
3003         * tree.cs (RootTypes): New public type. 
3004
3005 2004-07-20  Martin Baulig  <martin@ximian.com>
3006
3007         * tree.cs (Tree.RecordNamespace): Removed.
3008         (Tree.Namespaces): Removed.
3009
3010         * rootcontext.cs (RootContext.IsNamespace): Removed.
3011
3012         * cs-parser.jay (namespace_declaration): Just create a new
3013         NamespaceEntry here.
3014
3015 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3016
3017         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3018         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3019         entry to make sure it runs in the correct runtime version.
3020         
3021 2004-07-18  Martin Baulig  <martin@ximian.com>
3022
3023         * generic.cs (ConstructedType.CheckConstraints): Improved
3024         constraints checking.
3025
3026 2004-07-18  Martin Baulig  <martin@ximian.com>
3027
3028         * expression.cs (Invocation.BetterMethod): Call
3029         TypeManager.TypeToCoreType() on all types and removed my previous
3030         hack; we're already doig the right thing here.
3031
3032 2004-07-17  Martin Baulig  <martin@ximian.com>
3033
3034         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3035
3036 2004-07-16  Martin Baulig  <martin@ximian.com>
3037
3038         * iterators.cs: Added generics support.
3039
3040 2004-07-16  Martin Baulig  <martin@ximian.com>
3041
3042         * iterators.cs: Rewrote this.  We're now using one single Proxy
3043         class for both the IEnumerable and the IEnumerator interface and
3044         `Iterator' derives from Class so we can use the high-level API.
3045
3046         * class.cs (TypeContainer.AddIterator): New method.
3047         (TypeContainer.DoDefineType): New protected virtual method, which
3048         is called from DefineType().
3049         (TypeContainer.DoDefineMembers): Call DefineType() and
3050         DefineMembers() on all our iterators.
3051         (TypeContainer.Emit): Call Emit() on all our iterators.
3052         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3053
3054         * codegen.cs (EmitContext.CurrentIterator): New public field.
3055
3056 2004-07-15  Martin Baulig  <martin@ximian.com>
3057
3058         * typemanager.cs
3059         (TypeManager.not_supported_exception_type): New type.   
3060
3061 2004-07-14  Martin Baulig  <martin@ximian.com>
3062
3063         * typemanager.cs
3064         (TypeManager.generic_ienumerable_type): New type.
3065         (TypeManager.generic_ienumerator_type): New type.
3066
3067         * rootcontext.cs
3068         (RootContext.interfaces_first_stage): Added
3069         "System.Collections.Generic.IEnumerator`1" and
3070         "System.Collections.Generic.IEnumerable`1".     
3071
3072 2004-07-14  Martin Baulig  <martin@ximian.com>
3073
3074         * iterators.cs: Use real error numbers.
3075
3076 2004-07-14  Martin Baulig  <martin@ximian.com>
3077
3078         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3079         requires this to be a System.Collection.IEnumerable and not a
3080         class implementing that interface.
3081         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3082
3083 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3084
3085         * class.cs: Fixed previous fix, it broke some error tests.
3086
3087 2004-07-12  Martin Baulig  <martin@ximian.com>
3088
3089         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3090         Fixes #61293.
3091
3092 2004-07-14  Martin Baulig  <martin@ximian.com>
3093
3094         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3095         an exclamation mark (!) for the generic arity to reflect the
3096         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3097
3098 2004-07-13  Martin Baulig  <martin@ximian.com>
3099
3100         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3101         specifiers being part of a type argument.
3102
3103 2004-07-13  Martin Baulig  <martin@ximian.com>
3104
3105         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3106         name for generic types.
3107
3108 2004-07-13  Martin Baulig  <martin@ximian.com>
3109
3110         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3111         bit to fix #60119.
3112
3113 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3114
3115         * assign.cs (LocalTemporary): Add new argument: is_address,If
3116         `is_address' is true, then the value that we store is the address
3117         to the real value, and not the value itself.
3118         
3119         * ecore.cs (PropertyExpr): use the new local temporary
3120         stuff to allow us to handle X.Y += z (where X is a struct)
3121
3122 2004-07-08  Martin Baulig  <martin@ximian.com>
3123
3124         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3125         not always return, just like we're doing in Using.Resolve().
3126
3127 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3128
3129         * cs-parser.jay (fixed_statement): flag this as Pinned.
3130
3131 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3132
3133         * typemanager.cs (TypeManager): Removed MakePinned method, this
3134         mechanism is replaced with the .NET 2.x compatible mechanism of
3135         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3136
3137         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3138         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3139         `IsFixed' property which has a different meaning.
3140
3141 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3142
3143         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3144         visible from inside a nested class, not just the names of the
3145         immediately enclosing class.
3146         Fix for bug #60730.
3147
3148 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3149
3150         * expression.cs (BetterConversion): Remove buggy special-case
3151         handling of "implicit constant expression conversions".  At this
3152         point, we already know that the conversion is possible -- we're
3153         only checking to see which is better.
3154
3155 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3156
3157         * cs-parser.jay: Added error CS0210 test.
3158
3159 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3160
3161         * cs-parser.jay: Added error CS0134 test.
3162
3163 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3164
3165         Fix bug #52507
3166         * cs-parser.jay: Added error CS0145 test.
3167
3168 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3169
3170         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3171
3172 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3173         
3174         * expression.cs (StackAlloc.Resolve): The argument may not
3175         be a constant; deal with this case.
3176         
3177 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3178
3179         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3180         GetIndexerAttributeValue.
3181         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3182
3183         * class.cs (Indexer.Define): Added error tests for CS0415,
3184         CS0609.
3185
3186 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3187
3188         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3189         property code.
3190
3191 2004-06-23  Martin Baulig  <martin@ximian.com>
3192
3193         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3194         neither return nor throw, reset the barrier as well.  Fixes #60457.
3195
3196 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3197
3198         * class.cs : EventAttributes is now set to None by default.
3199           This fixes bug #60459.
3200
3201 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3202
3203         Fix bug #60219
3204         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3205         Don't throw exception but return null (it's sufficient now).
3206
3207 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3208
3209         * typemanager.cs (GetArgumentTypes): Faster implementation.
3210
3211 2004-06-18  Martin Baulig  <martin@ximian.com>
3212
3213         * attribute.cs (Attribute.Resolve): Check whether we're an
3214         EmptyCast which a Constant child.  Fixes #60333.
3215
3216 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3217
3218         * statement.cs (EmitCollectionForeach): Account for the fact that
3219         not all valuetypes are in areas which we can take the address of.
3220         For these variables, we store to a temporary variable. Also, make
3221         sure that we dont emit a `callvirt' on a valuetype method.
3222
3223 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3224
3225         * expression.cs (StackAlloc.DoReSolve): Added test for
3226         negative parameter (CS0247).
3227
3228 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3229
3230         Fix bug #59792
3231         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3232
3233 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3234
3235         Fix bug #59781
3236         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3237         ulong.
3238
3239 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3240
3241         Fix bug #58254 & cs1555.cs, cs1556.cs
3242         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3243
3244 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3245
3246         * cs-parser.jay: Added error CS1669 test for indexers.
3247
3248 2004-06-18  Martin Baulig  <martin@ximian.com>
3249
3250         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3251         argument.  Fixes #60441.
3252
3253 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3254         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3255         The name needs to have the actual name of the method in order
3256         for other tests (such as the one in OverloadResolve for Invoke
3257         on a delegate) to work. As well, it does not really help
3258         error reporting because the method group had multiple methods.
3259         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3260         Make profiling work.
3261         
3262 2004-06-13  Martin Baulig  <martin@ximian.com>
3263
3264         * cs-parser.jay: Don't allow generic attributes.
3265
3266 2004-06-13  Martin Baulig  <martin@ximian.com>
3267
3268         * class.cs (MemberBase.DoDefineBase): New protected method.
3269         (MemberBase.DoDefine): Compute the `flags' in the new
3270         DoDefineBase() which must be called first.
3271         (Method.Define): Call DoDefineBase() first so we have the flags
3272         when defining the generic method.
3273
3274         * cs-parser.jay (interface_method_declaration): Support generic methods.
3275
3276 2004-06-13  Martin Baulig  <martin@ximian.com>
3277
3278         * decl.cs (TypeName): Removed.
3279         (MemberName): Removed TypeName and MemberNow; now we just have
3280         MemberName.
3281
3282         * cs-parser.jay: Don't distinguish between type arguments and type
3283         parameters in the grammar and simplified the rules a bit.  The
3284         reduce/reduce conflicts are now gone (except the one we inherited
3285         from mcs).
3286
3287 2004-06-11  Martin Baulig  <martin@ximian.com>
3288
3289         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3290         call this twice: for params and varargs methods.
3291
3292 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3293
3294         * class.cs:
3295         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3296
3297 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3298
3299         * attribute.cs (Attribute.GetValidTargets): Made public.
3300
3301         * class.cs: 
3302         (AbstractPropertyEventMethod): New class for better code sharing.
3303         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3304         CS1667 report.
3305         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3306
3307 2004-06-09  Martin Baulig  <martin@ximian.com>
3308
3309         * cs-parser.jay: Removed a reduce/reduce conflict.
3310
3311 2004-06-03  Martin Baulig  <martin@ximian.com>
3312
3313         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3314         GetSimpleName() and return a SimpleName.
3315
3316         * ecore.cs (SimpleName.Arguments): New public field.
3317         (SimpleName): Added overloaded ctor which takes an additional
3318         TypeArguments argument.
3319         (SimpleName.SimpleNameResolve): Added support for generic methods.
3320         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3321         formerly in MemberAccess.DoResolve(), but we also need it in
3322         SimpleNameResolve().
3323
3324         * expression.cs (MemberAccess.DoResolve): Use the new
3325         MethodGroupExpr.ResolveGeneric().       
3326
3327 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3328
3329         * decl.cs: If possible, use lookuptypedirect here. We can only do
3330         this if there is no `.' after the namespace. Avoids using
3331         LookupType, which does lots of slow processing.
3332         (FindNestedType) New method, does what it says :-).
3333         * namespace.cs: use LookupTypeDirect.
3334         * rootcontext.cs: use membercache, if possible.
3335         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3336
3337 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3338
3339         * expression.cs:
3340         According to the spec, 
3341
3342         In a member access of the form E.I, if E is a single identifier,
3343         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3344         field, property, localvariable, or parameter with the same type as
3345         the meaning of E as a type-name (§3.8), then both possible
3346         meanings of E are permitted.
3347
3348         We did not check that E as a simple-name had the same type as E as
3349         a type name.
3350
3351         This trivial check gives us 5-7% on bootstrap time.
3352
3353 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3354
3355         * expression.cs (Invocation.OverloadResolve): Avoid the
3356         use of hashtables and boxing here by allocating on demand.
3357
3358 2004-05-30  Martin Baulig  <martin@ximian.com>
3359
3360         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3361         we're doing a silent lookup.  Don't try to lookup nested types in
3362         TypeManager.object_type (thanks to Ben Maurer).
3363
3364 2004-05-30  Martin Baulig  <martin@ximian.com>
3365
3366         Committing a patch from Ben Maurer.
3367
3368         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3369
3370 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3371
3372         * convert.cs: add a trivial cache for overload operator resolution.
3373
3374 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3375
3376         * attribute.cs
3377         (AttributeTester.GetObsoleteAttribute): Returns instance of
3378         ObsoleteAttribute when type is obsolete.
3379
3380         * class.cs
3381         (TypeContainer.VerifyObsoleteAttribute): Override.
3382         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3383         (MethodCode.VerifyObsoleteAttribute): Override.
3384         (MemberBase.VerifyObsoleteAttribute): Override.
3385
3386         * decl.cs
3387         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3388         and report proper error.
3389
3390         *delegate.cs
3391         (Delegate.VerifyObsoleteAttribute): Override.
3392
3393         * ecore.cs
3394         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3395         and report proper error.
3396         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3397
3398         * enum.cs
3399         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3400         and enum member.
3401
3402         * expression.cs
3403         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3404         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3405         Added test for ObsoleteAttribute.
3406
3407         * statement.cs
3408         (Catch): Derived from Statement.
3409
3410 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3411
3412         * decl.cs: If possible, use lookuptypedirect here. We can only do
3413         this if there is no `.' after the namespace. Avoids using
3414         LookupType, which does lots of slow processing.
3415         (FindNestedType) New method, does what it says :-).
3416         * namespace.cs: use LookupTypeDirect.
3417         * rootcontext.cs: use membercache, if possible.
3418         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3419
3420 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3421
3422         * expression.cs:
3423         According to the spec, 
3424
3425         In a member access of the form E.I, if E is a single identifier,
3426         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3427         field, property, localvariable, or parameter with the same type as
3428         the meaning of E as a type-name (§3.8), then both possible
3429         meanings of E are permitted.
3430
3431         We did not check that E as a simple-name had the same type as E as
3432         a type name.
3433
3434         This trivial check gives us 5-7% on bootstrap time.
3435
3436 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3437
3438         Fixed bug #59071 & cs0160.cs
3439         * statement.cs (Try.Resolve): Check here whether order of catch
3440         clauses matches their dependencies.
3441
3442 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3443
3444         Fixed bug #58624
3445         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
3446         unsafe type.
3447
3448 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3449
3450         * expression.cs (Invocation.OverloadResolve): Avoid the
3451         use of hashtables and boxing here by allocating on demand.
3452
3453 2004-05-30  Martin Baulig  <martin@ximian.com>
3454
3455         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3456         we're doing a silent lookup.  Don't try to lookup nested types in
3457         TypeManager.object_type (thanks to Ben Maurer).
3458
3459 2004-05-30  Martin Baulig  <martin@ximian.com>
3460
3461         Committing a patch from Ben Maurer.
3462
3463         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
3464
3465 2004-05-29  Martin Baulig  <martin@ximian.com>
3466
3467         * class.cs (IMethodData.ShouldIgnore): New method.
3468
3469         * typemanager.cs (TypeManager.MethodFlags): Don't take a
3470         `Location' argument, we don't need it anywhere.  Use
3471         `IMethodData.ShouldIgnore ()' instead of
3472         `MethodData.GetMethodFlags ()'.
3473         (TypeManager.AddMethod): Removed.
3474         (TypeManager.AddMethod2): Renamed to AddMethod.
3475
3476 2004-05-29  Martin Baulig  <martin@ximian.com>
3477
3478         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
3479
3480         * convert.cs (Convert.ImplicitReferenceConversion): If we're
3481         converting from a class type S to an interface type and we already
3482         have an object on the stack, don't box it again.  Fixes #52578.
3483
3484 2004-05-29  Martin Baulig  <martin@ximian.com>
3485
3486         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3487         Added support for `params' parameters.  Fixes #59267.
3488
3489 2004-05-29  Martin Baulig  <martin@ximian.com>
3490
3491         * literal.cs (NullPointer): Provide a private .ctor which sets
3492         `type' to TypeManager.object_type.  Fixes #59048.
3493
3494 2004-05-29  Martin Baulig  <martin@ximian.com>
3495
3496         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
3497         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
3498
3499         * ecore.cs (EventExpr.instance_expr): Make the field private.
3500
3501 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
3502
3503         Fixed bug #50080 & cs0214-2.cs
3504         * expression.cs (Cast.DoResolve): Check unsafe context here.
3505         
3506         * statement.cs (Resolve.DoResolve): Likewise.
3507
3508 2004-05-26  Martin Baulig  <martin@ximian.com>
3509
3510         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
3511
3512         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
3513         (RootContext.LookupType): Pass down the `silent' flag.
3514
3515 2004-05-25  Martin Baulig  <martin@ximian.com>
3516
3517         * expression.cs
3518         (MethodGroupExpr.IdenticalTypeName): New public property.
3519         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
3520         expression actually refers to a type.
3521
3522 2004-05-25  Martin Baulig  <martin@ximian.com>
3523
3524         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
3525         for #56176 and made it actually work.
3526
3527 2004-05-25  Martin Baulig  <martin@ximian.com>
3528
3529         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
3530         (FieldExpr, PropertyExpr): Override and implement
3531         CacheTemporaries.  Fixes #52279.
3532
3533 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
3534
3535         * location.cs: In the new compiler listing a file twice is a
3536         warning, not an error.
3537
3538 2004-05-24  Martin Baulig  <martin@ximian.com>
3539
3540         * enum.cs (Enum.DefineType): For the `BaseType' to be a
3541         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
3542
3543 2004-05-24  Martin Baulig  <martin@ximian.com>
3544
3545         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
3546         walking the `using' list.  Fixes #53921.
3547
3548 2004-05-24  Martin Baulig  <martin@ximian.com>
3549
3550         * const.cs (Const.LookupConstantValue): Added support for
3551         EmptyCast's; fixes #55251.
3552
3553 2004-05-24  Martin Baulig  <martin@ximian.com>
3554
3555         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
3556         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
3557         which does the CS0135 check.  The reason is that we first need to
3558         check whether the variable actually exists.
3559
3560 2004-05-24  Martin Baulig  <martin@ximian.com>
3561
3562         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
3563         than RootContext.LookupType() to find the explicit interface
3564         type.  Fixes #58584.
3565
3566 2004-05-24  Raja R Harinath  <rharinath@novell.com>
3567
3568         * Makefile: Simplify.  Use executable.make.
3569         * mcs.exe.sources: New file.  List of sources of mcs.exe.
3570
3571 2004-05-24  Anders Carlsson  <andersca@gnome.org>
3572
3573         * decl.cs:
3574         * enum.cs:
3575         Use the invariant culture when doing String.Compare for CLS case
3576         sensitivity.
3577         
3578 2004-05-23  Martin Baulig  <martin@ximian.com>
3579
3580         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
3581         don't have any dots.  Fixes #52622, added cs0246-8.cs.
3582
3583         * namespace.cs (NamespaceEntry.Lookup): Likewise.
3584
3585 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3586
3587         * class.cs (MemberBase.Define): Reuse MemberType member for 
3588         resolved type. Other methods can use it too.
3589
3590 2004-05-23  Martin Baulig  <martin@ximian.com>
3591
3592         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
3593         the variable also exists in the current block (otherwise, we need
3594         to report a CS0103).  Fixes #58670.
3595
3596 2004-05-23  Martin Baulig  <martin@ximian.com>
3597
3598         * flowanalysis.cs (Reachability.Reachable): Compute this
3599         on-the-fly rather than storing it as a field.
3600
3601 2004-05-23  Martin Baulig  <martin@ximian.com>
3602
3603         * flowanalysis.cs (Reachability.And): Manually compute the
3604         resulting `barrier' from the reachability.      
3605        
3606 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3607
3608         Fix bug #57835
3609         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
3610         instance of ObsoleteAttribute when symbol is obsolete.
3611
3612         * class.cs
3613         (IMethodData): Extended interface for ObsoleteAttribute support.
3614
3615 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3616
3617         * attribute.cs: Fix bug #55970
3618
3619 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3620
3621         Fix bug #52705
3622         * attribute.cs
3623         (GetObsoleteAttribute): New method. Creates the instance of
3624         ObsoleteAttribute.
3625         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
3626         ObsoleteAttribute when member is obsolete.
3627         (AttributeTester.Report_ObsoleteMessage): Common method for
3628         Obsolete error/warning reporting.
3629
3630         * class.cs
3631         (TypeContainer.base_classs_type): New member for storing parent type.
3632
3633         * decl.cs
3634         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
3635         for this MemberCore.
3636
3637 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3638
3639         * attribute.cs, const.cs: Fix bug #58590
3640
3641 2004-05-21  Martin Baulig  <martin@ximian.com>
3642
3643         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
3644         out parameters if the end of the method is unreachable.  Fixes
3645         #58098. 
3646
3647 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3648
3649         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
3650         Hari was right, why extra method.
3651
3652 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3653
3654         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
3655
3656 2004-05-20  Martin Baulig  <martin@ximian.com>
3657
3658         * delegate.cs: Convert this file to Unix mode - like the original
3659         version in mcs is.
3660
3661 2004-05-20  Martin Baulig  <martin@ximian.com>
3662
3663         * attribute.cs: Convert this file to Unix mode - like the original
3664         version in mcs is.
3665
3666 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
3667
3668        Fix bug #58688 (MCS does not report error when the same attribute
3669        is assigned twice)
3670
3671        * attribute.cs (Attribute.Emit): Distinction between null and default.
3672
3673 2004-05-19  Raja R Harinath  <rharinath@novell.com>
3674
3675        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
3676        of a top-level attribute without an attribute target.
3677        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
3678        Make non-static.
3679        (Attribute.Conditional_GetConditionName), 
3680        (Attribute.Obsolete_GetObsoleteMessage): Update.
3681        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
3682        part of ScanForIndexerName.
3683        (Attribute.CanIgnoreInvalidAttribute): New function.
3684        (Attribute.ScanForIndexerName): Move to ...
3685        (Attributes.ScanForIndexerName): ... here.
3686        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
3687        (Attributes.Search): New internal variant that can choose not to
3688        complain if types aren't resolved.  The original signature now
3689        complains.
3690        (Attributes.GetClsCompliantAttribute): Use internal variant, with
3691        complaints suppressed.
3692        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
3693        only if it not useful.
3694        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
3695        top-level for attributes that are shared between the assembly
3696        and a top-level class.
3697        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
3698        * class.cs: Update to reflect changes.
3699        (DefineIndexers): Fuse loops.
3700        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
3701        a couple more variants of attribute names.
3702
3703 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
3704
3705         Fix bug #52585 (Implemented explicit attribute declaration)
3706
3707         * attribute.cs:
3708         (Attributable.ValidAttributeTargets): New abstract method. It gets
3709         list of valid attribute targets for explicit target declaration.
3710         (Attribute.Target): It holds target itself.
3711         (AttributeSection): Removed.
3712         (Attribute.CheckTargets): New method. It checks whether attribute
3713         target is valid for the current element.
3714
3715         * class.cs:
3716         (EventProperty): New class. For events that are declared like
3717         property (with add and remove accessors).
3718         (EventField): New class. For events that are declared like field.
3719         class.cs
3720
3721         * cs-parser.jay: Implemented explicit attribute target declaration.
3722
3723         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
3724         Override ValidAttributeTargets.
3725
3726         * parameter.cs:
3727         (ReturnParameter): Class for applying custom attributes on 
3728         the return type.
3729         (ParameterAtribute): New class. Class for applying custom
3730         attributes on the parameter type.
3731
3732 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
3733
3734         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
3735         definitions. 
3736
3737         (Method): Allow UNSAFE here.
3738
3739         * modifiers.cs: Support unsafe reporting.
3740
3741 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
3742
3743         * decl.cs: Fix bug #58478.
3744
3745 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3746
3747         * statement.cs: When checking for unreachable code on an EmptyStatement,
3748         set the location. Fixes bug #58488.
3749
3750 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
3751
3752         * driver.cs: Add -pkg handling.
3753
3754         From Gonzalo: UseShelLExecute=false
3755
3756 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
3757
3758         * attribute.cs:
3759         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
3760         for attribute.
3761         (Attribute.IsClsCompliaceRequired): Moved to base for better
3762         accesibility.
3763         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
3764         when attribute is AttributeUsageAttribute.
3765         (Attribute.GetValidTargets): Simplified.
3766         (Attribute.GetAttributeUsage): New method returns AttributeUsage
3767         attribute for this type.
3768         (Attribute.ApplyAttributes): Method renamed to Emit and make
3769         non-static.
3770         (GlobalAttributeSection): New class for special handling of global
3771         attributes (assembly, module).
3772         (AttributeSection.Emit): New method.
3773
3774         * class.cs: Implemented Attributable abstract methods.
3775         (MethodCore.LabelParameters): Moved to Parameter class.
3776         (Accessor): Is back simple class.
3777         (PropertyMethod): Implemented Attributable abstract class.
3778         (DelegateMethod): Implemented Attributable abstract class.
3779         (Event): New constructor for disctintion between normal Event
3780         and Event with accessors.
3781
3782         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
3783
3784         * codegen.cs, const.cs, decl.cs, delegate.cs:
3785         (CommonAssemblyModulClass): Implemented Attributable abstract class
3786         and simplified.
3787
3788         * enum.cs: Implement IAttributeSupport interface.
3789         (EnumMember): New class for emum members. Implemented Attributable
3790         abstract class
3791
3792         * parameter.cs:
3793         (ParameterBase): Is abstract.
3794         (ReturnParameter): New class for easier [return:] attribute handling.
3795
3796         * typemanager.cs: Removed builder_to_attr.
3797
3798 2004-05-11  Raja R Harinath  <rharinath@novell.com>
3799
3800         Fix bug #57151.
3801         * attribute.cs (Attribute.GetPositionalValue): New function.
3802         * class.cs (TypeContainer.VerifyMembers): New function.
3803         (TypeContainer.Emit): Use it.
3804         (ClassOrStruct): New base class for Class and Struct.
3805         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
3806         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
3807         class.
3808         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
3809         then each non-static field should have a FieldOffset attribute.
3810         Otherwise, none of the fields should have a FieldOffset attribute.
3811         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
3812         and FieldOffset attributes.
3813         * typemanager.cs (TypeManager.struct_layout_attribute_type)
3814         (TypeManager.field_offset_attribute_type): New core types.
3815         (TypeManager.InitCoreTypes): Initialize them.
3816
3817 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
3818
3819         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
3820         Return correct type.
3821         From bug #58270.
3822
3823 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
3824
3825         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
3826         be implicitly converted to ulong.
3827         
3828         * expression.cs: The logic for allowing operator &, | and ^ worked
3829         was wrong, it worked before because we did not report an error in
3830         an else branch.  Fixes 57895.
3831
3832         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
3833         allow volatile fields to be reference types.
3834
3835 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
3836
3837         * driver.cs: Add support for /debug-
3838
3839 2004-05-07  Raja R Harinath  <rharinath@novell.com>
3840
3841         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
3842         Add a 'complain' parameter to silence errors.
3843         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
3844         silently overlooked type-resolutions.
3845         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
3846         to reflect changes.
3847         (Attributes.Search): New function.
3848         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
3849         (Attributes.GetAttributeFullName): Remove hack.
3850         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
3851         Update to reflect changes.
3852         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3853         Use Attributes.Search instead of nested loops.
3854
3855 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
3856
3857         * decl.cs:
3858         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
3859         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
3860         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
3861
3862         * report.cs: (Report.Warning): Renamed to Warning_T because of
3863         parameter collision.
3864
3865 2004-05-05  Raja R Harinath  <rharinath@novell.com>
3866
3867         * expression.cs (MemberAccess.ResolveMemberAccess):
3868         Exit with non-zero status after Report.Error.
3869         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
3870         Likewise.
3871         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
3872
3873 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
3874
3875         * support.cs: Don't hang when the file is empty.
3876
3877 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
3878
3879         * support.cs: In SeekableStreamReader, compute the preamble size of the
3880           underlying stream. Position changes should take into account that initial
3881           count of bytes.
3882
3883 2004-05-03  Todd Berman  <tberman@sevenl.net>
3884
3885         * driver.cs: remove unused GetSysVersion function.
3886
3887 2004-05-03  Todd Berman  <tberman@sevenl.net>
3888
3889         * driver.cs: Remove the hack from saturday, as well as the hack
3890         from jackson (LoadAssemblyFromGac), also adds the CWD to the
3891         link_paths to get that bit proper.
3892
3893 2004-05-01  Todd Berman  <tberman@sevenl.net>
3894
3895         * driver.cs: Try a LoadFrom before a Load, this checks the current
3896         path. This is currently a bug in mono that is be fixed, however, this
3897         provides a workaround for now. This will be removed when the bug
3898         is fixed.
3899
3900 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
3901
3902         * CryptoConvert.cs: Updated to latest version. Fix issue with 
3903         incomplete key pairs (#57941).
3904
3905 2004-05-01  Todd Berman  <tberman@sevenl.net>
3906
3907         * driver.cs: Remove '.' from path_chars, now System.* loads properly
3908         from the GAC
3909
3910 2004-04-30  Jackson Harper  <jackson@ximian.com>
3911
3912         * codegen.cs: Open keys readonly.
3913         
3914 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3915
3916         * typemanager.cs: don't report cyclic struct layout when a struct
3917         contains 2 or more fields of the same type. Failed for Pango.AttrShape
3918         which has 2 Pango.Rectangle fields.
3919
3920 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3921
3922         * expression.cs: Handle IntPtr comparisons with IL code
3923         rather than a method call.
3924
3925 2004-04-29  Martin Baulig  <martin@ximian.com>
3926
3927         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
3928         the list of PropertyInfo's in class hierarchy and find the
3929         accessor.  Fixes #56013.
3930
3931 2004-04-29  Martin Baulig  <martin@ximian.com>
3932
3933         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
3934
3935 2004-04-29  Martin Baulig  <martin@ximian.com>
3936
3937         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
3938
3939         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
3940
3941 2004-04-29  Martin Baulig  <martin@ximian.com>
3942
3943         * class.cs (ConstructorInitializer.Resolve): Check whether the
3944         parent .ctor is accessible.  Fixes #52146.
3945
3946 2004-04-29  Martin Baulig  <martin@ximian.com>
3947
3948         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
3949
3950         * statement.cs (Using.EmitLocalVariableDecls): Use
3951         TypeManager.idisposable_type, not typeof (IDisposable).
3952         (Foreach.EmitCollectionForeach): Added support for valuetypes.
3953
3954 2004-04-29  Martin Baulig  <martin@ximian.com>
3955
3956         * class.cs (Event.Define): Don't emit the field and don't set
3957         RTSpecialName and SpecialName for events on interfaces.  Fixes
3958         #57703. 
3959
3960 2004-04-29  Raja R Harinath  <rharinath@novell.com>
3961
3962         Refactor Attribute.ApplyAttributes.
3963         * attribute.cs (Attributable): New base class for objects that can
3964         have Attributes applied on them.
3965         (Attribute): Make AttributeUsage fields public.
3966         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
3967         (Attribute.IsInternalCall): New property.
3968         (Attribute.UsageAttr): Convert to a public read-only property.
3969         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
3970         (Attribute.ResolveType, Attribute.Resolve)
3971         (Attribute.ScanForIndexerName): Update to reflect changes.
3972         (Attribute.CheckAttributeTarget): Re-format.
3973         (Attribute.ApplyAttributes): Refactor, to various
3974         Attributable.ApplyAttributeBuilder methods.
3975         * decl.cs (MemberCore): Make Attributable.
3976         * class.cs (Accessor): Make Attributable.
3977         (MethodData.ApplyAttributes): Use proper attribute types, not
3978         attribute names.
3979         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
3980         (TypeContainer.ApplyAttributeBuilder)
3981         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
3982         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
3983         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
3984         (Operator.ApplyAttributeBuilder): New factored-out methods.
3985         * const.cs (Const.ApplyAttributeBuilder): Likewise.
3986         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
3987         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
3988         * parameter.cs (ParameterBase): New Attributable base class
3989         that can also represent Return types.
3990         (Parameter): Update to the changes.
3991
3992 2004-04-29  Jackson Harper  <jackson@ximian.com>
3993
3994         * driver.cs: Prefer the corlib system version when looking for
3995         assemblies in the GAC. This is still a hack, but its a better hack
3996         now.
3997         
3998 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
3999
4000         * decl.cs, enum.cs: Improved error 3005 reporting.
4001   
4002         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4003         (related_symbols): New private member for list of symbols
4004         related to reported error/warning.
4005         
4006         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4007
4008 2004-04-29  Martin Baulig  <martin@ximian.com>
4009
4010         * ecore.cs (Expression.Constantify): If we're an enum and
4011         TypeManager.TypeToCoreType() doesn't give us another type, use
4012         t.UnderlyingSystemType.  Fixes #56178.  
4013
4014 2004-04-29  Martin Baulig  <martin@ximian.com>
4015
4016         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4017         interfaces and for each interface, only add members directly
4018         declared in that interface.  Fixes #53255.
4019
4020 2004-04-28  Martin Baulig  <martin@ximian.com>
4021
4022         * expression.cs (ConditionalLogicalOperator): Use a temporary
4023         variable for `left' to avoid that we evaluate it more than once;
4024         bug #52588.
4025
4026 2004-04-28  Martin Baulig  <martin@ximian.com>
4027
4028         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4029         `void[]' (CS1547).
4030
4031 2004-04-28  Martin Baulig  <martin@ximian.com>
4032
4033         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4034         void (CS1547).
4035
4036         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4037         whether the type is not void (CS1547).
4038
4039 2004-04-28  Martin Baulig  <martin@ximian.com>
4040
4041         * expression.cs (Unary.DoResolveLValue): Override this and report
4042         CS0131 for anything but Operator.Indirection.
4043
4044 2004-04-28  Martin Baulig  <martin@ximian.com>
4045
4046         Committing a patch from Ben Maurer; see bug #50820.
4047
4048         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4049         check for classes.
4050
4051         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4052         classes.        
4053
4054 2004-04-28  Martin Baulig  <martin@ximian.com>
4055
4056         Committing a patch from Ben Maurer; see bug #50820.
4057
4058         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4059         check for classes.
4060
4061         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4062         classes.        
4063
4064 2004-04-28  Martin Baulig  <martin@ximian.com>
4065
4066         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4067         (Block.AddLabel): Call DoLookupLabel() to only search in the
4068         current block.
4069
4070 2004-04-28  Martin Baulig  <martin@ximian.com>
4071
4072         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4073         comparing StringConstants and NullLiterals in Equality and Inequality.
4074
4075 2004-04-28  Jackson Harper  <jackson@ximian.com>
4076
4077         * driver.cs: Attempt to load referenced assemblies from the
4078         GAC. This is the quick and dirty version of this method that
4079         doesnt take into account versions and just takes the first
4080         canidate found. Will be good enough for now as we will not have more
4081         then one version installed into the GAC until I update this method.
4082
4083 2004-04-28  Martin Baulig  <martin@ximian.com>
4084
4085         * typemanager.cs (TypeManager.CheckStructCycles): New public
4086         static method to check for cycles in the struct layout.
4087
4088         * rootcontext.cs (RootContext.PopulateTypes): Call
4089         TypeManager.CheckStructCycles() for each TypeContainer.
4090         [Note: We only need to visit each type once.]
4091
4092 2004-04-28  Martin Baulig  <martin@ximian.com>
4093
4094         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4095
4096         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4097         success and added `out object value'.  Use a `bool resolved' field
4098         to check whether we've already been called rather than
4099         `ConstantValue != null' since this breaks for NullLiterals.
4100
4101 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4102
4103         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4104         setting of this flag, since the 'set' method may be non-public.
4105
4106 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4107
4108         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4109         check on current_vector.Block.
4110
4111 2004-04-27  Martin Baulig  <martin@ximian.com>
4112
4113         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4114         a field initializer.  Fixes #56459.
4115
4116 2004-04-27  Martin Baulig  <martin@ximian.com>
4117
4118         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4119         we're not attempting to use an indexer.  Fixes #52154.
4120
4121 2004-04-27  Martin Baulig  <martin@ximian.com>
4122
4123         * statement.cs (Return): Don't create a return label if we don't
4124         need it; reverts my change from January 20th.  Thanks to Ben
4125         Maurer for this.
4126
4127 2004-04-27  Martin Baulig  <martin@ximian.com>
4128
4129         According to the spec, `goto' can only leave a nested scope, but
4130         never enter it.
4131
4132         * statement.cs (Block.LookupLabel): Only lookup in the current
4133         block, don't recurse into parent or child blocks.
4134         (Block.AddLabel): Check in parent and child blocks, report
4135         CS0140/CS0158 if we find a duplicate.
4136         (Block): Removed this indexer for label lookups.
4137         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4138         this already does the error reporting for us.
4139
4140         * flowanalysis.cs
4141         (FlowBranching.UsageVector.Block): New public variable; may be null.
4142         (FlowBranching.CreateSibling): Added `Block' argument.
4143         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4144         label for the target of a `goto' and check whether we're not
4145         leaving a `finally'.
4146
4147 2004-04-27  Martin Baulig  <martin@ximian.com>
4148
4149         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4150         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4151         just for returns).
4152
4153 2004-04-27  Martin Baulig  <martin@ximian.com>
4154
4155         * statement.cs (Block.AddLabel): Also check for implicit blocks
4156         and added a CS0158 check.
4157
4158 2004-04-27  Martin Baulig  <martin@ximian.com>
4159
4160         * flowanalysis.cs (FlowBranchingLoop): New class.
4161         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4162         UsageVector's instead of an ArrayList.
4163         (FlowBranching.Label): Likewise.
4164         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4165         (FlowBranching.AddBreakVector): New method.
4166
4167 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4168
4169         * attribute.cs: Small regression fix: only convert the type if we
4170         the type is different, fixes System.Drawing build.
4171
4172 2004-04-27  Martin Baulig  <martin@ximian.com>
4173
4174         * attribute.cs (Attribute.Resolve): If we have a constant value
4175         for a named field or property, implicity convert it to the correct
4176         type.
4177
4178 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4179
4180         * statement.cs (Block.Block): Implicit blocks share
4181         'child_variable_names' fields with parent blocks.
4182         (Block.AddChildVariableNames): Remove.
4183         (Block.AddVariable): Mark variable as "used by a child block" in
4184         every surrounding block.
4185         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4186         been used in a child block, complain about violation of "Invariant
4187         meaning in blocks" rule.
4188         * cs-parser.jay (declare_local_variables): Don't use
4189         AddChildVariableNames.
4190         (foreach_statement): Don't create an implicit block: 'foreach'
4191         introduces a scope.
4192
4193 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4194
4195         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4196         converting from 0L to ulong.  Fixes 57522.
4197
4198 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4199
4200         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4201         derived class hides via 'new' keyword field from base class (test-242.cs).
4202         TODO: Handle this in the more general way.
4203         
4204         * class.cs (CheckBase): Ditto.
4205
4206 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4207
4208         * decl.cs (caching_flags): New member for storing cached values
4209         as bit flags.
4210         (MemberCore.Flags): New enum where bit flags for caching_flags
4211         are defined.
4212         (MemberCore.cls_compliance): Moved to caching_flags.
4213         (DeclSpace.Created): Moved to caching_flags.
4214
4215         * class.cs: Use caching_flags instead of DeclSpace.Created
4216         
4217 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4218
4219         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4220         if we are only a derived class, not a nested class.
4221
4222         * typemanager.cs: Same as above, but do this at the MemberLookup
4223         level (used by field and methods, properties are handled in
4224         PropertyExpr).   Allow for the qualified access if we are a nested
4225         method. 
4226
4227 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4228
4229         * class.cs: Refactoring.
4230         (IMethodData): New inteface; Holds links to parent members
4231         to avoid member duplication (reduced memory allocation).
4232         (Method): Implemented IMethodData interface.
4233         (PropertyBase): New inner classes for get/set methods.
4234         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4235         (Event): New inner classes for add/remove methods.
4236         (Event.DelegateMethod): Implemented IMethodData interface.
4237
4238         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4239         EmitContext (related to class.cs refactoring).
4240
4241 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4242
4243         * delegate.cs (Delegate.VerifyApplicability): If the number of
4244         arguments are the same as the number of parameters, first try to
4245         verify applicability ignoring  any 'params' modifier on the last
4246         parameter.
4247         Fixes #56442.
4248
4249 2004-04-08  Martin Baulig  <martin@ximian.com>
4250
4251         Merged latest changes into gmcs.  Please keep this comment in
4252         here, it makes it easier for me to see what changed in MCS since
4253         the last time I merged.
4254
4255 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4256
4257         * class.cs (TypeContainer.AddIndexer): Use
4258         'ExplicitInterfaceName' to determine if interface name was
4259         explicitly specified.  'InterfaceType' is not initialized at this time.
4260         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4261         Indexers array is already in the required order.  Initialize
4262         'IndexerName' only if there are normal indexers.
4263         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4264         (TypeContainer.Emit): Emit DefaultMember attribute only if
4265         IndexerName is initialized.
4266         Fixes #56300.
4267
4268 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4269
4270         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4271         Fixes #57007
4272
4273 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4274
4275         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4276         attributes.
4277         Fix for #56456.
4278
4279         * attribute.cs (Attribute.Resolve): Check for duplicate named
4280         attributes.
4281         Fix for #56463.
4282
4283 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4284
4285         * iterators.cs (MarkYield): track whether we are in an exception,
4286         and generate code accordingly.  Use a temporary value to store the
4287         result for our state.
4288
4289         I had ignored a bit the interaction of try/catch with iterators
4290         since their behavior was not entirely obvious, but now it is
4291         possible to verify that our behavior is the same as MS .NET 2.0
4292
4293         Fixes 54814
4294
4295 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4296
4297         * iterators.cs: Avoid creating temporaries if there is no work to
4298         do. 
4299
4300         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4301         Enumerations, use TypeManager.EnumToUnderlying and call
4302         recursively. 
4303
4304         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4305         bug #57013
4306
4307         (This.Emit): Use EmitContext.EmitThis to emit our
4308         instance variable.
4309
4310         (This.EmitAssign): Ditto.
4311
4312         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4313         codepaths, we will move all the functionality into
4314         Mono.CSharp.This 
4315
4316         (FieldExpr.EmitAssign): Ditto.
4317
4318         This fixes several hidden bugs that I uncovered while doing a code
4319         review of this today.
4320
4321         * codegen.cs (EmitThis): reworked so the semantics are more clear
4322         and also support value types "this" instances.
4323
4324         * iterators.cs: Changed so that for iterators in value types, we
4325         do not pass the value type as a parameter.  
4326
4327         Initialization of the enumerator helpers is now done in the caller
4328         instead of passing the parameters to the constructors and having
4329         the constructor set the fields.
4330
4331         The fields have now `assembly' visibility instead of private.
4332
4333 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4334
4335         * expression.cs (Argument.Resolve): Check if fields passed as ref
4336         or out are contained in a MarshalByRefObject.
4337
4338         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4339         another compiler type.
4340
4341 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4342
4343         * class.cs (Indexer.Define): use the new name checking method.
4344         Also, return false on an error.
4345         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4346         (is_identifier_[start/part]_character): make static.
4347
4348 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4349
4350         * expression.cs (Binary.ResolveOperator): Do no append strings
4351         twice: since we can be invoked more than once (array evaluation)
4352         on the same concatenation, take care of this here.  Based on a fix
4353         from Ben (bug #56454)
4354
4355 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4356
4357         * codegen.cs: Fix another case where CS1548 must be reported (when 
4358         delay-sign isn't specified and no private is available #56564). Fix
4359         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4360         error when MCS is used on the MS runtime and we need to delay-sign 
4361         (which seems unsupported by AssemblyBuilder - see #56621).
4362
4363 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4364
4365         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4366         (TypeManager.ComputeNamespaces): Faster implementation for
4367         Microsoft runtime.
4368
4369         * compiler.csproj: Updated AssemblyName to mcs.
4370
4371 2004-05-11  Jackson Harper  <jackson@ximian.com>
4372
4373         * Makefile: Preserve MONO_PATH
4374         
4375 2004-05-11  Jackson Harper  <jackson@ximian.com>
4376
4377         * Makefile: Use mono and mcs to build gmcs
4378         
4379 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4380
4381         * codegen.cs: Add patch from Robert Shade
4382         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4383         sync with mcs.
4384
4385 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4386
4387         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4388         incomplete key pairs (#57941).
4389
4390 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4391
4392         * codegen.cs: Fix another case where CS1548 must be reported (when 
4393         delay-sign isn't specified and no private is available #56564). Fix
4394         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4395         error when MCS is used on the MS runtime and we need to delay-sign 
4396         (which seems unsupported by AssemblyBuilder - see #56621).
4397
4398 2004-04-29  Jackson Harper  <jackson@ximian.com>
4399
4400         * Makefile: Set MONO_PATH to use the bootstrap corlib
4401         * driver.cs: Check the GAC for referenced assemblies.
4402                 
4403 2004-04-29  Martin Baulig  <martin@ximian.com>
4404
4405         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4406
4407 2004-04-07  Martin Baulig  <martin@ximian.com>
4408
4409         * expression.cs (Binary.ResolveOperator): Added special case for
4410         Equality/Inequality between a type parameter and a null literal.
4411
4412 2004-04-07  Martin Baulig  <martin@ximian.com>
4413
4414         * convert.cs: Check null literal -> type parameter conversions.
4415
4416 2004-04-07  Martin Baulig  <martin@ximian.com>
4417
4418         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4419         `class' and `struct' constraints.
4420
4421 2004-04-07  Martin Baulig  <martin@ximian.com>
4422
4423         * generic.cs (SpecialConstraint): New public enum.
4424         (Constraints.Resolve): Added support for the `class' and `struct'
4425         constraints.
4426
4427         * cs-parser.jay (type_parameter_constraint): Added support for the
4428         `class' and `struct' constraints.
4429
4430 2004-04-07  Martin Baulig  <martin@ximian.com>
4431
4432         * support.cs (GenericConstraints): Replaced `Types' by
4433         `ClassConstraint' and `InterfaceConstraints'; added
4434         `HasClassConstraint'.   
4435
4436 2004-04-07  Martin Baulig  <martin@ximian.com>
4437
4438         * generic.cs
4439         (Constraints.InterfaceConstraints): New public property.
4440         (Constraints.Types): Make this property public
4441         (TypeParameter): Implement IMemberContainer.
4442         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
4443         instead of a TypeBuilder/MethodBuilder; pass the interface
4444         constraints to TypeManager.AddTypeParameter().
4445         (TypeParameter.DefineType): Just take an EmitContext and no
4446         TypeBuilder/MethodBuilder.  Use the new public API.
4447
4448         * typemanager.cs (TypeManager.AddTypeParameter): Added
4449         `TypeExpr[]' argument; add the interfaces to the
4450         `builder_to_ifaces' hash.
4451         (TypeManager.LookupMemberContainer): For
4452         GenericTypeParameterBuilders, get the TypeParameter from the
4453         `builder_to_type_param'.
4454         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
4455         the TypeParameter and call FindMembers on it.
4456
4457 2004-04-07  Martin Baulig  <martin@ximian.com>
4458
4459         * class.cs
4460         (MethodCore.GenericMethod): Moved this field here from Method.
4461         (MethodCore.IsDuplicateImplementation): Take the number of type
4462         parameters into account if we're a generic method.
4463
4464         * expression.cs (Invocation.InferTypeArguments): Don't return true
4465         if `arguments' is null; we still need to check whether we actually
4466         don't need to infer anything in this case.
4467         (MemberAccess): Merged the functionality from GenericMemberAccess
4468         into this class.
4469
4470         * generic.cs (GenericMemberAccess): Removed.
4471
4472 2004-04-05  Martin Baulig  <martin@ximian.com>
4473
4474         * decl.cs (MemberCore): For generic classes, interfaces and
4475         structs, `Name' now includes the number of type parameters
4476         ("Stack!1.Node!1").
4477         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
4478         encode the number of type arguments in the type name.
4479
4480         * expression.cs (Expression.MemberLookup): Removed the
4481         `num_type_args' argument; we now encode the number of type
4482         arguments in the type name.
4483
4484         * ecore.cs (SimpleName): Encode the number of type arguments in
4485         the type name itself.
4486
4487         * generic.cs (ConstructedType): Likewise.
4488
4489         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
4490         `MemberName'; we now include the number of type parameters in the
4491         type name.
4492
4493         * typemanager.cs (TypeManager.CheckGeneric): Removed.
4494         (TypeManager.MemberLookup): Removed the
4495         `num_type_args' argument; we now encode the number of type
4496         arguments in the type name.     
4497
4498 2004-04-03  Martin Baulig  <martin@ximian.com>
4499
4500         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
4501         (MemberCore.MemberName): Moved here from MemberBase.
4502         (DeclSpace.SetParameterInfo): Just take the constraints as an
4503         ArrayList; we already have the type parameters in our
4504         `MemberName'; also do the CS0080 reporting here.
4505
4506         * cs-parser.jay (struct_declaration): Use `member_name' instead of
4507         `IDENTIFIER opt_type_parameter_list'; when constructing our
4508         `MemberName', it'll already include our type parameters.
4509         (class_declaration, interface_declaration): Likewise.
4510         (delegate_declaration): Likewise.
4511         (MakeName): Take a MemberName and return a MemberName.
4512         The following two changes are required to avoid shift/reduce conflicts:
4513         (member_name): Don't include a TypeName anymore; ie. this is now
4514         just 'IDENTIFIER opt_type_parameter_list'.
4515         (property_declaration, event_declaration): Use a
4516         `namespace_or_type_name' instead of a `member_name'.            
4517
4518 2004-04-03  Martin Baulig  <martin@ximian.com>
4519
4520         * decl.cs (MemberName): Renamed to `TypeName' and created a new
4521         `MemberName' class.
4522         (TypeName): Formerly known as MemberName.
4523
4524         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
4525         instead of a `MemberName'.
4526
4527         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
4528         (member_name): New rule; create a MemberName.
4529
4530 2004-04-02  Martin Baulig  <martin@ximian.com>
4531
4532         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
4533         (CS0305 and CS0308).
4534
4535 2004-04-02  Martin Baulig  <martin@ximian.com>
4536
4537         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
4538         support for nested types.
4539
4540 2004-04-02  Martin Baulig  <martin@ximian.com>
4541
4542         * ecore.cs (IAlias): New public interface.
4543         (TypeExpr, TypeExpression): Implement IAlias.
4544         (TypeAliasExpression): New public class.
4545
4546         * namespace.cs (Namespace): Implement IAlias.
4547         (Namespace.Lookup): Return an IAlias instead on an object.
4548         (Namespace.DefineName): Take an IAlias instead of an object.
4549         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
4550         an object.
4551         (NamespaceEntry.UsingAlias): Take a Membername instead of an
4552         Expression.
4553         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
4554         object.
4555         (NamespaceEntry.Lookup): Likewise.
4556
4557         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
4558         instead of a Type.      
4559
4560         * decl.cs (DeclSpace): Implement IAlias.
4561         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
4562
4563         * generic.cs (ConstructedType): Improved error checking.
4564
4565 2004-04-02  Martin Baulig  <martin@ximian.com>
4566
4567         * convert.cs: Added type parameter conversions.
4568
4569         * ecore.cs
4570         (UnboxCast.Emit): Emit an `unbox.any' for type params.
4571         (ClassCast.Emit): If the source type is a type parameter, box it.
4572         If the target type is a type parameter, emit an `unbox.any'
4573         instead of a `classcast'.1      
4574
4575 2004-04-01  Martin Baulig  <martin@ximian.com>
4576
4577         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
4578
4579 2004-04-01  Martin Baulig  <martin@ximian.com>
4580
4581         * generic.cs (ConstructedType.CheckConstraints): Use
4582         Convert.ImplicitStandardConversionExists(); user-defined implicit
4583         conversions are not allowed according to the spec.
4584
4585 2004-03-30  Martin Baulig  <martin@ximian.com>
4586
4587         * expression.cs (New): Added support for type parameters.
4588
4589         * typemanager.cs
4590         (TypeManager.activator_type): New public static field.
4591         (TypeManager.activator_create_instance): Likewise.
4592
4593 2004-03-30  Martin Baulig  <martin@ximian.com>
4594
4595         * typemanager.cs (TypeManager.HasConstructorConstraint): New
4596         public method.
4597
4598 2004-03-30  Martin Baulig  <martin@ximian.com>
4599
4600         * generic.cs (ConstructedType.CheckConstraints): Actually follow
4601         the spec here: the argument type must be convertible to the
4602         constraints.
4603
4604 2004-03-30  Martin Baulig  <martin@ximian.com>
4605
4606         * generic.cs
4607         (TypeParameter.Define, TypeParameter.DefineMethod): Call
4608         TypeManager.AddTypeParameter().
4609         (ConstructedType.CheckConstraints): Re-enable this and actually
4610         check whether we have a constructor constraint.
4611
4612         * typemanager.cs
4613         (TypeManager.builder_to_type_param): New static field.
4614         (TypeManager.AddTypeParameter): New static method.
4615         (TypeManager.LookupTypeParameter): New public method.
4616
4617 2004-03-30  Martin Baulig  <martin@ximian.com>
4618
4619         * generic.cs (TypeParameter.DefineType): Return a boolean and use
4620         the new API to actually define the constructor constraint.
4621
4622         * typemanager.cs
4623         (TypeManager.new_constraint_attr_type): New static field.
4624         (TypeManager.InitCoreTypes): Initialize it.
4625
4626 2004-03-30  Martin Baulig  <martin@ximian.com>
4627
4628         * generic.cs (Constraints): Completed error checking, use correct
4629         error numbers.
4630
4631 2004-03-29  Martin Baulig  <martin@ximian.com>
4632
4633         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
4634
4635         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4636         public version which takes a `ParameterData pd' instead of an
4637         `ArrayList args'.
4638
4639 2004-03-29  Martin Baulig  <martin@ximian.com>
4640
4641         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
4642         not a MethodInfo.       
4643
4644 2004-03-29  Martin Baulig  <martin@ximian.com>
4645
4646         * expression.cs (Argument.ResolveMethodGroup): If we're a
4647         ConstructedType, call GetMemberAccess() on it.  
4648
4649 2004-03-29  Martin Baulig  <martin@ximian.com>
4650
4651         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
4652         (MethodCore.CheckGenericOverride): When overriding a generic
4653         method, check whether the constraints match.
4654
4655         * support.cs (GenericConstraints): New public interface.
4656         (ParameterData.GenericConstraints): New public method.
4657
4658         * parameter.cs (Parameter.Resolve): Check whether we're a generic
4659         method parameter and compute our constraints if appropriate.
4660         (Parameter.GenericConstraints): New public property.
4661
4662         * generic.cs (Constraints): Implement GenericConstraints.
4663
4664 2004-03-29  Martin Baulig  <martin@ximian.com>
4665
4666         * decl.cs (MemberCache.FindMemberToOverride): Use
4667         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
4668
4669 2004-03-29  Martin Baulig  <martin@ximian.com>
4670
4671         * generic.cs (GenericMethod.Define): Resolve our type parameters.
4672
4673 2004-03-29  Martin Baulig  <martin@ximian.com>
4674
4675         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
4676         not allowed on non-generic declarations").
4677
4678 2004-03-29  Martin Baulig  <martin@ximian.com>
4679
4680         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4681         public version of this method.
4682
4683         * class.cs (MethodCore.IsDuplicateImplementation): Use
4684         Invocation.InferTypeArguments() to check this.
4685
4686 2004-03-29  Martin Baulig  <martin@ximian.com>
4687
4688         * convert.cs: Use TypeManager.IsDelegateType() instead of
4689         comparing types correctly.
4690
4691 2004-03-29  Martin Baulig  <martin@ximian.com>
4692
4693         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
4694         types directly to make it work for generic instances.
4695
4696         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
4697
4698 2004-03-29  Martin Baulig  <martin@ximian.com>
4699
4700         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
4701         support for arrays.     
4702
4703 2004-03-24  Martin Baulig  <martin@ximian.com>
4704
4705         * decl.cs (DeclSpace.FindType): Also use
4706         TypeManager.CheckGeneric() for types from the using clauses.
4707
4708 2004-03-23  Martin Baulig  <martin@ximian.com>
4709
4710         * expression.cs (Invocation.OverloadResolve): Added `bool
4711         may_fail' argument and use it instead of the Location.IsNull() hack.
4712
4713 2004-03-23  Martin Baulig  <martin@ximian.com>
4714
4715         * expression.cs (Invocation.InferType): Use correct type inference
4716         rules here.     
4717
4718 2004-03-23  Martin Baulig  <martin@ximian.com>
4719
4720         * ecore.cs (MethodGroupExpr.Name): Use
4721         TypeManager.CSharpSignature() instead of just the name.
4722
4723         * expression.cs (Invocation.OverloadResolve): Provide better error
4724         reporting.
4725         (Invocation.DoResolve): OverloadResolve() never returns null
4726         without reporting an error, so removed the error -6 reporting here.
4727
4728 2004-03-23  Martin Baulig  <martin@ximian.com>
4729
4730         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
4731         generic methods.
4732
4733         * cs-parser.jay (delegate_declaration): Support generic delegates.
4734
4735         * delegate.cs: Support generic delegates.
4736
4737 2004-03-22  Martin Baulig  <martin@ximian.com>
4738
4739         * expression.cs (Invocation.InferParamsTypeArguments): New static
4740         method; does type inference for params arguments.
4741
4742 2004-03-21  Martin Baulig  <martin@ximian.com>
4743
4744         * typemanager.cs (TypeManager.IsGenericMethod): New public static
4745         method; checks whether a method is a generic method.    
4746
4747         * expression.cs (Invocation.InferTypeArguments): New static method;
4748         infer type arguments for generic method invocation.
4749
4750         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
4751         property; we set this to true if we're resolving a generic method
4752         invocation and the user specified type arguments, ie. we're not
4753         doing type inference.
4754
4755 2004-03-20  Martin Baulig  <martin@ximian.com>
4756
4757         * class.cs (MethodData.DeclaringType): New public property.
4758         (MethodData.Define): Set DeclaringType here.
4759         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
4760         instead of OperatorMethodBuilder.DeclaringType.
4761
4762 2004-03-20  Martin Baulig  <martin@ximian.com>
4763
4764         * cs-tokenizer.cs (xtoken): Return a special
4765         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
4766
4767         * cs-parser.jay (default_value_expression): Switch to the new
4768         syntax (14.5.13).
4769
4770 2004-03-19  Martin Baulig  <martin@ximian.com>
4771
4772         * decl.cs (MemberName): New class.  We use this to "construct"
4773         namespace_or_type_name's.
4774
4775         * generics.cs (TypeArguments.GetDeclarations): New public method;
4776         returns the type arguments as a string[] and reports a CS0081 if
4777         one of them is not an identifier.
4778
4779         * class.cs (MemberBase): The .ctor now takes the name as a
4780         MemberName instead of a string.
4781         (MemberBase.ExplicitInterfaceName): Changed type from string to
4782         Expression.
4783         (MemberBase.DoDefine): If we're an explicit implementation, the
4784         InterfaceType may be a generic instance.
4785
4786         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
4787         (namespace_name): Call MemberName.GetName () to transform the
4788         MemberName into a string and ensure we don't have any type
4789         arguments.
4790         (type_name): Call MemberName.GetTypeExpression() to transfrom the
4791         MemberName into an expression.
4792         (method_header): Use namespace_or_type_name instead of member_name.     
4793
4794 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
4795
4796         * rootcontext.cs: Add new types to the boot resolution.
4797
4798         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
4799         MulticastDelegate is not allowed.
4800
4801         * typemanager.cs: Add new types to lookup: System.TypedReference
4802         and ArgIterator.
4803
4804         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
4805         check for TypedReference or ArgIterator, they are not allowed. 
4806
4807         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
4808         makes us properly catch 1510 in some conditions (see bug 56016 for
4809         details). 
4810
4811 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
4812
4813         * CryptoConvert.cs: update from corlib version
4814         with endian fixes.
4815
4816 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
4817
4818         * class.cs (Indexer.Define): Check indexername declaration
4819
4820 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
4821
4822         * attribute.cs (IsClsCompliant): Fixed problem with handling
4823         all three states (compliant, not-compliant, undetected).
4824
4825 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
4826
4827         * attribute.cs (Attribute): Location is now public.
4828         (Resolve): Store resolved arguments (pos_values) in attribute class.
4829         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
4830         (GetClsCompliantAttributeValue): New method that gets
4831         CLSCompliantAttribute value.
4832         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
4833         if exists else null.
4834         (AttributeTester): New class for CLS-Compliant verification routines.
4835
4836         * class.cs (Emit): Add CLS-Compliant verification.
4837         (Method.GetSignatureForError): Implemented.
4838         (Constructor.GetSignatureForError): Implemented
4839         (Constructor.HasCompliantArgs): Returns if constructor has
4840         CLS-Compliant arguments.
4841         (Constructor.Emit): Override.
4842         (Construcor.IsIdentifierClsCompliant): New method; For constructors
4843         is needed to test only parameters.
4844         (FieldBase.GetSignatureForError): Implemented.
4845         (TypeContainer): New member for storing base interfaces.
4846         (TypeContainer.FindMembers): Search in base interfaces too.
4847
4848         * codegen.cs (GetClsComplianceAttribute): New method that gets
4849         assembly or module CLSCompliantAttribute value.
4850         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
4851         for assembly.
4852         (ModuleClass.Emit): Add error 3012 test.
4853
4854         * const.cs (Emit): Override and call base for CLS-Compliant tests.
4855
4856         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
4857         state for all decl types.
4858         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
4859         if CLS-Compliant tests are required.
4860         (IsClsCompliaceRequired): New method. Analyze whether code
4861         must be CLS-Compliant.
4862         (IsExposedFromAssembly): New method. Returns true when MemberCore
4863         is exposed from assembly.
4864         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
4865         value or gets cached value.
4866         (HasClsCompliantAttribute): New method. Returns true if MemberCore
4867         is explicitly marked with CLSCompliantAttribute.
4868         (IsIdentifierClsCompliant): New abstract method. This method is
4869         used to testing error 3005.
4870         (IsIdentifierAndParamClsCompliant): New method. Common helper method
4871         for identifier and parameters CLS-Compliant testing.
4872         (VerifyClsCompliance): New method. The main virtual method for
4873         CLS-Compliant verifications.
4874         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
4875         null. I don't know why is null (too many public members !).
4876         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
4877         and get value of first CLSCompliantAttribute that found.
4878
4879         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
4880         (VerifyClsCompliance): Override and add extra tests.
4881
4882         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
4883         clscheck- disable CLS-Compliant verification event if assembly is has
4884         CLSCompliantAttribute(true).
4885
4886         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
4887         ApllyAttribute is now called in emit section as in the other cases.
4888         Possible future Emit integration.
4889         (IsIdentifierClsCompliant): New override.
4890         (VerifyClsCompliance): New override.
4891         (GetEnumeratorName): Returns full enum name.
4892
4893         * parameter.cs (GetSignatureForError): Implemented.
4894
4895         * report.cs (WarningData): New struct for Warning message information.
4896         (LocationOfPreviousError): New method.
4897         (Warning): New method. Reports warning based on the warning table.
4898         (Error_T): New method. Reports error based on the error table.
4899
4900         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
4901         verifications are done here.
4902
4903         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
4904
4905         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
4906         CLSCompliantAttribute.
4907         (all_imported_types): New member holds all imported types from other
4908         assemblies.
4909         (LoadAllImportedTypes): New method fills static table with exported types
4910         from all referenced assemblies.
4911         (Modules): New property returns all assembly modules.
4912
4913 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
4914
4915         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
4916         throwing a parser error.
4917
4918         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
4919         which removes the hardcoded get_/set_ prefixes for properties, as
4920         IL allows for the properties to be named something else.  
4921
4922         Bug #56013
4923
4924         * expression.cs: Do not override operand before we know if it is
4925         non-null.  Fix 56207
4926
4927 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4928
4929         * typemanager.cs: support for pinned variables.
4930
4931 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4932
4933         * decl.cs, typemanager.cs: Avoid using an arraylist
4934         as a buffer if there is only one result set.
4935
4936 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4937
4938         * expression.cs: Make sure you cant call a static method
4939         with an instance expression, bug #56174.
4940
4941 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
4942
4943         * class.cs (IsDuplicateImplementation): Improve error reporting to
4944         flag 663 (method only differs in parameter modifier).
4945
4946         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
4947         in preprocessor directives.
4948
4949         * location.cs (LookupFile): Allow for the empty path.
4950
4951         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
4952         better approach for some of that patch, but its failing with the
4953         CharSet enumeration.  For now try/catch will do.
4954
4955         * typemanager.cs: Do not crash if a struct does not have fields.
4956         Fixes 56150.
4957
4958 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4959
4960         * expression.cs: cs0213, cant fix a fixed expression.
4961         fixes 50231.
4962
4963 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4964
4965         * cs-parser.jay: detect invalid embeded statements gracefully.
4966         bug #51113.
4967
4968 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4969
4970         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
4971         As a regex:
4972         s/
4973         the invocation type may not be a subclass of the tye of the item/
4974         The type of the item must be a subclass of the invocation item.
4975         /g
4976
4977         Fixes bug #50820.
4978
4979 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
4980
4981         * attribute.cs: Added methods to get a string and a bool from an
4982         attribute. Required to information from AssemblyKeyFileAttribute,
4983         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
4984         * codegen.cs: Modified AssemblyName creation to include support for
4985         strongnames. Catch additional exceptions to report them as CS1548.
4986         * compiler.csproj: Updated include CryptoConvert.cs.
4987         * compiler.csproj.user: Removed file - user specific configuration.
4988         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
4989         Mono.Security assembly. The original class is maintained and tested in
4990         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
4991         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
4992         like CSC 8.0 (C# v2) supports.
4993         * Makefile: Added CryptoConvert.cs to mcs sources.
4994         * rootcontext.cs: Added new options for strongnames.
4995
4996 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
4997
4998         * driver.cs: For --expect-error, report error code `2'
4999         if the program compiled with no errors, error code `1' if
5000         it compiled with an error other than the one expected.
5001
5002 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5003
5004         * compiler.csproj: Updated for Visual Studio .NET 2003.
5005         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5006         * compiler.sln: Updated for Visual Studio .NET 2003.
5007
5008 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5009
5010         * expression.cs: Fix bug #47234. We basically need to apply the
5011         rule that we prefer the conversion of null to a reference type
5012         when faced with a conversion to 'object' (csc behaviour).
5013
5014 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5015
5016         * statement.cs: Shorter form for foreach, eliminates
5017         a local variable. r=Martin.
5018
5019 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5020
5021         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5022         checks if we can use brtrue/brfalse to test for 0.
5023         * expression.cs: use the above in the test for using brtrue/brfalse.
5024         cleanup code a bit.
5025
5026 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5027
5028         * expression.cs: Rewrite string concat stuff. Benefits:
5029
5030         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5031         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5032         rather than a concat chain.
5033
5034         * typemanager.cs: Add lookups for more concat overloads.
5035
5036 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5037
5038         * expression.cs: Emit shorter il code for array init.
5039
5040         newarr
5041         dup
5042         // set 1
5043
5044         // set 2
5045
5046         newarr
5047         stloc.x
5048
5049         ldloc.x
5050         // set 1
5051
5052         ldloc.x
5053         // set 2
5054
5055 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5056
5057         * statement.cs: Before, two switch blocks would be merged if the
5058         total size of the blocks (end_item - begin_item + 1) was less than
5059         two times the combined sizes of the blocks.
5060
5061         Now, it will only merge if after the merge at least half of the
5062         slots are filled.
5063
5064         fixes 55885.
5065
5066 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5067
5068         * class.cs : csc build fix for GetMethods(). See bug #52503.
5069
5070 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5071
5072         * expression.cs: Make sure fp comparisons work with NaN.
5073         This fixes bug #54303. Mig approved this patch a long
5074         time ago, but we were not able to test b/c the runtime
5075         had a related bug.
5076
5077 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5078
5079         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5080
5081 2004-03-19  Martin Baulig  <martin@ximian.com>
5082
5083         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5084         two overloads may unify for some type parameter substitutions and
5085         report a CS0408 if appropriate.
5086
5087 2004-03-19  Martin Baulig  <martin@ximian.com>
5088
5089         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5090         error here and not in our caller.
5091
5092 2004-03-19  Martin Baulig  <martin@ximian.com>
5093
5094         * interface.cs: Completely killed this file.
5095         (Interface): We're now a TypeContainer and live in class.cs.
5096
5097         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5098         argument; we're now also called for interfaces.
5099         (TypeContainer.DefineMembers): Allow this method being called
5100         multiple times.
5101         (TypeContainer.GetMethods): New public method; formerly known as
5102         Interface.GetMethod().  This is used by PendingImplementation.
5103         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5104         it's now private and non-static.
5105         (Interface): Moved this here; it's now implemented similar to
5106         Class and Struct.
5107         (Method, Property, Event, Indexer): Added `bool is_interface'
5108         argument to their .ctor's.
5109         (MemberBase.IsInterface): New public field.
5110
5111         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5112         instances instead of InterfaceMethod, InterfaceProperty, etc.
5113         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5114         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5115
5116 2004-03-19  Martin Baulig  <martin@ximian.com>
5117
5118         * class.cs (MethodCore.IsDuplicateImplementation): New private
5119         method which does the CS0111 checking.
5120         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5121         Use IsDuplicateImplementation().
5122
5123 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5124
5125         * decl.cs (FindMemberToOverride): New method to find the correct
5126         method or property to override in the base class.
5127         * class.cs
5128             - Make Method/Property use the above method to find the
5129               version in the base class.
5130             - Remove the InheritableMemberSignatureCompare as it is now
5131               dead code.
5132
5133         This patch makes large code bases much faster to compile, as it is
5134         O(n) rather than O(n^2) to do this validation.
5135
5136         Also, it fixes bug 52458 which is that nested classes are not
5137         taken into account when finding the base class member.
5138
5139         Reviewed/Approved by Martin.
5140
5141 2004-03-17  Martin Baulig  <martin@ximian.com>
5142
5143         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5144         of type arguments into account; use the `real_num_type_args'
5145         approach like in DoResolveAsTypeStep().
5146
5147         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5148         nested types.
5149
5150 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5151
5152         * interface.cs: In all interface classes removed redundant
5153         member initialization.
5154
5155 2004-03-16  Martin Baulig  <martin@ximian.com>
5156
5157         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5158
5159 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5160
5161         * decl.cs (DefineTypeAndParents): New helper method to define a
5162         type's containers before the type itself is defined;  This is a
5163         bug exposed by the recent changes to Windows.Forms when an
5164         implemented interface was defined inside a class that had not been
5165         built yet.   
5166
5167         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5168
5169         (Check): Loop correctly to report errors modifiers
5170         (UNSAFE was not in the loop, since it was the same as TOP).
5171
5172         * interface.cs: Every interface member now takes a ModFlags,
5173         instead of a "is_new" bool, which we set on the base MemberCore. 
5174
5175         Every place where we called "UnsafeOk" in the interface, now we
5176         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5177         the unsafe settings from the member declaration instead of the
5178         container interface. 
5179
5180         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5181
5182         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5183         `set_indexer_name' to the pending bits (one per type).
5184
5185         We fixed a bug today that was picking the wrong method to
5186         override, since for properties the existing InterfaceMethod code
5187         basically ignored the method name.  Now we make sure that the
5188         method name is one of the valid indexer names.
5189
5190 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5191  
5192         * support.cs (SeekableStreamReader): Keep track of stream byte
5193         positions and don't mix them with character offsets to the buffer.
5194
5195         Patch from Gustavo Giráldez
5196
5197 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5198
5199         * interface.cs (InterfaceSetGetBase): Removed double member
5200         initialization, base class does it as well.
5201
5202 2004-03-13  Martin Baulig  <martin@ximian.com>
5203
5204         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5205         when compiling corlib.
5206
5207 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5208
5209         * convert.cs (ExplicitConversion): We were reporting an error on
5210         certain conversions (object_type source to a value type, when the
5211         expression was `null') before we had a chance to pass it through
5212         the user defined conversions.
5213
5214         * driver.cs: Replace / and \ in resource specifications to dots.
5215         Fixes 50752
5216
5217         * class.cs: Add check for duplicate operators.  Fixes 52477
5218
5219 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5220
5221         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5222         that are in the middle of the statements, not only at the end.
5223         Fixes #54987
5224
5225         * class.cs (TypeContainer.AddField): No longer set the
5226         `HaveStaticConstructor' flag, now we call it
5227         `UserDefineStaticConstructor' to diferentiate the slightly
5228         semantic difference.
5229
5230         The situation is that we were not adding BeforeFieldInit (from
5231         Modifiers.TypeAttr) to classes that could have it.
5232         BeforeFieldInit should be set to classes that have no static
5233         constructor. 
5234
5235         See:
5236
5237         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5238
5239         And most importantly Zoltan's comment:
5240
5241         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5242
5243         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5244          before its static fields are used', i.e. initialization does not need
5245          to be triggered by the first access to the type. Setting this flag
5246          helps the JIT to compile better code, since it can run the static
5247          constructor at JIT time, and does not need to generate code to call it
5248          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5249          this flag for lots of classes like String. 
5250          
5251          csc sets this flag if the type does not have an explicit static 
5252          constructor. The reasoning seems to be that if there are only static
5253          initalizers for a type, and no static constructor, then the programmer
5254          does not care when this initialization happens, so beforefieldinit
5255          can be used.
5256          
5257          This bug prevents the AOT compiler from being usable, since it 
5258          generates so many calls to mono_runtime_class_init that the AOT code
5259          is much slower than the JITted code. The JITted code is faster, 
5260          because it does not generate these calls if the vtable is type is
5261          already initialized, which is true in the majority of cases. But the
5262          AOT compiler can't do this."
5263
5264 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5265
5266         * class.cs (MethodData.Emit): Refactor the code so symbolic
5267         information is generated for destructors;  For some reasons we
5268         were taking a code path that did not generate symbolic information
5269         before. 
5270
5271 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5272
5273         * class.cs: Create a Constructor.CheckBase method that
5274         takes care of all validation type code. The method
5275         contains some code that was moved from Define.
5276
5277         It also includes new code that checks for duplicate ctors.
5278         This fixes bug #55148.
5279
5280 2004-03-09  Joshua Tauberer <tauberer@for.net>
5281
5282         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5283         a { ... }-style array creation invokes EmitStaticInitializers
5284         which is not good for reference-type arrays.  String, decimal
5285         and now null constants (NullCast) are not counted toward
5286         static initializers.
5287
5288 2004-03-05  Martin Baulig  <martin@ximian.com>
5289
5290         * location.cs (SourceFile.HasLineDirective): New public field;
5291         specifies whether the file contains or is referenced by a "#line"
5292         directive.
5293         (Location.DefineSymbolDocuments): Ignore source files which
5294         either contain or are referenced by a "#line" directive.        
5295
5296 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5297
5298         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5299         direct access to our parent, so check the method inline there.
5300
5301 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5302
5303         * expression.cs (Invocation.EmitCall): Miguel's last commit
5304         caused a regression. If you had:
5305
5306             T t = null;
5307             t.Foo ();
5308
5309         In Foo the implict this would be null.
5310
5311 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5312
5313         * expression.cs (Invocation.EmitCall): If the method is not
5314         virtual, do not emit a CallVirt to it, use Call.
5315
5316         * typemanager.cs (GetFullNameSignature): Improve the method to
5317         cope with ".ctor" and replace it with the type name.
5318
5319         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5320         as an argument the ConstructorBuilder where it is being defined,
5321         to catch the recursive constructor invocations.
5322
5323 2004-03-16  Martin Baulig  <martin@ximian.com>
5324
5325         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5326         ConstructedType, call ResolveType() on it to get the type rather
5327         than just using `expr.Type'.
5328
5329 2004-03-16  Martin Baulig  <martin@ximian.com>
5330
5331         * generics.cs (ConstructedType.GetMemberAccess): Take the
5332         EmitContext instead on the TypeExpr and use
5333         ec.TypeContainer.CurrentType/ec.ContainerType.
5334
5335 2004-03-16  Martin Baulig  <martin@ximian.com>
5336
5337         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5338         parameters before aliases.
5339
5340 2004-03-16  Martin Baulig  <martin@ximian.com>
5341
5342         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5343         New oublic function; checks whether two generic instances may become
5344         equal under some instantiations (26.3.1).
5345
5346         * class.cs (TypeContainer.Define): Call
5347         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5348         error.
5349
5350 2004-03-16  Martin Baulig  <martin@ximian.com>
5351
5352         * class.cs (TypeContainer.GetClassBases): Moved
5353         Error_TypeParameterAsBase() here and also check whether the base
5354         class is not an attribute.
5355
5356 2004-03-16  Martin Baulig  <martin@ximian.com>
5357
5358         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5359
5360 2004-03-16  Martin Baulig  <martin@ximian.com>
5361
5362         * class.cs (Error_TypeParameterAsBase): Use correct error number
5363         here (CS0689).  
5364
5365 2004-03-16  Martin Baulig  <martin@ximian.com>
5366
5367         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5368         for generics.
5369
5370         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5371         error reporting.
5372
5373 2004-03-15  Martin Baulig  <martin@ximian.com>
5374
5375         * typemanager.cs (TypeManager.GetFullName): New public method.
5376         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5377         argument; only return members with the correct number of type
5378         arguments.
5379         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5380         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5381         whether the number of type arguments matches.
5382
5383         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5384         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5385
5386         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5387         field; it's set by the protected .ctor when we're actually a
5388         GenericMemberAccess.
5389         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5390         arguments and pass it to MemberLookupFinal ().
5391
5392         * ecore.cs (Expression.MemberLookup): Added `int
5393         num_type_arguments' argument; only return members with the correct
5394         number of type arguments.
5395         (Expression.MemberLookupFailed): Check whether the MemberLookup
5396         failed because we did not have the correct number of type
5397         arguments; report CS0305 in this case.
5398
5399         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5400         `e.ResolveAsTypeTerminal()' already did so.
5401
5402 2004-03-15  Martin Baulig  <martin@ximian.com>
5403
5404         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5405         we're a ConstructedType; in this case, the caller must report an
5406         error (for instance CS0131).
5407
5408         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5409         (TypeArguments.Resolve): Actually report errors here.
5410
5411 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5412
5413         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5414         `set_indexer_name' to the pending bits (one per type).
5415
5416         We fixed a bug today that was picking the wrong method to
5417         override, since for properties the existing InterfaceMethod code
5418         basically ignored the method name.  Now we make sure that the
5419         method name is one of the valid indexer names.
5420
5421 2004-03-15  Martin Baulig  <martin@ximian.com>
5422
5423         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5424         for generic instances.
5425
5426 2004-03-13  Martin Baulig  <martin@ximian.com>
5427
5428         * class.cs (TypeContainer.DefineType): Call
5429         TypeManager.AddUserType() immediately after creating the
5430         TypeBuilder; pass all type parameters when creating the
5431         CurrentType.
5432
5433         * decl.cs (DeclSpace.FindNestedType): New public method.
5434         (DeclSpace.FindType): Added `int num_type_args' argument; only
5435         return types with the correct number of type parameters.
5436         (DeclSpace.CountTypeParams): New public property.
5437
5438         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
5439         the number of type parameters; defaults to zero.
5440
5441         * generic.cs (TypeArguments.Count): New public property.
5442         (ConstructedType.DoResolveAsTypeStep): First call
5443         ds.FindNestedType() to find out whether we're nested in the
5444         current generic type; in this case, we inherit all type parameters
5445         from the current class.
5446
5447         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
5448         num_type_args' argument.
5449         (RootContext.LookupType): Added overloaded version which takes the
5450         number of type arguments; only return types with the correct
5451         number of type arguments.
5452
5453         * typemanager.cs (TypeManager.CheckGeneric): New public function;
5454         checks whether `Type t' has `int num_type_args'.
5455
5456 2004-03-13  Martin Baulig  <martin@ximian.com>
5457
5458         * generic.cs (GenericMethod.DefineType): New method; calls
5459         DefineType() on all the type parameters.
5460
5461         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
5462         (MethodData.Define): If we're a generic method, call
5463         GenericMethod.DefineType() to define the type parameters.       
5464
5465 2004-03-10  Martin Baulig  <martin@ximian.com>
5466
5467         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
5468         instead of IsAssignableFrom.    
5469
5470 2004-03-10  Martin Baulig  <martin@ximian.com>
5471
5472         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
5473
5474         * support.cs (ParameterData.HasArrayParameter): New property.
5475         (ReflectionParameters.ctor): Take a MethodBase instead of a
5476         ParameterInfo[].  If we have any type parameters, get the generic
5477         method definition and ask it whether we have variable arguments.
5478
5479 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5480
5481         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5482         routines to check if a type is an enumerable/enumerator allow
5483         classes that implement the IEnumerable or IEnumerator interfaces.
5484
5485         * class.cs (Property, Operator): Implement IIteratorContainer, and
5486         implement SetYields.
5487
5488         (Property.Define): Do the block swapping for get_methods in the
5489         context of iterators.   We need to check if Properties also
5490         include indexers or not.
5491
5492         (Operator): Assign the Block before invoking the
5493         OperatorMethod.Define, so we can trigger the Iterator code
5494         replacement. 
5495
5496         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5497         Property and Operator classes are not created when we parse the
5498         declarator but until we have the block completed, so we use a
5499         singleton SimpleIteratorContainer.Simple to flag whether the
5500         SetYields has been invoked.
5501
5502         We propagate this setting then to the Property or the Operator to
5503         allow the `yield' to function.
5504
5505 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5506
5507         * codegen.cs: Implemented attribute support for modules.
5508         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5509         Assembly/Module functionality.
5510
5511         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5512         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5513         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5514
5515 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5516
5517         * interface.cs (FindMembers): The operation is performed on all base
5518         interfaces and not only on the first. It is required for future CLS Compliance patch.
5519
5520 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5521
5522         * statement.cs, codegen.cs:
5523         This patch deals with patterns such as:
5524
5525         public class List : IEnumerable {
5526
5527                 public MyEnumerator GetEnumerator () {
5528                         return new MyEnumerator(this);
5529                 }
5530
5531                 IEnumerator IEnumerable.GetEnumerator () {
5532                         ...
5533                 }
5534                 
5535                 public struct MyEnumerator : IEnumerator {
5536                         ...
5537                 }
5538         }
5539
5540         Before, there were a few things we did wrong:
5541         1) we would emit callvirt on a struct, which is illegal
5542         2) we emited ldarg when we needed to emit ldarga
5543         3) we would mistakenly call the interface methods on an enumerator
5544         type that derived from IEnumerator and was in another assembly. For example:
5545
5546         public class MyEnumerator : IEnumerator
5547
5548         Would have the interface methods called, even if there were public impls of the
5549         method. In a struct, this lead to invalid IL code.
5550
5551 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5552
5553         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5554           renamed to Emit.
5555
5556         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5557
5558 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5559
5560         * cs-parser.jay: Fix small regression: we were not testing V2
5561         compiler features correctly.
5562
5563         * interface.cs: If the emit context is null, then create one
5564
5565 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5566
5567         * decl.cs (GetSignatureForError): New virtual method to get full name
5568           for error messages.
5569
5570         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5571           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5572
5573         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5574           Duplicated members and code in these classes has been removed.
5575           Better encapsulation in these classes.
5576
5577 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5578
5579         * assign.cs (Assign.DoResolve): When dealing with compound
5580         assignments, there is a new rule in ECMA C# 2.4 (might have been
5581         there before, but it is documented here) that states that in:
5582
5583         a op= b;
5584
5585         If b is of type int, and the `op' is a shift-operator, then the
5586         above is evaluated as:
5587
5588         a = (int) a op b 
5589
5590         * expression.cs (Binary.ResolveOperator): Instead of testing for
5591         int/uint/long/ulong, try to implicitly convert to any of those
5592         types and use that in pointer arithmetic.
5593
5594         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5595         method to print information for from the type, not from the
5596         null-method we were given.
5597
5598 2004-02-01  Duncan Mak  <duncan@ximian.com>
5599
5600         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
5601         parsing for cmd, fixes bug #53694.
5602
5603 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
5604
5605         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
5606         in the member name duplication tests. Property and operator name duplication
5607         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
5608
5609 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
5610
5611         * interface.cs (PopulateMethod): Fixed crash when interface method
5612         returns not existing type (error test cs0246-3.cs).
5613
5614 2004-02-02  Ravi Pratap M <ravi@ximian.com>
5615
5616         * cs-parser.jay (interface_accessors): Re-write actions to also
5617         store attributes attached to get and set methods. Fix spelling
5618         while at it.
5619
5620         (inteface_property_declaration): Modify accordingly.
5621
5622         (InterfaceAccessorInfo): New helper class to store information to pass
5623         around between rules that use interface_accessors.
5624
5625         * interface.cs (Emit): Apply attributes on the get and set
5626         accessors of properties and indexers too.
5627
5628         * attribute.cs (ApplyAttributes): Modify accordingly to use the
5629         right MethodBuilder when applying attributes to the get and set accessors.
5630
5631 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
5632
5633         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
5634
5635 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
5636
5637         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
5638
5639 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
5640
5641         * cs-parser.jay: Remove YIELD token, instead use the new grammar
5642         changes that treat `yield' specially when present before `break'
5643         or `return' tokens.
5644
5645         * cs-tokenizer.cs: yield is no longer a keyword.
5646
5647 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
5648
5649         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
5650         setting for default constructors.
5651         For default constructors are almost every time set wrong Modifier. The
5652         generated IL code has been alright. But inside mcs this values was
5653         wrong and this was reason why several of my CLS Compliance tests
5654         failed.
5655
5656 2004-02-27  Martin Baulig  <martin@ximian.com>
5657
5658         * generics.cs (ConstructedType.ResolveType): Make the nested type
5659         stuff actually work.
5660
5661 2004-02-25  Martin Baulig  <martin@ximian.com>
5662
5663         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
5664         property; returns the type parameters just from the current type,
5665         ie. with the ones from outer classes.
5666         (DeclSpace.LookupGeneric): First search in the current class, then
5667         in outer classes.
5668         (DeclSpace.initialize_type_params): When hiding a type parameter
5669         from an outer class, put it into the `type_param_list' anyways.
5670
5671         * expression.cs (MemberAccess.expr): Made this field protected.
5672
5673         * class.cs (TypeContainer.Define): The `CurrentType' just contains
5674         the type parameters from the current class.
5675
5676         * generic.cs (ConstructedType.ResolveType): Support nested generic
5677         types by taking the type parameters which we inherit from outer
5678         classes into account.
5679         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
5680         support for nested generic types.
5681
5682 2004-02-23  Martin Baulig  <martin@ximian.com>
5683
5684         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
5685         field and check whether we're nested inside a generic type.
5686         (DeclSpace.ResolveType): If we're resolving to a generic type
5687         definition, create a ConstructedType and return its resolved type.
5688         (DeclSpace.initialize_type_params): New private method;
5689         initializes the `type_param_list' field from the type parameters
5690         from this and all enclosing classes.
5691         (DeclSpace.TypeParameters): Call initialize_type_params() unless
5692         we're already initialized.
5693
5694 2004-02-23  Martin Baulig  <martin@ximian.com>
5695
5696         * class.cs (Method.Define): Create the generic method before
5697         calling DoDefine().
5698         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
5699         the TypeContainer one); we use this for generic methods.
5700
5701         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
5702         parent's TypeBuilder.
5703
5704 2004-02-18  Martin Baulig  <martin@ximian.com>
5705
5706         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
5707         to check for equality.
5708
5709 2004-02-05  Martin Baulig  <martin@ximian.com>
5710
5711         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
5712         `ec.TypeContainer.CurrentType', use it instead of
5713         `ec.ContainerType' to check whether we're in the type's ctor.
5714
5715 2004-01-29  Martin Baulig  <martin@ximian.com>
5716
5717         * expression.cs (Invocation.DoResolve): If we're a
5718         `ConstructedType', then we're actually a generic method, so
5719         rewrite the expr as a GenericMemberAccess.
5720
5721         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
5722         here; manually parse it into a string.
5723
5724 2004-01-28  Martin Baulig  <martin@ximian.com>
5725
5726         * typemanager.cs (TypeManager.IsEqual): New static method.
5727         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
5728         check for equality instead of using `=='.
5729
5730 2004-01-26  Martin Baulig  <martin@ximian.com>
5731
5732         * decl.cs (DeclSpace.CurrentType): New public field.
5733
5734         * expression.cs (This.ResolveBase): If we have an
5735         `ec.TypeContainer.CurrentType', use it instead of
5736         `ec.ContainerType'.
5737
5738         * class.cs (TypeContainer.DefineType): If we're a generic type,
5739         create the `CurrentType' (unresolved).
5740         (TypeContainer.GenericType): New private field.
5741         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
5742         it and store it in `GenericType' before creating the MemberCache.
5743         (TypeContainer.GetMembers): If we have a `GenericType', call
5744         TypeManager.FindMembers() on it.
5745
5746         * interface.cs (Interface.GenericType): New private field.
5747         (Interface.DefineType): If we're a generic type, create the
5748         `CurrentType' (unresolved).
5749         (Interface.DefineMembers): If we have a `CurrentType', resolve it
5750         and store it in `GenericType' before creating the MemberCache.
5751         (Interface.GetMembers): If we have a `GenericType', call
5752         TypeManager.FindMembers() on it.
5753
5754 2004-01-22  Martin Baulig  <martin@ximian.com>
5755
5756         * cs-parser.jay (namespace_or_type_name): Return an Expression,
5757         not a QualifiedIdentifier.  This is what `type_name_expression'
5758         was previously doing.
5759         (type_name_expression): Removed; the code is now in
5760         `namespace_or_type_name'.
5761         (qualified_identifier): Removed, use `namespace_or_type_name'
5762         instead.
5763         (QualifiedIdentifier): Removed this class.      
5764
5765 2004-01-22  Martin Baulig  <martin@ximian.com>
5766
5767         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
5768         not a string as alias name.
5769
5770 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
5771
5772         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
5773         #52730 bug, and instead compute correctly the need to use a
5774         temporary variable when requesting an address based on the
5775         static/instace modified of the field and the constructor.
5776  
5777 2004-01-21  Martin Baulig  <martin@ximian.com>
5778
5779         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
5780         class and namespace before looking up aliases.  Fixes #52517.
5781
5782 2004-01-21  Martin Baulig  <martin@ximian.com>
5783
5784         * flowanalysis.cs (UsageVector.Merge): Allow variables being
5785         assinged in a 'try'; fixes exception4.cs.
5786
5787 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5788         * class.cs : Implemented parameter-less constructor for TypeContainer
5789
5790         * decl.cs: Attributes are now stored here. New property OptAttributes
5791
5792         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
5793
5794         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
5795
5796 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5797
5798         * typemanager.cs (CSharpSignature): Now reports also inner class name.
5799           (CSharpSignature): New method for indexer and property signature.
5800
5801 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5802
5803         * pending.cs (IsVirtualFilter): Faster implementation.
5804
5805 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5806
5807         * typemanager.cs: Avoid inclusion of same assembly more than once.
5808
5809 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5810
5811         * cs-parser.jay: Fixed problem where the last assembly attribute
5812           has been applied also to following declaration (class, struct, etc.)
5813           
5814 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5815
5816         * class.cs: Added error CS0538, CS0539 reporting.
5817         Fixed crash on Microsoft runtime when field type is void.
5818
5819         * cs-parser.jay: Added error CS0537 reporting.
5820
5821         * pending.cs: Added error CS0535 reporting.
5822         Improved error report for errors CS0536, CS0534.
5823
5824 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
5825
5826         Merge a few bits from the Anonymous Method MCS tree.
5827
5828         * statement.cs (ToplevelBlock): New class for toplevel methods,
5829         will hold anonymous methods, lifted variables.
5830
5831         * cs-parser.jay: Create toplevel blocks for delegates and for
5832         regular blocks of code. 
5833
5834 2004-01-20  Martin Baulig  <martin@ximian.com>
5835
5836         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
5837         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
5838         and `NeedExplicitReturn'; added `IsLastStatement'.
5839         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
5840         have a `ReturnLabel' or we're not unreachable.
5841
5842         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
5843         child's reachability; don't just override ours with it.  Fixes
5844         #58058 (lluis's example).
5845         (FlowBranching): Added public InTryOrCatch(), InCatch(),
5846         InFinally(), InLoop(), InSwitch() and
5847         BreakCrossesTryCatchBoundary() methods.
5848
5849         * statement.cs (Return): Do all error checking in Resolve().
5850         Unless we are the last statement in a top-level block, always
5851         create a return label and jump to it.
5852         (Break, Continue): Do all error checking in Resolve(); also make
5853         sure we aren't leaving a `finally'.
5854         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
5855         statement in a top-level block.
5856         (Block.Flags): Added `IsDestructor'.
5857         (Block.IsDestructor): New public property.
5858
5859 2004-01-20  Martin Baulig  <martin@ximian.com>
5860
5861         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
5862
5863 2004-01-20  Martin Baulig  <martin@ximian.com>
5864
5865         * statement.cs (Statement.ResolveUnreachable): New public method.
5866         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
5867         (Block.Resolve): Resolve unreachable statements.
5868
5869 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5870
5871         * expression.cs: We need to fix the case where we do
5872         not have a temp variable here.
5873
5874         * assign.cs: Only expression compound assignments need
5875         temporary variables.
5876
5877 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5878
5879         * flowanalysis.cs: Reduce memory allocation in a few ways:
5880           - A block with no variables should not allocate a bit
5881             vector for itself.
5882           - A method with no out parameters does not need any tracking
5883             for assignment of the parameters, so we need not allocate
5884             any data for it.
5885           - The arrays:
5886                 public readonly Type[] VariableTypes;
5887                 public readonly string[] VariableNames;
5888             Are redundant. The data is already stored in the variable
5889             map, so we need not allocate another array for it.
5890           - We need to add alot of checks for if (params | locals) == null
5891             due to the first two changes.
5892
5893 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
5894
5895         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
5896         implement IMemoryLocation, we store a copy on a local variable and
5897         take the address of it.  Patch from Benjamin Jemlich
5898
5899         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
5900         to use a special "type_name_expression" rule which reduces the
5901         number of "QualifiedIdentifier" classes created, and instead
5902         directly creates MemberAccess expressions.
5903
5904 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
5905
5906         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
5907         that fixes #52853.  Null literal assignment to ValueType
5908
5909         * class.cs (MethodData.Emit): Instead of checking the name of the
5910         method to determine if its a destructor, create a new derived
5911         class from Method called Destructor, and test for that.  
5912
5913         * cs-parser.jay: Create a Destructor object instead of a Method.  
5914
5915         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
5916
5917         Fixes: 52933
5918
5919 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
5920
5921         * expression.cs (Binary.ResolveOperator): Perform an implicit
5922         conversion from MethodGroups to their delegate types on the
5923         Addition operation.
5924
5925         * delegate.cs: Introduce a new class DelegateCreation that is the
5926         base class for `NewDelegate' and `ImplicitDelegateCreation',
5927         factor some code in here.
5928
5929         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
5930         conversion from MethodGroups to compatible delegate types. 
5931
5932         * ecore.cs (Expression.Resolve): Do not flag error 654
5933         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
5934         we allow conversions from MethodGroups to delegate types now.
5935
5936         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
5937         assignments in v2 either.
5938
5939 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
5940
5941         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
5942         static read-only fields in ctors.
5943
5944         Applied patch from Benjamin Jemlich 
5945
5946         * expression.cs (UnaryMutator): Avoid leaking local variables. 
5947
5948 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
5949
5950         * cs-tokenizer.cs (IsCastToken): Allow the various native types
5951         here to return true, as they can be used like this:
5952
5953                 (XXX) int.MEMBER ()
5954
5955         Fixed 49836 and all the other dups
5956
5957 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
5958
5959         * driver.cs: Implement /win32res and /win32icon.
5960
5961 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
5962
5963         * cs-parser.jay: Add a rule to improve error handling for the
5964         common mistake of placing modifiers after the type.
5965
5966 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
5967
5968         * cs-parser.jay (interface_event_declaration): Catch
5969         initialization of events on interfaces, and report cs0068
5970
5971         * cs-parser.jay (interface_event_declaration): Catch
5972         initialization of events. 
5973
5974         * ecore.cs: Better report missing constructors.
5975
5976         * expression.cs (Binary.ResolveOperator): My previous bug fix had
5977         the error reporting done in the wrong place.  Fix.
5978
5979         * expression.cs (Binary.ResolveOperator): Catch the 
5980         operator + (E x, E y) error earlier, and later allow for implicit
5981         conversions in operator +/- (E e, U x) from U to the underlying
5982         type of E.
5983
5984         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
5985         52596, if the container class is abstract, the default constructor
5986         is protected otherwise its public (before, we were always public).
5987
5988         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
5989         fixed statement.
5990
5991         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
5992         Jemlich that fixes bug #52597, MCS was generating invalid code for
5993         idisposable structs.   Thanks to Ben for following up with this
5994         bug as well.
5995
5996 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
5997
5998         * driver.cs: Allow assemblies without code to be generated, fixes
5999         52230.
6000
6001 2004-01-07  Nick Drochak <ndrochak@gol.com>
6002
6003         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6004
6005 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6006
6007         * cs-parser.jay: Add rules to improve error reporting if fields or
6008         methods are declared at the namespace level (error 116)
6009
6010         * Add rules to catch event add/remove
6011
6012 2004-01-04  David Sheldon <dave-mono@earth.li>
6013
6014   * expression.cs: Added matching ")" to error message for 
6015   CS0077
6016
6017 2004-01-03 Todd Berman <tberman@gentoo.org>
6018
6019         * ecore.cs, attribute.cs:
6020         Applying fix from #52429.
6021
6022 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6023
6024         * ecore.cs, expression.cs, statement.cs:
6025         Total rewrite of how we handle branching. We
6026         now handle complex boolean expressions with fewer
6027         jumps. As well if (x == 0) no longer emits a ceq.
6028
6029         if (x is Foo) is much faster now, because we generate
6030         better code.
6031
6032         Overall, we get a pretty big improvement on our benchmark
6033         tests. The code we generate is smaller and more readable.
6034
6035         I did a full two-stage bootstrap. The patch was reviewed
6036         by Martin and Miguel.
6037
6038 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6039
6040         * cs-parser.jay: Make primary_expression not take a QI.
6041         we dont need this because the member_access rule covers
6042         us here. So we replace the rule with just IDENTIFIER.
6043
6044         This has two good effects. First, we remove a s/r conflict.
6045         Second, we allocate many fewer QualifiedIdentifier objects.
6046
6047 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6048
6049         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6050         set the correct information via SRE. This prevents
6051         hanging on the MS runtime. Fixes #29374.
6052
6053 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6054
6055         * convert.cs: correctly handle conversions to value types
6056         from Enum and ValueType as unboxing conversions.
6057
6058         Fixes bug #52569. Patch by Benjamin Jemlich.
6059
6060 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6061
6062         * expression.cs (BetterConversion): Prefer int -> uint
6063         over int -> ulong (csc's behaviour). This fixed bug #52046.
6064
6065 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6066
6067         * decl.cs (MemberCache.FindMembers): now returns a
6068         MemberInfo [].
6069
6070         * typemanager.cs: In general, go with with ^^.
6071         (CopyNewMethods): take an IList.
6072         (RealMemberLookup): Only allocate an arraylist
6073         if we copy from two sets of methods.
6074
6075         This change basically does two things:
6076         1) Fewer array lists allocated due to CopyNewMethods.
6077         2) the explicit cast in MemberList costed ALOT.
6078
6079 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6080
6081         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6082         a hashtable to avoid needless string allocations when an identifier is
6083         used more than once (the common case).
6084
6085 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6086
6087         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6088         is broken, it will not return anything. So, we
6089         have to use the information we have in mcs to
6090         do the task.
6091
6092         * typemanager.cs: Add a cache for GetInterfaces,
6093         since this will now be used more often (due to ^^)
6094
6095         (GetExplicitInterfaces) New method that gets the
6096         declared, not effective, interfaces on a type
6097         builder (eg, if you have interface IFoo, interface
6098         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6099         { IBar }.
6100
6101         This patch makes MCS able to bootstrap itself on
6102         Windows again.
6103
6104 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6105
6106         * expression.cs: Remove the Nop's that Miguel put
6107         in by mistake.
6108
6109 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6110
6111         * report.cs, codegen.cs: Give the real stack trace to
6112         the error when an exception is thrown.
6113
6114 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6115
6116         * decl.cs: only allocate hashtables for ifaces if 
6117         it is an iface!
6118
6119 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6120
6121         * expression.cs: fix the error from cs0121-2.cs
6122         (a parent interface has two child interfaces that
6123         have a function with the same name and 0 params
6124         and the function is called through the parent).
6125
6126 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6127
6128         * class.cs, rootcontext.cs, typmanager.cs: do not
6129         leak pointers.
6130
6131 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6132
6133         * codegen.cs: remove stack for the ec flow branching.
6134         It is already a linked list, so no need.
6135
6136 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6137
6138         * Makefile: Allow custom profiler here.
6139
6140 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6141
6142         * typemanager.cs (LookupType):
6143           - Use a static char [], because split takes
6144             a param array for args, so it was allocating
6145             every time.
6146           - Do not store true in a hashtable, it boxes.
6147
6148 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6149
6150         * flowanalysis.cs: bytify common enums.
6151
6152 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6153
6154         * modifiers.cs: Add a new set of flags for the
6155         flags allowed on explicit interface impls.
6156         * cs-parser.jay: catch the use of modifiers in
6157         interfaces correctly.
6158         * class.cs: catch private void IFoo.Blah ().
6159
6160         All related to bug #50572.
6161
6162 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6163
6164         * decl.cs: Rewrite the consistant accessability checking.
6165         Accessability is not linear, it must be implemented in
6166         a tableish way. Fixes #49704.
6167
6168 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6169
6170         * expression.cs: Handle negation in a checked context.
6171         We must use subtraction from zero. Fixes #38674.
6172
6173 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6174
6175         * class.cs: Ignore static void main in DLLs.
6176         * rootcontext.cs: Handle the target type here,
6177         since we are have to access it from class.cs
6178         * driver.cs: account for the above.
6179
6180 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6181
6182         * report.cs: Give line numbers and files if available.
6183
6184 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6185
6186         * driver.cs: Implement /addmodule.
6187
6188         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6189         ModuleBuilders.
6190
6191 2003-12-20  Martin Baulig  <martin@ximian.com>
6192
6193         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6194         (FieldBase.IsAssigned): Removed this field.
6195         (FieldBase.SetAssigned): New public method.
6196         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6197
6198 2003-12-20  Martin Baulig  <martin@ximian.com>
6199
6200         * expression.cs (LocalVariableReference.DoResolve): Don't set
6201         `vi.Used' if we're called from DoResolveLValue().
6202
6203         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6204         returns the usage vector it just merged into the current one -
6205         pass this one to UsageWarning().
6206         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6207         of the `EmitContext', don't call this recursively on our children.
6208
6209 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6210
6211         * driver.cs: Implement /target:module.
6212
6213 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6214
6215         * support.cs (CharArrayHashtable): New helper class.
6216
6217         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6218         char arrays, not strings, so we can avoid creating a string in
6219         consume_identifier if the identifier is a keyword.
6220
6221 2003-12-16  Martin Baulig  <martin@ximian.com>
6222
6223         * statement.cs (LocalInfo.Assigned): Removed this property.
6224         (LocalInfo.Flags): Removed `Assigned'.
6225         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6226         and uses flow analysis.
6227         (Block.UsageWarning): Made this method private.
6228         (Block.Resolve): Call UsageWarning() if appropriate.
6229
6230         * expression.cs (LocalVariableReference.DoResolve): Always set
6231         LocalInfo.Used here.
6232
6233 2003-12-13  Martin Baulig  <martin@ximian.com>
6234
6235         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6236         any value here; we're now using flow analysis to figure out
6237         whether a statement/block returns a value.
6238
6239 2003-12-13  Martin Baulig  <martin@ximian.com>
6240
6241         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6242         working again.
6243         (FlowBranching.MergeFinally): Don't call
6244         `branching.CheckOutParameters()' here, this is called in
6245         MergeTopBlock().
6246         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6247         when adding the `finally' vector.       
6248
6249 2003-12-13  Martin Baulig  <martin@ximian.com>
6250
6251         * flowanalysis.cs
6252         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6253         actually work and also fix #48962.
6254
6255 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6256
6257         * decl.cs: Do not check System.Object for nested types,
6258         since we know it does not have any. Big bang for buck:
6259
6260         BEFORE:
6261            Run 1:   8.35 seconds
6262            Run 2:   8.32 seconds
6263            corlib:  17.99 seconds
6264         AFTER:
6265            Run 1:   8.17 seconds
6266            Run 2:   8.17 seconds
6267            corlib:  17.39 seconds
6268
6269 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6270
6271         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6272         time we are returning 0 members, so we save alot here.
6273
6274 2003-12-11  Martin Baulig  <martin@ximian.com>
6275
6276         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6277         `MergeChild()', also just take the `FlowBranching' as argument;
6278         call Merge() on it and return the result.
6279         (FlowBranching.Merge): We don't need to do anything if we just
6280         have one sibling.
6281
6282 2003-12-11  Martin Baulig  <martin@ximian.com>
6283
6284         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6285         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6286         Maurer for this idea.
6287
6288 2003-12-11  Martin Baulig  <martin@ximian.com>
6289
6290         * flowanalysis.cs (MergeResult): This class is now gone; we now
6291         use the `UsageVector' for this.  The reason for this is that if a
6292         branching just has one sibling, we don't need to "merge" them at
6293         all - that's the next step to do.
6294         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6295         `MergeResult'.
6296
6297 2003-12-11  Martin Baulig  <martin@ximian.com>
6298
6299         Reworked flow analyis and made it more precise and bug-free.  The
6300         most important change is that we're now using a special `Reachability'
6301         class instead of having "magic" meanings of `FlowReturns'.  I'll
6302         do some more cleanups and optimizations and also add some more
6303         documentation this week.
6304
6305         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6306         largely reworked this class.
6307         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6308         the new `Reachability' class instead of having "magic" values here.
6309         (FlowBranching): We're now using an instance of `Reachability'
6310         instead of having separate `Returns', `Breaks' etc. fields.
6311
6312         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6313         based on flow analysis; ignore the return value of block.Emit ().
6314
6315 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6316
6317         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6318         if they are private.
6319
6320 2003-12-09  Martin Baulig  <martin@ximian.com>
6321
6322         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6323         call them directly on the UsageVector.
6324
6325 2003-12-09  Martin Baulig  <martin@ximian.com>
6326
6327         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6328         Changed return type from `FlowReturns' to `Reachability'.
6329
6330 2003-12-09  Martin Baulig  <martin@ximian.com>
6331
6332         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6333         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6334         `Reachable' fields with a single `Reachability' one.
6335
6336 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6337
6338         * class.cs (FindMembers): Remove foreach's.
6339
6340         Bootstrap times:
6341
6342         BEFORE
6343                 Run 1:   8.74 seconds
6344                 Run 2:   8.71 seconds
6345
6346         AFTER
6347                 Run 1:   8.64 seconds
6348                 Run 2:   8.58 seconds
6349
6350
6351 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6352
6353         * cs-parser.jay:
6354         * gen-treedump.cs:
6355         * statement.cs:
6356         This patch does a few things:
6357                 1. EmptyStatement is now a singleton, so it is never reallocated.
6358                 2. All blah is EmptyStatement constructs have been changed to
6359                    blah == EmptyStatement.Value, which is much faster and valid
6360                    now that EmptyStatement is a singleton.
6361                 3. When resolving a block, rather than allocating a new array for
6362                    the non-empty statements, empty statements are replaced with
6363                    EmptyStatement.Value
6364                 4. Some recursive functions have been made non-recursive.
6365         Mainly the performance impact is from (3), however (1) and (2) are needed for
6366         this to work. (4) does not make a big difference in normal situations, however
6367         it makes the profile look saner.
6368
6369         Bootstrap times:
6370
6371         BEFORE
6372         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6373         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6374         Total memory allocated: 56397 KB
6375
6376         AFTER
6377         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6378         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6379         Total memory allocated: 55666 KB
6380
6381 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6382
6383         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6384         than the hashtable in a hashtable version
6385
6386         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6387         we always end up concating a string. This results in a huge perf
6388         loss, because many strings have to be tracked by the GC. In this
6389         patch, we first use a hashtable that works with two keys, so that
6390         the strings do not need to be concat'ed.
6391
6392         Bootstrap times:
6393         BEFORE
6394                 Run 1:   8.74 seconds
6395                 Run 2:   8.71 seconds
6396
6397         AFTER
6398                 Run 1:   8.65 seconds
6399                 Run 2:   8.56 seconds
6400
6401 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6402
6403         * Makefile: Add a new target `do-time' that does a quick and simple
6404         profile, leaving easy to parse output.
6405
6406 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6407
6408         * codegen.cs (Init): Create the dynamic assembly with 
6409         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6410
6411 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6412
6413         * support.cs: Make the PtrHashtable use only one
6414         instance of its comparer.
6415
6416 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6417
6418         * typemanager.cs: Fix lookup of GetNamespaces.
6419
6420 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6421
6422         * expression.cs: Removed redundant line.
6423
6424         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6425         ArrayLists, use for loops with bounds.  
6426
6427         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6428         arraylist.
6429
6430         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6431         arraylists, use for loop with bounds.
6432
6433         The above three changes give us a 0.071 second performance
6434         improvement out of 3.294 seconds down to 3.223.  On my machine
6435         the above changes reduced the memory usage by 1,387 KB during
6436         compiler bootstrap.
6437
6438         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6439         QualifiedIdentifiers.  Before we created a new string through
6440         concatenation, and mostly later on, the result would be
6441         manipulated by DecomposeQI through string manipulation.
6442
6443         This reduced the compiler memory usage for bootstrapping from
6444         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6445         compile times in 0.05 seconds.
6446
6447 2003-11-28  Dick Porter  <dick@ximian.com>
6448
6449         * support.cs: Do string compares with the Invariant culture.
6450
6451         * rootcontext.cs: 
6452         * gen-treedump.cs: 
6453         * expression.cs: 
6454         * driver.cs: 
6455         * decl.cs: 
6456         * codegen.cs: 
6457         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6458         the comparison is done with the Invariant culture.
6459
6460 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6461
6462         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6463         GetEnumerator method.
6464
6465         (ProbeCollectionType): Iterate starting at the most specific type
6466         upwards looking for a GetEnumerator
6467
6468         * expression.cs: Shift count can be up to 31 for int/uint and 63
6469         for long/ulong.
6470
6471 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6472
6473         * statement.cs (Block.LookupLabel): Also look for the label on the
6474         children blocks.  Use a hash table to keep track of visited
6475         nodes. 
6476
6477         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6478         we actually did transform the other operand, otherwise fall back
6479         to the common codepath that casts to long.
6480
6481         * cs-tokenizer.cs: Use the same code pattern as the int case.
6482         Maybe I should do the parsing myself, and avoid depending on the
6483         Parse routines to get this done.
6484
6485 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6486
6487         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6488         which fixes bug 51347.  This time test it.
6489
6490         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6491         attributes for example can not tell the difference between these.
6492         The difference was only a syntax feature of the language. 
6493
6494         * attribute.cs: Apply attributes to delegates.
6495
6496         * delegate.cs: Call the apply attributes method.
6497
6498 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6499
6500         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6501         comparing 0 vs Byte.MinValue, not the value
6502
6503         (ImplicitConversionRequired): When reporting a conversion error,
6504         use error 31 to print out the constant error instead of the
6505         simpler 29.
6506
6507         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6508         which fixes bug 51347.
6509
6510 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6511
6512         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6513         which fixes the -warnaserror command line option.
6514
6515 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6516
6517         * cfold.cs (DoNumericPromotions): During constant folding of
6518         additions on UIntConstant, special case intconstants with
6519         IntConstants like we do on the expression binary operator. 
6520
6521 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6522
6523         * convert.cs (ImplicitReferenceConversion): We were missing a case
6524         (System.Enum are not value types or class types, so we need to
6525         classify them separatedly).
6526
6527         * driver.cs: We do not support error 2007.
6528
6529 2003-11-12 Jackson Harper <jackson@ximian.com>
6530
6531         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6532         system directory. Also use the full file name so users can
6533         libraries names mscorlib-o-tron.dll in a non system dir.
6534         
6535 2004-01-04  David Sheldon <dave-mono@earth.li>
6536
6537         * expression.cs: Added matching ")" to error message for CS0077.
6538
6539 2003-12-19  Martin Baulig  <martin@ximian.com>
6540
6541         * typemanager.cs (TypeManager.IsEqualGenericType): New public
6542         static method; see documentation in the method.
6543         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
6544
6545         * convert.cs (Convert.ImplicitReferenceConversion,
6546         Convert.ImplicitReferenceConversionExists): Add support for
6547         generic type declarations; see gen-36.cs.
6548
6549 2003-12-19  Martin Baulig  <martin@ximian.com>
6550
6551         * pending.cs (Pending.InterfaceMethod): Use
6552         `Type.IsAssignableFrom()' instead of `=='.
6553
6554 2003-12-18  Martin Baulig  <martin@ximian.com>
6555
6556         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
6557         byref types first.
6558
6559         * convert.cs (Convert.ImplicitStandardConversionExists): Use
6560         `expr_type.Equals (target_type)' instead of `=='.
6561
6562 2003-12-08  Martin Baulig  <martin@ximian.com>
6563
6564         * generics.cs (Constraints.Types): Removed.
6565         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
6566         to Type's.
6567         (Constraints.ResolveTypes): New public method; resolves the
6568         TypeExpr's to Type's.
6569         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
6570         longer takes the constraints.
6571         (TypeParameter.DefineMethod): Likewise.
6572         (TypeParameter.DefineType): New public method.  Calls
6573         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
6574         the constraints.
6575
6576 2003-12-08  Martin Baulig  <martin@ximian.com>
6577
6578         * convert.cs (Convert.ImplicitConversionStandard): Use
6579         `expr_type.Equals (target_type)' instead of `=='.
6580
6581 2003-12-08  Martin Baulig  <martin@ximian.com>
6582
6583         * typemanager.cs (TypeManager.GetReferenceType): Call
6584         `Type.MakeByRefType ()'.
6585
6586 2003-12-08  Martin Baulig  <martin@ximian.com>
6587
6588         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
6589         just has some special meaning in some situations.  For instance,
6590         it is allowed to use `where' as the name of a variable etc.
6591
6592 2003-12-04  Martin Baulig  <martin@ximian.com>
6593
6594         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6595         `Type.MakeArrayType()' for array types.
6596
6597 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
6598
6599         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
6600         debugging message.
6601
6602         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
6603         corlib to compile.
6604
6605 2003-11-16  Martin Baulig  <martin@ximian.com>
6606
6607         * codegen.cs (EmitContext.IsGeneric): Removed.
6608
6609         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
6610         ResolveGeneric() on the DeclSpace.
6611
6612 2003-11-16  Martin Baulig  <martin@ximian.com>
6613
6614         * generic.cs (TypeArguments.Resolve):
6615         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
6616         `ResolveType()' on it to get the Type.
6617
6618 2003-11-15  Martin Baulig  <martin@ximian.com>
6619
6620         * generic.cs (ConstructedType.GetInterfaces): Override this.
6621
6622 2003-11-14  Martin Baulig  <martin@ximian.com>
6623
6624         * interface.cs (Interface.DefineType): Define all type parameters
6625         before adding the interfaces we inherit.
6626
6627 2003-11-11  Martin Baulig  <martin@ximian.com>
6628
6629         * generic.cs (ConstructedType.ResolveType): Always call
6630         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
6631
6632 2003-11-10  Martin Baulig  <martin@ximian.com>
6633
6634         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6635         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6636         calling `ResolveType()' on them, directly assign their `Type'.
6637
6638 2003-11-08  Martin Baulig  <martin@ximian.com>
6639
6640         * generic.cs (ConstructedType): Override `IsClass' etc.
6641
6642 2003-11-08  Martin Baulig  <martin@ximian.com>
6643
6644         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6645         return value and the `out parent' parameter.
6646         (TypeContainer.DefineType): Moved the CS0644 check into
6647         GetClassBases().  Don't pass the interface types to the
6648         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6649         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6650
6651         * ecore.cs (TypeExpr.IsAttribute): New property.
6652         (TypeExpr.GetInterfaces): New method.
6653
6654         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6655         TypeExpr instead of a Type.
6656         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6657         (Interface.DefineType): Don't pass the interface types to the
6658         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6659         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6660
6661         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6662         instead of a `Type[]'.
6663         (TypeManager.RegisterBuilder): Likewise.
6664         (TypeManager.AddUserInterface): Likewise.
6665         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6666         `Type[]' and also return a `TypeExpr[]'.
6667         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6668
6669 2003-11-08  Martin Baulig  <martin@ximian.com>
6670
6671         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6672         Expression.     
6673
6674 2003-11-08  Martin Baulig  <martin@ximian.com>
6675
6676         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6677         TypeManager.ResolveExpressionTypes().
6678
6679         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6680         instead of an Expression.
6681         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6682         (TypeExpression): New public class; formerly known as `TypeExpr'.
6683
6684         * expression.cs (ComposedCast): Derive from TypeExpr.
6685
6686         * typemanager.cs (TypeManager.system_*_expr): These are now
6687         TypExpr's instead of Expression's.
6688         (TypeManager.ResolveExpressionTypes): New public static function;
6689         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6690         of them.        
6691
6692 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6693
6694         * expression.cs (New.DoResolve): Do not dereference value that
6695         might be a null return.
6696
6697         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6698         sure that the constant value has the right type.  Fixes an
6699         unreported bug, similar to 50425.
6700
6701         * const.cs (Const.LookupConstantValue): Call
6702         ImplicitStandardConversionExists before doing a conversion to
6703         avoid havng the TypeManager.ChangeType do conversions.
6704
6705         Reduced the number of casts used
6706
6707         (Const.ChangeType): New routine to enable reuse of the constant
6708         type changing code from statement.
6709
6710         * typemanager.cs (ChangeType): Move common initialization to
6711         static global variables.
6712
6713         Fixes #50425.
6714
6715         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6716         every value type to go through, even if it was void.  Fix that. 
6717
6718         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6719         character of the define, and the is_identifier_part_character for
6720         the rest of the string.
6721
6722 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6723
6724         * expression.cs (UnaryMutator.EmitCode): When I updated
6725         LocalVariableReference.DoResolve, I overdid it, and dropped an
6726         optimization done on local variable references.
6727
6728 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6729
6730         * ecore.cs: Convert the return from Ldlen into an int.
6731
6732 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6733
6734         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6735         the accessibility, this is a special case for toplevel non-public
6736         classes (internal for instance).
6737
6738 2003-10-20  Nick Drochak <ndrochak@gol.com>
6739
6740         * ecore.cs: Fix typo and build.  Needed another right paren.
6741
6742 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6743
6744         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6745         `internal' case regular and protected, but not allowing protected
6746         to be evaluated later.  Bug 49840
6747
6748 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6749
6750         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6751         to kb.Nlast, and not the kb.nFirst to isolate the switch
6752         statement.
6753
6754         Extract the underlying type, so enumerations of long/ulong are
6755         treated like long/ulong.
6756
6757 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6758
6759         * expression.cs (New): Overload the meaning of RequestedType to
6760         track the possible creation of the NewDelegate type, since
6761         DoResolve is invoked more than once for new constructors on field
6762         initialization.
6763
6764         See bugs: #48800 and #37014
6765
6766         * cs-parser.jay (declare_local_constants): Take an arraylist
6767         instead of a single constant.
6768
6769         (local_constant_declaration): It should take a
6770         constant_declarators, not a constant_declarator.  Fixes 49487
6771
6772         * convert.cs: Fix error report.
6773
6774 2003-10-13 Jackson Harper <jackson@ximian.com>
6775
6776         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6777         bug #49611
6778         
6779 2003-11-03  Martin Baulig  <martin@ximian.com>
6780
6781         * expression.cs (ArrayAccess.GetStoreOpcode): Added
6782         `out bool has_type_arg'; if set, we need to pass the type to
6783         ig.Emit().
6784         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
6785         Stelem_Any/Ldelem_Any for generic parameters.   
6786
6787 2003-11-02  Martin Baulig  <martin@ximian.com>
6788
6789         * expression.cs (Invocation.EmitCall): Use
6790         `TypeManager.IsValueType()' to check whether it's a value type.
6791         Don't set `struct_call' when calling a method on a type parameter.
6792
6793 2003-11-02  Martin Baulig  <martin@ximian.com>
6794
6795         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
6796         and removed the TypeBuilder argument.
6797
6798         * typemanager.cs (TypeManager.IsValueType): Return
6799         `t.IsGenericParameter || t.IsValueType'.
6800
6801 2003-10-25  Martin Baulig  <martin@ximian.com>
6802
6803         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
6804         call ConstructedType.Resolve() on it.
6805
6806         * generic.cs (ConstructedType.Resolve): Set `type' on success.
6807
6808 2003-10-25  Martin Baulig  <martin@ximian.com>
6809
6810         * class.cs (TypeContainer.GetClassBases): Changed
6811         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
6812         CS8214 reporting here.
6813         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
6814         instead of a `Type' for our parent.  In case of a recursive
6815         declaration (see tests/gen-23.cs for an example), our parent is a
6816         ConstructedType and it doesn't have its type set.  So, first
6817         create our own TypeBuilder, then call constructed.Resolve() to get
6818         the parent's type and finally TypeBuilder.SetParent() it.
6819
6820         * ecore.cs (TypeExpr.Name): New public virtual property.
6821
6822         * generic.cs
6823         (ConstructedType): We're now a TypeExpr and not just an Expression.
6824         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
6825         arguments here; this is done later.
6826         (ConstructedType.Resolve): New public method to resolve the type
6827         arguments and bind them.
6828
6829 2003-10-21  Martin Baulig  <martin@ximian.com>
6830
6831         * convert.cs: Use `TypeManager.IsValueType' instead of
6832         'type.IsValueType' everywhere.
6833
6834         * typemanager.cs (TypeManager.IsValueType): Return true for type
6835         parameters.  The reason for this is that we need to box a type
6836         parameter when converting it to a reference type.
6837
6838         * cs-parser.jay: Added support for default value expressions.
6839
6840         * generics.cs (DefaultValueExpression): New public class.       
6841
6842 2003-10-17  Martin Baulig  <martin@ximian.com>
6843
6844         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
6845         TypeContainer so we can also use this for Interfaces.
6846         (TypeParameter.Resolve): Likewise.
6847
6848         * interface.cs (Interface.DefineType): Added support for generic
6849         interfaces.
6850
6851         * cs-parser.jay: Added support for generic structs and interfaces.
6852
6853 2003-10-17  Martin Baulig  <martin@ximian.com>
6854
6855         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
6856         call generic methods :-)
6857
6858 2003-10-16  Martin Baulig  <martin@ximian.com>
6859
6860         * cs-parser.jay (namespace_or_type_name): Only create a
6861         GenericMemberAccess if we actually have type arguments.
6862
6863 2003-10-13  Martin Baulig  <martin@ximian.com>
6864
6865         * class.cs (Method.Define): If we're a generic method, call
6866         TypeBuilder.DefineGenericMethod () before resolving
6867         the parameters.
6868         (MethodData): Added .ctor which takes an additional MethodBuilder
6869         argument; this is used for generic methods.
6870         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
6871         we already have a MethodBuilder.
6872
6873 2003-10-10  Martin Baulig  <martin@ximian.com>
6874
6875         * class.cs (Method): Added .ctor which takes a `GenericMethod'
6876         instead of a `DeclSpace'.  This is used for generic methods.
6877
6878         * cs-parser.jay (method_header): Added support for generic
6879         methods; create a `GenericMethod' instance and pass it to the
6880         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
6881         parameters and locals.
6882
6883         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
6884         since we already have the location.  Check whether we're a generic
6885         type declaration or a generic method and create the correct type
6886         parameter.
6887
6888         * generic.cs (TypeParameter.DefineMethod): New public method.
6889         (GenericMethod): New public class; derives from DeclSpace and is
6890         used for generic methods.       
6891
6892 2003-10-09  Martin Baulig  <martin@ximian.com>
6893
6894         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6895         to the .ctor.
6896         (MethodCore.DoDefineParameters): Removed the TypeContainer
6897         argument; use the DeclSpace which was passed to the .ctor instead.
6898         (MethodCore.CheckParameter): Take a DeclSpace instead of a
6899         TypeContainer; we only need a DeclSpace here.
6900
6901 2003-10-09  Martin Baulig  <martin@ximian.com>
6902
6903         * class.cs (MethodData): Added additional `DeclSpace ds' argument
6904         to the .ctor.
6905         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6906         EmitContext's .ctor.    
6907
6908 2003-10-09  Martin Baulig  <martin@ximian.com>
6909
6910         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
6911         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
6912         AsAccessible(), moved them as well.
6913
6914         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
6915
6916 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
6917
6918         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
6919         generation for >=, as spotted by Paolo, bug 48679.  
6920         Patch from David Waite.
6921
6922         * cs-tokenizer.cs: Add handling for #pragma.
6923
6924         * cs-parser.jay: Allow for both yield and yield return in the
6925         syntax.  The anti-cobolization of C# fight will go on!
6926
6927         * class.cs (TypeBuilder.DefineType): Catch error condition here
6928         (Parent.DefineType erroring out and returning null).
6929
6930         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
6931         coping with enumerations variables, we were mistakenly processing
6932         them as a regular value type instead of built-in types.  Fixes the
6933         bug #48063
6934
6935         * typemanager.cs (IsBuiltinOrEnum): New method.
6936
6937 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
6938
6939         * cs-parser.jay: Upgrade: yield now needs the return clause.
6940
6941 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
6942
6943         * cs-parser.jay : Renamed yyName to yyNames related to jay.
6944
6945 2003-09-29  Martin Baulig  <martin@ximian.com>
6946
6947         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
6948         inflated generic methods.
6949
6950         * generics.cs (ConstructedType): Distinguish between open and
6951         closed constructed types; correctly resolve the arguments.
6952
6953 2003-09-22  Martin Baulig  <martin@ximian.com>
6954
6955         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
6956         all type arguments meet their constraints.
6957
6958 2003-09-19  Martin Baulig  <martin@ximian.com>
6959
6960         * decl.cs (MemberCache.SetupCacheForInterface): Take a
6961         `MemberCache parent' argument.  Normally, an interface doesn't
6962         have a parent type except System.Object, but we use this in gmcs
6963         for generic type parameters.
6964
6965 2003-09-18  Martin Baulig  <martin@ximian.com>
6966
6967         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
6968         on `type.IsInterface'; don't check whether the type has a parent
6969         to determine whether it's an interface.
6970
6971 2003-09-17  Martin Baulig  <martin@ximian.com>
6972
6973         * generic.cs (ConstructedType.ToString): Always use `name' as the
6974         type name.
6975
6976 2003-09-15  Martin Baulig  <martin@ximian.com>
6977
6978         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
6979
6980         * generic.cs (Constraints.Resolve): New public method; this is
6981         called to resolve the constraint types and to check whether all
6982         the constraints are correct.
6983         (Constraints.Types): New public property.
6984         (TypeParameter.Resolve): New public method; resolves all the
6985         type's constraints.
6986
6987         * class.cs (TypeContainer.DefineType): Call
6988         TypeParameter.Resolve() before actually defining the type.
6989
6990 2003-09-15  Martin Baulig  <martin@ximian.com>
6991
6992         * class.cs (TypeContainer.DefineType): Added an error flag to
6993         avoid reporting duplicate CS0146's ("class definition is
6994         circular.").
6995
6996         * driver.cs (Driver.MainDriver): Abort if
6997         RootContext.ResolveTree() reported any errors.
6998
6999 2003-09-07  Martin Baulig  <martin@ximian.com>
7000
7001         * report.cs (Error, Warning): Added overloaded versions which take
7002         a `params object[] args' and call String.Format().
7003
7004 2003-09-07  Martin Baulig  <martin@ximian.com>
7005
7006         * decl.cs (DeclSpace..ctor): Don't call
7007         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7008         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7009         (DeclSpace.RecordDecl): New method.
7010
7011         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7012
7013 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7014
7015         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7016         value attributes to be applied to ParameterBuilders.
7017
7018         * class.cs (MethodCore.LabelParameters): Make static and more
7019         generic so that it can be used from other places - like interface
7020         methods, for instance.
7021
7022         * interface.cs (Interface.Emit): Call LabelParameters before
7023         emitting attributes on the InterfaceMethod.
7024
7025 2003-09-07  Martin Baulig  <martin@ximian.com>
7026
7027         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7028         if the number of type parameters doesn't match.
7029
7030 2003-09-04  Martin Baulig  <martin@ximian.com>
7031
7032         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7033         for arrays of generic type params (ie. `!0[]').
7034
7035 2003-09-04  Martin Baulig  <martin@ximian.com>
7036
7037         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7038         for the moment.
7039
7040 2003-09-04  Martin Baulig  <martin@ximian.com>
7041
7042         * decl.cs (DeclSpace.LookupGeneric): New method.
7043         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7044         moment.
7045
7046         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7047         argument, not just a string.
7048         (TypeParameter.Define): New public method; this is called to
7049         actually define the generic parameter; after this, you can use the
7050         new `Type' property to get the type.
7051
7052 2003-09-04  Martin Baulig  <martin@ximian.com>
7053
7054         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7055         is now an ArrayList; initialize the result of the `TypeParameters'
7056         property here.
7057         (DeclSpace.GetGenericData): Removed.
7058         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7059         implement this in a different way.
7060         (DeclSpace.GetTypeParameters): Removed; there's now a
7061         `TypeParameters' property.
7062         (DeclSpace.TypeParameters): New public property.
7063
7064         * generic.cs (Constraints): Make this class public.
7065         (TypeParameter): New public class.
7066
7067 2003-09-04  Martin Baulig  <martin@ximian.com>
7068
7069         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7070         generic parameters.
7071
7072         * class.cs (TypeContainer.DefineType): Call
7073         TypeBuilder.DefineGenericParameter () on all generic parameters if
7074         this is a generic type.
7075
7076 2003-08-28  Martin Baulig  <martin@ximian.com>
7077
7078         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7079         sample-stack.il".
7080
7081         * sample-hello.cs: Compile this with gmcs: "gmcs
7082         /r:sample-stack.dll sample-hello.cs".
7083
7084 2003-08-28  Martin Baulig  <martin@ximian.com>
7085
7086         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7087         the parameters to the generic type.
7088
7089 2003-08-28  Martin Baulig  <martin@ximian.com>
7090
7091         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7092
7093 2003-08-28  Martin Baulig  <martin@ximian.com>
7094
7095         * cs-parser.jay (opt_type_argument_list): Use
7096         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7097         (primary_expression): Replace `qualified_identifier' with `type_name'.
7098         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7099
7100         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7101         parser to check whether it is syntactically a type parameter list;
7102         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7103         this case.
7104
7105 2003-08-26  Martin Baulig  <martin@ximian.com>
7106
7107         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7108         resolving aliases; fixes #47927.
7109
7110 2003-08-26  Martin Baulig  <martin@ximian.com>
7111
7112         * statement.cs (Using.DoResolve): This is internally emitting a
7113         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7114         do not always return.  Fixes #47681.
7115
7116 2003-08-26  Martin Baulig  <martin@ximian.com>
7117
7118         * decl.cs (MemberCore): Moved WarningNotHiding(),
7119         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7120         into MemberBase.
7121         (AdditionResult): Make this nested in DeclSpace.
7122         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7123         argument; call NamespaceEntry.Define() unless we're nested in a
7124         class or struct.
7125
7126         * namespace.cs (Namespace.DefineName): New public function.  This
7127         is called from DeclSpace's .ctor to add 
7128         (Namespace.Lookup): Include DeclSpaces in the lookup.
7129
7130         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7131
7132         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7133
7134 2003-08-25  Martin Baulig  <martin@ximian.com>
7135
7136         * convert.cs (Convert.ExplicitReferenceConversion): When
7137         converting from an interface type to a class, unbox if the target
7138         type is a struct type.  Fixes #47822.
7139
7140 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7141
7142         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7143         #47854.
7144
7145 2003-08-22  Martin Baulig  <martin@ximian.com>
7146
7147         * class.cs (TypeManager.DefineType): When defining a nested type,
7148         call DefineType() on our parent; fixes #47801.
7149
7150 2003-08-22  Martin Baulig  <martin@ximian.com>
7151
7152         * class.cs (MethodData.Define): While checking if a method is an
7153         interface implementation, improve the test a bit more to fix #47654.
7154
7155 2003-08-22  Martin Baulig  <martin@ximian.com>
7156
7157         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7158         correctly; fixes #47722.
7159
7160 2003-08-22  Martin Baulig  <martin@ximian.com>
7161
7162         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7163         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7164
7165         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7166
7167 2003-08-22  Martin Baulig  <martin@ximian.com>
7168
7169         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7170         can only be assigned in static constructors.  Fixes #47161.
7171
7172 2003-08-22  Martin Baulig  <martin@ximian.com>
7173
7174         Rewrote and improved the flow analysis code.
7175
7176         * flowbranching.cs (FlowBranching): Make this class abstract.
7177         (FlowBranching.CreateBranching): New static function to create a
7178         new flow branching.
7179         (FlowBranchingBlock, FlowBranchingException): New classes.
7180         (FlowBranching.UsageVector.Type): New public readonly field.
7181         (FlowBranching.UsageVector.Breaks): Removed the setter.
7182         (FlowBranching.UsageVector.Returns): Removed the setter.
7183         (FlowBranching.UsageVector): Added Break(), Return(),
7184         NeverReachable() and Throw() methods to modify the reachability.
7185         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7186         done by FlowBranching.Merge().
7187         (FlowBranching.UsageVector.MergeChild): New method; merges the
7188         merge result into the current vector.
7189         (FlowBranching.Merge): New abstract method to merge a branching.
7190
7191 2003-08-12  Martin Baulig  <martin@ximian.com>
7192
7193         * expression.cs (Indirection.CacheTemporaries): Create the
7194         LocalTemporary with the pointer type, not its element type.
7195
7196 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7197
7198         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7199         token was a keyword or not.
7200
7201         Add `error' options where an IDENTIFIER was expected;  Provide
7202         CheckToken and CheckIdentifierToken convenience error reporting
7203         functions. 
7204
7205         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7206
7207         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7208         NameSpaceEntry NameSpaceEntry.
7209
7210         (LookupInterfaceOrClass): Avoid creating a full qualified name
7211         from namespace and name: avoid doing lookups when we know the
7212         namespace is non-existant.   Use new Tree.LookupByNamespace which
7213         looks up DeclSpaces based on their namespace, name pair.
7214
7215         * driver.cs: Provide a new `parser verbose' to display the
7216         exception thrown during parsing.  This is turned off by default
7217         now, so the output of a failure from mcs is more graceful.
7218
7219         * namespace.cs: Track all the namespaces defined in a hashtable
7220         for quick lookup.
7221
7222         (IsNamespace): New method
7223
7224 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7225
7226         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7227         we know that we need to concatenate (full typename can never be
7228         null). 
7229
7230         * class.cs: ditto.
7231
7232         * statement.cs: Use a bitfield;  Do not initialize to null things
7233         which are done by the constructor by default.
7234
7235         * cs-parser.jay: bug fix, parameter was 4, not 3.
7236
7237         * expression.cs: Just use the property;
7238
7239         * statement.cs: No need for GetVariableInfo method.
7240
7241 2003-08-08  Martin Baulig  <martin@ximian.com>
7242
7243         * flowanalysis.cs (FlowReturns): This is now nested in the
7244         `FlowBranching' class.
7245         (MyBitVector): Moved this here from statement.cs.
7246         (FlowBranching.SiblingType): New enum type.
7247         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7248
7249 2003-08-07  Martin Baulig  <martin@ximian.com>
7250
7251         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7252         `FlowBranching' class and called `BranchingType'.
7253
7254 2003-08-07  Martin Baulig  <martin@ximian.com>
7255
7256         * flowanalysis.cs: Moved all the control flow analysis code into
7257         its own file.
7258
7259 2003-08-07  Martin Baulig  <martin@ximian.com>
7260
7261         * assign.cs (Assign.DoResolve): `target' must either be an
7262         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7263         #37319.
7264
7265 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7266
7267         * expression.cs (BinaryMethod): This kind of expression is created by the
7268         Binary class if it determines that the operator has to be handled
7269         by a method.
7270
7271         (BinaryDelegate): This kind of expression is created if we are
7272         dealing with a + or - operator on delegates.
7273
7274         (Binary): remove method, argumetns, and DelegateOperator: when
7275         dealing with methods, 
7276
7277         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7278
7279         * statement.cs (Block): use bitfields for the three extra booleans
7280         we had in use.   Remove unused topblock parameter.
7281
7282         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7283
7284         * assign.cs: Drop extra unneeded tests.
7285
7286 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7287
7288         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7289
7290         * statement.cs (Foreach): Use VariableStorage instead of
7291         LocalBuilders.   
7292
7293         * codegen.cs (VariableStorage): New class used by clients that
7294         require a variable stored: locals or fields for variables that
7295         need to live across yield.
7296
7297         Maybe provide a convenience api for EmitThis+EmitLoad?
7298
7299         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7300         these bad boys.
7301
7302 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7303
7304         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7305         RemapParameterLValue): New methods that are used to turn a
7306         precomputed FieldInfo into an expression like this:
7307
7308                 instance.FieldInfo
7309
7310         The idea is to use this instead of making LocalVariableReference
7311         have more than one meaning.
7312
7313         * cs-parser.jay: Add error production to BASE.
7314
7315         * ecore.cs: Deal with TypeManager.GetField returning null, which
7316         is now a valid return value.
7317
7318         (FieldExprNoAddress): New expression for Fields whose address can
7319         not be taken.
7320
7321         * expression.cs (LocalVariableReference): During the resolve
7322         phases, create new expressions if we are in a remapping context.
7323         Remove code that dealt with remapping here.
7324
7325         (ParameterReference): same.
7326
7327         (ProxyInstance): New expression, like the `This' expression, but
7328         it is born fully resolved.  We know what we are doing, so remove
7329         the errors that are targeted to user-provided uses of `this'.
7330
7331         * statement.cs (Foreach): our variable is now stored as an
7332         Expression;  During resolution, follow the protocol, dont just
7333         assume it will return this.
7334
7335 2003-08-06  Martin Baulig  <martin@ximian.com>
7336
7337         * support.cs (SeekableStreamReader.cs): New public class.
7338
7339         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7340         SeekableStreamReader instead of the normal StreamReader.
7341
7342 2003-08-04  Martin Baulig  <martin@ximian.com>
7343
7344         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7345         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7346         deambiguate casts and delegate invocations.
7347         (parenthesized_expression): Use the new tokens to ensure this is
7348         not a cast of method invocation.
7349
7350         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7351         when reading a `)' and Deambiguate_CloseParens () was previously
7352         called.
7353
7354         * expression.cs (ParenthesizedExpression): New class.  This is
7355         just used for the CS0075 test.
7356         (Binary.DoResolve): Check for CS0075.   
7357
7358 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7359
7360         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7361         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7362         reference comparison.
7363
7364         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7365         examine the ReturnType for equality - this is necessary in the
7366         cases of implicit and explicit operators whose signature also
7367         includes the return type.
7368
7369 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7370
7371         * namespace.cs: Cache the result of the namespace computation,
7372         instead of computing it every time.
7373
7374 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7375
7376         * decl.cs: Use a global arraylist that we reuse over invocations
7377         to avoid excesive memory consumption.  Reduces memory usage on an
7378         mcs compile by one meg (45 average).
7379
7380         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7381         private, work around that.
7382
7383 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7384
7385         * literal.cs (IntLiteral): Define Zero and One static literals. 
7386
7387         * cs-parser.jay (integer_literal): use static literals to reduce
7388         memory usage for the most used literals (0, 1 and -1).  211kb
7389         reduced in memory usage.
7390
7391         Replace all calls to `new ArrayList' with `new
7392         ArrayList(4)' which is a good average number for most allocations,
7393         and also requires only 16 bytes of memory for its buffer by
7394         default. 
7395
7396         This reduced MCS memory usage in seven megabytes for the RSS after
7397         bootstrapping.
7398
7399 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7400
7401         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7402         handle params methods the correct way by forming only one
7403         applicable set with params and normal methods in them. Earlier we
7404         were looking at params methods only if we found no normal methods
7405         which was not the correct thing to do.
7406
7407         (Invocation.BetterFunction): Take separate arguments indicating
7408         when candidate and the best method are params methods in their
7409         expanded form.
7410
7411         This fixes bugs #43367 and #46199.
7412
7413         * attribute.cs: Documentation updates.
7414
7415         (CheckAttribute): Rename to CheckAttributeTarget.
7416         (GetValidPlaces): Rename to GetValidTargets.
7417
7418         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7419         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7420
7421         Fixes bug #44468.
7422
7423 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7424
7425         * codegen.cs: Compute IsGeneric correctly.
7426
7427         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7428         resolution. 
7429
7430         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7431         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7432         regressions, and I was chasing more bugs than I required.
7433
7434         * interface.cs: Use expressions for base type names (like classes
7435         and structs have been doing for a while now), and resolve that.
7436         This patch should probably go into head as well.
7437
7438         This makes it one less user of FindType.
7439
7440 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7441
7442         This compiler can not self host currently.  Need to fix that.
7443         
7444         * Makefile: compile to `gmcs.exe'
7445
7446         * driver.cs: Turn on v2 by default on gmcs.
7447
7448         * generic.cs (ConstructedType): Does no longer take a container
7449         type argument;  That will be taken care of later.
7450
7451         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
7452         Use SimpleName to resolve for now, so we can continue the work on
7453         the parser, until we get Type.GetType that understands generics.
7454
7455         (ConstructedType.ToString): Implement
7456
7457         (TypeArguments.Resolve): Resolve the child expressions as types. 
7458         
7459         * cs-parser.jay: Rename interface_constraints to
7460         type_parameter_constraints
7461
7462         (namespace_or_type_name): Only use constructed types for the basic
7463         construction, we will deal with identifier<...> later.
7464
7465         (type/type_name): No longer call DecomposeQI, as
7466         namespace_or_type_name is always decoded now.
7467         
7468 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7469
7470         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7471         closely: we eliminate methods in base types when we have an
7472         applicable method in a top-level type.
7473
7474         Please see section 14.5.5.1 for an exact description of what goes
7475         on. 
7476
7477         This fixes bug #45127 and a host of other related to corlib compilation.
7478
7479         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7480         array is the method corresponding to the top-level type (this is
7481         because of the changes made to icall.c) so we change this
7482         accordingly.
7483
7484         (MethodGroupExpr.Name): This too.
7485
7486         * typemanager.cs (GetElementType): New method which does the right
7487         thing when compiling corlib. 
7488
7489         * everywhere: Make use of the above in the relevant places.
7490
7491 2003-07-22  Martin Baulig  <martin@ximian.com>
7492
7493         * cs-parser.jay (invocation_expression): Moved
7494         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7495         `cast_expression', but create a InvocationOrCast which later
7496         resolves to either an Invocation or a Cast.
7497
7498         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7499         method; call this before EmitStatement() to make sure that this
7500         expression can be used as a statement.
7501
7502         * expression.cs (InvocationOrCast): New class; resolves to either
7503         an Invocation or a Cast.
7504
7505         * statement.cs (StatementExpression): Call ResolveStatement() on
7506         the ExpressionStatement before emitting it.
7507
7508 2003-07-21  Martin Baulig  <martin@ximian.com>
7509
7510         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7511         `ref' and `out' attributes match; fixes #46220.
7512         (MemberAccess.ResolveMemberAccess): You can't reference a type
7513         through an expression; fixes #33180.
7514         (Indexers.GetIndexersForType): Don't return the indexers from
7515         interfaces the class implements; fixes #46502.
7516
7517 2003-07-21  Martin Baulig  <martin@ximian.com>
7518
7519         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7520         CS0661 checks; fixes bug #30442.
7521
7522 2003-07-21  Martin Baulig  <martin@ximian.com>
7523
7524         * decl.cs (AdditionResult): Added `Error'.
7525
7526         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7527
7528         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
7529         cs0031.cs actually work.
7530
7531  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7532  
7533         * cs-parser.jay (namespace_name): do not use
7534         namespace_or_type_name, use qualified_identifier, because
7535         namespace_or_type_name will soon return a composed expression
7536         instead of a string.
7537  
7538         (namespace_or_type_name): Instead of returning a string, now this
7539         production returns an expression.
7540  
7541         * codegen.cs (EmitContext): Setup IsGeneric property based on
7542         whether our DeclSpace is generic, our the method is generic.
7543  
7544         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
7545         the method is generic.
7546  
7547         * cs-parser.jay (type_arguments, opt_type_argument_list,
7548         type_parameters, type_parameter_list, opt_type_parameter_list,
7549         type_parameter,, opt_type_parameter_constraints_clauses,
7550         type_parameter_constraints_clauses,
7551         type_parameter_constraint_clause, type_parameter_constraint,
7552         interface_constraints): Add new production
7553  
7554         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
7555         DeclSpace is generic or not.
7556  
7557         (DeclSpace.SetParameterInfo): New routine, used to set the
7558         parameter info for a type.
7559  
7560         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
7561         returns a GenericTypeExpr
7562  
7563         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
7564         generic, lookup the generic argument.
7565  
7566         * attribute.cs: Do not allow TypeParameterExpressions in
7567         Attributes.
7568  
7569         * class.cs: Do not allow the Main method to be defined in a
7570         Generic container.
7571  
7572         * expression.cs (SizeOf): Do not allow generic types to be used as
7573         arguments to sizeof.
7574  
7575         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
7576         it: whether a type is generic or not.  Only works for types we are
7577         currently building for now.
7578         
7579 2003-07-20  Martin Baulig  <martin@ximian.com>
7580
7581         * namespace.cs: Fixed that bug which caused a crash when compiling
7582         the debugger's GUI.
7583
7584 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7585
7586         * typemanager.cs (LookupTypeReflection): Never expose types which
7587         are NotPublic, NestedPrivate, NestedAssembly, or
7588         NestedFamANDAssem.  We used to return these, and later do a check
7589         that would report a meaningful error, but the problem is that we
7590         would not get the real match, if there was a name override.
7591
7592 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7593
7594         * namespace.cs (Namespace, Name): Do not compute the namespace
7595         name dynamically, compute it in the constructor.  This reduced
7596         memory usage by 1697 KB.
7597
7598         * driver.cs: Use --pause to pause at the end.
7599
7600 2003-07-17  Peter Williams  <peter@newton.cx>
7601
7602         * Makefile: Change the name of the test target so that it doesn't
7603         conflict with the recursive test target.
7604
7605 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7606
7607         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7608         AddressOf): Do not use EmitThis, that was wrong, use the actual
7609         this pointer.
7610
7611 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7612
7613         * class.cs (MethodData.Define): While checking if a method is an
7614         interface implementation, improve the test: If we are not public
7615         (use new test here: use the computed MethodAttributes directly,
7616         instead of the parsed modifier flags) check if the `implementing'
7617         method comes from an interface or not.
7618
7619         * pending.cs (VerifyPendingMethods): Slightly better error
7620         message.
7621
7622         * makefile: add test target that does the mcs bootstrap.
7623
7624 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7625
7626         * interface.cs (Define): Do nothing here since there are no
7627         members to populate etc. Move the attribute emission out of here
7628         since this was just totally the wrong place to put it. Attribute
7629         application happens during the 'Emit' phase, not in the 'Define'
7630         phase.
7631
7632         (Emit): Add this method and move the attribute emission here
7633
7634         * rootcontext.cs (EmitCode): Call the Emit method on interface
7635         types too.
7636
7637 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7638
7639         * expression.cs (OverloadResolve): Report error only if Location
7640         is not 'Null' which means that there was a probe going on.
7641
7642 2003-07-14  Martin Baulig  <martin@ximian.com>
7643
7644         * expression.cs (ConditionalLogicalOperator): New public class to
7645         implement user defined conditional logical operators.
7646         This is section 14.11.2 in the spec and bug #40505.
7647
7648 2003-07-14  Martin Baulig  <martin@ximian.com>
7649
7650         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7651
7652 2003-07-14  Martin Baulig  <martin@ximian.com>
7653
7654         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7655
7656         * ecore.cs (IVariable.VerifyFixed): New interface method.
7657
7658         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7659         operator, check whether the variable is actually fixed.  Fixes bug
7660         #36055.  Set a variable definitely assigned when taking its
7661         address as required by the spec.
7662
7663         * statement.cs (LocalInfo.IsFixed): New field.
7664         (LocalInfo.MakePinned): Set `IsFixed' to true.
7665
7666 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7667
7668         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7669         for .ctors, ensure that we only ask for members declared in the
7670         attribute type (BindingFlags.DeclaredOnly).
7671
7672         Fixes bug #43632.
7673
7674         * expression.cs (Error_WrongNumArguments): Report error 1501
7675         correctly the way CSC does.
7676
7677 2003-07-13  Martin Baulig  <martin@ximian.com>
7678
7679         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7680         lookup on the fully qualified name, to make things like "X.X" work
7681         where "X.X" is a fully qualified type name, but we also have a
7682         namespace "X" in the using list.  Fixes #41975.
7683
7684 2003-07-13  Martin Baulig  <martin@ximian.com>
7685
7686         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7687         function. If we're a CompoundAssign, we need to create an embedded
7688         CompoundAssign, not an embedded Assign.
7689         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7690         Fixes #45854.
7691
7692 2003-07-13  Martin Baulig  <martin@ximian.com>
7693
7694         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7695         work to fix bug #46088.
7696
7697 2003-07-13  Ravi Pratap <ravi@ximian.com>
7698
7699         * class.cs (Operator.Emit): Do not emit attributes here - it is
7700         taken care of by the Method class that we delegate too. This takes
7701         care of bug #45876.
7702
7703 2003-07-10  Martin Baulig  <martin@ximian.com>
7704
7705         * expression.cs (TypeOfVoid): New class.
7706         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7707
7708 2003-07-10  Martin Baulig  <martin@ximian.com>
7709
7710         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7711         bug #35957.
7712
7713 2003-07-10  Martin Baulig  <martin@ximian.com>
7714
7715         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7716         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7717
7718         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7719
7720         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7721
7722 2003-07-10  Martin Baulig  <martin@ximian.com>
7723
7724         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7725         of decimal.  Fixes #42850.
7726
7727         NOTE: I also fixed the created byte blob, but this doesn't work on
7728         the MS runtime and csc never produces any byte blobs for decimal
7729         arrays.
7730
7731 2003-07-10  Martin Baulig  <martin@ximian.com>
7732
7733         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7734         structs; fixes #32068.
7735         (Block.AddChildVariableNames): Fixed #44302.
7736
7737 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7738
7739         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7740
7741 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7742
7743         * attribute.cs: And this test is onger needed.
7744
7745 2003-07-08  Martin Baulig  <martin@ximian.com>
7746
7747         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7748         inaccessible types.  Fixes #36313.
7749
7750         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7751
7752         * namespace.cs (NamespaceEntry): Create implicit entries for all
7753         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7754         implicit entries for N1.N2 and N1.
7755
7756 2003-07-08  Martin Baulig  <martin@ximian.com>
7757
7758         Rewrote the handling of namespaces to fix a lot of the issues
7759         wrt. `using' aliases etc.
7760
7761         * namespace.cs (Namespace): Splitted this class into a
7762         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7763
7764         * typemanager.cs (TypeManager.IsNamespace): Removed.
7765         (TypeManager.ComputeNamespaces): Only compute namespaces from
7766         loaded assemblies here, not the namespaces from the assembly we're
7767         currently compiling.
7768
7769 2003-07-08  Martin Baulig  <martin@ximian.com>
7770
7771         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7772
7773 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7774
7775         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7776         already fixed it.  
7777
7778         I thought about the memory savings here, but LookupTypeReflection
7779         is used under already very constrained scenarios.  Compiling
7780         corlib or mcs only exposes one hit, so it would not really reduce
7781         any memory consumption.
7782
7783 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7784
7785         * typemanager.cs: fixes bug #45889 by only adding public types from
7786         other assemblies to the list of known types.
7787
7788 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7789
7790         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7791         on the type we resolved.
7792
7793 2003-07-05  Martin Baulig  <martin@ximian.com>
7794
7795         * pending.cs (PendingImplementation.ParentImplements): Don't
7796         create the proxy if the parent is abstract.
7797
7798         * class.cs (TypeContainer.DefineIndexers): Process explicit
7799         interface implementations first.  Fixes #37714.
7800
7801 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7802
7803         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7804         defined recursively;  but since we modify the input parameters
7805         (left is set to `this' temporarily), we reset this value if the
7806         left_is_explicit is false, which gives the original semantics to
7807         the code.  
7808
7809         * literal.cs (NullPointer): new class used to represent a null
7810         literal in a pointer context.
7811
7812         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7813         type is a pointer, use a NullPointer object instead of a
7814         NullLiteral.   Closes 43687
7815
7816         (ExplicitConversion): Convert pointer values using
7817         the conv opcode to the proper type.
7818
7819         * ecore.cs (New): change ValueTypeVariable property into a method,
7820         that returns whether the valuetype is suitable for being used.
7821
7822         * expression.cs (Binary.DoNumericPromotions): Only return if we
7823         the int constant was a valid uint, and we can return both left and
7824         right as uints.  If not, we continue processing, to trigger the
7825         type conversion.  This fixes 39018.
7826
7827         * statement.cs (Block.EmitMeta): During constant resolution, set
7828         the CurrentBlock property on the emitcontext, so that we resolve
7829         constants propertly.
7830
7831 2003-07-02  Martin Baulig  <martin@ximian.com>
7832
7833         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7834         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7835
7836         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7837         than emitting it here.
7838
7839         * statement.cs: Fixed some more flow analysis bugs.
7840
7841 2003-07-02  Martin Baulig  <martin@ximian.com>
7842
7843         * class.cs (MethodData.Define): When implementing interface
7844         methods, set Final unless we're Virtual.
7845
7846         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7847         check work for interface methods.
7848
7849 2003-07-01  Martin Baulig  <martin@ximian.com>
7850
7851         * ecore.cs (EmitContext.This): Replaced this property with a
7852         GetThis() method which takes a Location argument.  This ensures
7853         that we get the correct error location for a CS0188.
7854
7855 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7856
7857         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7858         ImplicitStandardConversion.
7859
7860         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7861
7862 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7863
7864         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7865         optimization.
7866
7867 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7868
7869         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7870         constructors.
7871
7872         (MethodData.Define): Turn off initlocals for unsafe methods.
7873
7874 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7875
7876         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7877         complete;  Fixes #37521.
7878
7879         * delegate.cs: Use Modifiers.TypeAttr to compute the
7880         TypeAttributes, instead of rolling our own.  This makes the flags
7881         correct for the delegates.
7882
7883 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7884
7885         * class.cs (Constructor.Define): Set the private flag for static
7886         constructors as well.
7887
7888         * cs-parser.jay (statement_expression): Set the return value to
7889         null, to avoid a crash when we catch an error.
7890
7891 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7892
7893         * cs-parser.jay: Applied patch from Jackson that adds support for
7894         extern and unsafe modifiers to destructor declarations.
7895
7896         * expression.cs: Report error 21 if the user is trying to index a
7897         System.Array.
7898
7899         * driver.cs: Add an error message, suggested by the bug report.
7900
7901         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7902         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7903
7904 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7905
7906         * namespace.cs: Add some information to reduce FAQs.
7907
7908 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7909
7910         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7911         underlying enumeration types.  Fixes #43915.
7912
7913         * expression.cs: Treat ushort/short as legal values to be used in
7914         bitwise operations.
7915
7916 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7917
7918         * delegate.cs: transfer custom attributes for paramenters from
7919         the delegate declaration to Invoke and BeginInvoke.
7920
7921 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7922
7923         * attribute.cs: handle custom marshalers and emit marshal info
7924         for fields, too.
7925
7926 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7927
7928         * makefile.gnu: Added anonymous.cs to the compiler sources.
7929
7930 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7931
7932         * iterators.cs: Change the name of the proxy class to include two
7933         underscores.
7934
7935         * cs-parser.jay: Update grammar to include anonymous methods.
7936
7937         * anonymous.cs: new file.
7938
7939 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7940
7941         * class.cs (Field.Define): Add missing test for pointers and
7942         safety. 
7943
7944 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7945
7946         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7947         we use the stobj opcode.
7948
7949         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7950         since it wasn't the correct fix. 
7951
7952         It still is puzzling that we are required to use stobj for IntPtr
7953         which seems to be a ValueType.
7954
7955 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7956
7957         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7958         during regular simple name resolution.   Now, the trick is that
7959         instead of returning for processing the simplename, we do a
7960         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7961         contextual lookup type).   If a match is found, return that, if
7962         not, return for further composition.
7963
7964         This fixes long-standing 30485.
7965
7966         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7967         using the address to initialize an object, do an Stobj instead of
7968         using the regular Stelem.
7969
7970         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7971         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
7972         Because if we are a BaseIndexerAccess that value will be true.
7973         Fixes 43643.
7974
7975         * statement.cs (GotoCase.Resolve): Return after reporting an
7976         error, do not attempt to continue. 
7977
7978         * expression.cs (PointerArithmetic.Emit): If our operand is a
7979         long, convert our constants to match the operand before
7980         multiplying.  Convert to I type before adding.   Fixes 43670.
7981
7982 2003-05-14  Ravi Pratap  <ravi@ximian.com>
7983
7984         * enum.cs (ImplicitConversionExists) : Rename to
7985         ImplicitEnumConversionExists to remove ambiguity. 
7986
7987         * ecore.cs (NullCast): New type of cast expression class which
7988         basically is very similar to EmptyCast with the difference being
7989         it still is a constant since it is used only to cast a null to
7990         something else
7991         (eg. (string) null)
7992
7993         * convert.cs (ImplicitReferenceConversion): When casting a null
7994         literal, we return a NullCast.
7995
7996         * literal.cs (NullLiteralTyped): Remove - I don't see why this
7997         should be around anymore.
7998
7999         The renaming (reported was slightly wrong). Corrections:
8000
8001         ConvertImplicitStandard -> ImplicitConversionStandard
8002         ConvertExplicitStandard -> ExplicitConversionStandard
8003
8004         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8005         before passing them in !
8006
8007         * convert.cs (ImplicitConversionStandard): When comparing for
8008         equal expr and target types, ensure that expr is not a
8009         NullLiteral.
8010
8011         In general, we must not be checking (expr_type ==
8012         target_type) in the top level conversion methods
8013         (ImplicitConversion, ExplicitConversion etc). This checking is
8014         done in the methods that they delegate to.
8015
8016 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8017
8018         * convert.cs: Move Error_CannotConvertType,
8019         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8020         ImplicitNumericConversion, ImplicitConversionExists,
8021         ImplicitUserConversionExists, StandardConversionExists,
8022         FindMostEncompassedType, FindMostSpecificSource,
8023         FindMostSpecificTarget, ImplicitUserConversion,
8024         ExplicitUserConversion, GetConversionOperators,
8025         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8026         TryImplicitIntConversion, Error_CannotConvertImplicit,
8027         ConvertImplicitRequired, ConvertNumericExplicit,
8028         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8029         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8030         its own file.
8031
8032         Perform the following renames:
8033
8034         StandardConversionExists -> ImplicitStandardConversionExists
8035         ConvertImplicit -> ImplicitConversion
8036         ConvertImplicitStandard -> ImplicitStandardConversion
8037         TryImplicitIntConversion -> ImplicitIntConversion
8038         ConvertImplicitRequired -> ImplicitConversionRequired
8039         ConvertNumericExplicit -> ExplicitNumericConversion
8040         ConvertReferenceExplicit -> ExplicitReferenceConversion
8041         ConvertExplicit -> ExplicitConversion
8042         ConvertExplicitStandard -> ExplicitStandardConversion
8043
8044 2003-05-19  Martin Baulig  <martin@ximian.com>
8045
8046         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8047         (TypeInfo): Added support for structs having structs as fields.
8048
8049         * ecore.cs (FieldExpr): Implement IVariable.
8050         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8051         VariableInfo for the field.
8052
8053 2003-05-18  Martin Baulig  <martin@ximian.com>
8054
8055         * expression.cs (This.DoResolve): Report a CS0027 if we're
8056         emitting a field initializer.
8057
8058 2003-05-18  Martin Baulig  <martin@ximian.com>
8059
8060         * expression.cs (This.ResolveBase): New public function.
8061         (This.DoResolve): Check for CS0188.
8062
8063         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8064         This.Resolve().
8065
8066         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8067         `instance_expression' to null if we don't have any non-static
8068         methods.
8069
8070 2003-05-18  Martin Baulig  <martin@ximian.com>
8071
8072         Reworked the way how local variables and parameters are handled by
8073         the flow analysis code.
8074
8075         * statement.cs (TypeInfo, VariableMap): New public classes.
8076         (VariableInfo): New public class.  This is now responsible for
8077         checking whether a variable has been assigned.  It is used for
8078         parameters and local variables.
8079         (Block.EmitMeta): Take the InternalParameters as argument; compute
8080         the layout of the flow vectors here.
8081         (Block.LocalMap, Block.ParameterMap): New public properties.
8082         (FlowBranching): The .ctor doesn't get the InternalParameters
8083         anymore since Block.EmitMeta() now computes the layout of the flow
8084         vector.
8085         (MyStructInfo): This class is now known as `StructInfo' and nested
8086         in `TypeInfo'; we don't access this directly anymore.
8087
8088         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8089         property and removed IsAssigned(), IsFieldAssigned(),
8090         SetAssigned() and SetFieldAssigned(); we now call them on the
8091         VariableInfo so we don't need to duplicate this code everywhere.
8092
8093         * expression.cs (ParameterReference): Added `Block block' argument
8094         to the .ctor.
8095         (LocalVariableReference, ParameterReference, This): The new
8096         VariableInfo class is now responsible for all the definite
8097         assignment stuff.
8098
8099         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8100         IsParameterAssigned, SetParameterAssigned): Removed.
8101
8102 2003-05-18  Martin Baulig  <martin@ximian.com>
8103
8104         * typemanager.cs (InitCoreTypes): Try calling
8105         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8106         the 3-args-version.  Corlib now also needs our `void_type'.
8107         (GetMethod): Added overloaded version which takes an optional
8108         `bool report_errors' to allow lookups of optional methods.
8109
8110 2003-05-12  Martin Baulig  <martin@ximian.com>
8111
8112         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8113         only used for locals and not for parameters.
8114
8115 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8116
8117         * support.cs (InternalParameters.ParameterType): Return the
8118         ExternalType of the parameter.
8119
8120         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8121         they were unused.
8122
8123 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8124
8125         * class.cs (MethodData.Define): Do not set the `newslot' on
8126         interface members, if they are also flagged as "override".
8127
8128         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8129         better code for ++i and i++.  This only works for static fields
8130         and local variables.
8131
8132         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8133         want to pull the DeclSpace out of the builder_to_declspace instead
8134         of the TypeBuilder (like in TypeContainer.FindMembers).
8135
8136         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8137         instead of LookupTypeContainer.  Fixes the crash on .NET for
8138         looking up interface members.
8139
8140         * const.cs: Create our own emit context during the Definition
8141         stage, so that constants are evaluated in the proper context, when
8142         a recursive definition happens.
8143
8144 2003-05-11  Martin Baulig  <martin@ximian.com>
8145
8146         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8147         new block for a switch section.
8148         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8149         the adding/lookup in the switch block.  Fixes #39828.
8150
8151 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8154         functionality: I needed to convert the data after I had performed
8155         the add/sub operation into the operands type size.
8156
8157         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8158         pass the type for the box operation, otherwise the resulting
8159         object would have been of type object.
8160
8161         (BoxedCast): Add constructor to specify the type to box as.
8162
8163 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8164
8165         * iterators.cs: I was reusing the `count' variable inadvertently,
8166         take steps to not allow this to happen.
8167
8168 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8169
8170         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8171         by creating an array at the point where the params starts and
8172         putting all those arguments there, then adjusting the size of the
8173         array.
8174
8175 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8176
8177         * expression.cs (New.AddressOf): Implement interface
8178         IMemoryLocation.  This is used when the `new' operator is used in
8179         the context of an invocation to a method on a value type.
8180
8181         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8182         example. 
8183
8184         * namespace.cs: Also check the using aliases here.
8185
8186         * driver.cs: Move the test for using validity after the types have
8187         been entered, so we do a single pass that also includes the using
8188         aliases. 
8189
8190         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8191         in the regular case.   CreateSiblingForFinally is doing extra
8192         error checking.
8193
8194         * attribute.cs (GetAttributeArgumentExpression): Store the result
8195         on an out value, and use the return value to indicate failure
8196         instead of using null (which is a valid return for Constant.GetValue).
8197
8198         * statement.cs: Perform the analysis flow for the increment
8199         portion after the statement, because this will be the real flow of
8200         execution.  Fixes #42385
8201
8202         * codegen.cs (EmitContext.EmitArgument,
8203         EmitContext.EmitStoreArgument): New helper functions when the
8204         RemapToProxy flag is set.
8205
8206         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8207         function.
8208
8209         Add support for remapping parameters. 
8210
8211         * iterators.cs: Propagate parameter values;  Store parameter
8212         values in the proxy classes.
8213
8214 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8215
8216         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8217         need a proxy reference;  I do not know what I was thinking
8218
8219         * cs-parser.jay (constructor_initializer): catch another error,
8220         and display nice message.
8221
8222         (field_declaration): catch void field declaration
8223         to flag a better error. 
8224
8225         * class.cs (MemberBase.CheckBase): Report an error instead of a
8226         warning if a new protected member is declared in a struct. 
8227         (Field.Define): catch the error of readonly/volatile.
8228
8229         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8230
8231         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8232         volatile variable is taken
8233
8234 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8235
8236         * statement.cs (Fixed.Resolve): Report an error if we are not in
8237         an unsafe context.
8238
8239 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8240
8241         * typemanager.cs: reuse the code that handles type clashes for
8242         delegates and enumerations.
8243
8244         * class.cs (Report28): Always report.
8245
8246         * expression.cs (EncodeAsAttribute): Allow nulls here.
8247
8248 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8249
8250         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8251         the functionality for testing whether an expression is valid for
8252         an attribute here.  Also handle the case of arrays of elements
8253         being stored. 
8254
8255         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8256         encoding a linear array into an array of objects that are suitable
8257         to be passed to an CustomAttributeBuilder.
8258
8259         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8260
8261         * ecore.cs: (FieldExpr): Handle field remapping here.
8262
8263         * iteratators.cs: Pass the instance variable (if the method is an
8264         instance method) to the constructors, so we can access the field
8265         variables on the class.
8266
8267         TODO: Test this with structs.  I think the THIS variable on
8268         structs might have to be a pointer, and not a refenrece
8269
8270 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8271
8272         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8273         local variables to fields in a proxy class.
8274
8275         * iterators.cs (PopulateProxy): Rename our internal fields to
8276         <XXX>.  
8277         Create a <THIS> field if we are an instance method, so we can
8278         reference our parent container variables.
8279         (MapVariable): Called back from the EmitContext code to enter a
8280         new variable to field mapping into the proxy class (we just create
8281         a FieldBuilder).
8282
8283         * expression.cs
8284         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8285         for using the remapped locals to fields.
8286
8287         I placed the code here, because that gives the same semantics to
8288         local variables, and only changes the Emit code.
8289
8290         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8291         statements inside iterators.
8292         (VariableInfo): Add a FieldBuilder for the cases when we are
8293         remapping local variables to fields in a proxy class
8294
8295         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8296         current_block != null.
8297
8298         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8299         not cope with strings, as it has been moved to the
8300         TableSwitchEmit.  Fixed bug in switch generation.
8301
8302         * expression.cs (New.DoResolve): Provide more context for the user
8303         when reporting an error.
8304
8305         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8306         pointers. 
8307
8308         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8309         check the permissions for it.  Note than in a type-resolution
8310         context the check was already present in DeclSpace.ResolveType,
8311         but was missing from the MemberAccess.
8312
8313         (ArrayCreation.CheckIndices): warn if the user has
8314         more nested levels of expressions, but there are no more
8315         dimensions specified.  Avoids crash on bug 41906.
8316
8317 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8318
8319         * statement.cs (Block): replace Implicit bool, for a generic
8320         flags.   
8321         New flag: `Unchecked'.  This is used during the EmitMeta phase
8322         (which is out-of-line with the regular Resolve/Emit process for a
8323         statement, as this is done ahead of time, but still gets a chance
8324         to call constant resolve).
8325
8326         (Block.Flags): new enum for adding a new flag.
8327
8328         (Block.EmitMeta): track the state of unchecked.
8329
8330         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8331         to enable constant resolution to work there as well.
8332
8333 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8334
8335         * typemanager.cs (ienumerable_type): Also look up
8336         System.Collections.IEnumerable. 
8337
8338 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8339
8340         TODO: Test more than one conditional per method.
8341
8342         * class.cs (Indexer.Define): Report the location where the user is
8343         referencing the unsupported feature.
8344
8345         (MethodData): Overload the use of `conditionals' to
8346         minimize the creation of needless ArrayLists.   This saves roughly
8347         212kb on my machine.
8348
8349         (Method): Implement the new IIteratorContainer interface.
8350         (Method.SetYields): Implement the method by setting the ModFlags
8351         to contain METHOD_YIELDS.
8352
8353         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8354         which just got set to null.
8355
8356         * iterators.cs: New file.
8357
8358         (Yield, YieldBreak): New statements.
8359
8360         * statement.cs (Return.Resolve): Flag an error if we are used in
8361         an iterator method.
8362
8363         * codegen.cs (InIterator): New flag set if the code is being
8364         compiled in an iterator method.
8365
8366         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8367         internal modifier, and we just use it to avoid adding extra
8368         fields, as this is seldom used.  
8369
8370         * cs-parser.jay: Add yield_statement (yield and yield break).
8371
8372         * driver.cs: New flag -v2 to turn on version 2 features. 
8373
8374         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8375         hashtable when v2 is enabled.
8376
8377 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8378
8379         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8380         there is already a namespace defined with this name.
8381
8382         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8383         people upgraded their corlibs.
8384
8385         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8386         always use fully qualified types, no need to use the compiler
8387         front end.
8388
8389         (TypeManager.IsNamespace): Use binarysearch.
8390
8391         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8392         AddDelegate): I did not quite use the new IsValid API properly: I
8393         have to pass the short-name and the fullname.  I was passing only
8394         the basename instead of the fullname sometimes. 
8395
8396         (TypeContainer.DefineType): call NamespaceClash.
8397
8398         * interface.cs (Interface.DefineType): use NamespaceClash before
8399         defining the type.
8400
8401         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8402         defining the type.
8403
8404         * enum.cs: (Enum.DefineType): use NamespaceClash before
8405         defining the type.
8406
8407         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8408         speed increase.  First, use the negative_hits cache when we get a
8409         negative.  Second, add the type with its full original name
8410         instead of the new . and + encoded name (reflection uses + to
8411         separate type from a nested type).  Use LookupTypeReflection
8412         directly which bypasses the type->name hashtable (that we already
8413         know does not contain the type.
8414
8415         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8416         location/container type. 
8417
8418         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8419
8420 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8421
8422         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8423
8424         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8425         method is being referenced in the method group from a static
8426         context, and report error 120 if so.
8427
8428         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8429         Error118. 
8430
8431         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8432         is created, we create the A namespace).
8433
8434         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8435         Fixes #41591
8436
8437 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8438
8439         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8440         invocation to ModuleBuilder.GetType with the same values will
8441         return a new type instance, so we need to cache its return
8442         values. 
8443
8444         * expression.cs (Binary.ResolveOperator): Only allow the compare
8445         operators on enums if they are of the same type.
8446
8447         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8448         types of ValueType on their own case.  Before we were giving them
8449         the same treatment as objects.
8450
8451         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8452         fullname.  Short name is used to compare against container name.
8453         Fullname is used to check against defined namespace names.
8454
8455         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8456         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8457
8458         (Method.CheckBase): Call parent.
8459         (MemberBase.CheckBase): Check for protected members on sealed
8460         classes.
8461         (PropertyBase.CheckBase): Call parent.
8462         (Field.Define): Call parent.
8463
8464         * report.cs: Negative error codes are now mapped to 8000 - code,
8465         so that the display is render more nicely.
8466
8467         * typemanager.cs: Do not use try/catch, instead report a regular
8468         error. 
8469
8470         (GetPointerType, GetReferenceType): These methods provide
8471         mechanisms to obtain the T* and T& from a T.  We had the code
8472         previously scattered around the code base, and it also used
8473         TypeManager.LookupType that would go through plenty of caches.
8474         This one goes directly to the type source.
8475
8476         In some places we did the Type.GetType followed by
8477         ModuleBuilder.GetType, but not in others, so this unifies the
8478         processing as well.
8479
8480         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8481         statements now that we have namespace information.
8482
8483         * typemanager.cs (IsNamespace): New method, returns whether the
8484         string presented is a namespace or not.
8485
8486         (ComputeNamespaces): New public entry point, computes the list of
8487         available namespaces, using the GetNamespaces API call in Mono, or
8488         the slower version in MS.NET.   
8489
8490         Now before we start the semantic analysis phase, we have a
8491         complete list of namespaces including everything that the user has
8492         provided.
8493
8494         Deleted old code to cache namespaces in .nsc files.
8495
8496 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8497
8498         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8499         class/struct location definition Location for the implicit
8500         constructor location.
8501
8502         (Operator.Define): Use the location of the operator for the
8503         implicit Method definition.
8504
8505         (Constructor.Emit): use the constructor location for the implicit
8506         base initializer constructor.
8507
8508         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8509         and the Expression class now contains two new methods:
8510
8511         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8512         isolate type lookup from the rest of the resolution process.
8513
8514         Since we use Expressions to hold type definitions due to the way
8515         we parse the input we have historically overloaded Resolve to
8516         perform the Type lookups if a special flag is passed.  Now this is
8517         eliminated and two methods take their place. 
8518
8519         The differences in the two methods between xStep and xTerminal is
8520         that xStep is involved in our current lookup system that uses
8521         SimpleNames to compose a name, while xTerminal is used just to
8522         catch the case where the simplename lookup failed.
8523
8524 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8525
8526         * expression.cs (ResolveMemberAccess): Remove redundant code.
8527         TypeExpr expressions are always born fully resolved.
8528
8529         * interface.cs (PopulateMethod): Do not lookup the types twice.
8530         We were doing it once during SemanticAnalysis and once during
8531         PopulateMethod.
8532
8533         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8534         in local variable type definitions, were being returned as a
8535         SimpleName (we decomposed everything into a string), that is
8536         because primary_expression was being used instead of a type in the
8537         grammar (reduce/reduce conflicts).
8538
8539         The part that was wrong is that we converted the expression into a
8540         string (an oversimplification in one hand, compounded with primary
8541         expressions doing string concatenation).
8542
8543         So things like:
8544
8545         A.B.C [] x;
8546
8547         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8548         using clauses from working on this particular context.  And a type
8549         was being matched directly against "A.B.C[]".
8550
8551         We now use the correct approach, and allow for ComposedCast to be
8552         part of the unary expression.  So the "A.B.C []" become a composed
8553         cast of "A.B.C" (as a nested group of MemberAccess with a
8554         SimpleName at the end) plus the rank composition "[]". 
8555
8556         Also fixes 35567
8557
8558 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8559
8560         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8561         for the access level checking.
8562
8563         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8564         `TypeContainer container', because I kept getting confused when I
8565         was debugging this code.
8566
8567         * expression.cs (Indexers): Instead of tracking getters/setters,
8568         we now track them in parallel.  We create one arraylist less, but
8569         most importantly it is possible now for the LValue code to find a
8570         matching get for a set.
8571
8572         (IndexerAccess.DoResolveLValue): Update the code.
8573         GetIndexersForType has been modified already to extract all the
8574         indexers from a type.  The code assumed it did not.
8575
8576         Also make the code set the correct return type for the indexer.
8577         This was fixed a long time ago for properties, but was missing for
8578         indexers.  It used to be void_type.
8579
8580         (Binary.Emit): Test first for doubles instead of
8581         floats, as they are more common.
8582
8583         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8584         when dealing with floats and the <=, >= operators.  This fixes bug
8585         #39314 
8586
8587         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8588         to load the array value by emitting a load on the foreach variable
8589         type.  This was incorrect.  
8590
8591         We now emit the code to load an element using the the array
8592         variable type, and then we emit the conversion operator.
8593
8594         Fixed #40176
8595
8596 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8597
8598         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8599
8600 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8601
8602         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8603         test for protection before we test for signatures. 
8604
8605         (MethodSignature.ToString): implement.
8606
8607         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8608         to the case where we reduced into a LongConstant.
8609
8610         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8611         depend on whether the information is acurrate, because the
8612         Microsoft runtime will always claim that the array type is public,
8613         regardless of the real state.
8614
8615         If the type is a pointer, another problem happens: the type is
8616         reported as non-public in Microsoft.  
8617
8618         In both cases we have to call CheckAccessLevel recursively with
8619         the underlying type as the argument to be tested.
8620
8621 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8622
8623         * assign.cs (Assign.Emit): If we are dealing with a compound
8624         assignment expression, we should use the code path that stores the
8625         intermediate result in a temporary value.  This fixes #40903.
8626
8627         *expression.cs (Indirection.ToString): Provide ToString method for
8628         debugging. 
8629
8630 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8631
8632         * class.cs: Null out fields holding references to Block objects so
8633         they can be garbage collected.
8634
8635         * expression.cs (OverloadResolve): Remove unused local.
8636
8637 2003-04-07  Martin Baulig  <martin@ximian.com>
8638
8639         * codegen.cs (EmitContext.CurrentFile): New public field.
8640         (EmitContext.Mark): Use the CurrentFile to check whether the
8641         location is in the correct file.
8642         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8643
8644 2003-04-07  Martin Baulig  <martin@ximian.com>
8645
8646         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8647
8648         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8649         location.  [FIXME: The location argument which gets passed to this
8650         method is sometimes wrong!]
8651
8652 2003-04-07  Nick Drochak <ndrochak@gol.com>
8653
8654         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8655
8656 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8657
8658         * expression.cs (Indirection.EmitAssign): We were using the
8659         temporary, but returning immediately instead of continuing the
8660         EmitAssing flow.
8661
8662 2003-04-06  Martin Baulig  <martin@ximian.com>
8663
8664         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8665         if it's a nested child, but also deriving from the outer class.
8666         See test 190.cs.
8667
8668         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8669         nested child, but also deriving from the outer class.  See
8670         test-190.cs.
8671         (FilterWithClosure): We may access private members of the outer
8672         class if we're a nested child and deriving from the outer class.
8673         (RealMemberLookup): Only set `closure_private_ok' if the
8674         `original_bf' contained BindingFlags.NonPublic.
8675
8676 2003-04-05  Martin Baulig  <martin@ximian.com>
8677
8678         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
8679         probe if its a type parameter, and if so, flag an error.
8680
8681         * decl.cs: Move here the SetParameterInfo code from class.cs.
8682         Handle IsGeneric here.
8683
8684         Handle a variety of errors in the parameter info definition.
8685
8686         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
8687         type parameters here.
8688
8689         * cs-parser.jay (class_declaration): report errors for parameters
8690         here as well.
8691
8692 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * generic.cs: New file, contains support code for generics.
8695
8696         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
8697         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
8698
8699         Update parser for the above removals.
8700
8701         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
8702         now taken care of in the parser.
8703
8704 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8705
8706         * class.cs (Event.Define): Do not allow abstract events to have
8707         initializers. 
8708
8709 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8710
8711         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8712         block in event declarations.
8713
8714         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8715         value type, get its address.
8716
8717         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8718         leaving a class on the stack instead of a boolean value (int
8719         0/1).  Change the code so we compare against null, and then the
8720         result against zero.
8721
8722         * class.cs (TypeContainer.GetClassBases): We were checking for the
8723         parent class being sealed too late.
8724
8725         * expression.cs (Binary.Emit): For <= and >= when dealing with
8726         floating point values, use cgt.un and clt.un instead of cgt and
8727         clt alone.
8728
8729 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8730
8731         * statement.cs: Apply the same optimization as MS: skip the 
8732         GetEnumerator returning an IEnumerator, and use the one returning a 
8733         CharEnumerator instead. This allows us to avoid the try-finally block 
8734         and the boxing.
8735
8736 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8737
8738         * cs-parser.jay: Attributes cannot be applied to
8739                          namespaces. Fixes #40473
8740
8741 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8742
8743         * class.cs:
8744         (Add*): check if the name is valid using the full name for constants,
8745         fields, properties and events.
8746
8747 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8748
8749         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8750         char constants to be part of the enumeration.
8751
8752         * expression.cs (Conditional.DoResolve): Add support for operator
8753         true. Implements the missing functionality from 14.12
8754
8755         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8756         operator true/false as required by the spec.
8757
8758         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8759         implicit conversion to boolean.
8760
8761         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8762         also one where the type implements `operator true'. 
8763
8764         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8765         get an expression that will invoke operator true based on an
8766         expression.  
8767
8768         (GetConversionOperators): Removed the hack that called op_True
8769         here.  
8770
8771         (Expression.ResolveBoolean): Move this from Statement.
8772
8773 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8774
8775         * ecore.cs (FieldExpr): do not allow initialization of initonly
8776         fields on derived classes
8777
8778 2003-03-13  Martin Baulig  <martin@ximian.com>
8779
8780         * statement.cs (Block.Emit): Call ig.BeginScope() and
8781         ig.EndScope() when compiling with debugging info; call
8782         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8783
8784 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8785
8786         * expression.cs (Indexers): Do not construct immediately, allow
8787         for new members to be appended as we go.  Fixes 38143
8788
8789 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8790
8791         * expression.cs: save/restore context when resolving an unchecked
8792         expression.
8793
8794 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * cfold.cs: Catch division by zero in modulus operator during
8797         constant folding.
8798
8799 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8800
8801         * interface.cs (Interface.DefineMembers): Avoid defining members
8802         twice. 
8803
8804 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8805
8806         * driver.cs: handle the +/- options for -noconfig
8807
8808         * statement.cs (Unckeched.Resolve): Also track the state of
8809         unchecked in the Resolve phase.
8810
8811 2003-02-27  Martin Baulig  <martin@ximian.com>
8812
8813         * ecore.cs (Expression.MemberLookup): Don't create a
8814         MethodGroupExpr for something which is not a method.  Fixes #38291.
8815
8816 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8817
8818         * class.cs (MemberBase.CheckParameters): Also check that the type
8819         is unmanaged if it is a pointer.
8820
8821         * expression.cs (SizeOf.Resolve): Add location information.
8822
8823         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8824         a managed type is declared.
8825
8826         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8827         parameter modifiers as well.  Fixes bug 38606
8828
8829         * class.cs: Very sad.  Am backing out the speed up changes
8830         introduced by the ArrayList -> Array in the TypeContainer, as they
8831         were not actually that much faster, and introduced a bug (no error
8832         reports on duplicated methods).
8833
8834         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8835         source first, this will guarantee that we have a valid expression
8836         before calling in lower levels functions that will require a
8837         resolved object.  Then use this original_source in the
8838         target.ResolveLValue instead of the original source that was
8839         passed to us.
8840
8841         Another change.  Use target.Resolve instead of LValueResolve.
8842         Although we are resolving for LValues, we will let the Assign code
8843         take care of that (it will be called again from Resolve).  This
8844         basically allows code like this:
8845
8846         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8847         class Y { void A (X x) { x [0] += o; }
8848
8849         The problem was that the indexer was trying to resolve for
8850         set_Item (idx, object o) and never finding one.  The real set_Item
8851         was set_Item (idx, X).  By delaying the process we get the right
8852         semantics. 
8853
8854         Fixes bug 36505
8855
8856 2003-02-23  Martin Baulig  <martin@ximian.com>
8857
8858         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8859         while calling DoEmit ().
8860
8861         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8862         source files; if you use the #line directive inside a method, the
8863         compiler stops emitting line numbers for the debugger until it
8864         reaches the end of the method or another #line directive which
8865         restores the original file.
8866
8867 2003-02-23  Martin Baulig  <martin@ximian.com>
8868
8869         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8870
8871 2003-02-23  Martin Baulig  <martin@ximian.com>
8872
8873         * statement.cs (Block.AddChildVariableNames): We need to call this
8874         recursively, not just for our immediate children.
8875
8876 2003-02-23  Martin Baulig  <martin@ximian.com>
8877
8878         * class.cs (Event.Define): Always make the field private, like csc does.
8879
8880         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8881         actually work, fixes bug #37521.
8882
8883 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8884
8885         * delegate.cs: When creating the various temporary "Parameters"
8886         classes, make sure that we call the ComputeAndDefineParameterTypes
8887         on those new parameters (just like we do with the formal ones), to
8888         allow them to be resolved in the context of the DeclSpace.
8889
8890         This fixes the bug that Dick observed in Bugzilla #38530.
8891
8892 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8893
8894         * expression.cs (ResolveMemberAccess): When resolving a constant,
8895         do not attempt to pull a constant if the value was not able to
8896         generate a valid constant.
8897
8898         * const.cs (LookupConstantValue): Do not report more errors than required.
8899
8900 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8901
8902         * expression.cs: fixes bug #38328.
8903
8904 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8905
8906         * class.cs: Changed all the various members that can be part of a
8907         class from being an ArrayList to be an Array of the right type.
8908         During the DefineType type_list, interface_list, delegate_list and
8909         enum_list are turned into types, interfaces, delegates and enums
8910         arrays.  
8911
8912         And during the member population, indexer_list, event_list,
8913         constant_list, field_list, instance_constructor_list, method_list,
8914         operator_list and property_list are turned into their real arrays.
8915
8916         Although we could probably perform this operation earlier, for
8917         good error reporting we need to keep the lists and remove the
8918         lists for longer than required.
8919
8920         This optimization was triggered by Paolo profiling the compiler
8921         speed on the output of `gen-sample-program.pl' perl script. 
8922
8923         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8924         not crash in methods like MemberLookupFailed that use this field.  
8925
8926         This problem arises when the compiler fails to resolve a type
8927         during interface type definition for example.
8928
8929 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8930
8931         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8932         inherit from System.Object, so we have to stop at null, not only
8933         when reaching System.Object.
8934
8935 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8936
8937         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8938         DeclaredOnly because the parent indexer might have had a different
8939         name, but did not loop until the top of the hierarchy was reached.
8940
8941         The problem this one fixes is 35492: when a class implemented an
8942         indexer from an interface, we were getting the interface method
8943         (which was abstract) and we were flagging an error (can not invoke
8944         abstract method).
8945
8946         This also keeps bug 33089 functioning, and test-148 functioning.
8947
8948         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8949         out if a method is special is to see if it is declared in a
8950         property or event, or whether it is one of the predefined operator
8951         names.   This should fix correctly #36804.
8952
8953 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8954
8955         The goal here is to remove the dependency on EmptyCast.Peel ().
8956         Killing it completely.
8957
8958         The problem is that currently in a number of places where
8959         constants are expected, we have to "probe" for an EmptyCast, and
8960         Peel, which is not the correct thing to do, as this will be
8961         repetitive and will likely lead to errors. 
8962
8963         The idea is to remove any EmptyCasts that are used in casts that
8964         can be reduced to constants, so we only have to cope with
8965         constants. 
8966
8967         This bug hunt was triggered by Bug 37363 and the desire to remove
8968         the duplicate pattern where we were "peeling" emptycasts to check
8969         whether they were constants.  Now constants will always be
8970         constants.
8971
8972         * ecore.cs: Use an enumconstant here instead of wrapping with
8973         EmptyCast.  
8974
8975         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
8976         throwing me off.  By handling this we can get rid of a few hacks.
8977
8978         * statement.cs (Switch): Removed Peel() code.
8979
8980 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
8981
8982         * class.cs: Location information for error 508
8983
8984         * expression.cs (New.DoResolve): Add a guard against double
8985         resolution of an expression.  
8986
8987         The New DoResolve might be called twice when initializing field
8988         expressions (see EmitFieldInitializers, the call to
8989         GetInitializerExpression will perform a resolve on the expression,
8990         and later the assign will trigger another resolution
8991
8992         This leads to bugs (#37014)
8993
8994         * delegate.cs: The signature for EndInvoke should contain any ref
8995         or out parameters as well.  We were not doing this in the past. 
8996
8997         * class.cs (Field.Define): Do not overwrite the type definition
8998         inside the `volatile' group.  Turns out that volatile enumerations
8999         were changing the type here to perform a validity test, which
9000         broke conversions. 
9001
9002 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9003
9004         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9005         and structs, we do not want to load the instance variable
9006
9007         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9008         enum_type has to be handled like an object reference (implicit
9009         conversions exists from this to object), but the regular IsClass
9010         and IsValueType tests will never return true for this one.
9011
9012         Also we use TypeManager.IsValueType instead of type.IsValueType,
9013         just for consistency with the rest of the code (this is only
9014         needed if we ever use the construct exposed by test-180.cs inside
9015         corlib, which we dont today).
9016
9017 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9018
9019         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9020         just InternalCall.
9021
9022 2003-02-09  Martin Baulig  <martin@ximian.com>
9023
9024         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9025         (Namespace.DefineNamespaces): New static public method; this is
9026         called when we're compiling with debugging to add all namespaces
9027         to the symbol file.
9028
9029         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9030         pass it to the Namespace's .ctor.
9031
9032         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9033         and MethodBase arguments; pass the namespace ID to the symwriter;
9034         pass the MethodBase instead of the token to the symwriter.
9035         (SymbolWriter.DefineNamespace): New method to add a namespace to
9036         the symbol file.
9037
9038 2003-02-09  Martin Baulig  <martin@ximian.com>
9039
9040         * symbolwriter.cs: New file.  This is a wrapper around
9041         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9042         methods here in near future.
9043
9044 2003-02-09  Martin Baulig  <martin@ximian.com>
9045
9046         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9047         ILGenerator.MarkSequencePoint() which are actually used by the
9048         symbol writer.
9049
9050 2003-02-09  Martin Baulig  <martin@ximian.com>
9051
9052         * location.cs (SourceFile): New public sealed class.  This
9053         contains the name and an index which is used in the location's token.
9054         (Location): Reserve an appropriate number of bits in the token for
9055         the source file instead of walking over that list, this gives us a
9056         really huge performance improvement when compiling with debugging.
9057
9058         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9059         `SourceFile' argument instead of a string.
9060         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9061         but don't parse/tokenize here, we need to generate the list of all
9062         source files before we do that.
9063         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9064         the files.
9065
9066         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9067         instead of a string.
9068
9069         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9070         of a string.
9071
9072 2003-02-09  Martin Baulig  <martin@ximian.com>
9073
9074         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9075         filename on `#line default'.
9076
9077 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9078
9079         * statement.cs: don't clear the pinned var when the fixed statement
9080         returns from the method (fixes bug#37752).
9081
9082 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9083
9084         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9085         to IsValueType.
9086
9087 2003-02-07  Martin Baulig  <martin@ximian.com>
9088
9089         * driver.cs: Removed the `--debug-args' command line argument.
9090
9091         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9092         automatically by the AsssemblyBuilder.
9093         (CodeGen.InitializeSymbolWriter): We don't need to call any
9094         initialization function on the symbol writer anymore.  This method
9095         doesn't take any arguments.
9096
9097 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9098
9099         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9100         from referenced assemblies as well.
9101
9102 2003-02-02  Martin Baulig  <martin@ximian.com>
9103
9104         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9105
9106 2003-02-02  Martin Baulig  <martin@ximian.com>
9107
9108         * class.cs (Constructor.Emit): Open the symbol writer before
9109         emitting the constructor initializer.
9110         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9111         single-stepping through constructor initializers.
9112
9113 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9114
9115         * class.cs: Handle error 549: do not allow virtual methods in
9116         sealed classes. 
9117
9118 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9119
9120         * decl.cs: Check access levels when resolving types
9121
9122 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9123
9124         * statement.cs: Add parameters and locals set in catch blocks that might 
9125         return to set vector
9126
9127 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9128
9129         * class.cs (Operator): Set the SpecialName flags for operators.
9130
9131         * expression.cs (Invocation.DoResolve): Only block calls to
9132         accessors and operators on SpecialName methods.
9133
9134         (Cast.TryReduce): Handle conversions from char constants.
9135
9136
9137 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9138
9139         * statement.cs: small memory and time optimization in FlowBranching.
9140
9141 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9142
9143         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9144         problem that the last fix but in the other sid (Set).
9145
9146         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9147         access when there is no indexer in the hierarchy.
9148
9149 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9150
9151         * class.cs: Combine some if statements.
9152
9153 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9154
9155         * driver.cs: fixed bug #37187.
9156
9157 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9158
9159         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9160         any indexer, it's needed to build a list with all the indexers in the
9161         hierarchy (AllGetters), else we have problems. Fixes #35653.
9162
9163 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9164
9165         * class.cs (MethodData.Define): It is wrong for an interface
9166         implementation to be static in both cases: explicit and implicit.
9167         We were only handling this in one case.
9168
9169         Improve the if situation there to not have negations.
9170
9171         * class.cs (Field.Define): Turns out that we do not need to check
9172         the unsafe bit on field definition, only on usage.  Remove the test.
9173
9174 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9175
9176         * driver.cs: use assembly.Location instead of Codebase (the latest
9177         patch made mcs fail when using MS assemblies).
9178
9179 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9180
9181         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9182         get the path to *corlib.dll.
9183
9184 2003-01-21  Nick Drochak <ndrochak@gol.com>
9185
9186         * cs-tokenizer.cs:
9187         * pending.cs:
9188         * typemanager.cs: Remove compiler warnings
9189
9190 2003-01-20  Duncan Mak  <duncan@ximian.com>
9191
9192         * AssemblyInfo.cs: Bump the version number to 0.19.
9193
9194 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9195
9196         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9197
9198 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9199
9200         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9201
9202 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9203
9204         * cs-parser.jay: Small fix: we were not comparing the constructor
9205         name correctly.   Thanks to Zoltan for the initial pointer.
9206
9207 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9208
9209         * cs-tokenizer.cs: Set file name when specified with #line
9210
9211 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9212
9213         * cs-parser.jay: Only perform the constructor checks here if we
9214         are named like the class;  This will help provider a better
9215         error.  The constructor path is taken when a type definition is
9216         not found, but most likely the user forgot to add the type, so
9217         report that rather than the constructor error.
9218
9219 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9220
9221         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9222         allocations.
9223
9224 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9225
9226         * cs-parser.jay: Add cleanup call.
9227
9228 2003-01-13  Duncan Mak  <duncan@ximian.com>
9229
9230         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9231         consistent with other methods.
9232
9233 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9234
9235         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9236
9237 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9238
9239         * attribute.cs: only set GuidAttr to true when we have a
9240         GuidAttribute.
9241
9242 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9243
9244         * ecore.cs:
9245         * expression.cs:
9246         * typemanager.cs: fixes to allow mcs compile corlib with the new
9247         Type.IsSubclassOf fix.
9248
9249 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9250
9251         * expression.cs (LocalVariableReference.DoResolve): Classify a
9252         constant as a value, not as a variable.   Also, set the type for
9253         the variable.
9254
9255         * cs-parser.jay (fixed_statement): take a type instead of a
9256         pointer_type, so we can produce a better error message later.
9257
9258         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9259         as an error.  
9260
9261         (For.DoEmit): Make inifinite loops have a
9262         non-conditional branch back.
9263
9264         (Fixed.DoEmit): First populate the pinned variables, then emit the
9265         statement, then clear the variables.  Before I was emitting the
9266         code once for each fixed piece.
9267
9268
9269 2003-01-08  Martin Baulig  <martin@ximian.com>
9270
9271         * statement.cs (FlowBranching.MergeChild): A break in a
9272         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9273
9274 2003-01-08  Martin Baulig  <martin@ximian.com>
9275
9276         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9277         lives in the same number space than `param_map'.  Fixes #36154.
9278
9279 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9280
9281         * cs-parser.jay (constructor_declaration): Set the
9282         Constructor.ModFlags before probing for it.  This makes the
9283         compiler report 514, 515 and 132 (the code was there, but got
9284         broken). 
9285
9286         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9287         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9288         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9289
9290 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9291
9292         * enum.cs: create the enum static fields using the enum type.
9293
9294 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9295
9296         * class.cs: don't try to create the ParamBuilder for the return
9297         type if it's not needed (and handle it breaking for the ms runtime
9298         anyway).
9299
9300 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9301
9302         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9303
9304 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9305
9306         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9307         the command.   This showed up while compiling the JANET source
9308         code, which used \r as its only newline separator.
9309
9310 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9311
9312         * class.cs (Method.Define): If we are an operator (because it
9313         reuses our code), then set the SpecialName and HideBySig.  #36128
9314
9315 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9316
9317         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9318         exception, report error 120 `object reference required'.
9319
9320         * driver.cs: Add --pause option, used during to measure the size
9321         of the process as it goes with --timestamp.
9322
9323         * expression.cs (Invocation.DoResolve): Do not allow methods with
9324         SpecialName to be invoked.
9325
9326 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9327
9328         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9329         number before adding it.
9330
9331 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9332
9333         * ecore.cs (StandardImplicitConversion): When in an unsafe
9334         context, we allow conversion between void * to any other pointer
9335         type. This fixes bug #35973.
9336
9337 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9338
9339         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9340         is not thrown when extensionless outputs are used 
9341
9342 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9343
9344         * rootcontext.cs: fixed compilation of corlib.
9345
9346 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * attribute.cs (Attributes.Contains): Add new method.
9349
9350         * class.cs (MethodCore.LabelParameters): if the parameter is an
9351         `out' parameter, check that no attribute `[In]' has been passed.
9352
9353         * enum.cs: Handle the `value__' name in an enumeration.
9354
9355 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9356
9357         * decl.cs: Added special case to allow overrides on "protected
9358         internal" methods
9359
9360 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9361
9362         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9363         since it makes much more sense.
9364
9365         (Attributes.ctor): Don't require a Location parameter.
9366
9367         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9368
9369         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9370         since we already have that information per attribute.
9371
9372         * everywhere : make appropriate changes.
9373
9374         * class.cs (LabelParameters): Write the code which actually
9375         applies attributes to the return type. We can't do this on the MS
9376         .NET runtime so we flag a warning in the case an exception is
9377         thrown.
9378
9379 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9380
9381         * const.cs: Handle implicit null conversions here too.
9382
9383 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9384
9385         * class.cs (MethodCore.LabelParameters): Remove the extra
9386         Type [] parameter since it is completely unnecessary. Instead
9387         pass in the method's attributes so that we can extract
9388         the "return" attribute.
9389
9390 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9391
9392         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9393         of ignoring it and letting the compile continue.
9394
9395         * typemanager.cs (ChangeType): use an extra argument to return an
9396         error condition instead of throwing an exception.
9397
9398 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9399
9400         * expression.cs (Unary.TryReduce): mimic the code for the regular
9401         code path.  Perform an implicit cast in the cases where we can
9402         implicitly convert to one of the integral types, and then reduce
9403         based on that constant.   This fixes bug #35483.
9404
9405 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9406
9407         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9408
9409 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9410
9411         * namespace.cs: fixed bug #35489.
9412
9413 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9414
9415         * class.cs: Remove some dead code.
9416
9417         * cs-parser.jay: Estimate the number of methods needed
9418         (RootContext.MethodCount);
9419
9420         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9421         numbers instead of StringBuilders.
9422
9423         * support.cs (PtrHashtable): Add constructor with initial size;
9424         We can now reduce reallocations of the method table.
9425
9426 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9427
9428         * attribute.cs (ApplyAttributes): Keep track of the emitted
9429         attributes on a per-target basis. This fixes bug #35413.
9430
9431 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9432
9433         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9434         default to the Windows 1252 encoding.
9435
9436         (UnixParseOption): Support version, thanks to Alp for the missing
9437         pointer. 
9438
9439         * AssemblyInfo.cs: Add nice assembly information.
9440
9441         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9442         (bug 35169).
9443
9444         * cs-parser.jay: Allow a trailing comma before the close bracked
9445         in the attribute_section production.
9446
9447         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9448         address of the instance was being taken, I will take this out,
9449         because we take the address of the object immediately here.
9450
9451 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9452
9453         * typemanager.cs (AreMultipleAllowed): Take care of the most
9454         obvious case where attribute type is not in the current assembly -
9455         stupid me ;-)
9456
9457 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9458
9459         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9460         definitions, instead of doing that afterwards.  
9461
9462         Also we use a nice little hack, depending on the constructor, we
9463         know if we are a "composed" name or a simple name.  Hence, we
9464         avoid the IndexOf test, and we avoid 
9465
9466         * codegen.cs: Add code to assist in a bug reporter to track down
9467         the source of a compiler crash. 
9468
9469 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9470
9471         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9472         types have been emitted for a given element and flag an error
9473         if something which does not have AllowMultiple set is used more
9474         than once.
9475
9476         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9477         attribute types and their corresponding AllowMultiple properties
9478
9479         (AreMultipleAllowed): Check the property for a given type.
9480
9481         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9482         property in the case we have a TypeContainer.
9483
9484         (Attributes.AddAttribute): Detect duplicates and just skip on
9485         adding them. This trivial fix catches a pretty gross error in our
9486         attribute emission - global attributes were being emitted twice!
9487
9488         Bugzilla bug #33187 is now fixed.
9489
9490 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9491
9492         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9493         instead of pp_and).
9494
9495         * expression.cs (Binary.ResolveOperator): I can only use the
9496         Concat (string, string, string) and Concat (string, string,
9497         string, string) if the child is actually a concatenation of
9498         strings. 
9499
9500 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9501
9502         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9503         context where we need a 2-character lookahead.
9504
9505         * pending.cs (PendingImplementation): Rework so we can keep track
9506         of interface types all the time, and flag those which were
9507         implemented by parents as optional.
9508
9509 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9510
9511         * expression.cs (Binary.ResolveOperator): Use
9512         String.Concat(string,string,string) or
9513         String.Concat(string,string,string,string) when possible. 
9514
9515         * typemanager: More helper methods.
9516
9517
9518 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9519
9520         * pending.cs: remove the bogus return from GetMissingInterfaces()
9521         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9522
9523 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9524
9525         * namespace.cs: avoid duplicated 'using xxx' being added to
9526         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9527         when we get more than one 'using' statement for the same namespace.
9528         Report a CS0105 warning for it.
9529
9530 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9531
9532         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9533         of calling getChar/putback, uses internal knowledge of it.    
9534
9535         (xtoken): Reorder tokenizer so most common patterns are checked
9536         first.  This reduces the compilation time in another 5% (from 8.11s
9537         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9538
9539         The parsing time is 22% of the compilation in mcs, and from that
9540         64% is spent on the tokenization process.  
9541
9542         I tried using a binary search for keywords, but this is slower
9543         than the hashtable.  Another option would be to do a couple of
9544         things:
9545
9546                 * Not use a StringBuilder, instead use an array of chars,
9547                   with a set value.  Notice that this way we could catch
9548                   the 645 error without having to do it *afterwards*.
9549
9550                 * We could write a hand-parser to avoid the hashtable
9551                   compares altogether.
9552
9553         The identifier consumption process takes 37% of the tokenization
9554         time.  Another 15% is spent on is_number.  56% of the time spent
9555         on is_number is spent on Int64.Parse:
9556
9557                 * We could probably choose based on the string length to
9558                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9559                   computations. 
9560
9561         Another 3% is spend on wrapping `xtoken' in the `token' function.
9562
9563         Handle 0xa0 as whitespace (#34752)
9564
9565 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9566
9567         * typemanager.cs (IsCLRType): New routine to tell whether a type
9568         is one of the builtin types.  
9569
9570         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9571         typecode in more places instead of doing pointer comparissions.
9572         We could leverage some knowledge about the way the typecodes are
9573         laid out.
9574
9575         New code to cache namespaces in assemblies, it is currently not
9576         invoked, to be used soon.
9577
9578         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9579
9580         * expression.cs (Binary.ResolveOperator): specially handle
9581         strings, and do not perform user-defined operator overloading for
9582         built-in types.
9583
9584 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9585
9586         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9587         internalcall as it is a pretty simple operation;  Avoid whenever
9588         possible to call Char.IsLetter.
9589
9590         (consume_identifier): Cut by half the number of
9591         hashtable calls by merging the is_keyword and GetKeyword behavior.
9592
9593         Do not short-circuit, because if we do, we
9594         report errors (ie, #if false && true would produce an invalid
9595         directive error);
9596
9597
9598 2002-11-24  Martin Baulig  <martin@ximian.com>
9599
9600         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9601         check constant ranges and report a CS0221.  Fixes #33186.
9602
9603 2002-11-24  Martin Baulig  <martin@ximian.com>
9604
9605         * cs-parser.jay: Make this work for uninitialized variable
9606         declarations in the `for' initializer.  Fixes #32416.
9607
9608 2002-11-24  Martin Baulig  <martin@ximian.com>
9609
9610         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9611         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9612
9613 2002-11-24  Martin Baulig  <martin@ximian.com>
9614
9615         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9616         argument; if true, we also check for user-defined conversions.
9617         This is only needed if both arguments are of a user-defined type.
9618         Fixes #30443, added test-175.cs.
9619         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9620
9621         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9622
9623 2002-11-24  Martin Baulig  <martin@ximian.com>
9624
9625         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9626         function to get the store opcode.
9627         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9628         only emit the Ldelema if the store opcode is Stobj.  You must run
9629         both test-34 and test-167 to test this.  Fixes #34529.
9630
9631 2002-11-23  Martin Baulig  <martin@ximian.com>
9632
9633         * ecore.cs (Expression.MemberLookup): Added additional
9634         `qualifier_type' argument which is used when we're being called
9635         from MemberAccess.DoResolve() and null if we're called from a
9636         SimpleName lookup.
9637         (Expression.MemberLookupFailed): New method to report errors; this
9638         does the CS1540 check and reports the correct error message.
9639
9640         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9641         argument for the CS1540 check and redone the way how we're dealing
9642         with private members.  See the comment in the source code for details.
9643         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9644         `closure_start_type' to `closure_qualifier_type' and check whether
9645         it's not null.  It was not this filter being broken, it was just
9646         being called with the wrong arguments.
9647
9648         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9649         and pass it the correct `qualifier_type'; this also does the error
9650         handling for us.
9651
9652 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9653
9654         * expression.cs (Invocation.EmitParams): If the we are dealing
9655         with a non-built-in value type, load its address as well.
9656
9657         (ArrayCreation): Use a a pretty constant instead
9658         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9659         static initializers.  
9660
9661         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9662         because they are not really value types, just glorified integers. 
9663
9664         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9665
9666         * ecore.cs: Remove redundant code for enumerations, make them use
9667         the same code path as everything else, fixes the casting issue
9668         with enumerations in Windows.Forms.
9669
9670         * attribute.cs: Do only cast to string if it is a string, the
9671         validation happens later.
9672
9673         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9674         people upgrade their corlibs.
9675
9676         * ecore.cs: Oops, enumerations were not following the entire code path
9677
9678 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9679
9680         * typemanager.cs (FilterWithClosure): Commented out the test for
9681         1540 in typemanager.cs, as it has problems when accessing
9682         protected methods from a parent class (see test-174.cs). 
9683
9684         * attribute.cs (Attribute.ValidateGuid): new method.
9685         (Attribute.Resolve): Use above.
9686
9687 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9688
9689         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9690
9691         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9692         handling for enumerations, as we only needed the TypeContainer
9693         functionality to begin with (this is required for the fix below to
9694         work for enums that reference constants in a container class for
9695         example). 
9696
9697         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9698
9699         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9700         a valid TypeBuilder to perform lookups on.o
9701
9702         * class.cs (InheritableMemberSignatureCompare): Use true in the
9703         call to GetGetMethod and GetSetMethod, because we are comparing
9704         the signature, and we need to get the methods *even* if they are
9705         private. 
9706
9707         (PropertyBase.CheckBase): ditto.
9708
9709         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9710         GotoCase.Resolve): Use Peel on EmpytCasts.
9711
9712         * ecore.cs (EmptyCast): drop child, add Peel method.
9713
9714 2002-11-17  Martin Baulig  <martin@ximian.com>
9715
9716         * ecore.cs (EmptyCast.Child): New public property.
9717
9718         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9719         label resolved to an EmptyCast.  Fixes #34162.
9720         (GotoCase.Resolve): Likewise.
9721         (Block.EmitMeta): Likewise.
9722
9723 2002-11-17  Martin Baulig  <martin@ximian.com>
9724
9725         * expression.cs (Invocation.BetterConversion): Prefer int over
9726         uint; short over ushort; long over ulong for integer literals.
9727         Use ImplicitConversionExists instead of StandardConversionExists
9728         since we also need to check for user-defined implicit conversions.
9729         Fixes #34165.  Added test-173.cs.
9730
9731 2002-11-16  Martin Baulig  <martin@ximian.com>
9732
9733         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9734         with the `true' and `false' literals.  Fixes #33151.
9735
9736 2002-11-16  Martin Baulig  <martin@ximian.com>
9737
9738         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9739         October 22nd; don't do the cs1540 check for static members.
9740
9741         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9742         now using our own filter here and doing the cs1540 check again.
9743
9744 2002-11-16  Martin Baulig  <martin@ximian.com>
9745
9746         * support.cs (InternalParameters): Don't crash if we don't have
9747         any fixed parameters.  Fixes #33532.
9748
9749 2002-11-16  Martin Baulig  <martin@ximian.com>
9750
9751         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9752         when looking up static methods to make this work on Windows.
9753         Fixes #33773.
9754
9755 2002-11-16  Martin Baulig  <martin@ximian.com>
9756
9757         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9758         a setter rather than using PropertyInfo.CanWrite.
9759
9760 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9761
9762         * class.cs: Allow acces to block member by subclasses. Fixes build
9763         breaker.
9764
9765 2002-11-14  Martin Baulig  <martin@ximian.com>
9766
9767         * class.cs (Constructor.Emit): Added the extern/block check.
9768         Fixes bug #33678.
9769
9770 2002-11-14  Martin Baulig  <martin@ximian.com>
9771
9772         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9773         iteration while looking for indexers, this is needed because the
9774         indexer may have a different name in our base classes.  Fixed the
9775         error reporting (no indexers at all, not get accessor, no
9776         overloaded match).  Fixes bug #33089.
9777         (IndexerAccess.DoResolveLValue): Likewise.
9778
9779 2002-11-14  Martin Baulig  <martin@ximian.com>
9780
9781         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9782         indexers.  Fixes the first part of bug #33089.
9783         (MethodSignature.InheritableMemberSignatureCompare): Added support
9784         for properties.
9785
9786 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9787
9788         * attribute.cs (Attribute.Resolve): Catch the
9789         NullReferenceException and report it since it isn't supposed to
9790         happen. 
9791
9792 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9793
9794         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9795         LogicalOr and LogicalAnd that can benefit from recursively
9796         handling EmitBranchable.  The code now should be nice for Paolo.
9797
9798 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9799
9800         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9801         the Type lookups, as we perform quite a number of lookups on
9802         non-Types.  This can be removed once we can deterministically tell
9803         whether we have a type or a namespace in advance.
9804
9805         But this might require special hacks from our corlib.
9806
9807         * TODO: updated.
9808
9809         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9810         and double which avoids a conversion from an integer to a double.
9811
9812         * expression.cs: tiny optimization, avoid calling IsConstant,
9813         because it effectively performs the lookup twice.
9814
9815 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9816
9817         But a bogus return here to keep the semantics of the old code
9818         until the Mono runtime is fixed.
9819
9820         * pending.cs (GetMissingInterfaces): New method used to remove all
9821         the interfaces that are already implemented by our parent
9822         classes from the list of pending methods. 
9823
9824         * interface.cs: Add checks for calls after ResolveTypeExpr.
9825
9826 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9827
9828         * class.cs (Class.Emit): Report warning 67: event not used if the
9829         warning level is beyond 3.
9830
9831         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9832         being a NullLiteral.
9833
9834         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9835         specifiers. 
9836
9837         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9838         path that might fail if a type can not be resolved.
9839
9840         * expression.cs (Binary.Emit): Emit unsigned versions of the
9841         operators. 
9842
9843         * driver.cs: use error 5.
9844
9845 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9846
9847         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9848
9849 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9850
9851         * cs-parser.jay (switch_section): A beautiful patch from Martin
9852         Baulig that fixed 33094.
9853
9854 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9855
9856         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9857         Check whether the base is abstract and report an error if so.
9858
9859         * expression.cs (IndexerAccess.DoResolveLValue,
9860         IndexerAccess.DoResolve): ditto. 
9861
9862         (Invocation.DoResolve): ditto.
9863
9864         (Invocation.FullMethodDesc): Improve the report string.
9865
9866         * statement.cs (Block): Eliminate IsVariableDefined as it is
9867         basically just a wrapper for GetVariableInfo.
9868
9869         * ecore.cs (SimpleName): Use new 
9870
9871         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9872         type, as we return the actual parameter ref/unref state on a
9873         different call.
9874
9875 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9876
9877         * support.cs: Return proper flags REF/OUT fixing the previous
9878         commit.  
9879
9880         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9881         not used to mean `ref' but `ref or out' in ParameterReference
9882
9883         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9884         full type signature instead of calling TypeManger.CSharpName
9885         ourselves. 
9886
9887         * support.cs (InternalParameters.ParameterDesc): Do not compare
9888         directly to the modflags, because REF/OUT will actually be bitsets
9889         if set. 
9890
9891         * delegate.cs (VerifyMethod): Check also the modifiers.
9892
9893         * cs-tokenizer.cs: Fix bug where floating point values with an
9894         exponent where a sign was missing was ignored.
9895
9896         * driver.cs: Allow multiple assemblies to be specified in a single
9897         /r: argument
9898
9899 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9900
9901         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9902         because identifiers after a parenthesis would end up in this kind
9903         of production, and we needed to desamiguate it for having casts
9904         like:
9905
9906                 (UserDefinedType *) xxx
9907
9908 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9909
9910         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9911         we should set on the Bindingflags.NonPublic, but not turn on
9912         private_ok.  private_ok controls whether a Private member is
9913         returned (this is chekced on the filter routine), while the
9914         BindingFlags.NonPublic just controls whether private/protected
9915         will be allowed.   This fixes the problem part of the problem of
9916         private properties being allowed to be used in derived classes.
9917
9918         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9919         so we can call the children DoResolveLValue method (this will
9920         properly signal errors on lvalue assignments to base properties)
9921
9922         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9923         getter are null, and we have a property info, we know that this
9924         happened because the lookup failed, so we report an error 122 for
9925         protection level violation.
9926
9927         We also silently return if setter and getter are null in the
9928         resolve functions, this condition only happens if we have flagged
9929         the error before.  This is the other half of the problem. 
9930
9931         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9932         not have accessibility information, that is why we were returning
9933         true in the filter function in typemanager.cs.
9934
9935         To properly report 122 (property is inaccessible because of its
9936         protection level) correctly, we report this error in ResolveAccess
9937         by failing if both the setter and the getter are lacking (ie, the
9938         lookup failed). 
9939
9940         DoResolve and DoLResolve have been modified to check for both
9941         setter/getter being null and returning silently, the reason being
9942         that I did not want to put the knowledge about this error in upper
9943         layers, like:
9944
9945         int old = Report.Errors;
9946         x = new PropertyExpr (...);
9947         if (old != Report.Errors)
9948                 return null;
9949         else
9950                 return x;
9951
9952         So the property expr is returned, but it is invalid, so the error
9953         will be flagged during the resolve process. 
9954
9955         * class.cs: Remove InheritablePropertySignatureCompare from the
9956         class, as we no longer depend on the property signature to compute
9957         whether it is possible to implement a method or not.
9958
9959         The reason is that calling PropertyInfo.GetGetMethod will return
9960         null (in .NET, in Mono it works, and we should change this), in
9961         cases where the Get Method does not exist in that particular
9962         class.
9963
9964         So this code:
9965
9966         class X { public virtual int A { get { return 1; } } }
9967         class Y : X { }
9968         class Z : Y { public override int A { get { return 2; } } }
9969
9970         Would fail in Z because the parent (Y) would not have the property
9971         defined.  So we avoid this completely now (because the alternative
9972         fix was ugly and slow), and we now depend exclusively on the
9973         method names.
9974
9975         (PropertyBase.CheckBase): Use a method-base mechanism to find our
9976         reference method, instead of using the property.
9977
9978         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
9979         routines are gone now.
9980
9981         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
9982         names, they were incorrectly named.
9983
9984         * cs-tokenizer.cs: Return are more gentle token on failure. 
9985
9986         * pending.cs (PendingImplementation.InterfaceMethod): This routine
9987         had an out-of-sync index variable, which caused it to remove from
9988         the list of pending methods the wrong method sometimes.
9989
9990 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
9991
9992         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
9993         CanWrite, because those refer to this particular instance of the
9994         property, and do not take into account the fact that we can
9995         override single members of a property.
9996
9997         Constructor requires an EmitContext.  The resolution process does
9998         not happen here, but we need to compute the accessors before,
9999         because the resolution does not always happen for properties.
10000
10001         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10002         subclass, before we did not update this flag, but we did update
10003         bindingflags. 
10004
10005         (GetAccessors): Drop this routine, as it did not work in the
10006         presence of partially overwritten set/get methods. 
10007
10008         Notice that this broke the cs1540 detection, but that will require
10009         more thinking. 
10010
10011 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10012
10013         * class.cs:
10014         * codegen.cs:
10015         * driver.cs: issue a warning instead of an error if we don't support
10016         debugging for the platform. Also ignore a couple of errors that may
10017         arise when trying to write the symbols. Undo my previous patch.
10018
10019 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10020
10021         * driver.cs: ignore /debug switch except for Unix platforms.
10022
10023 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10024
10025         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10026
10027 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10028
10029         * driver.cs: Do not make mcs-debug conditional, so we do not break
10030         builds that use it.
10031
10032         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10033         review this patch.  But basically after all the children variables
10034         have been merged, the value of "Breaks" was not being set to
10035         new_breaks for Switch blocks.  I think that it should be set after
10036         it has executed.  Currently I set this to the value of new_breaks,
10037         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10038         conservative, but I do not understand this code very well.
10039
10040         I did not break anything in the build, so that is good ;-)
10041
10042         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10043
10044 2002-10-20  Mark Crichton  <crichton@gimp.org>
10045
10046         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10047
10048 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10049
10050         * cfold.cs: Fixed compile blocker.
10051
10052 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10053
10054         * driver.cs: I was chekcing the key, not the file.
10055
10056 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10057
10058         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10059         message that we were generating - we just need to silently return
10060         a null.
10061
10062 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10063
10064         * class.cs (Event.Define): Change my previous commit, as this
10065         breaks the debugger.  This is a temporary hack, as it seems like
10066         the compiler is generating events incorrectly to begin with.
10067
10068         * expression.cs (Binary.ResolveOperator): Added support for 
10069         "U operator - (E x, E y)"
10070
10071         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10072         y)".
10073
10074         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10075         init-only variables, but this path did not take into account that
10076         there might be also instance readonly variables.  Correct this
10077         problem. 
10078
10079         This fixes bug 32253
10080
10081         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10082         delegates as well.
10083
10084         * driver.cs: Change the extension for modules to `netmodule'
10085
10086         * cs-parser.jay: Improved slightly the location tracking for
10087         the debugger symbols.
10088
10089         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10090         modifiers that were specified instead of the hardcoded value
10091         (FamAndAssem).  This was basically ignoring the static modifier,
10092         and others.  Fixes 32429.
10093
10094         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10095         fixed a bug in the process (32476)
10096
10097         * expression.cs (ArrayAccess.EmitAssign): Patch from
10098         hwang_rob@yahoo.ca that fixes bug 31834.3
10099
10100 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10101
10102         * driver.cs: Make the module extension .netmodule.
10103
10104 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10105
10106         * driver.cs: Report an error if the resource file is not found
10107         instead of crashing.
10108
10109         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10110         false, like Emit does.
10111
10112 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10113
10114         * typemanager.cs: Remove unused private member.  Also reported mcs
10115         bug to report this as a warning like csc.
10116
10117 2002-10-15  Martin Baulig  <martin@gnome.org>
10118
10119         * statement.cs (Statement.Emit): Made this a virtual method; emits
10120         the line number info and calls DoEmit().
10121         (Statement.DoEmit): New protected abstract method, formerly knows
10122         as Statement.Emit().
10123
10124         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10125
10126 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10127
10128         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10129         have fixed a remaining problem: not every AddXXXX was adding a
10130         fully qualified name.  
10131
10132         Now everyone registers a fully qualified name in the DeclSpace as
10133         being defined instead of the partial name.  
10134
10135         Downsides: we are slower than we need to be due to the excess
10136         copies and the names being registered this way.  
10137
10138         The reason for this is that we currently depend (on the corlib
10139         bootstrap for instance) that types are fully qualified, because
10140         we dump all the types in the namespace, and we should really have
10141         types inserted into the proper namespace, so we can only store the
10142         basenames in the defined_names array.
10143
10144 2002-10-10  Martin Baulig  <martin@gnome.org>
10145
10146         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10147         from bug #31834, see the bug report for a testcase which is
10148         miscompiled.
10149
10150 2002-10-10  Martin Baulig  <martin@gnome.org>
10151
10152         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10153         flow analysis code for this.
10154
10155         * statement.cs (Do, While, For): Tell the flow analysis code about
10156         infinite loops.
10157         (FlowBranching.UsageVector): Added support for infinite loops.
10158         (Block.Resolve): Moved the dead code elimination here and use flow
10159         analysis to do it.
10160
10161 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10162
10163         * class.cs (Field.Define): Catch cycles on struct type
10164         definitions. 
10165
10166         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10167         fields if the fields are static.  We only need to check instance
10168         fields. 
10169
10170         * expression.cs (As.DoResolve): Test for reference type.
10171
10172         * statement.cs (Using.ResolveExpression): Use
10173         ConvertImplicitRequired, not ConvertImplicit which reports an
10174         error on failture
10175         (Using.ResolveLocalVariableDecls): ditto.
10176
10177         * expression.cs (Binary.ResolveOperator): Report errors in a few
10178         places where we had to.
10179
10180         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10181
10182 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10183
10184         * expression.cs: Use StoreFromPtr instead of extracting the type
10185         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10186
10187         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10188         an enumeration value to a System.Enum, but System.Enum is not a
10189         value type, but an class type, so we need to box.
10190
10191         (Expression.ConvertExplicit): One codepath could return
10192         errors but not flag them.  Fix this.  Fixes #31853
10193
10194         * parameter.cs (Resolve): Do not allow void as a parameter type.
10195
10196 2002-10-06  Martin Baulig  <martin@gnome.org>
10197
10198         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10199         if it's a class type and not a struct.  Fixes #31815.
10200
10201 2002-10-06  Martin Baulig  <martin@gnome.org>
10202
10203         * statement.cs: Reworked the flow analysis code a bit to make it
10204         usable for dead code elimination.
10205
10206 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10207
10208         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10209
10210 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10211
10212         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10213         to fix the test 165, will investigate deeper.
10214
10215 2002-10-04  Martin Baulig  <martin@gnome.org>
10216
10217         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10218         finally blocks actually work.
10219         (Try.Resolve): We don't need to create a sibling for `finally' if
10220         there is no finally block.
10221
10222 2002-10-04  Martin Baulig  <martin@gnome.org>
10223
10224         * class.cs (Constructor.Define): The default accessibility for a
10225         non-default constructor is private, not public.
10226
10227 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * class.cs (Constructor): Make AllowedModifiers public, add
10230         EXTERN.
10231
10232         * cs-parser.jay: Perform the modifiers test here, as the
10233         constructor for the Constructor class usually receives a zero
10234         because of the way we create it (first we create, later we
10235         customize, and we were never checking the modifiers).
10236
10237         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10238         is a version of LookupTypeReflection that includes the type-name
10239         cache.  This can be used as a fast path for functions that know
10240         the fully qualified name and are only calling into *.GetType() to
10241         obtain a composed type.
10242
10243         This is also used by TypeManager.LookupType during its type
10244         composition.
10245
10246         (LookupType): We now also track the real type name, as sometimes
10247         we can get a quey for the real type name from things like
10248         ComposedCast.  This fixes bug 31422.
10249
10250         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10251         complete type fullname, it does not have to go through the type
10252         resolution system to obtain the composed version of the type (for
10253         obtaining arrays or pointers).
10254
10255         (Conditional.Emit): Use the EmitBoolExpression to
10256         generate nicer code, as requested by Paolo.
10257
10258         (ArrayCreation.CheckIndices): Use the patch from
10259         hwang_rob@yahoo.ca to validate the array initializers. 
10260
10261 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * class.cs (ConstructorInitializer.Emit): simplify code by using
10264         Invocation.EmitCall, and at the same time, fix the bugs in calling
10265         parent constructors that took variable arguments. 
10266
10267         * ecore.cs (Expression.ConvertNumericExplicit,
10268         Expression.ImplicitNumericConversion): Remove the code that
10269         manually wrapped decimal (InternalTypeConstructor call is now gone
10270         as well).
10271
10272         * expression.cs (Cast.TryReduce): Also handle decimal types when
10273         trying to perform a constant fold on the type.
10274
10275         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10276
10277         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10278         that only turned off an error report, and did nothing else. 
10279
10280 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10281
10282         * driver.cs: Handle and ignore /fullpaths
10283
10284 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10285
10286         * expression.cs (Binary.ResolveOperator): Catch the case where
10287         DoNumericPromotions returns true, 
10288
10289         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10290
10291 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10292
10293         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10294         report error 70.
10295
10296 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10297
10298         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10299         conversion exists, but it is also required that the conversion be
10300         performed.  This manifested in "(Type64Enum) 2".  
10301
10302         * class.cs (TypeManager.AddMethod): The fix is not to change
10303         AddEnum, because that one was using a fully qualified name (every
10304         DeclSpace derivative does), but to change the AddMethod routine
10305         that was using an un-namespaced name.  This now correctly reports
10306         the duplicated name.
10307
10308         Revert patch until I can properly fix it.  The issue
10309         is that we have a shared Type space across all namespaces
10310         currently, which is wrong.
10311
10312         Options include making the Namespace a DeclSpace, and merge
10313         current_namespace/current_container in the parser.
10314
10315 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10316
10317         * cs-parser.jay: Improve error reporting when we get a different
10318         kind of expression in local_variable_type and
10319         local_variable_pointer_type. 
10320
10321         Propagate this to avoid missleading errors being reported.
10322
10323         * ecore.cs (ImplicitReferenceConversion): treat
10324         TypeManager.value_type as a target just like object_type.   As
10325         code like this:
10326
10327         ValueType v = 1;
10328
10329         Is valid, and needs to result in the int 1 being boxed before it
10330         is assigned to the value type v.
10331
10332         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10333         to validate the enumeration name.
10334
10335         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10336         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10337         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10338
10339         * ecore.cs (TryImplicitIntConversion): When doing an
10340         implicit-enumeration-conversion, check if the type is 64-bits and
10341         perform a conversion before passing to EnumConstant.
10342
10343 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10344
10345         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10346         report ambiguous type references.  Unlike the MS version, we
10347         report what the ambiguity is.   Innovation at work ;-)
10348
10349         (DeclSpace.FindType): Require a location argument to
10350         display when we display an ambiguous error.
10351
10352         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10353
10354         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10355
10356         * expression.cs (EmitDynamicInitializers): Apply patch from
10357         hwang_rob@yahoo.ca that fixes the order in which we emit our
10358         initializers. 
10359
10360 2002-09-21  Martin Baulig  <martin@gnome.org>
10361
10362         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10363         delegate takes no arguments.
10364
10365 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10366
10367         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10368         from integers.
10369
10370         * expression.cs: Extract the underlying type.
10371
10372         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10373
10374         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10375
10376 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10377
10378         * class.cs (TypeContainer.DefineType): We can not use the nice
10379         PackingSize with the size set to 1 DefineType method, because it
10380         will not allow us to define the interfaces that the struct
10381         implements.
10382
10383         This completes the fixing of bug 27287
10384
10385         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10386         means also structs.  This fixes part of the problem. 
10387         (Expresion.ImplicitReferenceConversionExists): ditto.
10388
10389         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10390         error if there were no errors reported during the type lookup
10391         process, to avoid duplicates or redundant errors.  Without this
10392         you would get an ambiguous errors plus a type not found.  We have
10393         beaten the user enough with the first error.  
10394
10395         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10396         reference. 
10397
10398         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10399         during the resolution process, stop the lookup, this avoids
10400         repeated error reports (same error twice).
10401
10402         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10403
10404         * typemanager.cs (LookupType): Redo the type lookup code to match
10405         the needs of System.Reflection.  
10406
10407         The issue is that System.Reflection requires references to nested
10408         types to begin with a "+" sign instead of a dot.  So toplevel
10409         types look like: "NameSpace.TopLevelClass", and nested ones look
10410         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10411         levels. 
10412
10413 2002-09-19  Martin Baulig  <martin@gnome.org>
10414
10415         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10416         says that a method always returns or always throws an exception,
10417         don't report the CS0161.
10418
10419         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10420         set `Returns = new_returns'.
10421
10422 2002-09-19  Martin Baulig  <martin@gnome.org>
10423
10424         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10425         to an enum constant, check for a CS0176.
10426
10427 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10430         for operators that must be in pairs and report errors.
10431
10432         * ecore.cs (SimpleName.DoResolveType): During the initial type
10433         resolution process, when we define types recursively, we must
10434         check first for types in our current scope before we perform
10435         lookups in the enclosing scopes.
10436
10437         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10438
10439         (Invocation.VerifyArgumentsCompat): Call
10440         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10441         I thought we were supposed to always call this, but there are a
10442         few places in the code where we dont do it.
10443
10444 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10445
10446         * driver.cs: Add support in -linkres and -resource to specify the
10447         name of the identifier.
10448
10449 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10450
10451         * ecore.cs (StandardConversionExists): Sync with the conversion
10452         code: allow anything-* to void* conversions.
10453
10454         (FindMostSpecificSource): Use an Expression argument
10455         instead of a Type, because we might be handed over a Literal which
10456         gets a few more implicit conversions that plain types do not.  So
10457         this information was being lost.
10458
10459         Also, we drop the temporary type-holder expression when not
10460         required.
10461
10462 2002-09-17  Martin Baulig  <martin@gnome.org>
10463
10464         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10465         this is an explicit interface implementation.
10466
10467 2002-09-17  Martin Baulig  <martin@gnome.org>
10468
10469         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10470         different `IndexerName' attributes.
10471
10472         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10473         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10474         virtual CommonResolve().
10475
10476 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10477
10478         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10479         and convert that to the UnderlyingType.
10480
10481         * statement.cs (Foreach.Resolve): Indexers are just like variables
10482         or PropertyAccesses.
10483
10484         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10485         inside quoted strings, we were not doing this before.
10486
10487 2002-09-16  Martin Baulig  <martin@gnome.org>
10488
10489         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10490         resolve it.  This is needed for the definite assignment check of the
10491         instance expression, fixes bug #29846.
10492         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10493
10494 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10495
10496         * parameter.cs: Fix compile error.  Cannot reference static member
10497         from an instance object.  Is this an mcs bug?
10498
10499 2002-09-14  Martin Baulig  <martin@gnome.org>
10500
10501         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10502         multiple times.  Fixes bug #30295, added test-166.cs.
10503
10504 2002-09-14  Martin Baulig  <martin@gnome.org>
10505
10506         * statement.cs (Block.Emit): Don't emit unreachable code.
10507         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10508         `break' statements.
10509         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10510
10511 2002-09-14  Martin Baulig  <martin@gnome.org>
10512
10513         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10514         is set.
10515
10516 2002-09-14  Martin Baulig  <martin@gnome.org>
10517
10518         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10519         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10520         be false on the ms runtime.
10521
10522 2002-09-13  Martin Baulig  <martin@gnome.org>
10523
10524         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10525         the CS0038 error message.
10526
10527 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10530         constant inside, return it.
10531
10532 2002-09-12  Martin Baulig  <martin@gnome.org>
10533
10534         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10535         implicit conversion can be done between enum types.
10536
10537         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10538         check whether an implicit conversion to the current enum's UnderlyingType
10539         exists and report an error if not.
10540
10541         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10542         without debugging support.
10543
10544         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10545         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10546
10547 2002-09-12  Martin Baulig  <martin@gnome.org>
10548
10549         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10550
10551         * ecore.cs (IMemberExpr.DeclaringType): New property.
10552         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10553         nonstatic member of an outer type (CS0038).
10554
10555 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10556
10557         * driver.cs: Activate the using-error detector at warning level
10558         4 (at least for MS-compatible APIs).
10559
10560         * namespace.cs (VerifyUsing): Small buglett fix.
10561
10562         * pending.cs (PendingImplementation): pass the container pointer. 
10563
10564         * interface.cs (GetMethods): Allow for recursive definition.  Long
10565         term, I would like to move every type to support recursive
10566         definitions, not the current ordering mechanism that we have right
10567         now.
10568
10569         The situation is this: Attributes are handled before interfaces,
10570         so we can apply attributes to interfaces.  But some attributes
10571         implement interfaces, we will now handle the simple cases
10572         (recursive definitions will just get an error).  
10573
10574         * parameter.cs: Only invalidate types at the end if we fail to
10575         lookup all types.  
10576
10577 2002-09-09  Martin Baulig  <martin@gnome.org>
10578
10579         * ecore.cs (PropertyExpr.Emit): Also check for
10580         TypeManager.system_int_array_get_length so this'll also work when
10581         compiling corlib.  Fixes #30003.
10582
10583 2002-09-09  Martin Baulig  <martin@gnome.org>
10584
10585         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10586         and throw an exception if we can't get the type's size.  Fixed #30040,
10587         added test-165.cs.
10588
10589 2002-09-09  Martin Baulig  <martin@gnome.org>
10590
10591         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10592
10593         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10594         context.  Fixes bug #30027.
10595
10596         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10597         virtual functions.  Fixes bug #30043, added test-164.cs.
10598
10599 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10600
10601         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10602
10603 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10604
10605         * driver.cs: Use an object to get the windows codepage since it's not a
10606         static property.
10607
10608 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10609
10610         * statement.cs (For.Emit): for infinite loops (test == null)
10611         return whether there is a break inside, not always "true".
10612
10613         * namespace.cs (UsingEntry): New struct to hold the name of the
10614         using definition, the location where it is defined, and whether it
10615         has been used in a successful type lookup.
10616
10617         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10618         strings.
10619
10620         * decl.cs: ditto.
10621
10622 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10623
10624         * attribute.cs : Fix incorrect code which relied on catching
10625         a NullReferenceException to detect a null being passed in
10626         where an object was expected.
10627
10628 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10629
10630         * statement.cs (Try): flag the catch variable as assigned
10631
10632         * expression.cs (Cast): Simplified by using ResolveType instead of
10633         manually resolving.
10634
10635         * statement.cs (Catch): Fix bug by using ResolveType.
10636
10637 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10638
10639         * expression.cs (BetterConversion): Special case for when we have
10640         a NullLiteral as the argument and we have to choose between string
10641         and object types - we choose string the way csc does.
10642
10643         * attribute.cs (Attribute.Resolve): Catch the
10644         NullReferenceException and report error #182 since the Mono
10645         runtime no more has the bug and having this exception raised means
10646         we tried to select a constructor which takes an object and is
10647         passed a null.
10648
10649 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10650
10651         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10652         message (1502, 1503) when we can't locate a method after overload
10653         resolution. This is much more informative and closes the bug
10654         Miguel reported.
10655
10656         * interface.cs (PopulateMethod): Return if there are no argument
10657         types. Fixes a NullReferenceException bug.
10658
10659         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10660         expressions too. Previously we were checking only in one place for
10661         positional arguments leaving out named arguments.
10662
10663         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10664         type to the enum type is not allowed. Remove code corresponding to
10665         that.
10666
10667         (ConvertNumericExplicit): Allow explicit conversions from
10668         the underlying type to enum type. This precisely follows the spec
10669         and closes a bug filed by Gonzalo.
10670
10671 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10672
10673         * compiler.csproj:
10674         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10675
10676 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10677
10678         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10679         it was important that we stored the right value after the
10680         reduction in `converted'.
10681
10682 2002-09-04  Martin Baulig  <martin@gnome.org>
10683
10684         * location.cs (Location.SymbolDocument): Use full pathnames for the
10685         source files.
10686
10687 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10688
10689         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10690         of the expression resolve mechanism, because that will catch the
10691         SimpleName error failures.
10692
10693         (Conditional): If we can not resolve the
10694         expression, return, do not crash.
10695
10696 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10697
10698         * cs-tokenizer.cs:
10699         (location): display token name instead of its number.
10700
10701 2002-08-28  Martin Baulig  <martin@gnome.org>
10702
10703         * expression.cs (Binary.ResolveOperator): Don't silently return
10704         but return an error if an operator cannot be applied between two
10705         enum types.
10706
10707 2002-08-28  Martin Baulig  <martin@gnome.org>
10708
10709         * class.cs (Constructor.Define): Set the permission attributes
10710         correctly instead of making all constructors public.
10711
10712 2002-08-28  Martin Baulig  <martin@gnome.org>
10713
10714         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10715         for private members before reporting a CS0103; if we find anything,
10716         it's a CS0122.
10717
10718 2002-08-28  Martin Baulig  <martin@gnome.org>
10719
10720         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10721         to check whether `closure_start_type == closure_invocation_type',
10722         we also need to check whether `m.DeclaringType == closure_invocation_type'
10723         before bypassing the permission checks.  We might be accessing
10724         protected/private members from the base class.
10725         (TypeManager.RealMemberLookup): Only set private_ok if private
10726         members were requested via BindingFlags.NonPublic.
10727
10728         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10729
10730         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10731         MethodGroupExpr.IsExplicitImpl if appropriate.
10732         (Invocation.DoResolve): Don't report the CS0120 for explicit
10733         interface implementations.
10734
10735 2002-08-27  Martin Baulig  <martin@gnome.org>
10736
10737         * expression.cs (Invocation.DoResolve): If this is a static
10738         method and we don't have an InstanceExpression, we must report
10739         a CS0120.
10740
10741 2002-08-25  Martin Baulig  <martin@gnome.org>
10742
10743         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10744         `==' between a valuetype and an object.
10745
10746 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10747
10748         * ecore.cs (TypeExpr): Provide a ToString method.
10749
10750 2002-08-24  Martin Baulig  <martin@gnome.org>
10751
10752         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10753         now called proggie.dbg and it's a binary file.
10754
10755 2002-08-23  Martin Baulig  <martin@gnome.org>
10756
10757         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10758
10759 2002-08-23  Martin Baulig  <martin@gnome.org>
10760
10761         * struct.cs (MyStructInfo.ctor): Make this work with empty
10762         structs; it's not allowed to use foreach() on null.
10763
10764 2002-08-23  Martin Baulig  <martin@gnome.org>
10765
10766         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10767         writer the full pathname of the generated assembly.
10768
10769 2002-08-23  Martin Baulig  <martin@gnome.org>
10770
10771         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10772         A `finally' block never returns or breaks; improved handling of
10773         unreachable code.
10774
10775 2002-08-23  Martin Baulig  <martin@gnome.org>
10776
10777         * statement.cs (Throw.Resolve): Allow `throw null'.
10778
10779 2002-08-23  Martin Baulig  <martin@gnome.org>
10780
10781         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10782         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10783         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10784         MemberLookup would return a wrong event if this is an explicit
10785         interface implementation and the class has an event with the same
10786         name.
10787
10788 2002-08-23  Martin Baulig  <martin@gnome.org>
10789
10790         * statement.cs (Block.AddChildVariableNames): New public method.
10791         (Block.AddChildVariableName): Likewise.
10792         (Block.IsVariableNameUsedInChildBlock): Likewise.
10793         (Block.AddVariable): Check whether a variable name has already
10794         been used in a child block.
10795
10796         * cs-parser.jay (declare_local_variables): Mark all variable names
10797         from the current block as being used in a child block in the
10798         implicit block.
10799
10800 2002-08-23  Martin Baulig  <martin@gnome.org>
10801
10802         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10803         find the symbol writer.
10804
10805         * driver.cs: csc also allows the arguments to /define being
10806         separated by commas, not only by semicolons.
10807
10808 2002-08-23  Martin Baulig  <martin@gnome.org>
10809
10810         * interface.cs (Interface.GetMembers): Added static check for events.
10811
10812 2002-08-15  Martin Baulig  <martin@gnome.org>
10813
10814         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10815         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10816
10817         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10818         why the MethodData.EmitDestructor() change was necessary.
10819
10820 2002-08-20  Martin Baulig  <martin@gnome.org>
10821
10822         * class.cs (TypeContainer.FindMembers): Added static check for events.
10823
10824         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10825
10826         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10827         use Type.GetEvents(), not Type.FindMembers().
10828
10829 2002-08-20  Martin Baulig  <martin@gnome.org>
10830
10831         * decl.cs (MemberCache): Added a special method cache which will
10832         be used for method-only searched.  This ensures that a method
10833         search will return a MethodInfo with the correct ReflectedType for
10834         inherited methods.      
10835
10836 2002-08-20  Martin Baulig  <martin@gnome.org>
10837
10838         * decl.cs (DeclSpace.FindMembers): Made this public.
10839
10840 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10841
10842         * delegate.cs: fixed build on windows.
10843         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10844
10845 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10846
10847         * ecore.cs (StandardConversionExists): Return a false
10848         if we are trying to convert the void type to anything else
10849         since that is not allowed.
10850
10851         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10852         we flag error 70 in the event an event is trying to be accessed
10853         directly from outside the declaring type.
10854
10855 2002-08-20  Martin Baulig  <martin@gnome.org>
10856
10857         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10858         MemberCache from typemanager.cs to decl.cs.
10859
10860 2002-08-19  Martin Baulig  <martin@gnome.org>
10861
10862         * class.cs (TypeContainer): Implement IMemberContainer.
10863         (TypeContainer.DefineMembers): Create the MemberCache.
10864         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10865         return public members if BindingFlags.Public was given, check
10866         whether members are static.
10867
10868 2002-08-16  Martin Baulig  <martin@gnome.org>
10869
10870         * decl.cs (DeclSpace.Define): Splitted this in Define and
10871         DefineMembers.  DefineMembers is called first and initializes the
10872         MemberCache.
10873
10874         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10875         DefineMembers() on all our DeclSpaces.
10876
10877         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10878         but call DefineMembers() on all nested interfaces.  We call their
10879         Define() in our new Define() function.
10880
10881         * interface.cs (Interface): Implement IMemberContainer.
10882         (Interface.Define): Moved all code except the attribute stuf to
10883         DefineMembers().
10884         (Interface.DefineMembers): Initialize the member cache.
10885
10886         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10887         need this anymore since we can use MemberCache.FindMembers directly.
10888
10889 2002-08-19  Martin Baulig  <martin@gnome.org>
10890
10891         * typemanager.cs (MemberCache): When creating the cache for an
10892         interface type, add all inherited members.
10893         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10894         to `out bool used_cache' and documented it.
10895         (TypeManager.MemberLookup): If we already used the cache in the first
10896         iteration, we don't need to do the interfaces check.
10897
10898 2002-08-19  Martin Baulig  <martin@gnome.org>
10899
10900         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10901         here from IMemberFinder and don't implement this interface anymore.
10902         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10903
10904         * typemanager.cs (IMemberFinder): This interface is now only used by
10905         classes which actually support the member cache.
10906         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10907         since we only put DeclSpaces into this Hashtable.
10908         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10909         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10910
10911 2002-08-16  Martin Baulig  <martin@gnome.org>
10912
10913         * typemanager.cs (ICachingMemberFinder): Removed.
10914         (IMemberFinder.MemberCache): New property.
10915         (TypeManager.FindMembers): Merged this with RealFindMembers().
10916         This function will never be called from TypeManager.MemberLookup()
10917         so we can't use the cache here, just the IMemberFinder.
10918         (TypeManager.MemberLookup_FindMembers): Check whether the
10919         IMemberFinder has a MemberCache and call the cache's FindMembers
10920         function.
10921         (MemberCache): Rewrote larger parts of this yet another time and
10922         cleaned it up a bit.
10923
10924 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10925
10926         * driver.cs (LoadArgs): Support quoting.
10927
10928         (Usage): Show the CSC-like command line arguments.
10929
10930         Improved a few error messages.
10931
10932 2002-08-15  Martin Baulig  <martin@gnome.org>
10933
10934         * typemanager.cs (IMemberContainer.Type): New property.
10935         (IMemberContainer.IsInterface): New property.
10936
10937         The following changes are conditional to BROKEN_RUNTIME, which is
10938         defined at the top of the file.
10939
10940         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10941         class'es members, but add all members from TypeHandle.ObjectType
10942         if we're an interface.
10943         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10944         is the current type.
10945         (MemberCache.CacheEntry.Container): Removed this field.
10946         (TypeHandle.GetMembers): Include inherited members.
10947
10948 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10949
10950         * typemanager.cs: fixed compilation and added a comment on a field that
10951         is never used.
10952
10953 2002-08-15  Martin Baulig  <martin@gnome.org>
10954
10955         * class.cs (ConstructorInitializer.Resolve): In the
10956         Expression.MemberLookup call, use the queried_type as
10957         invocation_type.
10958
10959         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10960         declared' attribute, it's always true.
10961         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10962         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10963         temporary wrapper for FindMembers which tells MemberLookup whether
10964         members from the base classes are included in the return value.
10965         This will go away soon.
10966         (TypeManager.MemberLookup): Use this temporary hack here; once the
10967         new MemberCache is completed, we don't need to do the DeclaredOnly
10968         looping here anymore since the MemberCache will take care of this.
10969         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10970         (MemberCache): When creating the MemberCache for a class, get
10971         members from the current class and all its base classes.
10972         (MemberCache.CacheEntry.Container): New field.  This is a
10973         temporary hack until the Mono runtime is fixed to distinguish
10974         between ReflectedType and DeclaringType.  It allows us to use MCS
10975         with both the MS runtime and the unfixed Mono runtime without
10976         problems and without accecting performance.
10977         (MemberCache.SearchMembers): The DeclaredOnly looping from
10978         TypeManager.MemberLookup is now done here.      
10979
10980 2002-08-14  Martin Baulig  <martin@gnome.org>
10981
10982         * statement.cs (MyStructInfo.MyStructInfo): Don't call
10983         Type.GetFields on dynamic types but get the fields from the
10984         corresponding TypeContainer.
10985         (MyStructInfo.GetStructInfo): Added check for enum types.
10986
10987         * typemanager.cs (MemberList.IsSynchronized): Implemented.
10988         (MemberList.SyncRoot): Implemented.
10989         (TypeManager.FilterWithClosure): No need to check permissions if
10990         closure_start_type == closure_invocation_type, don't crash if
10991         closure_invocation_type is null.
10992
10993 2002-08-13  Martin Baulig  <martin@gnome.org>
10994
10995         Rewrote TypeContainer.FindMembers to use a member cache.  This
10996         gives us a speed increase of about 35% for the self-hosting MCS
10997         build and of about 15-20% for the class libs (both on GNU/Linux).
10998
10999         * report.cs (Timer): New class to get enhanced profiling.  This
11000         whole class is "TIMER" conditional since it remarkably slows down
11001         compilation speed.
11002
11003         * class.cs (MemberList): New class.  This is an IList wrapper
11004         which we're now using instead of passing MemberInfo[]'s around to
11005         avoid copying this array unnecessarily.
11006         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11007         (ICachingMemberFinder, IMemberContainer): New interface.
11008         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11009         has already been checked, otherwise use it for the name comparision.
11010         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11011         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11012         if possible.  Returns a MemberList, not a MemberInfo [].
11013         (TypeHandle): New class, implements IMemberContainer.  We create
11014         one instance of this class per type, it contains a MemberCache
11015         which is used to do the member lookups.
11016         (MemberCache): New class.  Each instance of this class contains
11017         all members of a type and a name-based hash table.
11018         (MemberCache.FindMembers): This is our new member lookup
11019         function.  First, it looks up all members of the requested name in
11020         the hash table.  Then, it walks this list and sorts out all
11021         applicable members and returns them.
11022
11023 2002-08-13  Martin Baulig  <martin@gnome.org>
11024
11025         In addition to a nice code cleanup, this gives us a performance
11026         increase of about 1.4% on GNU/Linux - not much, but it's already
11027         half a second for the self-hosting MCS compilation.
11028
11029         * typemanager.cs (IMemberFinder): New interface.  It is used by
11030         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11031         Enum, Delegate or Interface.
11032         (TypeManager.finder_to_member_finder): New PtrHashtable.
11033         (TypeManager.finder_to_container): Removed.
11034         (TypeManager.finder_to_delegate): Removed.
11035         (TypeManager.finder_to_interface): Removed.
11036         (TypeManager.finder_to_enum): Removed.
11037
11038         * interface.cs (Interface): Implement IMemberFinder.
11039
11040         * delegate.cs (Delegate): Implement IMemberFinder.
11041
11042         * enum.cs (Enum): Implement IMemberFinder.
11043
11044         * class.cs (TypeContainer): Implement IMemberFinder.
11045
11046 2002-08-12  Martin Baulig  <martin@gnome.org>
11047
11048         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11049
11050 2002-08-12  Martin Baulig  <martin@gnome.org>
11051
11052         * ecore.cs (ITypeExpression): New interface for expressions which
11053         resolve to a type.
11054         (TypeExpression): Renamed to TypeLookupExpression.
11055         (Expression.DoResolve): If we're doing a types-only lookup, the
11056         expression must implement the ITypeExpression interface and we
11057         call DoResolveType() on it.
11058         (SimpleName): Implement the new ITypeExpression interface.
11059         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11060         hack, the situation that we're only looking up types can't happen
11061         anymore when this method is called.  Moved the type lookup code to
11062         DoResolveType() and call it.
11063         (SimpleName.DoResolveType): This ITypeExpression interface method
11064         is now doing the types-only lookup.
11065         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11066         (ResolveFlags): Added MaskExprClass.
11067
11068         * expression.cs (MemberAccess): Implement the ITypeExpression
11069         interface.
11070         (MemberAccess.DoResolve): Added support for a types-only lookup
11071         when we're called via ITypeExpression.DoResolveType().
11072         (ComposedCast): Implement the ITypeExpression interface.
11073
11074         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11075         Expression.Resolve() with ResolveFlags.Type instead.
11076
11077 2002-08-12  Martin Baulig  <martin@gnome.org>
11078
11079         * interface.cs (Interface.Define): Apply attributes.
11080
11081         * attribute.cs (Attribute.ApplyAttributes): Added support for
11082         interface attributes.
11083
11084 2002-08-11  Martin Baulig  <martin@gnome.org>
11085
11086         * statement.cs (Block.Emit): Only check the "this" variable if we
11087         do not always throw an exception.
11088
11089         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11090         whether the property has a set accessor.
11091
11092 2002-08-11  Martin Baulig  <martin@gnome.org>
11093
11094         Added control flow analysis support for structs.
11095
11096         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11097         with control flow analysis turned off.
11098         (IVariable): New interface.
11099         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11100         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11101         (FieldExpr.DoResolve): Resolve the instance expression with flow
11102         analysis turned off and do the definite assignment check after the
11103         resolving when we know what the expression will resolve to.
11104
11105         * expression.cs (LocalVariableReference, ParameterReference):
11106         Implement the new IVariable interface, only call the flow analysis
11107         code if ec.DoFlowAnalysis is true.
11108         (This): Added constructor which takes a Block argument.  Implement
11109         the new IVariable interface.
11110         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11111         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11112         This does the definite assignment checks for struct members.
11113
11114         * class.cs (Constructor.Emit): If this is a non-static `struct'
11115         constructor which doesn't have any initializer, call
11116         Block.AddThisVariable() to tell the flow analysis code that all
11117         struct elements must be initialized before control returns from
11118         the constructor.
11119
11120         * statement.cs (MyStructInfo): New public class.
11121         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11122         argument to this indexer.  If non-zero, check an individual struct
11123         member, not the whole struct.
11124         (FlowBranching.CheckOutParameters): Check struct members.
11125         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11126         overloaded versions of these methods which take an additional
11127         `int field_idx' argument to check struct members.
11128         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11129         overloaded versions of these methods which take an additional
11130         `string field_name' argument to check struct member.s
11131         (VariableInfo): Implement the IVariable interface.
11132         (VariableInfo.StructInfo): New public property.  Returns the
11133         MyStructInfo instance of the variable if it's a struct or null.
11134         (Block.AddThisVariable): New public method.  This is called from
11135         Constructor.Emit() for non-static `struct' constructor which do
11136         not have any initializer.  It creates a special variable for the
11137         "this" instance variable which will be checked by the flow
11138         analysis code to ensure that all of the struct's fields are
11139         initialized before control returns from the constructor.
11140         (UsageVector): Added support for struct members.  If a
11141         variable/parameter is a struct with N members, we reserve a slot
11142         in the usage vector for each member.  A struct is considered fully
11143         initialized if either the struct itself (slot 0) or all its
11144         members are initialized.
11145
11146 2002-08-08  Martin Baulig  <martin@gnome.org>
11147
11148         * driver.cs (Driver.MainDriver): Only report an error CS5001
11149         if there were no compilation errors.
11150
11151         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11152         `UnsafeContext' property to determine whether the parent is in
11153         unsafe context rather than checking the parent's ModFlags:
11154         classes nested in an unsafe class are unsafe as well.
11155
11156 2002-08-08  Martin Baulig  <martin@gnome.org>
11157
11158         * statement.cs (UsageVector.MergeChildren): Distinguish between
11159         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11160         we return.  Added test17() and test18() to test-154.cs.
11161
11162 2002-08-08  Martin Baulig  <martin@gnome.org>
11163
11164         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11165         Family access, make sure the invoking type isn't a subclass of the
11166         queried type (that'd be a CS1540).
11167
11168         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11169         this method which takes an additional `Type invocation_type'.
11170
11171         * expression.cs (BaseAccess.DoResolve): Use the base type as
11172         invocation and query type.
11173         (MemberAccess.DoResolve): If the lookup failed and we're about to
11174         report a CS0122, try a lookup with the ec.ContainerType - if this
11175         succeeds, we must report a CS1540.
11176
11177 2002-08-08  Martin Baulig  <martin@gnome.org>
11178
11179         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11180         (MethodGroupExpr): Implement the IMemberExpr interface.
11181
11182         * expression (MemberAccess.ResolveMemberAccess): No need to have
11183         any special code for MethodGroupExprs anymore, they're now
11184         IMemberExprs.   
11185
11186 2002-08-08  Martin Baulig  <martin@gnome.org>
11187
11188         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11189         Family, FamANDAssem and FamORAssem permissions.
11190         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11191
11192 2002-08-08  Martin Baulig  <martin@gnome.org>
11193
11194         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11195         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11196         or loop block.
11197
11198 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11199
11200         * driver.cs: implemented /resource option to embed managed resources.
11201
11202 2002-08-07  Martin Baulig  <martin@gnome.org>
11203
11204         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11205         (FieldBase.HasFieldInitializer): New public property.
11206         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11207         returns the field initializer and makes sure it is only resolved once.
11208         (TypeContainer.EmitFieldInitializers): Call
11209         FieldBase.GetInitializerExpression to get the initializer, this ensures
11210         that it isn't resolved multiple times.
11211
11212         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11213         the resolving process (SimpleName/MemberLookup) that we're currently
11214         emitting a field initializer (which must not access any instance members,
11215         this is an error CS0236).
11216
11217         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11218         argument, if the `IsFieldInitializer' flag is set, we must report and
11219         error CS0236 and not an error CS0120.   
11220
11221 2002-08-07  Martin Baulig  <martin@gnome.org>
11222
11223         * ecore.cs (IMemberExpr): New public interface.
11224         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11225         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11226         if the expression is an IMemberExpr.
11227
11228         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11229         to be null, implicitly default to `this' if we're non-static in
11230         this case.  Simplified the code a lot by using the new IMemberExpr
11231         interface.  Also fixed bug #28176 here.
11232
11233 2002-08-06  Martin Baulig  <martin@gnome.org>
11234
11235         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11236         ParameterReferences during semantic analysis so that we can do a
11237         type-only search when resolving Cast, TypeOf and SizeOf.
11238         (block): Pass the `current_local_parameters' to the Block's
11239         constructor.
11240
11241         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11242         argument to the constructor.
11243         (ConstructorInitializer.Resolve): Create a temporary implicit
11244         block with the parameters.
11245
11246         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11247         references here if we aren't doing a type-only search.
11248
11249         * statement.cs (Block): Added constructor which takes a
11250         `Parameters parameters' argument.
11251         (Block.Parameters): New public property.
11252
11253         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11254         to `Parameters' and made it public readonly.
11255
11256 2002-08-06  Martin Baulig  <martin@gnome.org>
11257
11258         * ecore.cs (Expression.Warning): Made this public as well.
11259
11260         * report.cs (Report.Debug): Print the contents of collections.
11261
11262 2002-08-06  Martin Baulig  <martin@gnome.org>
11263
11264         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11265         used to tell Resolve() which kinds of expressions it may return.
11266         (Expression.Resolve): Added overloaded version of this method which
11267         takes a `ResolveFlags flags' argument.  This can be used to tell
11268         Resolve() which kinds of expressions it may return.  Reports a
11269         CS0118 on error.
11270         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11271         ResolveFlags.SimpleName.
11272         (Expression.Error118): Added overloaded version of this method which
11273         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11274         which kinds of expressions are allowed.
11275
11276         * expression.cs (Argument.ResolveMethodGroup): New public method.
11277         Resolves an argument, but allows a MethodGroup to be returned.
11278         This is used when invoking a delegate.
11279
11280         * TODO: Updated a bit.
11281
11282 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11283
11284         Fixed compilation with csc.
11285
11286         * ecore.cs: Expression.Error made public. Is this correct? Should
11287         Warning be made public too?
11288
11289         * expression.cs: use ea.Location instead of ea.loc.
11290         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11291
11292 2002-08-06  Martin Baulig  <martin@gnome.org>
11293
11294         * ecore.cs (Expression.loc): Moved the location here instead of
11295         duplicating it in all derived classes.
11296         (Expression.Location): New public property.
11297         (Expression.Error, Expression.Warning): Made them non-static and
11298         removed the location argument.
11299         (Expression.Warning): Added overloaded version which takes an
11300         `int level' argument.
11301         (Expression.Error118): Make this non-static and removed the
11302         expression and location arguments.
11303         (TypeExpr): Added location argument to the constructor.
11304
11305         * expression.cs (StaticCallExpr): Added location argument to
11306         the constructor.
11307         (Indirection, PointerArithmetic): Likewise.
11308         (CheckedExpr, UnCheckedExpr): Likewise.
11309         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11310         (StringPtr): Likewise.
11311
11312
11313 2002-08-05  Martin Baulig  <martin@gnome.org>
11314
11315         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11316
11317         * assign.cs (Assign.DoResolve): Check whether the source
11318         expression is a value or variable.
11319
11320         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11321         while resolving the corresponding blocks.
11322
11323         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11324         an error, don't silently return null.
11325
11326         * statement.cs (Block.AddVariable): Do the error reporting here
11327         and distinguish between CS0128 and CS0136.
11328         (Block.DoResolve): Report all unused labels (warning CS0164).
11329         (LabeledStatement): Pass the location to the constructor.
11330         (LabeledStatement.HasBeenReferenced): New property.
11331         (LabeledStatement.Resolve): Set it to true here.
11332
11333         * statement.cs (Return.Emit): Return success even after reporting
11334         a type mismatch error (CS0126 or CS0127), this is what csc does and
11335         it avoids confusing the users with any consecutive errors.
11336
11337 2002-08-05  Martin Baulig  <martin@gnome.org>
11338
11339         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11340
11341         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11342
11343         * expression.cs (MemberAccess.DoResolve): Silently return if an
11344         error has already been reported.
11345
11346         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11347         error has already been reported.
11348
11349 2002-08-05  Martin Baulig  <martin@gnome.org>
11350
11351         * statement.cs (UsageVector): Only initialize the `parameters'
11352         vector if we actually have any "out" parameters.
11353
11354 2002-08-05  Martin Baulig  <martin@gnome.org>
11355
11356         * expression.cs (Binary.ResolveOperator): When combining delegates,
11357         they must have the same type.
11358
11359 2002-08-05  Martin Baulig  <martin@gnome.org>
11360
11361         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11362         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11363         work with the ms runtime and we also don't need it: if we're a
11364         PropertyBuilder and not in the `indexer_arguments' hash, then we
11365         are a property and not an indexer.
11366
11367         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11368         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11369         since the latter one doesn't work with the ms runtime.
11370
11371 2002-08-03  Martin Baulig  <martin@gnome.org>
11372
11373         Fixed bugs #27998 and #22735.
11374
11375         * class.cs (Method.IsOperator): New public field.
11376         (Method.CheckBase): Report CS0111 if there's already a method
11377         with the same parameters in the current class.  Report CS0508 when
11378         attempting to change the return type of an inherited method.
11379         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11380         and it's not marked abstract or extern.
11381         (PropertyBase): New abstract base class for Property and Indexer.
11382         (PropertyBase.CheckBase): Moved here from Property and made it work
11383         for indexers.
11384         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11385         the same so we can reuse it there.
11386         (Property, Indexer): Derive from PropertyBase.
11387         (MethodSignature.inheritable_property_signature_filter): New delegate
11388         to find properties and indexers.
11389
11390         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11391         argument and improved error reporting.
11392
11393         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11394         EmptyReadOnlyParameters and made it a property.
11395
11396         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11397         version of this method which takes a `PropertyInfo indexer'.
11398         (TypeManager.RegisterIndexer): New method.
11399
11400         * class.cs: Added myself as author of this file :-)
11401
11402 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11403
11404         * class.cs: fixed compilation on windoze.
11405
11406 2002-08-03  Martin Baulig  <martin@gnome.org>
11407
11408         * interface.cs (Interface.GetInterfaceBases): Check whether all
11409         base interfaces are at least as accessible than the current one.
11410
11411         * class.cs (TypeContainer.GetClassBases): Check whether base types
11412         are at least as accessible than the current type.
11413         (TypeContainer.AsAccessible): Implemented and made non-static.
11414         (MemberBase.CheckParameters): Report errors if the accessibility
11415         checks fail.
11416
11417         * delegate.cs (Delegate.Delegate): The default visibility is
11418         internal for top-level types and private for nested types.
11419         (Delegate.Define): Report errors if the accessibility checks fail.
11420
11421         * enum.cs (Enum.Enum): The default visibility is internal for
11422         top-level types and private for nested types.
11423         (Enum.DefineType): Compute the correct visibility.
11424
11425         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11426         function which takes a `bool is_toplevel' instead of a TypeContainer.
11427
11428         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11429         builtin type.
11430
11431 2002-08-02  Martin Baulig  <martin@gnome.org>
11432
11433         * expression.cs (LocalVariableReferenc): Added constructor which
11434         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11435         (LocalVariableReference.IsReadOnly): New property.
11436         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11437         variable is readonly, use our own readonly flag to do this; you can
11438         use the new constructor to get a writable reference to a read-only
11439         variable.
11440
11441         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11442         reference to the local variable.
11443
11444 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11445
11446         * rootcontext.cs (ResolveCore): Also include System.Exception
11447
11448         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11449         we reach an EmptyStatement.
11450
11451         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11452         is also fine.
11453
11454         * expression.cs (Binary.ResolveOperator): Check error result in
11455         two places.
11456
11457         use brtrue/brfalse directly and avoid compares to null.
11458
11459 2002-08-02  Martin Baulig  <martin@gnome.org>
11460
11461         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11462         Fixes bug #28407, added test-155.cs.
11463
11464 2002-08-01  Martin Baulig  <martin@gnome.org>
11465
11466         * class.cs (Event.EmitDefaultMethod): Make this work with static
11467         events.  Fixes #28311, added verify-3.cs.
11468
11469 2002-08-01  Martin Baulig  <martin@gnome.org>
11470
11471         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11472         `is_disposable' fields.
11473         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11474         `hm.is_disposable' if we're using the collection pattern.
11475         (Foreach.EmitCollectionForeach): Use the correct type for the
11476         enumerator's local variable, only emit the try/finally block if
11477         necessary (fixes #27713).
11478
11479 2002-08-01  Martin Baulig  <martin@gnome.org>
11480
11481         * ecore.cs (Expression.report118): Renamed to Error118 and made
11482         it public static.
11483
11484         * statement.cs (Throw.Resolve): Check whether the expression is of
11485         the correct type (CS0118) and whether the type derives from
11486         System.Exception (CS0155).
11487         (Catch.Resolve): New method.  Do the type lookup here and check
11488         whether it derives from System.Exception (CS0155).
11489         (Catch.CatchType, Catch.IsGeneral): New public properties.
11490
11491         * typemanager.cs (TypeManager.exception_type): Added.
11492
11493 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11494
11495         * driver.cs: Updated About function.
11496
11497 2002-07-31  Martin Baulig  <martin@gnome.org>
11498
11499         Implemented Control Flow Analysis.
11500
11501         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11502         (EmitContext.CurrentBranching): Added.
11503         (EmitContext.StartFlowBranching): Added.
11504         (EmitContext.EndFlowBranching): Added.
11505         (EmitContext.KillFlowBranching): Added.
11506         (EmitContext.IsVariableAssigned): Added.
11507         (EmitContext.SetVariableAssigned): Added.
11508         (EmitContext.IsParameterAssigned): Added.
11509         (EmitContext.SetParameterAssigned): Added.
11510         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11511         Added control flow analysis stuff here.
11512
11513         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11514         resolve the expression as lvalue.
11515         (LocalVariableReference.DoResolve): Check whether the variable has
11516         already been assigned.
11517         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11518         the parameter as assigned here.
11519         (ParameterReference.DoResolve): Check whether the parameter has already
11520         been assigned.
11521         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11522         expression as lvalue.
11523
11524         * statement.cs (FlowBranching): New class for the flow analysis code.
11525         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11526         (LabeledStatement.IsDefined): New public property.
11527         (LabeledStatement.AddUsageVector): New public method to tell flow
11528         analyis that the label may be reached via a forward jump.
11529         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11530         flow analysis.
11531         (VariableInfo.Number): New public field.  This is used by flow analysis
11532         to number all locals of a block.
11533         (Block.CountVariables): New public property.  This is the number of
11534         local variables in this block (including the locals from all parent
11535         blocks).
11536         (Block.EmitMeta): Number all the variables.
11537
11538         * statement.cs: Added flow analysis support to all classes.
11539
11540 2002-07-31  Martin Baulig  <martin@gnome.org>
11541
11542         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11543         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11544         then use this argument.
11545
11546         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11547
11548         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11549         use this to specify /define options.
11550
11551 2002-07-29  Martin Baulig  <martin@gnome.org>
11552
11553         * statement.cs (Fixed): Moved all code that does variable lookups
11554         and resolvings from Emit to Resolve.
11555
11556         * statement.cs (For): Moved all code that does variable lookups
11557         and resolvings from Emit to Resolve.
11558
11559         * statement.cs (Using): Moved all code that does variable lookups
11560         and resolvings from Emit to Resolve.
11561
11562 2002-07-29  Martin Baulig  <martin@gnome.org>
11563
11564         * attribute.cs (Attribute.Resolve): Explicitly catch a
11565         System.NullReferenceException when creating the
11566         CustromAttributeBuilder and report a different warning message.
11567
11568 2002-07-29  Martin Baulig  <martin@gnome.org>
11569
11570         * support.cs (ParameterData.ParameterName): Added method to
11571         get the name of a parameter.
11572
11573         * typemanager.cs (TypeManager.IsValueType): New public method.
11574
11575 2002-07-29  Martin Baulig  <martin@gnome.org>
11576
11577         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11578         is a flag which specifies that it's either ref or out.
11579         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11580         the out parameter to `out Parameter.Modifier mod', also set the
11581         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11582
11583         * support.cs (InternalParameters.ParameterModifier): Distinguish
11584         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11585         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11586
11587         * expression.cs (Argument.GetParameterModifier): Distinguish
11588         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11589         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11590
11591 2002-07-29  Martin Baulig  <martin@gnome.org>
11592
11593         * expression.cs (ParameterReference.ParameterReference): Added
11594         `Location loc' argument to the constructor.
11595
11596         * cs-parser.jay: Pass location to ParameterReference.
11597
11598 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11599
11600         * statement.cs (Try): Initialize the location.
11601
11602         * cs-parser.jay: pass location to Try.
11603
11604         * expression.cs (Unary.Reduce): Change the prototype to return
11605         whether a constant fold could be performed or not.  The result is
11606         returned in an out parameters.  In the case of Indirection and
11607         AddressOf, we want to perform the full tests.
11608
11609 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11610
11611         * statement.cs (Statement.Emit): Flag dead code.
11612
11613 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11614
11615         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11616
11617 2002-07-27  Martin Baulig  <martin@gnome.org>
11618
11619         * class.cs (MethodData.Define): Put back call to
11620         TypeManager.AddMethod(), accidentally commented this out.
11621
11622         * report.cs (Debug): New public method to print debugging information,
11623         this is `[Conditional ("DEBUG")]'.
11624
11625 2002-07-26  Martin Baulig  <martin@gnome.org>
11626
11627         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11628         (switch_statement): Push the current_block to the switch_stack and
11629         pop it again when we're done with the switch.
11630         (switch_section): The new block is a child of the current_block.
11631         Fixes bug #24007, added test-152.cs.
11632
11633 2002-07-27  Martin Baulig  <martin@gnome.org>
11634
11635         * expression.cs (Invocation.EmitArguments): When calling a varargs
11636         function with only its fixed arguments, we need to pass an empty
11637         array.
11638
11639 2002-07-27  Martin Baulig  <martin@gnome.org>
11640
11641         Mono 0.13 has been released.
11642
11643 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * driver.cs: Rename --resource to --linkres, because that is what
11646         we do currently, we dont support --resource yet.
11647
11648         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11649
11650 2002-07-25  Martin Baulig  <martin@gnome.org>
11651
11652         * class.cs (MethodData): New public class.  This is a `method builder'
11653         class for a method or one accessor of a Property/Indexer/Event.
11654         (MethodData.GetMethodFlags): Moved here from MemberBase.
11655         (MethodData.ApplyAttributes): Likewise.
11656         (MethodData.ApplyObsoleteAttribute): Likewise.
11657         (MethodData.ApplyConditionalAttribute): Likewise.
11658         (MethodData.ApplyDllImportAttribute): Likewise.
11659         (MethodData.CheckAbstractAndExternal): Likewise.
11660         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11661         (MethodData.Emit): Formerly known as Method.Emit().
11662         (MemberBase): Moved everything which was specific to a single
11663         accessor/method to MethodData.
11664         (Method): Create a new MethodData and call Define() and Emit() on it.
11665         (Property, Indexer, Event): Create a new MethodData objects for each
11666         accessor and call Define() and Emit() on them.
11667
11668 2002-07-25  Martin Baulig  <martin@gnome.org>
11669
11670         Made MethodCore derive from MemberBase to reuse the code from there.
11671         MemberBase now also checks for attributes.
11672
11673         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11674         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11675         as virtual.
11676         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11677         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11678         (MemberBase.ApplyAttributes): New virtual method; applies the
11679         attributes to a method or accessor.
11680         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11681         (MemberBase.ApplyConditionalAttribute): Likewise.
11682         (MemberBase.ApplyDllImportAttribute): Likewise.
11683         (MemberBase.CheckAbstractAndExternal): Likewise.
11684         (MethodCore.ParameterTypes): This is now a property instead of a
11685         method, it's initialized from DoDefineParameters().
11686         (MethodCore.ParameterInfo): Removed the set accessor.
11687         (MethodCore.DoDefineParameters): New protected virtual method to
11688         initialize ParameterTypes and ParameterInfo.
11689         (Method.GetReturnType): We can now simply return the MemberType.
11690         (Method.GetMethodFlags): Override the MemberBase version and add
11691         the conditional flags.
11692         (Method.CheckBase): Moved some code from Define() here, call
11693         DoDefineParameters() here.
11694         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11695         here to avoid some larger code duplication.
11696         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11697         ensure that abstract and external accessors don't declare a body.
11698
11699         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11700         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11701         lookup in the attribute's parent classes, so we need to abort as soon
11702         as we found the first match.
11703         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11704         the attribute has no arguments.
11705
11706         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11707         of a Method.
11708
11709 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11710
11711         * cs-parser.jay: reverted previous patch.
11712
11713 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11714
11715         * cs-parser.jay: fixed bug #22119.
11716
11717 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11718
11719         * attribute.cs: fixed compilation. The error was:
11720         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11721         be assigned to before control leaves the current method."
11722         [FIXME:  Filed as bug #28186: MCS must report this error.]
11723
11724 2002-07-25  Martin Baulig  <martin@gnome.org>
11725
11726         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11727         method to pull the condition name ouf of a Conditional attribute.
11728         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11729         the obsolete message and error flag out of an Obsolete attribute.
11730
11731         * class.cs (Method.GetMethodFlags): New public method to get the
11732         TypeManager.MethodFlags for this method.
11733         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11734         private methods.
11735         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11736         if we're overriding a virtual function, set the new private variable
11737         `parent_method'; call the new TypeManager.AddMethod().
11738
11739         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11740         the MethodBuilder and the Method in a PtrHashtable.
11741         (TypeManager.builder_to_method): Added for this purpose.
11742         (TypeManager.MethodFlags): Added IsObsoleteError.
11743         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11744         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11745         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11746         the message from the attribute.
11747
11748 2002-07-24  Martin Baulig  <martin@gnome.org>
11749
11750         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11751         preprocessor directives, ensure that the argument to #define/#undef is
11752         exactly one identifier and that it's actually an identifier.
11753
11754         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11755         did not work ....
11756
11757 2002-07-24  Martin Baulig  <martin@gnome.org>
11758
11759         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11760         initialize it to TypeManager.object_type in the constructor.
11761         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11762         of the `hm.get_current' method if we're using the collection pattern.
11763         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11764         for the explicit conversion to make it work when we're using the collection
11765         pattern and the `Current' property has a different return type than `object'.
11766         Fixes #27713.
11767
11768 2002-07-24  Martin Baulig  <martin@gnome.org>
11769
11770         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11771         does not match, but don't report any errors.  This method is called in
11772         order for all methods in a MethodGroupExpr until a matching method is
11773         found, so we don't want to bail out if the first method doesn't match.
11774         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11775         matches, report the 123.  Fixes #28070.
11776
11777 2002-07-24  Martin Baulig  <martin@gnome.org>
11778
11779         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11780         TypeManager.TypeToCoreType() to the top of the method so the
11781         following equality checks will work.  Fixes #28107.
11782
11783 2002-07-24  Martin Baulig  <martin@gnome.org>
11784
11785         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11786         operand is of type uint, and the other operand is of type sbyte,
11787         short or int, the operands are converted to type long." -
11788         Actually do what this comment already told us.  Fixes bug #28106,
11789         added test-150.cs.
11790
11791 2002-07-24  Martin Baulig  <martin@gnome.org>
11792
11793         * class.cs (MethodBase): New abstract class.  This is now a base
11794         class for Property, Indexer and Event to avoid some code duplication
11795         in their Define() and DefineMethods() methods.
11796         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11797         generic methods for Define() and DefineMethods().
11798         (FieldBase): Derive from MemberBase, not MemberCore.
11799         (Property): Derive from MemberBase, not MemberCore.
11800         (Property.DefineMethod): Moved all the code from this method to the
11801         new MethodBase.DefineAccessor(), just call it with appropriate
11802         argumetnts.
11803         (Property.Define): Call the new Property.DoDefine(), this does some
11804         sanity checks and we don't need to duplicate the code everywhere.
11805         (Event): Derive from MemberBase, not MemberCore.
11806         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11807         accessors, this will also make them work with interface events.
11808         (Indexer): Derive from MemberBase, not MemberCore.
11809         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11810         (Indexer.Define): Use the new MethodBase functions.
11811
11812         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11813         argument to the constructor.
11814         (Interface.FindMembers): Added support for interface events.
11815         (Interface.PopluateEvent): Implemented.
11816
11817         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11818
11819 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11820
11821         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11822         but this is required to check for a method name being the same as
11823         the containing class.  
11824
11825         Handle this now.
11826
11827 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11828
11829         * interface.cs: initialize variable.
11830
11831 2002-07-23  Martin Baulig  <martin@gnome.org>
11832
11833         Implemented the IndexerName attribute in interfaces.
11834
11835         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11836         name if this is an explicit interface implementation.
11837         (Indexer.InterfaceIndexerName): New public variable.  If we're
11838         implementing an interface indexer, this is the IndexerName in that
11839         interface.  Otherwise, it's the IndexerName.
11840         (Indexer.DefineMethod): If we're implementing interface indexer,
11841         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11842         and Pending.ImplementIndexer methods.
11843         (Indexer.Define): Also define the PropertyBuilder if we're
11844         implementing an interface indexer and this is neither an explicit
11845         interface implementation nor do the IndexerName match the one in
11846         the interface.
11847
11848         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11849         If a method is defined here, then we always need to create a proxy
11850         for it.  This is used when implementing interface indexers.
11851         (Pending.IsInterfaceIndexer): New public method.
11852         (Pending.ImplementIndexer): New public method.
11853         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11854         This is used when implementing interface indexers to define a proxy
11855         if necessary.
11856         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11857         define a proxy if necessary.
11858
11859         * interface.cs (Interface.IndexerName): New public variable.
11860         (Interface.PopulateIndexer): Set the IndexerName.
11861         (Interface.DefineIndexers): New private method.  Populate all the
11862         indexers and make sure their IndexerNames match.
11863
11864         * typemanager.cs (IndexerPropertyName): Added support for interface
11865         indexers.
11866
11867 2002-07-22  Martin Baulig  <martin@gnome.org>
11868
11869         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11870         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11871         ret if HasReturnLabel.
11872         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11873         variables.
11874
11875         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11876         and set the ec.LoopBeginTryCatchLevel.
11877         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11878         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11879         the current ec.TryCatchLevel, the branch goes out of an exception
11880         block.  In this case, we need to use Leave and not Br.
11881
11882 2002-07-22  Martin Baulig  <martin@gnome.org>
11883
11884         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11885         block unless the block does not always return or it is contained in
11886         another try { ... } catch { ... } block.  Fixes bug #26506.
11887         Added verify-1.cs to the test suite.
11888
11889 2002-07-22  Martin Baulig  <martin@gnome.org>
11890
11891         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11892         then we do not always return.  Fixes bug #24985.
11893
11894 2002-07-22  Martin Baulig  <martin@gnome.org>
11895
11896         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11897         lookup on a per-class level; ie. walk up the class hierarchy until we
11898         found at least one applicable method, then choose the best among them.
11899         Fixes bug #24463 and test-29.cs.
11900
11901 2002-07-22  Martin Baulig  <martin@gnome.org>
11902
11903         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11904         return types of the methods.  The return type is not part of the
11905         signature and we must not check it to make the `new' modifier work.
11906         Fixes bug #27999, also added test-147.cs.
11907         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11908
11909         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11910         on the method's return type.
11911
11912 2002-07-21  Martin Baulig  <martin@gnome.org>
11913
11914         * assign.cs: Make this work if the rightmost source is a constant and
11915         we need to do an implicit type conversion.  Also adding a few more tests
11916         to test-38.cs which should have caught this.
11917
11918         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11919         target in the makefile for this.  The makefile.gnu is primarily intended
11920         for end-users who don't want to debug the compiler.
11921
11922 2002-07-21  Martin Baulig  <martin@gnome.org>
11923
11924         * assign.cs: Improved the Assign class so it can now handle embedded
11925         assignments (X = Y = Z = something).  As a side-effect this'll now also
11926         consume less local variables.  test-38.cs now passes with MCS, added
11927         a few new test cases to that test.
11928
11929 2002-07-20  Martin Baulig  <martin@gnome.org>
11930
11931         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11932         instructions.  Fixes bug #27977, also added test-146.cs.
11933
11934 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11935
11936         * cs-tokenizer.cs: fixed getHex ().
11937
11938 2002-07-19  Martin Baulig  <martin@gnome.org>
11939
11940         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11941         not Type.GetType() to lookup the array type.  This is needed when
11942         we're constructing an array of a user-defined type.
11943         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11944         single-dimensional arrays, but also for single-dimensial arrays of
11945         type decimal.
11946
11947 2002-07-19  Martin Baulig  <martin@gnome.org>
11948
11949         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11950         this function is called, it's not allowed to share LocalBuilders
11951         among ILGenerators.
11952
11953 2002-07-19  Martin Baulig  <martin@gnome.org>
11954
11955         * expression.cs (Argument.Resolve): Report an error 118 when trying
11956         to pass a type as argument.
11957
11958 2002-07-18  Martin Baulig  <martin@gnome.org>
11959
11960         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11961         Conv_R_Un for the signed `long' type.
11962
11963 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11964
11965         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11966         `expr' for the temporary result, as that will fail if we do
11967         multiple resolves on the same expression.
11968
11969 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11970
11971         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
11972         ec.TypeContainer for looking up aliases. 
11973
11974         * class.cs (TypeContainer): Remove LookupAlias from here.
11975
11976         * decl.cs (DeclSpace); Move here.
11977
11978 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
11979
11980         * class.cs (FindMembers): Only call filter if the constructor
11981         bulider is not null.
11982
11983         Also handle delegates in `NestedTypes' now.  Now we will perform
11984         type lookups using the standard resolution process.  This also
11985         fixes a bug.
11986
11987         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
11988         This uses Expressions (the limited kind that can be parsed by the
11989         tree) instead of strings.
11990
11991         * expression.cs (ComposedCast.ToString): Implement, used to flag
11992         errors since now we have to render expressions.
11993
11994         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
11995         FormArrayType. 
11996
11997         * ecore.cs (SimpleName.ToString): ditto.
11998
11999         * cs-parser.jay: Instead of using strings to assemble types, use
12000         Expressions to assemble the type (using SimpleName, ComposedCast,
12001         MemberAccess).  This should fix the type lookups in declarations,
12002         because we were using a different code path for this.
12003
12004         * statement.cs (Block.Resolve): Continue processing statements
12005         even when there is an error.
12006
12007 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12008
12009         * class.cs (Event.Define): Also remove the `remove' method from
12010         the list of pending items.
12011
12012         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12013         generate more compact code. 
12014
12015 2002-07-17  Martin Baulig  <martin@gnome.org>
12016
12017         * const.cs (Const.LookupConstantValue): Add support for constant
12018         `unchecked' and `checked' expressions.
12019         Also adding test case test-140.cs for this.
12020
12021 2002-07-17  Martin Baulig  <martin@gnome.org>
12022
12023         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12024         check whether mi.ReturnType implements the IEnumerator interface; the
12025         `==' and the IsAssignableFrom() will fail in this situation.
12026
12027 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12028
12029         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12030         here too.
12031
12032 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12033
12034         * expression.cs: fixed bug #27811.
12035
12036 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12037
12038         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12039         Molaro: when we are a ref, the value already contains a pointer
12040         value, do not take the address of it.
12041
12042 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12043         * removed mb-parser.jay and mb-tokenizer.cs
12044
12045 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12046
12047         * expression.cs: check against the building corlib void type.
12048
12049 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12050
12051         * ecore.cs: fix for valuetype static readonly fields: when 
12052         initializing them, we need their address, not the address of a copy.
12053
12054 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12055
12056         * typemanager.cs: register also enum_type in corlib.
12057
12058 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12059
12060         * class.cs: allow calling this (but not base) initializers in structs.
12061
12062 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12063
12064         * ecore.cs: make sure we compare against the building base types
12065         in GetTypeSize ().
12066
12067 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12068
12069         * typemanager.cs: fix TypeToCoreType() to handle void and object
12070         (corlib gets no more typerefs after this change).
12071
12072 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12073
12074         * expression.cs (ArrayCreation.EmitArrayArguments): use
12075         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12076
12077         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12078         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12079         array indexes, the runtime actually forbids them.
12080
12081         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12082         for array arguments here.
12083
12084         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12085         instead of the default for ValueTypes.
12086
12087         (New.DoEmit): Use IsValueType instead of
12088         IsSubclassOf (value_type)
12089         (New.DoResolve): ditto.
12090         (Invocation.EmitCall): ditto.
12091
12092         * assign.cs (Assign): ditto.
12093
12094         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12095         Statements *are* currently doing part of their resolution during
12096         Emit.  
12097
12098         Expressions do always resolve during resolve, but statements are
12099         only required to propagate resolution to their children.
12100
12101 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12102
12103         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12104
12105         (LoadAssembly): Do not add the dll if it is already specified
12106
12107         (MainDriver): Add the System directory to the link path at the end,
12108         after all the other -L arguments. 
12109
12110         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12111         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12112         ldelem.u1) and using the opposite for sbytes.
12113
12114         This fixes Digger, and we can finally run it.
12115
12116         * driver.cs (UnixParseOption): Move the option parsing here.  
12117         (CSCParseOption): Implement CSC-like parsing of options.
12118
12119         We now support both modes of operation, the old Unix way, and the
12120         new CSC-like way.  This should help those who wanted to make cross
12121         platform makefiles.
12122
12123         The only thing broken is that /r:, /reference: and /lib: are not
12124         implemented, because I want to make those have the same semantics
12125         as the CSC compiler has, and kill once and for all the confussion
12126         around this.   Will be doing this tomorrow.
12127
12128         * statement.cs (Unsafe.Resolve): The state is checked during
12129         resolve, not emit, so we have to set the flags for IsUnsfe here.
12130
12131 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12132
12133         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12134         not catch the Error_ObjectRefRequired in SimpleName (as it is
12135         possible to have a class/instance variable name that later gets
12136         deambiguated), we have to check this here.      
12137
12138 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12139
12140         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12141         make static and put into Expression.
12142
12143         (Event.Define): Register the private field of the event with the 
12144         TypeManager so that GetFieldFromEvent can get at it.
12145
12146         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12147         keep track of the private field associated with an event which
12148         has no accessors.
12149
12150         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12151         private field.
12152
12153         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12154
12155 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12156
12157         * expression.cs (Binary.EmitBranchable): this routine emits the
12158         Binary expression in a branchable context.  This basically means:
12159         we need to branch somewhere, not just get the value on the stack.
12160
12161         This works together with Statement.EmitBoolExpression.
12162
12163         * statement.cs (Statement.EmitBoolExpression): Use
12164         EmitBranchable. 
12165
12166 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * statement.cs (For): Reduce the number of jumps in loops.
12169
12170         (For): Implement loop inversion for the For statement.
12171
12172         (Break): We can be breaking out of a Try/Catch controlled section
12173         (foreach might have an implicit try/catch clause), so we need to
12174         use Leave instead of Br.
12175
12176         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12177         now).  If the instace expression supports IMemoryLocation, we use
12178         the AddressOf method from the IMemoryLocation to extract the
12179         address instead of emitting the instance.
12180
12181         This showed up with `This', as we were emitting the instance
12182         always (Emit) instead of the Address of This.  Particularly
12183         interesting when This is a value type, as we dont want the Emit
12184         effect (which was to load the object).
12185
12186 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12187
12188         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12189
12190         * statement.cs (Checked): Set the CheckedState during the resolve
12191         process too, as the ConvCast operations track the checked state on
12192         the resolve process, and not emit.
12193
12194         * cs-parser.jay (namespace_member_declaration): Flag that we have
12195         found a declaration when we do.  This is used to flag error 1529
12196
12197         * driver.cs: Report ok when we display the help only.
12198
12199 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12200
12201         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12202
12203 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12204
12205         * cs-tokenizer.cs (define): We also have to track locally the
12206         defines.  AllDefines is just used for the Conditional Attribute,
12207         but we also need the local defines for the current source code. 
12208
12209 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12210
12211         * statement.cs (While, For, Do): These loops can exit through a
12212         Break statement, use this information to tell whether the
12213         statement is the last piece of code.
12214
12215         (Break): Flag that we break.
12216
12217         * codegen.cs (EmitContexts): New `Breaks' state variable.
12218
12219 2002-07-03  Martin Baulig  <martin@gnome.org>
12220
12221         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12222         modifiers in method declarations in structs.  Otherwise, you won't
12223         be able to override things like Object.Equals().
12224
12225 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12226
12227         * class.cs (Method, Property, Indexer): Do not allow the public
12228         modifier to be used in explicit interface implementations.
12229
12230         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12231         override modifiers in method declarations in structs
12232
12233 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12234
12235         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12236         integer or real overflow, report an error
12237
12238 2002-07-02  Martin Baulig  <martin@gnome.org>
12239
12240         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12241         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12242         to tell the runtime about our newly created System.Object and
12243         System.ValueType types.
12244
12245 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12246
12247         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12248         struct instead of Ldarg/Starg.
12249
12250 2002-07-02  Martin Baulig  <martin@gnome.org>
12251
12252         * expression.cs (Indirection.Indirection): Call
12253         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12254
12255 2002-07-02  Martin Baulig  <martin@gnome.org>
12256
12257         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12258         ValueType, call TypeManager.TypeToCoreType() on it.
12259         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12260         the OpCodes.Newarr argument.
12261
12262 2002-07-02  Martin Baulig  <martin@gnome.org>
12263
12264         * expression.cs (Invocation.EmitCall): When compiling corlib,
12265         replace all calls to the system's System.Array type to calls to
12266         the newly created one.
12267
12268         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12269         System.Array methods.
12270         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12271         from the system's System.Array type which must be replaced.
12272
12273 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12274
12275         * typemanager.cs: load unverifiable_code_ctor so we can build
12276         corlib using the correct type. Avoid using GetTypeCode() with
12277         TypeBuilders.
12278         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12279         TypeManager.object_type to allow building corlib.
12280
12281 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12282
12283         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12284
12285 2002-07-01  Martin Baulig  <martin@gnome.org>
12286
12287         * class.cs: Make the last change actually work, we need to check
12288         whether `ifaces != null' to avoid a crash.
12289
12290 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12291
12292         * class.cs: when we build structs without fields that implement
12293         interfaces, we need to add the interfaces separately, since there is
12294         no API to both set the size and add the interfaces at type creation
12295         time.
12296
12297 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12298
12299         * expression.cs: the dimension arguments to the array constructors
12300         need to be converted if they are a long.
12301
12302 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12303
12304         * class.cs: don't emit ldarg.0 if there is no parent constructor
12305         (fixes showstopper for corlib).
12306
12307 2002-06-29  Martin Baulig  <martin@gnome.org>
12308
12309         MCS now compiles corlib on GNU/Linux :-)
12310
12311         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12312         ie. check for MethodImplOptions.InternalCall.
12313
12314         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12315         and TypeManager.attribute_type are null, so we must explicitly check
12316         whether parent is not null to find out whether it's an attribute type.
12317         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12318         and SetBuilder, not only if the property is neither abstract nor external.
12319         This is necessary to set the MethodImplOptions on the accessor methods.
12320         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12321         SetBuilder, see Property.Emit().
12322
12323         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12324         populate "System.Object", "System.ValueType" and "System.Attribute" since
12325         they've already been populated from BootCorlib_PopulateCoreTypes().
12326
12327 2002-06-29  Martin Baulig  <martin@gnome.org>
12328
12329         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12330         is the NullLiteral, we also need to make sure that target_type is not
12331         an enum type.   
12332
12333 2002-06-29  Martin Baulig  <martin@gnome.org>
12334
12335         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12336         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12337         before calling BootstrapCorlib_ResolveDelegate ().
12338
12339 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12340
12341         * statement.cs: fixed build-breaker. All tests passed ok.
12342
12343 2002-06-27  Martin Baulig  <martin@gnome.org>
12344
12345         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12346         for System.Decimal when compiling corlib.
12347
12348 2002-06-27  Martin Baulig  <martin@gnome.org>
12349
12350         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12351         switch blocks which contain nothing but a default clause.
12352
12353 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12354
12355        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12356
12357 2002-06-27  Martin Baulig  <martin@gnome.org>
12358
12359         * ecore.cs (PropertyExpr.PropertyExpr): Call
12360         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12361
12362         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12363         is already a TypeBuilder.
12364
12365 2002-06-27  Martin Baulig  <martin@gnome.org>
12366
12367         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12368         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12369         the "from an array-type to System.Array" case.  This makes it work
12370         when compiling corlib.
12371
12372 2002-06-27  Martin Baulig  <martin@gnome.org>
12373
12374         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12375         non-static PropertyExpr, set its InstanceExpression.  This makes
12376         the `ICollection.Count' property work in System/Array.cs.
12377
12378 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12379
12380         * driver.cs: Made error handling more consistent.  Errors now
12381         tracked by Report class, so many methods which used to return int
12382         now return void.  Main() now prints success/failure and 
12383         errors/warnings message.
12384
12385         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12386         the magic number return values (123 and 124).  Now, if the
12387         expected error occurs, the compiler exits with success (exit value
12388         0).  If the compilation completes without seeing that particular
12389         error, the compiler exits with failure (exit value 1).  The
12390         makefile in mcs/errors has been changed to handle the new behaviour.
12391
12392         * report.cs: Made 'expected error' number a property and renamed
12393         it from 'Probe' to 'ExpectedError'.
12394
12395         * genericparser.cs: Removed error handling support, since it is
12396         now all done by Report class.
12397
12398         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12399         class, so parse() no longer returns an int.
12400
12401         * namespace.cs: Use Report.Error instead of GenericParser.error
12402
12403 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12406         TypeContainer.AddOperator): At the front of the list put the
12407         explicit implementations, so they get resolved/defined first. 
12408
12409 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12410
12411         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12412         interface type is implemented by this TypeContainer.  Used during
12413         explicit interface implementation.
12414
12415         (Property.Define, Indexer.Define, Method.Define): Validate that
12416         the given interface in the explicit implementation is one of the
12417         base classes for the containing type.
12418
12419         Also if we are explicitly implementing an interface, but there is
12420         no match in the pending implementation table, report an error.
12421
12422         (Property.Define): Only define the property if we are
12423         not explicitly implementing a property from an interface.  Use the
12424         correct name also for those properties (the same CSC uses,
12425         although that is really not needed).
12426
12427         (Property.Emit): Do not emit attributes for explicitly implemented
12428         properties, as there is no TypeBuilder.
12429
12430         (Indexer.Emit): ditto.
12431
12432         Hiding then means that we do not really *implement* a pending
12433         implementation, which makes code fail.
12434
12435 2002-06-22  Martin Baulig  <martin@gnome.org>
12436
12437         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12438         the return value of Object.GetType().  [FIXME: we need to do this whenever
12439         we get a type back from the reflection library].
12440
12441 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12442
12443         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12444
12445 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12446
12447         * attribute.cs: Return null if we can not look up the type.
12448
12449         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12450         the interface types found.
12451
12452         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12453         interface types found.
12454
12455         * typemanager.cs (GetInterfaces): Make this routine returns alll
12456         the interfaces and work around the lame differences between
12457         System.Type and System.Reflection.Emit.TypeBuilder in the results
12458         result for GetInterfaces.
12459
12460         (ExpandInterfaces): Given an array of interface types, expand and
12461         eliminate repeated ocurrences of an interface.  This expands in
12462         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12463         be IA, IB, IC.
12464
12465 2002-06-21  Martin Baulig  <martin@gnome.org>
12466
12467         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12468         on System.Enum.
12469
12470 2002-06-21  Martin Baulig  <martin@gnome.org>
12471
12472         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12473         and called with one of the core types, return the corresponding typebuilder for
12474         that type.
12475
12476         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12477         element type.
12478
12479 2002-06-21  Martin Baulig  <martin@gnome.org>
12480
12481         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12482         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12483         (Expression.ConvertReferenceExplicit): Likewise.
12484
12485         * expression.cs (ElementAccess.DoResolve): Likewise.
12486         (ElementAccess.DoResolveLValue): Likewise.
12487
12488 2002-06-10  Martin Baulig  <martin@gnome.org>
12489
12490         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12491         add the "value" parameter to the parameter list.
12492
12493         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12494         to our caller.
12495
12496 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12497
12498         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12499         the argument to an int, uint, long or ulong, per the spec.  Also
12500         catch negative constants in array creation.
12501
12502 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12503
12504         * class.cs: do not allow the same interface to appear twice in
12505         the definition list.
12506
12507 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12508
12509         * ecore.cs: don't use ldlen with System.Array.
12510
12511 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12512
12513         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12514
12515 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12516
12517         * modifiers.cs: produce correct field attributes for protected
12518         internal. Easy fix so miguel can work on ther harder stuff:-)
12519
12520 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * pending.cs: New file.  Move the code from class.cs here.
12523         Support clearning the pending flag for all methods (when not doing
12524         explicit interface implementation).
12525
12526 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12527
12528         * rootcontext.cs: added a couple more types needed to bootstrap.
12529
12530 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12531
12532         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12533         constructor in the type, instead of any constructor in the type
12534         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12535         a bug in the Mono runtime when applying the params attribute). 
12536
12537 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12538         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12539
12540 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12541
12542         * expression.cs (Unary.ResolveOperator): Use TypeManager
12543         to resolve the type.
12544
12545 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12546
12547         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12548         attached.
12549
12550         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12551         with each member too.
12552
12553         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12554         field builders too - this takes care of the enum member case.
12555
12556 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12557
12558         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12559         address-of operator on both value types and pointers.
12560
12561 2002-06-10  Martin Baulig  <martin@gnome.org>
12562
12563         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12564         PropertyBuilder to the `property_builders' list.
12565
12566         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12567         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12568         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12569         find any indexers which are inherited from an interface.
12570
12571 2002-06-09  Martin Baulig  <martin@gnome.org>
12572
12573         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12574         the same type as the constant if necessary.  There's also a test-130.cs
12575         for this.
12576
12577         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12578
12579         * typemanager.cs (TypeManager.ChangeType): Previously known as
12580         Enum.ChangeEnumType().
12581
12582 2002-06-09  Martin Baulig  <martin@gnome.org>
12583
12584         * expression.cs (Cast.TryReduce): Added support for consts.
12585
12586 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12587
12588         * class.cs (Accessor): Hold attributes information so we can pass
12589         it along.
12590
12591         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12592         Modify to pass in attributes attached to the methods.
12593
12594         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12595
12596         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12597         to handle the Accessor kind :-)
12598
12599         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12600
12601 2002-06-08  Martin Baulig  <martin@gnome.org>
12602
12603         * expression.cs (Unary.TryReduceNegative): Added support for
12604         ULongConstants.
12605
12606 2002-06-08  Martin Baulig  <martin@gnome.org>
12607
12608         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12609         name can't be found in the `defined_names' - the caller will do a
12610         MemberLookup in this case and thus find methods in System.Enum
12611         such as Enum.IsDefined().
12612
12613 2002-06-08  Martin Baulig  <martin@gnome.org>
12614
12615         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12616         Convert.ChangeType() which works with TypeBuilder created types.
12617         (Enum.LookupEnumValue, Enum.Define): Use it here.
12618
12619         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12620         `TypeBuilder.BaseType != null' check.
12621         (TypeContainer.FindMembers): Only lookup parent members if we
12622         actually have a parent.
12623         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12624         (ConstructorInitializer.Resolve): Likewise.
12625
12626         * interface.cs (Interface.FindMembers): Added
12627         `TypeBuilder.BaseType != null' check.
12628
12629         * rootcontext.cs (RootContext.ResolveCore): Added
12630         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12631         classes_second_stage.
12632
12633         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12634         debug_type and trace_type when compiling with --nostdlib.       
12635
12636 2002-06-07  Martin Baulig  <martin@gnome.org>
12637
12638         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12639         (AddField): Set it to true when adding a non-static field.
12640         (DefineType): Use `have_nonstatic_fields' to find out whether we
12641         have non-static fields, not `Fields != null'.
12642
12643 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12644
12645         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12646         dereferencing a null on the static-field code path)
12647
12648 2002-05-30  Martin Baulig  <martin@gnome.org>
12649
12650         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12651         to take command line arguments.  Use reflection to call the new
12652         custom `Initialize' function on the symbol writer and pass it the
12653         command line arguments.
12654
12655         * driver.cs (--debug-args): New command line argument to pass command
12656         line arguments to the symbol writer.
12657
12658 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12659
12660         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12661         the target type for indexers and properties.  Thanks to Joe for
12662         catching this.
12663
12664 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * typemanager.cs (MethodFlags): returns the method flags
12667         (Obsolete/ShouldIgnore) that control warning emission and whether
12668         the invocation should be made, or ignored. 
12669
12670         * expression.cs (Invocation.Emit): Remove previous hack, we should
12671         not do this on matching a base type, we should do this based on an attribute
12672
12673         Only emit calls to System.Diagnostics.Debug and
12674         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12675         on the command line.
12676
12677         * rootcontext.cs: Global settings for tracing and debugging.
12678
12679         * cs-tokenizer.cs (define): New utility function to track
12680         defines.   Set the global settings for TRACE and DEBUG if found.
12681
12682 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12683
12684         * interface.cs (Populate*): Pass in the TypeContainer as well as
12685         the DeclSpace as parameters so that we can create EmitContexts and
12686         then use that to apply attributes etc.
12687
12688         (PopulateMethod, PopulateEvent, PopulateProperty)
12689         (PopulateIndexer): Apply attributes everywhere.
12690
12691         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12692         etc.
12693
12694         (ApplyAttributes): Update accordingly.
12695
12696         We now apply interface attributes for all members too.
12697
12698 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12699
12700         * class.cs (Indexer.Define); Correctly check if we are explicit
12701         implementation (instead of checking the Name for a ".", we
12702         directly look up if the InterfaceType was specified).
12703
12704         Delay the creation of the PropertyBuilder.
12705
12706         Only create the PropertyBuilder if we are not an explicit
12707         interface implementation.   This means that explicit interface
12708         implementation members do not participate in regular function
12709         lookups, and hence fixes another major ambiguity problem in
12710         overload resolution (that was the visible effect).
12711
12712         (DefineMethod): Return whether we are doing an interface
12713         implementation. 
12714
12715         * typemanager.cs: Temporary hack until we get attributes in
12716         interfaces (Ravi is working on that) and we get IndexerName
12717         support in interfaces.
12718
12719         * interface.cs: Register the indexers as properties.
12720
12721         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12722         warning, I have verified that this is a bug in the .NET runtime
12723         (JavaScript suffers of the same problem).
12724
12725         * typemanager.cs (MemberLookup): When looking up members for
12726         interfaces, the parent of an interface is the implicit
12727         System.Object (so we succeed in searches of Object methods in an
12728         interface method invocation.  Example:  IEnumerable x;  x.ToString
12729         ()) 
12730
12731 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12732
12733         * class.cs (Event): Events should also register if they do
12734         implement the methods that an interface requires.
12735
12736         * typemanager.cs (MemberLookup); use the new GetInterfaces
12737         method. 
12738
12739         (GetInterfaces): The code used to lookup interfaces for a type is
12740         used in more than one place, factor it here. 
12741
12742         * driver.cs: Track the errors at the bottom of the file, we kept
12743         on going.
12744
12745         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12746         instance if the method we are calling is static!
12747
12748 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12749
12750         * attribute.cs (ApplyAttributes): Make this function filter out
12751         the IndexerName attribute (as that attribute in reality is never
12752         applied) and return the string constant for the IndexerName
12753         attribute. 
12754
12755         * class.cs (TypeContainer.Emit): Validate that all the indexers
12756         have the same IndexerName attribute, and if so, set the
12757         DefaultName attribute on the class. 
12758
12759         * typemanager.cs: The return value might contain other stuff (not
12760         only methods).  For instance, consider a method with an "Item"
12761         property and an Item method.
12762
12763         * class.cs: If there is a problem with the parameter types,
12764         return. 
12765
12766 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12767
12768         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12769         looks at user defined conversion after making a call to 
12770         StandardConversionExists - we need this for overload resolution.
12771
12772         * expression.cs : Update accordingly the various method calls.
12773
12774         This fixes 2 bugs filed against implicit user defined conversions 
12775
12776 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12777
12778         * statement.cs: Track the result of the assignment.
12779
12780 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12781
12782         * expression.cs (MemberAccess): Improved error reporting for
12783         inaccessible members.
12784
12785 2002-05-22  Martin Baulig  <martin@gnome.org>
12786
12787         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12788         itself with debugging support.
12789
12790 2002-05-22  Martin Baulig  <martin@gnome.org>
12791
12792         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12793         Removed, this isn't needed anymore.
12794
12795 2002-05-20  Martin Baulig  <martin@gnome.org>
12796
12797         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12798         be underlying type for an enum.
12799
12800 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12803         that splits out the loading of just the core types.
12804
12805         * rootcontext.cs (ResolveCore): Split the struct resolution in
12806         two, so we can load the enumeration underlying types before any
12807         enums are used.
12808
12809         * expression.cs (Is): Bandaid until we fix properly Switch (see
12810         bug #24985 for details).
12811
12812         * typemanager.cs (ImplementsInterface): The hashtable will contain
12813         a null if there are no interfaces implemented.
12814
12815 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12816
12817         * cs-parser.jay (indexer_declarator): It is fine to have array
12818         parameters
12819
12820 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12821
12822         * typemanager.cs: (RegisterBuilder): New function used to register
12823         TypeBuilders that implement interfaces.  Since
12824         TypeBuilder.GetInterfaces (as usual) does not work with lame
12825         Reflection.Emit. 
12826         (AddUserType): register interfaces.
12827
12828         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12829         dealing with TypeBuilder.  Also, arrays are showing up as
12830         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12831         methods can not be invoked on them!
12832
12833         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12834         (ImplicitReferenceConversionExists): Split out from
12835         StandardConversionExists. 
12836
12837         * expression.cs (As): We were only implementing one of the three
12838         cases for the as operator.  We now implement them all.
12839         (Is): Implement the various other cases for Is as well.
12840
12841         * typemanager.cs (CACHE): New define used to control if we want or
12842         not the FindMembers cache.  Seems to have a negative impact on
12843         performance currently
12844
12845         (MemberLookup): Nested types have full acess to
12846         enclosing type members
12847
12848         Remove code that coped with instance/static returns for events, we
12849         now catch this in RealFindMembers.
12850
12851         (RealFindMembers): only perform static lookup if the instance
12852         lookup did not return a type or an event.  
12853
12854 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12855
12856         * assign.cs (CompoundAssign): We pass more semantic information
12857         now to Compound Assignments than we did before: now we have all
12858         the information at hand, and now we resolve the target *before* we
12859         do the expression expansion, which allows the "CacheValue" method
12860         to have the effect we intended (before, a [x] += 1 would generate
12861         two differen ArrayAccess expressions from the ElementAccess,
12862         during the resolution process).
12863
12864         (CompoundAssign.DoResolve): Resolve target and original_source here.
12865
12866 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12867
12868         * expression.cs (ArrayAccess): dropped debugging information. 
12869
12870         * typemanager.cs: Small bug fix: I was always returning i_members,
12871         instead of one of i_members or s_members (depending on which had
12872         the content).
12873
12874         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12875         method is invoked before any code generation takes place, and it
12876         is a mechanism to inform that the expression will be invoked more
12877         than once, and that the method should use temporary values to
12878         avoid having side effects
12879
12880         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12881
12882         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12883         implementation.
12884
12885         * expression.cs (Indirection, ArrayAccess): Add support for
12886         CacheTemporaries in these two bad boys. 
12887
12888         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12889         ldobj or ldind_ref.  
12890         (StoreFromPtr): Handle stobj as well.
12891
12892         * expression.cs (UnaryMutator): Share more code.
12893
12894         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12895         down: I was not tracking the Filter function as well, which
12896         was affecting the results of the cache.
12897
12898 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12899
12900         * attribute.cs: Remove the hack to handle the CharSet property on
12901         StructLayouts. 
12902
12903 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12904
12905         * attribute.cs (DoResolve): More uglyness, we now only try to
12906         resolve the attribute partially, to extract the CharSet
12907         information (only if we are a StructLayout attribute).  Otherwise 
12908
12909         (GetExtraTypeInfo): Add some code to conditionally kill in the
12910         future this.   I am more and more convinced that the .NET
12911         framework has special code to handle the attribute setting on
12912         certain elements.
12913
12914         * expression.cs (IsParamsMethodApplicable): Revert my previous
12915         foreach change here, it was wrong.
12916
12917 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12918
12919         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12920         (pp_expr): do not abort on unknown input, just return.
12921         (eval): abort if there are pending chars.
12922
12923         * attribute.cs (Attribute.Resolve): Positional parameters are
12924         optional.  Deal with that case.
12925
12926         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12927         the Ansi/Unicode/Auto information for the type.
12928
12929         (TypeContainer.DefineType): instantiate the EmitContext here, as
12930         we will be using it during the type definition (to resolve
12931         attributes) and during the emit phase.
12932
12933         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12934         to pull type information out of the attributes
12935
12936         (Attribute.Resolve): track the constructor builder, and allow for
12937         multiple invocations (structs and classes will use this).
12938
12939         * ecore.cs (MemberLookupFinal): new version with all the
12940         parameters customizable.
12941
12942         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12943         constructors.  Return if the result value is null (as the error
12944         would have been flagged already by MemberLookupFinal)
12945
12946         Do not allow instances of abstract classes or interfaces to be
12947         created.
12948
12949         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12950         We have to compare the assembly property here when dealing with
12951         FamANDAssem and Assembly access modifiers, because we might be
12952         creating an assembly from *modules* (that means that we are not
12953         getting TypeBuilders for types defined in other modules that are
12954         part of this assembly).
12955
12956         (Method.Emit): If the method is marked abstract and has a body,
12957         emit an error. 
12958
12959         (TypeContainer.DefineMembers): If both the defined member and the
12960         parent name match are methods, then do not emit any warnings: let
12961         the Method.Define routine take care of flagging warnings.  But if
12962         there is a mismatch (method overrides something else, or method is
12963         overriwritten by something, then emit warning).
12964
12965         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12966         set to null, this means `do not check for the return type on the
12967         signature'. 
12968
12969         (Method.Define): set the return type for the method signature to
12970         null, so that we get methods with the same name and parameters and
12971         different return types.  This is used to flag warning 114 (you are
12972         hiding a method, and you probably want to use the new/override
12973         keywords instead).
12974
12975         * typemanager.cs (MemberLookup): Implemented proper access
12976         control, closing a long standing set of bug reports.  The problem
12977         was that the Framework only has two bits: Public and NonPublic,
12978         and NonPublic includes private and protected methods, but we need
12979         to enforce the FamANDAssem, FamOrAssem and Family. 
12980
12981 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
12982
12983         * statement.cs (GotoCase): Return true: Ammounts to giving up
12984         knowledge on whether we return or not, and letting the other case
12985         be responsible for it.
12986
12987 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
12988
12989         * driver.cs: Do not load directories for each file processed, only
12990         do it if there is a pattern.
12991
12992         * ecore.cs: Report readonly assigns here as well, as we might have
12993         been resolved only by MemberAccess.
12994
12995         (SimpleName.SimpleNameResolve): Also be useful for LValue
12996         resolution.   We need this to propagate assign to local readonly variables
12997
12998         * typemanager.cs: Use a ptrhashtable for the criteria, because we
12999         do not want to reuse potential criteria memory.
13000
13001         * class.cs (MyEventBuilder): Set reflected_type;
13002
13003         * ecore.cs (Constantify): Added support for constifying bools.
13004
13005         (RootContext.LookupType): Added a cache for values looked up in
13006         the declaration space.
13007
13008         * typemanager.cs (FindMembers): Now is a front-end to
13009         RealFindMembers, and provides a two-level hashtable-based cache to
13010         the request.  
13011
13012         15% performance improvement: from 22.5 to 19.2 seconds.
13013
13014         * expression.cs (IsParamsMethodApplicable): use foreach.
13015         (Invocation.DoResolve): ditto.
13016         (New.DoResolve): ditto.
13017         (ArrayCreation.DoResolve): ditto.
13018
13019         * ecore.cs (FindMostEncompassingType): use foreach.
13020
13021         * delegate.cs (NewDelegate.DoResolve): Use foreach
13022
13023         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13024         (RemoveMethods): use foreach.
13025
13026         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13027         nested foreach statements instead of for, and also break out of
13028         the inner loop once a match is found.
13029
13030         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13031
13032 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13033
13034         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13035         we actually unwrap the expression to allow for extra information
13036         to be extracted. 
13037
13038         * expression.cs: Use Shr_Un on unsigned operations. 
13039
13040 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13041
13042         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13043         applicable operators was not being considered correctly. This closes
13044         the bug Miguel reported.
13045
13046 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13047
13048         * attribute.cs: check that the type derives from System.Attribute
13049         and report the correct error in that case (moved the duplicate code to
13050         its own method, too).
13051
13052 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13053
13054         * attribute.cs: lookup attribute type name as the spec says: first the
13055         bare attribute name and then name + "Attribute" (nant compiles with
13056         mcs after this fix).
13057
13058 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13059
13060         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13061         Because of the way we parse things, we should try to see if a
13062         UIntConstant can fit in an integer.
13063
13064 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13065
13066         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13067         when we are in an explicit context.
13068
13069         (ConvertReferenceExplicit): When converting from Iface type S to Class
13070         T make sure the rules are implemented as an OR.
13071
13072         * parameter.cs (ParameterType): Make it a property for now although the
13073         purpose really isn't anything immediate.
13074
13075         * expression.cs (Is*Applicable): Do better checking on the parameter type
13076         of a ref/out parameter. The ones from the system assemblies are already 
13077         marked with the correct type so we don't need to do any correction.
13078
13079         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13080         the object type is standard too so include that.
13081
13082 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13083
13084         * ecore.cs (StandardConversionExists): Augment with missing code:
13085         deal with IntConstant, LongConstants and Enumerations.
13086
13087         * assign.cs: Report the error, instead of failing silently
13088
13089         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13090         typecontainer that they are declared, because the
13091         typecontainer/namespace will have the list of using clauses that
13092         need to be applied.
13093
13094         Assembly Attributes were escaping the normal registration
13095         mechanism. 
13096
13097         (EmitCode): Apply attributes within an EmitContext that represents
13098         the container they were declared on.
13099
13100         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13101
13102 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13103
13104         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13105         Revamp completely - make much cleaner as we now operate only
13106         on a set of Types.
13107
13108         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13109         to implement the logic detailed in the spec more correctly.
13110
13111         (UserDefinedConversion): Update accordingly.
13112
13113 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13114
13115         * statement.cs: Return flow analysis information up.
13116
13117         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13118         and the default.
13119
13120         (token): Do not consume an extra character before calling
13121         decimal_digits.
13122
13123 2002-05-06  Piers Haken <piersh@friskit.com>
13124
13125         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13126
13127 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13128
13129         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13130         EmitContext during the instance constructor initializer
13131         resolution, to stop access to instance variables.
13132
13133         This is mandated by the spec, last paragraph of the `constructor
13134         initializers' section. 
13135
13136 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13137
13138         * cs-parser.jay, class.cs (Accessor): new class used to represent
13139         an accessor (get or set).  In the past we used `null' to represent
13140         a missing accessor.  But this is ambiguous because there was no
13141         way to tell in abstract indexers/properties if one of them was
13142         specified.
13143
13144         Now there is a way of addressing that.
13145
13146         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13147         instead of FindMembers.
13148
13149         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13150         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13151
13152         * attribute.cs: Treat indexers and properties as the same in terms
13153         of applying attributes
13154
13155         * ecore.cs (FindMostEncompassedType): Use statically initialized
13156         EmptyExpressions()s like we do elsewhere to avoid creating useless
13157         objects (and we take this out of the tight loop).
13158
13159         (GetConversionOperators): Move the code to extract the actual
13160         operators to a separate routine to clean things up.
13161
13162 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13163
13164         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13165         events are always registered FieldBuilders.
13166
13167         * class.cs (FieldBase): New class shared by Fields 
13168
13169         * delegate.cs: If we are a toplevel delegate, use our full name.
13170         If we are a nested delegate, then only use our tail name.
13171
13172 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13173
13174         * expression.cs (IsApplicable): Ensure that we add the "&" to
13175         ref/out types before comparing it with the type of the argument.
13176
13177         (IsParamsMethodApplicable): Ditto.
13178
13179         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13180         silly me ;-)
13181
13182         * delegate.cs : Handle the case when we have more than one applicable
13183         method. Flag an error only when we finish checking all.
13184
13185 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13186
13187         * expression.cs: Add support for boolean static initializers.
13188
13189 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13190
13191         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13192
13193         * parameter.cs (ComputeParameterTypes,
13194         ComputeAndDefineParameterTypes): Better error handling: now we
13195         clear the `types' cache if we fail during any of the type lookups.
13196         We also return the status code correctly to our caller
13197
13198         * delegate.cs: If we fail to define a delegate, abort the extra
13199         steps. 
13200
13201         * expression.cs (Binary.ResolveOperator): for
13202         operator==(object,object) and operator !=(object, object) we also
13203         have to verify that there is an implicit conversion from one to
13204         the other.
13205
13206         (ArrayAccess.DoResolve): Array Access can operate on
13207         non-variables. 
13208
13209 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13210
13211         * assign.cs (CompoundAssign): A new class used as a "flag" that
13212         the assignment actually is happening as part of a compound
13213         assignment operator.
13214
13215         During compound assignment, a few new rules exist to enable things
13216         like:
13217
13218         byte b |= 1 + 2
13219
13220         From the spec:
13221
13222         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13223         to the type of x) if y is implicitly convertible to the type of x,
13224         and the operator is a builtin operator and the return type of the
13225         operator is explicitly convertible to the type of x. 
13226
13227         * rootcontext.cs: Reset warning level to 2.  4 catches various
13228         "interesting" features in mcs, we must clean this up at some
13229         point, but currently am trying to kill other bugs ;-)
13230
13231         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13232         in container classes as well.  
13233
13234         * expression.cs (Binary.ResolveOperator): Handle string case
13235         before anything else (as operator overloading does emit an error
13236         before doing anything else).
13237
13238         This code could go away when we move to a table driven model, but
13239         i could not come up with a good plan last night.
13240
13241 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13242
13243         * typemanager.cs (CSharpName): reimplementation using regex.
13244         * class.cs: added null check for fields in Emit
13245         * rootcontext.cs: set warninglevel to 4
13246
13247 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13248
13249         * typemanager.cs (CSharpName): reimplemented with Lupus
13250         suggestion.
13251
13252 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13253
13254         * statement.cs (If): correclty implement Resolve, because we were
13255         not catching sem errors in there.  The same process is needed
13256         everywhere else. 
13257         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13258
13259
13260         (Statement.Warning_DeadCodeFound): Factorize code.
13261         (While): Report dead code here too.
13262
13263         (Statement): Added Resolve virtual method to allow
13264         for resolution split from the emit code.
13265
13266 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13267
13268         * statement.cs (EmitBoolExpression): No longer try to resolve the
13269         expression here.    
13270         (MakeBoolean): New utility function that resolve, implicitly
13271         converts to boolean and tags the expression. 
13272
13273
13274         (If, Do): Implement dead code elimination.
13275         (While): Implement loop inversion
13276
13277         (Do, While, For, If): Resolve the expression prior to calling our
13278         code generation.
13279
13280 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13281
13282         * class.cs:
13283           - added method Report28 (warning: program has more than one entry point)
13284           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13285           - modified method Method.Define, the part at the end of the method
13286
13287         * rootcontext.cs: added static public Location EntryPointLocation;
13288           
13289         * ../errors/cs0028.cs : Add test case for the above warning.              
13290
13291         * typemanager.cs:
13292           - modified method CSharpName to allow arrays of primitive type to
13293             be printed nicely (e.g. instead of System.Int32[][] it now prints
13294             int[][])
13295           - added method CSharpSignature: returns the signature of a method
13296             in string format to be used in reporting errors, warnings, etc.
13297
13298         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13299         with String.Empty.
13300
13301 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13302
13303         * delegate.cs (Define): Fix extremely silly bug where I was
13304         setting the type of the 'object' parameter of the BeginInvoke
13305         method to System.IAsyncResult instead of System.Object ;-)
13306
13307 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13308
13309         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13310         here. 
13311
13312         (Constructor.Emit): return if we fail to initialize the
13313         constructor.  Another door closed!  
13314
13315         * expression.cs (New.DoResolve): Improve error message (from -6 to
13316         1501).  Use DeclaredOnly lookup to find the exact constructor.
13317
13318         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13319         loop.  This is useful.
13320
13321         * cs-parser.jay: Adjust the default parameters so that destructors
13322         have the proper signature.
13323
13324 2002-04-26  Martin Baulig  <martin@gnome.org>
13325
13326         * driver.cs (LoadAssembly): If `assembly' contains any characters
13327         which are only valid in path names and not in assembly names
13328         (currently slash, backslash and point), use Assembly.LoadFrom ()
13329         instead of Assembly.Load () on the `assembly' (before iteration
13330         over the link_paths).
13331
13332 2002-04-26  Martin Baulig  <martin@gnome.org>
13333
13334         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13335
13336 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13337
13338         * class.cs (Property): use the new typemanager.MemberLookup
13339
13340         (TypeContainer.MemberLookup): Implement using the
13341         TypeManager.MemberLookup now. 
13342
13343         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13344         and return MemberInfos, so that these can be used without an
13345         EmitContext (what we had before).
13346
13347 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13348
13349         * expression.cs: Fix the case where the argument to params if the
13350         type of the params.  I omitted handling this before.   Fixed
13351
13352 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * driver.cs: Call BootCorlib_PopulateCoreType
13355
13356         * class.cs (Property.CheckBase): Check for properties only, not
13357         for all members. 
13358
13359         * interface.cs: Temporary hack: try/catch around the
13360         CustomAttributeBuilder, because I am getting an exception that I
13361         do not understand.
13362
13363         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13364         types whose definitions are required to be there (attributes are
13365         defined before standard types).
13366
13367         Compute definitions as we boot the various types, as they are used
13368         immediately (value_type class will need object_type, but if we do
13369         not initialize object_type, we will pass a null, which will let
13370         the runtime pick the System.Object from the existing corlib, which
13371         is not what we want).
13372
13373 2002-04-22  Patrik Torstensson <totte@labs2.com>
13374
13375         * cs-tokenizer.cs: fixed a number of trim() issues.
13376
13377 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13378
13379         * expression.cs (Argument.Type): Ensure that we return the correct
13380         type when we have out or ref parameters [in which case we 
13381         append a "&"].
13382
13383 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13384
13385         * class.cs (Property, Indexer): Allow extern modifier in there. 
13386
13387         * typemanager.cs (InitBaseTypes): Initializes object_type and
13388         value_type, since those will be used early on during the bootstrap
13389         process to compile corlib.
13390
13391         (InitCoreTypes): Move code from here to InitBaseTypes.
13392
13393 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13394
13395         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13396         single-dimension arrays as using the ldlen opcode.  
13397
13398         Daniel Lewis discovered this optimization.  
13399
13400         * typemanager.cs: Add signature for System.Array::get_Length
13401
13402 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13403
13404         * statement.cs: report the error when the foreach does not apply to an
13405         array nor a collection.
13406
13407 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13408
13409         * expression.cs: Add implicit conversions to the operator ~.
13410
13411         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13412
13413         * typemanager.cs: Locate the decimal constructor.
13414
13415 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13416
13417         * attribute.cs: use the new property of TypeOf.
13418         * expression.cs: added 'get' property around typearg.
13419
13420         These changes fix a build breaker reported by NickD. Is this the
13421         correct way to fix?  If not, please, revert my changes and make it
13422         work :-).
13423
13424 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13425
13426         * attribute.cs: Add support for typeof in attribute invocations.
13427         I am not sure that this is right though.
13428
13429 2002-04-14  Duncan Mak  <duncan@ximian.com>
13430
13431         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13432         Binary.Operator.Division case.
13433
13434 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13435
13436         * class.cs (DefineType): Ensure that we do a proper check on
13437         attribute types and also register it with the TypeManager.
13438
13439         (TypeContainer.Targets): The default for attribute types is
13440         AttributeTargets.All.
13441
13442         * attribute.cs (ApplyAttributes): Registering the attribute type
13443         is done elsewhere, not when we discover we have a Usage attribute.
13444
13445 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13446
13447         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13448         and get rid of is_delegate parameter.
13449
13450         * everywhere : update.
13451
13452 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13453
13454         * cs-parser.jay (compilation_unit): Revamp completely to use
13455         some new ideas that I got from Rhys' grammar to solve the problems
13456         with assembly level attributes.
13457
13458         (outer_declaration): New grammar production.
13459
13460         (attribute_sections): Add.
13461
13462         (opt_attributes): Base on attribute_sections
13463
13464         (namespace_declaration): Allow opt_attributes to tackle the case
13465         when we have assembly level attributes - we are clever in this
13466         regard now ;-)
13467
13468         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13469         attributes in the non-global context.
13470
13471         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13472         instead of SetGlobalAttributes.
13473
13474         * class.cs, rootcontext.cs : Ensure we define and generate 
13475         attribute types before anything else.
13476
13477         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13478         and flag the new error -20 for the case when the attribute type
13479         does not have valid targets specified. csc does not catch this.
13480
13481         * ../errors/errors.txt : update for error # -20
13482
13483 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13484
13485         * support.cs (InternalParameters.ParameterModifier): Do some null
13486         checking and return sane values.
13487
13488         * class.cs (Method.Define): If we are a PInvoke method, ensure
13489         that we are static and extern. Report error # 601
13490
13491         * ../errors/cs0601.cs : Add test case for the above error.
13492
13493 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13494
13495         * rootcontext.cs (attribute_types): We need to keep type of
13496         all attribute types separately and emit code for them first.
13497
13498         (RegisterAttribute) : Implement.
13499
13500         * class.cs (DefineType): Check if the current Type is a custom
13501         attribute type and register it accordingly.
13502
13503         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13504         adding the first attribute twice and rename to
13505
13506         (SetGlobalAttributes): this.
13507
13508         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13509         lookups.
13510
13511         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13512         if we are processing global arguments. Hmm, I am unsure of this.
13513
13514 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13515
13516         * expression.cs: added static array of strings to avoid calling
13517         Enum.ToString () for Operator in Binary. Significant recover of
13518         performance.
13519
13520 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13521
13522         * class.cs (FindMembers): Allow the Builders of the various
13523         members to be null.  If they are skip them.  This only happens
13524         during the PInvoke declaration.
13525
13526 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13529         failure, so we do not keep going afterwards.
13530
13531         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13532         wanted to pass `false' as the `is_delegate' argument.  If this is
13533         the case, why not use delegate_type == null to mean `is_delegate =
13534         false' and anything else as is_delegate = true.
13535
13536 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13537
13538         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13539         code for the section, not the beginning of the tests.
13540
13541 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13542
13543         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13544
13545         * expression.cs (Binary): same.  Warn about errors where we have
13546         Enum/Enum in operator + as well.
13547
13548 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13549
13550         * statement.cs:
13551                 - added support for switch(bool)
13552                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13553                 - add TableSwitchEmit() to handle table-based switch statements
13554
13555 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13556
13557         * expression.cs (Invocation.OverloadResolve): Factor out code which
13558         does parameter compatibility checking with arguments so that we can 
13559         re-use the code even from Delegate.VerifyApplicability
13560
13561         (VerifyArgumentsCompat): Move above code here.
13562
13563         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13564         and instead make a call to the above method.
13565
13566 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13567
13568         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13569         We use it to keep track of classes which are attribute types.
13570
13571 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13572
13573         * delegate.cs (Delegate.Define): Correctly define the types in the
13574         presence of fixed and array parameters.
13575
13576         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13577         doing FindMembers.
13578
13579         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13580         include NonPublic after the first iteration.
13581
13582         * class.cs (Indexer.CheckBase): Only check if both parents are
13583         non-null. 
13584
13585         * cs-parser.jay (accessor_body): If empty, set to null.
13586
13587         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13588         same code path here to resolve constants names that we did have in
13589         MemberAccess.DoResolve.  There is too much code duplicated here.
13590
13591 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13592
13593         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13594
13595         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13596         to MakeUnionSet.
13597
13598         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13599         tokens, numbers and strings.
13600
13601         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13602         parenthesis.
13603
13604         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13605         asyncronous parameters and the regular parameters.  
13606
13607         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13608         specify the target directory.
13609
13610         * expression.cs: (This.DoResolve): Simplify
13611         (As.Emit): Optimize, do not generate IsInst if the expression is
13612         always of the given type.
13613
13614         (Is.DoResolve): Bug fix, we were reporting both always/never for
13615         the is expression.
13616
13617         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13618         creating too many unnecessary arrays.
13619
13620 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13621
13622         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13623         fields instead of rolling our own initializer.   Takes care of all
13624         implicit conversions, and drops unnecessary static checks/argument.
13625
13626 2002-03-31  Dick Porter  <dick@ximian.com>
13627
13628         * driver.cs: use the GetDirectories() return values properly, and
13629         use "/" as path separator.
13630
13631 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13632
13633         * expression.cs (Unary): Optimize - - expr into expr.
13634         (Binary): Optimize a + (-b) into a -b.
13635
13636         * codegen.cs (CodeGen): Made all methods static.
13637
13638 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13639
13640         * rootcontext.cs: 
13641
13642         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13643         TypeBuilder property.
13644
13645         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13646         instead. 
13647
13648         * tree.cs: Removed the various RecordXXXX, and replaced with a
13649         single RecordDecl.  Removed all the accessor methods, and just
13650         left a single access point Type 
13651
13652         * enum.cs: Rename DefineEnum to DefineType.
13653
13654         * decl.cs: New abstract method `DefineType' used to unify the
13655         Defines for Enumerations, Interfaces, TypeContainers and
13656         Delegates.
13657
13658         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13659         LookupBaseClasses method that used to live in class.cs and
13660         interface.cs here, and renamed to FindType.
13661
13662         * delegate.cs: Implement DefineType.  Take advantage of the
13663         refactored pattern for locating the parent builder without taking
13664         the parent_builder argument (which we know does not work if we are
13665         nested, and triggering a toplevel definition).
13666
13667 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13668
13669         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13670         accessibility of a member has changed during override and report
13671         an error if so.
13672
13673         * class.cs (Method.Define, Property.Define): Only complain on
13674         overrides if the method is private, any other accessibility is
13675         fine (and since we just checked the permission is the same, we are
13676         good to go).
13677
13678         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13679         and elif are processed always.  The other pre-processing
13680         directives are only processed if we are "taking" the path
13681
13682 2002-03-29  Martin Baulig  <martin@gnome.org>
13683
13684         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13685         current location is not Null.
13686
13687         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13688         a separate method so we can profile it.
13689
13690         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13691         `span.Seconds' are just seconds, but no minutes or hours.
13692         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13693
13694 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13695
13696         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13697         Remove the gratuitous set of Final:
13698
13699                                 // If an interface implementation, then we can set Final.
13700                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13701                                     implementing.DeclaringType.IsInterface)
13702                                         flags |= MethodAttributes.Final;
13703
13704         I do not know what I was smoking when I used that.
13705
13706
13707         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13708         step into fixing the name resolution issues for delegates and
13709         unifying the toplevel name resolution.
13710
13711 2002-03-28  Martin Baulig  <martin@gnome.org>
13712
13713         * class.cs (Method.Emit): If we have a symbol writer, call its
13714         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13715         tell it about the current method.
13716
13717         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13718         writer that we're going to emit the first byte of IL code for a new
13719         statement (a new source line).
13720         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13721         EmitContext.Mark() before emitting any code.
13722
13723         * location.cs (SymbolDocument): Return null when we're Null.
13724
13725         * statement.cs (Statement): Moved the `Location loc' variable here.
13726         (Statement.EmitBoolExpression): If we have a symbol writer, call
13727         ec.Mark() before emitting any code to tell it that we're at the
13728         beginning of a new statement.
13729         (StatementExpression): Added `Location' argument to the constructor.
13730         (Block): Added public readonly variable `StartLocation' and public
13731         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13732         (Block): Added constructor which takes a start and end location.
13733         (Block.SetEndLocation): New method. This sets the end location.
13734         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13735         local variables we create.
13736         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13737         each statement and do also mark the begin and end of the block.
13738
13739         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13740         tell it the current lexer.Location, use Location.Null for the end of the
13741         block.
13742         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13743         current block, set its end location using SetEndLocation().
13744         (statement_expression): StatementExpression constructor now takes the
13745         lexer.Location as additional argument.
13746         (for_statement, declare_local_variables): Likewise.
13747         (declare_local_variables): When creating a new implicit block, use the
13748         new Block constructor and pass it the lexer.Location.
13749
13750 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13751
13752         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13753         members also on the parent interfaces recursively.
13754
13755 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13756
13757         * report.cs: Use new formats, since Gonzalo finished the missing
13758         bits. 
13759
13760         * expression.cs (Binary.ResolveOperator): added missing operator|
13761         operator& and operator^ for bool/bool.
13762
13763         * cs-parser.jay: CheckDef now takes a Location argument that is
13764         used to report errors more precisly (instead of reporting the end
13765         of a definition, we try to track something which is a lot closer
13766         to the source of the problem).
13767
13768         * cs-tokenizer.cs: Track global token use, so we can properly flag
13769         the use of #define/#undef after the first token has been seen.
13770
13771         Also, rename the reportXXXX to Error_DescriptiveName
13772
13773         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13774         TypeContainer, so that Enum and Interface can use this too.
13775
13776         * class.cs (TypeContainer.LookupInterfaceOrClass,
13777         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13778         `builder' argument.  Typically this was used to pass the parent
13779         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13780         the definition).  
13781
13782         The problem is that a nested class could trigger the definition of
13783         a toplevel class, and the builder would be obviously wrong in that
13784         case. 
13785
13786         So we drop this argument, and we compute dynamically the
13787         TypeBuilder/ModuleBuilder (the correct information was available
13788         to us anyways from DeclSpace.Parent)
13789
13790         * interface.cs (Interface.DefineInterface): Drop builder
13791         parameter cleanup like class.cs
13792
13793         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13794         like class.cs
13795
13796         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13797         values. 
13798
13799         (Try.Emit): Propagate the returns value from the statement.
13800
13801         (Return.Emit): Even if we are leavning 
13802
13803         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13804
13805         * modifiers.cs: Fix the computation of MethodAttributes flags.
13806
13807 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13808
13809         * driver.cs: allow compilation of files that start with '/'.
13810         Add a default case when checking the argument of --target.
13811
13812 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13813
13814         * interface.cs: Implement the same search algorithm for types in
13815         the interface code.
13816
13817         * delegate.cs: Do not allow multiple definition.
13818
13819         * Recovered ChangeLog that got accidentally amputated
13820
13821         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13822
13823         * rootcontext.cs: Load manually enum to allow core classes to
13824         contain enumerations.
13825
13826         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13827         Update to new static methods in TypeManager.
13828
13829         * typemanager.cs (GetMethod, GetConstructor): Use our
13830         implementation of FindMembers to find the members, since during
13831         corlib compilation, the types are TypeBuilders and GetMethod and
13832         GetConstructor do not work.
13833
13834         Make all methods in TypeManager static.
13835
13836         (InitCodeHelpers): Split the functionality from
13837         the InitCodeTypes function.
13838
13839         * driver.cs: Call InitCodeHelpers after we have populated the
13840         types. 
13841
13842         * cs-parser.jay (delegate_declaration): we did not used to compute
13843         the delegate name correctly for void delegates.
13844
13845 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13846
13847         * rootcontext.cs (RootContext): Init the interface_resolve_order
13848         and type_container_resolve_order always.
13849
13850         (ResolveCore, BootstrapCorlib_ResolveClass,
13851         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13852         compiler when compiling with --nostdlib
13853
13854         * class.cs (TypeContainer.DefineType): Check that our parent is
13855         not null.  This test is most important when we are bootstraping
13856         the core types.
13857
13858         * codegen.cs: Split out the symbol writing code.
13859
13860 2002-03-25  Martin Baulig  <martin@gnome.org>
13861
13862         * driver.cs (-g): Made -g an alias for --debug.
13863
13864 2002-03-24  Martin Baulig  <martin@gnome.org>
13865
13866         * codegen.cs (SymbolWriter): New public variable. Returns the
13867         current symbol writer.
13868         (CodeGen): Added `bool want_debugging_support' argument to the
13869          constructor. If true, tell the ModuleBuild that we want debugging
13870         support and ask it for the ISymbolWriter.
13871         (Save): If we have a symbol writer, call it's Close() method after
13872         saving the assembly.
13873
13874         * driver.c (--debug): New command line argument to create a
13875         debugger information file.
13876
13877         * location.cs (SymbolDocument): New public property. Returns an
13878         ISymbolDocumentWriter object for the current source file or null
13879         if we don't have a symbol writer.
13880
13881 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13882
13883         * driver.cs (LoadAssembly): Correctly return when all the paths
13884         have been tried and not before.
13885
13886         * statement.cs (Switch.Emit): return the actual coverage for this
13887         statement (returns/not-returns)
13888
13889         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13890         switch of the statement if we are the last switch section.  That
13891         kills two problems: try/catch problems (we used to emit an empty
13892         nop at the end) and switch statements where all branches would
13893         return. 
13894
13895 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13896
13897         * driver.cs: Add default assemblies (the equivalent to the
13898         Microsoft CSC.RSP file)
13899
13900         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13901         also update tokens_seen and set it to false.
13902
13903         * driver.cs: Implement --recurse for Mike.
13904
13905         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13906         correctly splitting out the paths.
13907
13908 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13909
13910         * interface.cs (Interface.PopulateProperty): Instead of using
13911         `parent' as the declaration space for the set parameters, use
13912         `this' 
13913
13914         * support.cs (InternalParameters): InternalParameters constructor
13915         takes a DeclSpace instead of a TypeContainer.
13916
13917         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13918         types are being initialized, load the address of it before calling
13919         the function.  
13920
13921         (New): Provide a mechanism to disable the generation of local
13922         value type temporaries when the caller will be providing us with
13923         an address to store it.
13924
13925         (ArrayCreation.EmitDynamicInitializers): Use it.
13926
13927 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13928
13929         * expression.cs (Invocation.EmitArguments): Only probe for array
13930         property if there is more than one argument.  Sorry about that.
13931
13932         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13933         empty param arrays.
13934
13935         * class.cs (Method.LabelParameters): Fix incorrect code path that
13936         prevented the `ParamArrayAttribute' from being applied to the
13937         params attribute.
13938
13939 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13940
13941         * support.cs (ReflectionParameters): Correctly compute whether the
13942         last argument is a params array.  Fixes the problem with
13943         string.Split ('a')
13944
13945         * typemanager.cs: Make the assemblies array always be non-null
13946         (empty, but non-null)
13947
13948         * tree.cs (RecordDecl): New function that abstracts the recording
13949         of names.  This reports error 101, and provides a pointer to the
13950         previous declaration.  Fixes a crash in the compiler.
13951
13952         * cs-parser.jay (constructor_declaration): Update to new grammar,
13953         and provide a constructor_body that can be empty.
13954
13955 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * driver.cs: Add support for --resources.
13958
13959         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13960         Make all types for the various array helper methods be integer.
13961
13962         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13963         CheckState to ConvCast.
13964
13965         (ConvCast): Now it takes a `checked' state argument, to avoid
13966         depending on the emit context for the conversion, and just using
13967         the resolve time setting.
13968
13969         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13970         instead of Invocation.EmitArguments.  We do not emit the original
13971         arguments, instead we emit those which have been converted to
13972         unsigned int expressions.
13973
13974         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
13975
13976         * codegen.cs: ditto.
13977
13978         * expression.cs (LocalVariableReference): Drop the use of the
13979         Store function that depended on the variable index.
13980
13981         * statement.cs (VariableInfo): Drop the `Idx' property from this
13982         class, as this is not taking into account the indexes for
13983         temporaries tat we generate during the execution, getting the
13984         indexes wrong.
13985
13986         * class.cs: First emit class initializers, then call the parent
13987         constructor. 
13988
13989         * expression.cs (Binary): Fix opcode emision.
13990         (UnaryMutator.EmitCode): Support checked code generation
13991
13992         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
13993         matches for events for both the Static and Instance scans,
13994         pointing to the same element.   Fix that.
13995
13996 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
13997
13998         * rootcontext.cs (ResolveTree): Always set the
13999         interface_resolve_order, because nested interfaces will be calling
14000         into us.
14001
14002         * class.cs (GetInterfaceOrClass): Track the same resolution
14003         process used by TypeManager.LookupType.  This fixes the nested
14004         type lookups in class declarations (separate path from
14005         LookupType). 
14006
14007         (TypeContainer.DefineType): Also define nested interfaces.
14008         (TypeContainer.RegisterOrder): New public function used to
14009         register the order in which child interfaces need to be closed.
14010
14011         Nested interfaces need to be closed after their parents have been
14012         created. 
14013
14014         * interface.cs (InterfaceAttr): Put all the logic for computing
14015         the interface attribute here. 
14016
14017         (DefineInterface): Register our interface order with the
14018         RootContext or with the TypeContainer depending on the case.
14019
14020 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14021
14022         * cs-parser.jay: rework foreach statement to work with the new
14023         changes to the policy on SimpleNames.
14024
14025         * report.cs: support Stacktrace on warnings as well.
14026
14027         * makefile: drop --unsafe and /unsafe from the compile.
14028
14029 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14030
14031         * ecore.cs (StandardConversionExists): Modify to take an Expression
14032         as the first parameter. Ensure we do null -> reference type conversion
14033         checking.
14034
14035         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14036         temporary Expression objects.
14037
14038 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14039
14040         * interface.cs: workaround bug in method overloading resolution
14041         (there is already a bugzilla bug for it).
14042
14043 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14044
14045         We could also solve this problem by having a separate path for
14046         performing type lookups, instead of DoResolve, we could have a
14047         ResolveType entry point, and only participating pieces of the
14048         production (simplename, deref, array) would implement this. 
14049
14050         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14051         signal SimpleName to only resolve type names and not attempt to
14052         resolve anything else.
14053
14054         * expression.cs (Cast): Set the flag.
14055
14056         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14057
14058         * class.cs: Only report 108 if there is no `new' modifier.
14059
14060         * cs-parser.jay: rework foreach statement to work with the new
14061         changes to the policy on SimpleNames.
14062         
14063         * report.cs: support Stacktrace on warnings as well.
14064
14065         * makefile: drop --unsafe and /unsafe from the compile.
14066
14067 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14068
14069         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14070         lookups here, instead of doing that at parse time.  This means
14071         that our grammar will not introduce `LocalVariableReferences' as
14072         expressions at this point.  That solves the problem of code like
14073         this:
14074
14075         class X {
14076            static void Main ()
14077            { int X = 1;
14078             { X x = null }}}
14079
14080         This is only half the fix.  The full fix requires parameters to
14081         also be handled in this way.
14082
14083         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14084         makes the use more obvious of the DeclSpace.  The
14085         ec.TypeContainer.TypeBuilder is now only used to pull the
14086         TypeBuilder for it.
14087
14088         My theory is that I can get rid of the TypeBuilder completely from
14089         the EmitContext, and have typecasts where it is used (from
14090         DeclSpace to where it matters).  
14091
14092         The only pending problem is that the code that implements Aliases
14093         is on TypeContainer, and probably should go in DeclSpace.
14094
14095         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14096         lookups here, instead of doing that at parse time.  This means
14097         that our grammar will not introduce `LocalVariableReferences' as
14098         expressions at this point.  That solves the problem of code like
14099         this:
14100
14101         class X {
14102            static void Main ()
14103            { int X = 1;
14104             { X x = null }}}
14105
14106         This is only half the fix.  The full fix requires parameters to
14107         also be handled in this way.
14108
14109         * class.cs (Property.DefineMethod): When implementing an interface
14110         method, set newslot, when implementing an abstract method, do not
14111         set the flag (before we tried never setting it, or always setting
14112         it, which is the difference).
14113         (Indexer.DefineMethod): same.
14114         (Method.DefineMethod): same.
14115
14116         * ecore.cs: Only set the status used flag if we get back a Field.
14117
14118         * attribute.cs: Temporary hack, so Paolo can keep working.
14119
14120 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14121
14122         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14123         the unmanaged type in the case we have a MarshalAs attribute.
14124
14125         (Resolve): Handle the case when we are parsing the special MarshalAs
14126         attribute [we need to store the unmanaged type to use later]
14127
14128         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14129         MarshalAs Attribute.
14130
14131         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14132         on parameters and accordingly set the marshalling info.
14133
14134 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14135
14136         * class.cs: Optimizing slightly by removing redundant code after
14137         we switched to the `NoTypes' return value.
14138         (Property.DefineMethod): use NoTypes here too.
14139
14140         This fixes the bug I introduced in my last batch of changes.
14141
14142 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14143
14144         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14145
14146         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14147         Enums since those are types too. 
14148
14149         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14150
14151         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14152         thanks to a call during the lookup process.
14153
14154 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14155
14156         * statement.cs (Foreach): Lots of work to accomodate a particular
14157         kind of foreach statement that I had not kept in mind.  It is
14158         possible to have foreachs on classes that provide a GetEnumerator
14159         method that return objects that implement the "pattern" for using
14160         a foreach, there is no need to support GetEnumerator
14161         specifically. 
14162
14163         This is needed to compile nant.
14164
14165         * decl.cs: Only report 114 if the member is not `Finalize' and if
14166         the warning level is at least 2.
14167
14168         * class.cs: Moved the compare function from Method to
14169         MethodSignature. 
14170
14171         (MethodSignature.InheritableMemberSignatureCompare): Add new
14172         filter function that is used to extract inheritable methods from a
14173         class. 
14174
14175         (Method.Define): Use the new `inheritable_method_signature_filter'
14176         delegate
14177
14178         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14179         command. 
14180
14181 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14182
14183         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14184
14185         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14186
14187         * expression.cs: Pass location information to
14188         ConvertImplicitStandard. 
14189
14190         * class.cs: Added debugging code to track return values from
14191         interfaces. 
14192
14193 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14194
14195         * expression.cs (Is.DoResolve): If either side of the `is' is an
14196         interface, do not flag the warning.
14197
14198         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14199         for interfaces
14200
14201         * report.cs: Allow for --fatal to be used with --probe.
14202
14203         * typemanager.cs (NoTypes): Move the definition for the empty Type
14204         array here. 
14205
14206         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14207         properties. 
14208         (TypeContainer.DefineProxy): New function used to proxy to parent
14209         implementations when implementing interfaces.
14210         (TypeContainer.ParentImplements): used to lookup if our parent
14211         implements a public function that is required by an interface.
14212         (TypeContainer.VerifyPendingMethods): Hook this up.
14213
14214         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14215         `modules' and `assemblies' arraylists into arrays.  We only grow
14216         these are the very early start up of the program, so this improves
14217         the speedof LookupType (nicely measured).
14218
14219         * expression.cs (MakeByteBlob): Replaced unsafe code with
14220         BitConverter, as suggested by Paolo.
14221
14222         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14223         folding of string concatenation, but if either side is a string,
14224         and the other is not, then return null, and let the runtime use
14225         the concatenation on the string plus the object (using
14226         `Object.ToString'). 
14227
14228 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14229
14230         Constant Folding has been implemented now.
14231
14232         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14233         the error instead on types that are not supported in one's
14234         complement. 
14235
14236         * constant.cs (Constant and all children): New set of functions to
14237         perform implict and explicit conversions.
14238
14239         * ecore.cs (EnumConstant): Implement the new functions to perform
14240         conversion by proxying to the child expression.
14241
14242         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14243         own separate setting that can not be turned off from the command
14244         line using --unchecked or --checked and is only controlled using
14245         the checked/unchecked statements and expressions.  This setting is
14246         used by the constant folder to flag errors.
14247
14248         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14249         ConstantCheckState as well.   
14250
14251         During Resolve, they also have to flag the state, because the
14252         constant folder runs completely in the Resolve phase.
14253
14254         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14255         well.
14256
14257 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * cfold.cs: New file, this file contains the constant folder.
14260
14261         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14262         argument to track whether we are using the resulting address to
14263         load or store a value and provide better error messages. 
14264
14265         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14266         new AddressOf arguments.
14267
14268         * statement.cs (Foreach.EmitCollectionForeach): Update
14269
14270         * expression.cs (Argument.Emit): Call AddressOf with proper
14271         arguments to track usage.
14272
14273         (New.DoEmit): Call AddressOf with new arguments.
14274
14275         (Unary.Emit): Adjust AddressOf call.
14276
14277 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14278
14279         * cs-parser.jay (member_access): Change the case for pre-defined types
14280         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14281         this suggestion.
14282
14283         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14284         a method body.
14285
14286         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14287         essentially like methods and apply attributes like MethodImplOptions to them too.
14288
14289         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14290         not being null.
14291
14292         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14293         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14294         is the DeclSpace.
14295
14296         * Update code everywhere accordingly.
14297
14298         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14299
14300         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14301
14302 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14303
14304         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14305         try performing lookups against those instead of jumping straight into using
14306         the 'using' clauses.
14307
14308         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14309
14310         (LookupType): Perform lookups in implicit parents too.
14311
14312         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14313         sequence as RootContext.LookupType. 
14314
14315         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14316         the various cases of namespace lookups into this method.
14317
14318 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14319
14320         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14321         in positional arguments)
14322
14323         * class.cs (Operator): Update the AllowedModifiers to contain
14324         extern. 
14325
14326         * cs-parser.jay: Update operator declaration to allow for the
14327         operator body to be empty.
14328
14329         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14330         values. 
14331
14332 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * class.cs (Method.Emit): Label parameters.
14335
14336         * driver.cs: Return 1 or 0 as the program exit code.
14337
14338 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14339
14340         * expression.cs: Special case the `null' object when trying to
14341         auto-compute the type, as anything can be explicitly converted to
14342         that. 
14343
14344         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14345         spotting this Paolo.
14346
14347         (Expression.ImplicitNumericConversion): Perform comparissions of
14348         the type using the underlying type in the case of an enumeration
14349         rather than using the enumeration type for the compare.
14350
14351         Cope with the underlying == type case, which is not possible to
14352         catch before. 
14353
14354         (Expression.ConvertNumericExplicit): Perform comparissions of
14355         the type using the underlying type in the case of an enumeration
14356         rather than using the enumeration type for the compare.
14357
14358         * driver.cs: If the user does not supply an extension, assume .exe
14359
14360         * cs-parser.jay (if_statement): Rewrote so that we can track the
14361         location for the if statement.
14362
14363         * expression.cs (Binary.ConstantFold): Only concat strings when
14364         the operation is "+", not everything ;-)
14365
14366         * statement.cs (Statement.EmitBoolExpression): Take a location
14367         argument. 
14368         (If, While, Do): Track location.
14369
14370         * expression.cs (Binary.ResolveOperator): In the object + string
14371         case, I was missing a call to ConvertImplicit
14372
14373 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14374
14375         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14376         Location arguments. Ensure we use RootContext.LookupType to do our work
14377         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14378
14379         * interface.cs (PopulateMethod): Handle the type of the parameter being
14380         null gracefully.
14381
14382         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14383         have a params method with no fixed arguments and a call is made with no
14384         arguments.
14385
14386 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14387
14388         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14389         the verbatim-string-literal
14390
14391         * support.cs (InternalParameters.ParameterModifier): handle null
14392         fixed parameters.
14393         (InternalParameters.ParameterType): ditto.
14394
14395         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14396         duplicating the name of the variable parameter.
14397         (GetParameterByName): Fix bug where we were not looking up array
14398         paramters if they were the only present (thanks Paolo!).
14399         (GetParameterInfo): We only have an empty set of types if both
14400         fixed and array are set to null.
14401         (GetParameterInfo-idx): Handle FixedParameter == null
14402
14403         * cs-parser.jay: Handle the case where there is no catch
14404         statements (missing null test).
14405
14406 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14407
14408         * driver.cs (MainDriver): Be conservative on our command line
14409         handling.
14410
14411         Catch DirectoryNotFoundException when calling GetFiles.
14412
14413         (SplitPathAndPattern): Used to split the input specification into
14414         a path and a pattern that we can feed to Directory.GetFiles.
14415
14416 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14417
14418         * statement.cs (Fixed): Implement the last case of the Fixed
14419         statement (string handling).
14420
14421         * expression.cs (StringPtr): New class used to return a char * to
14422         a string;  Used by the Fixed statement.
14423
14424         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14425
14426         * expression.cs (Binary.ResolveOperator): Remove redundant
14427         MemberLookup pn parent type.
14428         Optimize union call, we do not need a union if the types are the same.
14429         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14430         type.
14431
14432         Specialize the use of MemberLookup everywhere, instead of using
14433         the default settings. 
14434
14435         (StackAlloc): Implement stackalloc keyword.
14436
14437         * cs-parser.jay: Add rule to parse stackalloc.
14438
14439         * driver.cs: Handle /h, /help, /?
14440
14441         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14442         before we supported unsafe code.
14443
14444         * makefile: add --unsafe to the self compilation of mcs.
14445
14446 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14447
14448         * expression.cs (PointerArithmetic): New class that is used to
14449         perform pointer arithmetic.
14450         (Binary.Resolve): Handle pointer arithmetic
14451         Handle pointer comparission.
14452         (ArrayPtr): Utility expression class that is used to take the
14453         address of an array.
14454
14455         (ElementAccess): Implement array access for pointers
14456
14457         * statement.cs (Fixed): Implement fixed statement for arrays, we
14458         are missing one more case before we are done.
14459
14460         * expression.cs (Indirection): Implement EmitAssign and set the
14461         ExprClass to Variable.  This allows pointer dereferences to be
14462         treated as variables, and to have values assigned to them.
14463
14464         * ecore.cs (Expression.StoreFromPtr): New utility function to
14465         store values dereferencing.
14466
14467 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14468
14469         * expression.cs (Binary.ResolveOperator): Ensure that we are
14470         not trying to operate on a void type - this fixes the reported
14471         bug.
14472
14473         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14474         the parent implementation is sealed.
14475
14476         * ../errors/cs0239.cs : Add.
14477
14478         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14479
14480         * typemanager.cs (unverifiable_code_type): Corresponds to 
14481         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14482         which have unsafe code in them.
14483
14484         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14485         unsafe context.
14486
14487 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14488
14489         * cs-tokenizer.cs: Add support for @"litreal strings"
14490
14491         Make tokenizer accept pre-processor directives
14492         on any column (remove the old C-like limitation). 
14493
14494         * rootcontext.cs (EmitCode): Emit any global attributes.
14495         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14496
14497         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14498
14499         * cs-parser.jay: Add support for global attributes.  
14500
14501 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14502
14503         * expression.cs (Indirection): New helper class.  Unary will
14504         create Indirection classes to be able to implement the
14505         IMemoryLocation interface on it.
14506
14507 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14508
14509         * cs-parser.jay (fixed_statement): reference the right statement.
14510
14511         * statement.cs (Fixed.Emit): Finish implementing the fixed
14512         statement for the &x case.
14513
14514 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14515
14516         * class.cs (Property.Define, Method.Define): Remove newslot when
14517         `implementing'.  
14518
14519         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14520         wrong.  NewSlot should only be used if the `new' keyword is present.
14521
14522         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14523         locating our system dir.  Sorry about this.
14524
14525 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14526
14527         * driver.cs (GetSystemDir): Compute correctly the location of our
14528         system assemblies.  I was using the compiler directory instead of
14529         the library directory.
14530
14531 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14532
14533         * expression.cs (BetterFunction): Put back in what Miguel commented out
14534         since it is the correct fix. The problem is elsewhere ;-)
14535
14536         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14537         parameters of the parms method are themselves compatible or not !
14538
14539         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14540         to check that a class implements an interface before saying that an implicit
14541         conversion was allowed. Use ImplementsInterface to do the checking.
14542
14543 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14544
14545         * class.cs (Method.Define): Track whether we are an explicit
14546         implementation or not.  And only call DefineMethodOverride if we
14547         are an explicit implementation.
14548
14549         (Property.DefineMethod): Ditto.
14550
14551 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14552
14553         * expression.cs (BetterFunction): Catch hideous bug which was
14554          preventing us from detecting ambiguous calls due to implicit casts i.e
14555         cs0121.
14556
14557 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14558
14559         * support.cs (Pair): Remove un-needed method.  I figured why I was
14560         getting the error in cs-parser.jay, the variable in a foreach loop
14561         is readonly, and the compiler does not really treat this as a variable.
14562
14563         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14564         instead of EQUALS in grammar.  
14565
14566         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14567
14568         * expression.cs (Unary.DoResolve): Check whether the argument is
14569         managed or not.
14570
14571 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * support.cs: Api for Pair to set a value.  Despite the fact that
14574         the variables are public the MS C# compiler refuses to compile
14575         code that accesses the field if the variable is part of a foreach
14576         statement. 
14577
14578         * statement.cs (Fixed): Begin implementation of the fixed
14579         statement.
14580
14581         (Block.AddVariable): Return the VariableInfo on success and null
14582         on failure instead of true/false. 
14583
14584         * cs-parser.jay (foreach): Catch errors on variables already
14585         defined (we were ignoring this value before) and properly unwind
14586         the block hierarchy
14587
14588         (fixed_statement): grammar for the fixed statement.
14589
14590 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14591
14592         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14593         pointer types to be incretemented.
14594
14595         (SizeOf): Implement.
14596
14597         * cs-parser.jay (pointer_member_access): Implement
14598         expr->IDENTIFIER production.
14599
14600         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14601         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14602         on safe contexts.
14603
14604         (Unary): Implement indirection.
14605
14606         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14607         use in non-unsafe context).
14608
14609         (SimpleName.DoResolve): Check for pointers in field access on safe
14610         contexts. 
14611
14612         (Expression.LoadFromPtr): Factor the load-indirect code in this
14613         function.  This was duplicated in UnboxCast and ParameterReference
14614
14615 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14616
14617         * expression.cs (ComposedCast): report an error if a pointer cast
14618         is used in a safe region.
14619
14620         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14621         pointer type casts in unsafe context.
14622
14623         * codegen.cs (EmitContext): Set up IsUnsafe.
14624
14625         * cs-parser.jay (non_expression_type): Add productions for pointer
14626         casts. 
14627
14628         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14629         code.  We should not use force into static mode if the method is
14630         not virtual.  Fixes bug in MIS
14631
14632         * statement.cs (Do.Emit, While.Emit, For.Emit,
14633         Statement.EmitBoolExpression): Add support to Do and While to
14634         propagate infinite loop as `I do return' semantics.
14635
14636         Improve the For case to also test for boolean constants.
14637
14638         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14639         to the list of attributes we can add.
14640
14641         Remove `EmitContext' argument.
14642
14643         * class.cs (Method.Define): Apply parameter attributes.
14644         (Constructor.Define): Apply parameter attributes.
14645         (MethodCore.LabelParameters): Move here the core of labeling
14646         parameters. 
14647
14648         * support.cs (ReflectionParameters.ParameterModifier,
14649         InternalParameters.ParameterModifier): Use IsByRef on the type and
14650         only return the OUT bit for these parameters instead of in/out/ref
14651         flags.
14652
14653         This is because I miss-understood things.  The ParameterInfo.IsIn
14654         and IsOut represent whether the parameter has the [In] and [Out]
14655         attributes set.  
14656
14657 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14658
14659         * ecore.cs (FieldExpr.Emit): Release temporaries.
14660
14661         * assign.cs (LocalTemporary.Release): new function.
14662
14663         * codegen.cs (EmitContext.GetTemporaryStorage,
14664         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14665         temporary storage.  Now we can "put back" localbuilders when we
14666         are done with them
14667
14668 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14669
14670         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14671         need to make a copy of the variable to generate verifiable code.
14672
14673 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14674
14675         * driver.cs: Compute dynamically the system directory.
14676
14677         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14678         Slower, but more generally useful.  Used by the abstract
14679         registering implementation. 
14680
14681         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14682         the rules for the special rule on Type/instances.  First check if
14683         we have the same name, and if so, try that special static path
14684         rather than the instance path.
14685
14686 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14687
14688         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14689         for, while and if.
14690
14691         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14692         Enum, ValueType, Delegate or Array for non-corlib compiles.
14693
14694         * cs-tokenizer.cs: Catch long identifiers (645)
14695
14696         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14697         piece of code.
14698
14699         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14700         fix, we were returning too early, so we were not registering
14701         pending methods from abstract classes.
14702
14703         Do not register pending methods if the class is abstract.
14704
14705         * expression.cs (Conditional.DoResolve): Report circular implicit
14706         conversions when we neecd to compute it for conditional
14707         expressions. 
14708
14709         (Is.DoResolve): If the expression is always of the provided type,
14710         flag warning 183.  If the expression can not ever be of the
14711         provided type flag warning 184.
14712
14713         * class.cs: Catch 169 as well.
14714
14715         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14716         read. 
14717
14718 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14719
14720         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14721
14722 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14723
14724         * interface.cs: (PopulateMethod): Check for pointers being defined
14725         only if the unsafe context is active.
14726         (PopulateProperty): ditto.
14727         (PopulateIndexer): ditto.
14728
14729         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14730         specified.  If pointers are present, make sure that they are
14731         present in an unsafe context.
14732         (Constructor, Constructor.Define): ditto.
14733         (Field, Field.Define): ditto.
14734         (Property, Property.Define): ditto.
14735         (Event, Event.Define): ditto.
14736
14737         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14738         hashtable if there are classes or structs defined.
14739
14740         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14741         code, as the constant resolution moved.
14742
14743         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14744         the metadata, so we can flag error 133. 
14745
14746         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14747         pointer is being declared in an unsafe context.
14748
14749 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14750
14751         * modifiers.cs (Modifiers.Check): Require a Location argument.
14752         Report error 227 for Unsafe use.
14753
14754         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14755
14756         * statement.cs (For.Emit): If the test is null, then report that
14757         we do `return', as we wont reach anything afterwards.
14758
14759         (Switch.SwitchGoverningType): Track the expression that matched
14760         the conversion.
14761
14762         * driver.cs: Allow negative numbers as an error code to flag.
14763
14764         * cs-parser.jay: Handle 1551.
14765
14766         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14767
14768 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14769
14770         * cs-parser.jay: Report 1518 (type declaration can only contain
14771         class, struct, interface, enum or delegate)
14772
14773         (switch_label): Report 1523 (keywords `case' or `default' must
14774         preced code)
14775
14776         (opt_switch_sections): Report 1522 (empty switch)
14777
14778         * driver.cs: Report 1515 (response file specified multiple times)
14779         Report 1516 (Source file specified multiple times).
14780
14781         * expression.cs (Argument.Resolve): Signal 1510
14782
14783         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14784         access not allowed in static code)
14785
14786 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14787
14788         * typemanager.cs (IsPointerType): Utility method which we are going
14789         to need a lot.
14790
14791         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14792         the object type, so we take care of that.
14793
14794         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14795
14796         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14797         added to non-params parameters :-)
14798
14799         * typemanager.cs (CSharpName): Include 'void' type too. 
14800
14801         (void_ptr_type): Include in the set of core types.
14802
14803         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14804         duplicating code.
14805
14806         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14807         an unsafe context.
14808
14809         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14810         completely forgotten about it.
14811
14812 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14813
14814         * cs-parser.jay (pointer_type): Add. This begins our implementation
14815         of parsing rules for unsafe code.
14816
14817         (unsafe_statement): Implement.
14818
14819         (embedded_statement): Modify to include the above.
14820
14821         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14822
14823         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14824         if the current context is an unsafe one.
14825
14826         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14827         are handled differently, we need separate rules for them.
14828
14829         (local_variable_declaration): Update to use local_variable_pointer_type
14830         to allow variable declarations of unmanaged pointer types.
14831
14832         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14833         in unsafe contexts.
14834
14835         * ../errors/cs0214.cs : Add.
14836
14837 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14838
14839         * makefile: remove 'response' file when cleaning.
14840
14841 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14842
14843         * cs-parser.jay: Report 1524.
14844
14845 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14846
14847         * typemanager.cs (RegisterMethod): drop checking if we have
14848         registered this from here
14849
14850 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14851
14852         * class.cs (Method.EmitDestructor): Implement calling our base
14853         destructor. 
14854
14855         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14856         value of InFinally.
14857
14858         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14859         this routine and will wrap the call in a try/catch block.  Deal
14860         with the case.
14861
14862 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14863
14864         * ecore.cs (Expression.MemberLookup): instead of taking a
14865         parameter `same_type' that was used to tell whether we could
14866         access private members we compute our containing type from the
14867         EmitContext.
14868
14869         (FieldExpr): Added partial support for volatile fields.  This does
14870         not work for volatile fields exposed from assemblies, as I can not
14871         figure out how to extract the modreq from it.
14872
14873         Updated all the source files to use this.
14874
14875         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14876         because it is referenced by MemberLookup very often. 
14877
14878 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14879
14880         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14881         TypeBuilder.GetCustomAttributes to retrieve what we need.
14882
14883         Get rid of redundant default_member_attr_type as this is the same as
14884         default_member_type which already exists.
14885
14886         * interface.cs, attribute.cs : Update accordingly.
14887
14888 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14889
14890         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14891         work for TYpeBuilders though.  Ravi, can you please fix this?
14892
14893         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14894
14895         * expression.cs (Argument.Emit): Handle the case of ref objects
14896         being passed to ref functions;  
14897
14898         (ParameterReference.EmitLoad): Loads the content of the pointer
14899         without dereferencing.
14900
14901 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14902
14903         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14904
14905 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14906
14907         * class.cs (Indexer.DefineMethod): Incorporate the interface
14908         type in the name of the method if we are doing explicit interface
14909         implementation.
14910
14911         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14912
14913         (BetterConversion): Fix extremely trivial bug where we were referring to
14914         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14915         again !
14916
14917         * ../errors/bug16.cs : Add although we have fixed it.
14918
14919 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14920
14921         * expression.cs (BaseIndexer): Begin implementation.
14922
14923         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14924
14925         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14926         production directly to remove a shift/reduce, and implement
14927         explicit interface implementation.
14928
14929         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14930         after a floating point suffix.
14931
14932         * expression.cs (DoNumericPromotions): Improved the conversion for
14933         uint/uint.  If we have a constant, we avoid doing a typecast to a
14934         larger type.
14935
14936         * class.cs (Indexer): Implement explicit interface implementation
14937         for indexers.
14938
14939 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14940
14941         * class.cs: make the default instance constructor public and hidebysig.
14942
14943 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14944
14945         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14946         so we can call it from elsewhere.
14947
14948         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14949         we emit it internally if the class has a defined indexer; otherwise the user
14950         emits it by decorating the class definition with the DefaultMemberAttribute.
14951
14952         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14953         attribute is not used on a type which defines an indexer.
14954
14955         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14956         character when we skip whitespace.
14957
14958         * ../errors/cs0646.cs : Add.
14959
14960 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14961
14962         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14963         again. 
14964
14965         * makefile: Add practical target `mcs3.exe' which builds the third
14966         generation compiler. 
14967
14968         * expression.cs (New): Fix structures constructor calling.
14969
14970         * class.cs (Property, Method, Indexer): Emit Final flag on the
14971         method if we are an interface implementation and we are not
14972         abstract. 
14973
14974         * ecore.cs (PropertyExpr): New public field `IsBase', tells
14975         whether this property is referencing a `base' method.
14976
14977         * expression.cs (Invocation.EmitCall): take an extra argument:
14978         is_base, this is used to determine whether the `call' or
14979         `callvirt' opcode should be used.
14980
14981
14982         * delegate.cs: update EmitCall.
14983
14984         * class.cs (Method.Define): Set NewSlot for the cases where we are
14985         not implementing an interface method.
14986
14987         (Property.Define): ditto.
14988
14989 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
14990
14991         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
14992         'r'.  Allows mcs to parse itself fully.
14993
14994 2002-01-02  Ravi Pratap  <ravi@ximian.com>
14995
14996         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
14997         of the number of initializers that require the InitializeArray method.
14998
14999         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15000         update the above field where necessary.
15001
15002         (MakeByteBlob): Update accordingly.
15003
15004         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15005         greater than 2.
15006
15007         (EmitDynamicInitializers): Update in accordance with the new optimization.
15008
15009         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15010         same OpCode applies.
15011
15012         * cs-parser.jay : Fix some glaring errors I introduced.
15013
15014 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15015
15016         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15017         so that we can check for name clashes there too.
15018
15019         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15020         for interface indexers.
15021
15022         * interfaces.cs (Define): Emit the default member attribute.
15023
15024         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15025         variable was being referred to while setting the value ;-)
15026
15027 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15028
15029         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15030         byte-by-byte information when we know the data is zero.
15031
15032         Make the block always a multiple of 4, because
15033         DefineInitializedData has a bug.
15034
15035         * assign.cs: Fix, we should assign from the temporary, not from
15036         the source. 
15037
15038         * expression.cs (MakeByteBlob): Fix my incorrect code.
15039
15040 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15041
15042         * typemanager.cs (EnumToUnderlying): This function is used to get
15043         the underlying type from an enumeration, because it does not
15044         always work. 
15045
15046         * constant.cs: Use the I4_S form for values between -128 and 127.
15047
15048         * statement.cs (Block.LookupLabel): Looks up a label.
15049         (Block): Drop support for labeled blocks.
15050
15051         (LabeledStatement): New kind of statement that represents a label
15052         only.
15053
15054         (Goto): Finally implement this bad boy.
15055
15056         * cs-parser.jay: Update to reflect new mechanism to implement
15057         labels.
15058
15059 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * codegen.cs (EmitContext.This): a codegen property that keeps the
15062         a single instance of this instead of creating many different this
15063         instances. 
15064
15065         * delegate.cs (Delegate.DoResolve): Update to use the property;
15066
15067         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15068
15069         * expression.cs (BaseAccess.DoResolve): Ditto.
15070
15071 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15072
15073         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15074         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15075
15076         (InitCoreTypes): Update accordingly.
15077
15078         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15079         so we can quickly store the state.
15080
15081         (ApplyAttributes): Set the correct implementation flags
15082         for InternalCall methods.
15083
15084 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15085
15086         * expression.cs (EmitCall): if a method is not virtual, then do
15087         not use callvirt on it.
15088
15089         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15090         user defined stuff) requires the use of stobj, which takes an
15091         address on the stack instead of an array and an index.  So emit
15092         the Ldelema operation for it.
15093
15094         (EmitStoreOpcode): Use stobj for valuetypes.
15095
15096         (UnaryMutator.EmitCode): Use the right 1 value depending on
15097         whether we are dealing with int64/uint64, float or doubles.
15098
15099         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15100         constructors that I implemented last night.
15101
15102         (Constructor.IsDefault): Fix to work properly for static
15103         constructors.
15104
15105         * cs-parser.jay (CheckDef): report method signature errors.
15106         Update error number 103 to be 132.
15107
15108         * decl.cs: New AdditionResult enumeration value: MethodExists.
15109         Although we do this check for methods later on in the semantic
15110         analysis, catching repeated default constructors is so easy that
15111         we catch these here. 
15112
15113         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15114         promotions code.
15115
15116         (ParameterReference.EmitAssign, Emit): handle
15117         bools as bytes.
15118
15119         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15120         (ArrayAccess.EmitStoreOpcode): ditto.
15121
15122         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15123
15124         * expression.cs (MakeByteBlob): Complete all the missing types
15125         (uint, short, ushort, byte, sbyte)
15126
15127         * class.cs: Only init instance field initializers on instance
15128         constructors. 
15129
15130         Rename `constructors' to instance_constructors. 
15131
15132         (TypeContainer.AddConstructor): Only add constructors to the list
15133         if it is not static.
15134
15135         Make sure that we handle default_static_constructor independently
15136         everywhere where we handle instance_constructors
15137
15138 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15139
15140         * class.cs: Do not lookup or create a base initializer for a
15141         static constructor.
15142
15143         (ConstructorInitializer.Resolve): use the proper type to lookup
15144         for constructors.
15145
15146         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15147
15148         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15149         in DeclSpace. 
15150
15151         * decl.cs: CloseType is now an virtual method, the default
15152         implementation just closes this type.
15153
15154 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15155
15156         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15157         to PreserveSig by default. Also emit HideBySig on such methods.
15158
15159         Basically, set the defaults to standard values.
15160
15161         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15162         argument, if candidate is better, it can't be worse than the best !
15163
15164         (Invocation): Re-write bits to differentiate between methods being
15165         applicable in their expanded form and their normal form - for params
15166         methods of course.
15167
15168         Get rid of use_standard everywhere as only standard conversions are allowed
15169         in overload resolution. 
15170
15171         More spec conformance.
15172
15173 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * driver.cs: Add --timestamp, to see where the compiler spends
15176         most of its time.
15177
15178         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15179         `this' in static code.
15180
15181         (SimpleName.DoResolve): Implement in terms of a helper function
15182         that allows static-references to be passed upstream to
15183         MemberAccess.
15184
15185         (Expression.ResolveWithSimpleName): Resolve specially simple
15186         names when called by MemberAccess to implement the special
15187         semantics. 
15188
15189         (Expression.ImplicitReferenceConversion): Handle conversions from
15190         Null to reference types before others, as Null's type is
15191         System.Object. 
15192
15193         * expression.cs (Invocation.EmitCall): Handle the special case of
15194         calling methods declared on a reference type from a ValueType
15195         (Base classes System.Object and System.Enum)
15196
15197         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15198         the left hand side is a TypeExpr, not on every enumeration. 
15199
15200         (Binary.Resolve): If types are reference types, then do a cast to
15201         object on operators != and == of both arguments.
15202
15203         * typemanager.cs (FindMembers): Extract instance and static
15204         members if requested.
15205
15206         * interface.cs (PopulateProperty): Use void_type instead of null
15207         as the return type for the setter method.
15208
15209         (PopulateIndexer): ditto.
15210
15211 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15212
15213         * support.cs (ReflectionParameters): Fix minor bug where we
15214         were examining the wrong parameter for the ParamArray attribute.
15215
15216         Cope with requests for the type of the parameter at position
15217         greater than the params parameter's. We now return the element
15218         type of the params array as that makes more sense.
15219
15220         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15221         accordingly as we no longer have to extract the element type
15222         ourselves.
15223
15224         (Invocation.OverloadResolve): Update.
15225
15226 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15227
15228         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15229         against IEnumerator, test whether the return value is a descendant
15230         of the IEnumerator interface.
15231
15232         * class.cs (Indexer.Define): Use an auxiliary method to implement
15233         the other bits of the method definition.  Begin support for
15234         explicit interface implementation.
15235
15236         (Property.DefineMethod): Use TypeManager.void_type instead of null
15237         for an empty return value.
15238
15239 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15240
15241         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15242         dealing with a FieldExpr which is composed of a FieldBuilder, in
15243         the code path we did extract the constant, but we should have
15244         obtained the underlying value to be able to cast it (otherwise we
15245         end up in an infinite loop, this is what Ravi was running into).
15246
15247         (ArrayCreation.UpdateIndices): Arrays might be empty.
15248
15249         (MemberAccess.ResolveMemberAccess): Add support for section
15250         14.5.4.1 that deals with the special case of E.I when E is a type
15251         and something else, that I can be a reference to a static member.
15252
15253         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15254         handle a particular array type to create byte blobs, it is just
15255         something we dont generate byteblobs for.
15256
15257         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15258         arguments. 
15259
15260         * location.cs (Push): remove the key from the hashtable that we
15261         are about to add.   This happens for empty files.
15262
15263         * driver.cs: Dispose files after we have parsed them.
15264
15265         (tokenize): new function that only runs the tokenizer on its
15266         input, for speed testing.
15267
15268 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15269
15270         * class.cs (Event.Define): Define the private field only if there
15271         are no accessors defined.
15272
15273         * expression.cs (ResolveMemberAccess): If there is no associated
15274         field with the event, that means we have an event defined with its
15275         own accessors and we should flag error cs0070 since transforming
15276         ourselves into a field is not valid in that case.
15277
15278         * ecore.cs (SimpleName.DoResolve): Same as above.
15279
15280         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15281         and charset to sane values.
15282
15283 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15284
15285         * assign.cs (DoResolve): Perform check on events only if they 
15286         are being accessed outside the declaring type.
15287
15288         * cs-parser.jay (event_declarations): Update rules to correctly
15289         set the type of the implicit parameter etc.
15290
15291         (add_accessor, remove_accessor): Set current local parameters.
15292
15293         * expression.cs (Binary): For delegate addition and subtraction,
15294         cast the return value from the method into the appropriate delegate
15295         type.
15296
15297 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15298
15299         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15300         of these as the workaround is unnecessary.
15301
15302         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15303         delegate data - none of that is needed at all.
15304
15305         Re-write bits to extract the instance expression and the delegate method
15306         correctly.
15307
15308         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15309         on delegates too.
15310
15311         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15312         of attaching attributes instead of duplicating code everywhere.
15313
15314         * everywhere : Update code to do attribute emission using the above method.
15315
15316 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15317
15318         * expression.cs (IsParamsMethodApplicable): if there are not
15319         parameters, return immediately.
15320
15321         * ecore.cs: The 0 literal can be implicity converted to an enum
15322         type. 
15323
15324         (SimpleName.DoResolve): First lookup the type, then lookup the
15325         members. 
15326
15327         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15328         want to get its address.  If the InstanceExpression is not
15329         addressable, store the result in a temporary variable, then get
15330         the address of it.
15331
15332         * codegen.cs: Only display 219 errors on warning level or above. 
15333
15334         * expression.cs (ArrayAccess): Make it implement the
15335         IMemoryLocation interface.
15336
15337         (Binary.DoResolve): handle the operator == (object a, object b)
15338         and operator != (object a, object b) without incurring into a
15339         BoxedCast (because 5 != o should never be performed).
15340
15341         Handle binary enumerator operators.
15342
15343         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15344         value type, otherwise use Ldelem_ref.
15345
15346         Use precomputed names;
15347
15348         (AddressOf): Implement address of
15349
15350         * cs-parser.jay (labeled_statement): Fix recursive block
15351         addition by reworking the production.
15352
15353         * expression.cs (New.DoEmit): New has a special case:
15354                 
15355                  If we are dealing with a ValueType, we have a few
15356                  situations to deal with:
15357                 
15358                     * The target of New is a ValueType variable, that is
15359                       easy, we just pass this as the variable reference
15360                 
15361                     * The target of New is being passed as an argument,
15362                       to a boxing operation or a function that takes a
15363                       ValueType.
15364                 
15365                       In this case, we need to create a temporary variable
15366                       that is the argument of New.
15367
15368
15369 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15370
15371         * rootcontext.cs (LookupType): Check that current_type is not null before
15372         going about looking at nested types.
15373
15374         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15375         not implement the IAssignMethod interface any more.
15376
15377         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15378         where we tranform them into FieldExprs if they are being resolved from within
15379         the declaring type.
15380
15381         * ecore.cs (SimpleName.DoResolve): Do the same here.
15382
15383         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15384
15385         * ../errors/bug10.cs : Add.
15386
15387         * ../errors/cs0070.cs : Add.
15388
15389         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15390
15391         * assign.cs : Get rid of EventIsLocal everywhere.
15392
15393 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15394
15395         * ecore.cs (ConvertIntLiteral): finished the implementation.
15396
15397         * statement.cs (SwitchLabel): Convert the value we are using as a
15398         key before looking up the table.
15399
15400 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15401
15402         * codegen.cs (EmitTopBlock): Require a Location argument now.
15403
15404         * cs-parser.jay (constructor_declarator): We need to setup
15405         current_local_parameters before we parse the
15406         opt_constructor_initializer, to allow the variables to be bound
15407         to the constructor arguments.
15408
15409         * rootcontext.cs (LookupType): First lookup nested classes in our
15410         class and our parents before we go looking outside our class.
15411
15412         * expression.cs (ConstantFold): Extract/debox the values at the
15413         beginnning. 
15414
15415         * rootcontext.cs (EmitCode): Resolve the constants first before we
15416         resolve the types.  This is not really needed, but it helps debugging.
15417
15418         * statement.cs: report location.
15419
15420         * cs-parser.jay: pass location to throw statement.
15421
15422         * driver.cs: Small bug fix.
15423
15424         * report.cs: Updated format to be 4-zero filled digits.
15425
15426 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15427
15428         * expression.cs (CheckIndices): Fix minor bug where the wrong
15429         variable was being referred to ;-)
15430
15431         (DoEmit): Do not call EmitStaticInitializers when the 
15432         underlying type is System.Object.
15433
15434 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15435
15436         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15437         and do the usual workaround for SRE.
15438
15439         * class.cs (MyEventBuilder.EventType): New member to get at the type
15440         of the event, quickly.
15441
15442         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15443
15444         * assign.cs (Assign.DoResolve): Handle the case when the target
15445         is an EventExpr and perform the necessary checks.
15446
15447         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15448         interface.
15449
15450         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15451
15452         (EventExpr): Set the type in the constructor itself since we 
15453         are meant to be born fully resolved.
15454
15455         (EventExpr.Define): Revert code I wrote earlier.
15456                 
15457         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15458         instance expression is null. The instance expression is a This in that case
15459         or a null, depending on whether it is a static method or not.
15460
15461         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15462         refers to more than one method.
15463
15464         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15465         and accordingly flag errors.
15466
15467 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15468
15469         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15470
15471 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15472
15473         * location.cs (ToString): Provide useful rutine.
15474
15475 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15476
15477         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15478         objects, return the actual integral boxed.
15479
15480         * statement.cs (SwitchLabel): define an ILLabel for each
15481         SwitchLabel. 
15482
15483         (Switch.CheckSwitch): If the value is a Literal, extract
15484         the underlying literal.
15485
15486         Also in the unused hashtable we had, add the SwitchLabel so we can
15487         quickly look this value up.
15488
15489         * constant.cs: Implement a bunch of new constants.  Rewrite
15490         Literal based on this.  Made changes everywhere to adapt to this.
15491
15492         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15493         dereferencing array only once, and also copes with enumrations.
15494
15495         bytes are two bytes wide, not one.
15496
15497         (Cast): Perform constant conversions.
15498
15499         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15500         wrappers to the literals here.
15501
15502         * expression.cs (DoNumericPromotions): long literals can converted
15503         to ulong implicity (this is taken care of elsewhere, but I was
15504         missing this spot).
15505
15506         * ecore.cs (Expression.Literalize): Make the return type Literal,
15507         to improve type checking.
15508
15509         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15510
15511 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15512
15513         * literal.cs: Revert code from ravi that checked the bounds.  The
15514         bounds are sane by the definition of the type itself. 
15515
15516         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15517         need to actually look up in our parent hierarchy for interfaces
15518         implemented. 
15519
15520         * const.cs: Use the underlying type for enumerations
15521
15522         * delegate.cs: Compute the basename for the delegate creation,
15523         that should fix the delegate test case, and restore the correct
15524         Type Lookup semantics in rootcontext
15525
15526         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15527         referencing a nested type with the Reflection API is using the "+"
15528         sign. 
15529
15530         * cs-parser.jay: Do not require EOF token at the end.
15531
15532 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15533
15534         * rootcontext.cs (LookupType): Concatenate type names with
15535         a '.' instead of a '+' The test suite passes again.
15536
15537         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15538         field of the enumeration.
15539
15540         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15541         the case when the member is an EventExpr.
15542
15543         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15544         static has an associated instance expression.
15545
15546         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15547
15548         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15549
15550         * class.cs (Event.Define): Register event and perform appropriate checks
15551         for error #111.
15552
15553         We define the Add and Remove methods even if the use provides none because
15554         in that case, we provide default implementations ourselves.
15555
15556         Define a private field of the type of the event. This is done by the CSC compiler
15557         and we should be doing it too ;-)
15558
15559         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15560         More methods we use in code we generate.
15561
15562         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15563         is important.
15564
15565         (InitCoreTypes): Update accordingly for the above.
15566
15567         * class.cs (Event.Emit): Generate code for default accessors that we provide
15568
15569         (EmitDefaultMethod): Do the job in the above.
15570
15571         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15572         appropriate place.
15573
15574 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15575
15576         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15577         builders even if we were missing one.
15578
15579         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15580         pass the Basename as our class name instead of the Name.  The
15581         basename will be correctly composed for us.
15582
15583         * parameter.cs (Paramters): Now takes a Location argument.
15584
15585         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15586         make all the code call directly LookupType in RootContext and take
15587         this chance to pass the Location information everywhere.
15588
15589         * Everywhere: pass Location information.
15590
15591 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15592
15593         * class.cs (Constructor.Define): Updated way of detecting the
15594         length of the parameters.
15595
15596         (TypeContainer.DefineType): Use basename as the type name for
15597         nested types.
15598
15599         (TypeContainer.Define): Do not recursively define types here, as
15600         definition is taken care in order by the RootContext.
15601
15602         * tree.cs: Keep track of namespaces in a per-file basis.
15603
15604         * parameter.cs (Parameter.ComputeSignature): Update to use
15605         DeclSpace. 
15606
15607         (Parameters.GetSignature): ditto.
15608
15609         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15610         instead of a TypeContainer.
15611
15612         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15613         resolve names.  Because we need to be resolve in our context, not
15614         our parents.
15615
15616         * driver.cs: Implement response files.
15617
15618         * class.cs (TypeContainer.DefineType): If we are defined, do not
15619         redefine ourselves.
15620
15621         (Event.Emit): Emit the code for add/remove handlers.
15622         (Event.Define): Save the MethodBuilders for add/remove.
15623
15624         * typemanager.cs: Use pair here too.
15625
15626         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15627         DictionaryEntry requires the first argument to be non-null.  
15628
15629         (enum_declaration): Compute full name for registering the
15630         enumeration.
15631
15632         (delegate_declaration): Instead of using
15633         formal_parameter_list, use opt_formal_parameter_list as the list
15634         can be empty.
15635
15636         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15637         (EventParsing): New property that controls whether `add' and
15638         `remove' are returned as tokens or identifiers (for events);
15639
15640 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15641
15642         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15643         use MyEventBuilder only and let it wrap the real builder for us.
15644
15645         (MyEventBuilder): Revamp constructor etc.
15646
15647         Implement all operations that we perform on EventBuilder in precisely the same
15648         way here too.
15649
15650         (FindMembers): Update to use the EventBuilder member.
15651
15652         (Event.Emit): Update accordingly.
15653
15654 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15655
15656         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15657         by calling the appropriate methods.
15658
15659         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15660         useful.
15661
15662         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15663
15664 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15665
15666         * delegate.cs (Delegate.Populate): Check that the return type
15667         and various parameters types are indeed accessible.
15668
15669         * class.cs (Constructor.Define): Same here.
15670
15671         (Field.Define): Ditto.
15672
15673         (Event.Define): Ditto.
15674
15675         (Operator.Define): Check that the underlying Method defined itself
15676         correctly - so it's MethodBuilder should not be null.
15677
15678         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15679         expression happens to be null.
15680
15681         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15682         members but as of now we don't seem to be able to do anything really useful with it.
15683
15684         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15685         not the EventBuilder.
15686
15687 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15688
15689         * cs-tokenizer.cs: Add support for defines.
15690         Add support for #if, #elif, #else, #endif
15691
15692         (eval_var): evaluates a variable.
15693         (eval): stubbed for evaluating functions.
15694
15695         * cs-parser.jay: Pass the defines information
15696
15697         * driver.cs: Add --define command line option.
15698
15699         * decl.cs: Move MemberCore here.
15700
15701         Make it the base class for DeclSpace.  This allows us to catch and
15702         report 108 and 109 for everything now.
15703
15704         * class.cs (TypeContainer.Define): Extract all the members
15705         before populating and emit the warning 108 (new keyword required
15706         to override) instead of having each member implement this.
15707
15708         (MemberCore.Define): New abstract method, we will be using this in
15709         the warning reporting engine in Populate.
15710
15711         (Operator.Define): Adjust to new MemberCore protocol. 
15712
15713         * const.cs (Const): This does not derive from Expression, it is a
15714         temporary object we use to create fields, it is a MemberCore. 
15715
15716         * class.cs (Method.Define): Allow the entry point to be in a
15717         specific class.
15718
15719         * driver.cs: Rewrite the argument handler to clean it up a bit.
15720
15721         * rootcontext.cs: Made it just an auxiliary namespace feature by
15722         making everything static.
15723
15724         * driver.cs: Adapt code to use RootContext type name instead of
15725         instance variable.
15726
15727         * delegate.cs: Remove RootContext argument.
15728
15729         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15730         argument. 
15731
15732         * class.cs (Event.Define): The lookup can fail.
15733
15734         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15735
15736         * expression.cs: Resolve the this instance before invoking the code.
15737
15738 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15739
15740         * cs-parser.jay: Add a production in element_access that allows
15741         the thing to become a "type" reference.  This way we can parse
15742         things like "(string [])" as a type.
15743
15744         Note that this still does not handle the more complex rules of
15745         casts. 
15746
15747
15748         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15749
15750         * ecore.cs: (CopyNewMethods): new utility function used to
15751         assemble the list of methods from running FindMembers.
15752
15753         (MemberLookup): Rework FindMembers so that 
15754
15755 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15756
15757         * class.cs (TypeContainer): Remove Delegates who fail to be
15758         defined.
15759
15760         * delegate.cs (Populate): Verify that we dont get null return
15761         values.   TODO: Check for AsAccessible.
15762
15763         * cs-parser.jay: Use basename to emit error 574 (destructor should
15764         have the same name as container class), not the full name.
15765
15766         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15767         possible representation.  
15768
15769         Also implements integer type suffixes U and L.
15770
15771 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * expression.cs (ArrayCreation.DoResolve): We need to do the
15774         argument resolution *always*.
15775
15776         * decl.cs: Make this hold the namespace.  Hold the root context as
15777         well.
15778         (LookupType): Move here.
15779
15780         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15781
15782         * location.cs (Row, Name): Fixed the code, it was always returning
15783         references to the first file.
15784
15785         * interface.cs: Register properties defined through interfaces.
15786
15787         * driver.cs: Add support for globbing on the command line
15788
15789         * class.cs (Field): Make it derive from MemberCore as well.
15790         (Event): ditto.
15791
15792 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15793
15794         * class.cs (Event::Define): Check that the type of the event is a delegate
15795         type else flag error #66.
15796
15797         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15798         same.
15799
15800         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15801         values of EntryPoint, CharSet etc etc.
15802
15803         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15804
15805         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15806         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15807         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15808         which needs this to do its work.
15809
15810         * ../errors/cs0066.cs : Add.
15811
15812 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15813
15814         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15815         helper functions.
15816
15817         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15818         clears out the parameters field.
15819         (MemberSignatureCompare): Cleanup
15820
15821         (MemberCore): New base class used to share code between MethodCore
15822         and Property.
15823
15824         (RegisterRequiredImplementations) BindingFlags.Public requires
15825         either BindingFlags.Instace or Static.  Use instance here.
15826
15827         (Property): Refactored code to cope better with the full spec.
15828
15829         * parameter.cs (GetParameterInfo): Return an empty array instead
15830         of null on error.
15831
15832         * class.cs (Property): Abstract or extern properties have no bodies.
15833
15834         * parameter.cs (GetParameterInfo): return a zero-sized array.
15835
15836         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15837         method modifier validation to the typecontainer so we can reuse
15838         this on properties.
15839
15840         (MethodCore.ParameterTypes): return an empty sized array of types.
15841
15842         (Property.Define): Test property modifier validity.
15843
15844         Add tests for sealed/override too.
15845
15846         (Method.Emit): abstract or extern methods have no bodies.
15847
15848 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15849
15850         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15851         thing.
15852
15853         (Method::Define, ::Emit): Modify accordingly.
15854
15855         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15856
15857         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15858
15859         * makefile: Pass in /unsafe.
15860
15861 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15862
15863         * class.cs (MakeKey): Kill routine.
15864
15865         * class.cs (TypeContainer.Define): Correctly define explicit
15866         method implementations (they require the full interface name plus
15867         the method name).
15868
15869         * typemanager.cs: Deply the PtrHashtable here and stop using the
15870         lame keys.  Things work so much better.
15871
15872         This of course broke everyone who depended on `RegisterMethod' to
15873         do the `test for existance' test.  This has to be done elsewhere.
15874
15875         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15876         the object stupid Equals method (because, that like fails all over
15877         the place).  We still do not use it.
15878
15879         * class.cs (TypeContainer.SetRequiredInterface,
15880         TypeContainer.RequireMethods): Killed these two routines and moved
15881         all the functionality to RegisterRequiredImplementations.
15882
15883         (TypeContainer.RegisterRequiredImplementations): This routine now
15884         registers all the implementations required in an array for the
15885         interfaces and abstract methods.  We use an array of structures
15886         which can be computed ahead of time to reduce memory usage and we
15887         also assume that lookups are cheap as most classes will not
15888         implement too many interfaces.
15889
15890         We also avoid creating too many MethodSignatures.
15891
15892         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15893         clear the "pending" bit if we find that there are problems with
15894         the declaration.
15895
15896         (TypeContainer.VerifyPendingMethods): Update to report errors of
15897         methods that look like implementations but are not.
15898
15899         (TypeContainer.Define): Add support for explicit interface method
15900         implementation. 
15901
15902 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15903
15904         * typemanager.cs: Keep track of the parameters here instead of
15905         being a feature of the TypeContainer.
15906
15907         * class.cs: Drop the registration of parameters here, as
15908         InterfaceMethods are also interface declarations.
15909
15910         * delegate.cs: Register methods with the TypeManager not only with
15911         the TypeContainer.  This code was buggy.
15912
15913         * interface.cs: Full registation here.
15914
15915 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * expression.cs: Remove reducer for binary expressions, it can not
15918         be done this way.
15919
15920         * const.cs: Put here the code that used to go into constant.cs
15921
15922         * constant.cs: Put here the code for constants, this is a new base
15923         class for Literals.
15924
15925         * literal.cs: Make Literal derive from Constant.
15926
15927 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15928
15929         * statement.cs (Return.Emit): Report error 157 if the user
15930         attempts to return from a finally block.
15931
15932         (Return.Emit): Instead of emitting a return, jump to the end of
15933         the function.
15934
15935         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15936         LocalBuilder to store the result of the function.  ReturnLabel is
15937         the target where we jump.
15938
15939
15940 2001-12-09  Radek Doulik  <rodo@ximian.com>
15941
15942         * cs-parser.jay: remember alias in current namespace
15943
15944         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15945         namespaces
15946
15947         * class.cs (LookupAlias): lookup alias in my_namespace
15948
15949         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15950         aliases hashtable
15951         (LookupAlias): lookup alias in this and if needed in parent
15952         namespaces
15953
15954 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15955
15956         * support.cs: 
15957
15958         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15959         making things static.  I need this to avoid passing the
15960         TypeContainer when calling ParameterType.
15961
15962         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15963         that did string manipulation to compute the type and then call
15964         GetType.  Use Parameter.ParameterType instead.
15965
15966         * cs-tokenizer.cs: Consume the suffix for floating values.
15967
15968         * expression.cs (ParameterReference): figure out whether this is a
15969         reference parameter or not.  Kill an extra variable by computing
15970         the arg_idx during emission.
15971
15972         * parameter.cs (Parameters.GetParameterInfo): New overloaded
15973         function that returns whether a parameter is an out/ref value or not.
15974
15975         (Parameter.ParameterType): The type of the parameter (base,
15976         without ref/out applied).
15977
15978         (Parameter.Resolve): Perform resolution here.
15979         (Parameter.ExternalType): The full type (with ref/out applied).
15980
15981         * statement.cs (Using.Emit, Using.EmitExpression): Implement
15982         support for expressions on the using statement.
15983
15984 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
15985
15986         * statement.cs (Using.EmitLocalVariableDecls): Split the
15987         localvariable handling of the using statement.
15988
15989         (Block.EmitMeta): Keep track of variable count across blocks.  We
15990         were reusing slots on separate branches of blocks.
15991
15992         (Try.Emit): Emit the general code block, we were not emitting it. 
15993
15994         Check the type of the declaration to be an IDisposable or
15995         something that can be implicity converted to it. 
15996
15997         Emit conversions if required.
15998
15999         * ecore.cs (EmptyExpression): New utility class.
16000         (Expression.ImplicitConversionExists): New utility function.
16001
16002 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * statement.cs (Using): Implement.
16005
16006         * expression.cs (LocalVariableReference): Support read only variables.
16007
16008         * statement.cs: Remove the explicit emit for the Leave opcode.
16009         (VariableInfo): Add a readonly field.
16010
16011 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * ecore.cs (ConvCast): new class used to encapsulate the various
16014         explicit integer conversions that works in both checked and
16015         unchecked contexts.
16016
16017         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16018         properly generate the overflow opcodes.
16019
16020 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16021
16022         * statement.cs: The correct type for the EmptyExpression is the
16023         element_type, not the variable type.  Ravi pointed this out.
16024
16025 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16026
16027         * class.cs (Method::Define): Handle PInvoke methods specially
16028         by using DefinePInvokeMethod instead of the usual one.
16029
16030         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16031         above to do the task of extracting information and defining the method.
16032
16033 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16034
16035         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16036         of the condition for string type.
16037
16038         (Emit): Move that here. 
16039
16040         (ArrayCreation::CheckIndices): Keep string literals in their expression
16041         form.
16042
16043         (EmitDynamicInitializers): Handle strings appropriately.
16044
16045 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16046
16047         * codegen.cs (EmitContext): Replace multiple variables with a
16048         single pointer to the current Switch statement.
16049
16050         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16051         EmitContext.
16052
16053 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16054
16055         * statement.cs 
16056
16057         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16058         default'.
16059
16060         (Foreach.Emit): Foreach on arrays was not setting
16061         up the loop variables (for break/continue).
16062
16063         (GotoCase): Semi-implented.
16064
16065 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16066
16067         * attribute.cs (CheckAttribute): Handle system attributes by using
16068         Attribute.GetAttributes to examine information we need.
16069
16070         (GetValidPlaces): Same here.
16071
16072         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16073
16074         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16075
16076         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16077
16078         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16079
16080         (Method::Emit): Handle the case when we are a PInvoke method.
16081
16082 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16083
16084         * expression.cs: Use ResolveWithSimpleName on compound names.
16085
16086 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16087
16088         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16089         before trying to reduce it.
16090
16091         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16092
16093         * constant.cs (LookupConstantValue): Implement.
16094
16095         (EmitConstant): Use the above in emitting the constant.
16096
16097         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16098         that are user-defined by doing a LookupConstantValue on them.
16099
16100         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16101         too, like above.
16102
16103 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16106
16107         (BaseAccess.DoResolve): Implement.
16108
16109         (MemberAccess.DoResolve): Split this routine into a
16110         ResolveMemberAccess routine that can be used independently
16111
16112 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16113
16114         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16115         As that share bits of the implementation.  Is returns a boolean,
16116         while As returns the Type that is being probed.
16117
16118 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16119
16120         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16121         instead of a Literal - much easier.
16122
16123         (EnumInTransit): Remove - utterly useless :-)
16124
16125         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16126
16127         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16128
16129         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16130         chain when we have no associated expression.
16131
16132 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16133
16134         * constant.cs (Define): Use Location while reporting the errror.
16135
16136         Also emit a warning when 'new' is used and there is no inherited
16137         member to hide.
16138
16139         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16140         populated.
16141
16142         (LookupEnumValue): Implement to lookup an enum member's value and define it
16143         if necessary.
16144
16145         (Populate): Re-write accordingly to use the above routine.
16146
16147 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16148
16149         * expression.cs (This): Fix prototype for DoResolveLValue to
16150         override the base class DoResolveLValue.
16151
16152         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16153         declarations) 
16154
16155         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16156         (we need to load the address of the field here).  This fixes
16157         test-22. 
16158
16159         (FieldExpr.DoResolveLValue): Call the DoResolve
16160         function to initialize the Instance expression.
16161
16162         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16163         correctly the GetEnumerator operation on a value type.
16164
16165         * cs-parser.jay: Add more simple parsing error catches.
16166
16167         * statement.cs (Switch): Add support for string switches.
16168         Handle null specially.
16169
16170         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16171
16172 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16173
16174         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16175
16176         (declare_local_constant): New helper function.
16177
16178         * statement.cs (AddConstant): Keep a separate record of constants
16179
16180         (IsConstant): Implement to determine if a variable is a constant.
16181
16182         (GetConstantExpression): Implement.
16183
16184         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16185
16186         * statement.cs (IsVariableDefined): Re-write.
16187
16188 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16189
16190         * class.cs (TypeContainer::FindMembers): Look for constants
16191         in the case when we are looking for MemberTypes.Field
16192
16193         * expression.cs (MemberAccess::DoResolve): Check that in the
16194         case we are a FieldExpr and a Literal, we are not being accessed
16195         by an instance reference.
16196
16197         * cs-parser.jay (local_constant_declaration): Implement.
16198
16199         (declaration_statement): Implement for constant declarations.
16200
16201 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16202
16203         * statement.cs (Switch): Catch double defaults.
16204
16205         (Switch): More work on the switch() statement
16206         implementation.  It works for integral values now, need to finish
16207         string support.
16208
16209
16210 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16211
16212         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16213         integer literals into other integer literals.  To be used by
16214         switch. 
16215
16216 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16217
16218         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16219         some memory.
16220
16221         (EmitDynamicInitializers): Cope with the above since we extract data
16222         directly from ArrayData now.
16223
16224         (ExpectInitializers): Keep track of whether initializers are mandatory
16225         or not.
16226
16227         (Bounds): Make it a hashtable to prevent the same dimension being 
16228         recorded for every element in that dimension.
16229
16230         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16231         from being found.
16232
16233         Also fix bug which was causing the indices to be emitted in the reverse
16234         order.
16235
16236 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16237
16238         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16239         unfinished.  They do not work, because the underlying code is
16240         sloppy.
16241
16242 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16243
16244         * cs-parser.jay: Remove bogus fixme.
16245
16246         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16247         on Switch statement.
16248
16249 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16250
16251         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16252         the same. 
16253
16254         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16255         parameter. Apparently, any expression is allowed. 
16256
16257         (ValidateInitializers): Update accordingly.
16258
16259         (CheckIndices): Fix some tricky bugs thanks to recursion.
16260
16261         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16262         I was being completely brain-dead.
16263
16264         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16265         and re-write acordingly.
16266
16267         (DelegateInvocation): Re-write accordingly.
16268
16269         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16270
16271         (MakeByteBlob): Handle types more correctly.
16272
16273         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16274         initialization from expressions but it is incomplete because I am a complete
16275         Dodo :-|
16276
16277 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16278
16279         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16280         on If.  Basically, we have to return `true' (ie, we do return to
16281         our caller) only if both branches of the if return.
16282
16283         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16284         short-circuit operators, handle them as short circuit operators. 
16285
16286         (Cast.DoResolve): Resolve type.
16287         (Cast.Cast): Take an expression as the target type.
16288
16289         * cs-parser.jay (cast_expression): Remove old hack that only
16290         allowed a limited set of types to be handled.  Now we take a
16291         unary_expression and we resolve to a type during semantic
16292         analysis.
16293
16294         Use the grammar productions from Rhys to handle casts (this is
16295         not complete like Rhys syntax yet, we fail to handle that corner
16296         case that C# has regarding (-x), but we will get there.
16297
16298 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16299
16300         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16301         field which is an array type.
16302
16303         * cs-parser.jay (declare_local_variables): Support array initialization too.
16304
16305         * typemanager.cs (MakeKey): Implement.
16306
16307         (everywhere): Use the above appropriately.
16308
16309         * cs-parser.jay (for_statement): Update for array initialization while
16310         declaring variables.
16311
16312         * ecore.cs : The error message was correct, it's the variable's names that
16313         were misleading ;-) Make the code more readable.
16314
16315         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16316         the correct type etc.
16317
16318         (ConvertExplicit): Handle Enum types by examining the underlying type.
16319
16320 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16321
16322         * parameter.cs (GetCallingConvention): Always return
16323         CallingConventions.Standard for now.
16324
16325 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16328         and `r' after calling DoNumericPromotions.
16329
16330         * ecore.cs: Fix error message (the types were in the wrong order).
16331
16332         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16333         BindingFlags.Instance as well 
16334
16335         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16336         implicit int literal conversion in an empty cast so that we
16337         propagate the right type upstream.
16338
16339         (UnboxCast): new class used to unbox value types.
16340         (Expression.ConvertExplicit): Add explicit type conversions done
16341         by unboxing.
16342
16343         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16344         the target type before applying the implicit LongLiterals to ULong
16345         literal cast.
16346
16347 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16348
16349         * cs-parser.jay (for_statement): Reworked the way For works: now
16350         we declare manually any variables that are introduced in
16351         for_initializer to solve the problem of having out-of-band code
16352         emition (that is what got for broken).
16353
16354         (declaration_statement): Perform the actual variable declaration
16355         that used to be done in local_variable_declaration here.
16356
16357         (local_variable_declaration): Do not declare anything, just pass
16358         the information on a DictionaryEntry
16359
16360 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16361
16362         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16363         re-write of the logic to now make it recursive.
16364
16365         (UpdateIndices): Re-write accordingly.
16366
16367         Store element data in a separate ArrayData list in the above methods.
16368
16369         (MakeByteBlob): Implement to dump the array data into a byte array.
16370
16371 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16372
16373         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16374         into CheckIndices.
16375
16376         * constant.cs (Define): Implement.
16377
16378         (EmitConstant): Re-write fully.
16379
16380         Pass in location info.
16381
16382         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16383         respectively.
16384
16385         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16386         DictionaryEntry since we need location info too.
16387
16388         (constant_declaration): Update accordingly.
16389
16390         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16391         code into another method : UpdateIndices.
16392
16393 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16394
16395         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16396         some type checking etc.
16397
16398 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16399
16400         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16401         bits to provide dimension info if the user skips doing that.
16402
16403         Update second constructor to store the rank correctly.
16404
16405 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16406
16407         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16408         and try to implement.
16409
16410         * ../errors/cs0150.cs : Add.
16411
16412         * ../errors/cs0178.cs : Add.
16413
16414 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16415
16416         * statement.cs: Implement foreach on multi-dimensional arrays. 
16417
16418         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16419         name of the params argument.
16420
16421         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16422         initializing the array.
16423
16424         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16425         we can use this elsewhere.
16426
16427         * statement.cs: Finish implementation of foreach for single
16428         dimension arrays.
16429
16430         * cs-parser.jay: Use an out-of-band stack to pass information
16431         around, I wonder why I need this.
16432
16433         foreach_block: Make the new foreach_block the current_block.
16434
16435         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16436         function used to return a static Parameters structure.  Used for
16437         empty parameters, as those are created very frequently.
16438
16439         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16440
16441 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16442
16443         * interface.cs : Default modifier is private, not public. The
16444         make verify test passes again.
16445
16446 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16447
16448         * support.cs (ReflectionParameters): Fix logic to determine
16449         whether the last parameter is a params one. Test 9 passes again.
16450
16451         * delegate.cs (Populate): Register the builders we define with
16452         RegisterParameterForBuilder. Test 19 passes again.
16453
16454         * cs-parser.jay (property_declaration): Reference $6 instead
16455         of $$ to get at the location.
16456
16457         (indexer_declaration): Similar stuff.
16458
16459         (attribute): Ditto.
16460
16461         * class.cs (Property): Register parameters for the Get and Set methods
16462         if they exist. Test 23 passes again.
16463
16464         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16465         call to EmitArguments as we are sure there aren't any params arguments. 
16466         Test 32 passes again.
16467
16468         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16469         IndexOutOfRangeException. 
16470
16471         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16472         Test 33 now passes again.
16473
16474 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16475
16476         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16477         broke a bunch of things.  Will have to come up with a better way
16478         of tracking locations.
16479
16480         * statement.cs: Implemented foreach for single dimension arrays.
16481
16482 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16483
16484         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16485         an error.  This removes the lookup from the critical path.
16486
16487         * cs-parser.jay: Removed use of temporary_loc, which is completely
16488         broken. 
16489
16490 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * support.cs (ReflectionParameters.ParameterModifier): Report
16493         whether the argument is a PARAMS argument or not.
16494
16495         * class.cs: Set the attribute `ParamArrayAttribute' on the
16496         parameter argument.
16497
16498         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16499         and cons_param_array_attribute (ConstructorInfo for
16500         ParamArrayAttribute)., 
16501
16502         * codegen.cs: Emit the return using the `Return' statement, that
16503         way we can report the error correctly for missing return values. 
16504
16505         * class.cs (Method.Emit): Clean up.
16506
16507         * expression.cs (Argument.Resolve): Take another argument: the
16508         location where this argument is used.  Notice that this is not
16509         part of the "Argument" class as to reduce the size of the
16510         structure (we know the approximate location anyways).
16511
16512         Test if the argument is a variable-reference, if not, then
16513         complain with a 206.
16514
16515         (Argument.Emit): Emit addresses of variables.
16516
16517         (Argument.FullDesc): Simplify.
16518
16519         (Invocation.DoResolve): Update for Argument.Resolve.
16520
16521         (ElementAccess.DoResolve): ditto.
16522
16523         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16524         method should be virtual, as this method is always virtual.
16525
16526         (NewDelegate.DoResolve): Update for Argument.Resolve.
16527
16528         * class.cs (ConstructorInitializer.DoResolve): ditto.
16529
16530         * attribute.cs (Attribute.Resolve): ditto.
16531
16532 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16533
16534         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16535
16536         * expression.cs (ParameterReference): Drop IStackStorage and implement
16537         IAssignMethod instead. 
16538
16539         (LocalVariableReference): ditto.
16540
16541         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16542         IAssignMethod instead. 
16543
16544 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16545
16546         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16547         enumerations that are used in heavily used structures derive from
16548         byte in a laughable and pathetic attempt to reduce memory usage.
16549         This is the kind of pre-optimzations that you should not do at
16550         home without adult supervision.
16551
16552         * expression.cs (UnaryMutator): New class, used to handle ++ and
16553         -- separatedly from the other unary operators.  Cleans up the
16554         code, and kills the ExpressionStatement dependency in Unary.
16555
16556         (Unary): Removed `method' and `Arguments' from this class, making
16557         it smaller, and moving it all to SimpleCall, so I can reuse this
16558         code in other locations and avoid creating a lot of transient data
16559         strucutres when not required.
16560
16561         * cs-parser.jay: Adjust for new changes.
16562
16563 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16564
16565         * enum.cs (Enum.Populate): If there is a failure during
16566         definition, return
16567
16568         * cs-parser.jay (opt_enum_base): we used to catch type errors
16569         here, but this is really incorrect.  The type error should be
16570         catched during semantic analysis.
16571
16572 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16573
16574         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16575         current_local_parameters as expected since I, in my stupidity, had forgotten
16576         to do this :-)
16577
16578         * attribute.cs (GetValidPlaces): Fix stupid bug.
16579
16580         * class.cs (Method::Emit): Perform check on applicability of attributes.
16581
16582         (Constructor::Emit): Ditto.
16583
16584         (Field::Emit): Ditto.
16585
16586         (Field.Location): Store location information.
16587
16588         (Property, Event, Indexer, Operator): Ditto.
16589
16590         * cs-parser.jay (field_declaration): Pass in location for each field.
16591
16592         * ../errors/cs0592.cs : Add.
16593
16594 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16595
16596         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16597
16598         (InitCoreTypes): Update accordingly.
16599
16600         (RegisterAttrType, LookupAttr): Implement.
16601
16602         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16603         info about the same.
16604
16605         (Resolve): Update to populate the above as necessary.
16606
16607         (Error592): Helper.
16608
16609         (GetValidPlaces): Helper to the above.
16610
16611         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16612
16613         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16614
16615 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16616
16617         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16618
16619         * ../errors/cs0617.cs : Add.
16620
16621 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16622
16623         * enum.cs (Emit): Rename to Populate to be more consistent with what
16624         we expect it to do and when exactly it is called.
16625
16626         * class.cs, rootcontext.cs : Update accordingly.
16627
16628         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16629         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16630
16631         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16632
16633         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16634         of a fieldinfo using the above, when dealing with a FieldBuilder.
16635
16636 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16637
16638         * ../errors/cs0031.cs : Add.
16639
16640         * ../errors/cs1008.cs : Add.
16641
16642         * ../errrors/cs0543.cs : Add.
16643
16644         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16645         enum type.
16646
16647         (FindMembers): Implement.
16648
16649         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16650         enums and delegates too.
16651
16652         (enum_types): Rename to builder_to_enum.
16653
16654         (delegate_types): Rename to builder_to_delegate.
16655
16656         * delegate.cs (FindMembers): Implement.
16657
16658 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16659
16660         * typemanager.cs (IsEnumType): Implement.
16661
16662         * enum.cs (Emit): Re-write parts to account for the underlying type
16663         better and perform checking etc.
16664
16665         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16666         of the underlying type.
16667
16668         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16669         value
16670
16671         * enum.cs (error31): Helper to report error #31.
16672
16673         * cs-parser.jay (enum_declaration): Store location of each member too.
16674
16675         * enum.cs (member_to_location): New hashtable. 
16676
16677         (AddEnumMember): Update location hashtable.
16678
16679         (Emit): Use the location of each member while reporting errors.
16680
16681 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16682
16683         * cs-parser.jay: A for_initializer if is a
16684         local_variable_declaration really ammount to have an implicit
16685         block with the variable declaration and no initializer for for.
16686
16687         * statement.cs (For.Emit): Cope with null initializers.
16688
16689         This fixes the infinite loop on for initializers.
16690
16691 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16692
16693         * enum.cs: More cleanup.
16694
16695         * ecore.cs: Remove dead code.
16696
16697         * class.cs (Property.Emit): More simplification.
16698         (Event.Emit): ditto.
16699
16700         Reworked to have less levels of indentation.
16701
16702 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16703
16704         * class.cs (Property): Emit attributes.
16705
16706         (Field): Ditto.
16707
16708         (Event): Ditto.
16709
16710         (Indexer): Ditto.
16711
16712         (Operator): Ditto.
16713
16714         * enum.cs (Emit): Ditto.
16715
16716         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16717         Enums too.
16718
16719         * class.cs (Field, Event, etc.): Move attribute generation into the
16720         Emit method everywhere.
16721
16722         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16723         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16724         as we had no way of defining nested enums !
16725
16726         * rootcontext.cs : Adjust code accordingly.
16727
16728         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16729
16730 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16731
16732         * expression.cs (EvalConstantExpression): Move into ecore.cs
16733
16734         * enum.cs (Enum): Rename some members and make them public and readonly
16735         according to our convention.
16736
16737         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16738         nothing else.
16739
16740         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16741
16742         (Enum::Emit): Write a simple version for now which doesn't try to compute
16743         expressions. I shall modify this to be more robust in just a while.
16744
16745         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16746
16747         (TypeContainer::CloseType): Create the Enum types too.
16748
16749         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16750
16751         * expression.cs (EvalConstantExpression): Get rid of completely.
16752
16753         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16754         user-defined values and other cases.
16755
16756         (IsValidEnumLiteral): Helper function.
16757
16758         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16759         out there in the case we had a literal FieldExpr.
16760
16761         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16762
16763         (Literalize): Revamp a bit to take two arguments.
16764
16765         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16766
16767 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16768
16769         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16770
16771         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16772
16773         (Resolve): Use the above to ensure we have proper initializers.
16774
16775 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16776
16777         * expression.cs (Expression::EvalConstantExpression): New method to 
16778         evaluate constant expressions.
16779
16780         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16781
16782 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16783
16784         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16785         in an array.
16786
16787         (Binary.ResolveOperator): Handle operator != (object a, object b)
16788         and operator == (object a, object b);
16789
16790         (Binary.DoNumericPromotions): Indicate whether the numeric
16791         promotion was possible.
16792
16793         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16794         Implement.  
16795
16796         Made the ArrayAccess implement interface IAssignMethod instead of
16797         IStackStore as the order in which arguments are passed reflects
16798         this.
16799
16800         * assign.cs: Instead of using expr.ExprClass to select the way of
16801         assinging, probe for the IStackStore/IAssignMethod interfaces.
16802
16803         * typemanager.cs: Load InitializeArray definition.
16804
16805         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16806         static data that can be used to initialize arrays. 
16807
16808 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16809
16810         * expression.cs: Handle operator== and operator!= for booleans.
16811
16812         (Conditioal.Reduce): Implement reducer for the ?: operator.
16813
16814         (Conditional.Resolve): Implement dead code elimination.
16815
16816         (Binary.Resolve): Catch string literals and return a new
16817         concatenated string.
16818
16819         (Unary.Reduce): Implement reduction of unary expressions.
16820
16821         * ecore.cs: Split out the expression core handling here.
16822
16823         (Expression.Reduce): New method used to perform constant folding
16824         and CSE.  This is needed to support constant-expressions. 
16825
16826         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16827         targets, and optimize for !x.
16828
16829 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16830
16831         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16832         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16833         set custom atttributes.
16834
16835         * literal.cs (Literal::GetValue): New abstract method to return the actual
16836         value of the literal, cast as an object.
16837
16838         (*Literal): Implement GetValue method.
16839
16840         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16841         expressions to the arraylist but objects of type Argument.
16842
16843         * class.cs (TypeContainer::Emit): Emit our attributes too.
16844
16845         (Method::Emit, Constructor::Emit): Ditto.
16846
16847         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16848         to be ignoring earlier.
16849
16850 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16851
16852         * attribute.cs (AttributeSection::Define): Implement to do the business
16853         of constructing a CustomAttributeBuilder.
16854
16855         (Attribute): New trivial class. Increases readability of code.  
16856
16857         * cs-parser.jay : Update accordingly.
16858
16859         (positional_argument_list, named_argument_list, named_argument): New rules
16860
16861         (attribute_arguments): Use the above so that we are more correct.
16862
16863 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16864
16865         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16866         to perform all checks for a method with a params parameter.
16867
16868         (Invocation::OverloadResolve): Update to use the above method and therefore
16869         cope correctly with params method invocations.
16870
16871         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16872         params too.
16873
16874         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16875         constructors in our parent too because we can't afford to miss out on 
16876         protected ones ;-)
16877
16878         * attribute.cs (AttributeSection): New name for the class Attribute
16879
16880         Other trivial changes to improve readability.
16881
16882         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16883         use the new class names.
16884
16885 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16886
16887         * class.cs (Method::Define): Complete definition for params types too
16888
16889         (Indexer::Define): Ditto.
16890
16891         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16892         Cope everywhere with a request for info about the array parameter.
16893
16894 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16895
16896         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16897
16898         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16899         local_variable_type to extract the string corresponding to the type.
16900
16901         (local_variable_type): Fixup the action to use the new helper method.
16902
16903         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16904         go.
16905
16906         * expression.cs : Clean out code which uses the above.
16907
16908 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16909
16910         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16911         and bale out if necessary by returning a false.
16912
16913         (RegisterProperty): Ditto.
16914
16915         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16916         and print out appropriate error messages.
16917
16918         * interface.cs (everywhere): Ditto.
16919
16920         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16921         location to constructor.
16922
16923         * class.cs (Property, Event, Indexer): Update accordingly.
16924
16925         * ../errors/cs111.cs : Added.
16926
16927         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16928         of a method, as laid down by the spec.
16929
16930         (Invocation::OverloadResolve): Use the above method.
16931
16932 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16933
16934         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16935         now take a TypeContainer and a Parameters object.
16936
16937         (ParameterData): Modify return type of ParameterModifier method to be 
16938         Parameter.Modifier and not a string.
16939
16940         (ReflectionParameters, InternalParameters): Update accordingly.
16941
16942         * expression.cs (Argument::GetParameterModifier): Same here.
16943
16944         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16945         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16946         symbol in it at all so maybe this is only for now.
16947
16948 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16949
16950         * support.cs (InternalParameters): Constructor now takes an extra argument 
16951         which is the actual Parameters class.
16952
16953         (ParameterDesc): Update to provide info on ref/out modifiers.
16954
16955         * class.cs (everywhere): Update call to InternalParameters to pass in
16956         the second argument too.
16957
16958         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16959         to return the modifier info [ref/out etc]
16960
16961         (InternalParameters, ReflectionParameters): Implement the above.
16962
16963         * expression.cs (Argument::ParameterModifier): Similar function to return
16964         info about the argument's modifiers.
16965
16966         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16967         too.
16968
16969         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16970         a new SetFormalParameters object which we pass to InternalParameters.
16971
16972 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16973
16974         * expression.cs (NewArray): Merge into the ArrayCreation class.
16975
16976 2001-10-29  Ravi Pratap  <ravi@ximian.com>
16977
16978         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
16979         NewUserdefinedArray into one as there wasn't much of a use in having
16980         two separate ones.
16981
16982         * expression.cs (Argument): Change field's name to ArgType from Type.
16983
16984         (Type): New readonly property which returns the proper type, taking into 
16985         account ref/out modifiers.
16986
16987         (everywhere): Adjust code accordingly for the above.
16988
16989         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
16990         whether we are emitting for a ref or out parameter.
16991
16992         * expression.cs (Argument::Emit): Use the above field to set the state.
16993
16994         (LocalVariableReference::Emit): Update to honour the flag and emit the
16995         right stuff.
16996
16997         * parameter.cs (Attributes): Set the correct flags for ref parameters.
16998
16999         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17000
17001         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17002
17003         (ReflectionParameters, InternalParameters): Implement the above method.
17004
17005         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17006         reporting errors.
17007
17008         (Invocation::FullMethodDesc): Ditto. 
17009
17010 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17011
17012         * cs-parser.jay: Add extra production for the second form of array
17013         creation. 
17014
17015         * expression.cs (ArrayCreation): Update to reflect the above
17016         change. 
17017
17018         * Small changes to prepare for Array initialization.
17019
17020 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * typemanager.cs (ImplementsInterface): interface might be null;
17023         Deal with this problem;
17024
17025         Also, we do store negative hits on the cache (null values), so use
17026         this instead of calling t.GetInterfaces on the type everytime.
17027
17028 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17029
17030         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17031
17032         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17033         split functionality out into different classes.
17034
17035         (New::FormArrayType): Move into NewBuiltinArray.
17036
17037         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17038         quite useless.
17039
17040         (NewBuiltinArray): New class to handle creation of built-in arrays.
17041
17042         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17043         account creation of one-dimensional arrays.
17044
17045         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17046
17047         (NewUserdefinedArray::DoResolve): Implement.
17048
17049         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17050
17051         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17052         we maintain inside the TypeManager. This is necessary to perform lookups on the
17053         module builder.
17054
17055         (LookupType): Update to perform GetType on the module builders too.     
17056
17057         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17058
17059         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17060
17061 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17062
17063         * expression.cs (New::DoResolve): Implement guts of array creation.
17064
17065         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17066
17067 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17068
17069         * expression.cs: Fix bug I introduced lsat night that broke
17070         Delegates. 
17071
17072         (Expression.Resolve): Report a 246 error (can not resolve name)
17073         if we find a SimpleName in the stream.
17074
17075         (Expression.ResolveLValue): Ditto.
17076
17077         (Expression.ResolveWithSimpleName): This function is a variant of
17078         ResolveName, this one allows SimpleNames to be returned without a
17079         warning.  The only consumer of SimpleNames is MemberAccess
17080
17081 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17082
17083         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17084         might arrive here.  I have my doubts that this is correct.
17085
17086         * statement.cs (Lock): Implement lock statement.
17087
17088         * cs-parser.jay: Small fixes to support `lock' and `using'
17089
17090         * cs-tokenizer.cs: Remove extra space
17091
17092         * driver.cs: New flag --checked, allows to turn on integer math
17093         checking. 
17094
17095         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17096         Threading.Monitor.Exit 
17097
17098 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17099
17100         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17101         Expression Class to be IndexerAccess.
17102
17103         Notice that Indexer::DoResolve sets the eclass to Value.
17104
17105 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * class.cs (TypeContainer::Emit): Emit code for indexers.
17108
17109         * assign.cs (IAssignMethod): New interface implemented by Indexers
17110         and Properties for handling assignment.
17111
17112         (Assign::Emit): Simplify and reuse code. 
17113
17114         * expression.cs (IndexerAccess, PropertyExpr): Implement
17115         IAssignMethod, clean up old code. 
17116
17117 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17118
17119         * typemanager.cs (ImplementsInterface): New method to determine if a type
17120         implements a given interface. Provides a nice cache too.
17121
17122         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17123         method.
17124
17125         (ConvertReferenceExplicit): Ditto.
17126
17127         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17128         various methods, with correct names etc.
17129
17130         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17131         Operator.UnaryNegation.
17132
17133         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17134         we have a unary plus or minus operator.
17135
17136         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17137         UnaryMinus.
17138
17139         * everywhere : update accordingly.
17140
17141         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17142         respectively.
17143
17144         * class.cs (Method::Define): For the case where we are implementing a method
17145         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17146         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17147
17148 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17149
17150         * interface.cs (FindMembers): Implement to work around S.R.E
17151         lameness.
17152
17153         * typemanager.cs (IsInterfaceType): Implement.
17154
17155         (FindMembers): Update to handle interface types too.
17156
17157         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17158         use IsAssignableFrom as that is not correct - it doesn't work.
17159
17160         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17161         and accordingly override EmitStatement.
17162
17163         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17164         using the correct logic :-)
17165
17166 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17167
17168         * ../errors/cs-11.cs : Add to demonstrate error -11 
17169
17170 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17171
17172         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17173         then pass this as a hint to ResolveLValue.
17174
17175         * expression.cs (FieldExpr): Add Location information
17176
17177         (FieldExpr::LValueResolve): Report assignment to readonly
17178         variable. 
17179
17180         (Expression::ExprClassFromMemberInfo): Pass location information.
17181
17182         (Expression::ResolveLValue): Add new method that resolves an
17183         LValue. 
17184
17185         (Expression::DoResolveLValue): Default invocation calls
17186         DoResolve. 
17187
17188         (Indexers): New class used to keep track of indexers in a given
17189         Type. 
17190
17191         (IStackStore): Renamed from LValue, as it did not really describe
17192         what this did.  Also ResolveLValue is gone from this interface and
17193         now is part of Expression.
17194
17195         (ElementAccess): Depending on the element access type
17196
17197         * typemanager.cs: Add `indexer_name_type' as a Core type
17198         (System.Runtime.CompilerServices.IndexerNameAttribute)
17199
17200         * statement.cs (Goto): Take a location.
17201
17202 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17203
17204         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17205         if two delegates are compatible.
17206
17207         (NewDelegate::DoResolve): Update to take care of the case when
17208         we instantiate a delegate from another delegate.
17209
17210         * typemanager.cs (FindMembers): Don't even try to look up members
17211         of Delegate types for now.
17212
17213 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17214
17215         * delegate.cs (NewDelegate): New class to take care of delegate
17216         instantiation.
17217
17218         * expression.cs (New): Split the delegate related code out into 
17219         the NewDelegate class.
17220
17221         * delegate.cs (DelegateInvocation): New class to handle delegate 
17222         invocation.
17223
17224         * expression.cs (Invocation): Split out delegate related code into
17225         the DelegateInvocation class.
17226
17227 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17228
17229         * expression.cs (New::DoResolve): Implement delegate creation fully
17230         and according to the spec.
17231
17232         (New::DoEmit): Update to handle delegates differently.
17233
17234         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17235         because of which we were printing out arguments in reverse order !
17236
17237         * delegate.cs (VerifyMethod): Implement to check if the given method
17238         matches the delegate.
17239
17240         (FullDelegateDesc): Implement.
17241
17242         (VerifyApplicability): Implement.
17243
17244         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17245         delegate invocations too.
17246
17247         (Invocation::Emit): Ditto.
17248
17249         * ../errors/cs1593.cs : Added.
17250
17251         * ../errors/cs1594.cs : Added.
17252
17253         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17254
17255 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17256
17257         * typemanager.cs (intptr_type): Core type for System.IntPtr
17258
17259         (InitCoreTypes): Update for the same.
17260
17261         (iasyncresult_type, asynccallback_type): Ditto.
17262
17263         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17264         correct.
17265
17266         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17267         too.
17268
17269         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17270         the builders for the 4 members of a delegate type :-)
17271
17272         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17273         type.
17274
17275         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17276
17277         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17278
17279 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17280
17281         * statement.cs (Break::Emit): Implement.   
17282         (Continue::Emit): Implement.
17283
17284         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17285         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17286         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17287         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17288         end loop
17289
17290         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17291         properties that track the label for the current loop (begin of the
17292         loop and end of the loop).
17293
17294 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17295
17296         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17297         use of emitting anything at all.
17298
17299         * class.cs, rootcontext.cs : Get rid of calls to the same.
17300
17301         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17302
17303         (Populate): Define the constructor correctly and set the implementation
17304         attributes.
17305
17306         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17307         have been defined.
17308
17309         (AddDelegateType): Implement.
17310
17311         (IsDelegateType): Implement helper method.
17312
17313         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17314
17315         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17316         and accordingly handle it.
17317
17318         * delegate.cs (Populate): Take TypeContainer argument.
17319         Implement bits to define the Invoke method. However, I still haven't figured out
17320         how to take care of the native int bit :-(
17321
17322         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17323         Qualify the name of the delegate, not its return type !
17324
17325         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17326         conversion.
17327
17328         (StandardConversionExists): Checking for array types turns out to be recursive.
17329
17330         (ConvertReferenceExplicit): Implement array conversion.
17331
17332         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17333
17334 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17335
17336         * cs-parser.jay (delegate_declaration): Store the fully qualified
17337         name as it is a type declaration.
17338
17339         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17340         readonly.
17341
17342         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17343         as TypeContainer::DefineType.
17344
17345         (Populate): Method in which all the definition of the various methods (Invoke)
17346         etc is done.
17347
17348         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17349         see.
17350
17351         (CloseDelegate): Finally creates the delegate.
17352
17353         * class.cs (TypeContainer::DefineType): Update to define delegates.
17354         (Populate, Emit and CloseType): Do the same thing here too.
17355
17356         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17357         delegates in all these operations.
17358
17359 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17360
17361         * expression.cs: LocalTemporary: a new expression used to
17362         reference a temporary that has been created.
17363
17364         * assign.cs: Handle PropertyAccess back here, so that we can
17365         provide the proper semantic access to properties.
17366
17367         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17368         a few more explicit conversions. 
17369
17370         * modifiers.cs: `NEW' modifier maps to HideBySig.
17371
17372         * expression.cs (PropertyExpr): Make this into an
17373         ExpressionStatement, and support the EmitStatement code path. 
17374
17375         Perform get/set error checking, clean up the interface.
17376
17377         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17378         them into toplevel access objects.
17379
17380 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17381
17382         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17383         SRE.
17384
17385         * typemanager.cs: Keep track here of our PropertyBuilders again to
17386         work around lameness in SRE.
17387
17388 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17389
17390         * expression.cs (LValue::LValueResolve): New method in the
17391         interface, used to perform a second resolution pass for LValues. 
17392
17393         (This::DoResolve): Catch the use of this in static methods.
17394
17395         (This::LValueResolve): Implement.
17396
17397         (This::Store): Remove warning, assigning to `this' in structures
17398         is 
17399
17400         (Invocation::Emit): Deal with invocation of
17401         methods on value types.  We need to pass the address to structure
17402         methods rather than the object itself.  (The equivalent code to
17403         emit "this" for structures leaves the entire structure on the
17404         stack instead of a pointer to it). 
17405
17406         (ParameterReference::DoResolve): Compute the real index for the
17407         argument based on whether the method takes or not a `this' pointer
17408         (ie, the method is static).
17409
17410         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17411         value types returned from functions when we need to invoke a
17412         method on the sturcture.
17413
17414
17415 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17416
17417         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17418         defining the type in the Modulebuilder or Typebuilder. This is to take
17419         care of nested types which need to be defined on the TypeBuilder using
17420         DefineNestedMethod.
17421
17422         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17423         methods in RootContext, only ported to be part of TypeContainer.
17424
17425         (TypeContainer::GetInterfaceOrClass): Ditto.
17426
17427         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17428
17429         * interface.cs (Interface::DefineInterface): New method. Does exactly
17430         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17431         too.
17432
17433         (Interface::GetInterfaces): Move from RootContext here and port.
17434
17435         (Interface::GetInterfaceByName): Same here.
17436
17437         * rootcontext.cs (ResolveTree): Re-write.
17438
17439         (PopulateTypes): Re-write.
17440
17441         * class.cs (TypeContainer::Populate): Populate nested types too.
17442         (TypeContainer::Emit): Emit nested members too.
17443
17444         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17445         instead just use the name argument passed in as it is already fully
17446         qualified.
17447
17448         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17449         to TypeContainer mapping to see if a type is user-defined.
17450
17451         * class.cs (TypeContainer::CloseType): Implement. 
17452
17453         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17454         the default constructor.
17455
17456         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17457         twice.
17458
17459         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17460
17461         * interface.cs (CloseType): Create the type here.
17462
17463         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17464         the hierarchy.
17465
17466         Remove all the methods which are now in TypeContainer.
17467
17468 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17469
17470         * delegate.cs (Define): Re-write bits to define the delegate
17471         correctly.
17472
17473 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17474
17475         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17476
17477         * expression.cs (ImplicitReferenceConversion): handle null as well
17478         as a source to convert to any reference type.
17479
17480         * statement.cs (Return): Perform any implicit conversions to
17481         expected return type.  
17482
17483         Validate use of return statement.  
17484
17485         * codegen.cs (EmitContext): Pass the expected return type here.
17486
17487         * class.cs (Method, Constructor, Property): Pass expected return
17488         type to EmitContext.
17489
17490 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17491
17492         * expression.cs: Make DoResolve take an EmitContext instead of a
17493         TypeContainer.
17494
17495         Replaced `l' and `location' for `loc', for consistency.
17496
17497         (Error, Warning): Remove unneeded Tc argument.
17498
17499         * assign.cs, literal.cs, constant.cs: Update to new calling
17500         convention. 
17501
17502         * codegen.cs: EmitContext now contains a flag indicating whether
17503         code is being generated in a static method or not.
17504
17505         * cs-parser.jay: DecomposeQI, new function that replaces the old
17506         QualifiedIdentifier.  Now we always decompose the assembled
17507         strings from qualified_identifier productions into a group of
17508         memberaccesses.
17509
17510 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * rootcontext.cs: Deal with field-less struct types correctly now
17513         by passing the size option to Define Type.
17514
17515         * class.cs: Removed hack that created one static field. 
17516
17517 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17518
17519         * statement.cs: Moved most of the code generation here. 
17520
17521 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17522
17523         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17524         seem very right.
17525
17526         (ElementAccess): Remove useless bits for now - keep checks as the spec
17527         says.
17528
17529 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17530
17531         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17532         and start performing checks according to the spec.
17533
17534 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17535
17536         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17537         rank_specifiers instead.
17538
17539         (rank_specifiers): Change the order in which the rank specifiers are stored
17540
17541         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17542
17543         * expression.cs (ElementAccess): Implement the LValue interface too.
17544
17545 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17546
17547         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17548         except that user defined conversions are not included.
17549
17550         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17551         perform the conversion of the return type, if necessary.
17552
17553         (New::DoResolve): Check whether we are creating an array or an object
17554         and accordingly do the needful.
17555
17556         (New::Emit): Same here.
17557
17558         (New::DoResolve): Implement guts of array creation.
17559
17560         (New::FormLookupType): Helper function.
17561
17562 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17563
17564         * codegen.cs: Removed most of the code generation here, and move the
17565         corresponding code generation bits to the statement classes. 
17566
17567         Added support for try/catch/finalize and throw.
17568
17569         * cs-parser.jay: Added support for try/catch/finalize.
17570
17571         * class.cs: Catch static methods having the flags override,
17572         virtual or abstract.
17573
17574         * expression.cs (UserCast): This user cast was not really doing
17575         what it was supposed to do.  Which is to be born in fully resolved
17576         state.  Parts of the resolution were being performed at Emit time! 
17577
17578         Fixed this code.
17579
17580 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17581
17582         * expression.cs: Implicity convert the result from UserCast.
17583
17584 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17585
17586         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17587         prevented it from working correctly. 
17588
17589         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17590         merely ConvertImplicit.
17591
17592 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17593
17594         * typemanager.cs: Make the LookupTypeContainer function static,
17595         and not per-instance.  
17596
17597         * class.cs: Make static FindMembers (the one that takes a Type
17598         argument). 
17599
17600         * codegen.cs: Add EmitForeach here.
17601
17602         * cs-parser.jay: Make foreach a toplevel object instead of the
17603         inline expansion, as we need to perform semantic analysis on it. 
17604
17605 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17606
17607         * expression.cs (Expression::ImplicitUserConversion): Rename to
17608         UserDefinedConversion.
17609
17610         (Expression::UserDefinedConversion): Take an extra argument specifying 
17611         whether we look for explicit user conversions too.
17612
17613         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17614
17615         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17616
17617         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17618         with the appropriate arguments.
17619
17620         * cs-parser.jay (cast_expression): Record location too.
17621
17622         * expression.cs (Cast): Record location info.
17623
17624         (Expression::ConvertExplicit): Take location argument.
17625
17626         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17627         to determine if we are doing explicit conversions.
17628
17629         (UserCast::Emit): Update accordingly.
17630
17631         (Expression::ConvertExplicit): Report an error if everything fails.
17632
17633         * ../errors/cs0030.cs : Add.
17634
17635 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17636
17637         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17638         virtual and newslot bits. 
17639
17640         * class.cs (TypeContainer::RegisterRequiredImplementations):
17641         Record methods we need.
17642
17643         (TypeContainer::MakeKey): Helper function to make keys for
17644         MethodBases, since the Methodbase key is useless.
17645
17646         (TypeContainer::Populate): Call RegisterRequiredImplementations
17647         before defining the methods.   
17648
17649         Create a mapping for method_builders_to_methods ahead of time
17650         instead of inside a tight loop.
17651
17652         (::RequireMethods):  Accept an object as the data to set into the
17653         hashtable so we can report interface vs abstract method mismatch.
17654
17655 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17656
17657         * report.cs: Make all of it static.
17658
17659         * rootcontext.cs: Drop object_type and value_type computations, as
17660         we have those in the TypeManager anyways.
17661
17662         Drop report instance variable too, now it is a global.
17663
17664         * driver.cs: Use try/catch on command line handling.
17665
17666         Add --probe option to debug the error reporting system with a test
17667         suite. 
17668
17669         * report.cs: Add support for exiting program when a probe
17670         condition is reached.
17671
17672 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17673
17674         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17675         we do a forcible conversion regardless of type, to check if 
17676         ForceConversion returns a null.
17677
17678         (Binary::error19): Use location to report error.
17679
17680         (Unary::error23): Use location here too.
17681
17682         * ../errors/cs0019.cs : Check in.
17683
17684         * ../errors/cs0023.cs : Check in.
17685
17686         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17687         case of a non-null MethodInfo object with a length of 0 !
17688
17689         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17690         an applicable member - according to the spec :-)
17691         Also fix logic to find members in base types.
17692
17693         (Unary::ResolveOperator): Same here.
17694
17695         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17696         as I was getting thoroughly confused between this and error19 :-)
17697
17698         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17699         (::FindMostEncompassedType): Implement.
17700         (::FindMostEncompassingType): Implement.
17701         (::StandardConversionExists): Implement.
17702
17703         (UserImplicitCast): Re-vamp. We now need info about most specific
17704         source and target types so that we can do the necessary conversions.
17705
17706         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17707         mathematical union with no duplicates.
17708
17709 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17710
17711         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17712         in order from base classes to child classes, so that we can in
17713         child classes look up in our parent for method names and
17714         attributes (required for handling abstract, virtual, new, override
17715         constructs: we need to instrospect our base class, and if we dont
17716         populate the classes in order, the introspection might be
17717         incorrect.  For example, a method could query its parent before
17718         the parent has any methods and would determine that the parent has
17719         no abstract methods (while it could have had them)).
17720
17721         (RootContext::CreateType): Record the order in which we define the
17722         classes.
17723
17724 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17725
17726         * class.cs (TypeContainer::Populate): Also method definitions can
17727         fail now, keep track of this.
17728
17729         (TypeContainer::FindMembers): Implement support for
17730         DeclaredOnly/noDeclaredOnly flag.
17731
17732         (Constructor::Emit) Return the ConstructorBuilder.
17733
17734         (Method::Emit) Return the MethodBuilder. 
17735         Check for abstract or virtual methods to be public.
17736
17737         * rootcontext.cs (RootContext::CreateType): Register all the
17738         abstract methods required for the class to be complete and the
17739         interface methods that must be implemented. 
17740
17741         * cs-parser.jay: Report error 501 (method requires body if it is
17742         not marked abstract or extern).
17743
17744         * expression.cs (TypeOf::Emit): Implement.
17745
17746         * typemanager.cs: runtime_handle_type, new global type.
17747
17748         * class.cs (Property::Emit): Generate code for properties.
17749
17750 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17751
17752         * expression.cs (Unary::ResolveOperator): Find operators on base type
17753         too - we now conform exactly to the spec.
17754
17755         (Binary::ResolveOperator): Same here.
17756
17757         * class.cs (Operator::Define): Fix minor quirk in the tests.
17758
17759         * ../errors/cs0215.cs : Added.
17760
17761         * ../errors/cs0556.cs : Added.
17762
17763         * ../errors/cs0555.cs : Added.
17764
17765 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17766
17767         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17768         single integer which is really efficient
17769
17770 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17771
17772         *  expression.cs (Expression::ImplicitUserConversion): Use location
17773         even in the case when we are examining True operators.
17774  
17775         * class.cs (Operator::Define): Perform extensive checks to conform
17776         with the rules for operator overloading in the spec.
17777
17778         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17779         some of the other conversions mentioned in the spec.
17780
17781         * typemanager.cs (array_type): New static member for the System.Array built-in
17782         type.
17783
17784         (cloneable_interface): For System.ICloneable interface.
17785
17786         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17787         we start resolving the tree and populating types.
17788
17789         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17790  
17791 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17792
17793         * expression.cs (Expression::ExprClassFromMemberInfo,
17794         Expression::Literalize): Create literal expressions from
17795         FieldInfos which are literals.
17796
17797         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17798         type casts, because they were wrong.  The test suite in tests
17799         caught these ones.
17800
17801         (ImplicitNumericConversion): ushort to ulong requires a widening
17802         cast. 
17803
17804         Int32 constant to long requires widening cast as well.
17805
17806         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17807         for integers because the type on the stack is not i4.
17808
17809 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17810
17811         * expression.cs (report118): require location argument. 
17812
17813         * parameter.cs: Do not dereference potential null value.
17814
17815         * class.cs: Catch methods that lack the `new' keyword when
17816         overriding a name.  Report warnings when `new' is used without
17817         anything being there to override.
17818
17819         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17820
17821         * class.cs: Only add constructor to hashtable if it is non-null
17822         (as now constructors can fail on define).
17823
17824         (TypeManager, Class, Struct): Take location arguments.
17825
17826         Catch field instance initialization in structs as errors.
17827
17828         accepting_filter: a new filter for FindMembers that is static so
17829         that we dont create an instance per invocation.
17830
17831         (Constructor::Define): Catch errors where a struct constructor is
17832         parameterless 
17833
17834         * cs-parser.jay: Pass location information for various new
17835         constructs. 
17836
17837         * delegate.cs (Delegate): take a location argument.
17838
17839         * driver.cs: Do not call EmitCode if there were problesm in the
17840         Definition of the types, as many Builders wont be there. 
17841
17842         * decl.cs (Decl::Decl): Require a location argument.
17843
17844         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17845         into integers, and find the most appropiate integer for it.
17846
17847         * literal.cs: Implement ULongLiteral.
17848
17849         * rootcontext.cs: Provide better information about the location of
17850         failure when CreateType fails.
17851
17852 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17853
17854         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17855         as well.
17856
17857         * expression.cs (Binary::CheckShiftArguments): Add missing type
17858         computation.
17859         (Binary::ResolveOperator): Add type to the logical and and logical
17860         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17861         before.
17862
17863         (Binary::DoNumericPromotions): In the case where either argument
17864         is ulong (and most signed types combined with ulong cause an
17865         error) perform implicit integer constant conversions as well.
17866
17867 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17868
17869         * expression.cs (UserImplicitCast): Method should always be
17870         non-null. 
17871         (Invocation::BetterConversion): Simplified test for IntLiteral.
17872
17873         (Expression::ImplicitNumericConversion): Split this routine out.
17874         Put the code that performs implicit constant integer conversions
17875         here. 
17876
17877         (Expression::Resolve): Become a wrapper around DoResolve so we can
17878         check eclass and type being set after resolve.
17879
17880         (Invocation::Badness): Remove this dead function
17881
17882         (Binary::ResolveOperator): Do not compute the expensive argumnets
17883         unless we have a union for it.
17884
17885         (Probe::Emit): Is needs to do an isinst and then
17886         compare against null.
17887
17888         (::CanConvert): Added Location argument.  If the Location argument
17889         is null (Location.Null), then we do not report errors.  This is
17890         used by the `probe' mechanism of the Explicit conversion.  We do
17891         not want to generate an error for something that the user
17892         explicitly requested to be casted.  But the pipeline for an
17893         explicit cast first tests for potential implicit casts.
17894
17895         So for now, if the Location is null, it means `Probe only' to
17896         avoid adding another argument.   Might have to revise this
17897         strategy later.
17898
17899         (ClassCast): New class used to type cast objects into arbitrary
17900         classes (used in Explicit Reference Conversions).
17901
17902         Implement `as' as well.
17903
17904         Reverted all the patches from Ravi below: they were broken:
17905
17906                 * The use of `level' as a mechanism to stop recursive
17907                   invocations is wrong.  That was there just to catch the
17908                   bug with a strack trace but not as a way of addressing
17909                   the problem.
17910
17911                   To fix the problem we have to *understand* what is going
17912                   on and the interactions and come up with a plan, not
17913                   just get things going.
17914
17915                 * The use of the type conversion cache that I proposed
17916                   last night had an open topic: How does this work across
17917                   protection domains.  A user defined conversion might not
17918                   be public in the location where we are applying the
17919                   conversion, a different conversion might be selected
17920                   (ie, private A->B (better) but public B->A (worse),
17921                   inside A, A->B applies, but outside it, B->A will
17922                   apply).
17923
17924                 * On top of that (ie, even if the above is solved),
17925                   conversions in a cache need to be abstract.  Ie, `To
17926                   convert from an Int to a Short use an OpcodeCast', not
17927                   `To convert from an Int to a Short use the OpcodeCast on
17928                   the variable 5' (which is what this patch was doing).
17929
17930 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17931
17932         * expression.cs (Invocation::ConversionExists): Re-write to use
17933         the conversion cache
17934
17935         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17936         cache all conversions done, not just user-defined ones.
17937
17938         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17939         to determine if a conversion exists instead of acutually trying to 
17940         perform the conversion. It's faster too.
17941
17942         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17943         and only then attempt the implicit conversion.
17944
17945 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17946
17947         * expression.cs (ConvertImplicit): Use a cache for conversions
17948         already found. Check level of recursion and bail out if necessary.
17949
17950 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17951
17952         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17953         Export standard methods that we expect for string operations.
17954
17955         * statement.cs (Block::UsageWarning): Track usage of variables and
17956         report the errors for not used variables.
17957
17958         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17959         operator. 
17960
17961 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * codegen.cs: remove unnneded code 
17964
17965         * expression.cs: Removed BuiltinTypeAccess class
17966
17967         Fix the order in which implicit conversions are
17968         done.  
17969
17970         The previous fixed dropped support for boxed conversions (adding a
17971         test to the test suite now)
17972
17973         (UserImplicitCast::CanConvert): Remove test for source being null,
17974         that code is broken.  We should not feed a null to begin with, if
17975         we do, then we should track the bug where the problem originates
17976         and not try to cover it up here.
17977
17978         Return a resolved expression of type UserImplicitCast on success
17979         rather than true/false.  Ravi: this is what I was talking about,
17980         the pattern is to use a static method as a "constructor" for
17981         objects. 
17982
17983         Also, do not create arguments until the very last minute,
17984         otherwise we always create the arguments even for lookups that
17985         will never be performed. 
17986
17987         (UserImplicitCast::Resolve): Eliminate, objects of type
17988         UserImplicitCast are born in a fully resolved state. 
17989
17990         * typemanager.cs (InitCoreTypes): Init also value_type
17991         (System.ValueType). 
17992
17993         * expression.cs (Cast::Resolve): First resolve the child expression.
17994
17995         (LValue): Add new method AddressOf to be used by
17996         the `&' operator.  
17997
17998         Change the argument of Store to take an EmitContext instead of an
17999         ILGenerator, because things like FieldExpr need to be able to call
18000         their children expression to generate the instance code. 
18001
18002         (Expression::Error, Expression::Warning): Sugar functions for
18003         reporting errors.
18004
18005         (Expression::MemberLookup): Accept a TypeContainer instead of a
18006         Report as the first argument.
18007
18008         (Expression::ResolvePrimary): Killed.  I still want to improve
18009         this as currently the code is just not right.
18010
18011         (Expression::ResolveMemberAccess): Simplify, but it is still
18012         wrong. 
18013
18014         (Unary::Resolve): Catch errors in AddressOf operators.
18015
18016         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18017         index to a byte for the short-version, or the compiler will choose
18018         the wrong Emit call, which generates the wrong data.
18019
18020         (ParameterReference::Emit, ::Store): same.
18021
18022         (FieldExpr::AddressOf): Implement.
18023
18024         * typemanager.cs: TypeManager: made public variable instead of
18025         property.
18026
18027         * driver.cs: document --fatal.
18028
18029         * report.cs (ErrorMessage, WarningMessage): new names for the old
18030         Error and Warning classes.
18031
18032         * cs-parser.jay (member_access): Turn built-in access to types
18033         into a normal simplename
18034
18035 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18036
18037         * expression.cs (Invocation::BetterConversion): Fix to cope
18038         with q being null, since this was introducing a bug.
18039
18040         * expression.cs (ConvertImplicit): Do built-in conversions first.
18041
18042 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18043
18044         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18045
18046 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18047
18048         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18049         I had introduced long ago (what's new ?).
18050
18051         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18052         the work of all the checking. 
18053         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18054         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18055
18056         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18057         that is the right way. 
18058
18059         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18060         overloading resolution. Use everywhere instead of cutting and pasting code.
18061
18062         (Binary::ResolveOperator): Use MakeUnionSet.
18063
18064         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18065         we have to convert to bool types. Not complete yet.
18066
18067 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * typemanager.cs (TypeManager::CSharpName): support ushort.
18070
18071         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18072         to provide an expression that performsn an implicit constant int
18073         conversion (section 6.1.6).
18074         (Expression::ConvertImplicitRequired): Reworked to include
18075         implicit constant expression conversions.
18076
18077         (Expression::ConvertNumericExplicit): Finished.
18078
18079         (Invocation::Emit): If InstanceExpression is null, then it means
18080         that we perform a call on this.
18081
18082 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18083
18084         * expression.cs (Unary::Emit): Remove some dead code.
18085         (Probe): Implement Resolve and Emit for `is'.
18086         (Expression::ConvertImplicitRequired): Attempt to do constant
18087         expression conversions here.  Maybe should be moved to
18088         ConvertImplicit, but I am not sure.
18089         (Expression::ImplicitLongConstantConversionPossible,
18090         Expression::ImplicitIntConstantConversionPossible): New functions
18091         that tell whether is it possible to apply an implicit constant
18092         expression conversion.
18093
18094         (ConvertNumericExplicit): Started work on explicit numeric
18095         conversions.
18096
18097         * cs-parser.jay: Update operator constants.
18098
18099         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18100         (Parameters::GetSignature): Hook up VerifyArgs here.
18101         (Parameters::VerifyArgs): Verifies that no two arguments have the
18102         same name. 
18103
18104         * class.cs (Operator): Update the operator names to reflect the
18105         ones that the spec expects (as we are just stringizing the
18106         operator names).
18107
18108         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18109         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18110         previous usage did only work for our methods.
18111         (Expression::ConvertImplicit): Handle decimal implicit numeric
18112         conversions as well.
18113         (Expression::InternalTypeConstructor): Used to invoke constructors
18114         on internal types for default promotions.
18115
18116         (Unary::Emit): Implement special handling for the pre/post
18117         increment/decrement for overloaded operators, as they need to have
18118         the same semantics as the other operators.
18119
18120         (Binary::ResolveOperator): ditto.
18121         (Invocation::ConversionExists): ditto.
18122         (UserImplicitCast::Resolve): ditto.
18123
18124 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18125
18126         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18127         operator, return after emitting body. Regression tests pass again !
18128
18129         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18130         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18131         (Invocation::OverloadResolve): Ditto.
18132         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18133
18134         * everywhere : update calls to the above methods accordingly.
18135
18136 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18137
18138         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18139
18140         * expression.cs (ExpressionStatement): New base class used for
18141         expressions that can appear in statements, so that we can provide
18142         an alternate path to generate expression that do not leave a value
18143         on the stack.
18144
18145         (Expression::Emit, and all the derivatives): We no longer return
18146         whether a value is left on the stack or not.  Every expression
18147         after being emitted leaves a single value on the stack.
18148
18149         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18150         facilties of ExpressionStatement if possible.
18151
18152         * cs-parser.jay: Update statement_expression.
18153
18154 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18155
18156         * driver.cs: Change the wording of message
18157
18158 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18159
18160         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18161         the type of the expression to the return type of the method if
18162         we have an overloaded operator match ! The regression tests pass again !
18163         (Unary::ResolveOperator): Ditto.
18164
18165         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18166         to find "op_Implicit", not "implicit" ;-)
18167         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18168         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18169
18170         * everywhere : Correct calls to the above accordingly.
18171
18172         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18173         (ConvertImplicit): Do user-defined conversion if it exists.
18174
18175 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18176
18177         * assign.cs: track location.
18178         (Resolve): Use implicit conversions on assignment.
18179
18180         * literal.cs: Oops.  Not good, Emit of short access values should
18181         pass (Bytes) or the wrong argument will be selected.
18182
18183         * expression.cs (Unary::Emit): Emit code for -expr.
18184
18185         (Unary::ResolveOperator): Handle `Substract' for non-constants
18186         (substract from zero from the non-constants).
18187         Deal with Doubles as well. 
18188
18189         (Expression::ConvertImplicitRequired): New routine that reports an
18190         error if no implicit conversion exists. 
18191
18192         (Invocation::OverloadResolve): Store the converted implicit
18193         expressions if we make them
18194
18195 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18196
18197         * class.cs (ConstructorInitializer): Take a Location argument.
18198         (ConstructorBaseInitializer): Same here.
18199         (ConstructorThisInitializer): Same here.
18200
18201         * cs-parser.jay : Update all calls accordingly.
18202
18203         * expression.cs (Unary, Binary, New): Take location argument.
18204         Update accordingly everywhere.
18205
18206         * cs-parser.jay : Update all calls to the above to take a location
18207         argument.
18208
18209         * class.cs : Ditto.
18210
18211 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18212
18213         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18214         (Invocation::BetterConversion): Same here
18215         (Invocation::ConversionExists): Ditto.
18216
18217         (Invocation::ConversionExists): Implement.
18218
18219 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18220
18221         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18222         Also take an additional TypeContainer argument.
18223
18224         * All over : Pass in TypeContainer as argument to OverloadResolve.
18225
18226         * typemanager.cs (CSharpName): Update to check for the string type and return
18227         that too.
18228
18229         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18230         a given method.
18231
18232 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18233
18234         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18235         (Invocation::BetterFunction): Implement.
18236         (Invocation::BetterConversion): Implement.
18237         (Invocation::ConversionExists): Skeleton, no implementation yet.
18238
18239         Okay, things work fine !
18240
18241 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18242
18243         * typemanager.cs: declare and load enum_type, delegate_type and
18244         void_type. 
18245
18246         * expression.cs (Expression::Emit): Now emit returns a value that
18247         tells whether a value is left on the stack or not.  This strategy
18248         might be reveted tomorrow with a mechanism that would address
18249         multiple assignments.
18250         (Expression::report118): Utility routine to report mismatches on
18251         the ExprClass.
18252
18253         (Unary::Report23): Report impossible type/operator combination
18254         utility function.
18255
18256         (Unary::IsIncrementableNumber): Whether the type can be
18257         incremented or decremented with add.
18258         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18259         complemented. 
18260         (Unary::ResolveOperator): Implement ++, !, ~,
18261
18262         (Invocation::Emit): Deal with new Emit convetion.
18263
18264         * All Expression derivatives: Updated their Emit method to return
18265         whether they leave values on the stack or not.
18266
18267         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18268         stack for expressions that are statements. 
18269
18270 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18271
18272         * expression.cs (LValue): New interface.  Must be implemented by
18273         LValue objects.
18274         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18275         LValue interface.
18276
18277         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18278         interface for generating code, simplifies the code.
18279
18280 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18281
18282         * expression.cs (everywhere): Comment out return statements in ::Resolve
18283         methods to avoid the warnings.
18284
18285 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18286
18287         * driver.cs (parse): Report error 2001 if we can not open the
18288         source file.
18289
18290         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18291         not resolve it.
18292
18293         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18294         object. 
18295
18296         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18297         otherwise nested blocks end up with the same index.
18298
18299         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18300
18301         * expression.cs:  Instead of having FIXMEs in the Resolve
18302         functions, throw exceptions so it is obvious that we are facing a
18303         bug. 
18304
18305         * cs-parser.jay (invocation_expression): Pass Location information.
18306
18307         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18308         Use a basename for those routines because .NET does not like paths
18309         on them. 
18310
18311         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18312         already defined.
18313
18314 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18315
18316         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18317         are loading the correct data types (throws an exception if not).
18318         (TypeManager::InitCoreTypes): Use CoreLookupType
18319
18320         * expression.cs (Unary::ResolveOperator): return the child
18321         expression for expressions which are just +expr.
18322         (Unary::ResolveOperator): Return negative literals for -LITERAL
18323         expressions (otherwise they are Unary {Literal}).
18324         (Invocation::Badness): Take into account `Implicit constant
18325         expression conversions'.
18326
18327         * literal.cs (LongLiteral): Implement long literal class.
18328         (IntLiteral): export the `Value' of the intliteral. 
18329
18330 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18331
18332         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18333
18334         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18335         instead of 'Operator'
18336
18337         * expression.cs (Binary::ResolveOperator): Update accordingly.
18338         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18339         and 'Minus'
18340
18341         * cs-parser.jay (unary_expression): Update to use the new names.
18342
18343         * gen-treedump.cs (GetUnary): Same here.
18344
18345         * expression.cs (Unary::Resolve): Implement.
18346         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18347         operators are found instead of making noise ;-)
18348         (Unary::ResolveOperator): New method to do precisely the same thing which
18349         Binary::ResolveOperator does for Binary expressions.
18350         (Unary.method, .Arguments): Add.
18351         (Unary::OperName): Implement.   
18352         (Unary::ForceConversion): Copy and Paste !
18353
18354         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18355         a unary operator.
18356
18357         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18358         for the inbuilt operators. Only overloading works for now ;-)
18359
18360 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18361
18362         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18363         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18364
18365         * expression.cs (This::Emit): Implement. 
18366         (This::Resolve): Implement.
18367         (TypeOf:Resolve): Implement.
18368         (Expression::ResolveSimpleName): Add an implicit this to instance
18369         field references. 
18370         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18371         Bind instance variable to Field expressions.
18372         (FieldExpr::Instance): New field used to track the expression that
18373         represents the object instance.
18374         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18375         binding 
18376         (FieldExpr::Emit): Implement.
18377
18378         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18379         the last instruction contains a return opcode to avoid generating
18380         the last `ret' instruction (this generates correct code, and it is
18381         nice to pass the peverify output).
18382
18383         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18384         initializer for static and instance variables.
18385         (Constructor::Emit): Allow initializer to be null in the case of
18386         static constructors.  Only emit initializer for instance
18387         constructors. 
18388
18389         (TypeContainer::FindMembers): Return a null array if there are no
18390         matches.
18391
18392         Also fix the code for the MemberTypes.Method branch, as it was not
18393         scanning that for operators (or tried to access null variables before).
18394
18395         * assign.cs (Assign::Emit): Handle instance and static fields. 
18396
18397         * TODO: Updated.
18398
18399         * driver.cs: Stop compilation if there are parse errors.
18400
18401         * cs-parser.jay (constructor_declaration): Provide default base
18402         initializer for non-static constructors.
18403         (constructor_declarator): Do not provide a default base
18404         initializers if none was specified.
18405         Catch the fact that constructors should not have parameters.
18406
18407         * class.cs: Do not emit parent class initializers for static
18408         constructors, that should be flagged as an error.
18409
18410 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18411
18412         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18413         Move back code into TypeContainer::Populate.
18414
18415 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18416
18417         * class.cs (TypeContainer::AddConstructor): Fix the check to
18418         compare against Name, not Basename. 
18419         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18420
18421         * cs-parser.jay : Update accordingly.
18422
18423         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18424         for methods, don't forget to look into the operators too.
18425         (RegisterMethodBuilder): Helper method to take care of this for
18426         methods, constructors and operators.
18427         (Operator::Define): Completely revamp.
18428         (Operator.OperatorMethod, MethodName): New fields.
18429         (TypeContainer::Populate): Move the registering of builders into
18430         RegisterMethodBuilder.
18431         (Operator::Emit): Re-write.
18432
18433         * expression.cs (Binary::Emit): Comment out code path to emit method
18434         invocation stuff for the case when we have a user defined operator. I am
18435         just not able to get it right !
18436
18437 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18438
18439         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18440         argument. 
18441
18442         (Expression::MemberLookup): Provide a version that allows to
18443         specify the MemberTypes and BindingFlags. 
18444
18445         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18446         so it was not fetching variable information from outer blocks.
18447
18448         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18449         Beforefieldinit as it was buggy.
18450
18451         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18452         that Ravi put here.  
18453
18454         * class.cs (Constructor::Emit): Only emit if block is not null.
18455         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18456         deal with this by semantically definining it as if the user had
18457         done it.
18458
18459         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18460         constructors as we now "emit" them at a higher level.
18461
18462         (TypeContainer::DefineDefaultConstructor): Used to define the
18463         default constructors if none was provided.
18464
18465         (ConstructorInitializer): Add methods Resolve and Emit. 
18466
18467         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18468
18469 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18470
18471         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18472         the default constructor builder with our hashtable for methodbuilders
18473         to methodcores.
18474
18475         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18476         and argument_count is 0 in which case we have a match.
18477         (Binary::ResolveOperator): More null checking and miscellaneous coding
18478         style cleanup.
18479
18480 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18481
18482         * rootcontext.cs (IsNameSpace): Compare against null.
18483
18484         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18485
18486         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18487         and Unary::Operator.
18488
18489         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18490         accordingly.
18491
18492         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18493         we have overloaded operators.
18494         (Binary::ResolveOperator): Implement the part which does the operator overload
18495         resolution.
18496
18497         * class.cs (Operator::Emit): Implement.
18498         (TypeContainer::Emit): Emit the operators we have too.
18499
18500         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18501         the case when we have a user-defined operator.
18502
18503 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18504
18505         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18506
18507 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18508
18509         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18510         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18511         (Constructor::Emit): Implement.
18512         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18513         if we have no work to do. 
18514         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18515         Emit method.
18516
18517         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18518         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18519
18520         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18521         of parent.parent.
18522
18523 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18524
18525         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18526         in the source.
18527         (Tree::RecordNamespace): Method to do what the name says ;-)
18528         (Tree::Namespaces): Property to get at the namespaces hashtable.
18529
18530         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18531         keep track.
18532
18533         * rootcontext.cs (IsNamespace): Fixed it :-)
18534
18535 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * class.cs (TypeContainer::FindMembers): Add support for
18538         constructors. 
18539         (MethodCore): New class that encapsulates both the shared aspects
18540         of a Constructor and a Method.  
18541         (Method, Constructor): Factored pieces into MethodCore.
18542
18543         * driver.cs: Added --fatal which makes errors throw exceptions.
18544         Load System assembly as well as part of the standard library.
18545
18546         * report.cs: Allow throwing exceptions on errors for debugging.
18547
18548         * modifiers.cs: Do not use `parent', instead use the real type
18549         container to evaluate permission settings.
18550
18551         * class.cs: Put Ravi's patch back in.  He is right, and we will
18552         have to cope with the
18553
18554 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18555
18556         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18557         FamORAssem, not FamANDAssem.
18558
18559 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18560
18561         * driver.cs: Added --parse option that only parses its input files
18562         and terminates.
18563
18564         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18565         incorrect.  IsTopLevel is not used to tell whether an object is
18566         root_types or not (that can be achieved by testing this ==
18567         root_types).  But to see if this is a top-level *class* (not
18568         necessarly our "toplevel" container). 
18569
18570 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18571
18572         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18573         parent instead of a direct call to GetType.
18574
18575 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18576
18577         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18578         Modifiers.TypeAttr. This should just be a call to that method.
18579
18580         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18581         object so that we can determine if we are top-level or not.
18582
18583         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18584         TypeContainer too.
18585
18586         * enum.cs (Enum::Define): Ditto.
18587
18588         * modifiers.cs (FieldAttr): Re-write.
18589
18590         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18591         (TypeContainer::HaveStaticConstructor): New property to provide access
18592         to precisely that info.
18593
18594         * modifiers.cs (MethodAttr): Re-write.
18595         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18596
18597         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18598         of top-level types as claimed.
18599
18600 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18601
18602         * expression.cs (MemberLookup): Fruitless attempt to lookup
18603         constructors.  Maybe I need to emit default constructors?  That
18604         might be it (currently .NET emits this for me automatically).
18605         (Invocation::OverloadResolve): Cope with Arguments == null.
18606         (Invocation::EmitArguments): new function, shared by the new
18607         constructor and us.
18608         (Invocation::Emit): Handle static and instance methods.  Emit
18609         proper call instruction for virtual or non-virtual invocations.
18610         (New::Emit): Implement.
18611         (New::Resolve): Implement.
18612         (MemberAccess:Resolve): Implement.
18613         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18614         to track instances.
18615         (FieldExpr::Resolve): Set type.
18616
18617         * support.cs: Handle empty arguments.
18618                 
18619         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18620         SimpleLookup): Auxiliary routines to help parse a qualifier
18621         identifier.  
18622
18623         Update qualifier_identifier rule.
18624
18625         * codegen.cs: Removed debugging messages.
18626
18627         * class.cs: Make this a global thing, this acts just as a "key" to
18628         objects that we might have around.
18629
18630         (Populate): Only initialize method_builders_to_methods once.
18631
18632         * expression.cs (PropertyExpr): Initialize type from the
18633         PropertyType. 
18634
18635         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18636         Resolve pattern.  Attempt to implicitly convert value to boolean.
18637         Emit code.
18638
18639         * expression.cs: Set the type for the int32/int32 argument case.
18640         (Binary::ResolveOperator): Set the return type to boolean for
18641         comparission operators
18642
18643         * typemanager.cs: Remove debugging print code.
18644
18645         (Invocation::Resolve): resolve type.
18646
18647         * class.cs: Allocate a MemberInfo of the correct size, as the code
18648         elsewhere depends on the test to reflect the correct contents.
18649
18650         (Method::) Keep track of parameters, due to System.Reflection holes
18651
18652         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18653         mapping here.
18654
18655         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18656         of the exact size and return that.
18657
18658         (Class::LookupMethodByBuilder): New function that maps
18659         MethodBuilders to its methods.  Required to locate the information
18660         on methods because System.Reflection bit us again.
18661
18662         * support.cs: New file, contains an interface ParameterData and
18663         two implementations: ReflectionParameters and InternalParameters
18664         used to access Parameter information.  We will need to grow this
18665         as required.
18666
18667         * expression.cs (Invocation::GetParameterData): implement a cache
18668         and a wrapper around the ParameterData creation for methods. 
18669         (Invocation::OverloadResolve): Use new code.
18670
18671 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18672
18673         * class.cs (TypeContainer::EmitField): Remove and move into 
18674         (Field::Define): here and modify accordingly.
18675         (Field.FieldBuilder): New member.
18676         (TypeContainer::Populate): Update accordingly.
18677         (TypeContainer::FindMembers): Implement.
18678
18679 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18680
18681         * statement.cs: (VariableInfo::VariableType): New field to be
18682         initialized with the full type once it is resolved. 
18683
18684 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18685
18686         * parameter.cs (GetParameterInfo): Use a type cache to compute
18687         things only once, and to reuse this information
18688
18689         * expression.cs (LocalVariableReference::Emit): Implement.
18690         (OpcodeCast::Emit): fix.
18691
18692         (ParameterReference::Resolve): Implement.
18693         (ParameterReference::Emit): Implement.
18694
18695         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18696         that are expressions need to stay as Expressions.
18697
18698         * typemanager.cs (CSharpName): Returns the C# name of a type if
18699         possible. 
18700
18701         * expression.cs (Expression::ConvertImplicit): New function that
18702         implements implicit type conversions.
18703
18704         (Expression::ImplicitReferenceConversion): Implements implicit
18705         reference conversions.
18706
18707         (EmptyCast): New type for transparent casts.
18708
18709         (OpcodeCast): New type for casts of types that are performed with
18710         a sequence of bytecodes.
18711
18712         (BoxedCast): New type used for casting value types into reference
18713         types.  Emits a box opcode.
18714
18715         (Binary::DoNumericPromotions): Implements numeric promotions of
18716         and computation of the Binary::Type.
18717
18718         (Binary::EmitBranchable): Optimization.
18719
18720         (Binary::Emit): Implement code emission for expressions.
18721
18722         * typemanager.cs (TypeManager): Added two new core types: sbyte
18723         and byte.
18724
18725 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18726
18727         * class.cs (TypeContainer::FindMembers): Method which does exactly
18728         what Type.FindMembers does, only we don't have to use reflection. No
18729         implementation yet.
18730
18731         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18732         typecontainer objects as we need to get at them.
18733         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18734
18735         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18736         typecontainer object.
18737
18738         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18739         of just a Report object.
18740
18741 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18742
18743         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18744         "remove_"
18745         (TypeContainer::Populate): Now define the delegates of the type too.
18746         (TypeContainer.Delegates): Property to access the list of delegates defined
18747         in the type.
18748
18749         * delegates.cs (Delegate::Define): Implement partially.
18750
18751         * modifiers.cs (TypeAttr): Handle more flags.
18752
18753 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18754
18755         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18756         and not <=
18757         (Operator::Define): Re-write logic to get types by using the LookupType method
18758         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18759         (Indexer::Define): Ditto.
18760         (Event::Define): Ditto.
18761         (Property::Define): Ditto.
18762
18763 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18764
18765         * class.cs (TypeContainer::Populate): Now define operators too. 
18766         (TypeContainer.Operators): New property to access the list of operators
18767         in a type.
18768         (Operator.OperatorMethodBuilder): New member to hold the method builder
18769         for the operator we are defining.
18770         (Operator::Define): Implement.
18771
18772 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18773
18774         * class.cs (Event::Define): Make the prefixes of the accessor methods
18775         addOn_ and removeOn_ 
18776
18777         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18778         of the location being passed in too. Ideally, this should go later since all
18779         error reporting should be done through the Report object.
18780
18781         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18782         (Populate): Iterate thru the indexers we have and define them too.
18783         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18784         for the get and set accessors.
18785         (Indexer::Define): Implement.
18786
18787 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18788
18789         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18790         my previous implementation, did not work.
18791
18792         * typemanager.cs: Add a couple of missing types (the longs).
18793
18794         * literal.cs: Use TypeManager.bool_type instead of getting it.
18795
18796         * expression.cs (EventExpr): New kind of expressions.
18797         (Expressio::ExprClassFromMemberInfo): finish
18798
18799 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * assign.cs: Emit stores to static fields differently.
18802
18803 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18804
18805         * Merge in changes and adjust code to tackle conflicts. Backed out my
18806         code in Assign::Resolve ;-) 
18807
18808 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18809
18810         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18811         instead Report.Error and also pass in the location.
18812         (CSharpParser::Lexer): New readonly property to return the reference
18813         to the Tokenizer object.
18814         (declare_local_variables): Use Report.Error with location instead of plain 
18815         old error.
18816         (CheckDef): Ditto.
18817
18818         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18819         (Operator.CheckBinaryOperator): Ditto.
18820
18821         * cs-parser.jay (operator_declarator): Update accordingly.
18822
18823         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18824         (CheckBinaryOperator): Same here.
18825
18826         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18827         on the name without any prefixes of namespace names etc. This is because we
18828         already might have something already fully qualified like 
18829         'System.Console.WriteLine'
18830
18831         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18832
18833 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18834
18835         * cs-tokenizer.cs (location): Return a string which also contains
18836         the file name.
18837
18838         * expression.cs (ElementAccess): New class for expressions of the
18839         type 'element access.'
18840         (BaseAccess): New class for expressions of the type 'base access.'
18841         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18842         respectively.
18843
18844         * cs-parser.jay (element_access): Implement action.
18845         (base_access): Implement actions.
18846         (checked_expression, unchecked_expression): Implement.
18847
18848         * cs-parser.jay (local_variable_type): Correct and implement.
18849         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18850
18851         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18852
18853         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18854         name and the specifiers.
18855
18856         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18857
18858         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18859         making them all public ;-)
18860
18861         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18862         class anyways.
18863
18864 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18865
18866         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18867         PropertyExprs.
18868         (FieldExpr, PropertyExprs): New resolved expressions.
18869         (SimpleName::MemberStaticCheck): Perform static checks for access
18870         to non-static fields on static methods. Maybe this should be
18871         generalized for MemberAccesses. 
18872         (SimpleName::ResolveSimpleName): More work on simple name
18873         resolution. 
18874
18875         * cs-parser.jay (primary_expression/qualified_identifier): track
18876         the parameter index.
18877
18878         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18879         (EmitContext::EmitBoolExpression): Chain to expression generation
18880         instead of temporary hack.
18881         (::EmitStatementExpression): Put generic expression code generation.
18882
18883         * assign.cs (Assign::Emit): Implement variable assignments to
18884         local variables, parameters and fields.
18885
18886 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18887
18888         * statement.cs (Block::GetVariableInfo): New method, returns the
18889         VariableInfo for a variable name in a block.
18890         (Block::GetVariableType): Implement in terms of GetVariableInfo
18891
18892         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18893         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18894
18895 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18896
18897         * cs-parser.jay (operator_declaration): Continue on my quest : update
18898         to take attributes argument.
18899         (event_declaration): Ditto.
18900         (enum_declaration): Ditto.
18901         (indexer_declaration): Ditto.
18902
18903         * class.cs (Operator::Operator): Update constructor accordingly.
18904         (Event::Event): Ditto.
18905
18906         * delegate.cs (Delegate::Delegate): Same here.
18907
18908         * enum.cs (Enum::Enum): Same here.
18909
18910 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18911
18912         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18913
18914         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18915
18916         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18917         being passed around as an arraylist.
18918         (Attributes::AddAttribute): Method to add attribute sections.
18919
18920         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18921         (struct_declaration): Update accordingly.
18922         (constant_declaration): Update.
18923         (field_declaration): Update.
18924         (method_header): Update.
18925         (fixed_parameter): Update.
18926         (parameter_array): Ditto.
18927         (property_declaration): Ditto.
18928         (destructor_declaration): Ditto.
18929
18930         * class.cs (Struct::Struct): Update constructors accordingly.
18931         (Class::Class): Ditto.
18932         (Field::Field): Ditto.
18933         (Method::Method): Ditto.
18934         (Property::Property): Ditto.
18935         (TypeContainer::OptAttribute): update property's return type.
18936
18937         * interface.cs (Interface.opt_attributes): New member.
18938         (Interface::Interface): Update to take the extra Attributes argument.
18939
18940         * parameter.cs (Parameter::Parameter): Ditto.
18941
18942         * constant.cs (Constant::Constant): Ditto.
18943
18944         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18945         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18946         the attributes as a parameter.
18947         (InterfaceProperty): Update constructor call.
18948         (InterfaceEvent): Ditto.
18949         (InterfaceMethod): Ditto.
18950         (InterfaceIndexer): Ditto.
18951
18952         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18953         pass the attributes too.
18954         (interface_event_declaration): Ditto.
18955         (interface_property_declaration): Ditto.
18956         (interface_method_declaration): Ditto.
18957         (interface_declaration): Ditto.
18958
18959 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18960
18961         * class.cs (Method::Define): Track the "static Main" definition to
18962         create an entry point. 
18963
18964         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18965         EntryPoint if we find it. 
18966
18967         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18968         (EmitContext::ig): Make this variable public.
18969
18970         * driver.cs: Make the default output file be the first file name
18971         with the .exe extension.  
18972
18973         Detect empty compilations
18974
18975         Handle various kinds of output targets.  Handle --target and
18976         rename -t to --dumper.
18977
18978         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
18979         methods inherited from Expression return now an Expression.  This
18980         will is used during the tree rewriting as we resolve them during
18981         semantic analysis.
18982
18983         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
18984         the spec.  Missing entirely is the information about
18985         accessability of elements of it.
18986
18987         (Expression::ExprClassFromMemberInfo): New constructor for
18988         Expressions that creates a fully initialized Expression based on
18989         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
18990         a Type.
18991
18992         (Invocation::Resolve): Begin implementing resolution of invocations.
18993
18994         * literal.cs (StringLiteral):  Implement Emit.
18995
18996 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18997
18998         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
18999         member.
19000
19001 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19002
19003         * cs-parser.jay (attribute_arguments): Implement actions.
19004         (attribute): Fix bug in production. Implement action.
19005         (attribute_list): Implement.
19006         (attribute_target): Implement.
19007         (attribute_target_specifier, opt_target_specifier): Implement
19008         (CheckAttributeTarget): New method to check if the attribute target
19009         is valid.
19010         (attribute_section): Implement.
19011         (opt_attributes): Implement.
19012
19013         * attribute.cs : New file to handle attributes.
19014         (Attribute): Class to hold attribute info.
19015
19016         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19017         (attribute_section): Modify production to use 2 different rules to 
19018         achieve the same thing. 1 s/r conflict down !
19019         Clean out commented, useless, non-reducing dimension_separator rules.
19020
19021         * class.cs (TypeContainer.attributes): New member to hold list
19022         of attributes for a type.
19023         (Struct::Struct): Modify to take one more argument, the attribute list.
19024         (Class::Class): Ditto.
19025         (Field::Field): Ditto.
19026         (Method::Method): Ditto.
19027         (Property::Property): Ditto.
19028
19029         * cs-parser.jay (struct_declaration): Update constructor call to
19030         pass in the attributes too.
19031         (class_declaration): Ditto.
19032         (constant_declaration): Ditto.
19033         (field_declaration): Ditto.
19034         (method_header): Ditto.
19035         (fixed_parameter): Ditto.
19036         (parameter_array): Ditto.
19037         (property_declaration): Ditto.
19038
19039         * constant.cs (Constant::Constant): Update constructor similarly.
19040         Use System.Collections.
19041
19042         * parameter.cs (Parameter::Parameter): Update as above.
19043
19044 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19045
19046         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19047         (TypeContainer.delegates): New member to hold list of delegates.
19048
19049         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19050         this time as I seem to be on crack ;-)
19051
19052 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19053
19054         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19055         tell whether an identifier represents a namespace.
19056
19057         * expression.cs (NamespaceExpr): A namespace expression, used only
19058         temporarly during expression resolution.
19059         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19060         utility functions to resolve names on expressions.
19061
19062 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19063
19064         * codegen.cs: Add hook for StatementExpressions. 
19065
19066         * class.cs: Fix inverted test for static flag in methods.
19067
19068 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19069
19070         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19071         to make it coincide with MS' number.
19072         (Operator::CheckBinaryOperator): Ditto.
19073
19074         * ../errors/errors.txt : Remove error numbers added earlier.
19075
19076         * ../errors/cs1019.cs : Test case for error # 1019
19077
19078         * ../errros/cs1020.cs : Test case for error # 1020
19079
19080         * cs-parser.jay : Clean out commented cruft.
19081         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19082         used anywhere - non-reducing rule.
19083         (namespace_declarations): Non-reducing rule - comment out.
19084
19085         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19086         with TypeContainer::AddEnum.
19087
19088         * delegate.cs : New file for delegate handling classes.
19089         (Delegate): Class for declaring delegates.
19090
19091         * makefile : Update.
19092
19093         * cs-parser.jay (delegate_declaration): Implement.
19094
19095 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19096
19097         * class.cs (Event::Define): Implement.
19098         (Event.EventBuilder): New member.
19099
19100         * class.cs (TypeContainer::Populate): Update to define all enums and events
19101         we have.
19102         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19103         readonly fields for all these cases ?
19104
19105 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19106
19107         * class.cs (Property): Revamp to use the convention of making fields readonly.
19108         Accordingly modify code elsewhere.
19109
19110         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19111         the Define method of the Property class.
19112
19113         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19114         trivial bug.
19115         (TypeContainer::Populate): Update to define all the properties we have. Also
19116         define all enumerations.
19117
19118         * enum.cs (Define): Implement.
19119
19120 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19121
19122         * cs-parser.jay (overloadable_operator): The semantic value is an
19123         enum of the Operator class.
19124         (operator_declarator): Implement actions.
19125         (operator_declaration): Implement.
19126
19127         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19128         validity of definitions.
19129         (Operator::CheckBinaryOperator): Static method to check for binary operators
19130         (TypeContainer::AddOperator): New method to add an operator to a type.
19131
19132         * cs-parser.jay (indexer_declaration): Added line to actually call the
19133         AddIndexer method so it gets added ;-)
19134
19135         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19136         already taken care of by the MS compiler ?  
19137
19138 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19139
19140         * class.cs (Operator): New class for operator declarations.
19141         (Operator::OpType): Enum for the various operators.
19142
19143 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19144
19145         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19146         ostensibly handle this in semantic analysis.
19147
19148         * cs-parser.jay (general_catch_clause): Comment out
19149         (specific_catch_clauses, specific_catch_clause): Ditto.
19150         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19151         (catch_args, opt_catch_args): New productions.
19152         (catch_clause): Rewrite to use the new productions above
19153         (catch_clauses): Modify accordingly.
19154         (opt_catch_clauses): New production to use in try_statement
19155         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19156         and re-write the code in the actions to extract the specific and
19157         general catch clauses by being a little smart ;-)
19158
19159         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19160         Hooray, try and catch statements parse fine !
19161
19162 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19163
19164         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19165         string from the hashtable of variables.
19166
19167         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19168         I end up making that mistake ;-)
19169         (catch_clauses): Fixed gross error which made Key and Value of the 
19170         DictionaryEntry the same : $1 !!
19171
19172 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19173
19174         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19175
19176         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19177         when the add and remove accessors are specified. 
19178
19179 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19180
19181         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19182         information about indexer_declarator.
19183         (indexer_declarator): Implement actions.
19184         (parsing_indexer): New local boolean used to keep track of whether
19185         we are parsing indexers or properties. This is necessary because 
19186         implicit_parameters come into picture even for the get accessor in the 
19187         case of an indexer.
19188         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19189
19190         * class.cs (Indexer): New class for indexer declarations.
19191         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19192         (TypeContainer::indexers): New member to hold list of indexers for the
19193         type.
19194
19195 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19196
19197         * cs-parser.jay (add_accessor_declaration): Implement action.
19198         (remove_accessor_declaration): Implement action.
19199         (event_accessors_declaration): Implement
19200         (variable_declarators): swap statements for first rule - trivial.
19201
19202         * class.cs (Event): New class to hold information about event
19203         declarations.
19204         (TypeContainer::AddEvent): New method to add an event to a type
19205         (TypeContainer::events): New member to hold list of events.
19206
19207         * cs-parser.jay (event_declaration): Implement actions.
19208
19209 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19210
19211         * cs-parser.jay (dim_separators): Implement. Make it a string
19212         concatenating all the commas together, just as they appear.
19213         (opt_dim_separators): Modify accordingly
19214         (rank_specifiers): Update accordingly. Basically do the same
19215         thing - instead, collect the brackets here.
19216         (opt_rank_sepcifiers): Modify accordingly.
19217         (array_type): Modify to actually return the complete type string
19218         instead of ignoring the rank_specifiers.
19219         (expression_list): Implement to collect the expressions
19220         (variable_initializer): Implement. We make it a list of expressions
19221         essentially so that we can handle the array_initializer case neatly too.
19222         (variable_initializer_list): Implement.
19223         (array_initializer): Make it a list of variable_initializers
19224         (opt_array_initializer): Modify accordingly.
19225
19226         * expression.cs (New::NType): Add enumeration to help us
19227         keep track of whether we have an object/delegate creation
19228         or an array creation.
19229         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19230         members to hold data about array creation.
19231         (New:New): Modify to update NewType
19232         (New:New): New Overloaded contructor for the array creation
19233         case.
19234
19235         * cs-parser.jay (array_creation_expression): Implement to call
19236         the overloaded New constructor.
19237
19238 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19239
19240         * class.cs (TypeContainer::Constructors): Return member
19241         constructors instead of returning null.
19242
19243 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19244
19245         * typemanager.cs (InitCoreTypes): Initialize the various core
19246         types after we have populated the type manager with the user
19247         defined types (this distinction will be important later while
19248         compiling corlib.dll)
19249
19250         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19251         on Expression Classification.  Now all expressions have a method
19252         `Resolve' and a method `Emit'.
19253
19254         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19255         generation from working.     Also add some temporary debugging
19256         code. 
19257
19258 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19259
19260         * codegen.cs: Lots of code generation pieces.  This is only the
19261         beginning, will continue tomorrow with more touches of polish.  We
19262         handle the fundamentals of if, while, do, for, return.  Others are
19263         trickier and I need to start working on invocations soon.
19264
19265         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19266         s.InitStatement. 
19267
19268         * codegen.cs (EmitContext): New struct, used during code
19269         emission to keep a context.   Most of the code generation will be
19270         here. 
19271
19272         * cs-parser.jay: Add embedded blocks to the list of statements of
19273         this block.  So code generation proceeds in a top down fashion.
19274
19275 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19276
19277         * statement.cs: Add support for multiple child blocks.
19278
19279 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * codegen.cs (EmitCode): New function, will emit the code for a
19282         Block of code given a TypeContainer and its ILGenerator. 
19283
19284         * statement.cs (Block): Standard public readonly optimization.
19285         (Block::Block constructors): Link children. 
19286         (Block::Child): Child Linker.
19287         (Block::EmitVariables): Emits IL variable declarations.
19288
19289         * class.cs: Drop support for MethodGroups here, delay until
19290         Semantic Analysis.
19291         (Method::): Applied the same simplification that I did before, and
19292         move from Properties to public readonly fields.
19293         (Method::ParameterTypes): Returns the parameter types for the
19294         function, and implements a cache that will be useful later when I
19295         do error checking and the semantic analysis on the methods is
19296         performed.
19297         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19298         and made a method, optional argument tells whether this is a class
19299         or a structure to apply the `has-this' bit.
19300         (Method::GetCallingConvention): Implement, returns the calling
19301         convention. 
19302         (Method::Define): Defines the type, a second pass is performed
19303         later to populate the methods.
19304
19305         (Constructor::ParameterTypes): implement a cache similar to the
19306         one on Method::ParameterTypes, useful later when we do semantic
19307         analysis. 
19308
19309         (TypeContainer::EmitMethod):  New method.  Emits methods.
19310
19311         * expression.cs: Removed MethodGroup class from here.
19312
19313         * parameter.cs (Parameters::GetCallingConvention): new method.
19314
19315 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19316
19317         * class.cs (TypeContainer::Populate): Drop RootContext from the
19318         argument. 
19319
19320         (Constructor::CallingConvention): Returns the calling convention.
19321         (Constructor::ParameterTypes): Returns the constructor parameter
19322         types. 
19323
19324         (TypeContainer::AddConstructor): Keep track of default constructor
19325         and the default static constructor.
19326
19327         (Constructor::) Another class that starts using `public readonly'
19328         instead of properties. 
19329
19330         (Constructor::IsDefault): Whether this is a default constructor. 
19331
19332         (Field::) use readonly public fields instead of properties also.
19333
19334         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19335         track of static constructors;  If none is used, turn on
19336         BeforeFieldInit in the TypeAttributes. 
19337
19338         * cs-parser.jay (opt_argument_list): now the return can be null
19339         for the cases where there are no arguments. 
19340
19341         (constructor_declarator): If there is no implicit `base' or
19342         `this', then invoke the default parent constructor. 
19343
19344         * modifiers.cs (MethodAttr): New static function maps a set of
19345         modifiers flags into a MethodAttributes enum
19346         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19347         MethodAttr, TypeAttr to represent the various mappings where the
19348         modifiers are used.
19349         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19350
19351 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19352
19353         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19354         method arguments.
19355
19356         * interface.cs (PopulateIndexer): Implemented the code generator
19357         for interface indexers.
19358
19359 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19360
19361         * interface.cs (InterfaceMemberBase): Now we track the new status
19362         here.  
19363
19364         (PopulateProperty): Implement property population.  Woohoo!  Got
19365         Methods and Properties going today. 
19366
19367         Removed all the properties for interfaces, and replaced them with
19368         `public readonly' fields. 
19369
19370 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19371
19372         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19373         initialize their hashtables/arraylists only when they are needed
19374         instead of doing this always.
19375
19376         * parameter.cs: Handle refs and out parameters.
19377
19378         * cs-parser.jay: Use an ArrayList to construct the arguments
19379         instead of the ParameterCollection, and then cast that to a
19380         Parameter[] array.
19381
19382         * parameter.cs: Drop the use of ParameterCollection and use
19383         instead arrays of Parameters.
19384
19385         (GetParameterInfo): Use the Type, not the Name when resolving
19386         types. 
19387
19388 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19389
19390         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19391         and instead use public readonly fields.
19392
19393         * class.cs: Put back walking code for type containers.
19394
19395 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19396
19397         * class.cs (MakeConstant): Code to define constants.
19398
19399         * rootcontext.cs (LookupType): New function.  Used to locate types 
19400
19401
19402 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19403
19404         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19405         this System.Reflection code is.  Kudos to Microsoft
19406
19407         * typemanager.cs: Implement a type cache and avoid loading all
19408         types at boot time.  Wrap in LookupType the internals.  This made
19409         the compiler so much faster.  Wow.  I rule!
19410
19411         * driver.cs: Make sure we always load mscorlib first (for
19412         debugging purposes, nothing really important).
19413
19414         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19415         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19416
19417         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19418         on namespaces that have been imported using the `using' keyword.
19419
19420         * class.cs (TypeContainer::TypeAttr): Virtualize.
19421         (Class::TypeAttr): Return attributes suitable for this bad boy.
19422         (Struct::TypeAttr): ditto.
19423         Handle nested classes.
19424         (TypeContainer::) Remove all the type visiting code, it is now
19425         replaced with the rootcontext.cs code
19426
19427         * rootcontext.cs (GetClassBases): Added support for structs. 
19428
19429 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19430
19431         * interface.cs, statement.cs, class.cs, parameter.cs,
19432         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19433         Drop use of TypeRefs, and use strings instead.
19434
19435 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19436
19437         * rootcontext.cs: 
19438
19439         * class.cs (Struct::Struct): set the SEALED flags after
19440         checking the modifiers.
19441         (TypeContainer::TypeAttr): new property, returns the
19442         TypeAttributes for a class.  
19443
19444         * cs-parser.jay (type_list): Oops, list production was creating a
19445         new list of base types.
19446
19447         * rootcontext.cs (StdLib): New property.
19448         (GetInterfaceTypeByName): returns an interface by type name, and
19449         encapsulates error handling here.
19450         (GetInterfaces): simplified.
19451         (ResolveTree): Encapsulated all the tree resolution here.
19452         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19453         types. 
19454
19455         * driver.cs: Add support for --nostdlib, to avoid loading the
19456         default assemblies.
19457         (Main): Do not put tree resolution here. 
19458
19459         * rootcontext.cs: Beginning of the class resolution.
19460
19461 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19462
19463         * rootcontext.cs: Provide better error reporting. 
19464
19465         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19466
19467         * rootcontext.cs (CreateInterface): Handle the case where there
19468         are no parent interfaces.
19469
19470         (CloseTypes): Routine to flush types at the end.
19471         (CreateInterface): Track types.
19472         (GetInterfaces): Returns an array of Types from the list of
19473         defined interfaces.
19474
19475         * typemanager.c (AddUserType): Mechanism to track user types (puts
19476         the type on the global type hash, and allows us to close it at the
19477         end). 
19478
19479 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19482         RecordInterface instead.
19483
19484         * cs-parser.jay: Updated to reflect changes above.
19485
19486         * decl.cs (Definition): Keep track of the TypeBuilder type that
19487         represents this type here.  Not sure we will use it in the long
19488         run, but wont hurt for now.
19489
19490         * driver.cs: Smaller changes to accomodate the new code.
19491
19492         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19493         when done. 
19494
19495         * rootcontext.cs (CreateInterface):  New method, used to create
19496         the System.TypeBuilder type for interfaces.
19497         (ResolveInterfaces): new entry point to resolve the interface
19498         hierarchy. 
19499         (CodeGen): Property, used to keep track of the code generator.
19500
19501 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19502
19503         * cs-parser.jay: Add a second production for delegate_declaration
19504         with `VOID'.
19505
19506         (enum_body): Put an opt_comma here instead of putting it on
19507         enum_body or enum_member_declarations so we can handle trailing
19508         commas on enumeration members.  Gets rid of a shift/reduce.
19509
19510         (type_list): Need a COMMA in the middle.
19511
19512         (indexer_declaration): Tell tokenizer to recognize get/set
19513
19514         * Remove old targets.
19515
19516         * Re-add the parser target.
19517
19518 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19519
19520         * cs-parser.jay: Add precendence rules for a number of operators
19521         ot reduce the number of shift/reduce conflicts in the grammar.
19522
19523 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19526         and put it here.
19527
19528         Get rid of old crufty code.
19529
19530         * rootcontext.cs: Use this to keep track of the parsed
19531         representation and the defined types available to the program. 
19532
19533         * gen-treedump.cs: adjust for new convention.
19534
19535         * type.cs: Split out the type manager, and the assembly builder
19536         from here. 
19537
19538         * typemanager.cs: the type manager will live here now.
19539
19540         * cil-codegen.cs: And the code generator here. 
19541
19542 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19543
19544         * makefile: Fixed up for easy making.
19545
19546 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19547
19548         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19549         the 
19550
19551         (unary_expression): Expand pre_increment_expression and
19552         post_decrement_expression to reduce a shift/reduce.
19553
19554 2001-07-11  Simon Cozens
19555
19556         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19557
19558         Improve allow_keyword_as_indent name.
19559
19560 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19561
19562         * Adjustments for Beta2. 
19563
19564 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * decl.cs: Added `Define' abstract method.
19567         (InTransit): new property, used to catch recursive definitions. 
19568
19569         * interface.cs: Implement `Define'. 
19570
19571         * modifiers.cs: Map Modifiers.constants to
19572         System.Reflection.TypeAttribute flags.
19573
19574         * class.cs: Keep track of types and user-defined types.
19575         (BuilderInit): New method for creating an assembly
19576         (ResolveType): New function to launch the resolution process, only
19577         used by interfaces for now.
19578
19579         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19580         that are inserted into the name space. 
19581
19582 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19583
19584         * ARGH.  I have screwed up my tree so many times due to the use of
19585         rsync rather than using CVS.  Going to fix this at once. 
19586
19587         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19588         load types.
19589
19590 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19591
19592         * Experiment successful: Use System.Type rather that our own
19593         version of Type.  
19594
19595 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19596
19597         * cs-parser.jay: Removed nsAliases from here.
19598
19599         Use new namespaces, handle `using XXX;' 
19600
19601         * namespace.cs: Reimplemented namespace handling, use a recursive
19602         definition of the class.  Now we can keep track of using clauses
19603         and catch invalid using clauses.
19604
19605 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19606
19607         * gen-treedump.cs: Adapted for all the renaming.
19608
19609         * expression.cs (Expression): this class now has a Type property
19610         which returns an expression Type.
19611
19612         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19613         `Type', as this has a different meaning now in the base
19614
19615 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * interface.cs, class.cs: Removed from all the sources the
19618         references to signature computation, as we can not do method
19619         signature computation during the parsing time, as we are not
19620         trying to solve at that point distinguishing:
19621
19622         class X {
19623                 void a (Blah x) {}
19624                 void a (NS.Blah x) {}
19625         }
19626
19627         Which depending on the context might be valid or not, as we do not
19628         know if Blah is the same thing as NS.Blah at that point.
19629
19630         * Redid everything so the code uses TypeRefs now instead of
19631         Types.  TypeRefs are just temporary type placeholders, that need
19632         to be resolved.  They initially have a pointer to a string and the
19633         current scope in which they are used.  This is used later by the
19634         compiler to resolve the reference to an actual Type. 
19635
19636         * DeclSpace is no longer a CIR.Type, and neither are
19637         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19638         are all DeclSpaces, but no Types. 
19639
19640         * type.cs (TypeRefManager): This implements the TypeRef manager,
19641         which keeps track of all the types that need to be resolved after
19642         the parsing has finished. 
19643
19644 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19645
19646         * ARGH.  We are going to have to store `foreach' as a class rather
19647         than resolving it, as we need to verify error 1579 after name
19648         resolution.   *OR* we could keep a flag that says `This request to
19649         IEnumerator comes from a foreach statement' which we can then use
19650         to generate the error.
19651
19652 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19653
19654         * class.cs (TypeContainer.AddMethod): we now add methods to the
19655         MethodGroup instead of the method hashtable.  
19656
19657         * expression.cs: Add MethodGroup abstraction, which gets us one
19658         step closer to the specification in the way we handle method
19659         declarations.  
19660
19661         * cs-parser.jay (primary_expression): qualified_identifier now
19662         tried to match up an identifier to a local variable reference or
19663         to a parameter reference.
19664
19665         current_local_parameters is now a parser global variable that
19666         points to the current parameters for the block, used during name
19667         lookup.
19668
19669         (property_declaration): Now creates an implicit `value' argument to
19670         the set accessor.
19671
19672 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19673
19674         * parameter.cs: Do not use `param' arguments as part of the
19675         signature, per the spec.
19676
19677 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19678
19679         * decl.cs: Base class for classes, structs and interfaces.  This
19680         is the "Declaration Space" 
19681
19682         * cs-parser.jay: Use CheckDef for checking declaration errors
19683         instead of having one on each function.
19684
19685         * class.cs: Factor out some code for handling error handling in
19686         accordance to the "Declarations" section in the "Basic Concepts"
19687         chapter in the ECMA C# spec.
19688
19689         * interface.cs: Make all interface member classes derive from
19690         InterfaceMemberBase.
19691
19692 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19693
19694         * Many things: all interfaces are parsed and generated in
19695         gen-treedump.  Support for member variables, constructors,
19696         destructors, properties, constants is there.
19697
19698         Beginning of the IL backend, but very little done, just there for
19699         testing purposes. 
19700
19701 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19702
19703         * cs-parser.jay: Fix labeled statement.
19704
19705         * cs-tokenizer.cs (escape): Escape " and ' always.
19706         ref_line, ref_name: keep track of the line/filename as instructed
19707         by #line by the compiler.
19708         Parse #line.
19709
19710 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19711
19712         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19713         to match the values in System.CodeDOM.
19714
19715         Divid renamed to Divide.
19716
19717         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19718         statements. 
19719         (Statements.set): remove.
19720
19721         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19722         statements. 
19723
19724         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19725         falseStatements always have valid values. 
19726
19727         * cs-parser.jay: Use System.CodeDOM now.
19728