Set default
[mono.git] / mcs / gmcs / ChangeLog
1 2005-02-15  Martin Baulig  <martin@ximian.com>
2
3         * generic.cs (ConstructedType.Constraints): Correctly check
4         constraints if the argument type is a type parameter; fixes
5         #72326. 
6
7 2005-02-02  Martin Baulig  <martin@ximian.com>
8
9         * delegate.cs (Delegate.DefineType): Report an internal error if
10         TypeManager.multicast_delegate_type is null.  See bug #72015 for
11         details.        
12
13 2005-01-29  Miguel de Icaza  <miguel@novell.com>
14
15         * pending.cs: Produce better code (no nops produced by using Ldarg
16         + value).
17         
18         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
19         i - 1' it should be arg + 1.
20
21         Fixes bug #71819.
22         
23 2005-01-26  Martin Baulig  <martin@ximian.com>
24
25         * cs-parser.jay (indexer_declarator): Don't report an error if we
26         have type parameters since we can be an explicit interface
27         implementation; fixes #71449.
28
29 2005-01-26  Martin Baulig  <martin@ximian.com>
30
31         * class.cs (TypeContainer.AttributeTargets): Return the correct
32         AttributeTargets depending on our `Kind' instead of throwing an
33         exception; fixes #71632.
34
35 2005-01-26  Martin Baulig  <martin@ximian.com>
36
37         * delegate.cs (Delegate.DefineType): Correctly define our type
38         parameters.  Fixes #71483.
39
40 2005-01-25  Raja R Harinath  <rharinath@novell.com>
41
42         Fix #71602.
43         * expression.cs (MemberAccess.DoResolve): Don't complain with
44         cs0572 when the LHS of a member access has identical name and type
45         name.
46
47 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
48
49         Fix #71651, #71675
50         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
51         CreatePermission.
52         Create custom PermissionSet only for PermissionSetAttribute.
53
54 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
55
56         Fix #71649
57         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
58         delegates in static class.
59
60 2005-01-24  Martin Baulig  <martin@ximian.com>
61
62         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
63         merging an implicit block, just use its reachability.
64
65         * statement.cs (Block.Resolve): Make the unreachable code check
66         work wrt. implicit blocks; see test-337 from #63842.
67
68 2005-01-21  Alp Toker  <alp@atoker.com>
69  
70         * cs-parser.jay: destructor_declaration's container is PartialContainer
71         not Class when partial types are used, so use Kind prop instead of
72         'is'.
73         
74 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
75
76         * cs-parser.jay: Improve error reporting when an interface
77         declares new types.
78
79 2005-01-20  Dick Porter  <dick@ximian.com>
80
81         * support.cs: SeekableStreamReader fix from Sandor Dobos
82         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
83         chars are read.  Fixes bug 70369.
84
85 2005-01-20  Raja R Harinath  <rharinath@novell.com>
86
87         * cs-parser.jay (catch_clause): Simplify current_block handling
88         somewhat.
89
90 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
91
92         * convert.cs (ImplicitStandardConversionExists): Synchronize the
93         code with ImplicitStandardConversion to handle the implicit
94         conversion of method groups into valid delegate invocations. 
95
96         The problem is that in parameter handling we were using this code
97         path.  Fixes bug #64698
98
99 2005-01-19  Raja R Harinath  <rharinath@novell.com>
100
101         * cs-parser.jay: Fix several infelicities.
102         - Avoid assigning to the parser value stack.  Code like 
103           '$3 = null' is unclean.  Synthesize a value for the code block
104           instead. 
105         - Avoid using oob_stack for storing location information.  Use ...
106         (_mark_): ... this.  New (empty) rule.  Saves the current location
107         in $$.
108         (foreach_statement): Avoid using oob_stack for current_block
109         handling.  Use technique used in for_statement and
110         using_statement.  Synthesize a value for the code block to store
111         additional intermediate information.
112
113 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
114
115         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
116         of a different type is only allowed to private fields of a
117         containing type, not on fields of a base class.
118
119         See test-174.cs and error cs0122-9.cs
120
121 2005-01-13  Raja R Harinath  <rharinath@novell.com>
122
123         Fix test-335.cs (bug #58126).
124         * cs-parser.jay (argument): Split out non-expression parts of the
125         rule into 'non_simple_argument'.
126         (invocation_expression): Support parenthesized invocations with
127         multiple arguments, and with single non-simple arguments.
128
129 2005-01-13  Raja R Harinath  <rharinath@novell.com>
130
131         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
132         places.
133
134 2005-01-12  Raja R Harinath  <rharinath@novell.com>
135
136         Fix cs0038-1.cs, cs1640-6.cs.
137         * ecore.cs (Expression.Resolve): Remove special-case for
138         SimpleName in error-handling.
139         (Expression.almostMatchedMembers): Relax access permission to
140         protected.
141         (Expression.MemberLookupFailed): Handle duplicates in
142         almostMatchedMembers list.
143         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
144         * expression.cs (New.DoResolve): Report CS1540 for more cases.
145         * typemanager.cs (GetFullNameSignature): Use the MethodBase
146         overload if the passed in MemberInfo is a MethodBase.
147
148 2005-01-25  Martin Baulig  <martin@ximian.com>
149
150         * doc.cs
151         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
152
153 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
154
155         Fix #70749
156         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
157         for non-CAS & merge permission sets properly.
158
159 2005-01-11  Raja R Harinath  <rharinath@novell.com>
160
161         Improve standard-compliance of simple name and member access 
162         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
163         * ecore.cs (FullNamedExpression): New abstract base class 
164         for Namespaces and TypeExpressions.
165         (ResolveFlags.SimpleName): Remove.
166         (SimpleName): Remove support for dotted names.
167         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
168         DeclSpace.FindType and DeclSpace.LookupType.
169         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
170         (Expression.ExprClassName): Make member function.
171         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
172         a namespace.  Remove creation of dotted "SimpleName"s.
173         (MemberAccess.DoResolve): Likewise.
174         * decl.cs (DeclSpace.Cache): Make private.
175         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
176         (DeclSpace.FindType): Update.
177         (DeclSpace.LookupType): Move here from RootContext.  Return a 
178         FullNamedExpression.
179         * namespace.cs (Namespace): Derive from FullNamedExpression
180         so that it can be part of expression resolution.
181         (Namespace.Lookup): Return an FullNamedExpression.
182         (NamespaceEntry.LookupAlias): Lookup aliases only in current
183         namespace.
184         * rootcontext.cs (NamespaceLookup): Remove.
185         (LookupType): Move to DeclSpace.
186         * attribute.cs (CheckAttributeType): Update.
187         * doc.cs (FindDocumentedType): Remove allowAlias argument.
188         (FindDocumentedTypeNonArray): Likewise.
189
190 2005-01-11  Raja R Harinath  <rharinath@novell.com>
191
192         Fix cs0509.cs, cs1632.cs.
193         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
194         is the same as IsInterface.
195         (TypeContainer.GetClassBases): Likewise.
196         * statement.cs (LabeledStatement.ig): New field.
197         (LabeledStatement.LabelTarget): Save ILGenerator which created the
198         label.
199         (LabeledStatement.DoEmit): Check that the label was created with
200         the same ILGenerator.
201
202 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
203
204         Fix #71058
205         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
206         accessors to its properties.
207
208         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
209         from accessors to property.
210         
211 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
212
213         Fix #70722
214         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
215         only for overrides.
216         
217 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
218
219         * attribute.cs: Check for null and empty strings.  
220
221         I have lost another battle to Paolo.
222
223 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
224
225         Fix #70942
226         * class.cs (PropertyMethod): Set Parent field in ctors.
227         (SetMethod.InternalParameters): Add unsafe switch hack.
228         Override MarkForDuplicationCheck where it is appropriate.
229
230         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
231         It says whether container allows members with the same name.
232         Base default is no.
233         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
234         Removed is_method parameter.
235
236 2005-01-06  Duncan Mak  <duncan@ximian.com>
237
238         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
239         because the previous change led to incorrect reporting of CS1032
240         ("Cannot define/undefine preprocessor symbols after first token in
241         file"). Instead of using `tokens_seen' as the only flag that
242         triggers CS1040, introduce `comments_seen'. This new flag is used
243         to signify having seen comments on the current line, so it is
244         unset after a newline.
245
246 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
247
248         * doc.cs : When searching for a type, find nested type too.
249           This fixes bug #71040.
250
251 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
252
253         * doc.cs :
254           - Warn missing member comment on those classes which also does not
255             have doc comments. Fixed bug #71041.
256           - Don't warn missing doc comment on default constructor.
257             Fixed bug #71042.
258
259 2005-01-06  Duncan Mak  <duncan@ximian.com>
260
261         * cs-tokenizer.cs (xtoken): After handling traditional C-style
262         comments, set `tokens_seen' to true. This allows us to detect
263         misplaced preprocessor directives (i.e. not at the beginning of
264         the a line, nor after whitespaces). In that case, report error
265         CS1040. This fixes bug #56460.
266
267         * cs-parser.jay (interface_member_declaration): Add checks for
268         IsExplicitImpl, and report CS0541 error if an interface member is
269         defined as an explicit interface declaration.
270
271 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
272
273         Fix #70817
274         * class.cs (PropertyMethod): Set Parent field in ctors.
275         (SetMethod.InternalParameters): Add unsafe switch hack.
276         
277         * decl.cs (MemberCore.Parent): Cannot be readonly.
278
279 2005-01-06  Raja R Harinath  <rharinath@novell.com>
280
281         * decl.cs (DeclSpace.ResolveType): Remove.
282         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
283         Merge in code from ...
284         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
285         * class.cs, enum.cs: Update to changes.
286
287 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
288
289         * anonymous.cs: Ensure that we init the scope of our parent if it
290         has not been initialized yet.
291
292 2004-12-30  Duncan Mak  <duncan@ximian.com>
293
294         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
295         if field.FieldBuilder is null. Fixes #70758.
296
297         * convert.cs: Fixed some typos and updated some of the comments.
298         (ImplicitStandardConversionExists):
299         (TryImplicitIntConversion): If `target_type' is an interface and
300         the type of `ic' implements this interface, return true or a new
301         BoxedCast instead of null. This fixes #70468.
302
303 2004-12-29  Duncan Mak  <duncan@ximian.com>
304
305         * expression.cs (Argument.Emit): Check that Expr is
306         IMemoryLocation before casting to it, and report CS1510 otherwise.
307
308         This fixes #70402.
309
310 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
311
312         * statement.cs (Block.ThisVariable): remove the recursion here, to
313         make the --profile more sane.
314
315 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
316
317         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
318         assembly, by JB Evain.
319
320 2004-12-17  Raja R Harinath  <rharinath@novell.com>
321
322         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
323           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
324         "parent" refers to enclosing type/class.  "base" refers to superclass.
325
326 2004-12-17  Raja R Harinath  <rharinath@novell.com>
327
328         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
329         Ensure that we only have GlobalAttributes.
330         * attribute.cs (Attribute.Emit): Make non-virtual.
331         (GlobalAttribute.Emit): Remove.
332         (Attribute.Resolve): Make virtual.
333         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
334         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
335         the argument. Don't create one.
336         (Attribute.GetObsoleteAttribute): Likewise.
337         (Attribute.GetClsCompliantAttributeValue): Likewise.
338         * class.cs, decl.cs: Update to changes.
339
340 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
341
342         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
343         
344         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
345         
346         * statement.cs (Foreach.Resolve): Add error 186 report.
347
348 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
349
350         * expression.cs (Conditional.DoResolve): Add warning 429.
351         
352         * statement.cs (If.Resolve): Add warning 665.
353
354 2004-12-16  Raja R Harinath  <rharinath@novell.com>
355
356         New invariant: RootContext.Tree.Types.NamespaceEntry == null
357         except when in the parser, and in GlobalAttribute.
358         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
359         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
360         RootContext.Tree.Types.NamespaceEntry once work is done.
361         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
362         and resets RootContext.Tree.Types.NamespaceEntry.
363
364 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
365
366         * cs-parser.jay: Don't create a block for every variable.
367
368 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
369
370         * location.cs: Provide extra information.
371
372         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
373         variables from the captured environment, it is the ldarg_0.
374
375 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
376
377         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
378         find a conclusion.
379         
380         * class.cs: Changed warning level for 169 to avoid developer
381         displeasure from warning flooding. It will be changed back when they
382         fix most of current BCL warnings.
383         
384         * RootContext.cs: Pushed default WarningLevel to 3.
385         
386         * statement.cs: Removed unused variable.
387
388 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
389
390         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
391         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
392         Add error 502 report.
393         (StaticClass.DefineType): Add error 441 report.
394         (Class.AllowedModifiersProp): New virtual property as temporary
395         extension to AllowedModifiers.
396         (Class.DefineType): Add error 418 report. Moved ModFlags check here
397         to share implementation with StaticClass and don't call virtual
398         methods from ctor.
399         
400         * driver.cs (MainDriver): Add error 1558 test.
401
402         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
403         report. Moved error 36 test here.
404
405         * statement.cs (Throw.Resolve): Add error 724 report.
406
407         * typemanager.cs: Add out_attribute_type core type.
408         
409 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
410
411         * class.cs (TypeContainer.VerifyClsCompliance): Add error
412         3018 report.
413         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
414
415         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
416         3017 report.
417         
418         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
419
420         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
421         Add error 3023 report.
422         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
423
424         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
425         implementation.
426
427 2004-12-12  John Luke  <john.luke@gmail.com>
428
429         * driver.cs (AddArgs): take -- into account when
430         adding arguments, fixes bug 65710 
431
432 2004-12-12  Martin Baulig  <martin@ximian.com>
433
434         * expression.cs (Unary.TryReduceNegative): Added support for
435         SByteConstant and ByteConstant.
436         (Unary.Reduce): Check error values from TryReduceNegative().
437
438 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
439
440         * attributes.cs (Attribute.Resolve): Avoid multiple error report
441         and report exception as error 182.
442
443 2004-12-10  Raja R Harinath  <rharinath@novell.com>
444
445         * driver.cs (Main): Fix message when there are warnings.
446
447 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
448
449         * delegate.cs: Fixed my fix from yesterday, sorry about that.
450
451 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
452
453         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
454         Reduced number of warnings.
455         
456         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
457
458 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
459
460         * driver.cs: Removed message.
461
462         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
463
464 2004-12-08    <vargaz@freemail.hu>
465
466         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
467
468 2004-12-08  Martin Baulig  <martin@ximian.com>
469
470         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
471         instead of a CS3002 for properties and indexer.
472
473 2004-12-08  Martin Baulig  <martin@ximian.com>
474
475         * decl.cs (MemberName.ToString): Make this work again.
476
477 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
478
479         * attribute.cs (Resolve): Add error 591 detection.
480
481         * class.cs (FieldMember.Define): Add error 1547 detection.
482         (Indexer.Define): Add error 620 detection.
483         (Operator.Define): Add error 590 detection.
484
485         * ecore.cs: Missing argument for error 79.
486
487         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
488         detection.
489
490 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
491
492         Fix #70106
493         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
494         only.
495
496 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
497
498         * cs-parser.jay : handle doc comments on implicit/explicit operators.
499           Some operator comments were suppressed.
500         * doc.cs : Implicit/explicit operator name in doc comments are like
501           "op_Explicit(type)~returnType", so added suffix handling.
502
503 2005-01-21  Alp Toker  <alp@atoker.com>
504
505         * cs-parser.jay: destructor_declaration's container is PartialContainer
506         not Class when partial types are used, so use Kind prop instead of 'is'.
507
508 2004-12-12  Martin Baulig  <martin@ximian.com>
509
510         * expression.cs (Unary.TryReduceNegative): Added support for
511         SByteConstant and ByteConstant.
512         (Unary.Reduce): Check error values from TryReduceNegative().
513
514 2004-12-11  Martin Baulig  <martin@ximian.com>
515
516         * support.cs (ReflectionParameters.ParameterName): If we have a
517         `gpd', call `ParameterName' on it.
518
519         * parameter.cs (Parameter.GetParameterAttributes): New static method.
520
521         * pending.cs (PendingImplementation.DefineProxy): Call
522         DefineParameter() for all of the MethodBuilder's arguments.
523
524 2004-12-09  Martin Baulig  <martin@ximian.com>
525
526         * doc.cs (DocUtil): Make this a static class.
527
528 2004-12-09  Martin Baulig  <martin@ximian.com>
529
530         * expression.cs (Invocation.InferType): Moved the type inference
531         implementation into TypeManager.
532
533         * generics.cs (TypeManager): Moved the type inference
534         implementation here.
535
536 2004-12-09  Martin Baulig  <martin@ximian.com>
537
538         * typemanager.cs (TypeManager): Make this a partial class.
539
540         * generics.cs
541         (TypeManager): Move the generics part of `TypeManager' here.
542
543 2004-12-08  Martin Baulig  <martin@ximian.com>
544
545         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
546         instead of a CS3002 for properties and indexer.  Added CS3024
547         check for generic interfaces.
548
549         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
550         instances are not CLS-compliant.
551
552 2004-12-08  Martin Baulig  <martin@ximian.com>
553
554         * cs-parser.jay
555         (void_pointer_expression): New rule for `void*', `void**' etc.
556         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
557
558 2004-12-08  Martin Baulig  <martin@ximian.com>
559
560         * expression.cs (Invocation.InferType): Removed the hack for
561         MethodCore.MayUnify().  
562
563         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
564         this actually work.
565
566         * class.cs (MethodCore.MayUnify): Use
567         TypeManager.MayBecomeEqualGenericTypes().       
568
569 2004-12-08  Martin Baulig  <martin@ximian.com>
570
571         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
572         parameter, box it.  Fixes #69233.
573
574 2004-12-08  Martin Baulig  <martin@ximian.com>
575
576         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
577         have the ctor constraint.  Fixes #68326.
578
579 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
580
581         * cs-parser.jay : interface comment was not consumed because of
582           extra opt_semicolon before doc handling.
583
584 2004-12-03  Raja R Harinath  <rharinath@novell.com>
585
586         Fix test-327.cs, test-328.cs, and put in early infrastructure
587         for eventually fixing #52697.
588         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
589         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
590         from other methods.
591         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
592         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
593         (VerifyUsing, error246): Update.
594         * rootcontext.cs (RootContext.NamespaceLookup): Just use
595         'NamespaceEntry.LookupNamespaceOrType'.
596
597 2004-12-07  Martin Baulig  <martin@ximian.com>
598
599         * driver.cs: Call it "BETA SOFTWARE" :-)
600
601 2004-12-06  Raja R Harinath  <rharinath@novell.com>
602
603         Fix crash on cs0657-17.cs.
604         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
605         Use RootContext.Tree.Types, not 'new RootTypes ()'.
606         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
607         the case where the NamespaceEntry gets overwritten.
608
609 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
610
611         Fixed #69195, #56821
612         * ecore.cs (ResolveBoolean): Tiny refactoring.
613
614         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
615         of right expression resolving when left is false constant and
616         operator is LogicalAnd OR true constant and operator is LogicalOr.
617
618         * statement.cs (ResolveUnreachable): Always reports warning.
619
620 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
621
622         * class.cs: Distinguish between 1721 and 1722 (just a little help
623         for the programmer).
624
625 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
626
627         * delegate.cs: Only allow this on new versions of the language. 
628
629 2004-12-02  Duncan Mak  <duncan@ximian.com>
630
631         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
632         Expression class.
633         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
634         here as a static method. Take an additional bool out parameter
635         `must_do_cs1540_check' for signaling to InstanceResolve.
636         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
637         member field from PropertyExpr class and made it an argument of
638         the method instead.
639         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
640         check for MarshalByRefObject, and report CS0122 instead of CS1540.
641         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
642         and `remove_accessor' as well as InstanceResolve: report CS0122
643         where applicable.
644
645         Fixes #70129.
646
647 2004-12-07  Martin Baulig  <martin@ximian.com>
648
649         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
650         and CS0692 where appropriate.
651
652 2004-12-06  Martin Baulig  <martin@ximian.com>
653
654         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
655         IsDuplicateImplementation() and improved it.
656
657         * expression.cs (Invocation.InferTypeArguments): Added
658         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
659         and removed the "ref" modifier from `infered_types'.
660
661         * decl.cs (MemberName.ToString): Removed the exception.
662
663 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
664
665         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
666           comments are allowed.
667
668 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
669
670         * delegate.cs: Add checks for subtypes in paramaters and return values
671         in VerifyMethod () to add support for Covariance/Contravariance
672         in delegates.
673         
674 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
675
676         * report.cs: Remove extra closing parenthesis.
677
678         * convert.cs (Error_CannotImplicitConversion): If the name of the
679         types are the same, provide some extra information.
680
681 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
682
683         Fix bug #70102
684         * attribute.cs (Resolve): Improved implementation of params
685         attribute arguments.
686
687         * support.cs (ParameterData): Add HasParams to be faster.
688
689 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
690
691         all things are for /doc support:
692
693         * doc.cs: new file that supports XML documentation generation.
694         * mcs.exe.sources: added doc.cs.
695         * driver.cs:
696           Handle /doc command line option.
697           Report error 2006 instead of 5 for missing file name for /doc.
698           Generate XML documentation when required, after type resolution.
699         * cs-tokenizer.cs:
700           Added support for picking up documentation (/// and /** ... */),
701           including a new XmlCommentState enumeration.
702         * cs-parser.jay:
703           Added lines to fill Documentation element for field, constant,
704           property, indexer, method, constructor, destructor, operator, event
705           and class, struct, interface, delegate, enum.
706           Added lines to warn incorrect comment.
707         * rootcontext.cs :
708           Added Documentation field (passed only when /doc was specified).
709         * decl.cs:
710           Added DocComment, DocCommentHeader, GenerateDocComment() and
711           OnGenerateDocComment() and some supporting private members for
712           /doc feature to MemberCore.
713         * class.cs:
714           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
715         * delegate.cs:
716           Added overriden DocCommentHeader.
717         * enum.cs:
718           Added overriden DocCommentHeader and GenerateDocComment().
719
720 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
721
722         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
723         unwrapping the enumeration values, chain to
724         DoConstantNumericPromotions again, so we can promote things to the
725         fundamental types (takes care of enums that are bytes, sbytes).
726
727         Fixes bug #62054.
728
729 2004-12-01  Raja R Harinath  <rharinath@novell.com>
730
731         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
732         Fix long-standing bug in type-lookup.  Use FindType instead of
733         LookupType when ec.ResolvingTypeTree.
734         (Attribute.ResolveType, Attribute.Resolve)
735         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
736         Update to changes.
737         (Attributes.Search): Remove internal version.  Update.
738         (Attributes.SearchMulti): Update.
739         (Attributes.GetClsCompliantAttribute): Remove.
740         (Attributes.GetIndexerNameAttribute): Remove.
741         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
742         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
743         * class.cs (Indexer.Define): Likewise.
744
745 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
746
747         Fix bug #68790
748         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
749         MarshallByReference members access.
750
751         * expression.cs: Use CheckMarshallByRefAccess;
752         Better error CS0197 message.
753
754         * report.cs: Print whole related error message.
755
756 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
757
758         * class (GetClassBases): Better error 60 report.
759         (EventProperty): Disabled warning 67 detection.
760
761 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
762
763         Fix bug #60324
764         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
765
766         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
767         precise values.
768
769 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
770
771         Fix bug #49488
772         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
773
774         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
775
776 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
777
778         * attribute.cs (Attribute.Resolve): Refine error reporting and
779         report a cs0117 if the identifier does not exist, to distinguish
780         from 0617 which is a miss-use of the actual identifier.
781
782         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
783         between cs0070 and cs0079.
784
785         * class.cs (MemberBase.DoDefine): When reporting a wrong
786         accessibility level, we use MethodCore to compare instead of
787         Method (this was a regression in some refactoring effort).
788
789         So now we correctly report cs0056 again.
790
791         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
792         testing the target_type (which was known to be object_type) and
793         not the source type (which is anonymous_method).
794
795         Fixed reporting of error cs1660.
796
797         * expression.cs (UserCast.Source): Expose the underlying cast.
798
799         * statement.cs (Switch.SwitchGoverningType): Sort the list of
800         allowed types to find a match to int32 first (most common).
801
802         In addition, it ignores any ImplicitUserConversions that did an
803         internal implicit conversion (as the switch statement allows only
804         one integral conversion to exist).
805
806         * class.cs (PartialContainer.Create): rename `name' to
807         `member_name' for clarity.  Then replace the string calls with a
808         call to MemberName.GetPartialName, as now using
809         MemberName.ToString is an error (this is due to the side effects
810         it had, that were fixed in the past).
811
812         This will restore the error reporting on a number of partial class
813         errors that were missusing this (and getting an exception as a
814         results, which is now just a plain textual warning, because
815         yyparse debug output would crash otherwise).
816
817 2004-11-26  Raja R Harinath  <rharinath@novell.com>
818
819         * Makefile (PROGRAM_INSTALL_DIR): Remove.
820
821 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
822
823         * rootcontext.cs (LookupType): Make sure to cache lookups that
824         don't give us a negative result. This saves about 5% of corlib
825         compilation time.
826
827 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
828
829         * report.cs (AbstractMessage.Print): messages are sent to stderr
830
831         * class.cs (TypeContainer.GetClassBases): It is an error to have a
832         non-interface in the list of interfaces (at this point, either
833         parent was properly set, or a base class is being listed in the
834         interfaces section).
835
836         This flags error 1722, and resolves the crash from bug 69259.
837
838 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
839
840         * statement.cs (Using.EmitExpressionFinally): make this work right
841         for valuetypes. Fixes 69926.
842
843 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
844
845         * const.cs (Const.ChangeType): Cope with the "0 literal can be
846         converted to an enum" here, before we try to change the underlying
847         type.  This code exists, but it is a different code path than the
848         one used while encoding constants.
849
850         (ImplicitReferenceConversionExists): In addition, resynchronized
851         the code here, so it matches the same code in
852         ImplicitReferenceConversionExists for the `from any class-type S
853         to any interface-type T'.       
854
855 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
856
857         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
858
859 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
860
861         * cs-parser.jay: Use verbosity accordingly. 
862
863 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
864
865         * expression.cs (Unary.ResolveOperator): Do not report warning;
866         AddressOf reads from variable.
867         
868         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
869
870 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
871
872         Fix bug #69462
873
874         * attribute.cs (Attributable): Removed CheckTargets.
875         (Attributes.Emit): Explicit attribute targets are tested here.
876
877         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
878         not enabled for interfaces.
879
880         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
881         (GetAssemblyName): Ouch next bug there.
882
883 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
884
885         * expression.cs: Error 275 added.
886         
887 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
888
889         Fix bug #69177 (Implemented decimal constant support)
890
891         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
892         (BinaryFold): Add DecimalConstant.
893
894         * const.cs (Define): Decimal constant 
895         (is not constant.
896         (ChangeType): Add decimal type handling.
897         (LookupConstantValue): Don't set value for decimal type but
898         emit DecimalConstantAttribute. Needed for constant optimization.
899
900         * constant.cs (ToDecimal): New method.
901         (ConvertToDecimal): New method.
902         (IntConstant): Implemented ConvertToDecimal.
903         (DecimalConstant.Emit): Emit optimized version for decimals in
904         int range.
905
906         * expression.cs (ResolveOperator): Changed order of constant
907         reduction to work correctly with native types which have
908         overloaded operators.
909         (ResolveMemberAccess): Extract constant value from attribute
910         for decimal type.
911
912         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
913
914         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
915         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
916         (ChangeType): Decimal is special.
917         (TypeToCoreType): Add decimal type.
918
919 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
920
921         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
922         decimal types.
923
924 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
925
926         * class.cs (EventField.ApplyAttributeBuilder): Fix error
927         test cs1667-5.cs.
928
929 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
930
931         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
932
933         * pending.cs (PendingImplementation): Grab only interfaces.
934
935 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
936
937         * statement.cs (ForeachHelperMethods): Add location member and
938         error 202 detection.
939
940 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
941
942         * expression.cs (DoResolveBase): Fixed wrong warning for out
943         variables.
944
945 2004-12-04  Martin Baulig  <martin@ximian.com>
946
947         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
948         to check whether the conversion is ok.
949
950         * typemanager.cs (TypeManager.GetTypeArguments): Just return
951         `Type.EmptyTypes' if we're not a generic TypeContainer.
952
953 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
954
955         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
956         old bug: when converting from the null literal to a pointer,
957         return an EmptyCast, not the NullLiteral.
958
959         This fixes #69921, the recent null_type changes probably made this
960         bug more prominent.
961
962 2004-12-03  Martin Baulig  <martin@ximian.com>
963
964         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
965         method as our child, call AnonymousMethod.Compatible() on it.
966
967 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
968
969         * class.cs (FieldBase): Use an unused bit field from the field to
970         encode the `has_offset' property from the FieldMember.  This saves
971         a couple of Ks on bootstrap compilation.
972
973         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
974         method as our child, return the AnonymousMethod resolved
975         expression.
976
977         * expression.cs (New.DoResolve): Allow return values from
978         NewDelegate to also include AnonymousMethods.
979
980         Fixes #70150.
981
982 2004-11-29  Raja R Harinath  <rharinath@novell.com>
983
984         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
985         cs1648 report.
986         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
987         System.Runtime.InteropServices._Exception, since it's a base
988         interface of the core type System.Exception in the net_2_0 profile.
989
990 2004-11-27  Martin Baulig  <martin@ximian.com>
991
992         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
993
994 2004-11-26  Raja R Harinath  <rharinath@novell.com>
995
996         * Makefile: Convert to use executable.make.
997         * gmcs.exe.sources: New.
998
999 2004-11-25  Martin Baulig  <martin@ximian.com>
1000
1001         * expression.cs (Invocation.InferType): Added support for byref types.
1002
1003 2004-11-25  Martin Baulig  <martin@ximian.com>
1004
1005         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1006         in TypeManager.TypeToCoreType().
1007
1008 2004-11-25  Martin Baulig  <martin@ximian.com>
1009
1010         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1011         "Dispose" method from the `current_type'.
1012         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1013         DoDefineMembers() instead of using the MethodBuilder; this is
1014         required for generic iterators.
1015
1016         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1017
1018 2004-11-24  Martin Baulig  <martin@ximian.com>
1019
1020         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1021
1022 2004-11-20  Martin Baulig  <martin@ximian.com>
1023
1024         * expression.cs (Invocation.InferType): Correctly infer generic
1025         instances; see gen-103.cs.
1026         (Invocation.InferTypeArguments): If a generic method doesn't have
1027         any unbound type parameters, we don't need to infer anything.
1028
1029 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1030
1031         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1032
1033 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1034
1035         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1036         (TypeHandle.GetMemberCache): New.
1037         (TypeHandle.TypeHandle): Update.
1038         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1039         (TypeManager.LookupParentInterfacesCache):
1040         Rename from LookupInterfaceCache.  Optimize slightly.
1041         (TypeManager.MemberLookup_FindMembers): Update.
1042         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1043         multi-type variant.
1044         (AddCacheContents): Rename from AddHashtable.
1045         * class.cs (TypeContainer.parent_container): Remove.
1046         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1047         (TypeContainer.DoDefineMembers): Don't initialize it.
1048         Update to name changes.
1049         
1050 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1051
1052         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1053         that factors the code to check access modifiers on override.  
1054
1055         (PropertyBase): Use the code here.
1056
1057         Patch from Lluis S'anchez, fixes bug #69361.
1058
1059 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1060
1061         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1062         routine that is used to report the use of a captured variable
1063         whose address has been taken.
1064
1065         There are two checks: one when variables are being captured and
1066         the other check is when the address of a variable is taken. 
1067         
1068         (because an anonymous methods might be resolved before *or* after
1069         the address has been taken) and 
1070
1071         * expression.cs (Conditional.DoResolve): Remove the special
1072         casing that Martin added to trueExpr and falseExpr being both
1073         NullLiteral.  We get the right behavior now just by introducing
1074         the null_type into the compiler. 
1075
1076         * convert.cs (ExplicitConversion): Change the code to use
1077         null_type instead of testing `expr is NullLiteral'.
1078         (ImplicitConversionStandard): use null_type too.
1079         (ImplicitReferenceConversionExists): use null_type too.
1080         (ImplicitReferenceConversion): use null_type too.
1081
1082         * literal.cs: The type of `NullLiteral' is now null_type instead
1083         of object_type. 
1084         (Resolve): Set the type here.
1085
1086         * typemanager.cs: Introduce null_type.
1087
1088 2004-11-18  Martin Baulig  <martin@ximian.com>
1089
1090         * rootcontext.cs
1091         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1092
1093 2004-11-18  Martin Baulig  <martin@ximian.com>
1094
1095         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1096
1097 2004-11-18  Martin Baulig  <martin@ximian.com>
1098
1099         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1100         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1101         call ResolveConstructedType() on it to resolve it without checking
1102         constraints.
1103         (Constraints.ResolveTypes): Check them here.
1104         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1105         but don't check constraints.
1106         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1107         check constraints here.
1108         (ConstructedType.ResolveConstructedType): New public method.  This
1109         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1110         resolve ourselves without checking constraints.
1111
1112         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1113
1114 2004-11-18  Martin Baulig  <martin@ximian.com>
1115
1116         * decl.cs
1117         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1118
1119         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1120
1121 2004-11-18  Martin Baulig  <martin@ximian.com>
1122
1123         * ecore.cs (TypeExpr.ResolveType): Removed.
1124         (Expression.ResolveAsTypeTerminal): We always return a fully
1125         resolved `TypeExpr', so we can just access its `Type'.
1126
1127         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1128
1129 2004-11-17  Martin Baulig  <martin@ximian.com>
1130
1131         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1132         sure we don't return any unresolved TypeExpr's.
1133         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1134         a `TypeExpr'.
1135         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1136
1137         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1138         unresolved `ConstructedType's.
1139
1140 2004-11-17  Martin Baulig  <martin@ximian.com>
1141
1142         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1143
1144 2004-11-17  Martin Baulig  <martin@ximian.com>
1145
1146         * ecore.cs
1147         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1148
1149         * decl.cs (DeclSpace.ResolveType): Removed.
1150         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1151
1152 2004-11-17  Martin Baulig  <martin@ximian.com>
1153
1154         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1155         direction, like FindMembers() does.  Fixes #69546, testcase is in
1156         test-315.cs.    
1157
1158 2004-11-16  Martin Baulig  <martin@ximian.com>
1159
1160         This is based on a patch from Marek Safar, see bug #69082.
1161         Fixes bugs #63705 and #67130.
1162
1163         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1164         method; create a MemberCache for an interface type and cache the
1165         result.
1166
1167         * decl.cs (IMemberContainer.ParentContainer): Removed.
1168         (IMemberContainer.ParentCache): New property.
1169         (MemberCache.SetupCacheForInterface): Removed.
1170         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1171         to create a cache for an interface's "parent".
1172
1173         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1174         interfaces too.
1175
1176 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1177
1178         * statement.cs: Avoid adding bools to a hashtable.
1179
1180 2004-11-15  Martin Baulig  <martin@ximian.com>
1181
1182         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1183
1184 2004-11-11  Martin Baulig  <martin@ximian.com>
1185
1186         * typemanager.cs (TypeManager.GetMethodName): New method.
1187
1188         * class.cs (MethodData.Define): Include the generic arity in the
1189         name of an explicit interface; also add it to the method name.
1190
1191         * pending.cs (PendingImplementation.InterfaceMethod): The method
1192         name now includes the generic arity.
1193
1194 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1195
1196         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1197         calling an unsafe method from a safe location.
1198
1199 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
1200
1201         Fix #69167
1202         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1203
1204 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
1205
1206         * namespace.cs (VerifyUsing): use GetPartialName instead of
1207         ToString. 
1208
1209 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
1210
1211         * statement.cs (Return.Resolve): Fix regression in typo: if
1212         `in_exc', we have to request a NeedReturnLabel, this was a typo
1213         introduced in the anonymous method check-in.  Fixes #69131.
1214
1215         * Indexers were using the ShortName when defining themselves,
1216         causing a regression in the compiler bootstrap when applying the
1217         patch from 2004-11-02 (first part), now they use their full name
1218         and the bug is gone.
1219
1220 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
1221
1222         * driver.cs: Strip the path from the names of embedded resources. Fixes
1223         #68519.
1224
1225 2004-11-04  Raja R Harinath  <rharinath@novell.com>
1226
1227         Fix error message regression: cs0104-2.cs.
1228         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1229         (AliasEntry.Resolve): Update.
1230         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
1231         'silent' flag.
1232         (RootContext.LookupType): Update.
1233
1234 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
1235
1236         * cs-parser.jay: Add support for handling accessor modifiers
1237         * class: Add support port accessor modifiers and error checking,
1238         define PropertyMethod.Define as virtual (not abstract anymore)
1239         * ecore.cs: Add checking for proeprties access with access modifiers
1240         * iterators.cs: Modify Accessor constructor call based in the modified
1241         constructor
1242 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
1243
1244         * expression.cs (StringConcat): Handle being called twice,
1245         as when we have a concat in a field init with more than two
1246         ctors in the class
1247
1248 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
1249
1250         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1251         special case explicit implementations, we should always produce
1252         the .property or .event declaration.
1253         
1254         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1255         since it will not return correct data if people use this
1256         unresolved in the presence of using statements (see test-313).
1257
1258         * class.cs (MethodData.Define): If we are an explicit interface
1259         implementation, set the method name to the full name of the
1260         interface plus the name of the method.  
1261
1262         Notice that using the method.MethodName.GetFullName() does not
1263         work, as it will only contain the name as declared on the source
1264         file (it can be a shorthand in the presence of using statements)
1265         and not the fully qualifed type name, for example:
1266
1267         using System;
1268
1269         class D : ICloneable {
1270                 object ICloneable.Clone ()  {
1271                 }
1272         }
1273
1274         Would produce a method called `ICloneable.Clone' instead of
1275         `System.ICloneable.Clone'.
1276
1277         * namespace.cs (Alias.Resolve): Use GetPartialName.
1278         
1279 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1280
1281         * cs-parser.jay: Add error 1055 report.
1282
1283 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
1284
1285         * assign.cs (Assign.DoResolve): Only do the transform of
1286         assignment into a New if the types are compatible, if not, fall
1287         through and let the implicit code deal with the errors and with
1288         the necessary conversions. 
1289
1290 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
1291
1292         * cs-parser.jay: Add error 1031 report.
1293
1294         * cs-tokenizer.cs: Add location for error 1038.
1295
1296 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1297
1298         * cs-parser.jay: Add error 1016 report.
1299
1300 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1301
1302         * cs-parser.jay: Add errors 1575,1611 report.
1303
1304 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1305
1306         * cs-parser.jay: Add error 1001 report.
1307
1308 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1309
1310         Fix #68850
1311         * attribute.cs (GetMarshal): Add method argument for
1312         caller identification.
1313
1314         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1315         agument for GetMarshal and RuntimeMissingSupport.
1316
1317 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
1318
1319         * attribute.cs (ExtractSecurityPermissionSet): Removed
1320         TypeManager.code_access_permission_type.
1321
1322         * typemanager.cs: Removed TypeManager.code_access_permission_type.
1323
1324 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
1325
1326         * expression.cs (LocalVariableReference.DoResolveLValue): Check
1327         for obsolete use of a variable here.   Fixes regression on errors
1328         cs0619-25 and cs0619-26.
1329
1330 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
1331
1332         Fix #62358, implemented security attribute encoding.
1333
1334         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1335         Tests permitted SecurityAction for assembly or other types.
1336         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1337         data from SecurityPermissionAttribute to PermisionSet class.
1338
1339         * class.cs (ApplyAttributeBuilder): Added special handling
1340         for System.Security.Permissions.SecurityAttribute based types.
1341
1342         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1343         special handling for System.Security.Permissions.SecurityAttribute
1344         based types.
1345
1346         * enum.cs (ApplyAttributeBuilder): Added special handling
1347         for System.Security.Permissions.SecurityAttribute based types.
1348
1349         * parameter.cs (ApplyAttributeBuilder): Added special handling
1350         for System.Security.Permissions.SecurityAttribute based types.
1351
1352         * rootcontext.cs: Next 2 core types.
1353
1354         * typemanager.cs (TypeManager.security_permission_attr_type):
1355         Built in type for the SecurityPermission Attribute.
1356         (code_access_permission_type): Build in type.
1357
1358 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
1359
1360         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1361         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1362         all of this information into
1363         EmitContext.EmitCapturedVariableInstance.
1364         
1365         * codegen.cs (EmitCapturedVariableInstance): move here the
1366         funcionality of emitting an ldarg.0 in the presence of a
1367         remapping.   This centralizes the instance emit code.
1368
1369         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1370         then emit a load of this: it means that we have reached the
1371         topmost ScopeInfo: the one that contains the pointer to the
1372         instance of the class hosting the anonymous method.
1373
1374         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1375         captures to the topmost CaptureContext.
1376
1377 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
1378
1379         * expression.cs (LocalVariableReference): Move the knowledge about
1380         the iterators into codegen's EmitCapturedVariableInstance.
1381
1382 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
1383
1384         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1385         all code paths return a value from an anonymous method (it is the
1386         same as the 161 error, but for anonymous methods).
1387
1388 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
1389
1390         The introduction of anonymous methods in the compiler changed
1391         various ways of doing things in the compiler.  The most
1392         significant one is the hard split between the resolution phase
1393         and the emission phases of the compiler.
1394
1395         For instance, routines that referenced local variables no
1396         longer can safely create temporary variables during the
1397         resolution phase: they must do so from the emission phase,
1398         since the variable might have been "captured", hence access to
1399         it can not be done with the local-variable operations from the runtime.
1400         
1401         * statement.cs 
1402
1403         (Block.Flags): New flag `IsTopLevel' to indicate that this block
1404         is a toplevel block.
1405
1406         (ToplevelBlock): A new kind of Block, these are the blocks that
1407         are created by the parser for all toplevel method bodies.  These
1408         include methods, accessors and anonymous methods.
1409
1410         These contain some extra information not found in regular blocks:
1411         A pointer to an optional CaptureContext (for tracking captured
1412         local variables and parameters).  A pointer to the parent
1413         ToplevelBlock.
1414         
1415         (Return.Resolve): Catch missmatches when returning a value from an
1416         anonymous method (error 1662).
1417         Invoke NeedReturnLabel from the Resolve phase instead of the emit
1418         phase.
1419
1420         (Break.Resolve): ditto.
1421
1422         (SwitchLabel): instead of defining the labels during the
1423         resolution phase, we now turned the public ILLabel and ILLabelCode
1424         labels into methods called GetILLabelCode() and GetILLabel() that
1425         only define the label during the Emit phase.
1426
1427         (GotoCase): Track the SwitchLabel instead of the computed label
1428         (its contained therein).  Emit the code by using
1429         SwitchLabel.GetILLabelCode ().
1430
1431         (LocalInfo.Flags.Captured): A new flag has been introduce to track
1432         whether the Local has been captured or not.
1433
1434         (LocalInfo.IsCaptured): New property, used to tell whether the
1435         local has been captured.
1436         
1437         * anonymous.cs: Vastly updated to contain the anonymous method
1438         support.
1439
1440         The main classes here are: CaptureContext which tracks any
1441         captured information for a toplevel block and ScopeInfo used to
1442         track the activation frames for various local variables.   
1443
1444         Each toplevel block has an optional capture context associated
1445         with it.  When a method contains an anonymous method both the
1446         toplevel method and the anonymous method will create a capture
1447         context.   When variables or parameters are captured, they are
1448         recorded on the CaptureContext that owns them, for example:
1449
1450         void Demo () {
1451              int a;
1452              MyDelegate d = delegate {
1453                  a = 1;
1454              }
1455         }
1456
1457         Here `a' will be recorded as captured on the toplevel
1458         CapturedContext, the inner captured context will not have anything
1459         (it will only have data if local variables or parameters from it
1460         are captured in a nested anonymous method.
1461
1462         The ScopeInfo is used to track the activation frames for local
1463         variables, for example:
1464
1465         for (int i = 0; i < 10; i++)
1466                 for (int j = 0; j < 10; j++){
1467                    MyDelegate d = delegate {
1468                         call (i, j);
1469                    }
1470                 }
1471
1472         At runtime this captures a single captured variable `i', but it
1473         captures 10 different versions of the variable `j'.  The variable
1474         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
1475         recorded on a child.  
1476
1477         The toplevel ScopeInfo will also track information like the `this'
1478         pointer if instance variables were referenced (this is necessary
1479         as the anonymous method lives inside a nested class in the host
1480         type of the method). 
1481
1482         (AnonymousMethod): Expanded to track the Toplevel, implement
1483         `AnonymousMethod.Compatible' to tell whether an anonymous method
1484         can be converted to a target delegate type. 
1485
1486         The routine now also produces the anonymous method content
1487
1488         (AnonymousDelegate): A helper class that derives from
1489         DelegateCreation, this is used to generate the code necessary to
1490         produce the delegate for the anonymous method that was created. 
1491
1492         * assign.cs: API adjustments for new changes in
1493         Convert.ImplicitStandardConversionExists.
1494
1495         * class.cs: Adjustments to cope with the fact that now toplevel
1496         blocks are of type `ToplevelBlock'. 
1497
1498         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
1499         insteda of standard blocks.
1500
1501         Flag errors if params arguments are passed to anonymous methods.
1502
1503         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
1504         `CurrentAnonymousMethod' which points to the current Anonymous
1505         Method.  The variable points to the AnonymousMethod class that
1506         holds the code being compiled.  It is set in the new EmitContext
1507         created for the anonymous method.
1508
1509         (EmitContext.Phase): Introduce a variable and an enumeration to
1510         assist in enforcing some rules about when and where we are allowed
1511         to invoke certain methods (EmitContext.NeedsReturnLabel is the
1512         only one that enfonces this right now).
1513
1514         (EmitContext.HaveCaptureInfo): new helper method that returns
1515         whether we have a CapturedContext initialized.
1516
1517         (EmitContext.CaptureVariable): New method used to register that a
1518         LocalInfo must be flagged for capturing. 
1519
1520         (EmitContext.CapturedParameter): New method used to register that a
1521         parameters must be flagged for capturing. 
1522         
1523         (EmitContext.CapturedField): New method used to register that a
1524         field must be flagged for capturing. 
1525
1526         (EmitContext.HaveCapturedVariables,
1527         EmitContext.HaveCapturedFields): Return whether there are captured
1528         variables or fields. 
1529
1530         (EmitContext.EmitMethodHostInstance): This is used to emit the
1531         instance for the anonymous method.  The instance might be null
1532         (static methods), this (for anonymous methods that capture nothing
1533         and happen to live side-by-side with the current method body) or a
1534         more complicated expression if the method has a CaptureContext.
1535
1536         (EmitContext.EmitTopBlock): Routine that drives the emission of
1537         code: it will first resolve the top block, then emit any metadata
1538         and then emit the code.  The split is done so that we can extract
1539         any anonymous methods and flag any captured variables/parameters.
1540         
1541         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
1542         during this phase, the ILGenerator should not be used as labels
1543         and local variables declared here might not be accessible to any
1544         code that is part of an anonymous method.  
1545
1546         Exceptions to this include the temporary variables that are
1547         created by some statements internally for holding temporary
1548         variables. 
1549         
1550         (EmitContext.EmitMeta): New routine, in charge of emitting all the
1551         metadata for a cb
1552
1553         (EmitContext.TemporaryReturn): This method is typically called
1554         from the Emit phase, and its the only place where we allow the
1555         ReturnLabel to be defined other than the EmitMeta.  The reason is
1556         that otherwise we would have to duplicate a lot of logic in the
1557         Resolve phases of various methods that today is on the Emit
1558         phase. 
1559
1560         (EmitContext.NeedReturnLabel): This no longer creates the label,
1561         as the ILGenerator is not valid during the resolve phase.
1562
1563         (EmitContext.EmitThis): Extended the knowledge in this class to
1564         work in anonymous methods in addition to iterators. 
1565
1566         (EmitContext.EmitCapturedVariableInstance): This emits whatever
1567         code is necessary on the stack to access the instance to a local
1568         variable (the variable will be accessed as a field).
1569
1570         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
1571         EmitContext.EmitAddressOfParameter): Routines to support
1572         parameters (not completed at this point). 
1573         
1574         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
1575         will also remove the parameters.
1576
1577         * convert.cs (Convert): Define a `ConstantEC' which points to a
1578         null.  This is just to prefity some code that uses
1579         ImplicitStandardConversion code and do not have an EmitContext
1580         handy.
1581
1582         The idea is to flag explicitly that at that point in time, it is
1583         known that the conversion will not trigger the delegate checking
1584         code in implicit conversions (which requires a valid
1585         EmitContext). 
1586
1587         Everywhere: pass new EmitContext parameter since
1588         ImplicitStandardConversionExists now requires it to check for
1589         anonymous method conversions. 
1590
1591         (Convert.ImplicitStandardConversionExists): If the type of an
1592         expression is the anonymous_method_type, and the type is a
1593         delegate, we invoke the AnonymousMethod.Compatible method to check
1594         whether an implicit conversion is possible. 
1595
1596         (Convert.ImplicitConversionStandard): Only do implicit method
1597         group conversions if the language level is not ISO_1.
1598
1599         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
1600         MethodInfo for the Invoke method.  used by Delegate and
1601         AnonymousDelegate.
1602
1603         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
1604         method conversions if the target type is a delegate.
1605
1606         Removed extra debugging nops.
1607
1608         (LocalVariableReference): Turn the `local_info' into a public
1609         field. 
1610
1611         Add `prepared' field, the same hack used for FieldExprs to cope
1612         with composed assignments, as Local variables do not necessarily
1613         operate purely on the stack as they used to: they can be captured
1614         fields. 
1615
1616         Add `temp' for a temporary result, like fields.
1617
1618         Refactor DoResolve and DoResolveLValue into DoResolveBase.
1619
1620         It now copes with Local variables that are captured and emits the
1621         proper instance variable to load it from a field in the captured
1622         case. 
1623
1624         (ParameterReference.DoResolveBase): During the resolve phase,
1625         capture parameters if we are in an anonymous method.
1626
1627         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
1628         anonymous method, use the EmitContext helper routines to emit the
1629         parameter reference.
1630
1631         * iterators.cs: Set RemapToProxy to true/false during the
1632         EmitDispose class.
1633
1634         * parameters.cs (GetParameterByName): New helper method. 
1635
1636         * typemanager.cs (anonymous_method_type) a new type that
1637         represents an anonyous method.  This is always an internal type,
1638         used as a fencepost to test against the anonymous-methodness of an
1639         expression. 
1640         
1641 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
1642
1643         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
1644         561 report.
1645         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
1646
1647 2004-11-10  Martin Baulig  <martin@ximian.com>
1648
1649         * expression.cs (Invocation.BetterFunction): If two methods have
1650         equal parameter types, but only one of them is generic, the
1651         non-generic one wins.
1652         (New.DoResolve): Don't set `is_struct' to false if we're a generic
1653         instance; just use `Type.IsValueType' to determine whether
1654         something is a struct or not.
1655         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
1656         so we can be called multiple times.
1657
1658 2004-11-10  Martin Baulig  <martin@ximian.com>
1659
1660         * generic.cs (TypeParameter.DefineConstraints): New public method.
1661         (TypeParameter.CheckAccessLevel): Override this and return true.
1662         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
1663         override ResolveType() anymore.
1664         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
1665
1666 2004-11-10  Martin Baulig  <martin@ximian.com>
1667
1668         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
1669         call DeclSpace.ResolveNestedType() on it.
1670
1671 2004-11-10  Martin Baulig  <martin@ximian.com>
1672
1673         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
1674         non-null, call ParameterModifier() on it.
1675
1676 2004-11-10  Martin Baulig  <martin@ximian.com>
1677
1678         * iterators.cs
1679         (Iterators): Added `current_type' and `this_type' fields.
1680         (Iterators.DefineIterator): Create a new EmitContext and store it
1681         in `ec'; compute `this_type'.
1682
1683 2004-11-10  Martin Baulig  <martin@ximian.com>
1684
1685         * typemanager.cs
1686         (TypeManager.IsPrivateAccessible): New public method.
1687         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
1688
1689 2004-11-10  Martin Baulig  <martin@ximian.com>
1690
1691         * class.cs (TypeContainer.DefineType): Call
1692         TypeBuilder.DefineGenericParameters() before resolving the type
1693         parameters.
1694         (MethodData.parent_method): New protected field.
1695         (MethodData..ctor): Added `MethodInfo parent_method' argument.
1696         (MethodData.Define): Compute `parent_method'.
1697
1698         * decl.cs
1699         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
1700         (MemberCore.GetClsCompliantAttributeValue): Likewise.
1701         (DeclSpace.ec): New protected field; store the EmitContext here.
1702         (DeclSpace.EmitContext): New public property.
1703         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
1704         (DeclSpace.ResolveNestedType): New public method.
1705         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
1706         (DeclSpace.NestedAccessible): Added `Type tb' argument.
1707         (DeclSpace.FamilyAccessible): Likewise.
1708         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
1709         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
1710         EmitContext.
1711
1712         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
1713         field.
1714
1715         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
1716         (Enum.Emit): Don't create a new EmitContext.
1717
1718 2004-10-18  Martin Baulig  <martin@ximian.com>
1719
1720         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
1721         `Type' directly, but call ResolveType() on it.
1722         (Catch.Resolve): Likewise.
1723         (Foreach.Resolve): Likewise.
1724
1725 2004-10-18  Martin Baulig  <martin@ximian.com>
1726
1727         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
1728         `Type' directly, but call ResolveType() on it.
1729         (Probe.DoResolve): Likewise.
1730         (ArrayCreation.LookupType): Likewise.
1731         (TypeOf.DoResolve): Likewise.
1732         (SizeOf.DoResolve): Likewise.
1733
1734 2004-10-18  Raja R Harinath  <rharinath@novell.com>
1735
1736         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
1737         the ResolveType.
1738
1739 2004-10-17  John Luke  <john.luke@gmail.com>
1740
1741         * class.cs (Operator.GetSignatureForError): use CSharpName
1742
1743         * parameter.cs (Parameter.GetSignatureForError): Returns
1744         correct name even if was not defined.
1745
1746 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1747
1748         Fix #65816.
1749         * class.cs (TypeContainer.EmitContext): New property.
1750         (DefineNestedTypes): Create an emitcontext for each part.
1751         (MethodCore.DoDefineParameters): Use container's emitcontext.
1752         Pass type array to InternalParameters.
1753         (MemberBase.DoDefine): Use container's emitcontext.
1754         (FieldMember.Define): Likewise.
1755         (Event.Define): Likewise.
1756         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1757         Pass type array to InternalParameters.
1758         (SetIndexerMethod.GetParameterInfo): Likewise.
1759         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1760         * delegate.cs (Define): Pass emitcontext to
1761         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1762         array to InternalParameters.
1763         * expression.cs (ParameterReference.DoResolveBase): Pass
1764         emitcontext to GetParameterInfo.
1765         (ComposedCast.DoResolveAsTypeStep): Remove check on
1766         ec.ResolvingTypeTree.
1767         * parameter.cs (Parameter.Resolve): Change argument to
1768         EmitContext.  Use ResolveAsTypeTerminal.
1769         (Parameter.GetSignature): Change argument to EmitContext.
1770         (Parameters.ComputeSignature): Likewise.
1771         (Parameters.ComputeParameterTypes): Likewise.
1772         (Parameters.GetParameterInfo): Likewise.
1773         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1774         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1775         * support.cs (InternalParameters..ctor): Remove variant that takes
1776         a DeclSpace.
1777         * typemanager.cs (system_intptr_expr): New.
1778         (InitExpressionTypes): Initialize it.
1779
1780 2004-10-12  Chris Toshok  <toshok@ximian.com>
1781
1782         * cs-parser.jay: fix location for try_statement and catch_clause.
1783
1784 2004-10-18  Martin Baulig  <martin@ximian.com>
1785
1786         * class.cs (FieldMember.Define): Don't access the TypeExpr's
1787         `Type' directly, but call ResolveType() on it.
1788         (MemberBase.DoDefine): Likewise.
1789
1790         * expression.cs (New.DoResolve): Don't access the TypeExpr's
1791         `Type' directly, but call ResolveType() on it.
1792         (ComposedCast.DoResolveAsTypeStep): Likewise.
1793
1794         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
1795         `Type' directly, but call ResolveType() on it.
1796
1797 2004-10-17  John Luke  <john.luke@gmail.com>
1798
1799         * class.cs (Operator.GetSignatureForError): use CSharpName
1800
1801         * parameter.cs (Parameter.GetSignatureForError): Returns
1802         correct name even if was not defined.
1803
1804 2004-10-13  Raja R Harinath  <rharinath@novell.com>
1805
1806         Fix #65816.
1807         * class.cs (TypeContainer.EmitContext): New property.
1808         (DefineNestedTypes): Create an emitcontext for each part.
1809         (MethodCore.DoDefineParameters): Use container's emitcontext.
1810         Pass type array to InternalParameters.
1811         (MemberBase.DoDefine): Use container's emitcontext.
1812         (FieldMember.Define): Likewise.
1813         (Event.Define): Likewise.
1814         (SetMethod.GetParameterInfo): Change argument to EmitContext.
1815         Pass type array to InternalParameters.
1816         (SetIndexerMethod.GetParameterInfo): Likewise.
1817         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
1818         * delegate.cs (Define): Pass emitcontext to
1819         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
1820         array to InternalParameters.
1821         * expression.cs (ParameterReference.DoResolveBase): Pass
1822         emitcontext to GetParameterInfo.
1823         (ComposedCast.DoResolveAsTypeStep): Remove check on
1824         ec.ResolvingTypeTree.
1825         * parameter.cs (Parameter.Resolve): Change argument to
1826         EmitContext.  Use ResolveAsTypeTerminal.
1827         (Parameter.GetSignature): Change argument to EmitContext.
1828         (Parameters.ComputeSignature): Likewise.
1829         (Parameters.ComputeParameterTypes): Likewise.
1830         (Parameters.GetParameterInfo): Likewise.
1831         (Parameters.ComputeAndDefineParameterTypes): Likewise.
1832         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
1833         * support.cs (InternalParameters..ctor): Remove variant that takes
1834         a DeclSpace.
1835         * typemanager.cs (system_intptr_expr): New.
1836         (InitExpressionTypes): Initialize it.
1837
1838 2004-10-12  Chris Toshok  <toshok@ximian.com>
1839
1840         * cs-parser.jay: fix location for try_statement and catch_clause.
1841
1842 2004-10-07  Raja R Harinath  <rharinath@novell.com>
1843
1844         More DeclSpace.ResolveType avoidance.
1845         * decl.cs (MemberCore.InUnsafe): New property.
1846         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
1847         with newly created EmitContext.
1848         (FieldMember.Define): Likewise.
1849         * delegate.cs (Delegate.Define): Likewise.
1850         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
1851         only if normal name-lookup fails.
1852         (TypeExpr.DoResolve): Enable error-checking.
1853         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
1854         (SizeOf.DoResolve): Likewise.
1855         (ComposedCast.DoResolveAsTypeStep): Likewise.
1856         (StackAlloc.DoResolve): Likewise.
1857         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
1858         (Block.Unsafe): New property.
1859         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
1860         (Unsafe): Set 'unsafe' flag of contained block.
1861         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
1862         (Fixed.Resolve): Likewise.
1863         (Catch.Resolve): Likewise.
1864         (Using.ResolveLocalVariableDecls): Likewise.
1865         (Foreach.Resolve): Likewise.
1866
1867 2004-10-05  John Luke <john.luke@gmail.com>
1868
1869         * cs-parser.jay: add location to error CS0175
1870
1871 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
1872
1873         * ecore.cs (Expression.Constantity): Add support for turning null
1874         into a constant.
1875
1876         * const.cs (Const.Define): Allow constants to be reference types
1877         as long as the value is Null.
1878
1879 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
1880
1881         * namespace.cs (NamespaceEntry.Using): No matter which warning
1882         level is set, check if this namespace name has already been added.
1883
1884 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
1885
1886         * expression.cs: reftype [!=]= null should always use br[true,false].
1887         # 67410
1888
1889 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
1890
1891         Fix #67108
1892         * attribute.cs: Enum conversion moved to 
1893         GetAttributeArgumentExpression to be applied to the all
1894         expressions.
1895
1896 2004-10-01  Raja R Harinath  <rharinath@novell.com>
1897
1898         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
1899         * class.c (TypeContainer.DefineType): Flag error if
1900         base types aren't accessible due to access permissions.
1901         * decl.cs (DeclSpace.ResolveType): Move logic to
1902         Expression.ResolveAsTypeTerminal.
1903         (DeclSpace.ResolveTypeExpr): Thin layer over
1904         Expression.ResolveAsTypeTerminal.
1905         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
1906         Refactor code into NestedAccess.  Use it.
1907         (DeclSpace.NestedAccess): New.
1908         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
1909         argument to silence errors.  Check access permissions.
1910         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
1911         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
1912         (Cast.DoResolve): Likewise.
1913         (New.DoResolve): Likewise.
1914         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
1915         (TypeOf.DoResolve): Likewise.
1916
1917         * expression.cs (Invocation.BetterConversion): Return the Type of
1918         the better conversion.  Implement section 14.4.2.3 more faithfully.
1919         (Invocation.BetterFunction): Make boolean.  Make correspondence to
1920         section 14.4.2.2 explicit.
1921         (Invocation.OverloadResolve): Update.
1922         (Invocation): Remove is_base field.
1923         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
1924         (Invocation.Emit): Likewise.
1925
1926 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
1927
1928         * cs-parser.jay: Reverted 642 warning fix.
1929
1930 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1931
1932         Fix bug #66615
1933         * decl.cs (FindMemberWithSameName): Indexer can have more than
1934         1 argument.
1935
1936 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1937
1938         * expression.cs (LocalVariableReference.DoResolveLValue):
1939         Do not report warning 219 for out values.
1940         (EmptyExpression.Null): New member to avoid extra allocations.
1941
1942 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
1943
1944         * cs-parser.jay: Fix wrong warning 642 report.
1945
1946         * cs-tokenizer.cs (CheckNextToken): New helper;
1947         Inspect next character if is same as expected.
1948
1949 2004-09-23  Martin Baulig  <martin@ximian.com>
1950
1951         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
1952         (Convert.ImplicitReferenceConversionExists): Likewise.
1953
1954 2004-11-09  Raja R Harinath  <rharinath@novell.com>
1955
1956         * Makefile (DISTFILES): Comment out a few missing files.
1957
1958 2004-10-29  Raja R Harinath  <rharinath@novell.com>
1959
1960         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
1961         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
1962         (gmcs.exe): Invoke bootstrap-libs.
1963         (clean-local): Clean the net_2_0_bootstrap profile too.
1964         (PROGRAM_INSTALL_DIR): New.
1965         (install-local): Use it.
1966
1967 2004-10-13  Martin Baulig  <martin@ximian.com>
1968
1969         * generic.cs (TypeManager.InflatedConstraints): New nested class.
1970         (TypeParameter.DefineType): If we're a method type parameter and
1971         that method is overriding something, "inflate" its constraints.
1972
1973 2004-10-12  Martin Baulig  <martin@ximian.com>
1974
1975         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
1976         and have type arguments, create and resolve a ConstructedType.
1977
1978 2004-10-12  Martin Baulig  <martin@ximian.com>
1979
1980         * decl.cs (MemberCache.FindMemberToOverride): Use
1981         TypeManager.IsEqual() to compare the parameters and Type.Equals()
1982         to compare the invocationType.
1983
1984         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
1985         When comparing two type parameters, only do the signature-only
1986         comparision for method type parameters.
1987
1988 2004-10-11  Martin Baulig  <martin@ximian.com>
1989
1990         * report.cs: Don't make --fatal abort on warnings, we have
1991         -warnaserror for that.
1992
1993 2004-10-11  Martin Baulig  <martin@ximian.com>
1994
1995         * typemanager.cs
1996         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
1997         (TypeManager.IsEqual): Call ourself recursively instead of using
1998         Type.IsEqual(). 
1999
2000 2004-10-11  Martin Baulig  <martin@ximian.com>
2001
2002         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2003         on our own type parameters, not on the ones we inherit from a containing
2004         class.
2005
2006         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2007         the comparision.
2008
2009         * generic.cs (TypeParameter.Define): We may only be called once.
2010
2011         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2012         instead of TypeManager.IsEqual().
2013
2014 2004-09-28  Martin Baulig  <martin@ximian.com>
2015
2016         * generic.cs
2017         (GenericConstraints.EffectiveBaseClass): New public property.
2018         (TypeParameter.GenericConstraints): New public property.
2019         (ConstructedType.CheckConstraints): Improved.
2020
2021         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2022         (Convert.TypeParameterConversion): New private method; use this in
2023         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2024         for all conversions related to type parameters.
2025
2026 2004-09-24  Martin Baulig  <martin@ximian.com>
2027
2028         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2029         type parameter conversions for type parameters which are known to
2030         be reference types.
2031
2032 2004-09-24  Martin Baulig  <martin@ximian.com>
2033
2034         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2035         `IsValueType' properties.
2036
2037         * support.cs (ReflectionConstraints): Use
2038         Type.GetGenericParameterConstraints() instead of the old hack.
2039
2040 2004-09-24  Martin Baulig  <martin@ximian.com>
2041
2042         * generic.cs (GenericConstraints): Moved here and made it an
2043         abstract class.
2044
2045         * support.cs (GenericConstraints): Moved to generic.cs.
2046
2047 2004-09-24  Martin Baulig  <martin@ximian.com>
2048
2049         * support.cs
2050         (ReflectionConstraints): Un-nested this class and made it public.
2051
2052         * typemanager.cs
2053         (TypeManager.GetTypeParameterConstraints): New public method.
2054         (TypeManager.HasConstructorConstraint): Use the attributes.
2055
2056 2004-09-24  Martin Baulig  <martin@ximian.com>
2057
2058         * support.cs (GenericConstraints): Replaced `HasConstructor',
2059         `IsReferenceType' and `IsValueType' with `Attributes'.
2060         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2061         method and made the .ctor public.
2062
2063         * generic.cs (Constraints.Attributes): New public property.
2064         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2065         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2066         `IsValueType' -> `HasValueTypeConstraint'.
2067
2068 2004-09-23  Martin Baulig  <martin@ximian.com>
2069
2070         * generic.cs (Constraints): Reflect latest runtime changes.
2071
2072 2004-09-23  Martin Baulig  <martin@ximian.com>
2073
2074         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2075         (Convert.ImplicitReferenceConversionExists): Likewise.
2076
2077 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2078
2079         * class.cs (Operator.Define): Add error 448 and 559 report.
2080         
2081 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2082
2083         * class.cs (MemberBase.IsTypePermitted): New protected
2084         method for checking error CS0610.
2085
2086 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2087
2088         * class.cs (TypeContainer.HasExplicitLayout): New property
2089         Returns whether container has StructLayout attribute set Explicit.
2090         (FieldMember): New abstract class for consts and fields.
2091         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2092         (Field): Reuse FieldMember.
2093
2094         * const.cs (Const): Reuse FieldMember.
2095
2096         * rootcontext.cs: EmitConstants call moved to class.
2097
2098 2004-09-22  Martin Baulig  <martin@ximian.com>
2099
2100         Marek and me just fixed one of our oldest bugs: #28562 :-)
2101
2102         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2103
2104         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2105         we're an EnumConstant, just return that.
2106         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2107         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2108         to get the value which'll actually be written into the attribute.
2109         However, we have to use GetValue() to access the attribute's value
2110         in the compiler.        
2111
2112 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2113
2114         * constant.cs (Constant.IsNegative): New abstract property
2115         IsNegative.
2116
2117         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2118         (StackAlloc.DoResolve): Reused IsNegative.
2119
2120 2004-09-22  Martin Baulig  <martin@ximian.com>
2121
2122         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2123         public method; like LookupTypeContainer, but also works for
2124         generic instances.
2125
2126         * report.cs (Report.SymbolRelatedToPreviousError): Use
2127         TypeManager.LookupGenericTypeContainer().       
2128
2129 2004-09-22  Martin Baulig  <martin@ximian.com>
2130
2131         Thanks to Peter Sestoft for this bug report.
2132
2133         * expression.cs (Conditional): If both the `trueExpr' and the
2134         `falseExpr' is a NullLiteral, return a NullLiteral.
2135
2136 2004-09-22  Martin Baulig  <martin@ximian.com>
2137
2138         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2139         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2140         for the "get_Current" call.
2141
2142 2004-09-21  Martin Baulig  <martin@ximian.com>
2143
2144         * convert.cs (Convert.ImplicitReferenceConversion): When
2145         converting to an interface type, first check whether we're
2146         converting from a reference type.
2147
2148 2004-09-14  Martin Baulig  <martin@ximian.com>
2149
2150         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2151
2152 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2153
2154         Fixed bug #61902
2155         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2156         called and is obsolete then this member suppress message
2157         when call is inside next [Obsolete] method or type.
2158
2159         * expression.cs: Use TestObsoleteMethodUsage member.
2160
2161 2004-09-14  Martin Baulig  <martin@ximian.com>
2162
2163         * genericparser.cs: Removed.
2164
2165 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2166
2167         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2168
2169 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2170
2171         * attribute.cs (Attribute.Resolve): Add error 653 report.
2172
2173         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2174         report.
2175         (Method.ApplyAttributeBuilder): Add error 685 report.
2176         (Operator.Define): Add error 564 report.
2177
2178         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2179
2180         * expression.cs (Invocation.DoResolve): Add error
2181         245 and 250 report.
2182
2183         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2184         error 674 report.
2185
2186 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2187
2188         * class.cs (ConstructorInitializer.Resolve):
2189         Wrong error number (515->516).
2190
2191 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2192
2193         * class.cs (Indexer.Define): Add error 631 report.
2194
2195 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2196
2197         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2198
2199 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2200
2201         * expression.cs (Probe.DoResolve): Add error CS0241 report.
2202
2203 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
2204
2205         * cs-parser.jay: Added error CS0241 report.
2206
2207 2004-09-10  Raja R Harinath  <rharinath@novell.com>
2208
2209         * cs-parser.jay (fixed_statement): Introduce a scope for the
2210         declaration in the 'fixed' statement.
2211
2212 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2213
2214         * cs-parser.jay: Added CS0230 error report.
2215
2216 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2217
2218         * cs-parser.jay: Added errors CS0231 and CS0257 report.
2219
2220 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2221
2222         * expression.cs (Argument.Resolve): Added error CS0192 and
2223         CS0199 report.
2224
2225 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
2226
2227         C# 2.0 #pragma warning feature
2228
2229         * cs-tokenizer.cs (PreProcessPragma): New method; 
2230         Handles #pragma directive.
2231
2232         * report.cs (WarningRegions): New class; Support
2233         class for #pragma warning directive. It tests whether
2234         warning is enabled for a given line.
2235
2236 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
2237
2238         * const.cs: Add more descriptive error report, tahnks to
2239         Sebastien. 
2240
2241 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
2242
2243         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2244
2245 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
2246
2247         * expression.cs: Apply patch from Ben: Remove dead code from
2248         ArrayCreation, and remove the TurnintoConstant call in const.cs,
2249         as that code just threw an exception anwyays.
2250
2251         * const.cs: Remove the call to the turnintoconstant, for details
2252         see bug: #63144
2253         
2254         * literal.cs: The type of the null-literal is the null type;  So
2255         we use a placeholder type (literal.cs:System.Null, defined here)
2256         for it.
2257
2258         * expression.cs (Conditional.DoResolve): Remove some old code that
2259         is no longer needed, conversions have been fixed.
2260
2261         (ArrayCreationExpression.DoResolve): Return false if we fail to
2262         resolve the inner expression.
2263
2264 2004-09-07  Raja R Harinath  <rharinath@novell.com>
2265
2266         Fix test-290.cs.
2267         * cs-parser.jay (delegate_declaration): Record a delegate
2268         declaration as a type declaration.
2269         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2270
2271 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
2272
2273         * parameter.cs: Do not crash if the type can not be resolved. 
2274
2275         * expression.cs: Report errors with unsafe pointers, fixes #64896
2276
2277 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
2278
2279         * expression.cs: Pointer arith always needs to do a conv.i
2280         if the operand is a long. fix 65320
2281
2282 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2283
2284         Fixed cs0619-37.cs, cs0619-38.cs
2285
2286         * enum.cs (GetObsoleteAttribute): Removed.
2287
2288         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2289         on Enum member is double staged. The first is tested member
2290         and then enum.
2291
2292 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
2293
2294         Fixed #56986, #63631, #65231
2295
2296         * class.cs: (TypeContainer.AddToMemberContainer): New method,
2297         adds member to name container.
2298         (TypeContainer.AddToTypeContainer): New method, adds type to
2299         name container.
2300         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2301         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2302         AddOperator): Simplified by reusing AddToMemberContainer.
2303         (TypeContainer.UserDefinedStaticConstructor): Changed to property
2304         instead of field.
2305         (Method.CheckForDuplications): Fixed implementation to test all
2306         possibilities.
2307         (MemberBase): Detection whether member is explicit interface
2308         implementation is now in constructor.
2309         (MemberBase.UpdateMemberName): Handles IndexerName.
2310         (Accessor): Changed to keep also location information.
2311         (AbstractPropertyEventMethod): Is derived from MemberCore.
2312         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2313         will be emited or not.
2314         (PropertyBase.AreAccessorsDuplicateImplementation):
2315         Tests whether accessors are not in collision with some method.
2316         (Operator): Is derived from MethodCore to simplify common
2317         operations.
2318
2319         * decl.cs (Flags.TestMethodDuplication): Test for duplication
2320         must be performed.
2321         (DeclSpace.AddToContainer): Adds the member to defined_names
2322         table. It tests for duplications and enclosing name conflicts.
2323
2324         * enum.cs (EnumMember): Clean up to reuse the base structures
2325
2326 2004-09-03  Martin Baulig  <martin@ximian.com>
2327
2328         Merged latest changes into gmcs.  Please keep this comment in
2329         here, it makes it easier for me to see what changed in MCS since
2330         the last time I merged.
2331
2332 2004-09-03  Martin Baulig  <martin@ximian.com>
2333
2334         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2335         into TypeContainer, to make partial classes work again.
2336
2337 2004-09-03  Martin Baulig  <martin@ximian.com>
2338
2339         * rootcontext.cs (RootContext.V2): Removed.
2340
2341 2004-03-23  Martin Baulig  <martin@ximian.com>
2342
2343         * expression.cs (Invocation.OverloadResolve): Added `bool
2344         may_fail' argument and use it instead of the Location.IsNull() hack.
2345
2346 2004-09-09  Martin Baulig  <martin@ximian.com>
2347
2348         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2349
2350 2004-09-09  Martin Baulig  <martin@ximian.com>
2351
2352         * generic.cs (TypeParameter.DefineType): Added support for
2353         explicit interface methods.
2354
2355 2004-09-09  Martin Baulig  <martin@ximian.com>
2356
2357         * README.Changes: New document.  Started to list important changes
2358         between MCS and GMCS here.
2359
2360 2004-09-08  Martin Baulig  <martin@ximian.com>
2361
2362         * class.cs
2363         (TypeContainer.CheckRecursiveDefinition): New protected method.
2364         (TypeContainer.DefineType): Move the CS0146 check into
2365         CheckRecursiveDefinition().     
2366
2367 2004-09-06  Martin Baulig  <martin@ximian.com>
2368
2369         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2370         types for the constructor constraint.
2371
2372 2004-09-03  Martin Baulig  <martin@ximian.com>
2373
2374         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2375         into TypeContainer, to make partial classes work again.
2376
2377 2004-09-03  Martin Baulig  <martin@ximian.com>
2378
2379         * rootcontext.cs (RootContext.V2): Removed.
2380
2381 2004-03-23  Martin Baulig  <martin@ximian.com>
2382
2383         * expression.cs (Invocation.OverloadResolve): Added `bool
2384         may_fail' argument and use it instead of the Location.IsNull() hack.
2385
2386 2004-09-03  Martin Baulig  <martin@ximian.com>
2387
2388         Merged latest changes into gmcs.  Please keep this comment in
2389         here, it makes it easier for me to see what changed in MCS since
2390         the last time I merged.
2391
2392 2004-09-03  Raja R Harinath  <rharinath@novell.com>
2393
2394         Fix #61128.
2395         * expression.cs (BetterConversion): Don't allow either conversion 
2396         to be null.  Remove redundant implicit conversion test when 'q ==
2397         null' -- when this function is invoked, we already know that the
2398         implicit conversion exists.
2399         (BetterFunction): Assume that 'best' is non-null.  Remove
2400         redundant reimplementation of IsApplicable when 'best' is null.
2401         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2402         number of arguments.
2403         (IsAncestralType): Extract from OverloadResolve.
2404         (OverloadResolve): Make robust to the MethodGroupExpr being
2405         unsorted.  Implement all the logic of Section 14.5.5.1, and
2406         support overloading of methods from multiple applicable types.
2407         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
2408
2409         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2410         (RealError, Warning): Append type of report to related symbol.
2411
2412 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
2413
2414         * enum.cs: Fixed CLS-Compliance checks for enum members.
2415         Error tests cs3008-8.cs, cs3014-8.cs
2416
2417 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2418
2419         Fixed bug #62342, #63102
2420         * class.cs: ImplementIndexer uses member.IsExplicitImpl
2421         like ImplementMethod.
2422
2423 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
2424
2425         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2426         Fixed bug #65170.
2427
2428 2004-09-02  Martin Baulig  <martin@ximian.com>
2429
2430         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2431         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2432         on the MethodBase.
2433
2434 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
2435
2436         C# 2.0 Static classes implemented
2437
2438         * class.cs (TypeContainer): instance_constructors,
2439         initialized_fields, initialized_static_fields,
2440         default_constructor, base_inteface_types are protected to be
2441         accessible from StaticClass.
2442         (TypeContainer.DefineDefaultConstructor): New virtual method
2443         for custom default constructor generating
2444         (StaticClass): New class to handle "Static classes" feature.
2445
2446         * cs-parser.jay: Handle static keyword on class like instance
2447         of StaticClass.
2448
2449         * driver.cs: Added "/langversion" command line switch with two
2450         options (iso-1, default).
2451
2452 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
2453
2454         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2455
2456 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
2457
2458         * delegate.cs: Style.
2459
2460 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
2461
2462         * delegate.cs: Add seperate instance expr field for miguel.
2463
2464 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2465
2466         * PointerArithmetic (Resolve): make sure we are not doing
2467         pointer arith on void*. Also, make sure we are resolved
2468         by not setting eclass until resolve.
2469
2470         All callers: Make sure that PointerArithmetic gets resolved.
2471
2472 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
2473
2474         * ArrayCreation (LookupType): If the type does not resolve 
2475         to an array, give an error.
2476
2477 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
2478
2479         * statement.cs (Try.Resolve): Fixed bug #64222
2480
2481 2004-08-27  Martin Baulig  <martin@ximian.com>
2482
2483         * class.cs
2484         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2485         crash here.     
2486
2487 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2488
2489         * ecore.cs (Constantify): Get underlying type via
2490         System.Enum.GetUnderlyingType to avoid StackOverflow on the
2491         Windows in special cases.
2492
2493 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
2494
2495         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
2496         for obtaining also private methods.
2497         (GetRemoveMethod): Used GetRemoveMethod (true)
2498         for obtaining also private methods.
2499
2500 2004-09-02  Martin Baulig  <martin@ximian.com>
2501
2502         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2503         TypeManager.GetArgumentTypes() rather than calling GetParameters()
2504         on the MethodBase.
2505
2506 2004-08-27  Martin Baulig  <martin@ximian.com>
2507
2508         * class.cs
2509         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
2510         crash here.     
2511
2512 2004-08-25  Martin Baulig  <martin@ximian.com>
2513
2514         * support.cs (ReflectionParameters..ctor): If this is a generic
2515         method, retrieve and store its type parameters.
2516         (InternalParameters..ctor): Added `TypeParameter[]' argument.
2517         (ReflectionParameters.GenericConstraints): The argument specifies
2518         the type parameter, not the method parameter.
2519         (InternalParameters.GenericConstraints): Likewise.
2520
2521         * generic.cs (TypeParameter.DefineType): Correctly handle
2522         constraints wrt. generic methods in interfaces and their
2523         implementations.        
2524
2525 2004-08-24  Martin Baulig  <martin@ximian.com>
2526
2527         * generic.cs (TypeParameter.IsSubclassOf): New public method.
2528         (Constraints.IsSubclassOf): New internal method.
2529
2530         * typemanager.cs (TypeManager.FindMembers): Added special support
2531         for GenericTypeParameterBuilder's.      
2532         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
2533         type parameters.
2534
2535 2004-08-24  Martin Baulig  <martin@ximian.com>
2536
2537         * typemanager.cs
2538         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2539         this for accessibility checks.
2540         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
2541         IsNestedFamilyAccessible.
2542         (TypeManager.IsSubclassOf): New method, do what the name actually
2543         says.   
2544
2545 2004-08-24  Martin Baulig  <martin@ximian.com>
2546
2547         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
2548         as a SimpleName, include the generic arity.
2549
2550 2004-08-24  Martin Baulig  <martin@ximian.com>
2551
2552         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
2553         MethodAttributes.HideBySig for operators.
2554
2555 2004-08-23  Martin Baulig  <martin@ximian.com>
2556
2557         Back to the old error reporting system :-)
2558
2559         * report.cs (Message): Removed.
2560         (Report.MessageData, ErrorData, WarningData): Removed.
2561         (Report.Error, Warning): Back to the old system.
2562
2563 2004-08-23  Martin Baulig  <martin@ximian.com>
2564
2565         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
2566
2567         * class.cs (TypeContainer.ParentContainer): New public virtual
2568         method; replaces the explicit interface implementation.
2569         (ClassPart.ParentContainer): Override.
2570
2571 2004-08-23  Martin Baulig  <martin@ximian.com>
2572
2573         * statement.cs (Switch): Added support for constant switches; see
2574         #59428 or test-285.cs.
2575
2576 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2577
2578         Fixed bug #62740.
2579         * statement.cs (GetEnumeratorFilter): Removed useless
2580         logic because C# specs is strict. GetEnumerator must be
2581         public.
2582
2583 2004-08-22  Martin Baulig  <martin@ximian.com>
2584
2585         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2586         a switch and may break, reset the barrier.  Fixes #59867.
2587
2588 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
2589
2590         CLS-Compliance speed up (~5% for corlib)
2591
2592         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
2593         New method. Tests container for CLS-Compliant names
2594
2595         * class.cs (TypeContainer.VerifyClsName): New method.
2596         Checks whether container name is CLS Compliant.
2597         (Constructor): Implements IMethodData.
2598
2599         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
2600         low-case table for CLS Compliance test.
2601         (MemberCache.VerifyClsParameterConflict): New method.
2602         Checks method parameters for CS3006 error.
2603
2604         * enum.cs (EnumMember): Is derived from MemberCore.
2605         (Enum.VerifyClsName): Optimized for better performance.
2606
2607 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2608
2609         * report.cs: Renamed Error_T to Error and changed all
2610         references.
2611
2612 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
2613
2614         * class.cs (TypeContainer.IndexerArrayList): New inner class
2615         container for indexers.
2616         (TypeContainer.DefaultIndexerName): New constant for default
2617         indexer name. Replaced all "Item" with this constant.
2618         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
2619
2620         * typemanager.cs (TypeManager.default_member_ctor): Cache here
2621         DefaultMemberAttribute constructor.
2622
2623 2004-08-05  Martin Baulig  <martin@ximian.com>
2624
2625         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2626         Fix bug #59429.
2627
2628 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
2629
2630         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
2631         multi platforms problem.
2632
2633         * compiler.csproj: Included shared files.
2634
2635 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2636
2637         Fix bug 60333, 55971 in the more general way
2638         * attribute.cs (Attribute.GetAttributeArgumentExpression):
2639         Added arg_type argument for constant conversion.
2640         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
2641
2642 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2643
2644         Fix bug #59760
2645         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
2646         OperatorArrayList, MethodCoreArrayList for typecontainer
2647         containers. Changed class member types to these new types.
2648         (MethodArrayList.DefineMembers): Added test for CS0659.
2649
2650 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
2651
2652         * cfold.cs: Synchronize the folding with the code in expression.cs
2653         Binary.DoNumericPromotions for uint operands.
2654
2655         * attribute.cs: Revert patch from Raja, it introduced a regression
2656         while building Blam-1.2.1 (hard to isolate a test case).
2657
2658 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
2659
2660         Fix for #55382
2661         * class.cs:
2662         (TypeContainer.Define): Renamed to DefineContainerMembers because of
2663         name collision.
2664         (MethodCore.parent_method): New member. The method we're overriding
2665         if this is an override method.
2666         (MethodCore.CheckBase): Moved from Method class and made common.
2667         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
2668         private.
2669         (MethodCore.CheckForDuplications): New abstract method. For custom
2670         member duplication search in a container
2671         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
2672         method and its return type.
2673         (Event.conflict_symbol): New member. Symbol with same name in the
2674         parent class.
2675
2676         * decl.cs:
2677         (MemberCache.FindMemberWithSameName): New method. The method
2678         is looking for conflict with inherited symbols.
2679
2680 2004-08-04  Martin Baulig  <martin@ximian.com>
2681
2682         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2683
2684         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2685
2686 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2687
2688         * report.cs (Message): New enum for better error, warning reference in
2689         the code.
2690         (MessageData): New inner abstract class. It generally handles printing of
2691         error and warning messages.
2692         Removed unused Error, Warning, Message methods.
2693
2694 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2695
2696         Fix for cs0592-8.cs test
2697         * attribute.cs
2698         (Attributable.ValidAttributeTargets): Made public.
2699         (Attribute.ExplicitTarget): New member for explicit target value.
2700         (Attribute.CheckTargets): Now we translate explicit attribute
2701         target to Target here.
2702
2703 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
2704
2705         * ecore.cs (MethodGroupExpr): new IsBase property.
2706
2707         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
2708
2709         * delegate.cs (DelegateCreation): store a MethodGroupExpr
2710         rather than an instance expr.
2711
2712         (DelegateCreation.Emit): Use the method group rather than
2713         the instance expression. Also, if you have base.Foo as the
2714         method for a delegate, make sure to emit ldftn, not ldftnvirt.
2715
2716         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
2717
2718         (NewDelegate.DoResolve): Only check for the existance of Invoke
2719         if the method is going to be needed. Use MethodGroupExpr.
2720
2721         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
2722
2723         * expression.cs: For pointer arith., make sure to use
2724         the size of the type, not the size of the pointer to
2725         the type.
2726
2727 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
2728
2729         Fix for #60722
2730         * class.cs (Class): Added error CS0502 test.
2731
2732 2004-08-03  John Luke  <jluke@cfl.rr.com>
2733             Raja R Harinath  <rharinath@novell.com>
2734
2735         Fix for #60997.
2736         * attribute.cs (Attribute.complained_before): New flag.
2737         (Attribute.ResolveType, Attribute.Resolve),
2738         (Attribute.DefinePInvokeMethod): Set it.
2739         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
2740         
2741 2004-08-03  Martin Baulig  <martin@ximian.com>
2742
2743         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2744         use a user-defined operator; we still need to do numeric
2745         promotions in case one argument is a builtin type and the other
2746         one has an implicit conversion to that type.  Fixes #62322.
2747
2748 2004-08-18  Martin Baulig  <martin@ximian.com>
2749
2750         * class.cs (Method.Define): Use the correct method name when
2751         creating the MethodBuilder for a generic method.
2752
2753 2004-08-17  Martin Baulig  <martin@ximian.com>
2754
2755         * generic.cs (Constraints): Support type parameter constraints.
2756
2757 2004-08-16  Martin Baulig  <martin@ximian.com>
2758
2759         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
2760         (Token.GENERIC_DIMENSION): New token; this is returned if we
2761         encounter an unbound generic type in a typeof() expression.
2762
2763         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
2764         this token is only generated while parsing a typeof() expression.
2765         (typeof_expression): Removed the old unbound_type hack.
2766
2767         * generic.cs (TypeArguments.IsUnbound): New public property.
2768
2769         * decl.cs (MemberName): Added support for unbound types.
2770
2771 2004-08-14  Martin Baulig  <martin@ximian.com>
2772
2773         * typemanager.cs
2774         (TypeManager.IsEqualGenericInstance): New static method.
2775         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
2776         just used to check accessibility, so follow the rules of 26.1.6.        
2777
2778         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
2779         ConstructedType instead of a TypeExpression if we have type arguments.
2780
2781         * cs-parser.jay (typeof_expression): Support unbound generic types.
2782
2783         * ecore.cs (UnboundTypeExpression): New public class.
2784
2785 2004-08-12  Martin Baulig  <martin@ximian.com>
2786
2787         * typemanager.cs (TypeManager.IsNestedChildOf): Use
2788         TypeManager.IsEqual() rather than `=='.
2789
2790         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
2791         generic instances as well.
2792
2793 2004-08-12  Martin Baulig  <martin@ximian.com>
2794
2795         * expression.cs (Invocation.InferType): We can only infer method
2796         type parameters.  Fixes #62647.
2797
2798 2004-08-11  Martin Baulig  <martin@ximian.com>
2799
2800         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
2801         before resolving the base classes.
2802
2803 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
2804
2805         * Makefile: install .mdb file too.
2806
2807 2004-08-05  Martin Baulig  <martin@ximian.com>
2808
2809         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
2810         initializer, the current type is just the TypeBuilder, not the
2811         instantiated generic type.
2812         (FieldExpr.IsFieldInitializer): New public property.
2813
2814 2004-08-04  Martin Baulig  <martin@ximian.com>
2815
2816         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
2817
2818         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
2819
2820 2004-08-03  Martin Baulig  <martin@ximian.com>
2821
2822         * class.cs (MethodData.Define): If we're an explicit
2823         implementation, remove the generic arity from the type name.
2824
2825 2004-08-03  Martin Baulig  <martin@ximian.com>
2826
2827         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
2828         use a user-defined operator; we still need to do numeric
2829         promotions in case one argument is a builtin type and the other
2830         one has an implicit conversion to that type.  Fixes #62322.
2831
2832 2004-08-02  Martin Baulig  <martin@ximian.com>
2833
2834         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
2835         `TypeExpr[]' array.
2836         (TypeContainer.GetClassBases): Return the unexpanded list of
2837         interfaces; we expand them later.
2838         (TypeContainer.DefineType): After creating the TypeBuilder, call
2839         TypeManager.ExpandInterfaces() to get an expanded and resolved
2840         list of interfaces.
2841
2842         * ecore.cs (TypeExpr.GetInterfaces): Removed
2843
2844         * generics.cs (Constraints.InterfaceConstraints): Remove.
2845         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
2846         register the interface constraints.
2847
2848         * typemanager.cs
2849         (TypeManager.AddUserType): Removed the `ifaces' argument.
2850         (TypeManager.AddTypeParameter): Likewise.
2851         (TypeManager.AddUserInterface): Removed, was unused.
2852         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
2853         `TypeExpr[]' array for the interfaces.
2854         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
2855         has been defined, returns a list of the resolved interfaces types.
2856         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
2857         (TypeManager.GetExplicitInterfaces): Likewise.  
2858
2859 2004-08-02  Martin Baulig  <martin@ximian.com>
2860
2861         * expression.cs (Invocation.EmitCall): If we're invoking a method
2862         on a type parameter, use the new `Constrained' prefix opcode.
2863
2864 2004-08-02  Martin Baulig  <martin@ximian.com>
2865
2866         * statement.cs (LocalInfo.Flags): Added `IsThis'.
2867         (LocalInfo.IsThis): New public property.
2868         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
2869
2870 2004-08-01  Martin Baulig  <martin@ximian.com>
2871
2872         * class.cs (TypeContainer.GetClassBases): Don't set the default
2873         here since we may get called from GetPartialBases().
2874         (TypeContainer.DefineType): If GetClassBases() didn't return a
2875         parent, use the default one.
2876
2877 2004-07-30  Martin Baulig  <martin@ximian.com>
2878
2879         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
2880
2881         * class.cs (SourceMethod): New public class, derive from the
2882         symbol writer's ISourceMethod.
2883         (Method): Use the new symbol writer API.
2884
2885         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
2886         as argument and use the new symbol writer.
2887
2888         * location.cs
2889         (SourceFile): Implement the symbol writer's ISourceFile.
2890         (Location.SymbolDocument): Removed.
2891         (Location.SourceFile): New public property.
2892
2893         * symbolwriter.cs: Use the new symbol writer API.
2894
2895 2004-07-30  Raja R Harinath  <rharinath@novell.com>
2896
2897         * Makefile (install-local): Remove.  Functionality moved to
2898         executable.make.
2899
2900 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
2901
2902         * Makefile: Install mcs.exe.config file together with mcs.exe.
2903         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
2904         correct runtime version.
2905         
2906 2004-07-25  Martin Baulig  <martin@ximian.com>
2907
2908         * class.cs
2909         (TypeContainer.RegisterOrder): Removed, this was unused.
2910         (TypeContainer, interface_order): Removed.
2911         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
2912         TypeContainer as argument since we can also be called with a
2913         `PartialContainer' for a partial class/struct/interface.
2914         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
2915         of checking whether we're an `Interface' - we could be a
2916         `PartialContainer'.
2917         (PartialContainer.Register): Override; call
2918         AddClass()/AddStruct()/AddInterface() on our parent.
2919
2920         * cs-parser.jay (interface_member_declaration): Add things to the
2921         `current_container', not the `current_class'.
2922
2923         * rootcontext.cs (RegisterOrder): The overloaded version which
2924         takes an `Interface' was unused, removed.
2925
2926         * typemanager.cs (TypeManager.LookupInterface): Return a
2927         `TypeContainer', not an `Interface'.
2928         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
2929         contain a `PartialContainer' for an interface, so check it's
2930         `Kind' to figure out what it is.
2931
2932 2004-07-25  Martin Baulig  <martin@ximian.com>
2933
2934         * class.cs (Class.DefaultTypeAttributes): New public constant.
2935         (Struct.DefaultTypeAttributes): Likewise.
2936         (Interface.DefaultTypeAttributes): Likewise.
2937         (PartialContainer.TypeAttr): Override this and add the
2938         DefaultTypeAttributes.
2939
2940 2004-07-25  Martin Baulig  <martin@ximian.com>
2941
2942         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
2943         we can just use the `Parent' field instead.
2944
2945 2004-07-25  Martin Baulig  <martin@ximian.com>
2946
2947         * class.cs (TypeContainer.Emit): Renamed to EmitType().
2948
2949 2004-07-25  Martin Baulig  <martin@ximian.com>
2950
2951         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
2952         our parts before defining any methods.
2953         (TypeContainer.VerifyImplements): Make this virtual.
2954         (ClassPart.VerifyImplements): Override and call VerifyImplements()
2955         on our PartialContainer.
2956
2957 2004-07-25  Martin Baulig  <martin@ximian.com>
2958
2959         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
2960
2961         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
2962         argument, we can just use the `Parent' field instead.
2963
2964         * class.cs
2965         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
2966         (MemberBase.DoDefine): Likewise.
2967
2968 2004-07-24  Martin Baulig  <martin@ximian.com>
2969
2970         * decl.cs (MemberCore.Parent): New public field.
2971         (DeclSpace.Parent): Moved to MemberCore.
2972
2973         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
2974         (MemberBase.ctor): Added TypeContainer argument, pass it to our
2975         parent's .ctor.
2976         (FieldBase, Field, Operator): Likewise.
2977         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
2978         (EventField, Event): Likewise.
2979
2980 2004-07-23  Martin Baulig  <martin@ximian.com>
2981
2982         * class.cs (PartialContainer): New public class.
2983         (ClassPart): New public class.
2984         (TypeContainer): Added support for partial classes.
2985         (TypeContainer.GetClassBases): Splitted some of the functionality
2986         out into GetNormalBases() and GetPartialBases().
2987
2988         * cs-tokenizer.cs (Token.PARTIAL): New token.
2989         (Tokenizer.consume_identifier): Added some hacks to recognize
2990         `partial', but only if it's immediately followed by `class',
2991         `struct' or `interface'.
2992
2993         * cs-parser.jay: Added support for partial clases.
2994
2995 2004-07-23  Martin Baulig  <martin@ximian.com>
2996
2997         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
2998         a `DeclSpace' and also made it readonly.
2999         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3000         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3001         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3002
3003         * cs-parser.jay: Pass the `current_class', not the
3004         `current_container' (at the moment, this is still the same thing)
3005         to a new Method, Property, Event, Indexer or Constructor.
3006
3007 2004-07-23  Martin Baulig  <martin@ximian.com>
3008
3009         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3010         and removed the `current_interface' one.
3011         (struct_declaration, class_declaration, interface_declaration):
3012         Set `current_class' to the newly created class/struct/interface;
3013         set their `Bases' and call Register() before parsing their body.
3014
3015 2004-07-23  Martin Baulig  <martin@ximian.com>
3016
3017         * class.cs (Kind): New public enum.
3018         (TypeContainer): Made this class abstract.
3019         (TypeContainer.Kind): New public readonly field.
3020         (TypeContainer.CheckDef): New public method; moved here from
3021         cs-parser.jay.
3022         (TypeContainer.Register): New public abstract method.
3023         (TypeContainer.GetPendingImplementations): New public abstract
3024         method.
3025         (TypeContainer.GetClassBases): Removed the `is_class' and
3026         `is_iface' parameters.
3027         (TypeContainer.DefineNestedTypes): Formerly known as
3028         DoDefineType().
3029         (ClassOrStruct): Made this class abstract.
3030
3031         * tree.cs (RootTypes): New public type. 
3032
3033 2004-07-20  Martin Baulig  <martin@ximian.com>
3034
3035         * tree.cs (Tree.RecordNamespace): Removed.
3036         (Tree.Namespaces): Removed.
3037
3038         * rootcontext.cs (RootContext.IsNamespace): Removed.
3039
3040         * cs-parser.jay (namespace_declaration): Just create a new
3041         NamespaceEntry here.
3042
3043 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3044
3045         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3046         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3047         entry to make sure it runs in the correct runtime version.
3048         
3049 2004-07-18  Martin Baulig  <martin@ximian.com>
3050
3051         * generic.cs (ConstructedType.CheckConstraints): Improved
3052         constraints checking.
3053
3054 2004-07-18  Martin Baulig  <martin@ximian.com>
3055
3056         * expression.cs (Invocation.BetterMethod): Call
3057         TypeManager.TypeToCoreType() on all types and removed my previous
3058         hack; we're already doig the right thing here.
3059
3060 2004-07-17  Martin Baulig  <martin@ximian.com>
3061
3062         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3063
3064 2004-07-16  Martin Baulig  <martin@ximian.com>
3065
3066         * iterators.cs: Added generics support.
3067
3068 2004-07-16  Martin Baulig  <martin@ximian.com>
3069
3070         * iterators.cs: Rewrote this.  We're now using one single Proxy
3071         class for both the IEnumerable and the IEnumerator interface and
3072         `Iterator' derives from Class so we can use the high-level API.
3073
3074         * class.cs (TypeContainer.AddIterator): New method.
3075         (TypeContainer.DoDefineType): New protected virtual method, which
3076         is called from DefineType().
3077         (TypeContainer.DoDefineMembers): Call DefineType() and
3078         DefineMembers() on all our iterators.
3079         (TypeContainer.Emit): Call Emit() on all our iterators.
3080         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3081
3082         * codegen.cs (EmitContext.CurrentIterator): New public field.
3083
3084 2004-07-15  Martin Baulig  <martin@ximian.com>
3085
3086         * typemanager.cs
3087         (TypeManager.not_supported_exception_type): New type.   
3088
3089 2004-07-14  Martin Baulig  <martin@ximian.com>
3090
3091         * typemanager.cs
3092         (TypeManager.generic_ienumerable_type): New type.
3093         (TypeManager.generic_ienumerator_type): New type.
3094
3095         * rootcontext.cs
3096         (RootContext.interfaces_first_stage): Added
3097         "System.Collections.Generic.IEnumerator`1" and
3098         "System.Collections.Generic.IEnumerable`1".     
3099
3100 2004-07-14  Martin Baulig  <martin@ximian.com>
3101
3102         * iterators.cs: Use real error numbers.
3103
3104 2004-07-14  Martin Baulig  <martin@ximian.com>
3105
3106         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3107         requires this to be a System.Collection.IEnumerable and not a
3108         class implementing that interface.
3109         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3110
3111 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3112
3113         * class.cs: Fixed previous fix, it broke some error tests.
3114
3115 2004-07-12  Martin Baulig  <martin@ximian.com>
3116
3117         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3118         Fixes #61293.
3119
3120 2004-07-14  Martin Baulig  <martin@ximian.com>
3121
3122         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3123         an exclamation mark (!) for the generic arity to reflect the
3124         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3125
3126 2004-07-13  Martin Baulig  <martin@ximian.com>
3127
3128         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3129         specifiers being part of a type argument.
3130
3131 2004-07-13  Martin Baulig  <martin@ximian.com>
3132
3133         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3134         name for generic types.
3135
3136 2004-07-13  Martin Baulig  <martin@ximian.com>
3137
3138         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3139         bit to fix #60119.
3140
3141 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3142
3143         * assign.cs (LocalTemporary): Add new argument: is_address,If
3144         `is_address' is true, then the value that we store is the address
3145         to the real value, and not the value itself.
3146         
3147         * ecore.cs (PropertyExpr): use the new local temporary
3148         stuff to allow us to handle X.Y += z (where X is a struct)
3149
3150 2004-07-08  Martin Baulig  <martin@ximian.com>
3151
3152         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3153         not always return, just like we're doing in Using.Resolve().
3154
3155 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3156
3157         * cs-parser.jay (fixed_statement): flag this as Pinned.
3158
3159 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3160
3161         * typemanager.cs (TypeManager): Removed MakePinned method, this
3162         mechanism is replaced with the .NET 2.x compatible mechanism of
3163         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3164
3165         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3166         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3167         `IsFixed' property which has a different meaning.
3168
3169 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3170
3171         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3172         visible from inside a nested class, not just the names of the
3173         immediately enclosing class.
3174         Fix for bug #60730.
3175
3176 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3177
3178         * expression.cs (BetterConversion): Remove buggy special-case
3179         handling of "implicit constant expression conversions".  At this
3180         point, we already know that the conversion is possible -- we're
3181         only checking to see which is better.
3182
3183 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3184
3185         * cs-parser.jay: Added error CS0210 test.
3186
3187 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3188
3189         * cs-parser.jay: Added error CS0134 test.
3190
3191 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3192
3193         Fix bug #52507
3194         * cs-parser.jay: Added error CS0145 test.
3195
3196 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3197
3198         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3199
3200 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
3201         
3202         * expression.cs (StackAlloc.Resolve): The argument may not
3203         be a constant; deal with this case.
3204         
3205 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
3206
3207         * attribute.cs (IndexerName_GetIndexerName): Renamed to
3208         GetIndexerAttributeValue.
3209         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3210
3211         * class.cs (Indexer.Define): Added error tests for CS0415,
3212         CS0609.
3213
3214 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
3215
3216         * attribute.cs (Attribute.Resolve): Keep field code in sync with
3217         property code.
3218
3219 2004-06-23  Martin Baulig  <martin@ximian.com>
3220
3221         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3222         neither return nor throw, reset the barrier as well.  Fixes #60457.
3223
3224 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
3225
3226         * class.cs : EventAttributes is now set to None by default.
3227           This fixes bug #60459.
3228
3229 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3230
3231         Fix bug #60219
3232         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3233         Don't throw exception but return null (it's sufficient now).
3234
3235 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
3236
3237         * typemanager.cs (GetArgumentTypes): Faster implementation.
3238
3239 2004-06-18  Martin Baulig  <martin@ximian.com>
3240
3241         * attribute.cs (Attribute.Resolve): Check whether we're an
3242         EmptyCast which a Constant child.  Fixes #60333.
3243
3244 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
3245
3246         * statement.cs (EmitCollectionForeach): Account for the fact that
3247         not all valuetypes are in areas which we can take the address of.
3248         For these variables, we store to a temporary variable. Also, make
3249         sure that we dont emit a `callvirt' on a valuetype method.
3250
3251 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3252
3253         * expression.cs (StackAlloc.DoReSolve): Added test for
3254         negative parameter (CS0247).
3255
3256 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3257
3258         Fix bug #59792
3259         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3260
3261 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
3262
3263         Fix bug #59781
3264         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3265         ulong.
3266
3267 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3268
3269         Fix bug #58254 & cs1555.cs, cs1556.cs
3270         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3271
3272 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
3273
3274         * cs-parser.jay: Added error CS1669 test for indexers.
3275
3276 2004-06-18  Martin Baulig  <martin@ximian.com>
3277
3278         * generics.cs (GenericMethod.ctor): Don't take an Attributes
3279         argument.  Fixes #60441.
3280
3281 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
3282         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3283         The name needs to have the actual name of the method in order
3284         for other tests (such as the one in OverloadResolve for Invoke
3285         on a delegate) to work. As well, it does not really help
3286         error reporting because the method group had multiple methods.
3287         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3288         Make profiling work.
3289         
3290 2004-06-13  Martin Baulig  <martin@ximian.com>
3291
3292         * cs-parser.jay: Don't allow generic attributes.
3293
3294 2004-06-13  Martin Baulig  <martin@ximian.com>
3295
3296         * class.cs (MemberBase.DoDefineBase): New protected method.
3297         (MemberBase.DoDefine): Compute the `flags' in the new
3298         DoDefineBase() which must be called first.
3299         (Method.Define): Call DoDefineBase() first so we have the flags
3300         when defining the generic method.
3301
3302         * cs-parser.jay (interface_method_declaration): Support generic methods.
3303
3304 2004-06-13  Martin Baulig  <martin@ximian.com>
3305
3306         * decl.cs (TypeName): Removed.
3307         (MemberName): Removed TypeName and MemberNow; now we just have
3308         MemberName.
3309
3310         * cs-parser.jay: Don't distinguish between type arguments and type
3311         parameters in the grammar and simplified the rules a bit.  The
3312         reduce/reduce conflicts are now gone (except the one we inherited
3313         from mcs).
3314
3315 2004-06-11  Martin Baulig  <martin@ximian.com>
3316
3317         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3318         call this twice: for params and varargs methods.
3319
3320 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3321
3322         * class.cs:
3323         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3324
3325 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
3326
3327         * attribute.cs (Attribute.GetValidTargets): Made public.
3328
3329         * class.cs: 
3330         (AbstractPropertyEventMethod): New class for better code sharing.
3331         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3332         CS1667 report.
3333         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3334
3335 2004-06-09  Martin Baulig  <martin@ximian.com>
3336
3337         * cs-parser.jay: Removed a reduce/reduce conflict.
3338
3339 2004-06-03  Martin Baulig  <martin@ximian.com>
3340
3341         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3342         GetSimpleName() and return a SimpleName.
3343
3344         * ecore.cs (SimpleName.Arguments): New public field.
3345         (SimpleName): Added overloaded ctor which takes an additional
3346         TypeArguments argument.
3347         (SimpleName.SimpleNameResolve): Added support for generic methods.
3348         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
3349         formerly in MemberAccess.DoResolve(), but we also need it in
3350         SimpleNameResolve().
3351
3352         * expression.cs (MemberAccess.DoResolve): Use the new
3353         MethodGroupExpr.ResolveGeneric().       
3354
3355 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3356
3357         * decl.cs: If possible, use lookuptypedirect here. We can only do
3358         this if there is no `.' after the namespace. Avoids using
3359         LookupType, which does lots of slow processing.
3360         (FindNestedType) New method, does what it says :-).
3361         * namespace.cs: use LookupTypeDirect.
3362         * rootcontext.cs: use membercache, if possible.
3363         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3364
3365 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3366
3367         * expression.cs:
3368         According to the spec, 
3369
3370         In a member access of the form E.I, if E is a single identifier,
3371         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3372         field, property, localvariable, or parameter with the same type as
3373         the meaning of E as a type-name (§3.8), then both possible
3374         meanings of E are permitted.
3375
3376         We did not check that E as a simple-name had the same type as E as
3377         a type name.
3378
3379         This trivial check gives us 5-7% on bootstrap time.
3380
3381 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3382
3383         * expression.cs (Invocation.OverloadResolve): Avoid the
3384         use of hashtables and boxing here by allocating on demand.
3385
3386 2004-05-30  Martin Baulig  <martin@ximian.com>
3387
3388         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3389         we're doing a silent lookup.  Don't try to lookup nested types in
3390         TypeManager.object_type (thanks to Ben Maurer).
3391
3392 2004-05-30  Martin Baulig  <martin@ximian.com>
3393
3394         Committing a patch from Ben Maurer.
3395
3396         * rootcontext.cs (RootContext.LookupType): Cache negative results.
3397
3398 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3399
3400         * convert.cs: add a trivial cache for overload operator resolution.
3401
3402 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
3403
3404         * attribute.cs
3405         (AttributeTester.GetObsoleteAttribute): Returns instance of
3406         ObsoleteAttribute when type is obsolete.
3407
3408         * class.cs
3409         (TypeContainer.VerifyObsoleteAttribute): Override.
3410         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3411         (MethodCode.VerifyObsoleteAttribute): Override.
3412         (MemberBase.VerifyObsoleteAttribute): Override.
3413
3414         * decl.cs
3415         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3416         and report proper error.
3417
3418         *delegate.cs
3419         (Delegate.VerifyObsoleteAttribute): Override.
3420
3421         * ecore.cs
3422         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3423         and report proper error.
3424         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3425
3426         * enum.cs
3427         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3428         and enum member.
3429
3430         * expression.cs
3431         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3432         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3433         Added test for ObsoleteAttribute.
3434
3435         * statement.cs
3436         (Catch): Derived from Statement.
3437
3438 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3439
3440         * decl.cs: If possible, use lookuptypedirect here. We can only do
3441         this if there is no `.' after the namespace. Avoids using
3442         LookupType, which does lots of slow processing.
3443         (FindNestedType) New method, does what it says :-).
3444         * namespace.cs: use LookupTypeDirect.
3445         * rootcontext.cs: use membercache, if possible.
3446         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3447
3448 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3449
3450         * expression.cs:
3451         According to the spec, 
3452
3453         In a member access of the form E.I, if E is a single identifier,
3454         and if the meaning of E as a simple-name (§7.5.2) is a constant,
3455         field, property, localvariable, or parameter with the same type as
3456         the meaning of E as a type-name (§3.8), then both possible
3457         meanings of E are permitted.
3458
3459         We did not check that E as a simple-name had the same type as E as
3460         a type name.
3461
3462         This trivial check gives us 5-7% on bootstrap time.
3463
3464 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3465
3466         Fixed bug #59071 & cs0160.cs
3467         * statement.cs (Try.Resolve): Check here whether order of catch
3468         clauses matches their dependencies.
3469
3470 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
3471
3472         Fixed bug #58624
3473         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
3474         unsafe type.
3475
3476 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
3477
3478         * expression.cs (Invocation.OverloadResolve): Avoid the
3479         use of hashtables and boxing here by allocating on demand.
3480
3481 2004-05-30  Martin Baulig  <martin@ximian.com>
3482
3483         * rootcontext.cs (RootContext.LookupType): Don't cache things if
3484         we're doing a silent lookup.  Don't try to lookup nested types in
3485         TypeManager.object_type (thanks to Ben Maurer).
3486
3487 2004-05-30  Martin Baulig  <martin@ximian.com>
3488
3489         Committing a patch from Ben Maurer.
3490
3491         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
3492
3493 2004-05-29  Martin Baulig  <martin@ximian.com>
3494
3495         * class.cs (IMethodData.ShouldIgnore): New method.
3496
3497         * typemanager.cs (TypeManager.MethodFlags): Don't take a
3498         `Location' argument, we don't need it anywhere.  Use
3499         `IMethodData.ShouldIgnore ()' instead of
3500         `MethodData.GetMethodFlags ()'.
3501         (TypeManager.AddMethod): Removed.
3502         (TypeManager.AddMethod2): Renamed to AddMethod.
3503
3504 2004-05-29  Martin Baulig  <martin@ximian.com>
3505
3506         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
3507
3508         * convert.cs (Convert.ImplicitReferenceConversion): If we're
3509         converting from a class type S to an interface type and we already
3510         have an object on the stack, don't box it again.  Fixes #52578.
3511
3512 2004-05-29  Martin Baulig  <martin@ximian.com>
3513
3514         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3515         Added support for `params' parameters.  Fixes #59267.
3516
3517 2004-05-29  Martin Baulig  <martin@ximian.com>
3518
3519         * literal.cs (NullPointer): Provide a private .ctor which sets
3520         `type' to TypeManager.object_type.  Fixes #59048.
3521
3522 2004-05-29  Martin Baulig  <martin@ximian.com>
3523
3524         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
3525         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
3526
3527         * ecore.cs (EventExpr.instance_expr): Make the field private.
3528
3529 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
3530
3531         Fixed bug #50080 & cs0214-2.cs
3532         * expression.cs (Cast.DoResolve): Check unsafe context here.
3533         
3534         * statement.cs (Resolve.DoResolve): Likewise.
3535
3536 2004-05-26  Martin Baulig  <martin@ximian.com>
3537
3538         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
3539
3540         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
3541         (RootContext.LookupType): Pass down the `silent' flag.
3542
3543 2004-05-25  Martin Baulig  <martin@ximian.com>
3544
3545         * expression.cs
3546         (MethodGroupExpr.IdenticalTypeName): New public property.
3547         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
3548         expression actually refers to a type.
3549
3550 2004-05-25  Martin Baulig  <martin@ximian.com>
3551
3552         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
3553         for #56176 and made it actually work.
3554
3555 2004-05-25  Martin Baulig  <martin@ximian.com>
3556
3557         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
3558         (FieldExpr, PropertyExpr): Override and implement
3559         CacheTemporaries.  Fixes #52279.
3560
3561 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
3562
3563         * location.cs: In the new compiler listing a file twice is a
3564         warning, not an error.
3565
3566 2004-05-24  Martin Baulig  <martin@ximian.com>
3567
3568         * enum.cs (Enum.DefineType): For the `BaseType' to be a
3569         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
3570
3571 2004-05-24  Martin Baulig  <martin@ximian.com>
3572
3573         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
3574         walking the `using' list.  Fixes #53921.
3575
3576 2004-05-24  Martin Baulig  <martin@ximian.com>
3577
3578         * const.cs (Const.LookupConstantValue): Added support for
3579         EmptyCast's; fixes #55251.
3580
3581 2004-05-24  Martin Baulig  <martin@ximian.com>
3582
3583         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
3584         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
3585         which does the CS0135 check.  The reason is that we first need to
3586         check whether the variable actually exists.
3587
3588 2004-05-24  Martin Baulig  <martin@ximian.com>
3589
3590         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
3591         than RootContext.LookupType() to find the explicit interface
3592         type.  Fixes #58584.
3593
3594 2004-05-24  Raja R Harinath  <rharinath@novell.com>
3595
3596         * Makefile: Simplify.  Use executable.make.
3597         * mcs.exe.sources: New file.  List of sources of mcs.exe.
3598
3599 2004-05-24  Anders Carlsson  <andersca@gnome.org>
3600
3601         * decl.cs:
3602         * enum.cs:
3603         Use the invariant culture when doing String.Compare for CLS case
3604         sensitivity.
3605         
3606 2004-05-23  Martin Baulig  <martin@ximian.com>
3607
3608         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
3609         don't have any dots.  Fixes #52622, added cs0246-8.cs.
3610
3611         * namespace.cs (NamespaceEntry.Lookup): Likewise.
3612
3613 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3614
3615         * class.cs (MemberBase.Define): Reuse MemberType member for 
3616         resolved type. Other methods can use it too.
3617
3618 2004-05-23  Martin Baulig  <martin@ximian.com>
3619
3620         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
3621         the variable also exists in the current block (otherwise, we need
3622         to report a CS0103).  Fixes #58670.
3623
3624 2004-05-23  Martin Baulig  <martin@ximian.com>
3625
3626         * flowanalysis.cs (Reachability.Reachable): Compute this
3627         on-the-fly rather than storing it as a field.
3628
3629 2004-05-23  Martin Baulig  <martin@ximian.com>
3630
3631         * flowanalysis.cs (Reachability.And): Manually compute the
3632         resulting `barrier' from the reachability.      
3633        
3634 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
3635
3636         Fix bug #57835
3637         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
3638         instance of ObsoleteAttribute when symbol is obsolete.
3639
3640         * class.cs
3641         (IMethodData): Extended interface for ObsoleteAttribute support.
3642
3643 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3644
3645         * attribute.cs: Fix bug #55970
3646
3647 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
3648
3649         Fix bug #52705
3650         * attribute.cs
3651         (GetObsoleteAttribute): New method. Creates the instance of
3652         ObsoleteAttribute.
3653         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
3654         ObsoleteAttribute when member is obsolete.
3655         (AttributeTester.Report_ObsoleteMessage): Common method for
3656         Obsolete error/warning reporting.
3657
3658         * class.cs
3659         (TypeContainer.base_classs_type): New member for storing parent type.
3660
3661         * decl.cs
3662         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
3663         for this MemberCore.
3664
3665 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3666
3667         * attribute.cs, const.cs: Fix bug #58590
3668
3669 2004-05-21  Martin Baulig  <martin@ximian.com>
3670
3671         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
3672         out parameters if the end of the method is unreachable.  Fixes
3673         #58098. 
3674
3675 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3676
3677         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
3678         Hari was right, why extra method.
3679
3680 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
3681
3682         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
3683
3684 2004-05-20  Martin Baulig  <martin@ximian.com>
3685
3686         * delegate.cs: Convert this file to Unix mode - like the original
3687         version in mcs is.
3688
3689 2004-05-20  Martin Baulig  <martin@ximian.com>
3690
3691         * attribute.cs: Convert this file to Unix mode - like the original
3692         version in mcs is.
3693
3694 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
3695
3696        Fix bug #58688 (MCS does not report error when the same attribute
3697        is assigned twice)
3698
3699        * attribute.cs (Attribute.Emit): Distinction between null and default.
3700
3701 2004-05-19  Raja R Harinath  <rharinath@novell.com>
3702
3703        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
3704        of a top-level attribute without an attribute target.
3705        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
3706        Make non-static.
3707        (Attribute.Conditional_GetConditionName), 
3708        (Attribute.Obsolete_GetObsoleteMessage): Update.
3709        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
3710        part of ScanForIndexerName.
3711        (Attribute.CanIgnoreInvalidAttribute): New function.
3712        (Attribute.ScanForIndexerName): Move to ...
3713        (Attributes.ScanForIndexerName): ... here.
3714        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
3715        (Attributes.Search): New internal variant that can choose not to
3716        complain if types aren't resolved.  The original signature now
3717        complains.
3718        (Attributes.GetClsCompliantAttribute): Use internal variant, with
3719        complaints suppressed.
3720        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
3721        only if it not useful.
3722        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
3723        top-level for attributes that are shared between the assembly
3724        and a top-level class.
3725        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
3726        * class.cs: Update to reflect changes.
3727        (DefineIndexers): Fuse loops.
3728        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
3729        a couple more variants of attribute names.
3730
3731 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
3732
3733         Fix bug #52585 (Implemented explicit attribute declaration)
3734
3735         * attribute.cs:
3736         (Attributable.ValidAttributeTargets): New abstract method. It gets
3737         list of valid attribute targets for explicit target declaration.
3738         (Attribute.Target): It holds target itself.
3739         (AttributeSection): Removed.
3740         (Attribute.CheckTargets): New method. It checks whether attribute
3741         target is valid for the current element.
3742
3743         * class.cs:
3744         (EventProperty): New class. For events that are declared like
3745         property (with add and remove accessors).
3746         (EventField): New class. For events that are declared like field.
3747         class.cs
3748
3749         * cs-parser.jay: Implemented explicit attribute target declaration.
3750
3751         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
3752         Override ValidAttributeTargets.
3753
3754         * parameter.cs:
3755         (ReturnParameter): Class for applying custom attributes on 
3756         the return type.
3757         (ParameterAtribute): New class. Class for applying custom
3758         attributes on the parameter type.
3759
3760 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
3761
3762         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
3763         definitions. 
3764
3765         (Method): Allow UNSAFE here.
3766
3767         * modifiers.cs: Support unsafe reporting.
3768
3769 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
3770
3771         * decl.cs: Fix bug #58478.
3772
3773 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3774
3775         * statement.cs: When checking for unreachable code on an EmptyStatement,
3776         set the location. Fixes bug #58488.
3777
3778 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
3779
3780         * driver.cs: Add -pkg handling.
3781
3782         From Gonzalo: UseShelLExecute=false
3783
3784 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
3785
3786         * attribute.cs:
3787         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
3788         for attribute.
3789         (Attribute.IsClsCompliaceRequired): Moved to base for better
3790         accesibility.
3791         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
3792         when attribute is AttributeUsageAttribute.
3793         (Attribute.GetValidTargets): Simplified.
3794         (Attribute.GetAttributeUsage): New method returns AttributeUsage
3795         attribute for this type.
3796         (Attribute.ApplyAttributes): Method renamed to Emit and make
3797         non-static.
3798         (GlobalAttributeSection): New class for special handling of global
3799         attributes (assembly, module).
3800         (AttributeSection.Emit): New method.
3801
3802         * class.cs: Implemented Attributable abstract methods.
3803         (MethodCore.LabelParameters): Moved to Parameter class.
3804         (Accessor): Is back simple class.
3805         (PropertyMethod): Implemented Attributable abstract class.
3806         (DelegateMethod): Implemented Attributable abstract class.
3807         (Event): New constructor for disctintion between normal Event
3808         and Event with accessors.
3809
3810         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
3811
3812         * codegen.cs, const.cs, decl.cs, delegate.cs:
3813         (CommonAssemblyModulClass): Implemented Attributable abstract class
3814         and simplified.
3815
3816         * enum.cs: Implement IAttributeSupport interface.
3817         (EnumMember): New class for emum members. Implemented Attributable
3818         abstract class
3819
3820         * parameter.cs:
3821         (ParameterBase): Is abstract.
3822         (ReturnParameter): New class for easier [return:] attribute handling.
3823
3824         * typemanager.cs: Removed builder_to_attr.
3825
3826 2004-05-11  Raja R Harinath  <rharinath@novell.com>
3827
3828         Fix bug #57151.
3829         * attribute.cs (Attribute.GetPositionalValue): New function.
3830         * class.cs (TypeContainer.VerifyMembers): New function.
3831         (TypeContainer.Emit): Use it.
3832         (ClassOrStruct): New base class for Class and Struct.
3833         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
3834         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
3835         class.
3836         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
3837         then each non-static field should have a FieldOffset attribute.
3838         Otherwise, none of the fields should have a FieldOffset attribute.
3839         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
3840         and FieldOffset attributes.
3841         * typemanager.cs (TypeManager.struct_layout_attribute_type)
3842         (TypeManager.field_offset_attribute_type): New core types.
3843         (TypeManager.InitCoreTypes): Initialize them.
3844
3845 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
3846
3847         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
3848         Return correct type.
3849         From bug #58270.
3850
3851 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
3852
3853         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
3854         be implicitly converted to ulong.
3855         
3856         * expression.cs: The logic for allowing operator &, | and ^ worked
3857         was wrong, it worked before because we did not report an error in
3858         an else branch.  Fixes 57895.
3859
3860         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
3861         allow volatile fields to be reference types.
3862
3863 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
3864
3865         * driver.cs: Add support for /debug-
3866
3867 2004-05-07  Raja R Harinath  <rharinath@novell.com>
3868
3869         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
3870         Add a 'complain' parameter to silence errors.
3871         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
3872         silently overlooked type-resolutions.
3873         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
3874         to reflect changes.
3875         (Attributes.Search): New function.
3876         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
3877         (Attributes.GetAttributeFullName): Remove hack.
3878         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
3879         Update to reflect changes.
3880         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
3881         Use Attributes.Search instead of nested loops.
3882
3883 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
3884
3885         * decl.cs:
3886         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
3887         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
3888         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
3889
3890         * report.cs: (Report.Warning): Renamed to Warning_T because of
3891         parameter collision.
3892
3893 2004-05-05  Raja R Harinath  <rharinath@novell.com>
3894
3895         * expression.cs (MemberAccess.ResolveMemberAccess):
3896         Exit with non-zero status after Report.Error.
3897         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
3898         Likewise.
3899         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
3900
3901 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
3902
3903         * support.cs: Don't hang when the file is empty.
3904
3905 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
3906
3907         * support.cs: In SeekableStreamReader, compute the preamble size of the
3908           underlying stream. Position changes should take into account that initial
3909           count of bytes.
3910
3911 2004-05-03  Todd Berman  <tberman@sevenl.net>
3912
3913         * driver.cs: remove unused GetSysVersion function.
3914
3915 2004-05-03  Todd Berman  <tberman@sevenl.net>
3916
3917         * driver.cs: Remove the hack from saturday, as well as the hack
3918         from jackson (LoadAssemblyFromGac), also adds the CWD to the
3919         link_paths to get that bit proper.
3920
3921 2004-05-01  Todd Berman  <tberman@sevenl.net>
3922
3923         * driver.cs: Try a LoadFrom before a Load, this checks the current
3924         path. This is currently a bug in mono that is be fixed, however, this
3925         provides a workaround for now. This will be removed when the bug
3926         is fixed.
3927
3928 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
3929
3930         * CryptoConvert.cs: Updated to latest version. Fix issue with 
3931         incomplete key pairs (#57941).
3932
3933 2004-05-01  Todd Berman  <tberman@sevenl.net>
3934
3935         * driver.cs: Remove '.' from path_chars, now System.* loads properly
3936         from the GAC
3937
3938 2004-04-30  Jackson Harper  <jackson@ximian.com>
3939
3940         * codegen.cs: Open keys readonly.
3941         
3942 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3943
3944         * typemanager.cs: don't report cyclic struct layout when a struct
3945         contains 2 or more fields of the same type. Failed for Pango.AttrShape
3946         which has 2 Pango.Rectangle fields.
3947
3948 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3949
3950         * expression.cs: Handle IntPtr comparisons with IL code
3951         rather than a method call.
3952
3953 2004-04-29  Martin Baulig  <martin@ximian.com>
3954
3955         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
3956         the list of PropertyInfo's in class hierarchy and find the
3957         accessor.  Fixes #56013.
3958
3959 2004-04-29  Martin Baulig  <martin@ximian.com>
3960
3961         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
3962
3963 2004-04-29  Martin Baulig  <martin@ximian.com>
3964
3965         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
3966
3967         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
3968
3969 2004-04-29  Martin Baulig  <martin@ximian.com>
3970
3971         * class.cs (ConstructorInitializer.Resolve): Check whether the
3972         parent .ctor is accessible.  Fixes #52146.
3973
3974 2004-04-29  Martin Baulig  <martin@ximian.com>
3975
3976         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
3977
3978         * statement.cs (Using.EmitLocalVariableDecls): Use
3979         TypeManager.idisposable_type, not typeof (IDisposable).
3980         (Foreach.EmitCollectionForeach): Added support for valuetypes.
3981
3982 2004-04-29  Martin Baulig  <martin@ximian.com>
3983
3984         * class.cs (Event.Define): Don't emit the field and don't set
3985         RTSpecialName and SpecialName for events on interfaces.  Fixes
3986         #57703. 
3987
3988 2004-04-29  Raja R Harinath  <rharinath@novell.com>
3989
3990         Refactor Attribute.ApplyAttributes.
3991         * attribute.cs (Attributable): New base class for objects that can
3992         have Attributes applied on them.
3993         (Attribute): Make AttributeUsage fields public.
3994         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
3995         (Attribute.IsInternalCall): New property.
3996         (Attribute.UsageAttr): Convert to a public read-only property.
3997         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
3998         (Attribute.ResolveType, Attribute.Resolve)
3999         (Attribute.ScanForIndexerName): Update to reflect changes.
4000         (Attribute.CheckAttributeTarget): Re-format.
4001         (Attribute.ApplyAttributes): Refactor, to various
4002         Attributable.ApplyAttributeBuilder methods.
4003         * decl.cs (MemberCore): Make Attributable.
4004         * class.cs (Accessor): Make Attributable.
4005         (MethodData.ApplyAttributes): Use proper attribute types, not
4006         attribute names.
4007         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4008         (TypeContainer.ApplyAttributeBuilder)
4009         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4010         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4011         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4012         (Operator.ApplyAttributeBuilder): New factored-out methods.
4013         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4014         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4015         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4016         * parameter.cs (ParameterBase): New Attributable base class
4017         that can also represent Return types.
4018         (Parameter): Update to the changes.
4019
4020 2004-04-29  Jackson Harper  <jackson@ximian.com>
4021
4022         * driver.cs: Prefer the corlib system version when looking for
4023         assemblies in the GAC. This is still a hack, but its a better hack
4024         now.
4025         
4026 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4027
4028         * decl.cs, enum.cs: Improved error 3005 reporting.
4029   
4030         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4031         (related_symbols): New private member for list of symbols
4032         related to reported error/warning.
4033         
4034         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4035
4036 2004-04-29  Martin Baulig  <martin@ximian.com>
4037
4038         * ecore.cs (Expression.Constantify): If we're an enum and
4039         TypeManager.TypeToCoreType() doesn't give us another type, use
4040         t.UnderlyingSystemType.  Fixes #56178.  
4041
4042 2004-04-29  Martin Baulig  <martin@ximian.com>
4043
4044         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4045         interfaces and for each interface, only add members directly
4046         declared in that interface.  Fixes #53255.
4047
4048 2004-04-28  Martin Baulig  <martin@ximian.com>
4049
4050         * expression.cs (ConditionalLogicalOperator): Use a temporary
4051         variable for `left' to avoid that we evaluate it more than once;
4052         bug #52588.
4053
4054 2004-04-28  Martin Baulig  <martin@ximian.com>
4055
4056         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4057         `void[]' (CS1547).
4058
4059 2004-04-28  Martin Baulig  <martin@ximian.com>
4060
4061         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4062         void (CS1547).
4063
4064         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4065         whether the type is not void (CS1547).
4066
4067 2004-04-28  Martin Baulig  <martin@ximian.com>
4068
4069         * expression.cs (Unary.DoResolveLValue): Override this and report
4070         CS0131 for anything but Operator.Indirection.
4071
4072 2004-04-28  Martin Baulig  <martin@ximian.com>
4073
4074         Committing a patch from Ben Maurer; see bug #50820.
4075
4076         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4077         check for classes.
4078
4079         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4080         classes.        
4081
4082 2004-04-28  Martin Baulig  <martin@ximian.com>
4083
4084         Committing a patch from Ben Maurer; see bug #50820.
4085
4086         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4087         check for classes.
4088
4089         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4090         classes.        
4091
4092 2004-04-28  Martin Baulig  <martin@ximian.com>
4093
4094         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4095         (Block.AddLabel): Call DoLookupLabel() to only search in the
4096         current block.
4097
4098 2004-04-28  Martin Baulig  <martin@ximian.com>
4099
4100         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4101         comparing StringConstants and NullLiterals in Equality and Inequality.
4102
4103 2004-04-28  Jackson Harper  <jackson@ximian.com>
4104
4105         * driver.cs: Attempt to load referenced assemblies from the
4106         GAC. This is the quick and dirty version of this method that
4107         doesnt take into account versions and just takes the first
4108         canidate found. Will be good enough for now as we will not have more
4109         then one version installed into the GAC until I update this method.
4110
4111 2004-04-28  Martin Baulig  <martin@ximian.com>
4112
4113         * typemanager.cs (TypeManager.CheckStructCycles): New public
4114         static method to check for cycles in the struct layout.
4115
4116         * rootcontext.cs (RootContext.PopulateTypes): Call
4117         TypeManager.CheckStructCycles() for each TypeContainer.
4118         [Note: We only need to visit each type once.]
4119
4120 2004-04-28  Martin Baulig  <martin@ximian.com>
4121
4122         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4123
4124         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4125         success and added `out object value'.  Use a `bool resolved' field
4126         to check whether we've already been called rather than
4127         `ConstantValue != null' since this breaks for NullLiterals.
4128
4129 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4130
4131         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4132         setting of this flag, since the 'set' method may be non-public.
4133
4134 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4135
4136         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4137         check on current_vector.Block.
4138
4139 2004-04-27  Martin Baulig  <martin@ximian.com>
4140
4141         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4142         a field initializer.  Fixes #56459.
4143
4144 2004-04-27  Martin Baulig  <martin@ximian.com>
4145
4146         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4147         we're not attempting to use an indexer.  Fixes #52154.
4148
4149 2004-04-27  Martin Baulig  <martin@ximian.com>
4150
4151         * statement.cs (Return): Don't create a return label if we don't
4152         need it; reverts my change from January 20th.  Thanks to Ben
4153         Maurer for this.
4154
4155 2004-04-27  Martin Baulig  <martin@ximian.com>
4156
4157         According to the spec, `goto' can only leave a nested scope, but
4158         never enter it.
4159
4160         * statement.cs (Block.LookupLabel): Only lookup in the current
4161         block, don't recurse into parent or child blocks.
4162         (Block.AddLabel): Check in parent and child blocks, report
4163         CS0140/CS0158 if we find a duplicate.
4164         (Block): Removed this indexer for label lookups.
4165         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4166         this already does the error reporting for us.
4167
4168         * flowanalysis.cs
4169         (FlowBranching.UsageVector.Block): New public variable; may be null.
4170         (FlowBranching.CreateSibling): Added `Block' argument.
4171         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4172         label for the target of a `goto' and check whether we're not
4173         leaving a `finally'.
4174
4175 2004-04-27  Martin Baulig  <martin@ximian.com>
4176
4177         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4178         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4179         just for returns).
4180
4181 2004-04-27  Martin Baulig  <martin@ximian.com>
4182
4183         * statement.cs (Block.AddLabel): Also check for implicit blocks
4184         and added a CS0158 check.
4185
4186 2004-04-27  Martin Baulig  <martin@ximian.com>
4187
4188         * flowanalysis.cs (FlowBranchingLoop): New class.
4189         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4190         UsageVector's instead of an ArrayList.
4191         (FlowBranching.Label): Likewise.
4192         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4193         (FlowBranching.AddBreakVector): New method.
4194
4195 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4196
4197         * attribute.cs: Small regression fix: only convert the type if we
4198         the type is different, fixes System.Drawing build.
4199
4200 2004-04-27  Martin Baulig  <martin@ximian.com>
4201
4202         * attribute.cs (Attribute.Resolve): If we have a constant value
4203         for a named field or property, implicity convert it to the correct
4204         type.
4205
4206 2004-04-27  Raja R Harinath  <rharinath@novell.com>
4207
4208         * statement.cs (Block.Block): Implicit blocks share
4209         'child_variable_names' fields with parent blocks.
4210         (Block.AddChildVariableNames): Remove.
4211         (Block.AddVariable): Mark variable as "used by a child block" in
4212         every surrounding block.
4213         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4214         been used in a child block, complain about violation of "Invariant
4215         meaning in blocks" rule.
4216         * cs-parser.jay (declare_local_variables): Don't use
4217         AddChildVariableNames.
4218         (foreach_statement): Don't create an implicit block: 'foreach'
4219         introduces a scope.
4220
4221 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
4222
4223         * convert.cs (ImplicitNumericConversion): 0 is also positive when
4224         converting from 0L to ulong.  Fixes 57522.
4225
4226 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4227
4228         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4229         derived class hides via 'new' keyword field from base class (test-242.cs).
4230         TODO: Handle this in the more general way.
4231         
4232         * class.cs (CheckBase): Ditto.
4233
4234 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
4235
4236         * decl.cs (caching_flags): New member for storing cached values
4237         as bit flags.
4238         (MemberCore.Flags): New enum where bit flags for caching_flags
4239         are defined.
4240         (MemberCore.cls_compliance): Moved to caching_flags.
4241         (DeclSpace.Created): Moved to caching_flags.
4242
4243         * class.cs: Use caching_flags instead of DeclSpace.Created
4244         
4245 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
4246
4247         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4248         if we are only a derived class, not a nested class.
4249
4250         * typemanager.cs: Same as above, but do this at the MemberLookup
4251         level (used by field and methods, properties are handled in
4252         PropertyExpr).   Allow for the qualified access if we are a nested
4253         method. 
4254
4255 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
4256
4257         * class.cs: Refactoring.
4258         (IMethodData): New inteface; Holds links to parent members
4259         to avoid member duplication (reduced memory allocation).
4260         (Method): Implemented IMethodData interface.
4261         (PropertyBase): New inner classes for get/set methods.
4262         (PropertyBase.PropertyMethod): Implemented IMethodData interface
4263         (Event): New inner classes for add/remove methods.
4264         (Event.DelegateMethod): Implemented IMethodData interface.
4265
4266         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4267         EmitContext (related to class.cs refactoring).
4268
4269 2004-04-21  Raja R Harinath  <rharinath@novell.com>
4270
4271         * delegate.cs (Delegate.VerifyApplicability): If the number of
4272         arguments are the same as the number of parameters, first try to
4273         verify applicability ignoring  any 'params' modifier on the last
4274         parameter.
4275         Fixes #56442.
4276
4277 2004-04-08  Martin Baulig  <martin@ximian.com>
4278
4279         Merged latest changes into gmcs.  Please keep this comment in
4280         here, it makes it easier for me to see what changed in MCS since
4281         the last time I merged.
4282
4283 2004-04-16  Raja R Harinath  <rharinath@novell.com>
4284
4285         * class.cs (TypeContainer.AddIndexer): Use
4286         'ExplicitInterfaceName' to determine if interface name was
4287         explicitly specified.  'InterfaceType' is not initialized at this time.
4288         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
4289         Indexers array is already in the required order.  Initialize
4290         'IndexerName' only if there are normal indexers.
4291         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4292         (TypeContainer.Emit): Emit DefaultMember attribute only if
4293         IndexerName is initialized.
4294         Fixes #56300.
4295
4296 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
4297
4298         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4299         Fixes #57007
4300
4301 2004-04-15  Raja R Harinath  <rharinath@novell.com>
4302
4303         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4304         attributes.
4305         Fix for #56456.
4306
4307         * attribute.cs (Attribute.Resolve): Check for duplicate named
4308         attributes.
4309         Fix for #56463.
4310
4311 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
4312
4313         * iterators.cs (MarkYield): track whether we are in an exception,
4314         and generate code accordingly.  Use a temporary value to store the
4315         result for our state.
4316
4317         I had ignored a bit the interaction of try/catch with iterators
4318         since their behavior was not entirely obvious, but now it is
4319         possible to verify that our behavior is the same as MS .NET 2.0
4320
4321         Fixes 54814
4322
4323 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
4324
4325         * iterators.cs: Avoid creating temporaries if there is no work to
4326         do. 
4327
4328         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4329         Enumerations, use TypeManager.EnumToUnderlying and call
4330         recursively. 
4331
4332         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4333         bug #57013
4334
4335         (This.Emit): Use EmitContext.EmitThis to emit our
4336         instance variable.
4337
4338         (This.EmitAssign): Ditto.
4339
4340         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4341         codepaths, we will move all the functionality into
4342         Mono.CSharp.This 
4343
4344         (FieldExpr.EmitAssign): Ditto.
4345
4346         This fixes several hidden bugs that I uncovered while doing a code
4347         review of this today.
4348
4349         * codegen.cs (EmitThis): reworked so the semantics are more clear
4350         and also support value types "this" instances.
4351
4352         * iterators.cs: Changed so that for iterators in value types, we
4353         do not pass the value type as a parameter.  
4354
4355         Initialization of the enumerator helpers is now done in the caller
4356         instead of passing the parameters to the constructors and having
4357         the constructor set the fields.
4358
4359         The fields have now `assembly' visibility instead of private.
4360
4361 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
4362
4363         * expression.cs (Argument.Resolve): Check if fields passed as ref
4364         or out are contained in a MarshalByRefObject.
4365
4366         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4367         another compiler type.
4368
4369 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4370
4371         * class.cs (Indexer.Define): use the new name checking method.
4372         Also, return false on an error.
4373         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4374         (is_identifier_[start/part]_character): make static.
4375
4376 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
4377
4378         * expression.cs (Binary.ResolveOperator): Do no append strings
4379         twice: since we can be invoked more than once (array evaluation)
4380         on the same concatenation, take care of this here.  Based on a fix
4381         from Ben (bug #56454)
4382
4383 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4384
4385         * codegen.cs: Fix another case where CS1548 must be reported (when 
4386         delay-sign isn't specified and no private is available #56564). Fix
4387         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4388         error when MCS is used on the MS runtime and we need to delay-sign 
4389         (which seems unsupported by AssemblyBuilder - see #56621).
4390
4391 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
4392
4393         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4394         (TypeManager.ComputeNamespaces): Faster implementation for
4395         Microsoft runtime.
4396
4397         * compiler.csproj: Updated AssemblyName to mcs.
4398
4399 2004-05-11  Jackson Harper  <jackson@ximian.com>
4400
4401         * Makefile: Preserve MONO_PATH
4402         
4403 2004-05-11  Jackson Harper  <jackson@ximian.com>
4404
4405         * Makefile: Use mono and mcs to build gmcs
4406         
4407 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
4408
4409         * codegen.cs: Add patch from Robert Shade
4410         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4411         sync with mcs.
4412
4413 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
4414
4415         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4416         incomplete key pairs (#57941).
4417
4418 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
4419
4420         * codegen.cs: Fix another case where CS1548 must be reported (when 
4421         delay-sign isn't specified and no private is available #56564). Fix
4422         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
4423         error when MCS is used on the MS runtime and we need to delay-sign 
4424         (which seems unsupported by AssemblyBuilder - see #56621).
4425
4426 2004-04-29  Jackson Harper  <jackson@ximian.com>
4427
4428         * Makefile: Set MONO_PATH to use the bootstrap corlib
4429         * driver.cs: Check the GAC for referenced assemblies.
4430                 
4431 2004-04-29  Martin Baulig  <martin@ximian.com>
4432
4433         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4434
4435 2004-04-07  Martin Baulig  <martin@ximian.com>
4436
4437         * expression.cs (Binary.ResolveOperator): Added special case for
4438         Equality/Inequality between a type parameter and a null literal.
4439
4440 2004-04-07  Martin Baulig  <martin@ximian.com>
4441
4442         * convert.cs: Check null literal -> type parameter conversions.
4443
4444 2004-04-07  Martin Baulig  <martin@ximian.com>
4445
4446         * generic.cs (ConstructedType.CheckConstraints): Enforce the
4447         `class' and `struct' constraints.
4448
4449 2004-04-07  Martin Baulig  <martin@ximian.com>
4450
4451         * generic.cs (SpecialConstraint): New public enum.
4452         (Constraints.Resolve): Added support for the `class' and `struct'
4453         constraints.
4454
4455         * cs-parser.jay (type_parameter_constraint): Added support for the
4456         `class' and `struct' constraints.
4457
4458 2004-04-07  Martin Baulig  <martin@ximian.com>
4459
4460         * support.cs (GenericConstraints): Replaced `Types' by
4461         `ClassConstraint' and `InterfaceConstraints'; added
4462         `HasClassConstraint'.   
4463
4464 2004-04-07  Martin Baulig  <martin@ximian.com>
4465
4466         * generic.cs
4467         (Constraints.InterfaceConstraints): New public property.
4468         (Constraints.Types): Make this property public
4469         (TypeParameter): Implement IMemberContainer.
4470         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
4471         instead of a TypeBuilder/MethodBuilder; pass the interface
4472         constraints to TypeManager.AddTypeParameter().
4473         (TypeParameter.DefineType): Just take an EmitContext and no
4474         TypeBuilder/MethodBuilder.  Use the new public API.
4475
4476         * typemanager.cs (TypeManager.AddTypeParameter): Added
4477         `TypeExpr[]' argument; add the interfaces to the
4478         `builder_to_ifaces' hash.
4479         (TypeManager.LookupMemberContainer): For
4480         GenericTypeParameterBuilders, get the TypeParameter from the
4481         `builder_to_type_param'.
4482         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
4483         the TypeParameter and call FindMembers on it.
4484
4485 2004-04-07  Martin Baulig  <martin@ximian.com>
4486
4487         * class.cs
4488         (MethodCore.GenericMethod): Moved this field here from Method.
4489         (MethodCore.IsDuplicateImplementation): Take the number of type
4490         parameters into account if we're a generic method.
4491
4492         * expression.cs (Invocation.InferTypeArguments): Don't return true
4493         if `arguments' is null; we still need to check whether we actually
4494         don't need to infer anything in this case.
4495         (MemberAccess): Merged the functionality from GenericMemberAccess
4496         into this class.
4497
4498         * generic.cs (GenericMemberAccess): Removed.
4499
4500 2004-04-05  Martin Baulig  <martin@ximian.com>
4501
4502         * decl.cs (MemberCore): For generic classes, interfaces and
4503         structs, `Name' now includes the number of type parameters
4504         ("Stack!1.Node!1").
4505         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
4506         encode the number of type arguments in the type name.
4507
4508         * expression.cs (Expression.MemberLookup): Removed the
4509         `num_type_args' argument; we now encode the number of type
4510         arguments in the type name.
4511
4512         * ecore.cs (SimpleName): Encode the number of type arguments in
4513         the type name itself.
4514
4515         * generic.cs (ConstructedType): Likewise.
4516
4517         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
4518         `MemberName'; we now include the number of type parameters in the
4519         type name.
4520
4521         * typemanager.cs (TypeManager.CheckGeneric): Removed.
4522         (TypeManager.MemberLookup): Removed the
4523         `num_type_args' argument; we now encode the number of type
4524         arguments in the type name.     
4525
4526 2004-04-03  Martin Baulig  <martin@ximian.com>
4527
4528         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
4529         (MemberCore.MemberName): Moved here from MemberBase.
4530         (DeclSpace.SetParameterInfo): Just take the constraints as an
4531         ArrayList; we already have the type parameters in our
4532         `MemberName'; also do the CS0080 reporting here.
4533
4534         * cs-parser.jay (struct_declaration): Use `member_name' instead of
4535         `IDENTIFIER opt_type_parameter_list'; when constructing our
4536         `MemberName', it'll already include our type parameters.
4537         (class_declaration, interface_declaration): Likewise.
4538         (delegate_declaration): Likewise.
4539         (MakeName): Take a MemberName and return a MemberName.
4540         The following two changes are required to avoid shift/reduce conflicts:
4541         (member_name): Don't include a TypeName anymore; ie. this is now
4542         just 'IDENTIFIER opt_type_parameter_list'.
4543         (property_declaration, event_declaration): Use a
4544         `namespace_or_type_name' instead of a `member_name'.            
4545
4546 2004-04-03  Martin Baulig  <martin@ximian.com>
4547
4548         * decl.cs (MemberName): Renamed to `TypeName' and created a new
4549         `MemberName' class.
4550         (TypeName): Formerly known as MemberName.
4551
4552         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
4553         instead of a `MemberName'.
4554
4555         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
4556         (member_name): New rule; create a MemberName.
4557
4558 2004-04-02  Martin Baulig  <martin@ximian.com>
4559
4560         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
4561         (CS0305 and CS0308).
4562
4563 2004-04-02  Martin Baulig  <martin@ximian.com>
4564
4565         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
4566         support for nested types.
4567
4568 2004-04-02  Martin Baulig  <martin@ximian.com>
4569
4570         * ecore.cs (IAlias): New public interface.
4571         (TypeExpr, TypeExpression): Implement IAlias.
4572         (TypeAliasExpression): New public class.
4573
4574         * namespace.cs (Namespace): Implement IAlias.
4575         (Namespace.Lookup): Return an IAlias instead on an object.
4576         (Namespace.DefineName): Take an IAlias instead of an object.
4577         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
4578         an object.
4579         (NamespaceEntry.UsingAlias): Take a Membername instead of an
4580         Expression.
4581         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
4582         object.
4583         (NamespaceEntry.Lookup): Likewise.
4584
4585         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
4586         instead of a Type.      
4587
4588         * decl.cs (DeclSpace): Implement IAlias.
4589         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
4590
4591         * generic.cs (ConstructedType): Improved error checking.
4592
4593 2004-04-02  Martin Baulig  <martin@ximian.com>
4594
4595         * convert.cs: Added type parameter conversions.
4596
4597         * ecore.cs
4598         (UnboxCast.Emit): Emit an `unbox.any' for type params.
4599         (ClassCast.Emit): If the source type is a type parameter, box it.
4600         If the target type is a type parameter, emit an `unbox.any'
4601         instead of a `classcast'.1      
4602
4603 2004-04-01  Martin Baulig  <martin@ximian.com>
4604
4605         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
4606
4607 2004-04-01  Martin Baulig  <martin@ximian.com>
4608
4609         * generic.cs (ConstructedType.CheckConstraints): Use
4610         Convert.ImplicitStandardConversionExists(); user-defined implicit
4611         conversions are not allowed according to the spec.
4612
4613 2004-03-30  Martin Baulig  <martin@ximian.com>
4614
4615         * expression.cs (New): Added support for type parameters.
4616
4617         * typemanager.cs
4618         (TypeManager.activator_type): New public static field.
4619         (TypeManager.activator_create_instance): Likewise.
4620
4621 2004-03-30  Martin Baulig  <martin@ximian.com>
4622
4623         * typemanager.cs (TypeManager.HasConstructorConstraint): New
4624         public method.
4625
4626 2004-03-30  Martin Baulig  <martin@ximian.com>
4627
4628         * generic.cs (ConstructedType.CheckConstraints): Actually follow
4629         the spec here: the argument type must be convertible to the
4630         constraints.
4631
4632 2004-03-30  Martin Baulig  <martin@ximian.com>
4633
4634         * generic.cs
4635         (TypeParameter.Define, TypeParameter.DefineMethod): Call
4636         TypeManager.AddTypeParameter().
4637         (ConstructedType.CheckConstraints): Re-enable this and actually
4638         check whether we have a constructor constraint.
4639
4640         * typemanager.cs
4641         (TypeManager.builder_to_type_param): New static field.
4642         (TypeManager.AddTypeParameter): New static method.
4643         (TypeManager.LookupTypeParameter): New public method.
4644
4645 2004-03-30  Martin Baulig  <martin@ximian.com>
4646
4647         * generic.cs (TypeParameter.DefineType): Return a boolean and use
4648         the new API to actually define the constructor constraint.
4649
4650         * typemanager.cs
4651         (TypeManager.new_constraint_attr_type): New static field.
4652         (TypeManager.InitCoreTypes): Initialize it.
4653
4654 2004-03-30  Martin Baulig  <martin@ximian.com>
4655
4656         * generic.cs (Constraints): Completed error checking, use correct
4657         error numbers.
4658
4659 2004-03-29  Martin Baulig  <martin@ximian.com>
4660
4661         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
4662
4663         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4664         public version which takes a `ParameterData pd' instead of an
4665         `ArrayList args'.
4666
4667 2004-03-29  Martin Baulig  <martin@ximian.com>
4668
4669         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
4670         not a MethodInfo.       
4671
4672 2004-03-29  Martin Baulig  <martin@ximian.com>
4673
4674         * expression.cs (Argument.ResolveMethodGroup): If we're a
4675         ConstructedType, call GetMemberAccess() on it.  
4676
4677 2004-03-29  Martin Baulig  <martin@ximian.com>
4678
4679         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
4680         (MethodCore.CheckGenericOverride): When overriding a generic
4681         method, check whether the constraints match.
4682
4683         * support.cs (GenericConstraints): New public interface.
4684         (ParameterData.GenericConstraints): New public method.
4685
4686         * parameter.cs (Parameter.Resolve): Check whether we're a generic
4687         method parameter and compute our constraints if appropriate.
4688         (Parameter.GenericConstraints): New public property.
4689
4690         * generic.cs (Constraints): Implement GenericConstraints.
4691
4692 2004-03-29  Martin Baulig  <martin@ximian.com>
4693
4694         * decl.cs (MemberCache.FindMemberToOverride): Use
4695         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
4696
4697 2004-03-29  Martin Baulig  <martin@ximian.com>
4698
4699         * generic.cs (GenericMethod.Define): Resolve our type parameters.
4700
4701 2004-03-29  Martin Baulig  <martin@ximian.com>
4702
4703         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
4704         not allowed on non-generic declarations").
4705
4706 2004-03-29  Martin Baulig  <martin@ximian.com>
4707
4708         * expression.cs (Invocation.InferTypeArguments): Added overloaded
4709         public version of this method.
4710
4711         * class.cs (MethodCore.IsDuplicateImplementation): Use
4712         Invocation.InferTypeArguments() to check this.
4713
4714 2004-03-29  Martin Baulig  <martin@ximian.com>
4715
4716         * convert.cs: Use TypeManager.IsDelegateType() instead of
4717         comparing types correctly.
4718
4719 2004-03-29  Martin Baulig  <martin@ximian.com>
4720
4721         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
4722         types directly to make it work for generic instances.
4723
4724         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
4725
4726 2004-03-29  Martin Baulig  <martin@ximian.com>
4727
4728         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
4729         support for arrays.     
4730
4731 2004-03-24  Martin Baulig  <martin@ximian.com>
4732
4733         * decl.cs (DeclSpace.FindType): Also use
4734         TypeManager.CheckGeneric() for types from the using clauses.
4735
4736 2004-03-23  Martin Baulig  <martin@ximian.com>
4737
4738         * expression.cs (Invocation.OverloadResolve): Added `bool
4739         may_fail' argument and use it instead of the Location.IsNull() hack.
4740
4741 2004-03-23  Martin Baulig  <martin@ximian.com>
4742
4743         * expression.cs (Invocation.InferType): Use correct type inference
4744         rules here.     
4745
4746 2004-03-23  Martin Baulig  <martin@ximian.com>
4747
4748         * ecore.cs (MethodGroupExpr.Name): Use
4749         TypeManager.CSharpSignature() instead of just the name.
4750
4751         * expression.cs (Invocation.OverloadResolve): Provide better error
4752         reporting.
4753         (Invocation.DoResolve): OverloadResolve() never returns null
4754         without reporting an error, so removed the error -6 reporting here.
4755
4756 2004-03-23  Martin Baulig  <martin@ximian.com>
4757
4758         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
4759         generic methods.
4760
4761         * cs-parser.jay (delegate_declaration): Support generic delegates.
4762
4763         * delegate.cs: Support generic delegates.
4764
4765 2004-03-22  Martin Baulig  <martin@ximian.com>
4766
4767         * expression.cs (Invocation.InferParamsTypeArguments): New static
4768         method; does type inference for params arguments.
4769
4770 2004-03-21  Martin Baulig  <martin@ximian.com>
4771
4772         * typemanager.cs (TypeManager.IsGenericMethod): New public static
4773         method; checks whether a method is a generic method.    
4774
4775         * expression.cs (Invocation.InferTypeArguments): New static method;
4776         infer type arguments for generic method invocation.
4777
4778         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
4779         property; we set this to true if we're resolving a generic method
4780         invocation and the user specified type arguments, ie. we're not
4781         doing type inference.
4782
4783 2004-03-20  Martin Baulig  <martin@ximian.com>
4784
4785         * class.cs (MethodData.DeclaringType): New public property.
4786         (MethodData.Define): Set DeclaringType here.
4787         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
4788         instead of OperatorMethodBuilder.DeclaringType.
4789
4790 2004-03-20  Martin Baulig  <martin@ximian.com>
4791
4792         * cs-tokenizer.cs (xtoken): Return a special
4793         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
4794
4795         * cs-parser.jay (default_value_expression): Switch to the new
4796         syntax (14.5.13).
4797
4798 2004-03-19  Martin Baulig  <martin@ximian.com>
4799
4800         * decl.cs (MemberName): New class.  We use this to "construct"
4801         namespace_or_type_name's.
4802
4803         * generics.cs (TypeArguments.GetDeclarations): New public method;
4804         returns the type arguments as a string[] and reports a CS0081 if
4805         one of them is not an identifier.
4806
4807         * class.cs (MemberBase): The .ctor now takes the name as a
4808         MemberName instead of a string.
4809         (MemberBase.ExplicitInterfaceName): Changed type from string to
4810         Expression.
4811         (MemberBase.DoDefine): If we're an explicit implementation, the
4812         InterfaceType may be a generic instance.
4813
4814         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
4815         (namespace_name): Call MemberName.GetName () to transform the
4816         MemberName into a string and ensure we don't have any type
4817         arguments.
4818         (type_name): Call MemberName.GetTypeExpression() to transfrom the
4819         MemberName into an expression.
4820         (method_header): Use namespace_or_type_name instead of member_name.     
4821
4822 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
4823
4824         * rootcontext.cs: Add new types to the boot resolution.
4825
4826         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
4827         MulticastDelegate is not allowed.
4828
4829         * typemanager.cs: Add new types to lookup: System.TypedReference
4830         and ArgIterator.
4831
4832         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
4833         check for TypedReference or ArgIterator, they are not allowed. 
4834
4835         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
4836         makes us properly catch 1510 in some conditions (see bug 56016 for
4837         details). 
4838
4839 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
4840
4841         * CryptoConvert.cs: update from corlib version
4842         with endian fixes.
4843
4844 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
4845
4846         * class.cs (Indexer.Define): Check indexername declaration
4847
4848 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
4849
4850         * attribute.cs (IsClsCompliant): Fixed problem with handling
4851         all three states (compliant, not-compliant, undetected).
4852
4853 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
4854
4855         * attribute.cs (Attribute): Location is now public.
4856         (Resolve): Store resolved arguments (pos_values) in attribute class.
4857         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
4858         (GetClsCompliantAttributeValue): New method that gets
4859         CLSCompliantAttribute value.
4860         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
4861         if exists else null.
4862         (AttributeTester): New class for CLS-Compliant verification routines.
4863
4864         * class.cs (Emit): Add CLS-Compliant verification.
4865         (Method.GetSignatureForError): Implemented.
4866         (Constructor.GetSignatureForError): Implemented
4867         (Constructor.HasCompliantArgs): Returns if constructor has
4868         CLS-Compliant arguments.
4869         (Constructor.Emit): Override.
4870         (Construcor.IsIdentifierClsCompliant): New method; For constructors
4871         is needed to test only parameters.
4872         (FieldBase.GetSignatureForError): Implemented.
4873         (TypeContainer): New member for storing base interfaces.
4874         (TypeContainer.FindMembers): Search in base interfaces too.
4875
4876         * codegen.cs (GetClsComplianceAttribute): New method that gets
4877         assembly or module CLSCompliantAttribute value.
4878         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
4879         for assembly.
4880         (ModuleClass.Emit): Add error 3012 test.
4881
4882         * const.cs (Emit): Override and call base for CLS-Compliant tests.
4883
4884         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
4885         state for all decl types.
4886         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
4887         if CLS-Compliant tests are required.
4888         (IsClsCompliaceRequired): New method. Analyze whether code
4889         must be CLS-Compliant.
4890         (IsExposedFromAssembly): New method. Returns true when MemberCore
4891         is exposed from assembly.
4892         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
4893         value or gets cached value.
4894         (HasClsCompliantAttribute): New method. Returns true if MemberCore
4895         is explicitly marked with CLSCompliantAttribute.
4896         (IsIdentifierClsCompliant): New abstract method. This method is
4897         used to testing error 3005.
4898         (IsIdentifierAndParamClsCompliant): New method. Common helper method
4899         for identifier and parameters CLS-Compliant testing.
4900         (VerifyClsCompliance): New method. The main virtual method for
4901         CLS-Compliant verifications.
4902         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
4903         null. I don't know why is null (too many public members !).
4904         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
4905         and get value of first CLSCompliantAttribute that found.
4906
4907         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
4908         (VerifyClsCompliance): Override and add extra tests.
4909
4910         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
4911         clscheck- disable CLS-Compliant verification event if assembly is has
4912         CLSCompliantAttribute(true).
4913
4914         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
4915         ApllyAttribute is now called in emit section as in the other cases.
4916         Possible future Emit integration.
4917         (IsIdentifierClsCompliant): New override.
4918         (VerifyClsCompliance): New override.
4919         (GetEnumeratorName): Returns full enum name.
4920
4921         * parameter.cs (GetSignatureForError): Implemented.
4922
4923         * report.cs (WarningData): New struct for Warning message information.
4924         (LocationOfPreviousError): New method.
4925         (Warning): New method. Reports warning based on the warning table.
4926         (Error_T): New method. Reports error based on the error table.
4927
4928         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
4929         verifications are done here.
4930
4931         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
4932
4933         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
4934         CLSCompliantAttribute.
4935         (all_imported_types): New member holds all imported types from other
4936         assemblies.
4937         (LoadAllImportedTypes): New method fills static table with exported types
4938         from all referenced assemblies.
4939         (Modules): New property returns all assembly modules.
4940
4941 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
4942
4943         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
4944         throwing a parser error.
4945
4946         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
4947         which removes the hardcoded get_/set_ prefixes for properties, as
4948         IL allows for the properties to be named something else.  
4949
4950         Bug #56013
4951
4952         * expression.cs: Do not override operand before we know if it is
4953         non-null.  Fix 56207
4954
4955 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4956
4957         * typemanager.cs: support for pinned variables.
4958
4959 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4960
4961         * decl.cs, typemanager.cs: Avoid using an arraylist
4962         as a buffer if there is only one result set.
4963
4964 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4965
4966         * expression.cs: Make sure you cant call a static method
4967         with an instance expression, bug #56174.
4968
4969 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
4970
4971         * class.cs (IsDuplicateImplementation): Improve error reporting to
4972         flag 663 (method only differs in parameter modifier).
4973
4974         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
4975         in preprocessor directives.
4976
4977         * location.cs (LookupFile): Allow for the empty path.
4978
4979         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
4980         better approach for some of that patch, but its failing with the
4981         CharSet enumeration.  For now try/catch will do.
4982
4983         * typemanager.cs: Do not crash if a struct does not have fields.
4984         Fixes 56150.
4985
4986 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4987
4988         * expression.cs: cs0213, cant fix a fixed expression.
4989         fixes 50231.
4990
4991 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4992
4993         * cs-parser.jay: detect invalid embeded statements gracefully.
4994         bug #51113.
4995
4996 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
4997
4998         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
4999         As a regex:
5000         s/
5001         the invocation type may not be a subclass of the tye of the item/
5002         The type of the item must be a subclass of the invocation item.
5003         /g
5004
5005         Fixes bug #50820.
5006
5007 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5008
5009         * attribute.cs: Added methods to get a string and a bool from an
5010         attribute. Required to information from AssemblyKeyFileAttribute,
5011         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5012         * codegen.cs: Modified AssemblyName creation to include support for
5013         strongnames. Catch additional exceptions to report them as CS1548.
5014         * compiler.csproj: Updated include CryptoConvert.cs.
5015         * compiler.csproj.user: Removed file - user specific configuration.
5016         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5017         Mono.Security assembly. The original class is maintained and tested in
5018         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5019         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5020         like CSC 8.0 (C# v2) supports.
5021         * Makefile: Added CryptoConvert.cs to mcs sources.
5022         * rootcontext.cs: Added new options for strongnames.
5023
5024 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5025
5026         * driver.cs: For --expect-error, report error code `2'
5027         if the program compiled with no errors, error code `1' if
5028         it compiled with an error other than the one expected.
5029
5030 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5031
5032         * compiler.csproj: Updated for Visual Studio .NET 2003.
5033         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5034         * compiler.sln: Updated for Visual Studio .NET 2003.
5035
5036 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5037
5038         * expression.cs: Fix bug #47234. We basically need to apply the
5039         rule that we prefer the conversion of null to a reference type
5040         when faced with a conversion to 'object' (csc behaviour).
5041
5042 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5043
5044         * statement.cs: Shorter form for foreach, eliminates
5045         a local variable. r=Martin.
5046
5047 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5048
5049         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5050         checks if we can use brtrue/brfalse to test for 0.
5051         * expression.cs: use the above in the test for using brtrue/brfalse.
5052         cleanup code a bit.
5053
5054 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5055
5056         * expression.cs: Rewrite string concat stuff. Benefits:
5057
5058         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5059         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5060         rather than a concat chain.
5061
5062         * typemanager.cs: Add lookups for more concat overloads.
5063
5064 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5065
5066         * expression.cs: Emit shorter il code for array init.
5067
5068         newarr
5069         dup
5070         // set 1
5071
5072         // set 2
5073
5074         newarr
5075         stloc.x
5076
5077         ldloc.x
5078         // set 1
5079
5080         ldloc.x
5081         // set 2
5082
5083 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5084
5085         * statement.cs: Before, two switch blocks would be merged if the
5086         total size of the blocks (end_item - begin_item + 1) was less than
5087         two times the combined sizes of the blocks.
5088
5089         Now, it will only merge if after the merge at least half of the
5090         slots are filled.
5091
5092         fixes 55885.
5093
5094 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5095
5096         * class.cs : csc build fix for GetMethods(). See bug #52503.
5097
5098 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5099
5100         * expression.cs: Make sure fp comparisons work with NaN.
5101         This fixes bug #54303. Mig approved this patch a long
5102         time ago, but we were not able to test b/c the runtime
5103         had a related bug.
5104
5105 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5106
5107         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5108
5109 2004-03-19  Martin Baulig  <martin@ximian.com>
5110
5111         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5112         two overloads may unify for some type parameter substitutions and
5113         report a CS0408 if appropriate.
5114
5115 2004-03-19  Martin Baulig  <martin@ximian.com>
5116
5117         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5118         error here and not in our caller.
5119
5120 2004-03-19  Martin Baulig  <martin@ximian.com>
5121
5122         * interface.cs: Completely killed this file.
5123         (Interface): We're now a TypeContainer and live in class.cs.
5124
5125         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5126         argument; we're now also called for interfaces.
5127         (TypeContainer.DefineMembers): Allow this method being called
5128         multiple times.
5129         (TypeContainer.GetMethods): New public method; formerly known as
5130         Interface.GetMethod().  This is used by PendingImplementation.
5131         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5132         it's now private and non-static.
5133         (Interface): Moved this here; it's now implemented similar to
5134         Class and Struct.
5135         (Method, Property, Event, Indexer): Added `bool is_interface'
5136         argument to their .ctor's.
5137         (MemberBase.IsInterface): New public field.
5138
5139         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5140         instances instead of InterfaceMethod, InterfaceProperty, etc.
5141         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5142         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5143
5144 2004-03-19  Martin Baulig  <martin@ximian.com>
5145
5146         * class.cs (MethodCore.IsDuplicateImplementation): New private
5147         method which does the CS0111 checking.
5148         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5149         Use IsDuplicateImplementation().
5150
5151 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5152
5153         * decl.cs (FindMemberToOverride): New method to find the correct
5154         method or property to override in the base class.
5155         * class.cs
5156             - Make Method/Property use the above method to find the
5157               version in the base class.
5158             - Remove the InheritableMemberSignatureCompare as it is now
5159               dead code.
5160
5161         This patch makes large code bases much faster to compile, as it is
5162         O(n) rather than O(n^2) to do this validation.
5163
5164         Also, it fixes bug 52458 which is that nested classes are not
5165         taken into account when finding the base class member.
5166
5167         Reviewed/Approved by Martin.
5168
5169 2004-03-17  Martin Baulig  <martin@ximian.com>
5170
5171         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5172         of type arguments into account; use the `real_num_type_args'
5173         approach like in DoResolveAsTypeStep().
5174
5175         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5176         nested types.
5177
5178 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5179
5180         * interface.cs: In all interface classes removed redundant
5181         member initialization.
5182
5183 2004-03-16  Martin Baulig  <martin@ximian.com>
5184
5185         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5186
5187 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5188
5189         * decl.cs (DefineTypeAndParents): New helper method to define a
5190         type's containers before the type itself is defined;  This is a
5191         bug exposed by the recent changes to Windows.Forms when an
5192         implemented interface was defined inside a class that had not been
5193         built yet.   
5194
5195         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5196
5197         (Check): Loop correctly to report errors modifiers
5198         (UNSAFE was not in the loop, since it was the same as TOP).
5199
5200         * interface.cs: Every interface member now takes a ModFlags,
5201         instead of a "is_new" bool, which we set on the base MemberCore. 
5202
5203         Every place where we called "UnsafeOk" in the interface, now we
5204         call the proper member (InterfaceMethod.UnsafeOK) instead to get
5205         the unsafe settings from the member declaration instead of the
5206         container interface. 
5207
5208         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
5209
5210         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5211         `set_indexer_name' to the pending bits (one per type).
5212
5213         We fixed a bug today that was picking the wrong method to
5214         override, since for properties the existing InterfaceMethod code
5215         basically ignored the method name.  Now we make sure that the
5216         method name is one of the valid indexer names.
5217
5218 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
5219  
5220         * support.cs (SeekableStreamReader): Keep track of stream byte
5221         positions and don't mix them with character offsets to the buffer.
5222
5223         Patch from Gustavo Giráldez
5224
5225 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
5226
5227         * interface.cs (InterfaceSetGetBase): Removed double member
5228         initialization, base class does it as well.
5229
5230 2004-03-13  Martin Baulig  <martin@ximian.com>
5231
5232         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5233         when compiling corlib.
5234
5235 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
5236
5237         * convert.cs (ExplicitConversion): We were reporting an error on
5238         certain conversions (object_type source to a value type, when the
5239         expression was `null') before we had a chance to pass it through
5240         the user defined conversions.
5241
5242         * driver.cs: Replace / and \ in resource specifications to dots.
5243         Fixes 50752
5244
5245         * class.cs: Add check for duplicate operators.  Fixes 52477
5246
5247 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
5248
5249         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5250         that are in the middle of the statements, not only at the end.
5251         Fixes #54987
5252
5253         * class.cs (TypeContainer.AddField): No longer set the
5254         `HaveStaticConstructor' flag, now we call it
5255         `UserDefineStaticConstructor' to diferentiate the slightly
5256         semantic difference.
5257
5258         The situation is that we were not adding BeforeFieldInit (from
5259         Modifiers.TypeAttr) to classes that could have it.
5260         BeforeFieldInit should be set to classes that have no static
5261         constructor. 
5262
5263         See:
5264
5265         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5266
5267         And most importantly Zoltan's comment:
5268
5269         http://bugzilla.ximian.com/show_bug.cgi?id=44229
5270
5271         "I think beforefieldinit means 'it's ok to initialize the type sometime 
5272          before its static fields are used', i.e. initialization does not need
5273          to be triggered by the first access to the type. Setting this flag
5274          helps the JIT to compile better code, since it can run the static
5275          constructor at JIT time, and does not need to generate code to call it
5276          (possibly lots of times) at runtime. Unfortunately, mcs does not set
5277          this flag for lots of classes like String. 
5278          
5279          csc sets this flag if the type does not have an explicit static 
5280          constructor. The reasoning seems to be that if there are only static
5281          initalizers for a type, and no static constructor, then the programmer
5282          does not care when this initialization happens, so beforefieldinit
5283          can be used.
5284          
5285          This bug prevents the AOT compiler from being usable, since it 
5286          generates so many calls to mono_runtime_class_init that the AOT code
5287          is much slower than the JITted code. The JITted code is faster, 
5288          because it does not generate these calls if the vtable is type is
5289          already initialized, which is true in the majority of cases. But the
5290          AOT compiler can't do this."
5291
5292 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
5293
5294         * class.cs (MethodData.Emit): Refactor the code so symbolic
5295         information is generated for destructors;  For some reasons we
5296         were taking a code path that did not generate symbolic information
5297         before. 
5298
5299 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
5300
5301         * class.cs: Create a Constructor.CheckBase method that
5302         takes care of all validation type code. The method
5303         contains some code that was moved from Define.
5304
5305         It also includes new code that checks for duplicate ctors.
5306         This fixes bug #55148.
5307
5308 2004-03-09  Joshua Tauberer <tauberer@for.net>
5309
5310         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5311         a { ... }-style array creation invokes EmitStaticInitializers
5312         which is not good for reference-type arrays.  String, decimal
5313         and now null constants (NullCast) are not counted toward
5314         static initializers.
5315
5316 2004-03-05  Martin Baulig  <martin@ximian.com>
5317
5318         * location.cs (SourceFile.HasLineDirective): New public field;
5319         specifies whether the file contains or is referenced by a "#line"
5320         directive.
5321         (Location.DefineSymbolDocuments): Ignore source files which
5322         either contain or are referenced by a "#line" directive.        
5323
5324 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
5325
5326         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5327         direct access to our parent, so check the method inline there.
5328
5329 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
5330
5331         * expression.cs (Invocation.EmitCall): Miguel's last commit
5332         caused a regression. If you had:
5333
5334             T t = null;
5335             t.Foo ();
5336
5337         In Foo the implict this would be null.
5338
5339 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
5340
5341         * expression.cs (Invocation.EmitCall): If the method is not
5342         virtual, do not emit a CallVirt to it, use Call.
5343
5344         * typemanager.cs (GetFullNameSignature): Improve the method to
5345         cope with ".ctor" and replace it with the type name.
5346
5347         * class.cs (ConstructorInitializer.Resolve): Now the method takes
5348         as an argument the ConstructorBuilder where it is being defined,
5349         to catch the recursive constructor invocations.
5350
5351 2004-03-16  Martin Baulig  <martin@ximian.com>
5352
5353         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5354         ConstructedType, call ResolveType() on it to get the type rather
5355         than just using `expr.Type'.
5356
5357 2004-03-16  Martin Baulig  <martin@ximian.com>
5358
5359         * generics.cs (ConstructedType.GetMemberAccess): Take the
5360         EmitContext instead on the TypeExpr and use
5361         ec.TypeContainer.CurrentType/ec.ContainerType.
5362
5363 2004-03-16  Martin Baulig  <martin@ximian.com>
5364
5365         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5366         parameters before aliases.
5367
5368 2004-03-16  Martin Baulig  <martin@ximian.com>
5369
5370         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5371         New oublic function; checks whether two generic instances may become
5372         equal under some instantiations (26.3.1).
5373
5374         * class.cs (TypeContainer.Define): Call
5375         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5376         error.
5377
5378 2004-03-16  Martin Baulig  <martin@ximian.com>
5379
5380         * class.cs (TypeContainer.GetClassBases): Moved
5381         Error_TypeParameterAsBase() here and also check whether the base
5382         class is not an attribute.
5383
5384 2004-03-16  Martin Baulig  <martin@ximian.com>
5385
5386         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5387
5388 2004-03-16  Martin Baulig  <martin@ximian.com>
5389
5390         * class.cs (Error_TypeParameterAsBase): Use correct error number
5391         here (CS0689).  
5392
5393 2004-03-16  Martin Baulig  <martin@ximian.com>
5394
5395         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5396         for generics.
5397
5398         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5399         error reporting.
5400
5401 2004-03-15  Martin Baulig  <martin@ximian.com>
5402
5403         * typemanager.cs (TypeManager.GetFullName): New public method.
5404         (TypeManager.MemberLookup): Added `int_num_type_arguments'
5405         argument; only return members with the correct number of type
5406         arguments.
5407         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5408         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5409         whether the number of type arguments matches.
5410
5411         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5412         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5413
5414         * expression.cs (MemberAccess): Added public `NumTypeArguments'
5415         field; it's set by the protected .ctor when we're actually a
5416         GenericMemberAccess.
5417         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5418         arguments and pass it to MemberLookupFinal ().
5419
5420         * ecore.cs (Expression.MemberLookup): Added `int
5421         num_type_arguments' argument; only return members with the correct
5422         number of type arguments.
5423         (Expression.MemberLookupFailed): Check whether the MemberLookup
5424         failed because we did not have the correct number of type
5425         arguments; report CS0305 in this case.
5426
5427         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5428         `e.ResolveAsTypeTerminal()' already did so.
5429
5430 2004-03-15  Martin Baulig  <martin@ximian.com>
5431
5432         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5433         we're a ConstructedType; in this case, the caller must report an
5434         error (for instance CS0131).
5435
5436         * generic.cs (TypeArguments): Added Location argument to the .ctor.
5437         (TypeArguments.Resolve): Actually report errors here.
5438
5439 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5440
5441         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5442         `set_indexer_name' to the pending bits (one per type).
5443
5444         We fixed a bug today that was picking the wrong method to
5445         override, since for properties the existing InterfaceMethod code
5446         basically ignored the method name.  Now we make sure that the
5447         method name is one of the valid indexer names.
5448
5449 2004-03-15  Martin Baulig  <martin@ximian.com>
5450
5451         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5452         for generic instances.
5453
5454 2004-03-13  Martin Baulig  <martin@ximian.com>
5455
5456         * class.cs (TypeContainer.DefineType): Call
5457         TypeManager.AddUserType() immediately after creating the
5458         TypeBuilder; pass all type parameters when creating the
5459         CurrentType.
5460
5461         * decl.cs (DeclSpace.FindNestedType): New public method.
5462         (DeclSpace.FindType): Added `int num_type_args' argument; only
5463         return types with the correct number of type parameters.
5464         (DeclSpace.CountTypeParams): New public property.
5465
5466         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
5467         the number of type parameters; defaults to zero.
5468
5469         * generic.cs (TypeArguments.Count): New public property.
5470         (ConstructedType.DoResolveAsTypeStep): First call
5471         ds.FindNestedType() to find out whether we're nested in the
5472         current generic type; in this case, we inherit all type parameters
5473         from the current class.
5474
5475         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
5476         num_type_args' argument.
5477         (RootContext.LookupType): Added overloaded version which takes the
5478         number of type arguments; only return types with the correct
5479         number of type arguments.
5480
5481         * typemanager.cs (TypeManager.CheckGeneric): New public function;
5482         checks whether `Type t' has `int num_type_args'.
5483
5484 2004-03-13  Martin Baulig  <martin@ximian.com>
5485
5486         * generic.cs (GenericMethod.DefineType): New method; calls
5487         DefineType() on all the type parameters.
5488
5489         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
5490         (MethodData.Define): If we're a generic method, call
5491         GenericMethod.DefineType() to define the type parameters.       
5492
5493 2004-03-10  Martin Baulig  <martin@ximian.com>
5494
5495         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
5496         instead of IsAssignableFrom.    
5497
5498 2004-03-10  Martin Baulig  <martin@ximian.com>
5499
5500         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
5501
5502         * support.cs (ParameterData.HasArrayParameter): New property.
5503         (ReflectionParameters.ctor): Take a MethodBase instead of a
5504         ParameterInfo[].  If we have any type parameters, get the generic
5505         method definition and ask it whether we have variable arguments.
5506
5507 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
5508
5509         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
5510         routines to check if a type is an enumerable/enumerator allow
5511         classes that implement the IEnumerable or IEnumerator interfaces.
5512
5513         * class.cs (Property, Operator): Implement IIteratorContainer, and
5514         implement SetYields.
5515
5516         (Property.Define): Do the block swapping for get_methods in the
5517         context of iterators.   We need to check if Properties also
5518         include indexers or not.
5519
5520         (Operator): Assign the Block before invoking the
5521         OperatorMethod.Define, so we can trigger the Iterator code
5522         replacement. 
5523
5524         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
5525         Property and Operator classes are not created when we parse the
5526         declarator but until we have the block completed, so we use a
5527         singleton SimpleIteratorContainer.Simple to flag whether the
5528         SetYields has been invoked.
5529
5530         We propagate this setting then to the Property or the Operator to
5531         allow the `yield' to function.
5532
5533 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
5534
5535         * codegen.cs: Implemented attribute support for modules.
5536         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
5537         Assembly/Module functionality.
5538
5539         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
5540         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
5541         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
5542
5543 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
5544
5545         * interface.cs (FindMembers): The operation is performed on all base
5546         interfaces and not only on the first. It is required for future CLS Compliance patch.
5547
5548 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
5549
5550         * statement.cs, codegen.cs:
5551         This patch deals with patterns such as:
5552
5553         public class List : IEnumerable {
5554
5555                 public MyEnumerator GetEnumerator () {
5556                         return new MyEnumerator(this);
5557                 }
5558
5559                 IEnumerator IEnumerable.GetEnumerator () {
5560                         ...
5561                 }
5562                 
5563                 public struct MyEnumerator : IEnumerator {
5564                         ...
5565                 }
5566         }
5567
5568         Before, there were a few things we did wrong:
5569         1) we would emit callvirt on a struct, which is illegal
5570         2) we emited ldarg when we needed to emit ldarga
5571         3) we would mistakenly call the interface methods on an enumerator
5572         type that derived from IEnumerator and was in another assembly. For example:
5573
5574         public class MyEnumerator : IEnumerator
5575
5576         Would have the interface methods called, even if there were public impls of the
5577         method. In a struct, this lead to invalid IL code.
5578
5579 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
5580
5581         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
5582           renamed to Emit.
5583
5584         * delegate.cs (Define): Fixed crash when delegate type is undefined.
5585
5586 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
5587
5588         * cs-parser.jay: Fix small regression: we were not testing V2
5589         compiler features correctly.
5590
5591         * interface.cs: If the emit context is null, then create one
5592
5593 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
5594
5595         * decl.cs (GetSignatureForError): New virtual method to get full name
5596           for error messages.
5597
5598         * attribute.cs (IAttributeSupport): New interface for attribute setting.
5599           Now it is possible to rewrite ApplyAttributes method to be less if/else.
5600
5601         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
5602           Duplicated members and code in these classes has been removed.
5603           Better encapsulation in these classes.
5604
5605 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
5606
5607         * assign.cs (Assign.DoResolve): When dealing with compound
5608         assignments, there is a new rule in ECMA C# 2.4 (might have been
5609         there before, but it is documented here) that states that in:
5610
5611         a op= b;
5612
5613         If b is of type int, and the `op' is a shift-operator, then the
5614         above is evaluated as:
5615
5616         a = (int) a op b 
5617
5618         * expression.cs (Binary.ResolveOperator): Instead of testing for
5619         int/uint/long/ulong, try to implicitly convert to any of those
5620         types and use that in pointer arithmetic.
5621
5622         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
5623         method to print information for from the type, not from the
5624         null-method we were given.
5625
5626 2004-02-01  Duncan Mak  <duncan@ximian.com>
5627
5628         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
5629         parsing for cmd, fixes bug #53694.
5630
5631 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
5632
5633         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
5634         in the member name duplication tests. Property and operator name duplication
5635         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
5636
5637 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
5638
5639         * interface.cs (PopulateMethod): Fixed crash when interface method
5640         returns not existing type (error test cs0246-3.cs).
5641
5642 2004-02-02  Ravi Pratap M <ravi@ximian.com>
5643
5644         * cs-parser.jay (interface_accessors): Re-write actions to also
5645         store attributes attached to get and set methods. Fix spelling
5646         while at it.
5647
5648         (inteface_property_declaration): Modify accordingly.
5649
5650         (InterfaceAccessorInfo): New helper class to store information to pass
5651         around between rules that use interface_accessors.
5652
5653         * interface.cs (Emit): Apply attributes on the get and set
5654         accessors of properties and indexers too.
5655
5656         * attribute.cs (ApplyAttributes): Modify accordingly to use the
5657         right MethodBuilder when applying attributes to the get and set accessors.
5658
5659 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
5660
5661         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
5662
5663 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
5664
5665         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
5666
5667 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
5668
5669         * cs-parser.jay: Remove YIELD token, instead use the new grammar
5670         changes that treat `yield' specially when present before `break'
5671         or `return' tokens.
5672
5673         * cs-tokenizer.cs: yield is no longer a keyword.
5674
5675 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
5676
5677         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
5678         setting for default constructors.
5679         For default constructors are almost every time set wrong Modifier. The
5680         generated IL code has been alright. But inside mcs this values was
5681         wrong and this was reason why several of my CLS Compliance tests
5682         failed.
5683
5684 2004-02-27  Martin Baulig  <martin@ximian.com>
5685
5686         * generics.cs (ConstructedType.ResolveType): Make the nested type
5687         stuff actually work.
5688
5689 2004-02-25  Martin Baulig  <martin@ximian.com>
5690
5691         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
5692         property; returns the type parameters just from the current type,
5693         ie. with the ones from outer classes.
5694         (DeclSpace.LookupGeneric): First search in the current class, then
5695         in outer classes.
5696         (DeclSpace.initialize_type_params): When hiding a type parameter
5697         from an outer class, put it into the `type_param_list' anyways.
5698
5699         * expression.cs (MemberAccess.expr): Made this field protected.
5700
5701         * class.cs (TypeContainer.Define): The `CurrentType' just contains
5702         the type parameters from the current class.
5703
5704         * generic.cs (ConstructedType.ResolveType): Support nested generic
5705         types by taking the type parameters which we inherit from outer
5706         classes into account.
5707         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
5708         support for nested generic types.
5709
5710 2004-02-23  Martin Baulig  <martin@ximian.com>
5711
5712         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
5713         field and check whether we're nested inside a generic type.
5714         (DeclSpace.ResolveType): If we're resolving to a generic type
5715         definition, create a ConstructedType and return its resolved type.
5716         (DeclSpace.initialize_type_params): New private method;
5717         initializes the `type_param_list' field from the type parameters
5718         from this and all enclosing classes.
5719         (DeclSpace.TypeParameters): Call initialize_type_params() unless
5720         we're already initialized.
5721
5722 2004-02-23  Martin Baulig  <martin@ximian.com>
5723
5724         * class.cs (Method.Define): Create the generic method before
5725         calling DoDefine().
5726         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
5727         the TypeContainer one); we use this for generic methods.
5728
5729         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
5730         parent's TypeBuilder.
5731
5732 2004-02-18  Martin Baulig  <martin@ximian.com>
5733
5734         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
5735         to check for equality.
5736
5737 2004-02-05  Martin Baulig  <martin@ximian.com>
5738
5739         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
5740         `ec.TypeContainer.CurrentType', use it instead of
5741         `ec.ContainerType' to check whether we're in the type's ctor.
5742
5743 2004-01-29  Martin Baulig  <martin@ximian.com>
5744
5745         * expression.cs (Invocation.DoResolve): If we're a
5746         `ConstructedType', then we're actually a generic method, so
5747         rewrite the expr as a GenericMemberAccess.
5748
5749         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
5750         here; manually parse it into a string.
5751
5752 2004-01-28  Martin Baulig  <martin@ximian.com>
5753
5754         * typemanager.cs (TypeManager.IsEqual): New static method.
5755         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
5756         check for equality instead of using `=='.
5757
5758 2004-01-26  Martin Baulig  <martin@ximian.com>
5759
5760         * decl.cs (DeclSpace.CurrentType): New public field.
5761
5762         * expression.cs (This.ResolveBase): If we have an
5763         `ec.TypeContainer.CurrentType', use it instead of
5764         `ec.ContainerType'.
5765
5766         * class.cs (TypeContainer.DefineType): If we're a generic type,
5767         create the `CurrentType' (unresolved).
5768         (TypeContainer.GenericType): New private field.
5769         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
5770         it and store it in `GenericType' before creating the MemberCache.
5771         (TypeContainer.GetMembers): If we have a `GenericType', call
5772         TypeManager.FindMembers() on it.
5773
5774         * interface.cs (Interface.GenericType): New private field.
5775         (Interface.DefineType): If we're a generic type, create the
5776         `CurrentType' (unresolved).
5777         (Interface.DefineMembers): If we have a `CurrentType', resolve it
5778         and store it in `GenericType' before creating the MemberCache.
5779         (Interface.GetMembers): If we have a `GenericType', call
5780         TypeManager.FindMembers() on it.
5781
5782 2004-01-22  Martin Baulig  <martin@ximian.com>
5783
5784         * cs-parser.jay (namespace_or_type_name): Return an Expression,
5785         not a QualifiedIdentifier.  This is what `type_name_expression'
5786         was previously doing.
5787         (type_name_expression): Removed; the code is now in
5788         `namespace_or_type_name'.
5789         (qualified_identifier): Removed, use `namespace_or_type_name'
5790         instead.
5791         (QualifiedIdentifier): Removed this class.      
5792
5793 2004-01-22  Martin Baulig  <martin@ximian.com>
5794
5795         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
5796         not a string as alias name.
5797
5798 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
5799
5800         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
5801         #52730 bug, and instead compute correctly the need to use a
5802         temporary variable when requesting an address based on the
5803         static/instace modified of the field and the constructor.
5804  
5805 2004-01-21  Martin Baulig  <martin@ximian.com>
5806
5807         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
5808         class and namespace before looking up aliases.  Fixes #52517.
5809
5810 2004-01-21  Martin Baulig  <martin@ximian.com>
5811
5812         * flowanalysis.cs (UsageVector.Merge): Allow variables being
5813         assinged in a 'try'; fixes exception4.cs.
5814
5815 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5816         * class.cs : Implemented parameter-less constructor for TypeContainer
5817
5818         * decl.cs: Attributes are now stored here. New property OptAttributes
5819
5820         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
5821
5822         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
5823
5824 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5825
5826         * typemanager.cs (CSharpSignature): Now reports also inner class name.
5827           (CSharpSignature): New method for indexer and property signature.
5828
5829 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5830
5831         * pending.cs (IsVirtualFilter): Faster implementation.
5832
5833 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5834
5835         * typemanager.cs: Avoid inclusion of same assembly more than once.
5836
5837 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5838
5839         * cs-parser.jay: Fixed problem where the last assembly attribute
5840           has been applied also to following declaration (class, struct, etc.)
5841           
5842 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
5843
5844         * class.cs: Added error CS0538, CS0539 reporting.
5845         Fixed crash on Microsoft runtime when field type is void.
5846
5847         * cs-parser.jay: Added error CS0537 reporting.
5848
5849         * pending.cs: Added error CS0535 reporting.
5850         Improved error report for errors CS0536, CS0534.
5851
5852 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
5853
5854         Merge a few bits from the Anonymous Method MCS tree.
5855
5856         * statement.cs (ToplevelBlock): New class for toplevel methods,
5857         will hold anonymous methods, lifted variables.
5858
5859         * cs-parser.jay: Create toplevel blocks for delegates and for
5860         regular blocks of code. 
5861
5862 2004-01-20  Martin Baulig  <martin@ximian.com>
5863
5864         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
5865         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
5866         and `NeedExplicitReturn'; added `IsLastStatement'.
5867         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
5868         have a `ReturnLabel' or we're not unreachable.
5869
5870         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
5871         child's reachability; don't just override ours with it.  Fixes
5872         #58058 (lluis's example).
5873         (FlowBranching): Added public InTryOrCatch(), InCatch(),
5874         InFinally(), InLoop(), InSwitch() and
5875         BreakCrossesTryCatchBoundary() methods.
5876
5877         * statement.cs (Return): Do all error checking in Resolve().
5878         Unless we are the last statement in a top-level block, always
5879         create a return label and jump to it.
5880         (Break, Continue): Do all error checking in Resolve(); also make
5881         sure we aren't leaving a `finally'.
5882         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
5883         statement in a top-level block.
5884         (Block.Flags): Added `IsDestructor'.
5885         (Block.IsDestructor): New public property.
5886
5887 2004-01-20  Martin Baulig  <martin@ximian.com>
5888
5889         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
5890
5891 2004-01-20  Martin Baulig  <martin@ximian.com>
5892
5893         * statement.cs (Statement.ResolveUnreachable): New public method.
5894         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
5895         (Block.Resolve): Resolve unreachable statements.
5896
5897 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5898
5899         * expression.cs: We need to fix the case where we do
5900         not have a temp variable here.
5901
5902         * assign.cs: Only expression compound assignments need
5903         temporary variables.
5904
5905 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
5906
5907         * flowanalysis.cs: Reduce memory allocation in a few ways:
5908           - A block with no variables should not allocate a bit
5909             vector for itself.
5910           - A method with no out parameters does not need any tracking
5911             for assignment of the parameters, so we need not allocate
5912             any data for it.
5913           - The arrays:
5914                 public readonly Type[] VariableTypes;
5915                 public readonly string[] VariableNames;
5916             Are redundant. The data is already stored in the variable
5917             map, so we need not allocate another array for it.
5918           - We need to add alot of checks for if (params | locals) == null
5919             due to the first two changes.
5920
5921 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
5922
5923         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
5924         implement IMemoryLocation, we store a copy on a local variable and
5925         take the address of it.  Patch from Benjamin Jemlich
5926
5927         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
5928         to use a special "type_name_expression" rule which reduces the
5929         number of "QualifiedIdentifier" classes created, and instead
5930         directly creates MemberAccess expressions.
5931
5932 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
5933
5934         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
5935         that fixes #52853.  Null literal assignment to ValueType
5936
5937         * class.cs (MethodData.Emit): Instead of checking the name of the
5938         method to determine if its a destructor, create a new derived
5939         class from Method called Destructor, and test for that.  
5940
5941         * cs-parser.jay: Create a Destructor object instead of a Method.  
5942
5943         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
5944
5945         Fixes: 52933
5946
5947 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
5948
5949         * expression.cs (Binary.ResolveOperator): Perform an implicit
5950         conversion from MethodGroups to their delegate types on the
5951         Addition operation.
5952
5953         * delegate.cs: Introduce a new class DelegateCreation that is the
5954         base class for `NewDelegate' and `ImplicitDelegateCreation',
5955         factor some code in here.
5956
5957         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
5958         conversion from MethodGroups to compatible delegate types. 
5959
5960         * ecore.cs (Expression.Resolve): Do not flag error 654
5961         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
5962         we allow conversions from MethodGroups to delegate types now.
5963
5964         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
5965         assignments in v2 either.
5966
5967 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
5968
5969         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
5970         static read-only fields in ctors.
5971
5972         Applied patch from Benjamin Jemlich 
5973
5974         * expression.cs (UnaryMutator): Avoid leaking local variables. 
5975
5976 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
5977
5978         * cs-tokenizer.cs (IsCastToken): Allow the various native types
5979         here to return true, as they can be used like this:
5980
5981                 (XXX) int.MEMBER ()
5982
5983         Fixed 49836 and all the other dups
5984
5985 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
5986
5987         * driver.cs: Implement /win32res and /win32icon.
5988
5989 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
5990
5991         * cs-parser.jay: Add a rule to improve error handling for the
5992         common mistake of placing modifiers after the type.
5993
5994 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
5995
5996         * cs-parser.jay (interface_event_declaration): Catch
5997         initialization of events on interfaces, and report cs0068
5998
5999         * cs-parser.jay (interface_event_declaration): Catch
6000         initialization of events. 
6001
6002         * ecore.cs: Better report missing constructors.
6003
6004         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6005         the error reporting done in the wrong place.  Fix.
6006
6007         * expression.cs (Binary.ResolveOperator): Catch the 
6008         operator + (E x, E y) error earlier, and later allow for implicit
6009         conversions in operator +/- (E e, U x) from U to the underlying
6010         type of E.
6011
6012         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6013         52596, if the container class is abstract, the default constructor
6014         is protected otherwise its public (before, we were always public).
6015
6016         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6017         fixed statement.
6018
6019         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6020         Jemlich that fixes bug #52597, MCS was generating invalid code for
6021         idisposable structs.   Thanks to Ben for following up with this
6022         bug as well.
6023
6024 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6025
6026         * driver.cs: Allow assemblies without code to be generated, fixes
6027         52230.
6028
6029 2004-01-07  Nick Drochak <ndrochak@gol.com>
6030
6031         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6032
6033 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6034
6035         * cs-parser.jay: Add rules to improve error reporting if fields or
6036         methods are declared at the namespace level (error 116)
6037
6038         * Add rules to catch event add/remove
6039
6040 2004-01-04  David Sheldon <dave-mono@earth.li>
6041
6042   * expression.cs: Added matching ")" to error message for 
6043   CS0077
6044
6045 2004-01-03 Todd Berman <tberman@gentoo.org>
6046
6047         * ecore.cs, attribute.cs:
6048         Applying fix from #52429.
6049
6050 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6051
6052         * ecore.cs, expression.cs, statement.cs:
6053         Total rewrite of how we handle branching. We
6054         now handle complex boolean expressions with fewer
6055         jumps. As well if (x == 0) no longer emits a ceq.
6056
6057         if (x is Foo) is much faster now, because we generate
6058         better code.
6059
6060         Overall, we get a pretty big improvement on our benchmark
6061         tests. The code we generate is smaller and more readable.
6062
6063         I did a full two-stage bootstrap. The patch was reviewed
6064         by Martin and Miguel.
6065
6066 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6067
6068         * cs-parser.jay: Make primary_expression not take a QI.
6069         we dont need this because the member_access rule covers
6070         us here. So we replace the rule with just IDENTIFIER.
6071
6072         This has two good effects. First, we remove a s/r conflict.
6073         Second, we allocate many fewer QualifiedIdentifier objects.
6074
6075 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6076
6077         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6078         set the correct information via SRE. This prevents
6079         hanging on the MS runtime. Fixes #29374.
6080
6081 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6082
6083         * convert.cs: correctly handle conversions to value types
6084         from Enum and ValueType as unboxing conversions.
6085
6086         Fixes bug #52569. Patch by Benjamin Jemlich.
6087
6088 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6089
6090         * expression.cs (BetterConversion): Prefer int -> uint
6091         over int -> ulong (csc's behaviour). This fixed bug #52046.
6092
6093 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6094
6095         * decl.cs (MemberCache.FindMembers): now returns a
6096         MemberInfo [].
6097
6098         * typemanager.cs: In general, go with with ^^.
6099         (CopyNewMethods): take an IList.
6100         (RealMemberLookup): Only allocate an arraylist
6101         if we copy from two sets of methods.
6102
6103         This change basically does two things:
6104         1) Fewer array lists allocated due to CopyNewMethods.
6105         2) the explicit cast in MemberList costed ALOT.
6106
6107 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6108
6109         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6110         a hashtable to avoid needless string allocations when an identifier is
6111         used more than once (the common case).
6112
6113 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6114
6115         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6116         is broken, it will not return anything. So, we
6117         have to use the information we have in mcs to
6118         do the task.
6119
6120         * typemanager.cs: Add a cache for GetInterfaces,
6121         since this will now be used more often (due to ^^)
6122
6123         (GetExplicitInterfaces) New method that gets the
6124         declared, not effective, interfaces on a type
6125         builder (eg, if you have interface IFoo, interface
6126         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6127         { IBar }.
6128
6129         This patch makes MCS able to bootstrap itself on
6130         Windows again.
6131
6132 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6133
6134         * expression.cs: Remove the Nop's that Miguel put
6135         in by mistake.
6136
6137 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6138
6139         * report.cs, codegen.cs: Give the real stack trace to
6140         the error when an exception is thrown.
6141
6142 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6143
6144         * decl.cs: only allocate hashtables for ifaces if 
6145         it is an iface!
6146
6147 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6148
6149         * expression.cs: fix the error from cs0121-2.cs
6150         (a parent interface has two child interfaces that
6151         have a function with the same name and 0 params
6152         and the function is called through the parent).
6153
6154 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6155
6156         * class.cs, rootcontext.cs, typmanager.cs: do not
6157         leak pointers.
6158
6159 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6160
6161         * codegen.cs: remove stack for the ec flow branching.
6162         It is already a linked list, so no need.
6163
6164 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6165
6166         * Makefile: Allow custom profiler here.
6167
6168 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6169
6170         * typemanager.cs (LookupType):
6171           - Use a static char [], because split takes
6172             a param array for args, so it was allocating
6173             every time.
6174           - Do not store true in a hashtable, it boxes.
6175
6176 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6177
6178         * flowanalysis.cs: bytify common enums.
6179
6180 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6181
6182         * modifiers.cs: Add a new set of flags for the
6183         flags allowed on explicit interface impls.
6184         * cs-parser.jay: catch the use of modifiers in
6185         interfaces correctly.
6186         * class.cs: catch private void IFoo.Blah ().
6187
6188         All related to bug #50572.
6189
6190 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6191
6192         * decl.cs: Rewrite the consistant accessability checking.
6193         Accessability is not linear, it must be implemented in
6194         a tableish way. Fixes #49704.
6195
6196 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6197
6198         * expression.cs: Handle negation in a checked context.
6199         We must use subtraction from zero. Fixes #38674.
6200
6201 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6202
6203         * class.cs: Ignore static void main in DLLs.
6204         * rootcontext.cs: Handle the target type here,
6205         since we are have to access it from class.cs
6206         * driver.cs: account for the above.
6207
6208 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6209
6210         * report.cs: Give line numbers and files if available.
6211
6212 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
6213
6214         * driver.cs: Implement /addmodule.
6215
6216         * typemanager.cs:  Change 'modules' field so it now contains Modules not
6217         ModuleBuilders.
6218
6219 2003-12-20  Martin Baulig  <martin@ximian.com>
6220
6221         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6222         (FieldBase.IsAssigned): Removed this field.
6223         (FieldBase.SetAssigned): New public method.
6224         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6225
6226 2003-12-20  Martin Baulig  <martin@ximian.com>
6227
6228         * expression.cs (LocalVariableReference.DoResolve): Don't set
6229         `vi.Used' if we're called from DoResolveLValue().
6230
6231         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6232         returns the usage vector it just merged into the current one -
6233         pass this one to UsageWarning().
6234         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6235         of the `EmitContext', don't call this recursively on our children.
6236
6237 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
6238
6239         * driver.cs: Implement /target:module.
6240
6241 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
6242
6243         * support.cs (CharArrayHashtable): New helper class.
6244
6245         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
6246         char arrays, not strings, so we can avoid creating a string in
6247         consume_identifier if the identifier is a keyword.
6248
6249 2003-12-16  Martin Baulig  <martin@ximian.com>
6250
6251         * statement.cs (LocalInfo.Assigned): Removed this property.
6252         (LocalInfo.Flags): Removed `Assigned'.
6253         (LocalInfo.IsAssigned): New public method; takes the EmitContext
6254         and uses flow analysis.
6255         (Block.UsageWarning): Made this method private.
6256         (Block.Resolve): Call UsageWarning() if appropriate.
6257
6258         * expression.cs (LocalVariableReference.DoResolve): Always set
6259         LocalInfo.Used here.
6260
6261 2003-12-13  Martin Baulig  <martin@ximian.com>
6262
6263         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6264         any value here; we're now using flow analysis to figure out
6265         whether a statement/block returns a value.
6266
6267 2003-12-13  Martin Baulig  <martin@ximian.com>
6268
6269         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6270         working again.
6271         (FlowBranching.MergeFinally): Don't call
6272         `branching.CheckOutParameters()' here, this is called in
6273         MergeTopBlock().
6274         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6275         when adding the `finally' vector.       
6276
6277 2003-12-13  Martin Baulig  <martin@ximian.com>
6278
6279         * flowanalysis.cs
6280         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6281         actually work and also fix #48962.
6282
6283 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6284
6285         * decl.cs: Do not check System.Object for nested types,
6286         since we know it does not have any. Big bang for buck:
6287
6288         BEFORE:
6289            Run 1:   8.35 seconds
6290            Run 2:   8.32 seconds
6291            corlib:  17.99 seconds
6292         AFTER:
6293            Run 1:   8.17 seconds
6294            Run 2:   8.17 seconds
6295            corlib:  17.39 seconds
6296
6297 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6298
6299         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6300         time we are returning 0 members, so we save alot here.
6301
6302 2003-12-11  Martin Baulig  <martin@ximian.com>
6303
6304         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6305         `MergeChild()', also just take the `FlowBranching' as argument;
6306         call Merge() on it and return the result.
6307         (FlowBranching.Merge): We don't need to do anything if we just
6308         have one sibling.
6309
6310 2003-12-11  Martin Baulig  <martin@ximian.com>
6311
6312         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6313         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
6314         Maurer for this idea.
6315
6316 2003-12-11  Martin Baulig  <martin@ximian.com>
6317
6318         * flowanalysis.cs (MergeResult): This class is now gone; we now
6319         use the `UsageVector' for this.  The reason for this is that if a
6320         branching just has one sibling, we don't need to "merge" them at
6321         all - that's the next step to do.
6322         (FlowBranching.Merge): We now return a `UsageVector' instead of a
6323         `MergeResult'.
6324
6325 2003-12-11  Martin Baulig  <martin@ximian.com>
6326
6327         Reworked flow analyis and made it more precise and bug-free.  The
6328         most important change is that we're now using a special `Reachability'
6329         class instead of having "magic" meanings of `FlowReturns'.  I'll
6330         do some more cleanups and optimizations and also add some more
6331         documentation this week.
6332
6333         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6334         largely reworked this class.
6335         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6336         the new `Reachability' class instead of having "magic" values here.
6337         (FlowBranching): We're now using an instance of `Reachability'
6338         instead of having separate `Returns', `Breaks' etc. fields.
6339
6340         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6341         based on flow analysis; ignore the return value of block.Emit ().
6342
6343 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
6344
6345         * driver.cs typemanager.cs: Find the mono extensions to corlib even
6346         if they are private.
6347
6348 2003-12-09  Martin Baulig  <martin@ximian.com>
6349
6350         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6351         call them directly on the UsageVector.
6352
6353 2003-12-09  Martin Baulig  <martin@ximian.com>
6354
6355         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6356         Changed return type from `FlowReturns' to `Reachability'.
6357
6358 2003-12-09  Martin Baulig  <martin@ximian.com>
6359
6360         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6361         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6362         `Reachable' fields with a single `Reachability' one.
6363
6364 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6365
6366         * class.cs (FindMembers): Remove foreach's.
6367
6368         Bootstrap times:
6369
6370         BEFORE
6371                 Run 1:   8.74 seconds
6372                 Run 2:   8.71 seconds
6373
6374         AFTER
6375                 Run 1:   8.64 seconds
6376                 Run 2:   8.58 seconds
6377
6378
6379 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6380
6381         * cs-parser.jay:
6382         * gen-treedump.cs:
6383         * statement.cs:
6384         This patch does a few things:
6385                 1. EmptyStatement is now a singleton, so it is never reallocated.
6386                 2. All blah is EmptyStatement constructs have been changed to
6387                    blah == EmptyStatement.Value, which is much faster and valid
6388                    now that EmptyStatement is a singleton.
6389                 3. When resolving a block, rather than allocating a new array for
6390                    the non-empty statements, empty statements are replaced with
6391                    EmptyStatement.Value
6392                 4. Some recursive functions have been made non-recursive.
6393         Mainly the performance impact is from (3), however (1) and (2) are needed for
6394         this to work. (4) does not make a big difference in normal situations, however
6395         it makes the profile look saner.
6396
6397         Bootstrap times:
6398
6399         BEFORE
6400         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6401         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6402         Total memory allocated: 56397 KB
6403
6404         AFTER
6405         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6406         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6407         Total memory allocated: 55666 KB
6408
6409 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6410
6411         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6412         than the hashtable in a hashtable version
6413
6414         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6415         we always end up concating a string. This results in a huge perf
6416         loss, because many strings have to be tracked by the GC. In this
6417         patch, we first use a hashtable that works with two keys, so that
6418         the strings do not need to be concat'ed.
6419
6420         Bootstrap times:
6421         BEFORE
6422                 Run 1:   8.74 seconds
6423                 Run 2:   8.71 seconds
6424
6425         AFTER
6426                 Run 1:   8.65 seconds
6427                 Run 2:   8.56 seconds
6428
6429 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
6430
6431         * Makefile: Add a new target `do-time' that does a quick and simple
6432         profile, leaving easy to parse output.
6433
6434 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
6435
6436         * codegen.cs (Init): Create the dynamic assembly with 
6437         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6438
6439 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6440
6441         * support.cs: Make the PtrHashtable use only one
6442         instance of its comparer.
6443
6444 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
6445
6446         * typemanager.cs: Fix lookup of GetNamespaces.
6447
6448 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
6449
6450         * expression.cs: Removed redundant line.
6451
6452         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6453         ArrayLists, use for loops with bounds.  
6454
6455         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6456         arraylist.
6457
6458         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6459         arraylists, use for loop with bounds.
6460
6461         The above three changes give us a 0.071 second performance
6462         improvement out of 3.294 seconds down to 3.223.  On my machine
6463         the above changes reduced the memory usage by 1,387 KB during
6464         compiler bootstrap.
6465
6466         * cs-parser.jay (QualifiedIdentifier): New class used to represent
6467         QualifiedIdentifiers.  Before we created a new string through
6468         concatenation, and mostly later on, the result would be
6469         manipulated by DecomposeQI through string manipulation.
6470
6471         This reduced the compiler memory usage for bootstrapping from
6472         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
6473         compile times in 0.05 seconds.
6474
6475 2003-11-28  Dick Porter  <dick@ximian.com>
6476
6477         * support.cs: Do string compares with the Invariant culture.
6478
6479         * rootcontext.cs: 
6480         * gen-treedump.cs: 
6481         * expression.cs: 
6482         * driver.cs: 
6483         * decl.cs: 
6484         * codegen.cs: 
6485         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
6486         the comparison is done with the Invariant culture.
6487
6488 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
6491         GetEnumerator method.
6492
6493         (ProbeCollectionType): Iterate starting at the most specific type
6494         upwards looking for a GetEnumerator
6495
6496         * expression.cs: Shift count can be up to 31 for int/uint and 63
6497         for long/ulong.
6498
6499 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
6500
6501         * statement.cs (Block.LookupLabel): Also look for the label on the
6502         children blocks.  Use a hash table to keep track of visited
6503         nodes. 
6504
6505         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
6506         we actually did transform the other operand, otherwise fall back
6507         to the common codepath that casts to long.
6508
6509         * cs-tokenizer.cs: Use the same code pattern as the int case.
6510         Maybe I should do the parsing myself, and avoid depending on the
6511         Parse routines to get this done.
6512
6513 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
6514
6515         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6516         which fixes bug 51347.  This time test it.
6517
6518         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
6519         attributes for example can not tell the difference between these.
6520         The difference was only a syntax feature of the language. 
6521
6522         * attribute.cs: Apply attributes to delegates.
6523
6524         * delegate.cs: Call the apply attributes method.
6525
6526 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
6527
6528         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
6529         comparing 0 vs Byte.MinValue, not the value
6530
6531         (ImplicitConversionRequired): When reporting a conversion error,
6532         use error 31 to print out the constant error instead of the
6533         simpler 29.
6534
6535         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
6536         which fixes bug 51347.
6537
6538 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
6539
6540         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
6541         which fixes the -warnaserror command line option.
6542
6543 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
6544
6545         * cfold.cs (DoNumericPromotions): During constant folding of
6546         additions on UIntConstant, special case intconstants with
6547         IntConstants like we do on the expression binary operator. 
6548
6549 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
6550
6551         * convert.cs (ImplicitReferenceConversion): We were missing a case
6552         (System.Enum are not value types or class types, so we need to
6553         classify them separatedly).
6554
6555         * driver.cs: We do not support error 2007.
6556
6557 2003-11-12 Jackson Harper <jackson@ximian.com>
6558
6559         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
6560         system directory. Also use the full file name so users can
6561         libraries names mscorlib-o-tron.dll in a non system dir.
6562         
6563 2004-01-04  David Sheldon <dave-mono@earth.li>
6564
6565         * expression.cs: Added matching ")" to error message for CS0077.
6566
6567 2003-12-19  Martin Baulig  <martin@ximian.com>
6568
6569         * typemanager.cs (TypeManager.IsEqualGenericType): New public
6570         static method; see documentation in the method.
6571         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
6572
6573         * convert.cs (Convert.ImplicitReferenceConversion,
6574         Convert.ImplicitReferenceConversionExists): Add support for
6575         generic type declarations; see gen-36.cs.
6576
6577 2003-12-19  Martin Baulig  <martin@ximian.com>
6578
6579         * pending.cs (Pending.InterfaceMethod): Use
6580         `Type.IsAssignableFrom()' instead of `=='.
6581
6582 2003-12-18  Martin Baulig  <martin@ximian.com>
6583
6584         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
6585         byref types first.
6586
6587         * convert.cs (Convert.ImplicitStandardConversionExists): Use
6588         `expr_type.Equals (target_type)' instead of `=='.
6589
6590 2003-12-08  Martin Baulig  <martin@ximian.com>
6591
6592         * generics.cs (Constraints.Types): Removed.
6593         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
6594         to Type's.
6595         (Constraints.ResolveTypes): New public method; resolves the
6596         TypeExpr's to Type's.
6597         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
6598         longer takes the constraints.
6599         (TypeParameter.DefineMethod): Likewise.
6600         (TypeParameter.DefineType): New public method.  Calls
6601         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
6602         the constraints.
6603
6604 2003-12-08  Martin Baulig  <martin@ximian.com>
6605
6606         * convert.cs (Convert.ImplicitConversionStandard): Use
6607         `expr_type.Equals (target_type)' instead of `=='.
6608
6609 2003-12-08  Martin Baulig  <martin@ximian.com>
6610
6611         * typemanager.cs (TypeManager.GetReferenceType): Call
6612         `Type.MakeByRefType ()'.
6613
6614 2003-12-08  Martin Baulig  <martin@ximian.com>
6615
6616         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
6617         just has some special meaning in some situations.  For instance,
6618         it is allowed to use `where' as the name of a variable etc.
6619
6620 2003-12-04  Martin Baulig  <martin@ximian.com>
6621
6622         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
6623         `Type.MakeArrayType()' for array types.
6624
6625 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
6626
6627         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
6628         debugging message.
6629
6630         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
6631         corlib to compile.
6632
6633 2003-11-16  Martin Baulig  <martin@ximian.com>
6634
6635         * codegen.cs (EmitContext.IsGeneric): Removed.
6636
6637         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
6638         ResolveGeneric() on the DeclSpace.
6639
6640 2003-11-16  Martin Baulig  <martin@ximian.com>
6641
6642         * generic.cs (TypeArguments.Resolve):
6643         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
6644         `ResolveType()' on it to get the Type.
6645
6646 2003-11-15  Martin Baulig  <martin@ximian.com>
6647
6648         * generic.cs (ConstructedType.GetInterfaces): Override this.
6649
6650 2003-11-14  Martin Baulig  <martin@ximian.com>
6651
6652         * interface.cs (Interface.DefineType): Define all type parameters
6653         before adding the interfaces we inherit.
6654
6655 2003-11-11  Martin Baulig  <martin@ximian.com>
6656
6657         * generic.cs (ConstructedType.ResolveType): Always call
6658         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
6659
6660 2003-11-10  Martin Baulig  <martin@ximian.com>
6661
6662         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
6663         (TypeManager.InitCoreTypes): Initialize them here, but instead of
6664         calling `ResolveType()' on them, directly assign their `Type'.
6665
6666 2003-11-08  Martin Baulig  <martin@ximian.com>
6667
6668         * generic.cs (ConstructedType): Override `IsClass' etc.
6669
6670 2003-11-08  Martin Baulig  <martin@ximian.com>
6671
6672         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
6673         return value and the `out parent' parameter.
6674         (TypeContainer.DefineType): Moved the CS0644 check into
6675         GetClassBases().  Don't pass the interface types to the
6676         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
6677         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
6678
6679         * ecore.cs (TypeExpr.IsAttribute): New property.
6680         (TypeExpr.GetInterfaces): New method.
6681
6682         * interface.cs (Interface.GetInterfaceTypeByName): Return a
6683         TypeExpr instead of a Type.
6684         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
6685         (Interface.DefineType): Don't pass the interface types to the
6686         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
6687         them later and then call `TypeBulider.AddInterfaceImplementation()'.
6688
6689         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
6690         instead of a `Type[]'.
6691         (TypeManager.RegisterBuilder): Likewise.
6692         (TypeManager.AddUserInterface): Likewise.
6693         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
6694         `Type[]' and also return a `TypeExpr[]'.
6695         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
6696
6697 2003-11-08  Martin Baulig  <martin@ximian.com>
6698
6699         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
6700         Expression.     
6701
6702 2003-11-08  Martin Baulig  <martin@ximian.com>
6703
6704         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
6705         TypeManager.ResolveExpressionTypes().
6706
6707         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
6708         instead of an Expression.
6709         (TypeExpr): This is now an abstract base class for `TypeExpression'.
6710         (TypeExpression): New public class; formerly known as `TypeExpr'.
6711
6712         * expression.cs (ComposedCast): Derive from TypeExpr.
6713
6714         * typemanager.cs (TypeManager.system_*_expr): These are now
6715         TypExpr's instead of Expression's.
6716         (TypeManager.ResolveExpressionTypes): New public static function;
6717         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
6718         of them.        
6719
6720 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
6721
6722         * expression.cs (New.DoResolve): Do not dereference value that
6723         might be a null return.
6724
6725         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
6726         sure that the constant value has the right type.  Fixes an
6727         unreported bug, similar to 50425.
6728
6729         * const.cs (Const.LookupConstantValue): Call
6730         ImplicitStandardConversionExists before doing a conversion to
6731         avoid havng the TypeManager.ChangeType do conversions.
6732
6733         Reduced the number of casts used
6734
6735         (Const.ChangeType): New routine to enable reuse of the constant
6736         type changing code from statement.
6737
6738         * typemanager.cs (ChangeType): Move common initialization to
6739         static global variables.
6740
6741         Fixes #50425.
6742
6743         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
6744         every value type to go through, even if it was void.  Fix that. 
6745
6746         * cs-tokenizer.cs: Use is_identifier_start_character on the start
6747         character of the define, and the is_identifier_part_character for
6748         the rest of the string.
6749
6750 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
6751
6752         * expression.cs (UnaryMutator.EmitCode): When I updated
6753         LocalVariableReference.DoResolve, I overdid it, and dropped an
6754         optimization done on local variable references.
6755
6756 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
6757
6758         * ecore.cs: Convert the return from Ldlen into an int.
6759
6760 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
6761
6762         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
6763         the accessibility, this is a special case for toplevel non-public
6764         classes (internal for instance).
6765
6766 2003-10-20  Nick Drochak <ndrochak@gol.com>
6767
6768         * ecore.cs: Fix typo and build.  Needed another right paren.
6769
6770 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
6771
6772         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
6773         `internal' case regular and protected, but not allowing protected
6774         to be evaluated later.  Bug 49840
6775
6776 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
6777
6778         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
6779         to kb.Nlast, and not the kb.nFirst to isolate the switch
6780         statement.
6781
6782         Extract the underlying type, so enumerations of long/ulong are
6783         treated like long/ulong.
6784
6785 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
6786
6787         * expression.cs (New): Overload the meaning of RequestedType to
6788         track the possible creation of the NewDelegate type, since
6789         DoResolve is invoked more than once for new constructors on field
6790         initialization.
6791
6792         See bugs: #48800 and #37014
6793
6794         * cs-parser.jay (declare_local_constants): Take an arraylist
6795         instead of a single constant.
6796
6797         (local_constant_declaration): It should take a
6798         constant_declarators, not a constant_declarator.  Fixes 49487
6799
6800         * convert.cs: Fix error report.
6801
6802 2003-10-13 Jackson Harper <jackson@ximian.com>
6803
6804         * typemanager.cs (TypeToCoreType): Add float and double this fixes
6805         bug #49611
6806         
6807 2003-11-03  Martin Baulig  <martin@ximian.com>
6808
6809         * expression.cs (ArrayAccess.GetStoreOpcode): Added
6810         `out bool has_type_arg'; if set, we need to pass the type to
6811         ig.Emit().
6812         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
6813         Stelem_Any/Ldelem_Any for generic parameters.   
6814
6815 2003-11-02  Martin Baulig  <martin@ximian.com>
6816
6817         * expression.cs (Invocation.EmitCall): Use
6818         `TypeManager.IsValueType()' to check whether it's a value type.
6819         Don't set `struct_call' when calling a method on a type parameter.
6820
6821 2003-11-02  Martin Baulig  <martin@ximian.com>
6822
6823         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
6824         and removed the TypeBuilder argument.
6825
6826         * typemanager.cs (TypeManager.IsValueType): Return
6827         `t.IsGenericParameter || t.IsValueType'.
6828
6829 2003-10-25  Martin Baulig  <martin@ximian.com>
6830
6831         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
6832         call ConstructedType.Resolve() on it.
6833
6834         * generic.cs (ConstructedType.Resolve): Set `type' on success.
6835
6836 2003-10-25  Martin Baulig  <martin@ximian.com>
6837
6838         * class.cs (TypeContainer.GetClassBases): Changed
6839         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
6840         CS8214 reporting here.
6841         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
6842         instead of a `Type' for our parent.  In case of a recursive
6843         declaration (see tests/gen-23.cs for an example), our parent is a
6844         ConstructedType and it doesn't have its type set.  So, first
6845         create our own TypeBuilder, then call constructed.Resolve() to get
6846         the parent's type and finally TypeBuilder.SetParent() it.
6847
6848         * ecore.cs (TypeExpr.Name): New public virtual property.
6849
6850         * generic.cs
6851         (ConstructedType): We're now a TypeExpr and not just an Expression.
6852         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
6853         arguments here; this is done later.
6854         (ConstructedType.Resolve): New public method to resolve the type
6855         arguments and bind them.
6856
6857 2003-10-21  Martin Baulig  <martin@ximian.com>
6858
6859         * convert.cs: Use `TypeManager.IsValueType' instead of
6860         'type.IsValueType' everywhere.
6861
6862         * typemanager.cs (TypeManager.IsValueType): Return true for type
6863         parameters.  The reason for this is that we need to box a type
6864         parameter when converting it to a reference type.
6865
6866         * cs-parser.jay: Added support for default value expressions.
6867
6868         * generics.cs (DefaultValueExpression): New public class.       
6869
6870 2003-10-17  Martin Baulig  <martin@ximian.com>
6871
6872         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
6873         TypeContainer so we can also use this for Interfaces.
6874         (TypeParameter.Resolve): Likewise.
6875
6876         * interface.cs (Interface.DefineType): Added support for generic
6877         interfaces.
6878
6879         * cs-parser.jay: Added support for generic structs and interfaces.
6880
6881 2003-10-17  Martin Baulig  <martin@ximian.com>
6882
6883         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
6884         call generic methods :-)
6885
6886 2003-10-16  Martin Baulig  <martin@ximian.com>
6887
6888         * cs-parser.jay (namespace_or_type_name): Only create a
6889         GenericMemberAccess if we actually have type arguments.
6890
6891 2003-10-13  Martin Baulig  <martin@ximian.com>
6892
6893         * class.cs (Method.Define): If we're a generic method, call
6894         TypeBuilder.DefineGenericMethod () before resolving
6895         the parameters.
6896         (MethodData): Added .ctor which takes an additional MethodBuilder
6897         argument; this is used for generic methods.
6898         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
6899         we already have a MethodBuilder.
6900
6901 2003-10-10  Martin Baulig  <martin@ximian.com>
6902
6903         * class.cs (Method): Added .ctor which takes a `GenericMethod'
6904         instead of a `DeclSpace'.  This is used for generic methods.
6905
6906         * cs-parser.jay (method_header): Added support for generic
6907         methods; create a `GenericMethod' instance and pass it to the
6908         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
6909         parameters and locals.
6910
6911         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
6912         since we already have the location.  Check whether we're a generic
6913         type declaration or a generic method and create the correct type
6914         parameter.
6915
6916         * generic.cs (TypeParameter.DefineMethod): New public method.
6917         (GenericMethod): New public class; derives from DeclSpace and is
6918         used for generic methods.       
6919
6920 2003-10-09  Martin Baulig  <martin@ximian.com>
6921
6922         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
6923         to the .ctor.
6924         (MethodCore.DoDefineParameters): Removed the TypeContainer
6925         argument; use the DeclSpace which was passed to the .ctor instead.
6926         (MethodCore.CheckParameter): Take a DeclSpace instead of a
6927         TypeContainer; we only need a DeclSpace here.
6928
6929 2003-10-09  Martin Baulig  <martin@ximian.com>
6930
6931         * class.cs (MethodData): Added additional `DeclSpace ds' argument
6932         to the .ctor.
6933         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
6934         EmitContext's .ctor.    
6935
6936 2003-10-09  Martin Baulig  <martin@ximian.com>
6937
6938         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
6939         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
6940         AsAccessible(), moved them as well.
6941
6942         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
6943
6944 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
6945
6946         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
6947         generation for >=, as spotted by Paolo, bug 48679.  
6948         Patch from David Waite.
6949
6950         * cs-tokenizer.cs: Add handling for #pragma.
6951
6952         * cs-parser.jay: Allow for both yield and yield return in the
6953         syntax.  The anti-cobolization of C# fight will go on!
6954
6955         * class.cs (TypeBuilder.DefineType): Catch error condition here
6956         (Parent.DefineType erroring out and returning null).
6957
6958         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
6959         coping with enumerations variables, we were mistakenly processing
6960         them as a regular value type instead of built-in types.  Fixes the
6961         bug #48063
6962
6963         * typemanager.cs (IsBuiltinOrEnum): New method.
6964
6965 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
6966
6967         * cs-parser.jay: Upgrade: yield now needs the return clause.
6968
6969 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
6970
6971         * cs-parser.jay : Renamed yyName to yyNames related to jay.
6972
6973 2003-09-29  Martin Baulig  <martin@ximian.com>
6974
6975         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
6976         inflated generic methods.
6977
6978         * generics.cs (ConstructedType): Distinguish between open and
6979         closed constructed types; correctly resolve the arguments.
6980
6981 2003-09-22  Martin Baulig  <martin@ximian.com>
6982
6983         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
6984         all type arguments meet their constraints.
6985
6986 2003-09-19  Martin Baulig  <martin@ximian.com>
6987
6988         * decl.cs (MemberCache.SetupCacheForInterface): Take a
6989         `MemberCache parent' argument.  Normally, an interface doesn't
6990         have a parent type except System.Object, but we use this in gmcs
6991         for generic type parameters.
6992
6993 2003-09-18  Martin Baulig  <martin@ximian.com>
6994
6995         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
6996         on `type.IsInterface'; don't check whether the type has a parent
6997         to determine whether it's an interface.
6998
6999 2003-09-17  Martin Baulig  <martin@ximian.com>
7000
7001         * generic.cs (ConstructedType.ToString): Always use `name' as the
7002         type name.
7003
7004 2003-09-15  Martin Baulig  <martin@ximian.com>
7005
7006         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7007
7008         * generic.cs (Constraints.Resolve): New public method; this is
7009         called to resolve the constraint types and to check whether all
7010         the constraints are correct.
7011         (Constraints.Types): New public property.
7012         (TypeParameter.Resolve): New public method; resolves all the
7013         type's constraints.
7014
7015         * class.cs (TypeContainer.DefineType): Call
7016         TypeParameter.Resolve() before actually defining the type.
7017
7018 2003-09-15  Martin Baulig  <martin@ximian.com>
7019
7020         * class.cs (TypeContainer.DefineType): Added an error flag to
7021         avoid reporting duplicate CS0146's ("class definition is
7022         circular.").
7023
7024         * driver.cs (Driver.MainDriver): Abort if
7025         RootContext.ResolveTree() reported any errors.
7026
7027 2003-09-07  Martin Baulig  <martin@ximian.com>
7028
7029         * report.cs (Error, Warning): Added overloaded versions which take
7030         a `params object[] args' and call String.Format().
7031
7032 2003-09-07  Martin Baulig  <martin@ximian.com>
7033
7034         * decl.cs (DeclSpace..ctor): Don't call
7035         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7036         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7037         (DeclSpace.RecordDecl): New method.
7038
7039         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7040
7041 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7042
7043         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7044         value attributes to be applied to ParameterBuilders.
7045
7046         * class.cs (MethodCore.LabelParameters): Make static and more
7047         generic so that it can be used from other places - like interface
7048         methods, for instance.
7049
7050         * interface.cs (Interface.Emit): Call LabelParameters before
7051         emitting attributes on the InterfaceMethod.
7052
7053 2003-09-07  Martin Baulig  <martin@ximian.com>
7054
7055         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7056         if the number of type parameters doesn't match.
7057
7058 2003-09-04  Martin Baulig  <martin@ximian.com>
7059
7060         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7061         for arrays of generic type params (ie. `!0[]').
7062
7063 2003-09-04  Martin Baulig  <martin@ximian.com>
7064
7065         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7066         for the moment.
7067
7068 2003-09-04  Martin Baulig  <martin@ximian.com>
7069
7070         * decl.cs (DeclSpace.LookupGeneric): New method.
7071         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7072         moment.
7073
7074         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7075         argument, not just a string.
7076         (TypeParameter.Define): New public method; this is called to
7077         actually define the generic parameter; after this, you can use the
7078         new `Type' property to get the type.
7079
7080 2003-09-04  Martin Baulig  <martin@ximian.com>
7081
7082         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7083         is now an ArrayList; initialize the result of the `TypeParameters'
7084         property here.
7085         (DeclSpace.GetGenericData): Removed.
7086         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7087         implement this in a different way.
7088         (DeclSpace.GetTypeParameters): Removed; there's now a
7089         `TypeParameters' property.
7090         (DeclSpace.TypeParameters): New public property.
7091
7092         * generic.cs (Constraints): Make this class public.
7093         (TypeParameter): New public class.
7094
7095 2003-09-04  Martin Baulig  <martin@ximian.com>
7096
7097         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7098         generic parameters.
7099
7100         * class.cs (TypeContainer.DefineType): Call
7101         TypeBuilder.DefineGenericParameter () on all generic parameters if
7102         this is a generic type.
7103
7104 2003-08-28  Martin Baulig  <martin@ximian.com>
7105
7106         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7107         sample-stack.il".
7108
7109         * sample-hello.cs: Compile this with gmcs: "gmcs
7110         /r:sample-stack.dll sample-hello.cs".
7111
7112 2003-08-28  Martin Baulig  <martin@ximian.com>
7113
7114         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7115         the parameters to the generic type.
7116
7117 2003-08-28  Martin Baulig  <martin@ximian.com>
7118
7119         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7120
7121 2003-08-28  Martin Baulig  <martin@ximian.com>
7122
7123         * cs-parser.jay (opt_type_argument_list): Use
7124         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7125         (primary_expression): Replace `qualified_identifier' with `type_name'.
7126         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7127
7128         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7129         parser to check whether it is syntactically a type parameter list;
7130         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7131         this case.
7132
7133 2003-08-26  Martin Baulig  <martin@ximian.com>
7134
7135         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7136         resolving aliases; fixes #47927.
7137
7138 2003-08-26  Martin Baulig  <martin@ximian.com>
7139
7140         * statement.cs (Using.DoResolve): This is internally emitting a
7141         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7142         do not always return.  Fixes #47681.
7143
7144 2003-08-26  Martin Baulig  <martin@ximian.com>
7145
7146         * decl.cs (MemberCore): Moved WarningNotHiding(),
7147         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7148         into MemberBase.
7149         (AdditionResult): Make this nested in DeclSpace.
7150         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7151         argument; call NamespaceEntry.Define() unless we're nested in a
7152         class or struct.
7153
7154         * namespace.cs (Namespace.DefineName): New public function.  This
7155         is called from DeclSpace's .ctor to add 
7156         (Namespace.Lookup): Include DeclSpaces in the lookup.
7157
7158         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7159
7160         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7161
7162 2003-08-25  Martin Baulig  <martin@ximian.com>
7163
7164         * convert.cs (Convert.ExplicitReferenceConversion): When
7165         converting from an interface type to a class, unbox if the target
7166         type is a struct type.  Fixes #47822.
7167
7168 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7169
7170         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7171         #47854.
7172
7173 2003-08-22  Martin Baulig  <martin@ximian.com>
7174
7175         * class.cs (TypeManager.DefineType): When defining a nested type,
7176         call DefineType() on our parent; fixes #47801.
7177
7178 2003-08-22  Martin Baulig  <martin@ximian.com>
7179
7180         * class.cs (MethodData.Define): While checking if a method is an
7181         interface implementation, improve the test a bit more to fix #47654.
7182
7183 2003-08-22  Martin Baulig  <martin@ximian.com>
7184
7185         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7186         correctly; fixes #47722.
7187
7188 2003-08-22  Martin Baulig  <martin@ximian.com>
7189
7190         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7191         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7192
7193         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7194
7195 2003-08-22  Martin Baulig  <martin@ximian.com>
7196
7197         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7198         can only be assigned in static constructors.  Fixes #47161.
7199
7200 2003-08-22  Martin Baulig  <martin@ximian.com>
7201
7202         Rewrote and improved the flow analysis code.
7203
7204         * flowbranching.cs (FlowBranching): Make this class abstract.
7205         (FlowBranching.CreateBranching): New static function to create a
7206         new flow branching.
7207         (FlowBranchingBlock, FlowBranchingException): New classes.
7208         (FlowBranching.UsageVector.Type): New public readonly field.
7209         (FlowBranching.UsageVector.Breaks): Removed the setter.
7210         (FlowBranching.UsageVector.Returns): Removed the setter.
7211         (FlowBranching.UsageVector): Added Break(), Return(),
7212         NeverReachable() and Throw() methods to modify the reachability.
7213         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7214         done by FlowBranching.Merge().
7215         (FlowBranching.UsageVector.MergeChild): New method; merges the
7216         merge result into the current vector.
7217         (FlowBranching.Merge): New abstract method to merge a branching.
7218
7219 2003-08-12  Martin Baulig  <martin@ximian.com>
7220
7221         * expression.cs (Indirection.CacheTemporaries): Create the
7222         LocalTemporary with the pointer type, not its element type.
7223
7224 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7225
7226         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7227         token was a keyword or not.
7228
7229         Add `error' options where an IDENTIFIER was expected;  Provide
7230         CheckToken and CheckIdentifierToken convenience error reporting
7231         functions. 
7232
7233         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7234
7235         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7236         NameSpaceEntry NameSpaceEntry.
7237
7238         (LookupInterfaceOrClass): Avoid creating a full qualified name
7239         from namespace and name: avoid doing lookups when we know the
7240         namespace is non-existant.   Use new Tree.LookupByNamespace which
7241         looks up DeclSpaces based on their namespace, name pair.
7242
7243         * driver.cs: Provide a new `parser verbose' to display the
7244         exception thrown during parsing.  This is turned off by default
7245         now, so the output of a failure from mcs is more graceful.
7246
7247         * namespace.cs: Track all the namespaces defined in a hashtable
7248         for quick lookup.
7249
7250         (IsNamespace): New method
7251
7252 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7253
7254         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7255         we know that we need to concatenate (full typename can never be
7256         null). 
7257
7258         * class.cs: ditto.
7259
7260         * statement.cs: Use a bitfield;  Do not initialize to null things
7261         which are done by the constructor by default.
7262
7263         * cs-parser.jay: bug fix, parameter was 4, not 3.
7264
7265         * expression.cs: Just use the property;
7266
7267         * statement.cs: No need for GetVariableInfo method.
7268
7269 2003-08-08  Martin Baulig  <martin@ximian.com>
7270
7271         * flowanalysis.cs (FlowReturns): This is now nested in the
7272         `FlowBranching' class.
7273         (MyBitVector): Moved this here from statement.cs.
7274         (FlowBranching.SiblingType): New enum type.
7275         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7276
7277 2003-08-07  Martin Baulig  <martin@ximian.com>
7278
7279         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7280         `FlowBranching' class and called `BranchingType'.
7281
7282 2003-08-07  Martin Baulig  <martin@ximian.com>
7283
7284         * flowanalysis.cs: Moved all the control flow analysis code into
7285         its own file.
7286
7287 2003-08-07  Martin Baulig  <martin@ximian.com>
7288
7289         * assign.cs (Assign.DoResolve): `target' must either be an
7290         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7291         #37319.
7292
7293 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7294
7295         * expression.cs (BinaryMethod): This kind of expression is created by the
7296         Binary class if it determines that the operator has to be handled
7297         by a method.
7298
7299         (BinaryDelegate): This kind of expression is created if we are
7300         dealing with a + or - operator on delegates.
7301
7302         (Binary): remove method, argumetns, and DelegateOperator: when
7303         dealing with methods, 
7304
7305         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7306
7307         * statement.cs (Block): use bitfields for the three extra booleans
7308         we had in use.   Remove unused topblock parameter.
7309
7310         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7311
7312         * assign.cs: Drop extra unneeded tests.
7313
7314 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7315
7316         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7317
7318         * statement.cs (Foreach): Use VariableStorage instead of
7319         LocalBuilders.   
7320
7321         * codegen.cs (VariableStorage): New class used by clients that
7322         require a variable stored: locals or fields for variables that
7323         need to live across yield.
7324
7325         Maybe provide a convenience api for EmitThis+EmitLoad?
7326
7327         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7328         these bad boys.
7329
7330 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7331
7332         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7333         RemapParameterLValue): New methods that are used to turn a
7334         precomputed FieldInfo into an expression like this:
7335
7336                 instance.FieldInfo
7337
7338         The idea is to use this instead of making LocalVariableReference
7339         have more than one meaning.
7340
7341         * cs-parser.jay: Add error production to BASE.
7342
7343         * ecore.cs: Deal with TypeManager.GetField returning null, which
7344         is now a valid return value.
7345
7346         (FieldExprNoAddress): New expression for Fields whose address can
7347         not be taken.
7348
7349         * expression.cs (LocalVariableReference): During the resolve
7350         phases, create new expressions if we are in a remapping context.
7351         Remove code that dealt with remapping here.
7352
7353         (ParameterReference): same.
7354
7355         (ProxyInstance): New expression, like the `This' expression, but
7356         it is born fully resolved.  We know what we are doing, so remove
7357         the errors that are targeted to user-provided uses of `this'.
7358
7359         * statement.cs (Foreach): our variable is now stored as an
7360         Expression;  During resolution, follow the protocol, dont just
7361         assume it will return this.
7362
7363 2003-08-06  Martin Baulig  <martin@ximian.com>
7364
7365         * support.cs (SeekableStreamReader.cs): New public class.
7366
7367         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7368         SeekableStreamReader instead of the normal StreamReader.
7369
7370 2003-08-04  Martin Baulig  <martin@ximian.com>
7371
7372         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7373         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7374         deambiguate casts and delegate invocations.
7375         (parenthesized_expression): Use the new tokens to ensure this is
7376         not a cast of method invocation.
7377
7378         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7379         when reading a `)' and Deambiguate_CloseParens () was previously
7380         called.
7381
7382         * expression.cs (ParenthesizedExpression): New class.  This is
7383         just used for the CS0075 test.
7384         (Binary.DoResolve): Check for CS0075.   
7385
7386 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7387
7388         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7389         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7390         reference comparison.
7391
7392         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7393         examine the ReturnType for equality - this is necessary in the
7394         cases of implicit and explicit operators whose signature also
7395         includes the return type.
7396
7397 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7398
7399         * namespace.cs: Cache the result of the namespace computation,
7400         instead of computing it every time.
7401
7402 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7403
7404         * decl.cs: Use a global arraylist that we reuse over invocations
7405         to avoid excesive memory consumption.  Reduces memory usage on an
7406         mcs compile by one meg (45 average).
7407
7408         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7409         private, work around that.
7410
7411 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7412
7413         * literal.cs (IntLiteral): Define Zero and One static literals. 
7414
7415         * cs-parser.jay (integer_literal): use static literals to reduce
7416         memory usage for the most used literals (0, 1 and -1).  211kb
7417         reduced in memory usage.
7418
7419         Replace all calls to `new ArrayList' with `new
7420         ArrayList(4)' which is a good average number for most allocations,
7421         and also requires only 16 bytes of memory for its buffer by
7422         default. 
7423
7424         This reduced MCS memory usage in seven megabytes for the RSS after
7425         bootstrapping.
7426
7427 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7428
7429         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7430         handle params methods the correct way by forming only one
7431         applicable set with params and normal methods in them. Earlier we
7432         were looking at params methods only if we found no normal methods
7433         which was not the correct thing to do.
7434
7435         (Invocation.BetterFunction): Take separate arguments indicating
7436         when candidate and the best method are params methods in their
7437         expanded form.
7438
7439         This fixes bugs #43367 and #46199.
7440
7441         * attribute.cs: Documentation updates.
7442
7443         (CheckAttribute): Rename to CheckAttributeTarget.
7444         (GetValidPlaces): Rename to GetValidTargets.
7445
7446         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7447         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7448
7449         Fixes bug #44468.
7450
7451 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
7452
7453         * codegen.cs: Compute IsGeneric correctly.
7454
7455         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7456         resolution. 
7457
7458         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7459         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
7460         regressions, and I was chasing more bugs than I required.
7461
7462         * interface.cs: Use expressions for base type names (like classes
7463         and structs have been doing for a while now), and resolve that.
7464         This patch should probably go into head as well.
7465
7466         This makes it one less user of FindType.
7467
7468 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7469
7470         This compiler can not self host currently.  Need to fix that.
7471         
7472         * Makefile: compile to `gmcs.exe'
7473
7474         * driver.cs: Turn on v2 by default on gmcs.
7475
7476         * generic.cs (ConstructedType): Does no longer take a container
7477         type argument;  That will be taken care of later.
7478
7479         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
7480         Use SimpleName to resolve for now, so we can continue the work on
7481         the parser, until we get Type.GetType that understands generics.
7482
7483         (ConstructedType.ToString): Implement
7484
7485         (TypeArguments.Resolve): Resolve the child expressions as types. 
7486         
7487         * cs-parser.jay: Rename interface_constraints to
7488         type_parameter_constraints
7489
7490         (namespace_or_type_name): Only use constructed types for the basic
7491         construction, we will deal with identifier<...> later.
7492
7493         (type/type_name): No longer call DecomposeQI, as
7494         namespace_or_type_name is always decoded now.
7495         
7496 2003-07-22  Ravi Pratap  <ravi@ximian.com>
7497
7498         * expression.cs (Invocation.OverloadResolve): Follow the spec more
7499         closely: we eliminate methods in base types when we have an
7500         applicable method in a top-level type.
7501
7502         Please see section 14.5.5.1 for an exact description of what goes
7503         on. 
7504
7505         This fixes bug #45127 and a host of other related to corlib compilation.
7506
7507         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
7508         array is the method corresponding to the top-level type (this is
7509         because of the changes made to icall.c) so we change this
7510         accordingly.
7511
7512         (MethodGroupExpr.Name): This too.
7513
7514         * typemanager.cs (GetElementType): New method which does the right
7515         thing when compiling corlib. 
7516
7517         * everywhere: Make use of the above in the relevant places.
7518
7519 2003-07-22  Martin Baulig  <martin@ximian.com>
7520
7521         * cs-parser.jay (invocation_expression): Moved
7522         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
7523         `cast_expression', but create a InvocationOrCast which later
7524         resolves to either an Invocation or a Cast.
7525
7526         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
7527         method; call this before EmitStatement() to make sure that this
7528         expression can be used as a statement.
7529
7530         * expression.cs (InvocationOrCast): New class; resolves to either
7531         an Invocation or a Cast.
7532
7533         * statement.cs (StatementExpression): Call ResolveStatement() on
7534         the ExpressionStatement before emitting it.
7535
7536 2003-07-21  Martin Baulig  <martin@ximian.com>
7537
7538         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
7539         `ref' and `out' attributes match; fixes #46220.
7540         (MemberAccess.ResolveMemberAccess): You can't reference a type
7541         through an expression; fixes #33180.
7542         (Indexers.GetIndexersForType): Don't return the indexers from
7543         interfaces the class implements; fixes #46502.
7544
7545 2003-07-21  Martin Baulig  <martin@ximian.com>
7546
7547         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
7548         CS0661 checks; fixes bug #30442.
7549
7550 2003-07-21  Martin Baulig  <martin@ximian.com>
7551
7552         * decl.cs (AdditionResult): Added `Error'.
7553
7554         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
7555
7556         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
7557         cs0031.cs actually work.
7558
7559  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7560  
7561         * cs-parser.jay (namespace_name): do not use
7562         namespace_or_type_name, use qualified_identifier, because
7563         namespace_or_type_name will soon return a composed expression
7564         instead of a string.
7565  
7566         (namespace_or_type_name): Instead of returning a string, now this
7567         production returns an expression.
7568  
7569         * codegen.cs (EmitContext): Setup IsGeneric property based on
7570         whether our DeclSpace is generic, our the method is generic.
7571  
7572         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
7573         the method is generic.
7574  
7575         * cs-parser.jay (type_arguments, opt_type_argument_list,
7576         type_parameters, type_parameter_list, opt_type_parameter_list,
7577         type_parameter,, opt_type_parameter_constraints_clauses,
7578         type_parameter_constraints_clauses,
7579         type_parameter_constraint_clause, type_parameter_constraint,
7580         interface_constraints): Add new production
7581  
7582         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
7583         DeclSpace is generic or not.
7584  
7585         (DeclSpace.SetParameterInfo): New routine, used to set the
7586         parameter info for a type.
7587  
7588         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
7589         returns a GenericTypeExpr
7590  
7591         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
7592         generic, lookup the generic argument.
7593  
7594         * attribute.cs: Do not allow TypeParameterExpressions in
7595         Attributes.
7596  
7597         * class.cs: Do not allow the Main method to be defined in a
7598         Generic container.
7599  
7600         * expression.cs (SizeOf): Do not allow generic types to be used as
7601         arguments to sizeof.
7602  
7603         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
7604         it: whether a type is generic or not.  Only works for types we are
7605         currently building for now.
7606         
7607 2003-07-20  Martin Baulig  <martin@ximian.com>
7608
7609         * namespace.cs: Fixed that bug which caused a crash when compiling
7610         the debugger's GUI.
7611
7612 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
7613
7614         * typemanager.cs (LookupTypeReflection): Never expose types which
7615         are NotPublic, NestedPrivate, NestedAssembly, or
7616         NestedFamANDAssem.  We used to return these, and later do a check
7617         that would report a meaningful error, but the problem is that we
7618         would not get the real match, if there was a name override.
7619
7620 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
7621
7622         * namespace.cs (Namespace, Name): Do not compute the namespace
7623         name dynamically, compute it in the constructor.  This reduced
7624         memory usage by 1697 KB.
7625
7626         * driver.cs: Use --pause to pause at the end.
7627
7628 2003-07-17  Peter Williams  <peter@newton.cx>
7629
7630         * Makefile: Change the name of the test target so that it doesn't
7631         conflict with the recursive test target.
7632
7633 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
7634
7635         * expression.cs (LocalVariableReference.Emit, EmitAssign,
7636         AddressOf): Do not use EmitThis, that was wrong, use the actual
7637         this pointer.
7638
7639 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
7640
7641         * class.cs (MethodData.Define): While checking if a method is an
7642         interface implementation, improve the test: If we are not public
7643         (use new test here: use the computed MethodAttributes directly,
7644         instead of the parsed modifier flags) check if the `implementing'
7645         method comes from an interface or not.
7646
7647         * pending.cs (VerifyPendingMethods): Slightly better error
7648         message.
7649
7650         * makefile: add test target that does the mcs bootstrap.
7651
7652 2003-07-16  Ravi Pratap  <ravi@ximian.com>
7653
7654         * interface.cs (Define): Do nothing here since there are no
7655         members to populate etc. Move the attribute emission out of here
7656         since this was just totally the wrong place to put it. Attribute
7657         application happens during the 'Emit' phase, not in the 'Define'
7658         phase.
7659
7660         (Emit): Add this method and move the attribute emission here
7661
7662         * rootcontext.cs (EmitCode): Call the Emit method on interface
7663         types too.
7664
7665 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7666
7667         * expression.cs (OverloadResolve): Report error only if Location
7668         is not 'Null' which means that there was a probe going on.
7669
7670 2003-07-14  Martin Baulig  <martin@ximian.com>
7671
7672         * expression.cs (ConditionalLogicalOperator): New public class to
7673         implement user defined conditional logical operators.
7674         This is section 14.11.2 in the spec and bug #40505.
7675
7676 2003-07-14  Martin Baulig  <martin@ximian.com>
7677
7678         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
7679
7680 2003-07-14  Martin Baulig  <martin@ximian.com>
7681
7682         * codegen.cs (EmitContext.InFixedInitializer): New public field.
7683
7684         * ecore.cs (IVariable.VerifyFixed): New interface method.
7685
7686         * expression.cs (Unary.ResolveOperator): When resolving the `&'
7687         operator, check whether the variable is actually fixed.  Fixes bug
7688         #36055.  Set a variable definitely assigned when taking its
7689         address as required by the spec.
7690
7691         * statement.cs (LocalInfo.IsFixed): New field.
7692         (LocalInfo.MakePinned): Set `IsFixed' to true.
7693
7694 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
7695
7696         * attribute.cs (Attribute.Resolve): While doing a Member lookup
7697         for .ctors, ensure that we only ask for members declared in the
7698         attribute type (BindingFlags.DeclaredOnly).
7699
7700         Fixes bug #43632.
7701
7702         * expression.cs (Error_WrongNumArguments): Report error 1501
7703         correctly the way CSC does.
7704
7705 2003-07-13  Martin Baulig  <martin@ximian.com>
7706
7707         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
7708         lookup on the fully qualified name, to make things like "X.X" work
7709         where "X.X" is a fully qualified type name, but we also have a
7710         namespace "X" in the using list.  Fixes #41975.
7711
7712 2003-07-13  Martin Baulig  <martin@ximian.com>
7713
7714         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
7715         function. If we're a CompoundAssign, we need to create an embedded
7716         CompoundAssign, not an embedded Assign.
7717         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
7718         Fixes #45854.
7719
7720 2003-07-13  Martin Baulig  <martin@ximian.com>
7721
7722         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
7723         work to fix bug #46088.
7724
7725 2003-07-13  Ravi Pratap <ravi@ximian.com>
7726
7727         * class.cs (Operator.Emit): Do not emit attributes here - it is
7728         taken care of by the Method class that we delegate too. This takes
7729         care of bug #45876.
7730
7731 2003-07-10  Martin Baulig  <martin@ximian.com>
7732
7733         * expression.cs (TypeOfVoid): New class.
7734         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
7735
7736 2003-07-10  Martin Baulig  <martin@ximian.com>
7737
7738         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
7739         bug #35957.
7740
7741 2003-07-10  Martin Baulig  <martin@ximian.com>
7742
7743         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
7744         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
7745
7746         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
7747
7748         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
7749
7750 2003-07-10  Martin Baulig  <martin@ximian.com>
7751
7752         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
7753         of decimal.  Fixes #42850.
7754
7755         NOTE: I also fixed the created byte blob, but this doesn't work on
7756         the MS runtime and csc never produces any byte blobs for decimal
7757         arrays.
7758
7759 2003-07-10  Martin Baulig  <martin@ximian.com>
7760
7761         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
7762         structs; fixes #32068.
7763         (Block.AddChildVariableNames): Fixed #44302.
7764
7765 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7766
7767         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
7768
7769 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7770
7771         * attribute.cs: And this test is onger needed.
7772
7773 2003-07-08  Martin Baulig  <martin@ximian.com>
7774
7775         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
7776         inaccessible types.  Fixes #36313.
7777
7778         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
7779
7780         * namespace.cs (NamespaceEntry): Create implicit entries for all
7781         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
7782         implicit entries for N1.N2 and N1.
7783
7784 2003-07-08  Martin Baulig  <martin@ximian.com>
7785
7786         Rewrote the handling of namespaces to fix a lot of the issues
7787         wrt. `using' aliases etc.
7788
7789         * namespace.cs (Namespace): Splitted this class into a
7790         per-assembly `Namespace' and a per-file `NamespaceEntry'.
7791
7792         * typemanager.cs (TypeManager.IsNamespace): Removed.
7793         (TypeManager.ComputeNamespaces): Only compute namespaces from
7794         loaded assemblies here, not the namespaces from the assembly we're
7795         currently compiling.
7796
7797 2003-07-08  Martin Baulig  <martin@ximian.com>
7798
7799         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
7800
7801 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7802
7803         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
7804         already fixed it.  
7805
7806         I thought about the memory savings here, but LookupTypeReflection
7807         is used under already very constrained scenarios.  Compiling
7808         corlib or mcs only exposes one hit, so it would not really reduce
7809         any memory consumption.
7810
7811 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7812
7813         * typemanager.cs: fixes bug #45889 by only adding public types from
7814         other assemblies to the list of known types.
7815
7816 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
7817
7818         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
7819         on the type we resolved.
7820
7821 2003-07-05  Martin Baulig  <martin@ximian.com>
7822
7823         * pending.cs (PendingImplementation.ParentImplements): Don't
7824         create the proxy if the parent is abstract.
7825
7826         * class.cs (TypeContainer.DefineIndexers): Process explicit
7827         interface implementations first.  Fixes #37714.
7828
7829 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
7830
7831         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
7832         defined recursively;  but since we modify the input parameters
7833         (left is set to `this' temporarily), we reset this value if the
7834         left_is_explicit is false, which gives the original semantics to
7835         the code.  
7836
7837         * literal.cs (NullPointer): new class used to represent a null
7838         literal in a pointer context.
7839
7840         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
7841         type is a pointer, use a NullPointer object instead of a
7842         NullLiteral.   Closes 43687
7843
7844         (ExplicitConversion): Convert pointer values using
7845         the conv opcode to the proper type.
7846
7847         * ecore.cs (New): change ValueTypeVariable property into a method,
7848         that returns whether the valuetype is suitable for being used.
7849
7850         * expression.cs (Binary.DoNumericPromotions): Only return if we
7851         the int constant was a valid uint, and we can return both left and
7852         right as uints.  If not, we continue processing, to trigger the
7853         type conversion.  This fixes 39018.
7854
7855         * statement.cs (Block.EmitMeta): During constant resolution, set
7856         the CurrentBlock property on the emitcontext, so that we resolve
7857         constants propertly.
7858
7859 2003-07-02  Martin Baulig  <martin@ximian.com>
7860
7861         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
7862         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
7863
7864         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
7865         than emitting it here.
7866
7867         * statement.cs: Fixed some more flow analysis bugs.
7868
7869 2003-07-02  Martin Baulig  <martin@ximian.com>
7870
7871         * class.cs (MethodData.Define): When implementing interface
7872         methods, set Final unless we're Virtual.
7873
7874         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
7875         check work for interface methods.
7876
7877 2003-07-01  Martin Baulig  <martin@ximian.com>
7878
7879         * ecore.cs (EmitContext.This): Replaced this property with a
7880         GetThis() method which takes a Location argument.  This ensures
7881         that we get the correct error location for a CS0188.
7882
7883 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
7884
7885         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
7886         ImplicitStandardConversion.
7887
7888         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
7889
7890 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
7891
7892         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
7893         optimization.
7894
7895 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
7896
7897         * class.cs (Constructor.Define): Turn off initlocals for unsafe
7898         constructors.
7899
7900         (MethodData.Define): Turn off initlocals for unsafe methods.
7901
7902 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
7903
7904         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
7905         complete;  Fixes #37521.
7906
7907         * delegate.cs: Use Modifiers.TypeAttr to compute the
7908         TypeAttributes, instead of rolling our own.  This makes the flags
7909         correct for the delegates.
7910
7911 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
7912
7913         * class.cs (Constructor.Define): Set the private flag for static
7914         constructors as well.
7915
7916         * cs-parser.jay (statement_expression): Set the return value to
7917         null, to avoid a crash when we catch an error.
7918
7919 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
7920
7921         * cs-parser.jay: Applied patch from Jackson that adds support for
7922         extern and unsafe modifiers to destructor declarations.
7923
7924         * expression.cs: Report error 21 if the user is trying to index a
7925         System.Array.
7926
7927         * driver.cs: Add an error message, suggested by the bug report.
7928
7929         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
7930         if we do not have a ": this ()" constructor initializer.  Fixes 45149
7931
7932 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
7933
7934         * namespace.cs: Add some information to reduce FAQs.
7935
7936 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
7937
7938         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
7939         underlying enumeration types.  Fixes #43915.
7940
7941         * expression.cs: Treat ushort/short as legal values to be used in
7942         bitwise operations.
7943
7944 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
7945
7946         * delegate.cs: transfer custom attributes for paramenters from
7947         the delegate declaration to Invoke and BeginInvoke.
7948
7949 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
7950
7951         * attribute.cs: handle custom marshalers and emit marshal info
7952         for fields, too.
7953
7954 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
7955
7956         * makefile.gnu: Added anonymous.cs to the compiler sources.
7957
7958 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
7959
7960         * iterators.cs: Change the name of the proxy class to include two
7961         underscores.
7962
7963         * cs-parser.jay: Update grammar to include anonymous methods.
7964
7965         * anonymous.cs: new file.
7966
7967 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
7968
7969         * class.cs (Field.Define): Add missing test for pointers and
7970         safety. 
7971
7972 2003-05-27  Ravi Pratap  <ravi@ximian.com>
7973
7974         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
7975         we use the stobj opcode.
7976
7977         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
7978         since it wasn't the correct fix. 
7979
7980         It still is puzzling that we are required to use stobj for IntPtr
7981         which seems to be a ValueType.
7982
7983 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
7984
7985         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
7986         during regular simple name resolution.   Now, the trick is that
7987         instead of returning for processing the simplename, we do a
7988         TypeManager.LookupType (ie, a rooted lookup as opposed to a
7989         contextual lookup type).   If a match is found, return that, if
7990         not, return for further composition.
7991
7992         This fixes long-standing 30485.
7993
7994         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7995         using the address to initialize an object, do an Stobj instead of
7996         using the regular Stelem.
7997
7998         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
7999         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8000         Because if we are a BaseIndexerAccess that value will be true.
8001         Fixes 43643.
8002
8003         * statement.cs (GotoCase.Resolve): Return after reporting an
8004         error, do not attempt to continue. 
8005
8006         * expression.cs (PointerArithmetic.Emit): If our operand is a
8007         long, convert our constants to match the operand before
8008         multiplying.  Convert to I type before adding.   Fixes 43670.
8009
8010 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8011
8012         * enum.cs (ImplicitConversionExists) : Rename to
8013         ImplicitEnumConversionExists to remove ambiguity. 
8014
8015         * ecore.cs (NullCast): New type of cast expression class which
8016         basically is very similar to EmptyCast with the difference being
8017         it still is a constant since it is used only to cast a null to
8018         something else
8019         (eg. (string) null)
8020
8021         * convert.cs (ImplicitReferenceConversion): When casting a null
8022         literal, we return a NullCast.
8023
8024         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8025         should be around anymore.
8026
8027         The renaming (reported was slightly wrong). Corrections:
8028
8029         ConvertImplicitStandard -> ImplicitConversionStandard
8030         ConvertExplicitStandard -> ExplicitConversionStandard
8031
8032         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8033         before passing them in !
8034
8035         * convert.cs (ImplicitConversionStandard): When comparing for
8036         equal expr and target types, ensure that expr is not a
8037         NullLiteral.
8038
8039         In general, we must not be checking (expr_type ==
8040         target_type) in the top level conversion methods
8041         (ImplicitConversion, ExplicitConversion etc). This checking is
8042         done in the methods that they delegate to.
8043
8044 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8045
8046         * convert.cs: Move Error_CannotConvertType,
8047         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8048         ImplicitNumericConversion, ImplicitConversionExists,
8049         ImplicitUserConversionExists, StandardConversionExists,
8050         FindMostEncompassedType, FindMostSpecificSource,
8051         FindMostSpecificTarget, ImplicitUserConversion,
8052         ExplicitUserConversion, GetConversionOperators,
8053         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8054         TryImplicitIntConversion, Error_CannotConvertImplicit,
8055         ConvertImplicitRequired, ConvertNumericExplicit,
8056         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8057         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8058         its own file.
8059
8060         Perform the following renames:
8061
8062         StandardConversionExists -> ImplicitStandardConversionExists
8063         ConvertImplicit -> ImplicitConversion
8064         ConvertImplicitStandard -> ImplicitStandardConversion
8065         TryImplicitIntConversion -> ImplicitIntConversion
8066         ConvertImplicitRequired -> ImplicitConversionRequired
8067         ConvertNumericExplicit -> ExplicitNumericConversion
8068         ConvertReferenceExplicit -> ExplicitReferenceConversion
8069         ConvertExplicit -> ExplicitConversion
8070         ConvertExplicitStandard -> ExplicitStandardConversion
8071
8072 2003-05-19  Martin Baulig  <martin@ximian.com>
8073
8074         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8075         (TypeInfo): Added support for structs having structs as fields.
8076
8077         * ecore.cs (FieldExpr): Implement IVariable.
8078         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8079         VariableInfo for the field.
8080
8081 2003-05-18  Martin Baulig  <martin@ximian.com>
8082
8083         * expression.cs (This.DoResolve): Report a CS0027 if we're
8084         emitting a field initializer.
8085
8086 2003-05-18  Martin Baulig  <martin@ximian.com>
8087
8088         * expression.cs (This.ResolveBase): New public function.
8089         (This.DoResolve): Check for CS0188.
8090
8091         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8092         This.Resolve().
8093
8094         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8095         `instance_expression' to null if we don't have any non-static
8096         methods.
8097
8098 2003-05-18  Martin Baulig  <martin@ximian.com>
8099
8100         Reworked the way how local variables and parameters are handled by
8101         the flow analysis code.
8102
8103         * statement.cs (TypeInfo, VariableMap): New public classes.
8104         (VariableInfo): New public class.  This is now responsible for
8105         checking whether a variable has been assigned.  It is used for
8106         parameters and local variables.
8107         (Block.EmitMeta): Take the InternalParameters as argument; compute
8108         the layout of the flow vectors here.
8109         (Block.LocalMap, Block.ParameterMap): New public properties.
8110         (FlowBranching): The .ctor doesn't get the InternalParameters
8111         anymore since Block.EmitMeta() now computes the layout of the flow
8112         vector.
8113         (MyStructInfo): This class is now known as `StructInfo' and nested
8114         in `TypeInfo'; we don't access this directly anymore.
8115
8116         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8117         property and removed IsAssigned(), IsFieldAssigned(),
8118         SetAssigned() and SetFieldAssigned(); we now call them on the
8119         VariableInfo so we don't need to duplicate this code everywhere.
8120
8121         * expression.cs (ParameterReference): Added `Block block' argument
8122         to the .ctor.
8123         (LocalVariableReference, ParameterReference, This): The new
8124         VariableInfo class is now responsible for all the definite
8125         assignment stuff.
8126
8127         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8128         IsParameterAssigned, SetParameterAssigned): Removed.
8129
8130 2003-05-18  Martin Baulig  <martin@ximian.com>
8131
8132         * typemanager.cs (InitCoreTypes): Try calling
8133         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8134         the 3-args-version.  Corlib now also needs our `void_type'.
8135         (GetMethod): Added overloaded version which takes an optional
8136         `bool report_errors' to allow lookups of optional methods.
8137
8138 2003-05-12  Martin Baulig  <martin@ximian.com>
8139
8140         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8141         only used for locals and not for parameters.
8142
8143 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8144
8145         * support.cs (InternalParameters.ParameterType): Return the
8146         ExternalType of the parameter.
8147
8148         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8149         they were unused.
8150
8151 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * class.cs (MethodData.Define): Do not set the `newslot' on
8154         interface members, if they are also flagged as "override".
8155
8156         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8157         better code for ++i and i++.  This only works for static fields
8158         and local variables.
8159
8160         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8161         want to pull the DeclSpace out of the builder_to_declspace instead
8162         of the TypeBuilder (like in TypeContainer.FindMembers).
8163
8164         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8165         instead of LookupTypeContainer.  Fixes the crash on .NET for
8166         looking up interface members.
8167
8168         * const.cs: Create our own emit context during the Definition
8169         stage, so that constants are evaluated in the proper context, when
8170         a recursive definition happens.
8171
8172 2003-05-11  Martin Baulig  <martin@ximian.com>
8173
8174         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8175         new block for a switch section.
8176         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8177         the adding/lookup in the switch block.  Fixes #39828.
8178
8179 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8180
8181         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8182         functionality: I needed to convert the data after I had performed
8183         the add/sub operation into the operands type size.
8184
8185         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8186         pass the type for the box operation, otherwise the resulting
8187         object would have been of type object.
8188
8189         (BoxedCast): Add constructor to specify the type to box as.
8190
8191 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8192
8193         * iterators.cs: I was reusing the `count' variable inadvertently,
8194         take steps to not allow this to happen.
8195
8196 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8197
8198         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8199         by creating an array at the point where the params starts and
8200         putting all those arguments there, then adjusting the size of the
8201         array.
8202
8203 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8204
8205         * expression.cs (New.AddressOf): Implement interface
8206         IMemoryLocation.  This is used when the `new' operator is used in
8207         the context of an invocation to a method on a value type.
8208
8209         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8210         example. 
8211
8212         * namespace.cs: Also check the using aliases here.
8213
8214         * driver.cs: Move the test for using validity after the types have
8215         been entered, so we do a single pass that also includes the using
8216         aliases. 
8217
8218         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8219         in the regular case.   CreateSiblingForFinally is doing extra
8220         error checking.
8221
8222         * attribute.cs (GetAttributeArgumentExpression): Store the result
8223         on an out value, and use the return value to indicate failure
8224         instead of using null (which is a valid return for Constant.GetValue).
8225
8226         * statement.cs: Perform the analysis flow for the increment
8227         portion after the statement, because this will be the real flow of
8228         execution.  Fixes #42385
8229
8230         * codegen.cs (EmitContext.EmitArgument,
8231         EmitContext.EmitStoreArgument): New helper functions when the
8232         RemapToProxy flag is set.
8233
8234         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8235         function.
8236
8237         Add support for remapping parameters. 
8238
8239         * iterators.cs: Propagate parameter values;  Store parameter
8240         values in the proxy classes.
8241
8242 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8243
8244         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8245         need a proxy reference;  I do not know what I was thinking
8246
8247         * cs-parser.jay (constructor_initializer): catch another error,
8248         and display nice message.
8249
8250         (field_declaration): catch void field declaration
8251         to flag a better error. 
8252
8253         * class.cs (MemberBase.CheckBase): Report an error instead of a
8254         warning if a new protected member is declared in a struct. 
8255         (Field.Define): catch the error of readonly/volatile.
8256
8257         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8258
8259         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8260         volatile variable is taken
8261
8262 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8263
8264         * statement.cs (Fixed.Resolve): Report an error if we are not in
8265         an unsafe context.
8266
8267 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8268
8269         * typemanager.cs: reuse the code that handles type clashes for
8270         delegates and enumerations.
8271
8272         * class.cs (Report28): Always report.
8273
8274         * expression.cs (EncodeAsAttribute): Allow nulls here.
8275
8276 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8277
8278         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8279         the functionality for testing whether an expression is valid for
8280         an attribute here.  Also handle the case of arrays of elements
8281         being stored. 
8282
8283         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8284         encoding a linear array into an array of objects that are suitable
8285         to be passed to an CustomAttributeBuilder.
8286
8287         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8288
8289         * ecore.cs: (FieldExpr): Handle field remapping here.
8290
8291         * iteratators.cs: Pass the instance variable (if the method is an
8292         instance method) to the constructors, so we can access the field
8293         variables on the class.
8294
8295         TODO: Test this with structs.  I think the THIS variable on
8296         structs might have to be a pointer, and not a refenrece
8297
8298 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8299
8300         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8301         local variables to fields in a proxy class.
8302
8303         * iterators.cs (PopulateProxy): Rename our internal fields to
8304         <XXX>.  
8305         Create a <THIS> field if we are an instance method, so we can
8306         reference our parent container variables.
8307         (MapVariable): Called back from the EmitContext code to enter a
8308         new variable to field mapping into the proxy class (we just create
8309         a FieldBuilder).
8310
8311         * expression.cs
8312         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8313         for using the remapped locals to fields.
8314
8315         I placed the code here, because that gives the same semantics to
8316         local variables, and only changes the Emit code.
8317
8318         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8319         statements inside iterators.
8320         (VariableInfo): Add a FieldBuilder for the cases when we are
8321         remapping local variables to fields in a proxy class
8322
8323         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8324         current_block != null.
8325
8326         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8327         not cope with strings, as it has been moved to the
8328         TableSwitchEmit.  Fixed bug in switch generation.
8329
8330         * expression.cs (New.DoResolve): Provide more context for the user
8331         when reporting an error.
8332
8333         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8334         pointers. 
8335
8336         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8337         check the permissions for it.  Note than in a type-resolution
8338         context the check was already present in DeclSpace.ResolveType,
8339         but was missing from the MemberAccess.
8340
8341         (ArrayCreation.CheckIndices): warn if the user has
8342         more nested levels of expressions, but there are no more
8343         dimensions specified.  Avoids crash on bug 41906.
8344
8345 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8346
8347         * statement.cs (Block): replace Implicit bool, for a generic
8348         flags.   
8349         New flag: `Unchecked'.  This is used during the EmitMeta phase
8350         (which is out-of-line with the regular Resolve/Emit process for a
8351         statement, as this is done ahead of time, but still gets a chance
8352         to call constant resolve).
8353
8354         (Block.Flags): new enum for adding a new flag.
8355
8356         (Block.EmitMeta): track the state of unchecked.
8357
8358         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8359         to enable constant resolution to work there as well.
8360
8361 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8362
8363         * typemanager.cs (ienumerable_type): Also look up
8364         System.Collections.IEnumerable. 
8365
8366 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8367
8368         TODO: Test more than one conditional per method.
8369
8370         * class.cs (Indexer.Define): Report the location where the user is
8371         referencing the unsupported feature.
8372
8373         (MethodData): Overload the use of `conditionals' to
8374         minimize the creation of needless ArrayLists.   This saves roughly
8375         212kb on my machine.
8376
8377         (Method): Implement the new IIteratorContainer interface.
8378         (Method.SetYields): Implement the method by setting the ModFlags
8379         to contain METHOD_YIELDS.
8380
8381         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8382         which just got set to null.
8383
8384         * iterators.cs: New file.
8385
8386         (Yield, YieldBreak): New statements.
8387
8388         * statement.cs (Return.Resolve): Flag an error if we are used in
8389         an iterator method.
8390
8391         * codegen.cs (InIterator): New flag set if the code is being
8392         compiled in an iterator method.
8393
8394         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8395         internal modifier, and we just use it to avoid adding extra
8396         fields, as this is seldom used.  
8397
8398         * cs-parser.jay: Add yield_statement (yield and yield break).
8399
8400         * driver.cs: New flag -v2 to turn on version 2 features. 
8401
8402         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8403         hashtable when v2 is enabled.
8404
8405 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8406
8407         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8408         there is already a namespace defined with this name.
8409
8410         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8411         people upgraded their corlibs.
8412
8413         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8414         always use fully qualified types, no need to use the compiler
8415         front end.
8416
8417         (TypeManager.IsNamespace): Use binarysearch.
8418
8419         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8420         AddDelegate): I did not quite use the new IsValid API properly: I
8421         have to pass the short-name and the fullname.  I was passing only
8422         the basename instead of the fullname sometimes. 
8423
8424         (TypeContainer.DefineType): call NamespaceClash.
8425
8426         * interface.cs (Interface.DefineType): use NamespaceClash before
8427         defining the type.
8428
8429         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8430         defining the type.
8431
8432         * enum.cs: (Enum.DefineType): use NamespaceClash before
8433         defining the type.
8434
8435         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8436         speed increase.  First, use the negative_hits cache when we get a
8437         negative.  Second, add the type with its full original name
8438         instead of the new . and + encoded name (reflection uses + to
8439         separate type from a nested type).  Use LookupTypeReflection
8440         directly which bypasses the type->name hashtable (that we already
8441         know does not contain the type.
8442
8443         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8444         location/container type. 
8445
8446         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8447
8448 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8449
8450         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8451
8452         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8453         method is being referenced in the method group from a static
8454         context, and report error 120 if so.
8455
8456         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8457         Error118. 
8458
8459         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8460         is created, we create the A namespace).
8461
8462         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8463         Fixes #41591
8464
8465 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8466
8467         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8468         invocation to ModuleBuilder.GetType with the same values will
8469         return a new type instance, so we need to cache its return
8470         values. 
8471
8472         * expression.cs (Binary.ResolveOperator): Only allow the compare
8473         operators on enums if they are of the same type.
8474
8475         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8476         types of ValueType on their own case.  Before we were giving them
8477         the same treatment as objects.
8478
8479         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8480         fullname.  Short name is used to compare against container name.
8481         Fullname is used to check against defined namespace names.
8482
8483         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8484         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8485
8486         (Method.CheckBase): Call parent.
8487         (MemberBase.CheckBase): Check for protected members on sealed
8488         classes.
8489         (PropertyBase.CheckBase): Call parent.
8490         (Field.Define): Call parent.
8491
8492         * report.cs: Negative error codes are now mapped to 8000 - code,
8493         so that the display is render more nicely.
8494
8495         * typemanager.cs: Do not use try/catch, instead report a regular
8496         error. 
8497
8498         (GetPointerType, GetReferenceType): These methods provide
8499         mechanisms to obtain the T* and T& from a T.  We had the code
8500         previously scattered around the code base, and it also used
8501         TypeManager.LookupType that would go through plenty of caches.
8502         This one goes directly to the type source.
8503
8504         In some places we did the Type.GetType followed by
8505         ModuleBuilder.GetType, but not in others, so this unifies the
8506         processing as well.
8507
8508         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
8509         statements now that we have namespace information.
8510
8511         * typemanager.cs (IsNamespace): New method, returns whether the
8512         string presented is a namespace or not.
8513
8514         (ComputeNamespaces): New public entry point, computes the list of
8515         available namespaces, using the GetNamespaces API call in Mono, or
8516         the slower version in MS.NET.   
8517
8518         Now before we start the semantic analysis phase, we have a
8519         complete list of namespaces including everything that the user has
8520         provided.
8521
8522         Deleted old code to cache namespaces in .nsc files.
8523
8524 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
8525
8526         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
8527         class/struct location definition Location for the implicit
8528         constructor location.
8529
8530         (Operator.Define): Use the location of the operator for the
8531         implicit Method definition.
8532
8533         (Constructor.Emit): use the constructor location for the implicit
8534         base initializer constructor.
8535
8536         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
8537         and the Expression class now contains two new methods:
8538
8539         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
8540         isolate type lookup from the rest of the resolution process.
8541
8542         Since we use Expressions to hold type definitions due to the way
8543         we parse the input we have historically overloaded Resolve to
8544         perform the Type lookups if a special flag is passed.  Now this is
8545         eliminated and two methods take their place. 
8546
8547         The differences in the two methods between xStep and xTerminal is
8548         that xStep is involved in our current lookup system that uses
8549         SimpleNames to compose a name, while xTerminal is used just to
8550         catch the case where the simplename lookup failed.
8551
8552 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
8553
8554         * expression.cs (ResolveMemberAccess): Remove redundant code.
8555         TypeExpr expressions are always born fully resolved.
8556
8557         * interface.cs (PopulateMethod): Do not lookup the types twice.
8558         We were doing it once during SemanticAnalysis and once during
8559         PopulateMethod.
8560
8561         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
8562         in local variable type definitions, were being returned as a
8563         SimpleName (we decomposed everything into a string), that is
8564         because primary_expression was being used instead of a type in the
8565         grammar (reduce/reduce conflicts).
8566
8567         The part that was wrong is that we converted the expression into a
8568         string (an oversimplification in one hand, compounded with primary
8569         expressions doing string concatenation).
8570
8571         So things like:
8572
8573         A.B.C [] x;
8574
8575         Would return "A.B.C[]" as a SimpleName.  This stopped things like
8576         using clauses from working on this particular context.  And a type
8577         was being matched directly against "A.B.C[]".
8578
8579         We now use the correct approach, and allow for ComposedCast to be
8580         part of the unary expression.  So the "A.B.C []" become a composed
8581         cast of "A.B.C" (as a nested group of MemberAccess with a
8582         SimpleName at the end) plus the rank composition "[]". 
8583
8584         Also fixes 35567
8585
8586 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
8587
8588         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
8589         for the access level checking.
8590
8591         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
8592         `TypeContainer container', because I kept getting confused when I
8593         was debugging this code.
8594
8595         * expression.cs (Indexers): Instead of tracking getters/setters,
8596         we now track them in parallel.  We create one arraylist less, but
8597         most importantly it is possible now for the LValue code to find a
8598         matching get for a set.
8599
8600         (IndexerAccess.DoResolveLValue): Update the code.
8601         GetIndexersForType has been modified already to extract all the
8602         indexers from a type.  The code assumed it did not.
8603
8604         Also make the code set the correct return type for the indexer.
8605         This was fixed a long time ago for properties, but was missing for
8606         indexers.  It used to be void_type.
8607
8608         (Binary.Emit): Test first for doubles instead of
8609         floats, as they are more common.
8610
8611         (Binary.EmitBranchable): Use the .un version of the branch opcodes
8612         when dealing with floats and the <=, >= operators.  This fixes bug
8613         #39314 
8614
8615         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
8616         to load the array value by emitting a load on the foreach variable
8617         type.  This was incorrect.  
8618
8619         We now emit the code to load an element using the the array
8620         variable type, and then we emit the conversion operator.
8621
8622         Fixed #40176
8623
8624 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
8625
8626         * attribute.cs: Avoid allocation of ArrayLists in the common case.
8627
8628 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
8629
8630         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
8631         test for protection before we test for signatures. 
8632
8633         (MethodSignature.ToString): implement.
8634
8635         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
8636         to the case where we reduced into a LongConstant.
8637
8638         * decl.cs (CheckAccessLevel): If the type is an array, we can not
8639         depend on whether the information is acurrate, because the
8640         Microsoft runtime will always claim that the array type is public,
8641         regardless of the real state.
8642
8643         If the type is a pointer, another problem happens: the type is
8644         reported as non-public in Microsoft.  
8645
8646         In both cases we have to call CheckAccessLevel recursively with
8647         the underlying type as the argument to be tested.
8648
8649 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
8650
8651         * assign.cs (Assign.Emit): If we are dealing with a compound
8652         assignment expression, we should use the code path that stores the
8653         intermediate result in a temporary value.  This fixes #40903.
8654
8655         *expression.cs (Indirection.ToString): Provide ToString method for
8656         debugging. 
8657
8658 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
8659
8660         * class.cs: Null out fields holding references to Block objects so
8661         they can be garbage collected.
8662
8663         * expression.cs (OverloadResolve): Remove unused local.
8664
8665 2003-04-07  Martin Baulig  <martin@ximian.com>
8666
8667         * codegen.cs (EmitContext.CurrentFile): New public field.
8668         (EmitContext.Mark): Use the CurrentFile to check whether the
8669         location is in the correct file.
8670         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
8671
8672 2003-04-07  Martin Baulig  <martin@ximian.com>
8673
8674         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
8675
8676         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
8677         location.  [FIXME: The location argument which gets passed to this
8678         method is sometimes wrong!]
8679
8680 2003-04-07  Nick Drochak <ndrochak@gol.com>
8681
8682         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
8683
8684 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
8685
8686         * expression.cs (Indirection.EmitAssign): We were using the
8687         temporary, but returning immediately instead of continuing the
8688         EmitAssing flow.
8689
8690 2003-04-06  Martin Baulig  <martin@ximian.com>
8691
8692         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
8693         if it's a nested child, but also deriving from the outer class.
8694         See test 190.cs.
8695
8696         * typemanager.cs (IsNestedChildOf): Make this work if it's a
8697         nested child, but also deriving from the outer class.  See
8698         test-190.cs.
8699         (FilterWithClosure): We may access private members of the outer
8700         class if we're a nested child and deriving from the outer class.
8701         (RealMemberLookup): Only set `closure_private_ok' if the
8702         `original_bf' contained BindingFlags.NonPublic.
8703
8704 2003-04-05  Martin Baulig  <martin@ximian.com>
8705
8706         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
8707         probe if its a type parameter, and if so, flag an error.
8708
8709         * decl.cs: Move here the SetParameterInfo code from class.cs.
8710         Handle IsGeneric here.
8711
8712         Handle a variety of errors in the parameter info definition.
8713
8714         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
8715         type parameters here.
8716
8717         * cs-parser.jay (class_declaration): report errors for parameters
8718         here as well.
8719
8720 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
8721
8722         * generic.cs: New file, contains support code for generics.
8723
8724         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
8725         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
8726
8727         Update parser for the above removals.
8728
8729         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
8730         now taken care of in the parser.
8731
8732 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
8733
8734         * class.cs (Event.Define): Do not allow abstract events to have
8735         initializers. 
8736
8737 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
8738
8739         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
8740         block in event declarations.
8741
8742         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
8743         value type, get its address.
8744
8745         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
8746         leaving a class on the stack instead of a boolean value (int
8747         0/1).  Change the code so we compare against null, and then the
8748         result against zero.
8749
8750         * class.cs (TypeContainer.GetClassBases): We were checking for the
8751         parent class being sealed too late.
8752
8753         * expression.cs (Binary.Emit): For <= and >= when dealing with
8754         floating point values, use cgt.un and clt.un instead of cgt and
8755         clt alone.
8756
8757 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
8758
8759         * statement.cs: Apply the same optimization as MS: skip the 
8760         GetEnumerator returning an IEnumerator, and use the one returning a 
8761         CharEnumerator instead. This allows us to avoid the try-finally block 
8762         and the boxing.
8763
8764 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
8765
8766         * cs-parser.jay: Attributes cannot be applied to
8767                          namespaces. Fixes #40473
8768
8769 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8770
8771         * class.cs:
8772         (Add*): check if the name is valid using the full name for constants,
8773         fields, properties and events.
8774
8775 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
8776
8777         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
8778         char constants to be part of the enumeration.
8779
8780         * expression.cs (Conditional.DoResolve): Add support for operator
8781         true. Implements the missing functionality from 14.12
8782
8783         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
8784         operator true/false as required by the spec.
8785
8786         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
8787         implicit conversion to boolean.
8788
8789         * statement.cs (Statement.ResolveBoolean): A boolean expression is
8790         also one where the type implements `operator true'. 
8791
8792         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
8793         get an expression that will invoke operator true based on an
8794         expression.  
8795
8796         (GetConversionOperators): Removed the hack that called op_True
8797         here.  
8798
8799         (Expression.ResolveBoolean): Move this from Statement.
8800
8801 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
8802
8803         * ecore.cs (FieldExpr): do not allow initialization of initonly
8804         fields on derived classes
8805
8806 2003-03-13  Martin Baulig  <martin@ximian.com>
8807
8808         * statement.cs (Block.Emit): Call ig.BeginScope() and
8809         ig.EndScope() when compiling with debugging info; call
8810         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
8811
8812 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
8813
8814         * expression.cs (Indexers): Do not construct immediately, allow
8815         for new members to be appended as we go.  Fixes 38143
8816
8817 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8818
8819         * expression.cs: save/restore context when resolving an unchecked
8820         expression.
8821
8822 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
8823
8824         * cfold.cs: Catch division by zero in modulus operator during
8825         constant folding.
8826
8827 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
8828
8829         * interface.cs (Interface.DefineMembers): Avoid defining members
8830         twice. 
8831
8832 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
8833
8834         * driver.cs: handle the +/- options for -noconfig
8835
8836         * statement.cs (Unckeched.Resolve): Also track the state of
8837         unchecked in the Resolve phase.
8838
8839 2003-02-27  Martin Baulig  <martin@ximian.com>
8840
8841         * ecore.cs (Expression.MemberLookup): Don't create a
8842         MethodGroupExpr for something which is not a method.  Fixes #38291.
8843
8844 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * class.cs (MemberBase.CheckParameters): Also check that the type
8847         is unmanaged if it is a pointer.
8848
8849         * expression.cs (SizeOf.Resolve): Add location information.
8850
8851         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
8852         a managed type is declared.
8853
8854         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
8855         parameter modifiers as well.  Fixes bug 38606
8856
8857         * class.cs: Very sad.  Am backing out the speed up changes
8858         introduced by the ArrayList -> Array in the TypeContainer, as they
8859         were not actually that much faster, and introduced a bug (no error
8860         reports on duplicated methods).
8861
8862         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
8863         source first, this will guarantee that we have a valid expression
8864         before calling in lower levels functions that will require a
8865         resolved object.  Then use this original_source in the
8866         target.ResolveLValue instead of the original source that was
8867         passed to us.
8868
8869         Another change.  Use target.Resolve instead of LValueResolve.
8870         Although we are resolving for LValues, we will let the Assign code
8871         take care of that (it will be called again from Resolve).  This
8872         basically allows code like this:
8873
8874         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
8875         class Y { void A (X x) { x [0] += o; }
8876
8877         The problem was that the indexer was trying to resolve for
8878         set_Item (idx, object o) and never finding one.  The real set_Item
8879         was set_Item (idx, X).  By delaying the process we get the right
8880         semantics. 
8881
8882         Fixes bug 36505
8883
8884 2003-02-23  Martin Baulig  <martin@ximian.com>
8885
8886         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
8887         while calling DoEmit ().
8888
8889         * codegen.cs (EmitContext.Mark): Don't mark locations in other
8890         source files; if you use the #line directive inside a method, the
8891         compiler stops emitting line numbers for the debugger until it
8892         reaches the end of the method or another #line directive which
8893         restores the original file.
8894
8895 2003-02-23  Martin Baulig  <martin@ximian.com>
8896
8897         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
8898
8899 2003-02-23  Martin Baulig  <martin@ximian.com>
8900
8901         * statement.cs (Block.AddChildVariableNames): We need to call this
8902         recursively, not just for our immediate children.
8903
8904 2003-02-23  Martin Baulig  <martin@ximian.com>
8905
8906         * class.cs (Event.Define): Always make the field private, like csc does.
8907
8908         * typemanager.cs (TypeManager.RealMemberLookup): Make events
8909         actually work, fixes bug #37521.
8910
8911 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
8912
8913         * delegate.cs: When creating the various temporary "Parameters"
8914         classes, make sure that we call the ComputeAndDefineParameterTypes
8915         on those new parameters (just like we do with the formal ones), to
8916         allow them to be resolved in the context of the DeclSpace.
8917
8918         This fixes the bug that Dick observed in Bugzilla #38530.
8919
8920 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
8921
8922         * expression.cs (ResolveMemberAccess): When resolving a constant,
8923         do not attempt to pull a constant if the value was not able to
8924         generate a valid constant.
8925
8926         * const.cs (LookupConstantValue): Do not report more errors than required.
8927
8928 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8929
8930         * expression.cs: fixes bug #38328.
8931
8932 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8933
8934         * class.cs: Changed all the various members that can be part of a
8935         class from being an ArrayList to be an Array of the right type.
8936         During the DefineType type_list, interface_list, delegate_list and
8937         enum_list are turned into types, interfaces, delegates and enums
8938         arrays.  
8939
8940         And during the member population, indexer_list, event_list,
8941         constant_list, field_list, instance_constructor_list, method_list,
8942         operator_list and property_list are turned into their real arrays.
8943
8944         Although we could probably perform this operation earlier, for
8945         good error reporting we need to keep the lists and remove the
8946         lists for longer than required.
8947
8948         This optimization was triggered by Paolo profiling the compiler
8949         speed on the output of `gen-sample-program.pl' perl script. 
8950
8951         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
8952         not crash in methods like MemberLookupFailed that use this field.  
8953
8954         This problem arises when the compiler fails to resolve a type
8955         during interface type definition for example.
8956
8957 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
8958
8959         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
8960         inherit from System.Object, so we have to stop at null, not only
8961         when reaching System.Object.
8962
8963 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
8964
8965         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
8966         DeclaredOnly because the parent indexer might have had a different
8967         name, but did not loop until the top of the hierarchy was reached.
8968
8969         The problem this one fixes is 35492: when a class implemented an
8970         indexer from an interface, we were getting the interface method
8971         (which was abstract) and we were flagging an error (can not invoke
8972         abstract method).
8973
8974         This also keeps bug 33089 functioning, and test-148 functioning.
8975
8976         * typemanager.cs (IsSpecialMethod): The correct way of figuring
8977         out if a method is special is to see if it is declared in a
8978         property or event, or whether it is one of the predefined operator
8979         names.   This should fix correctly #36804.
8980
8981 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
8982
8983         The goal here is to remove the dependency on EmptyCast.Peel ().
8984         Killing it completely.
8985
8986         The problem is that currently in a number of places where
8987         constants are expected, we have to "probe" for an EmptyCast, and
8988         Peel, which is not the correct thing to do, as this will be
8989         repetitive and will likely lead to errors. 
8990
8991         The idea is to remove any EmptyCasts that are used in casts that
8992         can be reduced to constants, so we only have to cope with
8993         constants. 
8994
8995         This bug hunt was triggered by Bug 37363 and the desire to remove
8996         the duplicate pattern where we were "peeling" emptycasts to check
8997         whether they were constants.  Now constants will always be
8998         constants.
8999
9000         * ecore.cs: Use an enumconstant here instead of wrapping with
9001         EmptyCast.  
9002
9003         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9004         throwing me off.  By handling this we can get rid of a few hacks.
9005
9006         * statement.cs (Switch): Removed Peel() code.
9007
9008 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9009
9010         * class.cs: Location information for error 508
9011
9012         * expression.cs (New.DoResolve): Add a guard against double
9013         resolution of an expression.  
9014
9015         The New DoResolve might be called twice when initializing field
9016         expressions (see EmitFieldInitializers, the call to
9017         GetInitializerExpression will perform a resolve on the expression,
9018         and later the assign will trigger another resolution
9019
9020         This leads to bugs (#37014)
9021
9022         * delegate.cs: The signature for EndInvoke should contain any ref
9023         or out parameters as well.  We were not doing this in the past. 
9024
9025         * class.cs (Field.Define): Do not overwrite the type definition
9026         inside the `volatile' group.  Turns out that volatile enumerations
9027         were changing the type here to perform a validity test, which
9028         broke conversions. 
9029
9030 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9031
9032         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9033         and structs, we do not want to load the instance variable
9034
9035         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9036         enum_type has to be handled like an object reference (implicit
9037         conversions exists from this to object), but the regular IsClass
9038         and IsValueType tests will never return true for this one.
9039
9040         Also we use TypeManager.IsValueType instead of type.IsValueType,
9041         just for consistency with the rest of the code (this is only
9042         needed if we ever use the construct exposed by test-180.cs inside
9043         corlib, which we dont today).
9044
9045 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9046
9047         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9048         just InternalCall.
9049
9050 2003-02-09  Martin Baulig  <martin@ximian.com>
9051
9052         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9053         (Namespace.DefineNamespaces): New static public method; this is
9054         called when we're compiling with debugging to add all namespaces
9055         to the symbol file.
9056
9057         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9058         pass it to the Namespace's .ctor.
9059
9060         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9061         and MethodBase arguments; pass the namespace ID to the symwriter;
9062         pass the MethodBase instead of the token to the symwriter.
9063         (SymbolWriter.DefineNamespace): New method to add a namespace to
9064         the symbol file.
9065
9066 2003-02-09  Martin Baulig  <martin@ximian.com>
9067
9068         * symbolwriter.cs: New file.  This is a wrapper around
9069         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9070         methods here in near future.
9071
9072 2003-02-09  Martin Baulig  <martin@ximian.com>
9073
9074         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9075         ILGenerator.MarkSequencePoint() which are actually used by the
9076         symbol writer.
9077
9078 2003-02-09  Martin Baulig  <martin@ximian.com>
9079
9080         * location.cs (SourceFile): New public sealed class.  This
9081         contains the name and an index which is used in the location's token.
9082         (Location): Reserve an appropriate number of bits in the token for
9083         the source file instead of walking over that list, this gives us a
9084         really huge performance improvement when compiling with debugging.
9085
9086         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9087         `SourceFile' argument instead of a string.
9088         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9089         but don't parse/tokenize here, we need to generate the list of all
9090         source files before we do that.
9091         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9092         the files.
9093
9094         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9095         instead of a string.
9096
9097         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9098         of a string.
9099
9100 2003-02-09  Martin Baulig  <martin@ximian.com>
9101
9102         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9103         filename on `#line default'.
9104
9105 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9106
9107         * statement.cs: don't clear the pinned var when the fixed statement
9108         returns from the method (fixes bug#37752).
9109
9110 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9111
9112         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9113         to IsValueType.
9114
9115 2003-02-07  Martin Baulig  <martin@ximian.com>
9116
9117         * driver.cs: Removed the `--debug-args' command line argument.
9118
9119         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9120         automatically by the AsssemblyBuilder.
9121         (CodeGen.InitializeSymbolWriter): We don't need to call any
9122         initialization function on the symbol writer anymore.  This method
9123         doesn't take any arguments.
9124
9125 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9126
9127         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9128         from referenced assemblies as well.
9129
9130 2003-02-02  Martin Baulig  <martin@ximian.com>
9131
9132         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9133
9134 2003-02-02  Martin Baulig  <martin@ximian.com>
9135
9136         * class.cs (Constructor.Emit): Open the symbol writer before
9137         emitting the constructor initializer.
9138         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9139         single-stepping through constructor initializers.
9140
9141 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9142
9143         * class.cs: Handle error 549: do not allow virtual methods in
9144         sealed classes. 
9145
9146 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9147
9148         * decl.cs: Check access levels when resolving types
9149
9150 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9151
9152         * statement.cs: Add parameters and locals set in catch blocks that might 
9153         return to set vector
9154
9155 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9156
9157         * class.cs (Operator): Set the SpecialName flags for operators.
9158
9159         * expression.cs (Invocation.DoResolve): Only block calls to
9160         accessors and operators on SpecialName methods.
9161
9162         (Cast.TryReduce): Handle conversions from char constants.
9163
9164
9165 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9166
9167         * statement.cs: small memory and time optimization in FlowBranching.
9168
9169 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9170
9171         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9172         problem that the last fix but in the other sid (Set).
9173
9174         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9175         access when there is no indexer in the hierarchy.
9176
9177 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9178
9179         * class.cs: Combine some if statements.
9180
9181 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9182
9183         * driver.cs: fixed bug #37187.
9184
9185 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9186
9187         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9188         any indexer, it's needed to build a list with all the indexers in the
9189         hierarchy (AllGetters), else we have problems. Fixes #35653.
9190
9191 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9192
9193         * class.cs (MethodData.Define): It is wrong for an interface
9194         implementation to be static in both cases: explicit and implicit.
9195         We were only handling this in one case.
9196
9197         Improve the if situation there to not have negations.
9198
9199         * class.cs (Field.Define): Turns out that we do not need to check
9200         the unsafe bit on field definition, only on usage.  Remove the test.
9201
9202 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9203
9204         * driver.cs: use assembly.Location instead of Codebase (the latest
9205         patch made mcs fail when using MS assemblies).
9206
9207 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9208
9209         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9210         get the path to *corlib.dll.
9211
9212 2003-01-21  Nick Drochak <ndrochak@gol.com>
9213
9214         * cs-tokenizer.cs:
9215         * pending.cs:
9216         * typemanager.cs: Remove compiler warnings
9217
9218 2003-01-20  Duncan Mak  <duncan@ximian.com>
9219
9220         * AssemblyInfo.cs: Bump the version number to 0.19.
9221
9222 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9223
9224         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9225
9226 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9227
9228         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9229
9230 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9231
9232         * cs-parser.jay: Small fix: we were not comparing the constructor
9233         name correctly.   Thanks to Zoltan for the initial pointer.
9234
9235 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9236
9237         * cs-tokenizer.cs: Set file name when specified with #line
9238
9239 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9240
9241         * cs-parser.jay: Only perform the constructor checks here if we
9242         are named like the class;  This will help provider a better
9243         error.  The constructor path is taken when a type definition is
9244         not found, but most likely the user forgot to add the type, so
9245         report that rather than the constructor error.
9246
9247 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9248
9249         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9250         allocations.
9251
9252 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9253
9254         * cs-parser.jay: Add cleanup call.
9255
9256 2003-01-13  Duncan Mak  <duncan@ximian.com>
9257
9258         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9259         consistent with other methods.
9260
9261 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9262
9263         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9264
9265 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9266
9267         * attribute.cs: only set GuidAttr to true when we have a
9268         GuidAttribute.
9269
9270 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9271
9272         * ecore.cs:
9273         * expression.cs:
9274         * typemanager.cs: fixes to allow mcs compile corlib with the new
9275         Type.IsSubclassOf fix.
9276
9277 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9278
9279         * expression.cs (LocalVariableReference.DoResolve): Classify a
9280         constant as a value, not as a variable.   Also, set the type for
9281         the variable.
9282
9283         * cs-parser.jay (fixed_statement): take a type instead of a
9284         pointer_type, so we can produce a better error message later.
9285
9286         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9287         as an error.  
9288
9289         (For.DoEmit): Make inifinite loops have a
9290         non-conditional branch back.
9291
9292         (Fixed.DoEmit): First populate the pinned variables, then emit the
9293         statement, then clear the variables.  Before I was emitting the
9294         code once for each fixed piece.
9295
9296
9297 2003-01-08  Martin Baulig  <martin@ximian.com>
9298
9299         * statement.cs (FlowBranching.MergeChild): A break in a
9300         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9301
9302 2003-01-08  Martin Baulig  <martin@ximian.com>
9303
9304         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9305         lives in the same number space than `param_map'.  Fixes #36154.
9306
9307 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9308
9309         * cs-parser.jay (constructor_declaration): Set the
9310         Constructor.ModFlags before probing for it.  This makes the
9311         compiler report 514, 515 and 132 (the code was there, but got
9312         broken). 
9313
9314         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9315         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9316         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9317
9318 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9319
9320         * enum.cs: create the enum static fields using the enum type.
9321
9322 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9323
9324         * class.cs: don't try to create the ParamBuilder for the return
9325         type if it's not needed (and handle it breaking for the ms runtime
9326         anyway).
9327
9328 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9329
9330         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9331
9332 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9333
9334         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9335         the command.   This showed up while compiling the JANET source
9336         code, which used \r as its only newline separator.
9337
9338 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9339
9340         * class.cs (Method.Define): If we are an operator (because it
9341         reuses our code), then set the SpecialName and HideBySig.  #36128
9342
9343 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9346         exception, report error 120 `object reference required'.
9347
9348         * driver.cs: Add --pause option, used during to measure the size
9349         of the process as it goes with --timestamp.
9350
9351         * expression.cs (Invocation.DoResolve): Do not allow methods with
9352         SpecialName to be invoked.
9353
9354 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9355
9356         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9357         number before adding it.
9358
9359 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9360
9361         * ecore.cs (StandardImplicitConversion): When in an unsafe
9362         context, we allow conversion between void * to any other pointer
9363         type. This fixes bug #35973.
9364
9365 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9366
9367         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9368         is not thrown when extensionless outputs are used 
9369
9370 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9371
9372         * rootcontext.cs: fixed compilation of corlib.
9373
9374 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9375
9376         * attribute.cs (Attributes.Contains): Add new method.
9377
9378         * class.cs (MethodCore.LabelParameters): if the parameter is an
9379         `out' parameter, check that no attribute `[In]' has been passed.
9380
9381         * enum.cs: Handle the `value__' name in an enumeration.
9382
9383 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9384
9385         * decl.cs: Added special case to allow overrides on "protected
9386         internal" methods
9387
9388 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9389
9390         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9391         since it makes much more sense.
9392
9393         (Attributes.ctor): Don't require a Location parameter.
9394
9395         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9396
9397         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9398         since we already have that information per attribute.
9399
9400         * everywhere : make appropriate changes.
9401
9402         * class.cs (LabelParameters): Write the code which actually
9403         applies attributes to the return type. We can't do this on the MS
9404         .NET runtime so we flag a warning in the case an exception is
9405         thrown.
9406
9407 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9408
9409         * const.cs: Handle implicit null conversions here too.
9410
9411 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9412
9413         * class.cs (MethodCore.LabelParameters): Remove the extra
9414         Type [] parameter since it is completely unnecessary. Instead
9415         pass in the method's attributes so that we can extract
9416         the "return" attribute.
9417
9418 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9419
9420         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9421         of ignoring it and letting the compile continue.
9422
9423         * typemanager.cs (ChangeType): use an extra argument to return an
9424         error condition instead of throwing an exception.
9425
9426 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9427
9428         * expression.cs (Unary.TryReduce): mimic the code for the regular
9429         code path.  Perform an implicit cast in the cases where we can
9430         implicitly convert to one of the integral types, and then reduce
9431         based on that constant.   This fixes bug #35483.
9432
9433 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9434
9435         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9436
9437 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9438
9439         * namespace.cs: fixed bug #35489.
9440
9441 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9442
9443         * class.cs: Remove some dead code.
9444
9445         * cs-parser.jay: Estimate the number of methods needed
9446         (RootContext.MethodCount);
9447
9448         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9449         numbers instead of StringBuilders.
9450
9451         * support.cs (PtrHashtable): Add constructor with initial size;
9452         We can now reduce reallocations of the method table.
9453
9454 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9455
9456         * attribute.cs (ApplyAttributes): Keep track of the emitted
9457         attributes on a per-target basis. This fixes bug #35413.
9458
9459 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9460
9461         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9462         default to the Windows 1252 encoding.
9463
9464         (UnixParseOption): Support version, thanks to Alp for the missing
9465         pointer. 
9466
9467         * AssemblyInfo.cs: Add nice assembly information.
9468
9469         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9470         (bug 35169).
9471
9472         * cs-parser.jay: Allow a trailing comma before the close bracked
9473         in the attribute_section production.
9474
9475         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9476         address of the instance was being taken, I will take this out,
9477         because we take the address of the object immediately here.
9478
9479 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9480
9481         * typemanager.cs (AreMultipleAllowed): Take care of the most
9482         obvious case where attribute type is not in the current assembly -
9483         stupid me ;-)
9484
9485 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9486
9487         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9488         definitions, instead of doing that afterwards.  
9489
9490         Also we use a nice little hack, depending on the constructor, we
9491         know if we are a "composed" name or a simple name.  Hence, we
9492         avoid the IndexOf test, and we avoid 
9493
9494         * codegen.cs: Add code to assist in a bug reporter to track down
9495         the source of a compiler crash. 
9496
9497 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9498
9499         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9500         types have been emitted for a given element and flag an error
9501         if something which does not have AllowMultiple set is used more
9502         than once.
9503
9504         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9505         attribute types and their corresponding AllowMultiple properties
9506
9507         (AreMultipleAllowed): Check the property for a given type.
9508
9509         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9510         property in the case we have a TypeContainer.
9511
9512         (Attributes.AddAttribute): Detect duplicates and just skip on
9513         adding them. This trivial fix catches a pretty gross error in our
9514         attribute emission - global attributes were being emitted twice!
9515
9516         Bugzilla bug #33187 is now fixed.
9517
9518 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9519
9520         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9521         instead of pp_and).
9522
9523         * expression.cs (Binary.ResolveOperator): I can only use the
9524         Concat (string, string, string) and Concat (string, string,
9525         string, string) if the child is actually a concatenation of
9526         strings. 
9527
9528 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
9529
9530         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
9531         context where we need a 2-character lookahead.
9532
9533         * pending.cs (PendingImplementation): Rework so we can keep track
9534         of interface types all the time, and flag those which were
9535         implemented by parents as optional.
9536
9537 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
9538
9539         * expression.cs (Binary.ResolveOperator): Use
9540         String.Concat(string,string,string) or
9541         String.Concat(string,string,string,string) when possible. 
9542
9543         * typemanager: More helper methods.
9544
9545
9546 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
9547
9548         * pending.cs: remove the bogus return from GetMissingInterfaces()
9549         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
9550
9551 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9552
9553         * namespace.cs: avoid duplicated 'using xxx' being added to
9554         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
9555         when we get more than one 'using' statement for the same namespace.
9556         Report a CS0105 warning for it.
9557
9558 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
9559
9560         * cs-tokenizer.cs (consume_identifier): use read directly, instead
9561         of calling getChar/putback, uses internal knowledge of it.    
9562
9563         (xtoken): Reorder tokenizer so most common patterns are checked
9564         first.  This reduces the compilation time in another 5% (from 8.11s
9565         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
9566
9567         The parsing time is 22% of the compilation in mcs, and from that
9568         64% is spent on the tokenization process.  
9569
9570         I tried using a binary search for keywords, but this is slower
9571         than the hashtable.  Another option would be to do a couple of
9572         things:
9573
9574                 * Not use a StringBuilder, instead use an array of chars,
9575                   with a set value.  Notice that this way we could catch
9576                   the 645 error without having to do it *afterwards*.
9577
9578                 * We could write a hand-parser to avoid the hashtable
9579                   compares altogether.
9580
9581         The identifier consumption process takes 37% of the tokenization
9582         time.  Another 15% is spent on is_number.  56% of the time spent
9583         on is_number is spent on Int64.Parse:
9584
9585                 * We could probably choose based on the string length to
9586                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
9587                   computations. 
9588
9589         Another 3% is spend on wrapping `xtoken' in the `token' function.
9590
9591         Handle 0xa0 as whitespace (#34752)
9592
9593 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
9594
9595         * typemanager.cs (IsCLRType): New routine to tell whether a type
9596         is one of the builtin types.  
9597
9598         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
9599         typecode in more places instead of doing pointer comparissions.
9600         We could leverage some knowledge about the way the typecodes are
9601         laid out.
9602
9603         New code to cache namespaces in assemblies, it is currently not
9604         invoked, to be used soon.
9605
9606         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
9607
9608         * expression.cs (Binary.ResolveOperator): specially handle
9609         strings, and do not perform user-defined operator overloading for
9610         built-in types.
9611
9612 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
9613
9614         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
9615         internalcall as it is a pretty simple operation;  Avoid whenever
9616         possible to call Char.IsLetter.
9617
9618         (consume_identifier): Cut by half the number of
9619         hashtable calls by merging the is_keyword and GetKeyword behavior.
9620
9621         Do not short-circuit, because if we do, we
9622         report errors (ie, #if false && true would produce an invalid
9623         directive error);
9624
9625
9626 2002-11-24  Martin Baulig  <martin@ximian.com>
9627
9628         * expression.cs (Cast.TryReduce): If we're in checked syntax,
9629         check constant ranges and report a CS0221.  Fixes #33186.
9630
9631 2002-11-24  Martin Baulig  <martin@ximian.com>
9632
9633         * cs-parser.jay: Make this work for uninitialized variable
9634         declarations in the `for' initializer.  Fixes #32416.
9635
9636 2002-11-24  Martin Baulig  <martin@ximian.com>
9637
9638         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
9639         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
9640
9641 2002-11-24  Martin Baulig  <martin@ximian.com>
9642
9643         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
9644         argument; if true, we also check for user-defined conversions.
9645         This is only needed if both arguments are of a user-defined type.
9646         Fixes #30443, added test-175.cs.
9647         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
9648
9649         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
9650
9651 2002-11-24  Martin Baulig  <martin@ximian.com>
9652
9653         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
9654         function to get the store opcode.
9655         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
9656         only emit the Ldelema if the store opcode is Stobj.  You must run
9657         both test-34 and test-167 to test this.  Fixes #34529.
9658
9659 2002-11-23  Martin Baulig  <martin@ximian.com>
9660
9661         * ecore.cs (Expression.MemberLookup): Added additional
9662         `qualifier_type' argument which is used when we're being called
9663         from MemberAccess.DoResolve() and null if we're called from a
9664         SimpleName lookup.
9665         (Expression.MemberLookupFailed): New method to report errors; this
9666         does the CS1540 check and reports the correct error message.
9667
9668         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
9669         argument for the CS1540 check and redone the way how we're dealing
9670         with private members.  See the comment in the source code for details.
9671         (FilterWithClosure): Reverted this back to revision 1.197; renamed
9672         `closure_start_type' to `closure_qualifier_type' and check whether
9673         it's not null.  It was not this filter being broken, it was just
9674         being called with the wrong arguments.
9675
9676         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
9677         and pass it the correct `qualifier_type'; this also does the error
9678         handling for us.
9679
9680 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
9681
9682         * expression.cs (Invocation.EmitParams): If the we are dealing
9683         with a non-built-in value type, load its address as well.
9684
9685         (ArrayCreation): Use a a pretty constant instead
9686         of the hardcoded value 2.   Use 6 instead of 2 for the number of
9687         static initializers.  
9688
9689         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
9690         because they are not really value types, just glorified integers. 
9691
9692         * driver.cs: Do not append .exe, the CSC compiler does not do it.
9693
9694         * ecore.cs: Remove redundant code for enumerations, make them use
9695         the same code path as everything else, fixes the casting issue
9696         with enumerations in Windows.Forms.
9697
9698         * attribute.cs: Do only cast to string if it is a string, the
9699         validation happens later.
9700
9701         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
9702         people upgrade their corlibs.
9703
9704         * ecore.cs: Oops, enumerations were not following the entire code path
9705
9706 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
9707
9708         * typemanager.cs (FilterWithClosure): Commented out the test for
9709         1540 in typemanager.cs, as it has problems when accessing
9710         protected methods from a parent class (see test-174.cs). 
9711
9712         * attribute.cs (Attribute.ValidateGuid): new method.
9713         (Attribute.Resolve): Use above.
9714
9715 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
9716
9717         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
9718
9719         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
9720         handling for enumerations, as we only needed the TypeContainer
9721         functionality to begin with (this is required for the fix below to
9722         work for enums that reference constants in a container class for
9723         example). 
9724
9725         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
9726
9727         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
9728         a valid TypeBuilder to perform lookups on.o
9729
9730         * class.cs (InheritableMemberSignatureCompare): Use true in the
9731         call to GetGetMethod and GetSetMethod, because we are comparing
9732         the signature, and we need to get the methods *even* if they are
9733         private. 
9734
9735         (PropertyBase.CheckBase): ditto.
9736
9737         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
9738         GotoCase.Resolve): Use Peel on EmpytCasts.
9739
9740         * ecore.cs (EmptyCast): drop child, add Peel method.
9741
9742 2002-11-17  Martin Baulig  <martin@ximian.com>
9743
9744         * ecore.cs (EmptyCast.Child): New public property.
9745
9746         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
9747         label resolved to an EmptyCast.  Fixes #34162.
9748         (GotoCase.Resolve): Likewise.
9749         (Block.EmitMeta): Likewise.
9750
9751 2002-11-17  Martin Baulig  <martin@ximian.com>
9752
9753         * expression.cs (Invocation.BetterConversion): Prefer int over
9754         uint; short over ushort; long over ulong for integer literals.
9755         Use ImplicitConversionExists instead of StandardConversionExists
9756         since we also need to check for user-defined implicit conversions.
9757         Fixes #34165.  Added test-173.cs.
9758
9759 2002-11-16  Martin Baulig  <martin@ximian.com>
9760
9761         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
9762         with the `true' and `false' literals.  Fixes #33151.
9763
9764 2002-11-16  Martin Baulig  <martin@ximian.com>
9765
9766         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
9767         October 22nd; don't do the cs1540 check for static members.
9768
9769         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
9770         now using our own filter here and doing the cs1540 check again.
9771
9772 2002-11-16  Martin Baulig  <martin@ximian.com>
9773
9774         * support.cs (InternalParameters): Don't crash if we don't have
9775         any fixed parameters.  Fixes #33532.
9776
9777 2002-11-16  Martin Baulig  <martin@ximian.com>
9778
9779         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
9780         when looking up static methods to make this work on Windows.
9781         Fixes #33773.
9782
9783 2002-11-16  Martin Baulig  <martin@ximian.com>
9784
9785         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
9786         a setter rather than using PropertyInfo.CanWrite.
9787
9788 2002-11-15  Nick Drochak  <ndrochak@gol.com>
9789
9790         * class.cs: Allow acces to block member by subclasses. Fixes build
9791         breaker.
9792
9793 2002-11-14  Martin Baulig  <martin@ximian.com>
9794
9795         * class.cs (Constructor.Emit): Added the extern/block check.
9796         Fixes bug #33678.
9797
9798 2002-11-14  Martin Baulig  <martin@ximian.com>
9799
9800         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
9801         iteration while looking for indexers, this is needed because the
9802         indexer may have a different name in our base classes.  Fixed the
9803         error reporting (no indexers at all, not get accessor, no
9804         overloaded match).  Fixes bug #33089.
9805         (IndexerAccess.DoResolveLValue): Likewise.
9806
9807 2002-11-14  Martin Baulig  <martin@ximian.com>
9808
9809         * class.cs (PropertyBase.CheckBase): Make this work for multiple
9810         indexers.  Fixes the first part of bug #33089.
9811         (MethodSignature.InheritableMemberSignatureCompare): Added support
9812         for properties.
9813
9814 2002-11-13  Ravi Pratap  <ravi@ximian.com>
9815
9816         * attribute.cs (Attribute.Resolve): Catch the
9817         NullReferenceException and report it since it isn't supposed to
9818         happen. 
9819
9820 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
9821
9822         * expression.cs (Binary.EmitBranchable): Also handle the cases for
9823         LogicalOr and LogicalAnd that can benefit from recursively
9824         handling EmitBranchable.  The code now should be nice for Paolo.
9825
9826 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
9827
9828         * typemanager.cs (LookupType): Added a negative-hit hashtable for
9829         the Type lookups, as we perform quite a number of lookups on
9830         non-Types.  This can be removed once we can deterministically tell
9831         whether we have a type or a namespace in advance.
9832
9833         But this might require special hacks from our corlib.
9834
9835         * TODO: updated.
9836
9837         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
9838         and double which avoids a conversion from an integer to a double.
9839
9840         * expression.cs: tiny optimization, avoid calling IsConstant,
9841         because it effectively performs the lookup twice.
9842
9843 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
9844
9845         But a bogus return here to keep the semantics of the old code
9846         until the Mono runtime is fixed.
9847
9848         * pending.cs (GetMissingInterfaces): New method used to remove all
9849         the interfaces that are already implemented by our parent
9850         classes from the list of pending methods. 
9851
9852         * interface.cs: Add checks for calls after ResolveTypeExpr.
9853
9854 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
9855
9856         * class.cs (Class.Emit): Report warning 67: event not used if the
9857         warning level is beyond 3.
9858
9859         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
9860         being a NullLiteral.
9861
9862         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
9863         specifiers. 
9864
9865         * class.cs (TypeContainer.GetClassBases): Cover a missing code
9866         path that might fail if a type can not be resolved.
9867
9868         * expression.cs (Binary.Emit): Emit unsigned versions of the
9869         operators. 
9870
9871         * driver.cs: use error 5.
9872
9873 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
9874
9875         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
9876
9877 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
9878
9879         * cs-parser.jay (switch_section): A beautiful patch from Martin
9880         Baulig that fixed 33094.
9881
9882 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
9883
9884         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
9885         Check whether the base is abstract and report an error if so.
9886
9887         * expression.cs (IndexerAccess.DoResolveLValue,
9888         IndexerAccess.DoResolve): ditto. 
9889
9890         (Invocation.DoResolve): ditto.
9891
9892         (Invocation.FullMethodDesc): Improve the report string.
9893
9894         * statement.cs (Block): Eliminate IsVariableDefined as it is
9895         basically just a wrapper for GetVariableInfo.
9896
9897         * ecore.cs (SimpleName): Use new 
9898
9899         * support.cs (ReflectionParamter.ParameterType): We unwrap the
9900         type, as we return the actual parameter ref/unref state on a
9901         different call.
9902
9903 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
9904
9905         * support.cs: Return proper flags REF/OUT fixing the previous
9906         commit.  
9907
9908         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
9909         not used to mean `ref' but `ref or out' in ParameterReference
9910
9911         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
9912         full type signature instead of calling TypeManger.CSharpName
9913         ourselves. 
9914
9915         * support.cs (InternalParameters.ParameterDesc): Do not compare
9916         directly to the modflags, because REF/OUT will actually be bitsets
9917         if set. 
9918
9919         * delegate.cs (VerifyMethod): Check also the modifiers.
9920
9921         * cs-tokenizer.cs: Fix bug where floating point values with an
9922         exponent where a sign was missing was ignored.
9923
9924         * driver.cs: Allow multiple assemblies to be specified in a single
9925         /r: argument
9926
9927 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
9928
9929         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
9930         because identifiers after a parenthesis would end up in this kind
9931         of production, and we needed to desamiguate it for having casts
9932         like:
9933
9934                 (UserDefinedType *) xxx
9935
9936 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
9937
9938         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
9939         we should set on the Bindingflags.NonPublic, but not turn on
9940         private_ok.  private_ok controls whether a Private member is
9941         returned (this is chekced on the filter routine), while the
9942         BindingFlags.NonPublic just controls whether private/protected
9943         will be allowed.   This fixes the problem part of the problem of
9944         private properties being allowed to be used in derived classes.
9945
9946         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
9947         so we can call the children DoResolveLValue method (this will
9948         properly signal errors on lvalue assignments to base properties)
9949
9950         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
9951         getter are null, and we have a property info, we know that this
9952         happened because the lookup failed, so we report an error 122 for
9953         protection level violation.
9954
9955         We also silently return if setter and getter are null in the
9956         resolve functions, this condition only happens if we have flagged
9957         the error before.  This is the other half of the problem. 
9958
9959         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
9960         not have accessibility information, that is why we were returning
9961         true in the filter function in typemanager.cs.
9962
9963         To properly report 122 (property is inaccessible because of its
9964         protection level) correctly, we report this error in ResolveAccess
9965         by failing if both the setter and the getter are lacking (ie, the
9966         lookup failed). 
9967
9968         DoResolve and DoLResolve have been modified to check for both
9969         setter/getter being null and returning silently, the reason being
9970         that I did not want to put the knowledge about this error in upper
9971         layers, like:
9972
9973         int old = Report.Errors;
9974         x = new PropertyExpr (...);
9975         if (old != Report.Errors)
9976                 return null;
9977         else
9978                 return x;
9979
9980         So the property expr is returned, but it is invalid, so the error
9981         will be flagged during the resolve process. 
9982
9983         * class.cs: Remove InheritablePropertySignatureCompare from the
9984         class, as we no longer depend on the property signature to compute
9985         whether it is possible to implement a method or not.
9986
9987         The reason is that calling PropertyInfo.GetGetMethod will return
9988         null (in .NET, in Mono it works, and we should change this), in
9989         cases where the Get Method does not exist in that particular
9990         class.
9991
9992         So this code:
9993
9994         class X { public virtual int A { get { return 1; } } }
9995         class Y : X { }
9996         class Z : Y { public override int A { get { return 2; } } }
9997
9998         Would fail in Z because the parent (Y) would not have the property
9999         defined.  So we avoid this completely now (because the alternative
10000         fix was ugly and slow), and we now depend exclusively on the
10001         method names.
10002
10003         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10004         reference method, instead of using the property.
10005
10006         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10007         routines are gone now.
10008
10009         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10010         names, they were incorrectly named.
10011
10012         * cs-tokenizer.cs: Return are more gentle token on failure. 
10013
10014         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10015         had an out-of-sync index variable, which caused it to remove from
10016         the list of pending methods the wrong method sometimes.
10017
10018 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10019
10020         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10021         CanWrite, because those refer to this particular instance of the
10022         property, and do not take into account the fact that we can
10023         override single members of a property.
10024
10025         Constructor requires an EmitContext.  The resolution process does
10026         not happen here, but we need to compute the accessors before,
10027         because the resolution does not always happen for properties.
10028
10029         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10030         subclass, before we did not update this flag, but we did update
10031         bindingflags. 
10032
10033         (GetAccessors): Drop this routine, as it did not work in the
10034         presence of partially overwritten set/get methods. 
10035
10036         Notice that this broke the cs1540 detection, but that will require
10037         more thinking. 
10038
10039 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10040
10041         * class.cs:
10042         * codegen.cs:
10043         * driver.cs: issue a warning instead of an error if we don't support
10044         debugging for the platform. Also ignore a couple of errors that may
10045         arise when trying to write the symbols. Undo my previous patch.
10046
10047 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10048
10049         * driver.cs: ignore /debug switch except for Unix platforms.
10050
10051 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10052
10053         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10054
10055 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10056
10057         * driver.cs: Do not make mcs-debug conditional, so we do not break
10058         builds that use it.
10059
10060         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10061         review this patch.  But basically after all the children variables
10062         have been merged, the value of "Breaks" was not being set to
10063         new_breaks for Switch blocks.  I think that it should be set after
10064         it has executed.  Currently I set this to the value of new_breaks,
10065         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10066         conservative, but I do not understand this code very well.
10067
10068         I did not break anything in the build, so that is good ;-)
10069
10070         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10071
10072 2002-10-20  Mark Crichton  <crichton@gimp.org>
10073
10074         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10075
10076 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10077
10078         * cfold.cs: Fixed compile blocker.
10079
10080 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10081
10082         * driver.cs: I was chekcing the key, not the file.
10083
10084 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10085
10086         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10087         message that we were generating - we just need to silently return
10088         a null.
10089
10090 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10091
10092         * class.cs (Event.Define): Change my previous commit, as this
10093         breaks the debugger.  This is a temporary hack, as it seems like
10094         the compiler is generating events incorrectly to begin with.
10095
10096         * expression.cs (Binary.ResolveOperator): Added support for 
10097         "U operator - (E x, E y)"
10098
10099         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10100         y)".
10101
10102         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10103         init-only variables, but this path did not take into account that
10104         there might be also instance readonly variables.  Correct this
10105         problem. 
10106
10107         This fixes bug 32253
10108
10109         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10110         delegates as well.
10111
10112         * driver.cs: Change the extension for modules to `netmodule'
10113
10114         * cs-parser.jay: Improved slightly the location tracking for
10115         the debugger symbols.
10116
10117         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10118         modifiers that were specified instead of the hardcoded value
10119         (FamAndAssem).  This was basically ignoring the static modifier,
10120         and others.  Fixes 32429.
10121
10122         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10123         fixed a bug in the process (32476)
10124
10125         * expression.cs (ArrayAccess.EmitAssign): Patch from
10126         hwang_rob@yahoo.ca that fixes bug 31834.3
10127
10128 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10129
10130         * driver.cs: Make the module extension .netmodule.
10131
10132 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10133
10134         * driver.cs: Report an error if the resource file is not found
10135         instead of crashing.
10136
10137         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10138         false, like Emit does.
10139
10140 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10141
10142         * typemanager.cs: Remove unused private member.  Also reported mcs
10143         bug to report this as a warning like csc.
10144
10145 2002-10-15  Martin Baulig  <martin@gnome.org>
10146
10147         * statement.cs (Statement.Emit): Made this a virtual method; emits
10148         the line number info and calls DoEmit().
10149         (Statement.DoEmit): New protected abstract method, formerly knows
10150         as Statement.Emit().
10151
10152         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10153
10154 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10155
10156         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10157         have fixed a remaining problem: not every AddXXXX was adding a
10158         fully qualified name.  
10159
10160         Now everyone registers a fully qualified name in the DeclSpace as
10161         being defined instead of the partial name.  
10162
10163         Downsides: we are slower than we need to be due to the excess
10164         copies and the names being registered this way.  
10165
10166         The reason for this is that we currently depend (on the corlib
10167         bootstrap for instance) that types are fully qualified, because
10168         we dump all the types in the namespace, and we should really have
10169         types inserted into the proper namespace, so we can only store the
10170         basenames in the defined_names array.
10171
10172 2002-10-10  Martin Baulig  <martin@gnome.org>
10173
10174         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10175         from bug #31834, see the bug report for a testcase which is
10176         miscompiled.
10177
10178 2002-10-10  Martin Baulig  <martin@gnome.org>
10179
10180         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10181         flow analysis code for this.
10182
10183         * statement.cs (Do, While, For): Tell the flow analysis code about
10184         infinite loops.
10185         (FlowBranching.UsageVector): Added support for infinite loops.
10186         (Block.Resolve): Moved the dead code elimination here and use flow
10187         analysis to do it.
10188
10189 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10190
10191         * class.cs (Field.Define): Catch cycles on struct type
10192         definitions. 
10193
10194         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10195         fields if the fields are static.  We only need to check instance
10196         fields. 
10197
10198         * expression.cs (As.DoResolve): Test for reference type.
10199
10200         * statement.cs (Using.ResolveExpression): Use
10201         ConvertImplicitRequired, not ConvertImplicit which reports an
10202         error on failture
10203         (Using.ResolveLocalVariableDecls): ditto.
10204
10205         * expression.cs (Binary.ResolveOperator): Report errors in a few
10206         places where we had to.
10207
10208         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10209
10210 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10211
10212         * expression.cs: Use StoreFromPtr instead of extracting the type
10213         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10214
10215         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10216         an enumeration value to a System.Enum, but System.Enum is not a
10217         value type, but an class type, so we need to box.
10218
10219         (Expression.ConvertExplicit): One codepath could return
10220         errors but not flag them.  Fix this.  Fixes #31853
10221
10222         * parameter.cs (Resolve): Do not allow void as a parameter type.
10223
10224 2002-10-06  Martin Baulig  <martin@gnome.org>
10225
10226         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10227         if it's a class type and not a struct.  Fixes #31815.
10228
10229 2002-10-06  Martin Baulig  <martin@gnome.org>
10230
10231         * statement.cs: Reworked the flow analysis code a bit to make it
10232         usable for dead code elimination.
10233
10234 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10235
10236         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10237
10238 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10239
10240         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10241         to fix the test 165, will investigate deeper.
10242
10243 2002-10-04  Martin Baulig  <martin@gnome.org>
10244
10245         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10246         finally blocks actually work.
10247         (Try.Resolve): We don't need to create a sibling for `finally' if
10248         there is no finally block.
10249
10250 2002-10-04  Martin Baulig  <martin@gnome.org>
10251
10252         * class.cs (Constructor.Define): The default accessibility for a
10253         non-default constructor is private, not public.
10254
10255 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10256
10257         * class.cs (Constructor): Make AllowedModifiers public, add
10258         EXTERN.
10259
10260         * cs-parser.jay: Perform the modifiers test here, as the
10261         constructor for the Constructor class usually receives a zero
10262         because of the way we create it (first we create, later we
10263         customize, and we were never checking the modifiers).
10264
10265         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10266         is a version of LookupTypeReflection that includes the type-name
10267         cache.  This can be used as a fast path for functions that know
10268         the fully qualified name and are only calling into *.GetType() to
10269         obtain a composed type.
10270
10271         This is also used by TypeManager.LookupType during its type
10272         composition.
10273
10274         (LookupType): We now also track the real type name, as sometimes
10275         we can get a quey for the real type name from things like
10276         ComposedCast.  This fixes bug 31422.
10277
10278         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10279         complete type fullname, it does not have to go through the type
10280         resolution system to obtain the composed version of the type (for
10281         obtaining arrays or pointers).
10282
10283         (Conditional.Emit): Use the EmitBoolExpression to
10284         generate nicer code, as requested by Paolo.
10285
10286         (ArrayCreation.CheckIndices): Use the patch from
10287         hwang_rob@yahoo.ca to validate the array initializers. 
10288
10289 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10290
10291         * class.cs (ConstructorInitializer.Emit): simplify code by using
10292         Invocation.EmitCall, and at the same time, fix the bugs in calling
10293         parent constructors that took variable arguments. 
10294
10295         * ecore.cs (Expression.ConvertNumericExplicit,
10296         Expression.ImplicitNumericConversion): Remove the code that
10297         manually wrapped decimal (InternalTypeConstructor call is now gone
10298         as well).
10299
10300         * expression.cs (Cast.TryReduce): Also handle decimal types when
10301         trying to perform a constant fold on the type.
10302
10303         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10304
10305         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10306         that only turned off an error report, and did nothing else. 
10307
10308 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10309
10310         * driver.cs: Handle and ignore /fullpaths
10311
10312 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * expression.cs (Binary.ResolveOperator): Catch the case where
10315         DoNumericPromotions returns true, 
10316
10317         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10318
10319 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10320
10321         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10322         report error 70.
10323
10324 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10325
10326         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10327         conversion exists, but it is also required that the conversion be
10328         performed.  This manifested in "(Type64Enum) 2".  
10329
10330         * class.cs (TypeManager.AddMethod): The fix is not to change
10331         AddEnum, because that one was using a fully qualified name (every
10332         DeclSpace derivative does), but to change the AddMethod routine
10333         that was using an un-namespaced name.  This now correctly reports
10334         the duplicated name.
10335
10336         Revert patch until I can properly fix it.  The issue
10337         is that we have a shared Type space across all namespaces
10338         currently, which is wrong.
10339
10340         Options include making the Namespace a DeclSpace, and merge
10341         current_namespace/current_container in the parser.
10342
10343 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10344
10345         * cs-parser.jay: Improve error reporting when we get a different
10346         kind of expression in local_variable_type and
10347         local_variable_pointer_type. 
10348
10349         Propagate this to avoid missleading errors being reported.
10350
10351         * ecore.cs (ImplicitReferenceConversion): treat
10352         TypeManager.value_type as a target just like object_type.   As
10353         code like this:
10354
10355         ValueType v = 1;
10356
10357         Is valid, and needs to result in the int 1 being boxed before it
10358         is assigned to the value type v.
10359
10360         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10361         to validate the enumeration name.
10362
10363         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10364         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10365         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10366
10367         * ecore.cs (TryImplicitIntConversion): When doing an
10368         implicit-enumeration-conversion, check if the type is 64-bits and
10369         perform a conversion before passing to EnumConstant.
10370
10371 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10372
10373         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10374         report ambiguous type references.  Unlike the MS version, we
10375         report what the ambiguity is.   Innovation at work ;-)
10376
10377         (DeclSpace.FindType): Require a location argument to
10378         display when we display an ambiguous error.
10379
10380         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10381
10382         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10383
10384         * expression.cs (EmitDynamicInitializers): Apply patch from
10385         hwang_rob@yahoo.ca that fixes the order in which we emit our
10386         initializers. 
10387
10388 2002-09-21  Martin Baulig  <martin@gnome.org>
10389
10390         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10391         delegate takes no arguments.
10392
10393 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10396         from integers.
10397
10398         * expression.cs: Extract the underlying type.
10399
10400         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10401
10402         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10403
10404 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10405
10406         * class.cs (TypeContainer.DefineType): We can not use the nice
10407         PackingSize with the size set to 1 DefineType method, because it
10408         will not allow us to define the interfaces that the struct
10409         implements.
10410
10411         This completes the fixing of bug 27287
10412
10413         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10414         means also structs.  This fixes part of the problem. 
10415         (Expresion.ImplicitReferenceConversionExists): ditto.
10416
10417         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10418         error if there were no errors reported during the type lookup
10419         process, to avoid duplicates or redundant errors.  Without this
10420         you would get an ambiguous errors plus a type not found.  We have
10421         beaten the user enough with the first error.  
10422
10423         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10424         reference. 
10425
10426         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10427         during the resolution process, stop the lookup, this avoids
10428         repeated error reports (same error twice).
10429
10430         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10431
10432         * typemanager.cs (LookupType): Redo the type lookup code to match
10433         the needs of System.Reflection.  
10434
10435         The issue is that System.Reflection requires references to nested
10436         types to begin with a "+" sign instead of a dot.  So toplevel
10437         types look like: "NameSpace.TopLevelClass", and nested ones look
10438         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10439         levels. 
10440
10441 2002-09-19  Martin Baulig  <martin@gnome.org>
10442
10443         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10444         says that a method always returns or always throws an exception,
10445         don't report the CS0161.
10446
10447         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10448         set `Returns = new_returns'.
10449
10450 2002-09-19  Martin Baulig  <martin@gnome.org>
10451
10452         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10453         to an enum constant, check for a CS0176.
10454
10455 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10456
10457         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10458         for operators that must be in pairs and report errors.
10459
10460         * ecore.cs (SimpleName.DoResolveType): During the initial type
10461         resolution process, when we define types recursively, we must
10462         check first for types in our current scope before we perform
10463         lookups in the enclosing scopes.
10464
10465         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10466
10467         (Invocation.VerifyArgumentsCompat): Call
10468         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10469         I thought we were supposed to always call this, but there are a
10470         few places in the code where we dont do it.
10471
10472 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10473
10474         * driver.cs: Add support in -linkres and -resource to specify the
10475         name of the identifier.
10476
10477 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10478
10479         * ecore.cs (StandardConversionExists): Sync with the conversion
10480         code: allow anything-* to void* conversions.
10481
10482         (FindMostSpecificSource): Use an Expression argument
10483         instead of a Type, because we might be handed over a Literal which
10484         gets a few more implicit conversions that plain types do not.  So
10485         this information was being lost.
10486
10487         Also, we drop the temporary type-holder expression when not
10488         required.
10489
10490 2002-09-17  Martin Baulig  <martin@gnome.org>
10491
10492         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10493         this is an explicit interface implementation.
10494
10495 2002-09-17  Martin Baulig  <martin@gnome.org>
10496
10497         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10498         different `IndexerName' attributes.
10499
10500         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10501         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10502         virtual CommonResolve().
10503
10504 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10505
10506         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10507         and convert that to the UnderlyingType.
10508
10509         * statement.cs (Foreach.Resolve): Indexers are just like variables
10510         or PropertyAccesses.
10511
10512         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10513         inside quoted strings, we were not doing this before.
10514
10515 2002-09-16  Martin Baulig  <martin@gnome.org>
10516
10517         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10518         resolve it.  This is needed for the definite assignment check of the
10519         instance expression, fixes bug #29846.
10520         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10521
10522 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10523
10524         * parameter.cs: Fix compile error.  Cannot reference static member
10525         from an instance object.  Is this an mcs bug?
10526
10527 2002-09-14  Martin Baulig  <martin@gnome.org>
10528
10529         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
10530         multiple times.  Fixes bug #30295, added test-166.cs.
10531
10532 2002-09-14  Martin Baulig  <martin@gnome.org>
10533
10534         * statement.cs (Block.Emit): Don't emit unreachable code.
10535         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
10536         `break' statements.
10537         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
10538
10539 2002-09-14  Martin Baulig  <martin@gnome.org>
10540
10541         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
10542         is set.
10543
10544 2002-09-14  Martin Baulig  <martin@gnome.org>
10545
10546         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
10547         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
10548         be false on the ms runtime.
10549
10550 2002-09-13  Martin Baulig  <martin@gnome.org>
10551
10552         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
10553         the CS0038 error message.
10554
10555 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
10556
10557         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
10558         constant inside, return it.
10559
10560 2002-09-12  Martin Baulig  <martin@gnome.org>
10561
10562         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
10563         implicit conversion can be done between enum types.
10564
10565         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
10566         check whether an implicit conversion to the current enum's UnderlyingType
10567         exists and report an error if not.
10568
10569         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
10570         without debugging support.
10571
10572         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
10573         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
10574
10575 2002-09-12  Martin Baulig  <martin@gnome.org>
10576
10577         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
10578
10579         * ecore.cs (IMemberExpr.DeclaringType): New property.
10580         (SimpleName.SimpleNameResolve): Check whether we're accessing a
10581         nonstatic member of an outer type (CS0038).
10582
10583 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
10584
10585         * driver.cs: Activate the using-error detector at warning level
10586         4 (at least for MS-compatible APIs).
10587
10588         * namespace.cs (VerifyUsing): Small buglett fix.
10589
10590         * pending.cs (PendingImplementation): pass the container pointer. 
10591
10592         * interface.cs (GetMethods): Allow for recursive definition.  Long
10593         term, I would like to move every type to support recursive
10594         definitions, not the current ordering mechanism that we have right
10595         now.
10596
10597         The situation is this: Attributes are handled before interfaces,
10598         so we can apply attributes to interfaces.  But some attributes
10599         implement interfaces, we will now handle the simple cases
10600         (recursive definitions will just get an error).  
10601
10602         * parameter.cs: Only invalidate types at the end if we fail to
10603         lookup all types.  
10604
10605 2002-09-09  Martin Baulig  <martin@gnome.org>
10606
10607         * ecore.cs (PropertyExpr.Emit): Also check for
10608         TypeManager.system_int_array_get_length so this'll also work when
10609         compiling corlib.  Fixes #30003.
10610
10611 2002-09-09  Martin Baulig  <martin@gnome.org>
10612
10613         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
10614         and throw an exception if we can't get the type's size.  Fixed #30040,
10615         added test-165.cs.
10616
10617 2002-09-09  Martin Baulig  <martin@gnome.org>
10618
10619         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
10620
10621         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
10622         context.  Fixes bug #30027.
10623
10624         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
10625         virtual functions.  Fixes bug #30043, added test-164.cs.
10626
10627 2002-09-08  Ravi Pratap  <ravi@ximian.com>
10628
10629         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
10630
10631 2002-09-08  Nick Drochak  <ndrochak@gol.com>
10632
10633         * driver.cs: Use an object to get the windows codepage since it's not a
10634         static property.
10635
10636 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
10637
10638         * statement.cs (For.Emit): for infinite loops (test == null)
10639         return whether there is a break inside, not always "true".
10640
10641         * namespace.cs (UsingEntry): New struct to hold the name of the
10642         using definition, the location where it is defined, and whether it
10643         has been used in a successful type lookup.
10644
10645         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
10646         strings.
10647
10648         * decl.cs: ditto.
10649
10650 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10651
10652         * attribute.cs : Fix incorrect code which relied on catching
10653         a NullReferenceException to detect a null being passed in
10654         where an object was expected.
10655
10656 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
10657
10658         * statement.cs (Try): flag the catch variable as assigned
10659
10660         * expression.cs (Cast): Simplified by using ResolveType instead of
10661         manually resolving.
10662
10663         * statement.cs (Catch): Fix bug by using ResolveType.
10664
10665 2002-09-06  Ravi Pratap  <ravi@ximian.com>
10666
10667         * expression.cs (BetterConversion): Special case for when we have
10668         a NullLiteral as the argument and we have to choose between string
10669         and object types - we choose string the way csc does.
10670
10671         * attribute.cs (Attribute.Resolve): Catch the
10672         NullReferenceException and report error #182 since the Mono
10673         runtime no more has the bug and having this exception raised means
10674         we tried to select a constructor which takes an object and is
10675         passed a null.
10676
10677 2002-09-05  Ravi Pratap  <ravi@ximian.com>
10678
10679         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
10680         message (1502, 1503) when we can't locate a method after overload
10681         resolution. This is much more informative and closes the bug
10682         Miguel reported.
10683
10684         * interface.cs (PopulateMethod): Return if there are no argument
10685         types. Fixes a NullReferenceException bug.
10686
10687         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
10688         expressions too. Previously we were checking only in one place for
10689         positional arguments leaving out named arguments.
10690
10691         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
10692         type to the enum type is not allowed. Remove code corresponding to
10693         that.
10694
10695         (ConvertNumericExplicit): Allow explicit conversions from
10696         the underlying type to enum type. This precisely follows the spec
10697         and closes a bug filed by Gonzalo.
10698
10699 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10700
10701         * compiler.csproj:
10702         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
10703
10704 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
10705
10706         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
10707         it was important that we stored the right value after the
10708         reduction in `converted'.
10709
10710 2002-09-04  Martin Baulig  <martin@gnome.org>
10711
10712         * location.cs (Location.SymbolDocument): Use full pathnames for the
10713         source files.
10714
10715 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
10716
10717         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
10718         of the expression resolve mechanism, because that will catch the
10719         SimpleName error failures.
10720
10721         (Conditional): If we can not resolve the
10722         expression, return, do not crash.
10723
10724 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10725
10726         * cs-tokenizer.cs:
10727         (location): display token name instead of its number.
10728
10729 2002-08-28  Martin Baulig  <martin@gnome.org>
10730
10731         * expression.cs (Binary.ResolveOperator): Don't silently return
10732         but return an error if an operator cannot be applied between two
10733         enum types.
10734
10735 2002-08-28  Martin Baulig  <martin@gnome.org>
10736
10737         * class.cs (Constructor.Define): Set the permission attributes
10738         correctly instead of making all constructors public.
10739
10740 2002-08-28  Martin Baulig  <martin@gnome.org>
10741
10742         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
10743         for private members before reporting a CS0103; if we find anything,
10744         it's a CS0122.
10745
10746 2002-08-28  Martin Baulig  <martin@gnome.org>
10747
10748         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
10749         to check whether `closure_start_type == closure_invocation_type',
10750         we also need to check whether `m.DeclaringType == closure_invocation_type'
10751         before bypassing the permission checks.  We might be accessing
10752         protected/private members from the base class.
10753         (TypeManager.RealMemberLookup): Only set private_ok if private
10754         members were requested via BindingFlags.NonPublic.
10755
10756         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
10757
10758         * expression.cs (MemberAccess.ResolveMemberAccess): Set
10759         MethodGroupExpr.IsExplicitImpl if appropriate.
10760         (Invocation.DoResolve): Don't report the CS0120 for explicit
10761         interface implementations.
10762
10763 2002-08-27  Martin Baulig  <martin@gnome.org>
10764
10765         * expression.cs (Invocation.DoResolve): If this is a static
10766         method and we don't have an InstanceExpression, we must report
10767         a CS0120.
10768
10769 2002-08-25  Martin Baulig  <martin@gnome.org>
10770
10771         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
10772         `==' between a valuetype and an object.
10773
10774 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
10775
10776         * ecore.cs (TypeExpr): Provide a ToString method.
10777
10778 2002-08-24  Martin Baulig  <martin@gnome.org>
10779
10780         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
10781         now called proggie.dbg and it's a binary file.
10782
10783 2002-08-23  Martin Baulig  <martin@gnome.org>
10784
10785         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
10786
10787 2002-08-23  Martin Baulig  <martin@gnome.org>
10788
10789         * struct.cs (MyStructInfo.ctor): Make this work with empty
10790         structs; it's not allowed to use foreach() on null.
10791
10792 2002-08-23  Martin Baulig  <martin@gnome.org>
10793
10794         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
10795         writer the full pathname of the generated assembly.
10796
10797 2002-08-23  Martin Baulig  <martin@gnome.org>
10798
10799         * statements.cs (FlowBranching.UsageVector.MergeChildren):
10800         A `finally' block never returns or breaks; improved handling of
10801         unreachable code.
10802
10803 2002-08-23  Martin Baulig  <martin@gnome.org>
10804
10805         * statement.cs (Throw.Resolve): Allow `throw null'.
10806
10807 2002-08-23  Martin Baulig  <martin@gnome.org>
10808
10809         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
10810         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
10811         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
10812         MemberLookup would return a wrong event if this is an explicit
10813         interface implementation and the class has an event with the same
10814         name.
10815
10816 2002-08-23  Martin Baulig  <martin@gnome.org>
10817
10818         * statement.cs (Block.AddChildVariableNames): New public method.
10819         (Block.AddChildVariableName): Likewise.
10820         (Block.IsVariableNameUsedInChildBlock): Likewise.
10821         (Block.AddVariable): Check whether a variable name has already
10822         been used in a child block.
10823
10824         * cs-parser.jay (declare_local_variables): Mark all variable names
10825         from the current block as being used in a child block in the
10826         implicit block.
10827
10828 2002-08-23  Martin Baulig  <martin@gnome.org>
10829
10830         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
10831         find the symbol writer.
10832
10833         * driver.cs: csc also allows the arguments to /define being
10834         separated by commas, not only by semicolons.
10835
10836 2002-08-23  Martin Baulig  <martin@gnome.org>
10837
10838         * interface.cs (Interface.GetMembers): Added static check for events.
10839
10840 2002-08-15  Martin Baulig  <martin@gnome.org>
10841
10842         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
10843         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
10844
10845         * ecore.cs (Expression.MemberLookup): Added documentation and explained
10846         why the MethodData.EmitDestructor() change was necessary.
10847
10848 2002-08-20  Martin Baulig  <martin@gnome.org>
10849
10850         * class.cs (TypeContainer.FindMembers): Added static check for events.
10851
10852         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
10853
10854         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
10855         use Type.GetEvents(), not Type.FindMembers().
10856
10857 2002-08-20  Martin Baulig  <martin@gnome.org>
10858
10859         * decl.cs (MemberCache): Added a special method cache which will
10860         be used for method-only searched.  This ensures that a method
10861         search will return a MethodInfo with the correct ReflectedType for
10862         inherited methods.      
10863
10864 2002-08-20  Martin Baulig  <martin@gnome.org>
10865
10866         * decl.cs (DeclSpace.FindMembers): Made this public.
10867
10868 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10869
10870         * delegate.cs: fixed build on windows.
10871         [FIXME:  Filed as bug #29150: MCS must report these errors.]
10872
10873 2002-08-19  Ravi Pratap  <ravi@ximian.com>
10874
10875         * ecore.cs (StandardConversionExists): Return a false
10876         if we are trying to convert the void type to anything else
10877         since that is not allowed.
10878
10879         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
10880         we flag error 70 in the event an event is trying to be accessed
10881         directly from outside the declaring type.
10882
10883 2002-08-20  Martin Baulig  <martin@gnome.org>
10884
10885         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
10886         MemberCache from typemanager.cs to decl.cs.
10887
10888 2002-08-19  Martin Baulig  <martin@gnome.org>
10889
10890         * class.cs (TypeContainer): Implement IMemberContainer.
10891         (TypeContainer.DefineMembers): Create the MemberCache.
10892         (TypeContainer.FindMembers): Do better BindingFlags checking; only
10893         return public members if BindingFlags.Public was given, check
10894         whether members are static.
10895
10896 2002-08-16  Martin Baulig  <martin@gnome.org>
10897
10898         * decl.cs (DeclSpace.Define): Splitted this in Define and
10899         DefineMembers.  DefineMembers is called first and initializes the
10900         MemberCache.
10901
10902         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
10903         DefineMembers() on all our DeclSpaces.
10904
10905         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
10906         but call DefineMembers() on all nested interfaces.  We call their
10907         Define() in our new Define() function.
10908
10909         * interface.cs (Interface): Implement IMemberContainer.
10910         (Interface.Define): Moved all code except the attribute stuf to
10911         DefineMembers().
10912         (Interface.DefineMembers): Initialize the member cache.
10913
10914         * typemanager.cs (IMemberFinder): Removed this interface, we don't
10915         need this anymore since we can use MemberCache.FindMembers directly.
10916
10917 2002-08-19  Martin Baulig  <martin@gnome.org>
10918
10919         * typemanager.cs (MemberCache): When creating the cache for an
10920         interface type, add all inherited members.
10921         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
10922         to `out bool used_cache' and documented it.
10923         (TypeManager.MemberLookup): If we already used the cache in the first
10924         iteration, we don't need to do the interfaces check.
10925
10926 2002-08-19  Martin Baulig  <martin@gnome.org>
10927
10928         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
10929         here from IMemberFinder and don't implement this interface anymore.
10930         (DeclSpace.MemberCache): Moved here from IMemberFinder.
10931
10932         * typemanager.cs (IMemberFinder): This interface is now only used by
10933         classes which actually support the member cache.
10934         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
10935         since we only put DeclSpaces into this Hashtable.
10936         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
10937         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
10938
10939 2002-08-16  Martin Baulig  <martin@gnome.org>
10940
10941         * typemanager.cs (ICachingMemberFinder): Removed.
10942         (IMemberFinder.MemberCache): New property.
10943         (TypeManager.FindMembers): Merged this with RealFindMembers().
10944         This function will never be called from TypeManager.MemberLookup()
10945         so we can't use the cache here, just the IMemberFinder.
10946         (TypeManager.MemberLookup_FindMembers): Check whether the
10947         IMemberFinder has a MemberCache and call the cache's FindMembers
10948         function.
10949         (MemberCache): Rewrote larger parts of this yet another time and
10950         cleaned it up a bit.
10951
10952 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
10953
10954         * driver.cs (LoadArgs): Support quoting.
10955
10956         (Usage): Show the CSC-like command line arguments.
10957
10958         Improved a few error messages.
10959
10960 2002-08-15  Martin Baulig  <martin@gnome.org>
10961
10962         * typemanager.cs (IMemberContainer.Type): New property.
10963         (IMemberContainer.IsInterface): New property.
10964
10965         The following changes are conditional to BROKEN_RUNTIME, which is
10966         defined at the top of the file.
10967
10968         * typemanager.cs (MemberCache.MemberCache): Don't add the base
10969         class'es members, but add all members from TypeHandle.ObjectType
10970         if we're an interface.
10971         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
10972         is the current type.
10973         (MemberCache.CacheEntry.Container): Removed this field.
10974         (TypeHandle.GetMembers): Include inherited members.
10975
10976 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10977
10978         * typemanager.cs: fixed compilation and added a comment on a field that
10979         is never used.
10980
10981 2002-08-15  Martin Baulig  <martin@gnome.org>
10982
10983         * class.cs (ConstructorInitializer.Resolve): In the
10984         Expression.MemberLookup call, use the queried_type as
10985         invocation_type.
10986
10987         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
10988         declared' attribute, it's always true.
10989         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
10990         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
10991         temporary wrapper for FindMembers which tells MemberLookup whether
10992         members from the base classes are included in the return value.
10993         This will go away soon.
10994         (TypeManager.MemberLookup): Use this temporary hack here; once the
10995         new MemberCache is completed, we don't need to do the DeclaredOnly
10996         looping here anymore since the MemberCache will take care of this.
10997         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
10998         (MemberCache): When creating the MemberCache for a class, get
10999         members from the current class and all its base classes.
11000         (MemberCache.CacheEntry.Container): New field.  This is a
11001         temporary hack until the Mono runtime is fixed to distinguish
11002         between ReflectedType and DeclaringType.  It allows us to use MCS
11003         with both the MS runtime and the unfixed Mono runtime without
11004         problems and without accecting performance.
11005         (MemberCache.SearchMembers): The DeclaredOnly looping from
11006         TypeManager.MemberLookup is now done here.      
11007
11008 2002-08-14  Martin Baulig  <martin@gnome.org>
11009
11010         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11011         Type.GetFields on dynamic types but get the fields from the
11012         corresponding TypeContainer.
11013         (MyStructInfo.GetStructInfo): Added check for enum types.
11014
11015         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11016         (MemberList.SyncRoot): Implemented.
11017         (TypeManager.FilterWithClosure): No need to check permissions if
11018         closure_start_type == closure_invocation_type, don't crash if
11019         closure_invocation_type is null.
11020
11021 2002-08-13  Martin Baulig  <martin@gnome.org>
11022
11023         Rewrote TypeContainer.FindMembers to use a member cache.  This
11024         gives us a speed increase of about 35% for the self-hosting MCS
11025         build and of about 15-20% for the class libs (both on GNU/Linux).
11026
11027         * report.cs (Timer): New class to get enhanced profiling.  This
11028         whole class is "TIMER" conditional since it remarkably slows down
11029         compilation speed.
11030
11031         * class.cs (MemberList): New class.  This is an IList wrapper
11032         which we're now using instead of passing MemberInfo[]'s around to
11033         avoid copying this array unnecessarily.
11034         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11035         (ICachingMemberFinder, IMemberContainer): New interface.
11036         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11037         has already been checked, otherwise use it for the name comparision.
11038         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11039         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11040         if possible.  Returns a MemberList, not a MemberInfo [].
11041         (TypeHandle): New class, implements IMemberContainer.  We create
11042         one instance of this class per type, it contains a MemberCache
11043         which is used to do the member lookups.
11044         (MemberCache): New class.  Each instance of this class contains
11045         all members of a type and a name-based hash table.
11046         (MemberCache.FindMembers): This is our new member lookup
11047         function.  First, it looks up all members of the requested name in
11048         the hash table.  Then, it walks this list and sorts out all
11049         applicable members and returns them.
11050
11051 2002-08-13  Martin Baulig  <martin@gnome.org>
11052
11053         In addition to a nice code cleanup, this gives us a performance
11054         increase of about 1.4% on GNU/Linux - not much, but it's already
11055         half a second for the self-hosting MCS compilation.
11056
11057         * typemanager.cs (IMemberFinder): New interface.  It is used by
11058         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11059         Enum, Delegate or Interface.
11060         (TypeManager.finder_to_member_finder): New PtrHashtable.
11061         (TypeManager.finder_to_container): Removed.
11062         (TypeManager.finder_to_delegate): Removed.
11063         (TypeManager.finder_to_interface): Removed.
11064         (TypeManager.finder_to_enum): Removed.
11065
11066         * interface.cs (Interface): Implement IMemberFinder.
11067
11068         * delegate.cs (Delegate): Implement IMemberFinder.
11069
11070         * enum.cs (Enum): Implement IMemberFinder.
11071
11072         * class.cs (TypeContainer): Implement IMemberFinder.
11073
11074 2002-08-12  Martin Baulig  <martin@gnome.org>
11075
11076         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11077
11078 2002-08-12  Martin Baulig  <martin@gnome.org>
11079
11080         * ecore.cs (ITypeExpression): New interface for expressions which
11081         resolve to a type.
11082         (TypeExpression): Renamed to TypeLookupExpression.
11083         (Expression.DoResolve): If we're doing a types-only lookup, the
11084         expression must implement the ITypeExpression interface and we
11085         call DoResolveType() on it.
11086         (SimpleName): Implement the new ITypeExpression interface.
11087         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11088         hack, the situation that we're only looking up types can't happen
11089         anymore when this method is called.  Moved the type lookup code to
11090         DoResolveType() and call it.
11091         (SimpleName.DoResolveType): This ITypeExpression interface method
11092         is now doing the types-only lookup.
11093         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11094         (ResolveFlags): Added MaskExprClass.
11095
11096         * expression.cs (MemberAccess): Implement the ITypeExpression
11097         interface.
11098         (MemberAccess.DoResolve): Added support for a types-only lookup
11099         when we're called via ITypeExpression.DoResolveType().
11100         (ComposedCast): Implement the ITypeExpression interface.
11101
11102         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11103         Expression.Resolve() with ResolveFlags.Type instead.
11104
11105 2002-08-12  Martin Baulig  <martin@gnome.org>
11106
11107         * interface.cs (Interface.Define): Apply attributes.
11108
11109         * attribute.cs (Attribute.ApplyAttributes): Added support for
11110         interface attributes.
11111
11112 2002-08-11  Martin Baulig  <martin@gnome.org>
11113
11114         * statement.cs (Block.Emit): Only check the "this" variable if we
11115         do not always throw an exception.
11116
11117         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11118         whether the property has a set accessor.
11119
11120 2002-08-11  Martin Baulig  <martin@gnome.org>
11121
11122         Added control flow analysis support for structs.
11123
11124         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11125         with control flow analysis turned off.
11126         (IVariable): New interface.
11127         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11128         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11129         (FieldExpr.DoResolve): Resolve the instance expression with flow
11130         analysis turned off and do the definite assignment check after the
11131         resolving when we know what the expression will resolve to.
11132
11133         * expression.cs (LocalVariableReference, ParameterReference):
11134         Implement the new IVariable interface, only call the flow analysis
11135         code if ec.DoFlowAnalysis is true.
11136         (This): Added constructor which takes a Block argument.  Implement
11137         the new IVariable interface.
11138         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11139         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11140         This does the definite assignment checks for struct members.
11141
11142         * class.cs (Constructor.Emit): If this is a non-static `struct'
11143         constructor which doesn't have any initializer, call
11144         Block.AddThisVariable() to tell the flow analysis code that all
11145         struct elements must be initialized before control returns from
11146         the constructor.
11147
11148         * statement.cs (MyStructInfo): New public class.
11149         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11150         argument to this indexer.  If non-zero, check an individual struct
11151         member, not the whole struct.
11152         (FlowBranching.CheckOutParameters): Check struct members.
11153         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11154         overloaded versions of these methods which take an additional
11155         `int field_idx' argument to check struct members.
11156         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11157         overloaded versions of these methods which take an additional
11158         `string field_name' argument to check struct member.s
11159         (VariableInfo): Implement the IVariable interface.
11160         (VariableInfo.StructInfo): New public property.  Returns the
11161         MyStructInfo instance of the variable if it's a struct or null.
11162         (Block.AddThisVariable): New public method.  This is called from
11163         Constructor.Emit() for non-static `struct' constructor which do
11164         not have any initializer.  It creates a special variable for the
11165         "this" instance variable which will be checked by the flow
11166         analysis code to ensure that all of the struct's fields are
11167         initialized before control returns from the constructor.
11168         (UsageVector): Added support for struct members.  If a
11169         variable/parameter is a struct with N members, we reserve a slot
11170         in the usage vector for each member.  A struct is considered fully
11171         initialized if either the struct itself (slot 0) or all its
11172         members are initialized.
11173
11174 2002-08-08  Martin Baulig  <martin@gnome.org>
11175
11176         * driver.cs (Driver.MainDriver): Only report an error CS5001
11177         if there were no compilation errors.
11178
11179         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11180         `UnsafeContext' property to determine whether the parent is in
11181         unsafe context rather than checking the parent's ModFlags:
11182         classes nested in an unsafe class are unsafe as well.
11183
11184 2002-08-08  Martin Baulig  <martin@gnome.org>
11185
11186         * statement.cs (UsageVector.MergeChildren): Distinguish between
11187         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11188         we return.  Added test17() and test18() to test-154.cs.
11189
11190 2002-08-08  Martin Baulig  <martin@gnome.org>
11191
11192         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11193         Family access, make sure the invoking type isn't a subclass of the
11194         queried type (that'd be a CS1540).
11195
11196         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11197         this method which takes an additional `Type invocation_type'.
11198
11199         * expression.cs (BaseAccess.DoResolve): Use the base type as
11200         invocation and query type.
11201         (MemberAccess.DoResolve): If the lookup failed and we're about to
11202         report a CS0122, try a lookup with the ec.ContainerType - if this
11203         succeeds, we must report a CS1540.
11204
11205 2002-08-08  Martin Baulig  <martin@gnome.org>
11206
11207         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11208         (MethodGroupExpr): Implement the IMemberExpr interface.
11209
11210         * expression (MemberAccess.ResolveMemberAccess): No need to have
11211         any special code for MethodGroupExprs anymore, they're now
11212         IMemberExprs.   
11213
11214 2002-08-08  Martin Baulig  <martin@gnome.org>
11215
11216         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11217         Family, FamANDAssem and FamORAssem permissions.
11218         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11219
11220 2002-08-08  Martin Baulig  <martin@gnome.org>
11221
11222         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11223         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11224         or loop block.
11225
11226 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11227
11228         * driver.cs: implemented /resource option to embed managed resources.
11229
11230 2002-08-07  Martin Baulig  <martin@gnome.org>
11231
11232         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11233         (FieldBase.HasFieldInitializer): New public property.
11234         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11235         returns the field initializer and makes sure it is only resolved once.
11236         (TypeContainer.EmitFieldInitializers): Call
11237         FieldBase.GetInitializerExpression to get the initializer, this ensures
11238         that it isn't resolved multiple times.
11239
11240         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11241         the resolving process (SimpleName/MemberLookup) that we're currently
11242         emitting a field initializer (which must not access any instance members,
11243         this is an error CS0236).
11244
11245         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11246         argument, if the `IsFieldInitializer' flag is set, we must report and
11247         error CS0236 and not an error CS0120.   
11248
11249 2002-08-07  Martin Baulig  <martin@gnome.org>
11250
11251         * ecore.cs (IMemberExpr): New public interface.
11252         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11253         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11254         if the expression is an IMemberExpr.
11255
11256         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11257         to be null, implicitly default to `this' if we're non-static in
11258         this case.  Simplified the code a lot by using the new IMemberExpr
11259         interface.  Also fixed bug #28176 here.
11260
11261 2002-08-06  Martin Baulig  <martin@gnome.org>
11262
11263         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11264         ParameterReferences during semantic analysis so that we can do a
11265         type-only search when resolving Cast, TypeOf and SizeOf.
11266         (block): Pass the `current_local_parameters' to the Block's
11267         constructor.
11268
11269         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11270         argument to the constructor.
11271         (ConstructorInitializer.Resolve): Create a temporary implicit
11272         block with the parameters.
11273
11274         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11275         references here if we aren't doing a type-only search.
11276
11277         * statement.cs (Block): Added constructor which takes a
11278         `Parameters parameters' argument.
11279         (Block.Parameters): New public property.
11280
11281         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11282         to `Parameters' and made it public readonly.
11283
11284 2002-08-06  Martin Baulig  <martin@gnome.org>
11285
11286         * ecore.cs (Expression.Warning): Made this public as well.
11287
11288         * report.cs (Report.Debug): Print the contents of collections.
11289
11290 2002-08-06  Martin Baulig  <martin@gnome.org>
11291
11292         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11293         used to tell Resolve() which kinds of expressions it may return.
11294         (Expression.Resolve): Added overloaded version of this method which
11295         takes a `ResolveFlags flags' argument.  This can be used to tell
11296         Resolve() which kinds of expressions it may return.  Reports a
11297         CS0118 on error.
11298         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11299         ResolveFlags.SimpleName.
11300         (Expression.Error118): Added overloaded version of this method which
11301         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11302         which kinds of expressions are allowed.
11303
11304         * expression.cs (Argument.ResolveMethodGroup): New public method.
11305         Resolves an argument, but allows a MethodGroup to be returned.
11306         This is used when invoking a delegate.
11307
11308         * TODO: Updated a bit.
11309
11310 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11311
11312         Fixed compilation with csc.
11313
11314         * ecore.cs: Expression.Error made public. Is this correct? Should
11315         Warning be made public too?
11316
11317         * expression.cs: use ea.Location instead of ea.loc.
11318         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11319
11320 2002-08-06  Martin Baulig  <martin@gnome.org>
11321
11322         * ecore.cs (Expression.loc): Moved the location here instead of
11323         duplicating it in all derived classes.
11324         (Expression.Location): New public property.
11325         (Expression.Error, Expression.Warning): Made them non-static and
11326         removed the location argument.
11327         (Expression.Warning): Added overloaded version which takes an
11328         `int level' argument.
11329         (Expression.Error118): Make this non-static and removed the
11330         expression and location arguments.
11331         (TypeExpr): Added location argument to the constructor.
11332
11333         * expression.cs (StaticCallExpr): Added location argument to
11334         the constructor.
11335         (Indirection, PointerArithmetic): Likewise.
11336         (CheckedExpr, UnCheckedExpr): Likewise.
11337         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11338         (StringPtr): Likewise.
11339
11340
11341 2002-08-05  Martin Baulig  <martin@gnome.org>
11342
11343         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11344
11345         * assign.cs (Assign.DoResolve): Check whether the source
11346         expression is a value or variable.
11347
11348         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11349         while resolving the corresponding blocks.
11350
11351         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11352         an error, don't silently return null.
11353
11354         * statement.cs (Block.AddVariable): Do the error reporting here
11355         and distinguish between CS0128 and CS0136.
11356         (Block.DoResolve): Report all unused labels (warning CS0164).
11357         (LabeledStatement): Pass the location to the constructor.
11358         (LabeledStatement.HasBeenReferenced): New property.
11359         (LabeledStatement.Resolve): Set it to true here.
11360
11361         * statement.cs (Return.Emit): Return success even after reporting
11362         a type mismatch error (CS0126 or CS0127), this is what csc does and
11363         it avoids confusing the users with any consecutive errors.
11364
11365 2002-08-05  Martin Baulig  <martin@gnome.org>
11366
11367         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11368
11369         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11370
11371         * expression.cs (MemberAccess.DoResolve): Silently return if an
11372         error has already been reported.
11373
11374         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11375         error has already been reported.
11376
11377 2002-08-05  Martin Baulig  <martin@gnome.org>
11378
11379         * statement.cs (UsageVector): Only initialize the `parameters'
11380         vector if we actually have any "out" parameters.
11381
11382 2002-08-05  Martin Baulig  <martin@gnome.org>
11383
11384         * expression.cs (Binary.ResolveOperator): When combining delegates,
11385         they must have the same type.
11386
11387 2002-08-05  Martin Baulig  <martin@gnome.org>
11388
11389         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11390         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11391         work with the ms runtime and we also don't need it: if we're a
11392         PropertyBuilder and not in the `indexer_arguments' hash, then we
11393         are a property and not an indexer.
11394
11395         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11396         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11397         since the latter one doesn't work with the ms runtime.
11398
11399 2002-08-03  Martin Baulig  <martin@gnome.org>
11400
11401         Fixed bugs #27998 and #22735.
11402
11403         * class.cs (Method.IsOperator): New public field.
11404         (Method.CheckBase): Report CS0111 if there's already a method
11405         with the same parameters in the current class.  Report CS0508 when
11406         attempting to change the return type of an inherited method.
11407         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11408         and it's not marked abstract or extern.
11409         (PropertyBase): New abstract base class for Property and Indexer.
11410         (PropertyBase.CheckBase): Moved here from Property and made it work
11411         for indexers.
11412         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11413         the same so we can reuse it there.
11414         (Property, Indexer): Derive from PropertyBase.
11415         (MethodSignature.inheritable_property_signature_filter): New delegate
11416         to find properties and indexers.
11417
11418         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11419         argument and improved error reporting.
11420
11421         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11422         EmptyReadOnlyParameters and made it a property.
11423
11424         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11425         version of this method which takes a `PropertyInfo indexer'.
11426         (TypeManager.RegisterIndexer): New method.
11427
11428         * class.cs: Added myself as author of this file :-)
11429
11430 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11431
11432         * class.cs: fixed compilation on windoze.
11433
11434 2002-08-03  Martin Baulig  <martin@gnome.org>
11435
11436         * interface.cs (Interface.GetInterfaceBases): Check whether all
11437         base interfaces are at least as accessible than the current one.
11438
11439         * class.cs (TypeContainer.GetClassBases): Check whether base types
11440         are at least as accessible than the current type.
11441         (TypeContainer.AsAccessible): Implemented and made non-static.
11442         (MemberBase.CheckParameters): Report errors if the accessibility
11443         checks fail.
11444
11445         * delegate.cs (Delegate.Delegate): The default visibility is
11446         internal for top-level types and private for nested types.
11447         (Delegate.Define): Report errors if the accessibility checks fail.
11448
11449         * enum.cs (Enum.Enum): The default visibility is internal for
11450         top-level types and private for nested types.
11451         (Enum.DefineType): Compute the correct visibility.
11452
11453         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11454         function which takes a `bool is_toplevel' instead of a TypeContainer.
11455
11456         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11457         builtin type.
11458
11459 2002-08-02  Martin Baulig  <martin@gnome.org>
11460
11461         * expression.cs (LocalVariableReferenc): Added constructor which
11462         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11463         (LocalVariableReference.IsReadOnly): New property.
11464         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11465         variable is readonly, use our own readonly flag to do this; you can
11466         use the new constructor to get a writable reference to a read-only
11467         variable.
11468
11469         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11470         reference to the local variable.
11471
11472 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11473
11474         * rootcontext.cs (ResolveCore): Also include System.Exception
11475
11476         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11477         we reach an EmptyStatement.
11478
11479         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11480         is also fine.
11481
11482         * expression.cs (Binary.ResolveOperator): Check error result in
11483         two places.
11484
11485         use brtrue/brfalse directly and avoid compares to null.
11486
11487 2002-08-02  Martin Baulig  <martin@gnome.org>
11488
11489         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11490         Fixes bug #28407, added test-155.cs.
11491
11492 2002-08-01  Martin Baulig  <martin@gnome.org>
11493
11494         * class.cs (Event.EmitDefaultMethod): Make this work with static
11495         events.  Fixes #28311, added verify-3.cs.
11496
11497 2002-08-01  Martin Baulig  <martin@gnome.org>
11498
11499         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11500         `is_disposable' fields.
11501         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11502         `hm.is_disposable' if we're using the collection pattern.
11503         (Foreach.EmitCollectionForeach): Use the correct type for the
11504         enumerator's local variable, only emit the try/finally block if
11505         necessary (fixes #27713).
11506
11507 2002-08-01  Martin Baulig  <martin@gnome.org>
11508
11509         * ecore.cs (Expression.report118): Renamed to Error118 and made
11510         it public static.
11511
11512         * statement.cs (Throw.Resolve): Check whether the expression is of
11513         the correct type (CS0118) and whether the type derives from
11514         System.Exception (CS0155).
11515         (Catch.Resolve): New method.  Do the type lookup here and check
11516         whether it derives from System.Exception (CS0155).
11517         (Catch.CatchType, Catch.IsGeneral): New public properties.
11518
11519         * typemanager.cs (TypeManager.exception_type): Added.
11520
11521 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11522
11523         * driver.cs: Updated About function.
11524
11525 2002-07-31  Martin Baulig  <martin@gnome.org>
11526
11527         Implemented Control Flow Analysis.
11528
11529         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
11530         (EmitContext.CurrentBranching): Added.
11531         (EmitContext.StartFlowBranching): Added.
11532         (EmitContext.EndFlowBranching): Added.
11533         (EmitContext.KillFlowBranching): Added.
11534         (EmitContext.IsVariableAssigned): Added.
11535         (EmitContext.SetVariableAssigned): Added.
11536         (EmitContext.IsParameterAssigned): Added.
11537         (EmitContext.SetParameterAssigned): Added.
11538         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
11539         Added control flow analysis stuff here.
11540
11541         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
11542         resolve the expression as lvalue.
11543         (LocalVariableReference.DoResolve): Check whether the variable has
11544         already been assigned.
11545         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
11546         the parameter as assigned here.
11547         (ParameterReference.DoResolve): Check whether the parameter has already
11548         been assigned.
11549         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
11550         expression as lvalue.
11551
11552         * statement.cs (FlowBranching): New class for the flow analysis code.
11553         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
11554         (LabeledStatement.IsDefined): New public property.
11555         (LabeledStatement.AddUsageVector): New public method to tell flow
11556         analyis that the label may be reached via a forward jump.
11557         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
11558         flow analysis.
11559         (VariableInfo.Number): New public field.  This is used by flow analysis
11560         to number all locals of a block.
11561         (Block.CountVariables): New public property.  This is the number of
11562         local variables in this block (including the locals from all parent
11563         blocks).
11564         (Block.EmitMeta): Number all the variables.
11565
11566         * statement.cs: Added flow analysis support to all classes.
11567
11568 2002-07-31  Martin Baulig  <martin@gnome.org>
11569
11570         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
11571         To get debugging messages, compile mcs with /define:MCS_DEBUG and
11572         then use this argument.
11573
11574         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
11575
11576         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
11577         use this to specify /define options.
11578
11579 2002-07-29  Martin Baulig  <martin@gnome.org>
11580
11581         * statement.cs (Fixed): Moved all code that does variable lookups
11582         and resolvings from Emit to Resolve.
11583
11584         * statement.cs (For): Moved all code that does variable lookups
11585         and resolvings from Emit to Resolve.
11586
11587         * statement.cs (Using): Moved all code that does variable lookups
11588         and resolvings from Emit to Resolve.
11589
11590 2002-07-29  Martin Baulig  <martin@gnome.org>
11591
11592         * attribute.cs (Attribute.Resolve): Explicitly catch a
11593         System.NullReferenceException when creating the
11594         CustromAttributeBuilder and report a different warning message.
11595
11596 2002-07-29  Martin Baulig  <martin@gnome.org>
11597
11598         * support.cs (ParameterData.ParameterName): Added method to
11599         get the name of a parameter.
11600
11601         * typemanager.cs (TypeManager.IsValueType): New public method.
11602
11603 2002-07-29  Martin Baulig  <martin@gnome.org>
11604
11605         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
11606         is a flag which specifies that it's either ref or out.
11607         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
11608         the out parameter to `out Parameter.Modifier mod', also set the
11609         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
11610
11611         * support.cs (InternalParameters.ParameterModifier): Distinguish
11612         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11613         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11614
11615         * expression.cs (Argument.GetParameterModifier): Distinguish
11616         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
11617         Parameter.Modifier.ISBYREF flag if it's either ref or out.
11618
11619 2002-07-29  Martin Baulig  <martin@gnome.org>
11620
11621         * expression.cs (ParameterReference.ParameterReference): Added
11622         `Location loc' argument to the constructor.
11623
11624         * cs-parser.jay: Pass location to ParameterReference.
11625
11626 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
11627
11628         * statement.cs (Try): Initialize the location.
11629
11630         * cs-parser.jay: pass location to Try.
11631
11632         * expression.cs (Unary.Reduce): Change the prototype to return
11633         whether a constant fold could be performed or not.  The result is
11634         returned in an out parameters.  In the case of Indirection and
11635         AddressOf, we want to perform the full tests.
11636
11637 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
11638
11639         * statement.cs (Statement.Emit): Flag dead code.
11640
11641 2002-07-27  Andrew Birkett  <andy@nobugs.org>
11642
11643         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
11644
11645 2002-07-27  Martin Baulig  <martin@gnome.org>
11646
11647         * class.cs (MethodData.Define): Put back call to
11648         TypeManager.AddMethod(), accidentally commented this out.
11649
11650         * report.cs (Debug): New public method to print debugging information,
11651         this is `[Conditional ("DEBUG")]'.
11652
11653 2002-07-26  Martin Baulig  <martin@gnome.org>
11654
11655         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
11656         (switch_statement): Push the current_block to the switch_stack and
11657         pop it again when we're done with the switch.
11658         (switch_section): The new block is a child of the current_block.
11659         Fixes bug #24007, added test-152.cs.
11660
11661 2002-07-27  Martin Baulig  <martin@gnome.org>
11662
11663         * expression.cs (Invocation.EmitArguments): When calling a varargs
11664         function with only its fixed arguments, we need to pass an empty
11665         array.
11666
11667 2002-07-27  Martin Baulig  <martin@gnome.org>
11668
11669         Mono 0.13 has been released.
11670
11671 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
11672
11673         * driver.cs: Rename --resource to --linkres, because that is what
11674         we do currently, we dont support --resource yet.
11675
11676         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
11677
11678 2002-07-25  Martin Baulig  <martin@gnome.org>
11679
11680         * class.cs (MethodData): New public class.  This is a `method builder'
11681         class for a method or one accessor of a Property/Indexer/Event.
11682         (MethodData.GetMethodFlags): Moved here from MemberBase.
11683         (MethodData.ApplyAttributes): Likewise.
11684         (MethodData.ApplyObsoleteAttribute): Likewise.
11685         (MethodData.ApplyConditionalAttribute): Likewise.
11686         (MethodData.ApplyDllImportAttribute): Likewise.
11687         (MethodData.CheckAbstractAndExternal): Likewise.
11688         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
11689         (MethodData.Emit): Formerly known as Method.Emit().
11690         (MemberBase): Moved everything which was specific to a single
11691         accessor/method to MethodData.
11692         (Method): Create a new MethodData and call Define() and Emit() on it.
11693         (Property, Indexer, Event): Create a new MethodData objects for each
11694         accessor and call Define() and Emit() on them.
11695
11696 2002-07-25  Martin Baulig  <martin@gnome.org>
11697
11698         Made MethodCore derive from MemberBase to reuse the code from there.
11699         MemberBase now also checks for attributes.
11700
11701         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
11702         (MemberBase.GetMethodFlags): Moved here from class Method and marked
11703         as virtual.
11704         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
11705         `CallingConventions cc' and `Attributes opt_attrs' arguments.
11706         (MemberBase.ApplyAttributes): New virtual method; applies the
11707         attributes to a method or accessor.
11708         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
11709         (MemberBase.ApplyConditionalAttribute): Likewise.
11710         (MemberBase.ApplyDllImportAttribute): Likewise.
11711         (MemberBase.CheckAbstractAndExternal): Likewise.
11712         (MethodCore.ParameterTypes): This is now a property instead of a
11713         method, it's initialized from DoDefineParameters().
11714         (MethodCore.ParameterInfo): Removed the set accessor.
11715         (MethodCore.DoDefineParameters): New protected virtual method to
11716         initialize ParameterTypes and ParameterInfo.
11717         (Method.GetReturnType): We can now simply return the MemberType.
11718         (Method.GetMethodFlags): Override the MemberBase version and add
11719         the conditional flags.
11720         (Method.CheckBase): Moved some code from Define() here, call
11721         DoDefineParameters() here.
11722         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
11723         here to avoid some larger code duplication.
11724         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
11725         ensure that abstract and external accessors don't declare a body.
11726
11727         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
11728         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
11729         lookup in the attribute's parent classes, so we need to abort as soon
11730         as we found the first match.
11731         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
11732         the attribute has no arguments.
11733
11734         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
11735         of a Method.
11736
11737 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11738
11739         * cs-parser.jay: reverted previous patch.
11740
11741 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11742
11743         * cs-parser.jay: fixed bug #22119.
11744
11745 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11746
11747         * attribute.cs: fixed compilation. The error was:
11748         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
11749         be assigned to before control leaves the current method."
11750         [FIXME:  Filed as bug #28186: MCS must report this error.]
11751
11752 2002-07-25  Martin Baulig  <martin@gnome.org>
11753
11754         * attribute.cs (Attribute.Conditional_GetConditionName): New static
11755         method to pull the condition name ouf of a Conditional attribute.
11756         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
11757         the obsolete message and error flag out of an Obsolete attribute.
11758
11759         * class.cs (Method.GetMethodFlags): New public method to get the
11760         TypeManager.MethodFlags for this method.
11761         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
11762         private methods.
11763         (Method.Define): Get and apply the Obsolete and Conditional attributes;
11764         if we're overriding a virtual function, set the new private variable
11765         `parent_method'; call the new TypeManager.AddMethod().
11766
11767         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
11768         the MethodBuilder and the Method in a PtrHashtable.
11769         (TypeManager.builder_to_method): Added for this purpose.
11770         (TypeManager.MethodFlags): Added IsObsoleteError.
11771         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
11772         Obsolete and Conditional arguments in MethodBuilders.  If we discover
11773         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
11774         the message from the attribute.
11775
11776 2002-07-24  Martin Baulig  <martin@gnome.org>
11777
11778         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
11779         preprocessor directives, ensure that the argument to #define/#undef is
11780         exactly one identifier and that it's actually an identifier.
11781
11782         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
11783         did not work ....
11784
11785 2002-07-24  Martin Baulig  <martin@gnome.org>
11786
11787         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
11788         initialize it to TypeManager.object_type in the constructor.
11789         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
11790         of the `hm.get_current' method if we're using the collection pattern.
11791         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
11792         for the explicit conversion to make it work when we're using the collection
11793         pattern and the `Current' property has a different return type than `object'.
11794         Fixes #27713.
11795
11796 2002-07-24  Martin Baulig  <martin@gnome.org>
11797
11798         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
11799         does not match, but don't report any errors.  This method is called in
11800         order for all methods in a MethodGroupExpr until a matching method is
11801         found, so we don't want to bail out if the first method doesn't match.
11802         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
11803         matches, report the 123.  Fixes #28070.
11804
11805 2002-07-24  Martin Baulig  <martin@gnome.org>
11806
11807         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
11808         TypeManager.TypeToCoreType() to the top of the method so the
11809         following equality checks will work.  Fixes #28107.
11810
11811 2002-07-24  Martin Baulig  <martin@gnome.org>
11812
11813         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
11814         operand is of type uint, and the other operand is of type sbyte,
11815         short or int, the operands are converted to type long." -
11816         Actually do what this comment already told us.  Fixes bug #28106,
11817         added test-150.cs.
11818
11819 2002-07-24  Martin Baulig  <martin@gnome.org>
11820
11821         * class.cs (MethodBase): New abstract class.  This is now a base
11822         class for Property, Indexer and Event to avoid some code duplication
11823         in their Define() and DefineMethods() methods.
11824         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
11825         generic methods for Define() and DefineMethods().
11826         (FieldBase): Derive from MemberBase, not MemberCore.
11827         (Property): Derive from MemberBase, not MemberCore.
11828         (Property.DefineMethod): Moved all the code from this method to the
11829         new MethodBase.DefineAccessor(), just call it with appropriate
11830         argumetnts.
11831         (Property.Define): Call the new Property.DoDefine(), this does some
11832         sanity checks and we don't need to duplicate the code everywhere.
11833         (Event): Derive from MemberBase, not MemberCore.
11834         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
11835         accessors, this will also make them work with interface events.
11836         (Indexer): Derive from MemberBase, not MemberCore.
11837         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
11838         (Indexer.Define): Use the new MethodBase functions.
11839
11840         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
11841         argument to the constructor.
11842         (Interface.FindMembers): Added support for interface events.
11843         (Interface.PopluateEvent): Implemented.
11844
11845         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
11846
11847 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
11848
11849         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
11850         but this is required to check for a method name being the same as
11851         the containing class.  
11852
11853         Handle this now.
11854
11855 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11856
11857         * interface.cs: initialize variable.
11858
11859 2002-07-23  Martin Baulig  <martin@gnome.org>
11860
11861         Implemented the IndexerName attribute in interfaces.
11862
11863         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
11864         name if this is an explicit interface implementation.
11865         (Indexer.InterfaceIndexerName): New public variable.  If we're
11866         implementing an interface indexer, this is the IndexerName in that
11867         interface.  Otherwise, it's the IndexerName.
11868         (Indexer.DefineMethod): If we're implementing interface indexer,
11869         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
11870         and Pending.ImplementIndexer methods.
11871         (Indexer.Define): Also define the PropertyBuilder if we're
11872         implementing an interface indexer and this is neither an explicit
11873         interface implementation nor do the IndexerName match the one in
11874         the interface.
11875
11876         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
11877         If a method is defined here, then we always need to create a proxy
11878         for it.  This is used when implementing interface indexers.
11879         (Pending.IsInterfaceIndexer): New public method.
11880         (Pending.ImplementIndexer): New public method.
11881         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
11882         This is used when implementing interface indexers to define a proxy
11883         if necessary.
11884         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
11885         define a proxy if necessary.
11886
11887         * interface.cs (Interface.IndexerName): New public variable.
11888         (Interface.PopulateIndexer): Set the IndexerName.
11889         (Interface.DefineIndexers): New private method.  Populate all the
11890         indexers and make sure their IndexerNames match.
11891
11892         * typemanager.cs (IndexerPropertyName): Added support for interface
11893         indexers.
11894
11895 2002-07-22  Martin Baulig  <martin@gnome.org>
11896
11897         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
11898         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
11899         ret if HasReturnLabel.
11900         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
11901         variables.
11902
11903         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
11904         and set the ec.LoopBeginTryCatchLevel.
11905         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
11906         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
11907         the current ec.TryCatchLevel, the branch goes out of an exception
11908         block.  In this case, we need to use Leave and not Br.
11909
11910 2002-07-22  Martin Baulig  <martin@gnome.org>
11911
11912         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
11913         block unless the block does not always return or it is contained in
11914         another try { ... } catch { ... } block.  Fixes bug #26506.
11915         Added verify-1.cs to the test suite.
11916
11917 2002-07-22  Martin Baulig  <martin@gnome.org>
11918
11919         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
11920         then we do not always return.  Fixes bug #24985.
11921
11922 2002-07-22  Martin Baulig  <martin@gnome.org>
11923
11924         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
11925         lookup on a per-class level; ie. walk up the class hierarchy until we
11926         found at least one applicable method, then choose the best among them.
11927         Fixes bug #24463 and test-29.cs.
11928
11929 2002-07-22  Martin Baulig  <martin@gnome.org>
11930
11931         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
11932         return types of the methods.  The return type is not part of the
11933         signature and we must not check it to make the `new' modifier work.
11934         Fixes bug #27999, also added test-147.cs.
11935         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
11936
11937         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
11938         on the method's return type.
11939
11940 2002-07-21  Martin Baulig  <martin@gnome.org>
11941
11942         * assign.cs: Make this work if the rightmost source is a constant and
11943         we need to do an implicit type conversion.  Also adding a few more tests
11944         to test-38.cs which should have caught this.
11945
11946         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
11947         target in the makefile for this.  The makefile.gnu is primarily intended
11948         for end-users who don't want to debug the compiler.
11949
11950 2002-07-21  Martin Baulig  <martin@gnome.org>
11951
11952         * assign.cs: Improved the Assign class so it can now handle embedded
11953         assignments (X = Y = Z = something).  As a side-effect this'll now also
11954         consume less local variables.  test-38.cs now passes with MCS, added
11955         a few new test cases to that test.
11956
11957 2002-07-20  Martin Baulig  <martin@gnome.org>
11958
11959         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
11960         instructions.  Fixes bug #27977, also added test-146.cs.
11961
11962 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11963
11964         * cs-tokenizer.cs: fixed getHex ().
11965
11966 2002-07-19  Martin Baulig  <martin@gnome.org>
11967
11968         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
11969         not Type.GetType() to lookup the array type.  This is needed when
11970         we're constructing an array of a user-defined type.
11971         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
11972         single-dimensional arrays, but also for single-dimensial arrays of
11973         type decimal.
11974
11975 2002-07-19  Martin Baulig  <martin@gnome.org>
11976
11977         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
11978         this function is called, it's not allowed to share LocalBuilders
11979         among ILGenerators.
11980
11981 2002-07-19  Martin Baulig  <martin@gnome.org>
11982
11983         * expression.cs (Argument.Resolve): Report an error 118 when trying
11984         to pass a type as argument.
11985
11986 2002-07-18  Martin Baulig  <martin@gnome.org>
11987
11988         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
11989         Conv_R_Un for the signed `long' type.
11990
11991 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
11992
11993         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
11994         `expr' for the temporary result, as that will fail if we do
11995         multiple resolves on the same expression.
11996
11997 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
11998
11999         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12000         ec.TypeContainer for looking up aliases. 
12001
12002         * class.cs (TypeContainer): Remove LookupAlias from here.
12003
12004         * decl.cs (DeclSpace); Move here.
12005
12006 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12007
12008         * class.cs (FindMembers): Only call filter if the constructor
12009         bulider is not null.
12010
12011         Also handle delegates in `NestedTypes' now.  Now we will perform
12012         type lookups using the standard resolution process.  This also
12013         fixes a bug.
12014
12015         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12016         This uses Expressions (the limited kind that can be parsed by the
12017         tree) instead of strings.
12018
12019         * expression.cs (ComposedCast.ToString): Implement, used to flag
12020         errors since now we have to render expressions.
12021
12022         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12023         FormArrayType. 
12024
12025         * ecore.cs (SimpleName.ToString): ditto.
12026
12027         * cs-parser.jay: Instead of using strings to assemble types, use
12028         Expressions to assemble the type (using SimpleName, ComposedCast,
12029         MemberAccess).  This should fix the type lookups in declarations,
12030         because we were using a different code path for this.
12031
12032         * statement.cs (Block.Resolve): Continue processing statements
12033         even when there is an error.
12034
12035 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12036
12037         * class.cs (Event.Define): Also remove the `remove' method from
12038         the list of pending items.
12039
12040         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12041         generate more compact code. 
12042
12043 2002-07-17  Martin Baulig  <martin@gnome.org>
12044
12045         * const.cs (Const.LookupConstantValue): Add support for constant
12046         `unchecked' and `checked' expressions.
12047         Also adding test case test-140.cs for this.
12048
12049 2002-07-17  Martin Baulig  <martin@gnome.org>
12050
12051         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12052         check whether mi.ReturnType implements the IEnumerator interface; the
12053         `==' and the IsAssignableFrom() will fail in this situation.
12054
12055 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12056
12057         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12058         here too.
12059
12060 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12061
12062         * expression.cs: fixed bug #27811.
12063
12064 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12065
12066         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12067         Molaro: when we are a ref, the value already contains a pointer
12068         value, do not take the address of it.
12069
12070 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12071         * removed mb-parser.jay and mb-tokenizer.cs
12072
12073 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12074
12075         * expression.cs: check against the building corlib void type.
12076
12077 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12078
12079         * ecore.cs: fix for valuetype static readonly fields: when 
12080         initializing them, we need their address, not the address of a copy.
12081
12082 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12083
12084         * typemanager.cs: register also enum_type in corlib.
12085
12086 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12087
12088         * class.cs: allow calling this (but not base) initializers in structs.
12089
12090 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12091
12092         * ecore.cs: make sure we compare against the building base types
12093         in GetTypeSize ().
12094
12095 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12096
12097         * typemanager.cs: fix TypeToCoreType() to handle void and object
12098         (corlib gets no more typerefs after this change).
12099
12100 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12101
12102         * expression.cs (ArrayCreation.EmitArrayArguments): use
12103         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12104
12105         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12106         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12107         array indexes, the runtime actually forbids them.
12108
12109         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12110         for array arguments here.
12111
12112         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12113         instead of the default for ValueTypes.
12114
12115         (New.DoEmit): Use IsValueType instead of
12116         IsSubclassOf (value_type)
12117         (New.DoResolve): ditto.
12118         (Invocation.EmitCall): ditto.
12119
12120         * assign.cs (Assign): ditto.
12121
12122         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12123         Statements *are* currently doing part of their resolution during
12124         Emit.  
12125
12126         Expressions do always resolve during resolve, but statements are
12127         only required to propagate resolution to their children.
12128
12129 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12130
12131         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12132
12133         (LoadAssembly): Do not add the dll if it is already specified
12134
12135         (MainDriver): Add the System directory to the link path at the end,
12136         after all the other -L arguments. 
12137
12138         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12139         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12140         ldelem.u1) and using the opposite for sbytes.
12141
12142         This fixes Digger, and we can finally run it.
12143
12144         * driver.cs (UnixParseOption): Move the option parsing here.  
12145         (CSCParseOption): Implement CSC-like parsing of options.
12146
12147         We now support both modes of operation, the old Unix way, and the
12148         new CSC-like way.  This should help those who wanted to make cross
12149         platform makefiles.
12150
12151         The only thing broken is that /r:, /reference: and /lib: are not
12152         implemented, because I want to make those have the same semantics
12153         as the CSC compiler has, and kill once and for all the confussion
12154         around this.   Will be doing this tomorrow.
12155
12156         * statement.cs (Unsafe.Resolve): The state is checked during
12157         resolve, not emit, so we have to set the flags for IsUnsfe here.
12158
12159 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12160
12161         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12162         not catch the Error_ObjectRefRequired in SimpleName (as it is
12163         possible to have a class/instance variable name that later gets
12164         deambiguated), we have to check this here.      
12165
12166 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12167
12168         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12169         make static and put into Expression.
12170
12171         (Event.Define): Register the private field of the event with the 
12172         TypeManager so that GetFieldFromEvent can get at it.
12173
12174         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12175         keep track of the private field associated with an event which
12176         has no accessors.
12177
12178         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12179         private field.
12180
12181         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12182
12183 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12184
12185         * expression.cs (Binary.EmitBranchable): this routine emits the
12186         Binary expression in a branchable context.  This basically means:
12187         we need to branch somewhere, not just get the value on the stack.
12188
12189         This works together with Statement.EmitBoolExpression.
12190
12191         * statement.cs (Statement.EmitBoolExpression): Use
12192         EmitBranchable. 
12193
12194 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12195
12196         * statement.cs (For): Reduce the number of jumps in loops.
12197
12198         (For): Implement loop inversion for the For statement.
12199
12200         (Break): We can be breaking out of a Try/Catch controlled section
12201         (foreach might have an implicit try/catch clause), so we need to
12202         use Leave instead of Br.
12203
12204         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12205         now).  If the instace expression supports IMemoryLocation, we use
12206         the AddressOf method from the IMemoryLocation to extract the
12207         address instead of emitting the instance.
12208
12209         This showed up with `This', as we were emitting the instance
12210         always (Emit) instead of the Address of This.  Particularly
12211         interesting when This is a value type, as we dont want the Emit
12212         effect (which was to load the object).
12213
12214 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12215
12216         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12217
12218         * statement.cs (Checked): Set the CheckedState during the resolve
12219         process too, as the ConvCast operations track the checked state on
12220         the resolve process, and not emit.
12221
12222         * cs-parser.jay (namespace_member_declaration): Flag that we have
12223         found a declaration when we do.  This is used to flag error 1529
12224
12225         * driver.cs: Report ok when we display the help only.
12226
12227 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12228
12229         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12230
12231 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12232
12233         * cs-tokenizer.cs (define): We also have to track locally the
12234         defines.  AllDefines is just used for the Conditional Attribute,
12235         but we also need the local defines for the current source code. 
12236
12237 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12238
12239         * statement.cs (While, For, Do): These loops can exit through a
12240         Break statement, use this information to tell whether the
12241         statement is the last piece of code.
12242
12243         (Break): Flag that we break.
12244
12245         * codegen.cs (EmitContexts): New `Breaks' state variable.
12246
12247 2002-07-03  Martin Baulig  <martin@gnome.org>
12248
12249         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12250         modifiers in method declarations in structs.  Otherwise, you won't
12251         be able to override things like Object.Equals().
12252
12253 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12254
12255         * class.cs (Method, Property, Indexer): Do not allow the public
12256         modifier to be used in explicit interface implementations.
12257
12258         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12259         override modifiers in method declarations in structs
12260
12261 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12262
12263         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12264         integer or real overflow, report an error
12265
12266 2002-07-02  Martin Baulig  <martin@gnome.org>
12267
12268         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12269         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12270         to tell the runtime about our newly created System.Object and
12271         System.ValueType types.
12272
12273 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12274
12275         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12276         struct instead of Ldarg/Starg.
12277
12278 2002-07-02  Martin Baulig  <martin@gnome.org>
12279
12280         * expression.cs (Indirection.Indirection): Call
12281         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12282
12283 2002-07-02  Martin Baulig  <martin@gnome.org>
12284
12285         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12286         ValueType, call TypeManager.TypeToCoreType() on it.
12287         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12288         the OpCodes.Newarr argument.
12289
12290 2002-07-02  Martin Baulig  <martin@gnome.org>
12291
12292         * expression.cs (Invocation.EmitCall): When compiling corlib,
12293         replace all calls to the system's System.Array type to calls to
12294         the newly created one.
12295
12296         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12297         System.Array methods.
12298         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12299         from the system's System.Array type which must be replaced.
12300
12301 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12302
12303         * typemanager.cs: load unverifiable_code_ctor so we can build
12304         corlib using the correct type. Avoid using GetTypeCode() with
12305         TypeBuilders.
12306         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12307         TypeManager.object_type to allow building corlib.
12308
12309 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12310
12311         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12312
12313 2002-07-01  Martin Baulig  <martin@gnome.org>
12314
12315         * class.cs: Make the last change actually work, we need to check
12316         whether `ifaces != null' to avoid a crash.
12317
12318 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12319
12320         * class.cs: when we build structs without fields that implement
12321         interfaces, we need to add the interfaces separately, since there is
12322         no API to both set the size and add the interfaces at type creation
12323         time.
12324
12325 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12326
12327         * expression.cs: the dimension arguments to the array constructors
12328         need to be converted if they are a long.
12329
12330 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12331
12332         * class.cs: don't emit ldarg.0 if there is no parent constructor
12333         (fixes showstopper for corlib).
12334
12335 2002-06-29  Martin Baulig  <martin@gnome.org>
12336
12337         MCS now compiles corlib on GNU/Linux :-)
12338
12339         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12340         ie. check for MethodImplOptions.InternalCall.
12341
12342         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12343         and TypeManager.attribute_type are null, so we must explicitly check
12344         whether parent is not null to find out whether it's an attribute type.
12345         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12346         and SetBuilder, not only if the property is neither abstract nor external.
12347         This is necessary to set the MethodImplOptions on the accessor methods.
12348         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12349         SetBuilder, see Property.Emit().
12350
12351         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12352         populate "System.Object", "System.ValueType" and "System.Attribute" since
12353         they've already been populated from BootCorlib_PopulateCoreTypes().
12354
12355 2002-06-29  Martin Baulig  <martin@gnome.org>
12356
12357         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12358         is the NullLiteral, we also need to make sure that target_type is not
12359         an enum type.   
12360
12361 2002-06-29  Martin Baulig  <martin@gnome.org>
12362
12363         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12364         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12365         before calling BootstrapCorlib_ResolveDelegate ().
12366
12367 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12368
12369         * statement.cs: fixed build-breaker. All tests passed ok.
12370
12371 2002-06-27  Martin Baulig  <martin@gnome.org>
12372
12373         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12374         for System.Decimal when compiling corlib.
12375
12376 2002-06-27  Martin Baulig  <martin@gnome.org>
12377
12378         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12379         switch blocks which contain nothing but a default clause.
12380
12381 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12382
12383        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12384
12385 2002-06-27  Martin Baulig  <martin@gnome.org>
12386
12387         * ecore.cs (PropertyExpr.PropertyExpr): Call
12388         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12389
12390         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12391         is already a TypeBuilder.
12392
12393 2002-06-27  Martin Baulig  <martin@gnome.org>
12394
12395         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12396         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12397         the "from an array-type to System.Array" case.  This makes it work
12398         when compiling corlib.
12399
12400 2002-06-27  Martin Baulig  <martin@gnome.org>
12401
12402         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12403         non-static PropertyExpr, set its InstanceExpression.  This makes
12404         the `ICollection.Count' property work in System/Array.cs.
12405
12406 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12407
12408         * driver.cs: Made error handling more consistent.  Errors now
12409         tracked by Report class, so many methods which used to return int
12410         now return void.  Main() now prints success/failure and 
12411         errors/warnings message.
12412
12413         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12414         the magic number return values (123 and 124).  Now, if the
12415         expected error occurs, the compiler exits with success (exit value
12416         0).  If the compilation completes without seeing that particular
12417         error, the compiler exits with failure (exit value 1).  The
12418         makefile in mcs/errors has been changed to handle the new behaviour.
12419
12420         * report.cs: Made 'expected error' number a property and renamed
12421         it from 'Probe' to 'ExpectedError'.
12422
12423         * genericparser.cs: Removed error handling support, since it is
12424         now all done by Report class.
12425
12426         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12427         class, so parse() no longer returns an int.
12428
12429         * namespace.cs: Use Report.Error instead of GenericParser.error
12430
12431 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12432
12433         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12434         TypeContainer.AddOperator): At the front of the list put the
12435         explicit implementations, so they get resolved/defined first. 
12436
12437 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12440         interface type is implemented by this TypeContainer.  Used during
12441         explicit interface implementation.
12442
12443         (Property.Define, Indexer.Define, Method.Define): Validate that
12444         the given interface in the explicit implementation is one of the
12445         base classes for the containing type.
12446
12447         Also if we are explicitly implementing an interface, but there is
12448         no match in the pending implementation table, report an error.
12449
12450         (Property.Define): Only define the property if we are
12451         not explicitly implementing a property from an interface.  Use the
12452         correct name also for those properties (the same CSC uses,
12453         although that is really not needed).
12454
12455         (Property.Emit): Do not emit attributes for explicitly implemented
12456         properties, as there is no TypeBuilder.
12457
12458         (Indexer.Emit): ditto.
12459
12460         Hiding then means that we do not really *implement* a pending
12461         implementation, which makes code fail.
12462
12463 2002-06-22  Martin Baulig  <martin@gnome.org>
12464
12465         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12466         the return value of Object.GetType().  [FIXME: we need to do this whenever
12467         we get a type back from the reflection library].
12468
12469 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12470
12471         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12472
12473 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * attribute.cs: Return null if we can not look up the type.
12476
12477         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12478         the interface types found.
12479
12480         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12481         interface types found.
12482
12483         * typemanager.cs (GetInterfaces): Make this routine returns alll
12484         the interfaces and work around the lame differences between
12485         System.Type and System.Reflection.Emit.TypeBuilder in the results
12486         result for GetInterfaces.
12487
12488         (ExpandInterfaces): Given an array of interface types, expand and
12489         eliminate repeated ocurrences of an interface.  This expands in
12490         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12491         be IA, IB, IC.
12492
12493 2002-06-21  Martin Baulig  <martin@gnome.org>
12494
12495         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12496         on System.Enum.
12497
12498 2002-06-21  Martin Baulig  <martin@gnome.org>
12499
12500         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12501         and called with one of the core types, return the corresponding typebuilder for
12502         that type.
12503
12504         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12505         element type.
12506
12507 2002-06-21  Martin Baulig  <martin@gnome.org>
12508
12509         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12510         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12511         (Expression.ConvertReferenceExplicit): Likewise.
12512
12513         * expression.cs (ElementAccess.DoResolve): Likewise.
12514         (ElementAccess.DoResolveLValue): Likewise.
12515
12516 2002-06-10  Martin Baulig  <martin@gnome.org>
12517
12518         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12519         add the "value" parameter to the parameter list.
12520
12521         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12522         to our caller.
12523
12524 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12525
12526         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12527         the argument to an int, uint, long or ulong, per the spec.  Also
12528         catch negative constants in array creation.
12529
12530 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
12531
12532         * class.cs: do not allow the same interface to appear twice in
12533         the definition list.
12534
12535 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
12536
12537         * ecore.cs: don't use ldlen with System.Array.
12538
12539 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
12540
12541         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
12542
12543 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
12544
12545         * modifiers.cs: produce correct field attributes for protected
12546         internal. Easy fix so miguel can work on ther harder stuff:-)
12547
12548 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
12549
12550         * pending.cs: New file.  Move the code from class.cs here.
12551         Support clearning the pending flag for all methods (when not doing
12552         explicit interface implementation).
12553
12554 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
12555
12556         * rootcontext.cs: added a couple more types needed to bootstrap.
12557
12558 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
12559
12560         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
12561         constructor in the type, instead of any constructor in the type
12562         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
12563         a bug in the Mono runtime when applying the params attribute). 
12564
12565 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
12566         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
12567
12568 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
12569
12570         * expression.cs (Unary.ResolveOperator): Use TypeManager
12571         to resolve the type.
12572
12573 2002-06-13  Ravi Pratap  <ravi@ximian.com>
12574
12575         * cs-parser.jay (enum_member_declaration): Pass in the attributes
12576         attached.
12577
12578         * enum.cs (AddEnumMember): Add support to store the attributes associated 
12579         with each member too.
12580
12581         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
12582         field builders too - this takes care of the enum member case.
12583
12584 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
12585
12586         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
12587         address-of operator on both value types and pointers.
12588
12589 2002-06-10  Martin Baulig  <martin@gnome.org>
12590
12591         * interface.cs (Interface.PopulateIndexer): Add the indexer's
12592         PropertyBuilder to the `property_builders' list.
12593
12594         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
12595         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
12596         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
12597         find any indexers which are inherited from an interface.
12598
12599 2002-06-09  Martin Baulig  <martin@gnome.org>
12600
12601         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
12602         the same type as the constant if necessary.  There's also a test-130.cs
12603         for this.
12604
12605         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
12606
12607         * typemanager.cs (TypeManager.ChangeType): Previously known as
12608         Enum.ChangeEnumType().
12609
12610 2002-06-09  Martin Baulig  <martin@gnome.org>
12611
12612         * expression.cs (Cast.TryReduce): Added support for consts.
12613
12614 2002-06-08  Ravi Pratap  <ravi@ximian.com>
12615
12616         * class.cs (Accessor): Hold attributes information so we can pass
12617         it along.
12618
12619         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
12620         Modify to pass in attributes attached to the methods.
12621
12622         (add_accessor_declaration, remove_accessor_declaration): Ditto.
12623
12624         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
12625         to handle the Accessor kind :-)
12626
12627         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
12628
12629 2002-06-08  Martin Baulig  <martin@gnome.org>
12630
12631         * expression.cs (Unary.TryReduceNegative): Added support for
12632         ULongConstants.
12633
12634 2002-06-08  Martin Baulig  <martin@gnome.org>
12635
12636         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
12637         name can't be found in the `defined_names' - the caller will do a
12638         MemberLookup in this case and thus find methods in System.Enum
12639         such as Enum.IsDefined().
12640
12641 2002-06-08  Martin Baulig  <martin@gnome.org>
12642
12643         * enum.cs (Enum.ChangeEnumType): This is a custom version of
12644         Convert.ChangeType() which works with TypeBuilder created types.
12645         (Enum.LookupEnumValue, Enum.Define): Use it here.
12646
12647         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
12648         `TypeBuilder.BaseType != null' check.
12649         (TypeContainer.FindMembers): Only lookup parent members if we
12650         actually have a parent.
12651         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
12652         (ConstructorInitializer.Resolve): Likewise.
12653
12654         * interface.cs (Interface.FindMembers): Added
12655         `TypeBuilder.BaseType != null' check.
12656
12657         * rootcontext.cs (RootContext.ResolveCore): Added
12658         "System.Runtime.CompilerServices.IndexerNameAttribute" to
12659         classes_second_stage.
12660
12661         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
12662         debug_type and trace_type when compiling with --nostdlib.       
12663
12664 2002-06-07  Martin Baulig  <martin@gnome.org>
12665
12666         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
12667         (AddField): Set it to true when adding a non-static field.
12668         (DefineType): Use `have_nonstatic_fields' to find out whether we
12669         have non-static fields, not `Fields != null'.
12670
12671 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
12672
12673         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
12674         dereferencing a null on the static-field code path)
12675
12676 2002-05-30  Martin Baulig  <martin@gnome.org>
12677
12678         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
12679         to take command line arguments.  Use reflection to call the new
12680         custom `Initialize' function on the symbol writer and pass it the
12681         command line arguments.
12682
12683         * driver.cs (--debug-args): New command line argument to pass command
12684         line arguments to the symbol writer.
12685
12686 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
12687
12688         * assign.cs (DoResolve): Forgot to do the implicit conversion to
12689         the target type for indexers and properties.  Thanks to Joe for
12690         catching this.
12691
12692 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
12693
12694         * typemanager.cs (MethodFlags): returns the method flags
12695         (Obsolete/ShouldIgnore) that control warning emission and whether
12696         the invocation should be made, or ignored. 
12697
12698         * expression.cs (Invocation.Emit): Remove previous hack, we should
12699         not do this on matching a base type, we should do this based on an attribute
12700
12701         Only emit calls to System.Diagnostics.Debug and
12702         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
12703         on the command line.
12704
12705         * rootcontext.cs: Global settings for tracing and debugging.
12706
12707         * cs-tokenizer.cs (define): New utility function to track
12708         defines.   Set the global settings for TRACE and DEBUG if found.
12709
12710 2002-05-25  Ravi Pratap  <ravi@ximian.com>
12711
12712         * interface.cs (Populate*): Pass in the TypeContainer as well as
12713         the DeclSpace as parameters so that we can create EmitContexts and
12714         then use that to apply attributes etc.
12715
12716         (PopulateMethod, PopulateEvent, PopulateProperty)
12717         (PopulateIndexer): Apply attributes everywhere.
12718
12719         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
12720         etc.
12721
12722         (ApplyAttributes): Update accordingly.
12723
12724         We now apply interface attributes for all members too.
12725
12726 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
12727
12728         * class.cs (Indexer.Define); Correctly check if we are explicit
12729         implementation (instead of checking the Name for a ".", we
12730         directly look up if the InterfaceType was specified).
12731
12732         Delay the creation of the PropertyBuilder.
12733
12734         Only create the PropertyBuilder if we are not an explicit
12735         interface implementation.   This means that explicit interface
12736         implementation members do not participate in regular function
12737         lookups, and hence fixes another major ambiguity problem in
12738         overload resolution (that was the visible effect).
12739
12740         (DefineMethod): Return whether we are doing an interface
12741         implementation. 
12742
12743         * typemanager.cs: Temporary hack until we get attributes in
12744         interfaces (Ravi is working on that) and we get IndexerName
12745         support in interfaces.
12746
12747         * interface.cs: Register the indexers as properties.
12748
12749         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
12750         warning, I have verified that this is a bug in the .NET runtime
12751         (JavaScript suffers of the same problem).
12752
12753         * typemanager.cs (MemberLookup): When looking up members for
12754         interfaces, the parent of an interface is the implicit
12755         System.Object (so we succeed in searches of Object methods in an
12756         interface method invocation.  Example:  IEnumerable x;  x.ToString
12757         ()) 
12758
12759 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
12760
12761         * class.cs (Event): Events should also register if they do
12762         implement the methods that an interface requires.
12763
12764         * typemanager.cs (MemberLookup); use the new GetInterfaces
12765         method. 
12766
12767         (GetInterfaces): The code used to lookup interfaces for a type is
12768         used in more than one place, factor it here. 
12769
12770         * driver.cs: Track the errors at the bottom of the file, we kept
12771         on going.
12772
12773         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
12774         instance if the method we are calling is static!
12775
12776 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
12777
12778         * attribute.cs (ApplyAttributes): Make this function filter out
12779         the IndexerName attribute (as that attribute in reality is never
12780         applied) and return the string constant for the IndexerName
12781         attribute. 
12782
12783         * class.cs (TypeContainer.Emit): Validate that all the indexers
12784         have the same IndexerName attribute, and if so, set the
12785         DefaultName attribute on the class. 
12786
12787         * typemanager.cs: The return value might contain other stuff (not
12788         only methods).  For instance, consider a method with an "Item"
12789         property and an Item method.
12790
12791         * class.cs: If there is a problem with the parameter types,
12792         return. 
12793
12794 2002-05-24  Ravi Pratap  <ravi@ximian.com>
12795
12796         * ecore.cs (ImplicitConversionExists): Wrapper function which also
12797         looks at user defined conversion after making a call to 
12798         StandardConversionExists - we need this for overload resolution.
12799
12800         * expression.cs : Update accordingly the various method calls.
12801
12802         This fixes 2 bugs filed against implicit user defined conversions 
12803
12804 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
12805
12806         * statement.cs: Track the result of the assignment.
12807
12808 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
12809
12810         * expression.cs (MemberAccess): Improved error reporting for
12811         inaccessible members.
12812
12813 2002-05-22  Martin Baulig  <martin@gnome.org>
12814
12815         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
12816         itself with debugging support.
12817
12818 2002-05-22  Martin Baulig  <martin@gnome.org>
12819
12820         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
12821         Removed, this isn't needed anymore.
12822
12823 2002-05-20  Martin Baulig  <martin@gnome.org>
12824
12825         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
12826         be underlying type for an enum.
12827
12828 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
12829
12830         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
12831         that splits out the loading of just the core types.
12832
12833         * rootcontext.cs (ResolveCore): Split the struct resolution in
12834         two, so we can load the enumeration underlying types before any
12835         enums are used.
12836
12837         * expression.cs (Is): Bandaid until we fix properly Switch (see
12838         bug #24985 for details).
12839
12840         * typemanager.cs (ImplementsInterface): The hashtable will contain
12841         a null if there are no interfaces implemented.
12842
12843 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
12844
12845         * cs-parser.jay (indexer_declarator): It is fine to have array
12846         parameters
12847
12848 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12849
12850         * typemanager.cs: (RegisterBuilder): New function used to register
12851         TypeBuilders that implement interfaces.  Since
12852         TypeBuilder.GetInterfaces (as usual) does not work with lame
12853         Reflection.Emit. 
12854         (AddUserType): register interfaces.
12855
12856         (ImplementsInterface): Use the builder_to_ifaces hash if we are
12857         dealing with TypeBuilder.  Also, arrays are showing up as
12858         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
12859         methods can not be invoked on them!
12860
12861         * ecore.cs (ExplicitReferenceConversionExists): Made public.
12862         (ImplicitReferenceConversionExists): Split out from
12863         StandardConversionExists. 
12864
12865         * expression.cs (As): We were only implementing one of the three
12866         cases for the as operator.  We now implement them all.
12867         (Is): Implement the various other cases for Is as well.
12868
12869         * typemanager.cs (CACHE): New define used to control if we want or
12870         not the FindMembers cache.  Seems to have a negative impact on
12871         performance currently
12872
12873         (MemberLookup): Nested types have full acess to
12874         enclosing type members
12875
12876         Remove code that coped with instance/static returns for events, we
12877         now catch this in RealFindMembers.
12878
12879         (RealFindMembers): only perform static lookup if the instance
12880         lookup did not return a type or an event.  
12881
12882 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
12883
12884         * assign.cs (CompoundAssign): We pass more semantic information
12885         now to Compound Assignments than we did before: now we have all
12886         the information at hand, and now we resolve the target *before* we
12887         do the expression expansion, which allows the "CacheValue" method
12888         to have the effect we intended (before, a [x] += 1 would generate
12889         two differen ArrayAccess expressions from the ElementAccess,
12890         during the resolution process).
12891
12892         (CompoundAssign.DoResolve): Resolve target and original_source here.
12893
12894 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
12895
12896         * expression.cs (ArrayAccess): dropped debugging information. 
12897
12898         * typemanager.cs: Small bug fix: I was always returning i_members,
12899         instead of one of i_members or s_members (depending on which had
12900         the content).
12901
12902         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
12903         method is invoked before any code generation takes place, and it
12904         is a mechanism to inform that the expression will be invoked more
12905         than once, and that the method should use temporary values to
12906         avoid having side effects
12907
12908         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
12909
12910         * ecore.cs (Expression.CacheTemporaries): Provide empty default
12911         implementation.
12912
12913         * expression.cs (Indirection, ArrayAccess): Add support for
12914         CacheTemporaries in these two bad boys. 
12915
12916         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
12917         ldobj or ldind_ref.  
12918         (StoreFromPtr): Handle stobj as well.
12919
12920         * expression.cs (UnaryMutator): Share more code.
12921
12922         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
12923         down: I was not tracking the Filter function as well, which
12924         was affecting the results of the cache.
12925
12926 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
12927
12928         * attribute.cs: Remove the hack to handle the CharSet property on
12929         StructLayouts. 
12930
12931 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
12932
12933         * attribute.cs (DoResolve): More uglyness, we now only try to
12934         resolve the attribute partially, to extract the CharSet
12935         information (only if we are a StructLayout attribute).  Otherwise 
12936
12937         (GetExtraTypeInfo): Add some code to conditionally kill in the
12938         future this.   I am more and more convinced that the .NET
12939         framework has special code to handle the attribute setting on
12940         certain elements.
12941
12942         * expression.cs (IsParamsMethodApplicable): Revert my previous
12943         foreach change here, it was wrong.
12944
12945 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
12948         (pp_expr): do not abort on unknown input, just return.
12949         (eval): abort if there are pending chars.
12950
12951         * attribute.cs (Attribute.Resolve): Positional parameters are
12952         optional.  Deal with that case.
12953
12954         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
12955         the Ansi/Unicode/Auto information for the type.
12956
12957         (TypeContainer.DefineType): instantiate the EmitContext here, as
12958         we will be using it during the type definition (to resolve
12959         attributes) and during the emit phase.
12960
12961         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
12962         to pull type information out of the attributes
12963
12964         (Attribute.Resolve): track the constructor builder, and allow for
12965         multiple invocations (structs and classes will use this).
12966
12967         * ecore.cs (MemberLookupFinal): new version with all the
12968         parameters customizable.
12969
12970         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
12971         constructors.  Return if the result value is null (as the error
12972         would have been flagged already by MemberLookupFinal)
12973
12974         Do not allow instances of abstract classes or interfaces to be
12975         created.
12976
12977         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
12978         We have to compare the assembly property here when dealing with
12979         FamANDAssem and Assembly access modifiers, because we might be
12980         creating an assembly from *modules* (that means that we are not
12981         getting TypeBuilders for types defined in other modules that are
12982         part of this assembly).
12983
12984         (Method.Emit): If the method is marked abstract and has a body,
12985         emit an error. 
12986
12987         (TypeContainer.DefineMembers): If both the defined member and the
12988         parent name match are methods, then do not emit any warnings: let
12989         the Method.Define routine take care of flagging warnings.  But if
12990         there is a mismatch (method overrides something else, or method is
12991         overriwritten by something, then emit warning).
12992
12993         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
12994         set to null, this means `do not check for the return type on the
12995         signature'. 
12996
12997         (Method.Define): set the return type for the method signature to
12998         null, so that we get methods with the same name and parameters and
12999         different return types.  This is used to flag warning 114 (you are
13000         hiding a method, and you probably want to use the new/override
13001         keywords instead).
13002
13003         * typemanager.cs (MemberLookup): Implemented proper access
13004         control, closing a long standing set of bug reports.  The problem
13005         was that the Framework only has two bits: Public and NonPublic,
13006         and NonPublic includes private and protected methods, but we need
13007         to enforce the FamANDAssem, FamOrAssem and Family. 
13008
13009 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13010
13011         * statement.cs (GotoCase): Return true: Ammounts to giving up
13012         knowledge on whether we return or not, and letting the other case
13013         be responsible for it.
13014
13015 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * driver.cs: Do not load directories for each file processed, only
13018         do it if there is a pattern.
13019
13020         * ecore.cs: Report readonly assigns here as well, as we might have
13021         been resolved only by MemberAccess.
13022
13023         (SimpleName.SimpleNameResolve): Also be useful for LValue
13024         resolution.   We need this to propagate assign to local readonly variables
13025
13026         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13027         do not want to reuse potential criteria memory.
13028
13029         * class.cs (MyEventBuilder): Set reflected_type;
13030
13031         * ecore.cs (Constantify): Added support for constifying bools.
13032
13033         (RootContext.LookupType): Added a cache for values looked up in
13034         the declaration space.
13035
13036         * typemanager.cs (FindMembers): Now is a front-end to
13037         RealFindMembers, and provides a two-level hashtable-based cache to
13038         the request.  
13039
13040         15% performance improvement: from 22.5 to 19.2 seconds.
13041
13042         * expression.cs (IsParamsMethodApplicable): use foreach.
13043         (Invocation.DoResolve): ditto.
13044         (New.DoResolve): ditto.
13045         (ArrayCreation.DoResolve): ditto.
13046
13047         * ecore.cs (FindMostEncompassingType): use foreach.
13048
13049         * delegate.cs (NewDelegate.DoResolve): Use foreach
13050
13051         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13052         (RemoveMethods): use foreach.
13053
13054         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13055         nested foreach statements instead of for, and also break out of
13056         the inner loop once a match is found.
13057
13058         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13059
13060 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13061
13062         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13063         we actually unwrap the expression to allow for extra information
13064         to be extracted. 
13065
13066         * expression.cs: Use Shr_Un on unsigned operations. 
13067
13068 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13069
13070         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13071         applicable operators was not being considered correctly. This closes
13072         the bug Miguel reported.
13073
13074 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13075
13076         * attribute.cs: check that the type derives from System.Attribute
13077         and report the correct error in that case (moved the duplicate code to
13078         its own method, too).
13079
13080 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13081
13082         * attribute.cs: lookup attribute type name as the spec says: first the
13083         bare attribute name and then name + "Attribute" (nant compiles with
13084         mcs after this fix).
13085
13086 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13087
13088         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13089         Because of the way we parse things, we should try to see if a
13090         UIntConstant can fit in an integer.
13091
13092 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13093
13094         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13095         when we are in an explicit context.
13096
13097         (ConvertReferenceExplicit): When converting from Iface type S to Class
13098         T make sure the rules are implemented as an OR.
13099
13100         * parameter.cs (ParameterType): Make it a property for now although the
13101         purpose really isn't anything immediate.
13102
13103         * expression.cs (Is*Applicable): Do better checking on the parameter type
13104         of a ref/out parameter. The ones from the system assemblies are already 
13105         marked with the correct type so we don't need to do any correction.
13106
13107         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13108         the object type is standard too so include that.
13109
13110 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13111
13112         * ecore.cs (StandardConversionExists): Augment with missing code:
13113         deal with IntConstant, LongConstants and Enumerations.
13114
13115         * assign.cs: Report the error, instead of failing silently
13116
13117         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13118         typecontainer that they are declared, because the
13119         typecontainer/namespace will have the list of using clauses that
13120         need to be applied.
13121
13122         Assembly Attributes were escaping the normal registration
13123         mechanism. 
13124
13125         (EmitCode): Apply attributes within an EmitContext that represents
13126         the container they were declared on.
13127
13128         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13129
13130 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13131
13132         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13133         Revamp completely - make much cleaner as we now operate only
13134         on a set of Types.
13135
13136         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13137         to implement the logic detailed in the spec more correctly.
13138
13139         (UserDefinedConversion): Update accordingly.
13140
13141 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13142
13143         * statement.cs: Return flow analysis information up.
13144
13145         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13146         and the default.
13147
13148         (token): Do not consume an extra character before calling
13149         decimal_digits.
13150
13151 2002-05-06  Piers Haken <piersh@friskit.com>
13152
13153         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13154
13155 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13156
13157         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13158         EmitContext during the instance constructor initializer
13159         resolution, to stop access to instance variables.
13160
13161         This is mandated by the spec, last paragraph of the `constructor
13162         initializers' section. 
13163
13164 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13165
13166         * cs-parser.jay, class.cs (Accessor): new class used to represent
13167         an accessor (get or set).  In the past we used `null' to represent
13168         a missing accessor.  But this is ambiguous because there was no
13169         way to tell in abstract indexers/properties if one of them was
13170         specified.
13171
13172         Now there is a way of addressing that.
13173
13174         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13175         instead of FindMembers.
13176
13177         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13178         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13179
13180         * attribute.cs: Treat indexers and properties as the same in terms
13181         of applying attributes
13182
13183         * ecore.cs (FindMostEncompassedType): Use statically initialized
13184         EmptyExpressions()s like we do elsewhere to avoid creating useless
13185         objects (and we take this out of the tight loop).
13186
13187         (GetConversionOperators): Move the code to extract the actual
13188         operators to a separate routine to clean things up.
13189
13190 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13191
13192         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13193         events are always registered FieldBuilders.
13194
13195         * class.cs (FieldBase): New class shared by Fields 
13196
13197         * delegate.cs: If we are a toplevel delegate, use our full name.
13198         If we are a nested delegate, then only use our tail name.
13199
13200 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13201
13202         * expression.cs (IsApplicable): Ensure that we add the "&" to
13203         ref/out types before comparing it with the type of the argument.
13204
13205         (IsParamsMethodApplicable): Ditto.
13206
13207         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13208         silly me ;-)
13209
13210         * delegate.cs : Handle the case when we have more than one applicable
13211         method. Flag an error only when we finish checking all.
13212
13213 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13214
13215         * expression.cs: Add support for boolean static initializers.
13216
13217 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13218
13219         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13220
13221         * parameter.cs (ComputeParameterTypes,
13222         ComputeAndDefineParameterTypes): Better error handling: now we
13223         clear the `types' cache if we fail during any of the type lookups.
13224         We also return the status code correctly to our caller
13225
13226         * delegate.cs: If we fail to define a delegate, abort the extra
13227         steps. 
13228
13229         * expression.cs (Binary.ResolveOperator): for
13230         operator==(object,object) and operator !=(object, object) we also
13231         have to verify that there is an implicit conversion from one to
13232         the other.
13233
13234         (ArrayAccess.DoResolve): Array Access can operate on
13235         non-variables. 
13236
13237 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13238
13239         * assign.cs (CompoundAssign): A new class used as a "flag" that
13240         the assignment actually is happening as part of a compound
13241         assignment operator.
13242
13243         During compound assignment, a few new rules exist to enable things
13244         like:
13245
13246         byte b |= 1 + 2
13247
13248         From the spec:
13249
13250         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13251         to the type of x) if y is implicitly convertible to the type of x,
13252         and the operator is a builtin operator and the return type of the
13253         operator is explicitly convertible to the type of x. 
13254
13255         * rootcontext.cs: Reset warning level to 2.  4 catches various
13256         "interesting" features in mcs, we must clean this up at some
13257         point, but currently am trying to kill other bugs ;-)
13258
13259         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13260         in container classes as well.  
13261
13262         * expression.cs (Binary.ResolveOperator): Handle string case
13263         before anything else (as operator overloading does emit an error
13264         before doing anything else).
13265
13266         This code could go away when we move to a table driven model, but
13267         i could not come up with a good plan last night.
13268
13269 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13270
13271         * typemanager.cs (CSharpName): reimplementation using regex.
13272         * class.cs: added null check for fields in Emit
13273         * rootcontext.cs: set warninglevel to 4
13274
13275 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13276
13277         * typemanager.cs (CSharpName): reimplemented with Lupus
13278         suggestion.
13279
13280 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * statement.cs (If): correclty implement Resolve, because we were
13283         not catching sem errors in there.  The same process is needed
13284         everywhere else. 
13285         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13286
13287
13288         (Statement.Warning_DeadCodeFound): Factorize code.
13289         (While): Report dead code here too.
13290
13291         (Statement): Added Resolve virtual method to allow
13292         for resolution split from the emit code.
13293
13294 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13295
13296         * statement.cs (EmitBoolExpression): No longer try to resolve the
13297         expression here.    
13298         (MakeBoolean): New utility function that resolve, implicitly
13299         converts to boolean and tags the expression. 
13300
13301
13302         (If, Do): Implement dead code elimination.
13303         (While): Implement loop inversion
13304
13305         (Do, While, For, If): Resolve the expression prior to calling our
13306         code generation.
13307
13308 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13309
13310         * class.cs:
13311           - added method Report28 (warning: program has more than one entry point)
13312           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13313           - modified method Method.Define, the part at the end of the method
13314
13315         * rootcontext.cs: added static public Location EntryPointLocation;
13316           
13317         * ../errors/cs0028.cs : Add test case for the above warning.              
13318
13319         * typemanager.cs:
13320           - modified method CSharpName to allow arrays of primitive type to
13321             be printed nicely (e.g. instead of System.Int32[][] it now prints
13322             int[][])
13323           - added method CSharpSignature: returns the signature of a method
13324             in string format to be used in reporting errors, warnings, etc.
13325
13326         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13327         with String.Empty.
13328
13329 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13330
13331         * delegate.cs (Define): Fix extremely silly bug where I was
13332         setting the type of the 'object' parameter of the BeginInvoke
13333         method to System.IAsyncResult instead of System.Object ;-)
13334
13335 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13336
13337         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13338         here. 
13339
13340         (Constructor.Emit): return if we fail to initialize the
13341         constructor.  Another door closed!  
13342
13343         * expression.cs (New.DoResolve): Improve error message (from -6 to
13344         1501).  Use DeclaredOnly lookup to find the exact constructor.
13345
13346         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13347         loop.  This is useful.
13348
13349         * cs-parser.jay: Adjust the default parameters so that destructors
13350         have the proper signature.
13351
13352 2002-04-26  Martin Baulig  <martin@gnome.org>
13353
13354         * driver.cs (LoadAssembly): If `assembly' contains any characters
13355         which are only valid in path names and not in assembly names
13356         (currently slash, backslash and point), use Assembly.LoadFrom ()
13357         instead of Assembly.Load () on the `assembly' (before iteration
13358         over the link_paths).
13359
13360 2002-04-26  Martin Baulig  <martin@gnome.org>
13361
13362         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13363
13364 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13365
13366         * class.cs (Property): use the new typemanager.MemberLookup
13367
13368         (TypeContainer.MemberLookup): Implement using the
13369         TypeManager.MemberLookup now. 
13370
13371         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13372         and return MemberInfos, so that these can be used without an
13373         EmitContext (what we had before).
13374
13375 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * expression.cs: Fix the case where the argument to params if the
13378         type of the params.  I omitted handling this before.   Fixed
13379
13380 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13381
13382         * driver.cs: Call BootCorlib_PopulateCoreType
13383
13384         * class.cs (Property.CheckBase): Check for properties only, not
13385         for all members. 
13386
13387         * interface.cs: Temporary hack: try/catch around the
13388         CustomAttributeBuilder, because I am getting an exception that I
13389         do not understand.
13390
13391         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13392         types whose definitions are required to be there (attributes are
13393         defined before standard types).
13394
13395         Compute definitions as we boot the various types, as they are used
13396         immediately (value_type class will need object_type, but if we do
13397         not initialize object_type, we will pass a null, which will let
13398         the runtime pick the System.Object from the existing corlib, which
13399         is not what we want).
13400
13401 2002-04-22  Patrik Torstensson <totte@labs2.com>
13402
13403         * cs-tokenizer.cs: fixed a number of trim() issues.
13404
13405 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13406
13407         * expression.cs (Argument.Type): Ensure that we return the correct
13408         type when we have out or ref parameters [in which case we 
13409         append a "&"].
13410
13411 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13412
13413         * class.cs (Property, Indexer): Allow extern modifier in there. 
13414
13415         * typemanager.cs (InitBaseTypes): Initializes object_type and
13416         value_type, since those will be used early on during the bootstrap
13417         process to compile corlib.
13418
13419         (InitCoreTypes): Move code from here to InitBaseTypes.
13420
13421 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13422
13423         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13424         single-dimension arrays as using the ldlen opcode.  
13425
13426         Daniel Lewis discovered this optimization.  
13427
13428         * typemanager.cs: Add signature for System.Array::get_Length
13429
13430 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13431
13432         * statement.cs: report the error when the foreach does not apply to an
13433         array nor a collection.
13434
13435 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13436
13437         * expression.cs: Add implicit conversions to the operator ~.
13438
13439         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13440
13441         * typemanager.cs: Locate the decimal constructor.
13442
13443 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13444
13445         * attribute.cs: use the new property of TypeOf.
13446         * expression.cs: added 'get' property around typearg.
13447
13448         These changes fix a build breaker reported by NickD. Is this the
13449         correct way to fix?  If not, please, revert my changes and make it
13450         work :-).
13451
13452 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13453
13454         * attribute.cs: Add support for typeof in attribute invocations.
13455         I am not sure that this is right though.
13456
13457 2002-04-14  Duncan Mak  <duncan@ximian.com>
13458
13459         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13460         Binary.Operator.Division case.
13461
13462 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13463
13464         * class.cs (DefineType): Ensure that we do a proper check on
13465         attribute types and also register it with the TypeManager.
13466
13467         (TypeContainer.Targets): The default for attribute types is
13468         AttributeTargets.All.
13469
13470         * attribute.cs (ApplyAttributes): Registering the attribute type
13471         is done elsewhere, not when we discover we have a Usage attribute.
13472
13473 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13474
13475         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13476         and get rid of is_delegate parameter.
13477
13478         * everywhere : update.
13479
13480 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13481
13482         * cs-parser.jay (compilation_unit): Revamp completely to use
13483         some new ideas that I got from Rhys' grammar to solve the problems
13484         with assembly level attributes.
13485
13486         (outer_declaration): New grammar production.
13487
13488         (attribute_sections): Add.
13489
13490         (opt_attributes): Base on attribute_sections
13491
13492         (namespace_declaration): Allow opt_attributes to tackle the case
13493         when we have assembly level attributes - we are clever in this
13494         regard now ;-)
13495
13496         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13497         attributes in the non-global context.
13498
13499         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13500         instead of SetGlobalAttributes.
13501
13502         * class.cs, rootcontext.cs : Ensure we define and generate 
13503         attribute types before anything else.
13504
13505         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13506         and flag the new error -20 for the case when the attribute type
13507         does not have valid targets specified. csc does not catch this.
13508
13509         * ../errors/errors.txt : update for error # -20
13510
13511 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13512
13513         * support.cs (InternalParameters.ParameterModifier): Do some null
13514         checking and return sane values.
13515
13516         * class.cs (Method.Define): If we are a PInvoke method, ensure
13517         that we are static and extern. Report error # 601
13518
13519         * ../errors/cs0601.cs : Add test case for the above error.
13520
13521 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13522
13523         * rootcontext.cs (attribute_types): We need to keep type of
13524         all attribute types separately and emit code for them first.
13525
13526         (RegisterAttribute) : Implement.
13527
13528         * class.cs (DefineType): Check if the current Type is a custom
13529         attribute type and register it accordingly.
13530
13531         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
13532         adding the first attribute twice and rename to
13533
13534         (SetGlobalAttributes): this.
13535
13536         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
13537         lookups.
13538
13539         * attribute.cs (ApplyAttributes): Take an additional argument telling us
13540         if we are processing global arguments. Hmm, I am unsure of this.
13541
13542 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13543
13544         * expression.cs: added static array of strings to avoid calling
13545         Enum.ToString () for Operator in Binary. Significant recover of
13546         performance.
13547
13548 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
13549
13550         * class.cs (FindMembers): Allow the Builders of the various
13551         members to be null.  If they are skip them.  This only happens
13552         during the PInvoke declaration.
13553
13554 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
13555
13556         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
13557         failure, so we do not keep going afterwards.
13558
13559         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
13560         wanted to pass `false' as the `is_delegate' argument.  If this is
13561         the case, why not use delegate_type == null to mean `is_delegate =
13562         false' and anything else as is_delegate = true.
13563
13564 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
13565
13566         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
13567         code for the section, not the beginning of the tests.
13568
13569 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
13570
13571         * cfold.cs: Handle operator + (Enum x, Underlying x) 
13572
13573         * expression.cs (Binary): same.  Warn about errors where we have
13574         Enum/Enum in operator + as well.
13575
13576 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
13577
13578         * statement.cs:
13579                 - added support for switch(bool)
13580                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
13581                 - add TableSwitchEmit() to handle table-based switch statements
13582
13583 2002-04-05  Ravi Pratap  <ravi@ximian.com>
13584
13585         * expression.cs (Invocation.OverloadResolve): Factor out code which
13586         does parameter compatibility checking with arguments so that we can 
13587         re-use the code even from Delegate.VerifyApplicability
13588
13589         (VerifyArgumentsCompat): Move above code here.
13590
13591         * delegate.cs (VerifyApplicability): Get rid of duplicate code
13592         and instead make a call to the above method.
13593
13594 2002-03-31  Ravi Pratap  <ravi@ximian.com>
13595
13596         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
13597         We use it to keep track of classes which are attribute types.
13598
13599 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
13600
13601         * delegate.cs (Delegate.Define): Correctly define the types in the
13602         presence of fixed and array parameters.
13603
13604         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
13605         doing FindMembers.
13606
13607         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
13608         include NonPublic after the first iteration.
13609
13610         * class.cs (Indexer.CheckBase): Only check if both parents are
13611         non-null. 
13612
13613         * cs-parser.jay (accessor_body): If empty, set to null.
13614
13615         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
13616         same code path here to resolve constants names that we did have in
13617         MemberAccess.DoResolve.  There is too much code duplicated here.
13618
13619 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
13620
13621         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
13622
13623         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
13624         to MakeUnionSet.
13625
13626         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
13627         tokens, numbers and strings.
13628
13629         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
13630         parenthesis.
13631
13632         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
13633         asyncronous parameters and the regular parameters.  
13634
13635         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
13636         specify the target directory.
13637
13638         * expression.cs: (This.DoResolve): Simplify
13639         (As.Emit): Optimize, do not generate IsInst if the expression is
13640         always of the given type.
13641
13642         (Is.DoResolve): Bug fix, we were reporting both always/never for
13643         the is expression.
13644
13645         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
13646         creating too many unnecessary arrays.
13647
13648 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
13649
13650         * class.cs (EmitFieldInitializer): Use Assign expression to assign
13651         fields instead of rolling our own initializer.   Takes care of all
13652         implicit conversions, and drops unnecessary static checks/argument.
13653
13654 2002-03-31  Dick Porter  <dick@ximian.com>
13655
13656         * driver.cs: use the GetDirectories() return values properly, and
13657         use "/" as path separator.
13658
13659 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
13660
13661         * expression.cs (Unary): Optimize - - expr into expr.
13662         (Binary): Optimize a + (-b) into a -b.
13663
13664         * codegen.cs (CodeGen): Made all methods static.
13665
13666 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
13667
13668         * rootcontext.cs: 
13669
13670         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
13671         TypeBuilder property.
13672
13673         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
13674         instead. 
13675
13676         * tree.cs: Removed the various RecordXXXX, and replaced with a
13677         single RecordDecl.  Removed all the accessor methods, and just
13678         left a single access point Type 
13679
13680         * enum.cs: Rename DefineEnum to DefineType.
13681
13682         * decl.cs: New abstract method `DefineType' used to unify the
13683         Defines for Enumerations, Interfaces, TypeContainers and
13684         Delegates.
13685
13686         (FindType): Moved LookupInterfaceOrClass here.  Moved the
13687         LookupBaseClasses method that used to live in class.cs and
13688         interface.cs here, and renamed to FindType.
13689
13690         * delegate.cs: Implement DefineType.  Take advantage of the
13691         refactored pattern for locating the parent builder without taking
13692         the parent_builder argument (which we know does not work if we are
13693         nested, and triggering a toplevel definition).
13694
13695 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13696
13697         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
13698         accessibility of a member has changed during override and report
13699         an error if so.
13700
13701         * class.cs (Method.Define, Property.Define): Only complain on
13702         overrides if the method is private, any other accessibility is
13703         fine (and since we just checked the permission is the same, we are
13704         good to go).
13705
13706         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
13707         and elif are processed always.  The other pre-processing
13708         directives are only processed if we are "taking" the path
13709
13710 2002-03-29  Martin Baulig  <martin@gnome.org>
13711
13712         * class.cs (Method.Emit): Only emit symbolic debugging info if the
13713         current location is not Null.
13714
13715         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
13716         a separate method so we can profile it.
13717
13718         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
13719         `span.Seconds' are just seconds, but no minutes or hours.
13720         (MainDriver): Profile the CodeGen.SaveSymbols calls.
13721
13722 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13723
13724         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
13725         Remove the gratuitous set of Final:
13726
13727                                 // If an interface implementation, then we can set Final.
13728                                 if (((flags & MethodAttributes.Abstract) == 0) &&
13729                                     implementing.DeclaringType.IsInterface)
13730                                         flags |= MethodAttributes.Final;
13731
13732         I do not know what I was smoking when I used that.
13733
13734
13735         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
13736         step into fixing the name resolution issues for delegates and
13737         unifying the toplevel name resolution.
13738
13739 2002-03-28  Martin Baulig  <martin@gnome.org>
13740
13741         * class.cs (Method.Emit): If we have a symbol writer, call its
13742         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
13743         tell it about the current method.
13744
13745         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
13746         writer that we're going to emit the first byte of IL code for a new
13747         statement (a new source line).
13748         (EmitContext.EmitTopBlock): If we have a symbol writer, call
13749         EmitContext.Mark() before emitting any code.
13750
13751         * location.cs (SymbolDocument): Return null when we're Null.
13752
13753         * statement.cs (Statement): Moved the `Location loc' variable here.
13754         (Statement.EmitBoolExpression): If we have a symbol writer, call
13755         ec.Mark() before emitting any code to tell it that we're at the
13756         beginning of a new statement.
13757         (StatementExpression): Added `Location' argument to the constructor.
13758         (Block): Added public readonly variable `StartLocation' and public
13759         variable `EndLocation'.  The latter is to be set using SetEndLocation().
13760         (Block): Added constructor which takes a start and end location.
13761         (Block.SetEndLocation): New method. This sets the end location.
13762         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
13763         local variables we create.
13764         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
13765         each statement and do also mark the begin and end of the block.
13766
13767         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
13768         tell it the current lexer.Location, use Location.Null for the end of the
13769         block.
13770         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
13771         current block, set its end location using SetEndLocation().
13772         (statement_expression): StatementExpression constructor now takes the
13773         lexer.Location as additional argument.
13774         (for_statement, declare_local_variables): Likewise.
13775         (declare_local_variables): When creating a new implicit block, use the
13776         new Block constructor and pass it the lexer.Location.
13777
13778 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
13779
13780         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
13781         members also on the parent interfaces recursively.
13782
13783 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
13784
13785         * report.cs: Use new formats, since Gonzalo finished the missing
13786         bits. 
13787
13788         * expression.cs (Binary.ResolveOperator): added missing operator|
13789         operator& and operator^ for bool/bool.
13790
13791         * cs-parser.jay: CheckDef now takes a Location argument that is
13792         used to report errors more precisly (instead of reporting the end
13793         of a definition, we try to track something which is a lot closer
13794         to the source of the problem).
13795
13796         * cs-tokenizer.cs: Track global token use, so we can properly flag
13797         the use of #define/#undef after the first token has been seen.
13798
13799         Also, rename the reportXXXX to Error_DescriptiveName
13800
13801         * decl.cs (DeclSpace.IsTopLevel): Move property here from
13802         TypeContainer, so that Enum and Interface can use this too.
13803
13804         * class.cs (TypeContainer.LookupInterfaceOrClass,
13805         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
13806         `builder' argument.  Typically this was used to pass the parent
13807         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
13808         the definition).  
13809
13810         The problem is that a nested class could trigger the definition of
13811         a toplevel class, and the builder would be obviously wrong in that
13812         case. 
13813
13814         So we drop this argument, and we compute dynamically the
13815         TypeBuilder/ModuleBuilder (the correct information was available
13816         to us anyways from DeclSpace.Parent)
13817
13818         * interface.cs (Interface.DefineInterface): Drop builder
13819         parameter cleanup like class.cs
13820
13821         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
13822         like class.cs
13823
13824         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
13825         values. 
13826
13827         (Try.Emit): Propagate the returns value from the statement.
13828
13829         (Return.Emit): Even if we are leavning 
13830
13831         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
13832
13833         * modifiers.cs: Fix the computation of MethodAttributes flags.
13834
13835 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
13836
13837         * driver.cs: allow compilation of files that start with '/'.
13838         Add a default case when checking the argument of --target.
13839
13840 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * interface.cs: Implement the same search algorithm for types in
13843         the interface code.
13844
13845         * delegate.cs: Do not allow multiple definition.
13846
13847         * Recovered ChangeLog that got accidentally amputated
13848
13849         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
13850
13851         * rootcontext.cs: Load manually enum to allow core classes to
13852         contain enumerations.
13853
13854         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
13855         Update to new static methods in TypeManager.
13856
13857         * typemanager.cs (GetMethod, GetConstructor): Use our
13858         implementation of FindMembers to find the members, since during
13859         corlib compilation, the types are TypeBuilders and GetMethod and
13860         GetConstructor do not work.
13861
13862         Make all methods in TypeManager static.
13863
13864         (InitCodeHelpers): Split the functionality from
13865         the InitCodeTypes function.
13866
13867         * driver.cs: Call InitCodeHelpers after we have populated the
13868         types. 
13869
13870         * cs-parser.jay (delegate_declaration): we did not used to compute
13871         the delegate name correctly for void delegates.
13872
13873 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
13874
13875         * rootcontext.cs (RootContext): Init the interface_resolve_order
13876         and type_container_resolve_order always.
13877
13878         (ResolveCore, BootstrapCorlib_ResolveClass,
13879         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
13880         compiler when compiling with --nostdlib
13881
13882         * class.cs (TypeContainer.DefineType): Check that our parent is
13883         not null.  This test is most important when we are bootstraping
13884         the core types.
13885
13886         * codegen.cs: Split out the symbol writing code.
13887
13888 2002-03-25  Martin Baulig  <martin@gnome.org>
13889
13890         * driver.cs (-g): Made -g an alias for --debug.
13891
13892 2002-03-24  Martin Baulig  <martin@gnome.org>
13893
13894         * codegen.cs (SymbolWriter): New public variable. Returns the
13895         current symbol writer.
13896         (CodeGen): Added `bool want_debugging_support' argument to the
13897          constructor. If true, tell the ModuleBuild that we want debugging
13898         support and ask it for the ISymbolWriter.
13899         (Save): If we have a symbol writer, call it's Close() method after
13900         saving the assembly.
13901
13902         * driver.c (--debug): New command line argument to create a
13903         debugger information file.
13904
13905         * location.cs (SymbolDocument): New public property. Returns an
13906         ISymbolDocumentWriter object for the current source file or null
13907         if we don't have a symbol writer.
13908
13909 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
13910
13911         * driver.cs (LoadAssembly): Correctly return when all the paths
13912         have been tried and not before.
13913
13914         * statement.cs (Switch.Emit): return the actual coverage for this
13915         statement (returns/not-returns)
13916
13917         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
13918         switch of the statement if we are the last switch section.  That
13919         kills two problems: try/catch problems (we used to emit an empty
13920         nop at the end) and switch statements where all branches would
13921         return. 
13922
13923 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
13924
13925         * driver.cs: Add default assemblies (the equivalent to the
13926         Microsoft CSC.RSP file)
13927
13928         * cs-tokenizer.cs: When updating `cols and setting it to zero,
13929         also update tokens_seen and set it to false.
13930
13931         * driver.cs: Implement --recurse for Mike.
13932
13933         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
13934         correctly splitting out the paths.
13935
13936 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * interface.cs (Interface.PopulateProperty): Instead of using
13939         `parent' as the declaration space for the set parameters, use
13940         `this' 
13941
13942         * support.cs (InternalParameters): InternalParameters constructor
13943         takes a DeclSpace instead of a TypeContainer.
13944
13945         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
13946         types are being initialized, load the address of it before calling
13947         the function.  
13948
13949         (New): Provide a mechanism to disable the generation of local
13950         value type temporaries when the caller will be providing us with
13951         an address to store it.
13952
13953         (ArrayCreation.EmitDynamicInitializers): Use it.
13954
13955 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * expression.cs (Invocation.EmitArguments): Only probe for array
13958         property if there is more than one argument.  Sorry about that.
13959
13960         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
13961         empty param arrays.
13962
13963         * class.cs (Method.LabelParameters): Fix incorrect code path that
13964         prevented the `ParamArrayAttribute' from being applied to the
13965         params attribute.
13966
13967 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
13968
13969         * support.cs (ReflectionParameters): Correctly compute whether the
13970         last argument is a params array.  Fixes the problem with
13971         string.Split ('a')
13972
13973         * typemanager.cs: Make the assemblies array always be non-null
13974         (empty, but non-null)
13975
13976         * tree.cs (RecordDecl): New function that abstracts the recording
13977         of names.  This reports error 101, and provides a pointer to the
13978         previous declaration.  Fixes a crash in the compiler.
13979
13980         * cs-parser.jay (constructor_declaration): Update to new grammar,
13981         and provide a constructor_body that can be empty.
13982
13983 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
13984
13985         * driver.cs: Add support for --resources.
13986
13987         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
13988         Make all types for the various array helper methods be integer.
13989
13990         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
13991         CheckState to ConvCast.
13992
13993         (ConvCast): Now it takes a `checked' state argument, to avoid
13994         depending on the emit context for the conversion, and just using
13995         the resolve time setting.
13996
13997         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
13998         instead of Invocation.EmitArguments.  We do not emit the original
13999         arguments, instead we emit those which have been converted to
14000         unsigned int expressions.
14001
14002         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14003
14004         * codegen.cs: ditto.
14005
14006         * expression.cs (LocalVariableReference): Drop the use of the
14007         Store function that depended on the variable index.
14008
14009         * statement.cs (VariableInfo): Drop the `Idx' property from this
14010         class, as this is not taking into account the indexes for
14011         temporaries tat we generate during the execution, getting the
14012         indexes wrong.
14013
14014         * class.cs: First emit class initializers, then call the parent
14015         constructor. 
14016
14017         * expression.cs (Binary): Fix opcode emision.
14018         (UnaryMutator.EmitCode): Support checked code generation
14019
14020         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14021         matches for events for both the Static and Instance scans,
14022         pointing to the same element.   Fix that.
14023
14024 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14025
14026         * rootcontext.cs (ResolveTree): Always set the
14027         interface_resolve_order, because nested interfaces will be calling
14028         into us.
14029
14030         * class.cs (GetInterfaceOrClass): Track the same resolution
14031         process used by TypeManager.LookupType.  This fixes the nested
14032         type lookups in class declarations (separate path from
14033         LookupType). 
14034
14035         (TypeContainer.DefineType): Also define nested interfaces.
14036         (TypeContainer.RegisterOrder): New public function used to
14037         register the order in which child interfaces need to be closed.
14038
14039         Nested interfaces need to be closed after their parents have been
14040         created. 
14041
14042         * interface.cs (InterfaceAttr): Put all the logic for computing
14043         the interface attribute here. 
14044
14045         (DefineInterface): Register our interface order with the
14046         RootContext or with the TypeContainer depending on the case.
14047
14048 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14049
14050         * cs-parser.jay: rework foreach statement to work with the new
14051         changes to the policy on SimpleNames.
14052
14053         * report.cs: support Stacktrace on warnings as well.
14054
14055         * makefile: drop --unsafe and /unsafe from the compile.
14056
14057 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14058
14059         * ecore.cs (StandardConversionExists): Modify to take an Expression
14060         as the first parameter. Ensure we do null -> reference type conversion
14061         checking.
14062
14063         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14064         temporary Expression objects.
14065
14066 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14067
14068         * interface.cs: workaround bug in method overloading resolution
14069         (there is already a bugzilla bug for it).
14070
14071 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14072
14073         We could also solve this problem by having a separate path for
14074         performing type lookups, instead of DoResolve, we could have a
14075         ResolveType entry point, and only participating pieces of the
14076         production (simplename, deref, array) would implement this. 
14077
14078         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14079         signal SimpleName to only resolve type names and not attempt to
14080         resolve anything else.
14081
14082         * expression.cs (Cast): Set the flag.
14083
14084         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14085
14086         * class.cs: Only report 108 if there is no `new' modifier.
14087
14088         * cs-parser.jay: rework foreach statement to work with the new
14089         changes to the policy on SimpleNames.
14090         
14091         * report.cs: support Stacktrace on warnings as well.
14092
14093         * makefile: drop --unsafe and /unsafe from the compile.
14094
14095 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14096
14097         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14098         lookups here, instead of doing that at parse time.  This means
14099         that our grammar will not introduce `LocalVariableReferences' as
14100         expressions at this point.  That solves the problem of code like
14101         this:
14102
14103         class X {
14104            static void Main ()
14105            { int X = 1;
14106             { X x = null }}}
14107
14108         This is only half the fix.  The full fix requires parameters to
14109         also be handled in this way.
14110
14111         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14112         makes the use more obvious of the DeclSpace.  The
14113         ec.TypeContainer.TypeBuilder is now only used to pull the
14114         TypeBuilder for it.
14115
14116         My theory is that I can get rid of the TypeBuilder completely from
14117         the EmitContext, and have typecasts where it is used (from
14118         DeclSpace to where it matters).  
14119
14120         The only pending problem is that the code that implements Aliases
14121         is on TypeContainer, and probably should go in DeclSpace.
14122
14123         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14124         lookups here, instead of doing that at parse time.  This means
14125         that our grammar will not introduce `LocalVariableReferences' as
14126         expressions at this point.  That solves the problem of code like
14127         this:
14128
14129         class X {
14130            static void Main ()
14131            { int X = 1;
14132             { X x = null }}}
14133
14134         This is only half the fix.  The full fix requires parameters to
14135         also be handled in this way.
14136
14137         * class.cs (Property.DefineMethod): When implementing an interface
14138         method, set newslot, when implementing an abstract method, do not
14139         set the flag (before we tried never setting it, or always setting
14140         it, which is the difference).
14141         (Indexer.DefineMethod): same.
14142         (Method.DefineMethod): same.
14143
14144         * ecore.cs: Only set the status used flag if we get back a Field.
14145
14146         * attribute.cs: Temporary hack, so Paolo can keep working.
14147
14148 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14149
14150         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14151         the unmanaged type in the case we have a MarshalAs attribute.
14152
14153         (Resolve): Handle the case when we are parsing the special MarshalAs
14154         attribute [we need to store the unmanaged type to use later]
14155
14156         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14157         MarshalAs Attribute.
14158
14159         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14160         on parameters and accordingly set the marshalling info.
14161
14162 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14163
14164         * class.cs: Optimizing slightly by removing redundant code after
14165         we switched to the `NoTypes' return value.
14166         (Property.DefineMethod): use NoTypes here too.
14167
14168         This fixes the bug I introduced in my last batch of changes.
14169
14170 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14171
14172         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14173
14174         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14175         Enums since those are types too. 
14176
14177         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14178
14179         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14180         thanks to a call during the lookup process.
14181
14182 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14183
14184         * statement.cs (Foreach): Lots of work to accomodate a particular
14185         kind of foreach statement that I had not kept in mind.  It is
14186         possible to have foreachs on classes that provide a GetEnumerator
14187         method that return objects that implement the "pattern" for using
14188         a foreach, there is no need to support GetEnumerator
14189         specifically. 
14190
14191         This is needed to compile nant.
14192
14193         * decl.cs: Only report 114 if the member is not `Finalize' and if
14194         the warning level is at least 2.
14195
14196         * class.cs: Moved the compare function from Method to
14197         MethodSignature. 
14198
14199         (MethodSignature.InheritableMemberSignatureCompare): Add new
14200         filter function that is used to extract inheritable methods from a
14201         class. 
14202
14203         (Method.Define): Use the new `inheritable_method_signature_filter'
14204         delegate
14205
14206         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14207         command. 
14208
14209 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14210
14211         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14212
14213         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14214
14215         * expression.cs: Pass location information to
14216         ConvertImplicitStandard. 
14217
14218         * class.cs: Added debugging code to track return values from
14219         interfaces. 
14220
14221 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14222
14223         * expression.cs (Is.DoResolve): If either side of the `is' is an
14224         interface, do not flag the warning.
14225
14226         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14227         for interfaces
14228
14229         * report.cs: Allow for --fatal to be used with --probe.
14230
14231         * typemanager.cs (NoTypes): Move the definition for the empty Type
14232         array here. 
14233
14234         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14235         properties. 
14236         (TypeContainer.DefineProxy): New function used to proxy to parent
14237         implementations when implementing interfaces.
14238         (TypeContainer.ParentImplements): used to lookup if our parent
14239         implements a public function that is required by an interface.
14240         (TypeContainer.VerifyPendingMethods): Hook this up.
14241
14242         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14243         `modules' and `assemblies' arraylists into arrays.  We only grow
14244         these are the very early start up of the program, so this improves
14245         the speedof LookupType (nicely measured).
14246
14247         * expression.cs (MakeByteBlob): Replaced unsafe code with
14248         BitConverter, as suggested by Paolo.
14249
14250         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14251         folding of string concatenation, but if either side is a string,
14252         and the other is not, then return null, and let the runtime use
14253         the concatenation on the string plus the object (using
14254         `Object.ToString'). 
14255
14256 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14257
14258         Constant Folding has been implemented now.
14259
14260         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14261         the error instead on types that are not supported in one's
14262         complement. 
14263
14264         * constant.cs (Constant and all children): New set of functions to
14265         perform implict and explicit conversions.
14266
14267         * ecore.cs (EnumConstant): Implement the new functions to perform
14268         conversion by proxying to the child expression.
14269
14270         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14271         own separate setting that can not be turned off from the command
14272         line using --unchecked or --checked and is only controlled using
14273         the checked/unchecked statements and expressions.  This setting is
14274         used by the constant folder to flag errors.
14275
14276         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14277         ConstantCheckState as well.   
14278
14279         During Resolve, they also have to flag the state, because the
14280         constant folder runs completely in the Resolve phase.
14281
14282         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14283         well.
14284
14285 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14286
14287         * cfold.cs: New file, this file contains the constant folder.
14288
14289         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14290         argument to track whether we are using the resulting address to
14291         load or store a value and provide better error messages. 
14292
14293         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14294         new AddressOf arguments.
14295
14296         * statement.cs (Foreach.EmitCollectionForeach): Update
14297
14298         * expression.cs (Argument.Emit): Call AddressOf with proper
14299         arguments to track usage.
14300
14301         (New.DoEmit): Call AddressOf with new arguments.
14302
14303         (Unary.Emit): Adjust AddressOf call.
14304
14305 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14306
14307         * cs-parser.jay (member_access): Change the case for pre-defined types
14308         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14309         this suggestion.
14310
14311         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14312         a method body.
14313
14314         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14315         essentially like methods and apply attributes like MethodImplOptions to them too.
14316
14317         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14318         not being null.
14319
14320         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14321         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14322         is the DeclSpace.
14323
14324         * Update code everywhere accordingly.
14325
14326         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14327
14328         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14329
14330 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14331
14332         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14333         try performing lookups against those instead of jumping straight into using
14334         the 'using' clauses.
14335
14336         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14337
14338         (LookupType): Perform lookups in implicit parents too.
14339
14340         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14341         sequence as RootContext.LookupType. 
14342
14343         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14344         the various cases of namespace lookups into this method.
14345
14346 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14347
14348         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14349         in positional arguments)
14350
14351         * class.cs (Operator): Update the AllowedModifiers to contain
14352         extern. 
14353
14354         * cs-parser.jay: Update operator declaration to allow for the
14355         operator body to be empty.
14356
14357         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14358         values. 
14359
14360 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14361
14362         * class.cs (Method.Emit): Label parameters.
14363
14364         * driver.cs: Return 1 or 0 as the program exit code.
14365
14366 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14367
14368         * expression.cs: Special case the `null' object when trying to
14369         auto-compute the type, as anything can be explicitly converted to
14370         that. 
14371
14372         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14373         spotting this Paolo.
14374
14375         (Expression.ImplicitNumericConversion): Perform comparissions of
14376         the type using the underlying type in the case of an enumeration
14377         rather than using the enumeration type for the compare.
14378
14379         Cope with the underlying == type case, which is not possible to
14380         catch before. 
14381
14382         (Expression.ConvertNumericExplicit): Perform comparissions of
14383         the type using the underlying type in the case of an enumeration
14384         rather than using the enumeration type for the compare.
14385
14386         * driver.cs: If the user does not supply an extension, assume .exe
14387
14388         * cs-parser.jay (if_statement): Rewrote so that we can track the
14389         location for the if statement.
14390
14391         * expression.cs (Binary.ConstantFold): Only concat strings when
14392         the operation is "+", not everything ;-)
14393
14394         * statement.cs (Statement.EmitBoolExpression): Take a location
14395         argument. 
14396         (If, While, Do): Track location.
14397
14398         * expression.cs (Binary.ResolveOperator): In the object + string
14399         case, I was missing a call to ConvertImplicit
14400
14401 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14402
14403         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14404         Location arguments. Ensure we use RootContext.LookupType to do our work
14405         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14406
14407         * interface.cs (PopulateMethod): Handle the type of the parameter being
14408         null gracefully.
14409
14410         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14411         have a params method with no fixed arguments and a call is made with no
14412         arguments.
14413
14414 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14415
14416         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14417         the verbatim-string-literal
14418
14419         * support.cs (InternalParameters.ParameterModifier): handle null
14420         fixed parameters.
14421         (InternalParameters.ParameterType): ditto.
14422
14423         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14424         duplicating the name of the variable parameter.
14425         (GetParameterByName): Fix bug where we were not looking up array
14426         paramters if they were the only present (thanks Paolo!).
14427         (GetParameterInfo): We only have an empty set of types if both
14428         fixed and array are set to null.
14429         (GetParameterInfo-idx): Handle FixedParameter == null
14430
14431         * cs-parser.jay: Handle the case where there is no catch
14432         statements (missing null test).
14433
14434 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14435
14436         * driver.cs (MainDriver): Be conservative on our command line
14437         handling.
14438
14439         Catch DirectoryNotFoundException when calling GetFiles.
14440
14441         (SplitPathAndPattern): Used to split the input specification into
14442         a path and a pattern that we can feed to Directory.GetFiles.
14443
14444 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14445
14446         * statement.cs (Fixed): Implement the last case of the Fixed
14447         statement (string handling).
14448
14449         * expression.cs (StringPtr): New class used to return a char * to
14450         a string;  Used by the Fixed statement.
14451
14452         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14453
14454         * expression.cs (Binary.ResolveOperator): Remove redundant
14455         MemberLookup pn parent type.
14456         Optimize union call, we do not need a union if the types are the same.
14457         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14458         type.
14459
14460         Specialize the use of MemberLookup everywhere, instead of using
14461         the default settings. 
14462
14463         (StackAlloc): Implement stackalloc keyword.
14464
14465         * cs-parser.jay: Add rule to parse stackalloc.
14466
14467         * driver.cs: Handle /h, /help, /?
14468
14469         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14470         before we supported unsafe code.
14471
14472         * makefile: add --unsafe to the self compilation of mcs.
14473
14474 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * expression.cs (PointerArithmetic): New class that is used to
14477         perform pointer arithmetic.
14478         (Binary.Resolve): Handle pointer arithmetic
14479         Handle pointer comparission.
14480         (ArrayPtr): Utility expression class that is used to take the
14481         address of an array.
14482
14483         (ElementAccess): Implement array access for pointers
14484
14485         * statement.cs (Fixed): Implement fixed statement for arrays, we
14486         are missing one more case before we are done.
14487
14488         * expression.cs (Indirection): Implement EmitAssign and set the
14489         ExprClass to Variable.  This allows pointer dereferences to be
14490         treated as variables, and to have values assigned to them.
14491
14492         * ecore.cs (Expression.StoreFromPtr): New utility function to
14493         store values dereferencing.
14494
14495 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14496
14497         * expression.cs (Binary.ResolveOperator): Ensure that we are
14498         not trying to operate on a void type - this fixes the reported
14499         bug.
14500
14501         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14502         the parent implementation is sealed.
14503
14504         * ../errors/cs0239.cs : Add.
14505
14506         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14507
14508         * typemanager.cs (unverifiable_code_type): Corresponds to 
14509         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14510         which have unsafe code in them.
14511
14512         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14513         unsafe context.
14514
14515 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14516
14517         * cs-tokenizer.cs: Add support for @"litreal strings"
14518
14519         Make tokenizer accept pre-processor directives
14520         on any column (remove the old C-like limitation). 
14521
14522         * rootcontext.cs (EmitCode): Emit any global attributes.
14523         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14524
14525         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14526
14527         * cs-parser.jay: Add support for global attributes.  
14528
14529 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
14530
14531         * expression.cs (Indirection): New helper class.  Unary will
14532         create Indirection classes to be able to implement the
14533         IMemoryLocation interface on it.
14534
14535 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
14536
14537         * cs-parser.jay (fixed_statement): reference the right statement.
14538
14539         * statement.cs (Fixed.Emit): Finish implementing the fixed
14540         statement for the &x case.
14541
14542 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
14543
14544         * class.cs (Property.Define, Method.Define): Remove newslot when
14545         `implementing'.  
14546
14547         * modifiers.cs: My use of NewSlot when `Abstract' was set was
14548         wrong.  NewSlot should only be used if the `new' keyword is present.
14549
14550         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
14551         locating our system dir.  Sorry about this.
14552
14553 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14554
14555         * driver.cs (GetSystemDir): Compute correctly the location of our
14556         system assemblies.  I was using the compiler directory instead of
14557         the library directory.
14558
14559 2002-02-13  Ravi Pratap  <ravi@ximian.com>
14560
14561         * expression.cs (BetterFunction): Put back in what Miguel commented out
14562         since it is the correct fix. The problem is elsewhere ;-)
14563
14564         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
14565         parameters of the parms method are themselves compatible or not !
14566
14567         (StandardConversionExists): Fix very dangerous bug where we were forgetting
14568         to check that a class implements an interface before saying that an implicit
14569         conversion was allowed. Use ImplementsInterface to do the checking.
14570
14571 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
14572
14573         * class.cs (Method.Define): Track whether we are an explicit
14574         implementation or not.  And only call DefineMethodOverride if we
14575         are an explicit implementation.
14576
14577         (Property.DefineMethod): Ditto.
14578
14579 2002-02-11  Ravi Pratap  <ravi@ximian.com>
14580
14581         * expression.cs (BetterFunction): Catch hideous bug which was
14582          preventing us from detecting ambiguous calls due to implicit casts i.e
14583         cs0121.
14584
14585 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
14586
14587         * support.cs (Pair): Remove un-needed method.  I figured why I was
14588         getting the error in cs-parser.jay, the variable in a foreach loop
14589         is readonly, and the compiler does not really treat this as a variable.
14590
14591         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
14592         instead of EQUALS in grammar.  
14593
14594         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
14595
14596         * expression.cs (Unary.DoResolve): Check whether the argument is
14597         managed or not.
14598
14599 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
14600
14601         * support.cs: Api for Pair to set a value.  Despite the fact that
14602         the variables are public the MS C# compiler refuses to compile
14603         code that accesses the field if the variable is part of a foreach
14604         statement. 
14605
14606         * statement.cs (Fixed): Begin implementation of the fixed
14607         statement.
14608
14609         (Block.AddVariable): Return the VariableInfo on success and null
14610         on failure instead of true/false. 
14611
14612         * cs-parser.jay (foreach): Catch errors on variables already
14613         defined (we were ignoring this value before) and properly unwind
14614         the block hierarchy
14615
14616         (fixed_statement): grammar for the fixed statement.
14617
14618 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
14619
14620         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
14621         pointer types to be incretemented.
14622
14623         (SizeOf): Implement.
14624
14625         * cs-parser.jay (pointer_member_access): Implement
14626         expr->IDENTIFIER production.
14627
14628         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
14629         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
14630         on safe contexts.
14631
14632         (Unary): Implement indirection.
14633
14634         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
14635         use in non-unsafe context).
14636
14637         (SimpleName.DoResolve): Check for pointers in field access on safe
14638         contexts. 
14639
14640         (Expression.LoadFromPtr): Factor the load-indirect code in this
14641         function.  This was duplicated in UnboxCast and ParameterReference
14642
14643 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
14644
14645         * expression.cs (ComposedCast): report an error if a pointer cast
14646         is used in a safe region.
14647
14648         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
14649         pointer type casts in unsafe context.
14650
14651         * codegen.cs (EmitContext): Set up IsUnsafe.
14652
14653         * cs-parser.jay (non_expression_type): Add productions for pointer
14654         casts. 
14655
14656         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
14657         code.  We should not use force into static mode if the method is
14658         not virtual.  Fixes bug in MIS
14659
14660         * statement.cs (Do.Emit, While.Emit, For.Emit,
14661         Statement.EmitBoolExpression): Add support to Do and While to
14662         propagate infinite loop as `I do return' semantics.
14663
14664         Improve the For case to also test for boolean constants.
14665
14666         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
14667         to the list of attributes we can add.
14668
14669         Remove `EmitContext' argument.
14670
14671         * class.cs (Method.Define): Apply parameter attributes.
14672         (Constructor.Define): Apply parameter attributes.
14673         (MethodCore.LabelParameters): Move here the core of labeling
14674         parameters. 
14675
14676         * support.cs (ReflectionParameters.ParameterModifier,
14677         InternalParameters.ParameterModifier): Use IsByRef on the type and
14678         only return the OUT bit for these parameters instead of in/out/ref
14679         flags.
14680
14681         This is because I miss-understood things.  The ParameterInfo.IsIn
14682         and IsOut represent whether the parameter has the [In] and [Out]
14683         attributes set.  
14684
14685 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
14686
14687         * ecore.cs (FieldExpr.Emit): Release temporaries.
14688
14689         * assign.cs (LocalTemporary.Release): new function.
14690
14691         * codegen.cs (EmitContext.GetTemporaryStorage,
14692         EmitContext.FreeTemporaryStorage): Rework the way we deal with
14693         temporary storage.  Now we can "put back" localbuilders when we
14694         are done with them
14695
14696 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
14699         need to make a copy of the variable to generate verifiable code.
14700
14701 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
14702
14703         * driver.cs: Compute dynamically the system directory.
14704
14705         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
14706         Slower, but more generally useful.  Used by the abstract
14707         registering implementation. 
14708
14709         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
14710         the rules for the special rule on Type/instances.  First check if
14711         we have the same name, and if so, try that special static path
14712         rather than the instance path.
14713
14714 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
14717         for, while and if.
14718
14719         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
14720         Enum, ValueType, Delegate or Array for non-corlib compiles.
14721
14722         * cs-tokenizer.cs: Catch long identifiers (645)
14723
14724         * typemanager.cs (IndexerPropetyName): Ravi never tested this
14725         piece of code.
14726
14727         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
14728         fix, we were returning too early, so we were not registering
14729         pending methods from abstract classes.
14730
14731         Do not register pending methods if the class is abstract.
14732
14733         * expression.cs (Conditional.DoResolve): Report circular implicit
14734         conversions when we neecd to compute it for conditional
14735         expressions. 
14736
14737         (Is.DoResolve): If the expression is always of the provided type,
14738         flag warning 183.  If the expression can not ever be of the
14739         provided type flag warning 184.
14740
14741         * class.cs: Catch 169 as well.
14742
14743         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
14744         read. 
14745
14746 2002-01-18  Nick Drochak  <ndrochak@gol.com>
14747
14748         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
14749
14750 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
14751
14752         * interface.cs: (PopulateMethod): Check for pointers being defined
14753         only if the unsafe context is active.
14754         (PopulateProperty): ditto.
14755         (PopulateIndexer): ditto.
14756
14757         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
14758         specified.  If pointers are present, make sure that they are
14759         present in an unsafe context.
14760         (Constructor, Constructor.Define): ditto.
14761         (Field, Field.Define): ditto.
14762         (Property, Property.Define): ditto.
14763         (Event, Event.Define): ditto.
14764
14765         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
14766         hashtable if there are classes or structs defined.
14767
14768         * expression.cs (LocalVariableReference.DoResolve): Simplify this
14769         code, as the constant resolution moved.
14770
14771         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
14772         the metadata, so we can flag error 133. 
14773
14774         * decl.cs (MemberCore.UnsafeOK): New function to test that a
14775         pointer is being declared in an unsafe context.
14776
14777 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
14778
14779         * modifiers.cs (Modifiers.Check): Require a Location argument.
14780         Report error 227 for Unsafe use.
14781
14782         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
14783
14784         * statement.cs (For.Emit): If the test is null, then report that
14785         we do `return', as we wont reach anything afterwards.
14786
14787         (Switch.SwitchGoverningType): Track the expression that matched
14788         the conversion.
14789
14790         * driver.cs: Allow negative numbers as an error code to flag.
14791
14792         * cs-parser.jay: Handle 1551.
14793
14794         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
14795
14796 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14797
14798         * cs-parser.jay: Report 1518 (type declaration can only contain
14799         class, struct, interface, enum or delegate)
14800
14801         (switch_label): Report 1523 (keywords `case' or `default' must
14802         preced code)
14803
14804         (opt_switch_sections): Report 1522 (empty switch)
14805
14806         * driver.cs: Report 1515 (response file specified multiple times)
14807         Report 1516 (Source file specified multiple times).
14808
14809         * expression.cs (Argument.Resolve): Signal 1510
14810
14811         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
14812         access not allowed in static code)
14813
14814 2002-01-11  Ravi Pratap  <ravi@ximian.com>
14815
14816         * typemanager.cs (IsPointerType): Utility method which we are going
14817         to need a lot.
14818
14819         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
14820         the object type, so we take care of that.
14821
14822         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
14823
14824         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
14825         added to non-params parameters :-)
14826
14827         * typemanager.cs (CSharpName): Include 'void' type too. 
14828
14829         (void_ptr_type): Include in the set of core types.
14830
14831         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
14832         duplicating code.
14833
14834         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
14835         an unsafe context.
14836
14837         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
14838         completely forgotten about it.
14839
14840 2002-01-10  Ravi Pratap  <ravi@ximian.com>
14841
14842         * cs-parser.jay (pointer_type): Add. This begins our implementation
14843         of parsing rules for unsafe code.
14844
14845         (unsafe_statement): Implement.
14846
14847         (embedded_statement): Modify to include the above.
14848
14849         * statement.cs (Unsafe): Implement new class for unsafe blocks.
14850
14851         * codegen.cs (EmitContext.InUnsafe): Add. This determines
14852         if the current context is an unsafe one.
14853
14854         * cs-parser.jay (local_variable_pointer_type): Since local variable types
14855         are handled differently, we need separate rules for them.
14856
14857         (local_variable_declaration): Update to use local_variable_pointer_type
14858         to allow variable declarations of unmanaged pointer types.
14859
14860         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
14861         in unsafe contexts.
14862
14863         * ../errors/cs0214.cs : Add.
14864
14865 2002-01-16  Nick Drochak  <ndrochak@gol.com>
14866
14867         * makefile: remove 'response' file when cleaning.
14868
14869 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
14870
14871         * cs-parser.jay: Report 1524.
14872
14873 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
14874
14875         * typemanager.cs (RegisterMethod): drop checking if we have
14876         registered this from here
14877
14878 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
14879
14880         * class.cs (Method.EmitDestructor): Implement calling our base
14881         destructor. 
14882
14883         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
14884         value of InFinally.
14885
14886         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
14887         this routine and will wrap the call in a try/catch block.  Deal
14888         with the case.
14889
14890 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
14891
14892         * ecore.cs (Expression.MemberLookup): instead of taking a
14893         parameter `same_type' that was used to tell whether we could
14894         access private members we compute our containing type from the
14895         EmitContext.
14896
14897         (FieldExpr): Added partial support for volatile fields.  This does
14898         not work for volatile fields exposed from assemblies, as I can not
14899         figure out how to extract the modreq from it.
14900
14901         Updated all the source files to use this.
14902
14903         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
14904         because it is referenced by MemberLookup very often. 
14905
14906 2002-01-09  Ravi Pratap  <ravi@ximian.com>
14907
14908         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
14909         TypeBuilder.GetCustomAttributes to retrieve what we need.
14910
14911         Get rid of redundant default_member_attr_type as this is the same as
14912         default_member_type which already exists.
14913
14914         * interface.cs, attribute.cs : Update accordingly.
14915
14916 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
14917
14918         * typemanager.cs: Enable IndexerPropertyName again.  It does not
14919         work for TYpeBuilders though.  Ravi, can you please fix this?
14920
14921         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
14922
14923         * expression.cs (Argument.Emit): Handle the case of ref objects
14924         being passed to ref functions;  
14925
14926         (ParameterReference.EmitLoad): Loads the content of the pointer
14927         without dereferencing.
14928
14929 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14930
14931         * cs-tokenizer.cs: Implemented the pre-processing expressions.
14932
14933 2002-01-08  Ravi Pratap  <ravi@ximian.com>
14934
14935         * class.cs (Indexer.DefineMethod): Incorporate the interface
14936         type in the name of the method if we are doing explicit interface
14937         implementation.
14938
14939         * expression.cs (ConversionExists): Remove as it is completely obsolete.
14940
14941         (BetterConversion): Fix extremely trivial bug where we were referring to
14942         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
14943         again !
14944
14945         * ../errors/bug16.cs : Add although we have fixed it.
14946
14947 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
14948
14949         * expression.cs (BaseIndexer): Begin implementation.
14950
14951         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
14952
14953         * cs-parser.jay (indexer_declarator): Use qualified_identifier
14954         production directly to remove a shift/reduce, and implement
14955         explicit interface implementation.
14956
14957         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
14958         after a floating point suffix.
14959
14960         * expression.cs (DoNumericPromotions): Improved the conversion for
14961         uint/uint.  If we have a constant, we avoid doing a typecast to a
14962         larger type.
14963
14964         * class.cs (Indexer): Implement explicit interface implementation
14965         for indexers.
14966
14967 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
14968
14969         * class.cs: make the default instance constructor public and hidebysig.
14970
14971 2001-01-03  Ravi Pratap  <ravi@ximian.com>
14972
14973         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
14974         so we can call it from elsewhere.
14975
14976         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
14977         we emit it internally if the class has a defined indexer; otherwise the user
14978         emits it by decorating the class definition with the DefaultMemberAttribute.
14979
14980         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
14981         attribute is not used on a type which defines an indexer.
14982
14983         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
14984         character when we skip whitespace.
14985
14986         * ../errors/cs0646.cs : Add.
14987
14988 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
14989
14990         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
14991         again. 
14992
14993         * makefile: Add practical target `mcs3.exe' which builds the third
14994         generation compiler. 
14995
14996         * expression.cs (New): Fix structures constructor calling.
14997
14998         * class.cs (Property, Method, Indexer): Emit Final flag on the
14999         method if we are an interface implementation and we are not
15000         abstract. 
15001
15002         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15003         whether this property is referencing a `base' method.
15004
15005         * expression.cs (Invocation.EmitCall): take an extra argument:
15006         is_base, this is used to determine whether the `call' or
15007         `callvirt' opcode should be used.
15008
15009
15010         * delegate.cs: update EmitCall.
15011
15012         * class.cs (Method.Define): Set NewSlot for the cases where we are
15013         not implementing an interface method.
15014
15015         (Property.Define): ditto.
15016
15017 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15018
15019         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15020         'r'.  Allows mcs to parse itself fully.
15021
15022 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15023
15024         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15025         of the number of initializers that require the InitializeArray method.
15026
15027         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15028         update the above field where necessary.
15029
15030         (MakeByteBlob): Update accordingly.
15031
15032         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15033         greater than 2.
15034
15035         (EmitDynamicInitializers): Update in accordance with the new optimization.
15036
15037         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15038         same OpCode applies.
15039
15040         * cs-parser.jay : Fix some glaring errors I introduced.
15041
15042 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15043
15044         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15045         so that we can check for name clashes there too.
15046
15047         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15048         for interface indexers.
15049
15050         * interfaces.cs (Define): Emit the default member attribute.
15051
15052         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15053         variable was being referred to while setting the value ;-)
15054
15055 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15056
15057         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15058         byte-by-byte information when we know the data is zero.
15059
15060         Make the block always a multiple of 4, because
15061         DefineInitializedData has a bug.
15062
15063         * assign.cs: Fix, we should assign from the temporary, not from
15064         the source. 
15065
15066         * expression.cs (MakeByteBlob): Fix my incorrect code.
15067
15068 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15069
15070         * typemanager.cs (EnumToUnderlying): This function is used to get
15071         the underlying type from an enumeration, because it does not
15072         always work. 
15073
15074         * constant.cs: Use the I4_S form for values between -128 and 127.
15075
15076         * statement.cs (Block.LookupLabel): Looks up a label.
15077         (Block): Drop support for labeled blocks.
15078
15079         (LabeledStatement): New kind of statement that represents a label
15080         only.
15081
15082         (Goto): Finally implement this bad boy.
15083
15084         * cs-parser.jay: Update to reflect new mechanism to implement
15085         labels.
15086
15087 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15088
15089         * codegen.cs (EmitContext.This): a codegen property that keeps the
15090         a single instance of this instead of creating many different this
15091         instances. 
15092
15093         * delegate.cs (Delegate.DoResolve): Update to use the property;
15094
15095         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15096
15097         * expression.cs (BaseAccess.DoResolve): Ditto.
15098
15099 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15100
15101         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15102         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15103
15104         (InitCoreTypes): Update accordingly.
15105
15106         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15107         so we can quickly store the state.
15108
15109         (ApplyAttributes): Set the correct implementation flags
15110         for InternalCall methods.
15111
15112 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15113
15114         * expression.cs (EmitCall): if a method is not virtual, then do
15115         not use callvirt on it.
15116
15117         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15118         user defined stuff) requires the use of stobj, which takes an
15119         address on the stack instead of an array and an index.  So emit
15120         the Ldelema operation for it.
15121
15122         (EmitStoreOpcode): Use stobj for valuetypes.
15123
15124         (UnaryMutator.EmitCode): Use the right 1 value depending on
15125         whether we are dealing with int64/uint64, float or doubles.
15126
15127         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15128         constructors that I implemented last night.
15129
15130         (Constructor.IsDefault): Fix to work properly for static
15131         constructors.
15132
15133         * cs-parser.jay (CheckDef): report method signature errors.
15134         Update error number 103 to be 132.
15135
15136         * decl.cs: New AdditionResult enumeration value: MethodExists.
15137         Although we do this check for methods later on in the semantic
15138         analysis, catching repeated default constructors is so easy that
15139         we catch these here. 
15140
15141         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15142         promotions code.
15143
15144         (ParameterReference.EmitAssign, Emit): handle
15145         bools as bytes.
15146
15147         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15148         (ArrayAccess.EmitStoreOpcode): ditto.
15149
15150         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15151
15152         * expression.cs (MakeByteBlob): Complete all the missing types
15153         (uint, short, ushort, byte, sbyte)
15154
15155         * class.cs: Only init instance field initializers on instance
15156         constructors. 
15157
15158         Rename `constructors' to instance_constructors. 
15159
15160         (TypeContainer.AddConstructor): Only add constructors to the list
15161         if it is not static.
15162
15163         Make sure that we handle default_static_constructor independently
15164         everywhere where we handle instance_constructors
15165
15166 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15167
15168         * class.cs: Do not lookup or create a base initializer for a
15169         static constructor.
15170
15171         (ConstructorInitializer.Resolve): use the proper type to lookup
15172         for constructors.
15173
15174         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15175
15176         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15177         in DeclSpace. 
15178
15179         * decl.cs: CloseType is now an virtual method, the default
15180         implementation just closes this type.
15181
15182 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15183
15184         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15185         to PreserveSig by default. Also emit HideBySig on such methods.
15186
15187         Basically, set the defaults to standard values.
15188
15189         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15190         argument, if candidate is better, it can't be worse than the best !
15191
15192         (Invocation): Re-write bits to differentiate between methods being
15193         applicable in their expanded form and their normal form - for params
15194         methods of course.
15195
15196         Get rid of use_standard everywhere as only standard conversions are allowed
15197         in overload resolution. 
15198
15199         More spec conformance.
15200
15201 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15202
15203         * driver.cs: Add --timestamp, to see where the compiler spends
15204         most of its time.
15205
15206         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15207         `this' in static code.
15208
15209         (SimpleName.DoResolve): Implement in terms of a helper function
15210         that allows static-references to be passed upstream to
15211         MemberAccess.
15212
15213         (Expression.ResolveWithSimpleName): Resolve specially simple
15214         names when called by MemberAccess to implement the special
15215         semantics. 
15216
15217         (Expression.ImplicitReferenceConversion): Handle conversions from
15218         Null to reference types before others, as Null's type is
15219         System.Object. 
15220
15221         * expression.cs (Invocation.EmitCall): Handle the special case of
15222         calling methods declared on a reference type from a ValueType
15223         (Base classes System.Object and System.Enum)
15224
15225         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15226         the left hand side is a TypeExpr, not on every enumeration. 
15227
15228         (Binary.Resolve): If types are reference types, then do a cast to
15229         object on operators != and == of both arguments.
15230
15231         * typemanager.cs (FindMembers): Extract instance and static
15232         members if requested.
15233
15234         * interface.cs (PopulateProperty): Use void_type instead of null
15235         as the return type for the setter method.
15236
15237         (PopulateIndexer): ditto.
15238
15239 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15240
15241         * support.cs (ReflectionParameters): Fix minor bug where we
15242         were examining the wrong parameter for the ParamArray attribute.
15243
15244         Cope with requests for the type of the parameter at position
15245         greater than the params parameter's. We now return the element
15246         type of the params array as that makes more sense.
15247
15248         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15249         accordingly as we no longer have to extract the element type
15250         ourselves.
15251
15252         (Invocation.OverloadResolve): Update.
15253
15254 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15255
15256         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15257         against IEnumerator, test whether the return value is a descendant
15258         of the IEnumerator interface.
15259
15260         * class.cs (Indexer.Define): Use an auxiliary method to implement
15261         the other bits of the method definition.  Begin support for
15262         explicit interface implementation.
15263
15264         (Property.DefineMethod): Use TypeManager.void_type instead of null
15265         for an empty return value.
15266
15267 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15268
15269         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15270         dealing with a FieldExpr which is composed of a FieldBuilder, in
15271         the code path we did extract the constant, but we should have
15272         obtained the underlying value to be able to cast it (otherwise we
15273         end up in an infinite loop, this is what Ravi was running into).
15274
15275         (ArrayCreation.UpdateIndices): Arrays might be empty.
15276
15277         (MemberAccess.ResolveMemberAccess): Add support for section
15278         14.5.4.1 that deals with the special case of E.I when E is a type
15279         and something else, that I can be a reference to a static member.
15280
15281         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15282         handle a particular array type to create byte blobs, it is just
15283         something we dont generate byteblobs for.
15284
15285         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15286         arguments. 
15287
15288         * location.cs (Push): remove the key from the hashtable that we
15289         are about to add.   This happens for empty files.
15290
15291         * driver.cs: Dispose files after we have parsed them.
15292
15293         (tokenize): new function that only runs the tokenizer on its
15294         input, for speed testing.
15295
15296 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15297
15298         * class.cs (Event.Define): Define the private field only if there
15299         are no accessors defined.
15300
15301         * expression.cs (ResolveMemberAccess): If there is no associated
15302         field with the event, that means we have an event defined with its
15303         own accessors and we should flag error cs0070 since transforming
15304         ourselves into a field is not valid in that case.
15305
15306         * ecore.cs (SimpleName.DoResolve): Same as above.
15307
15308         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15309         and charset to sane values.
15310
15311 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15312
15313         * assign.cs (DoResolve): Perform check on events only if they 
15314         are being accessed outside the declaring type.
15315
15316         * cs-parser.jay (event_declarations): Update rules to correctly
15317         set the type of the implicit parameter etc.
15318
15319         (add_accessor, remove_accessor): Set current local parameters.
15320
15321         * expression.cs (Binary): For delegate addition and subtraction,
15322         cast the return value from the method into the appropriate delegate
15323         type.
15324
15325 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15326
15327         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15328         of these as the workaround is unnecessary.
15329
15330         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15331         delegate data - none of that is needed at all.
15332
15333         Re-write bits to extract the instance expression and the delegate method
15334         correctly.
15335
15336         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15337         on delegates too.
15338
15339         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15340         of attaching attributes instead of duplicating code everywhere.
15341
15342         * everywhere : Update code to do attribute emission using the above method.
15343
15344 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15345
15346         * expression.cs (IsParamsMethodApplicable): if there are not
15347         parameters, return immediately.
15348
15349         * ecore.cs: The 0 literal can be implicity converted to an enum
15350         type. 
15351
15352         (SimpleName.DoResolve): First lookup the type, then lookup the
15353         members. 
15354
15355         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15356         want to get its address.  If the InstanceExpression is not
15357         addressable, store the result in a temporary variable, then get
15358         the address of it.
15359
15360         * codegen.cs: Only display 219 errors on warning level or above. 
15361
15362         * expression.cs (ArrayAccess): Make it implement the
15363         IMemoryLocation interface.
15364
15365         (Binary.DoResolve): handle the operator == (object a, object b)
15366         and operator != (object a, object b) without incurring into a
15367         BoxedCast (because 5 != o should never be performed).
15368
15369         Handle binary enumerator operators.
15370
15371         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15372         value type, otherwise use Ldelem_ref.
15373
15374         Use precomputed names;
15375
15376         (AddressOf): Implement address of
15377
15378         * cs-parser.jay (labeled_statement): Fix recursive block
15379         addition by reworking the production.
15380
15381         * expression.cs (New.DoEmit): New has a special case:
15382                 
15383                  If we are dealing with a ValueType, we have a few
15384                  situations to deal with:
15385                 
15386                     * The target of New is a ValueType variable, that is
15387                       easy, we just pass this as the variable reference
15388                 
15389                     * The target of New is being passed as an argument,
15390                       to a boxing operation or a function that takes a
15391                       ValueType.
15392                 
15393                       In this case, we need to create a temporary variable
15394                       that is the argument of New.
15395
15396
15397 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15398
15399         * rootcontext.cs (LookupType): Check that current_type is not null before
15400         going about looking at nested types.
15401
15402         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15403         not implement the IAssignMethod interface any more.
15404
15405         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15406         where we tranform them into FieldExprs if they are being resolved from within
15407         the declaring type.
15408
15409         * ecore.cs (SimpleName.DoResolve): Do the same here.
15410
15411         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15412
15413         * ../errors/bug10.cs : Add.
15414
15415         * ../errors/cs0070.cs : Add.
15416
15417         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15418
15419         * assign.cs : Get rid of EventIsLocal everywhere.
15420
15421 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15422
15423         * ecore.cs (ConvertIntLiteral): finished the implementation.
15424
15425         * statement.cs (SwitchLabel): Convert the value we are using as a
15426         key before looking up the table.
15427
15428 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15429
15430         * codegen.cs (EmitTopBlock): Require a Location argument now.
15431
15432         * cs-parser.jay (constructor_declarator): We need to setup
15433         current_local_parameters before we parse the
15434         opt_constructor_initializer, to allow the variables to be bound
15435         to the constructor arguments.
15436
15437         * rootcontext.cs (LookupType): First lookup nested classes in our
15438         class and our parents before we go looking outside our class.
15439
15440         * expression.cs (ConstantFold): Extract/debox the values at the
15441         beginnning. 
15442
15443         * rootcontext.cs (EmitCode): Resolve the constants first before we
15444         resolve the types.  This is not really needed, but it helps debugging.
15445
15446         * statement.cs: report location.
15447
15448         * cs-parser.jay: pass location to throw statement.
15449
15450         * driver.cs: Small bug fix.
15451
15452         * report.cs: Updated format to be 4-zero filled digits.
15453
15454 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15455
15456         * expression.cs (CheckIndices): Fix minor bug where the wrong
15457         variable was being referred to ;-)
15458
15459         (DoEmit): Do not call EmitStaticInitializers when the 
15460         underlying type is System.Object.
15461
15462 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15463
15464         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15465         and do the usual workaround for SRE.
15466
15467         * class.cs (MyEventBuilder.EventType): New member to get at the type
15468         of the event, quickly.
15469
15470         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15471
15472         * assign.cs (Assign.DoResolve): Handle the case when the target
15473         is an EventExpr and perform the necessary checks.
15474
15475         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15476         interface.
15477
15478         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15479
15480         (EventExpr): Set the type in the constructor itself since we 
15481         are meant to be born fully resolved.
15482
15483         (EventExpr.Define): Revert code I wrote earlier.
15484                 
15485         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15486         instance expression is null. The instance expression is a This in that case
15487         or a null, depending on whether it is a static method or not.
15488
15489         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15490         refers to more than one method.
15491
15492         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15493         and accordingly flag errors.
15494
15495 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15496
15497         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15498
15499 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15500
15501         * location.cs (ToString): Provide useful rutine.
15502
15503 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15504
15505         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15506         objects, return the actual integral boxed.
15507
15508         * statement.cs (SwitchLabel): define an ILLabel for each
15509         SwitchLabel. 
15510
15511         (Switch.CheckSwitch): If the value is a Literal, extract
15512         the underlying literal.
15513
15514         Also in the unused hashtable we had, add the SwitchLabel so we can
15515         quickly look this value up.
15516
15517         * constant.cs: Implement a bunch of new constants.  Rewrite
15518         Literal based on this.  Made changes everywhere to adapt to this.
15519
15520         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15521         dereferencing array only once, and also copes with enumrations.
15522
15523         bytes are two bytes wide, not one.
15524
15525         (Cast): Perform constant conversions.
15526
15527         * ecore.cs (TryImplicitIntConversion): Return literals instead of
15528         wrappers to the literals here.
15529
15530         * expression.cs (DoNumericPromotions): long literals can converted
15531         to ulong implicity (this is taken care of elsewhere, but I was
15532         missing this spot).
15533
15534         * ecore.cs (Expression.Literalize): Make the return type Literal,
15535         to improve type checking.
15536
15537         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
15538
15539 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * literal.cs: Revert code from ravi that checked the bounds.  The
15542         bounds are sane by the definition of the type itself. 
15543
15544         * typemanager.cs: Fix implementation of ImplementsInterface.  We
15545         need to actually look up in our parent hierarchy for interfaces
15546         implemented. 
15547
15548         * const.cs: Use the underlying type for enumerations
15549
15550         * delegate.cs: Compute the basename for the delegate creation,
15551         that should fix the delegate test case, and restore the correct
15552         Type Lookup semantics in rootcontext
15553
15554         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
15555         referencing a nested type with the Reflection API is using the "+"
15556         sign. 
15557
15558         * cs-parser.jay: Do not require EOF token at the end.
15559
15560 2001-12-20  Ravi Pratap  <ravi@ximian.com>
15561
15562         * rootcontext.cs (LookupType): Concatenate type names with
15563         a '.' instead of a '+' The test suite passes again.
15564
15565         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
15566         field of the enumeration.
15567
15568         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
15569         the case when the member is an EventExpr.
15570
15571         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
15572         static has an associated instance expression.
15573
15574         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
15575
15576         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
15577
15578         * class.cs (Event.Define): Register event and perform appropriate checks
15579         for error #111.
15580
15581         We define the Add and Remove methods even if the use provides none because
15582         in that case, we provide default implementations ourselves.
15583
15584         Define a private field of the type of the event. This is done by the CSC compiler
15585         and we should be doing it too ;-)
15586
15587         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
15588         More methods we use in code we generate.
15589
15590         (multicast_delegate_type, delegate_type): Two separate types since the distinction
15591         is important.
15592
15593         (InitCoreTypes): Update accordingly for the above.
15594
15595         * class.cs (Event.Emit): Generate code for default accessors that we provide
15596
15597         (EmitDefaultMethod): Do the job in the above.
15598
15599         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
15600         appropriate place.
15601
15602 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
15603
15604         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
15605         builders even if we were missing one.
15606
15607         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
15608         pass the Basename as our class name instead of the Name.  The
15609         basename will be correctly composed for us.
15610
15611         * parameter.cs (Paramters): Now takes a Location argument.
15612
15613         * decl.cs (DeclSpace.LookupType): Removed convenience function and
15614         make all the code call directly LookupType in RootContext and take
15615         this chance to pass the Location information everywhere.
15616
15617         * Everywhere: pass Location information.
15618
15619 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
15620
15621         * class.cs (Constructor.Define): Updated way of detecting the
15622         length of the parameters.
15623
15624         (TypeContainer.DefineType): Use basename as the type name for
15625         nested types.
15626
15627         (TypeContainer.Define): Do not recursively define types here, as
15628         definition is taken care in order by the RootContext.
15629
15630         * tree.cs: Keep track of namespaces in a per-file basis.
15631
15632         * parameter.cs (Parameter.ComputeSignature): Update to use
15633         DeclSpace. 
15634
15635         (Parameters.GetSignature): ditto.
15636
15637         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
15638         instead of a TypeContainer.
15639
15640         (Interface.SemanticAnalysis): Use `this' instead of our parent to
15641         resolve names.  Because we need to be resolve in our context, not
15642         our parents.
15643
15644         * driver.cs: Implement response files.
15645
15646         * class.cs (TypeContainer.DefineType): If we are defined, do not
15647         redefine ourselves.
15648
15649         (Event.Emit): Emit the code for add/remove handlers.
15650         (Event.Define): Save the MethodBuilders for add/remove.
15651
15652         * typemanager.cs: Use pair here too.
15653
15654         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
15655         DictionaryEntry requires the first argument to be non-null.  
15656
15657         (enum_declaration): Compute full name for registering the
15658         enumeration.
15659
15660         (delegate_declaration): Instead of using
15661         formal_parameter_list, use opt_formal_parameter_list as the list
15662         can be empty.
15663
15664         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
15665         (EventParsing): New property that controls whether `add' and
15666         `remove' are returned as tokens or identifiers (for events);
15667
15668 2001-12-19  Ravi Pratap  <ravi@ximian.com>
15669
15670         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
15671         use MyEventBuilder only and let it wrap the real builder for us.
15672
15673         (MyEventBuilder): Revamp constructor etc.
15674
15675         Implement all operations that we perform on EventBuilder in precisely the same
15676         way here too.
15677
15678         (FindMembers): Update to use the EventBuilder member.
15679
15680         (Event.Emit): Update accordingly.
15681
15682 2001-12-18  Ravi Pratap  <ravi@ximian.com>
15683
15684         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
15685         by calling the appropriate methods.
15686
15687         (GetCustomAttributes): Make stubs as they cannot possibly do anything
15688         useful.
15689
15690         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
15691
15692 2001-12-17  Ravi Pratap  <ravi@ximian.com>
15693
15694         * delegate.cs (Delegate.Populate): Check that the return type
15695         and various parameters types are indeed accessible.
15696
15697         * class.cs (Constructor.Define): Same here.
15698
15699         (Field.Define): Ditto.
15700
15701         (Event.Define): Ditto.
15702
15703         (Operator.Define): Check that the underlying Method defined itself
15704         correctly - so it's MethodBuilder should not be null.
15705
15706         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
15707         expression happens to be null.
15708
15709         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
15710         members but as of now we don't seem to be able to do anything really useful with it.
15711
15712         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
15713         not the EventBuilder.
15714
15715 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
15716
15717         * cs-tokenizer.cs: Add support for defines.
15718         Add support for #if, #elif, #else, #endif
15719
15720         (eval_var): evaluates a variable.
15721         (eval): stubbed for evaluating functions.
15722
15723         * cs-parser.jay: Pass the defines information
15724
15725         * driver.cs: Add --define command line option.
15726
15727         * decl.cs: Move MemberCore here.
15728
15729         Make it the base class for DeclSpace.  This allows us to catch and
15730         report 108 and 109 for everything now.
15731
15732         * class.cs (TypeContainer.Define): Extract all the members
15733         before populating and emit the warning 108 (new keyword required
15734         to override) instead of having each member implement this.
15735
15736         (MemberCore.Define): New abstract method, we will be using this in
15737         the warning reporting engine in Populate.
15738
15739         (Operator.Define): Adjust to new MemberCore protocol. 
15740
15741         * const.cs (Const): This does not derive from Expression, it is a
15742         temporary object we use to create fields, it is a MemberCore. 
15743
15744         * class.cs (Method.Define): Allow the entry point to be in a
15745         specific class.
15746
15747         * driver.cs: Rewrite the argument handler to clean it up a bit.
15748
15749         * rootcontext.cs: Made it just an auxiliary namespace feature by
15750         making everything static.
15751
15752         * driver.cs: Adapt code to use RootContext type name instead of
15753         instance variable.
15754
15755         * delegate.cs: Remove RootContext argument.
15756
15757         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
15758         argument. 
15759
15760         * class.cs (Event.Define): The lookup can fail.
15761
15762         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
15763
15764         * expression.cs: Resolve the this instance before invoking the code.
15765
15766 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * cs-parser.jay: Add a production in element_access that allows
15769         the thing to become a "type" reference.  This way we can parse
15770         things like "(string [])" as a type.
15771
15772         Note that this still does not handle the more complex rules of
15773         casts. 
15774
15775
15776         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
15777
15778         * ecore.cs: (CopyNewMethods): new utility function used to
15779         assemble the list of methods from running FindMembers.
15780
15781         (MemberLookup): Rework FindMembers so that 
15782
15783 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * class.cs (TypeContainer): Remove Delegates who fail to be
15786         defined.
15787
15788         * delegate.cs (Populate): Verify that we dont get null return
15789         values.   TODO: Check for AsAccessible.
15790
15791         * cs-parser.jay: Use basename to emit error 574 (destructor should
15792         have the same name as container class), not the full name.
15793
15794         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
15795         possible representation.  
15796
15797         Also implements integer type suffixes U and L.
15798
15799 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
15800
15801         * expression.cs (ArrayCreation.DoResolve): We need to do the
15802         argument resolution *always*.
15803
15804         * decl.cs: Make this hold the namespace.  Hold the root context as
15805         well.
15806         (LookupType): Move here.
15807
15808         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
15809
15810         * location.cs (Row, Name): Fixed the code, it was always returning
15811         references to the first file.
15812
15813         * interface.cs: Register properties defined through interfaces.
15814
15815         * driver.cs: Add support for globbing on the command line
15816
15817         * class.cs (Field): Make it derive from MemberCore as well.
15818         (Event): ditto.
15819
15820 2001-12-15  Ravi Pratap  <ravi@ximian.com>
15821
15822         * class.cs (Event::Define): Check that the type of the event is a delegate
15823         type else flag error #66.
15824
15825         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
15826         same.
15827
15828         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
15829         values of EntryPoint, CharSet etc etc.
15830
15831         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
15832
15833         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
15834         be null and we should ignore this. I am not sure if this is really clean. Apparently,
15835         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
15836         which needs this to do its work.
15837
15838         * ../errors/cs0066.cs : Add.
15839
15840 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
15841
15842         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
15843         helper functions.
15844
15845         * class.cs: (MethodSignature.MethodSignature): Removed hack that
15846         clears out the parameters field.
15847         (MemberSignatureCompare): Cleanup
15848
15849         (MemberCore): New base class used to share code between MethodCore
15850         and Property.
15851
15852         (RegisterRequiredImplementations) BindingFlags.Public requires
15853         either BindingFlags.Instace or Static.  Use instance here.
15854
15855         (Property): Refactored code to cope better with the full spec.
15856
15857         * parameter.cs (GetParameterInfo): Return an empty array instead
15858         of null on error.
15859
15860         * class.cs (Property): Abstract or extern properties have no bodies.
15861
15862         * parameter.cs (GetParameterInfo): return a zero-sized array.
15863
15864         * class.cs (TypeContainer.MethodModifiersValid): Move all the
15865         method modifier validation to the typecontainer so we can reuse
15866         this on properties.
15867
15868         (MethodCore.ParameterTypes): return an empty sized array of types.
15869
15870         (Property.Define): Test property modifier validity.
15871
15872         Add tests for sealed/override too.
15873
15874         (Method.Emit): abstract or extern methods have no bodies.
15875
15876 2001-12-14  Ravi Pratap  <ravi@ximian.com>
15877
15878         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
15879         thing.
15880
15881         (Method::Define, ::Emit): Modify accordingly.
15882
15883         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
15884
15885         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
15886
15887         * makefile: Pass in /unsafe.
15888
15889 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
15890
15891         * class.cs (MakeKey): Kill routine.
15892
15893         * class.cs (TypeContainer.Define): Correctly define explicit
15894         method implementations (they require the full interface name plus
15895         the method name).
15896
15897         * typemanager.cs: Deply the PtrHashtable here and stop using the
15898         lame keys.  Things work so much better.
15899
15900         This of course broke everyone who depended on `RegisterMethod' to
15901         do the `test for existance' test.  This has to be done elsewhere.
15902
15903         * support.cs (PtrHashtable): A hashtable that avoid comparing with
15904         the object stupid Equals method (because, that like fails all over
15905         the place).  We still do not use it.
15906
15907         * class.cs (TypeContainer.SetRequiredInterface,
15908         TypeContainer.RequireMethods): Killed these two routines and moved
15909         all the functionality to RegisterRequiredImplementations.
15910
15911         (TypeContainer.RegisterRequiredImplementations): This routine now
15912         registers all the implementations required in an array for the
15913         interfaces and abstract methods.  We use an array of structures
15914         which can be computed ahead of time to reduce memory usage and we
15915         also assume that lookups are cheap as most classes will not
15916         implement too many interfaces.
15917
15918         We also avoid creating too many MethodSignatures.
15919
15920         (TypeContainer.IsInterfaceMethod): Update and optionally does not
15921         clear the "pending" bit if we find that there are problems with
15922         the declaration.
15923
15924         (TypeContainer.VerifyPendingMethods): Update to report errors of
15925         methods that look like implementations but are not.
15926
15927         (TypeContainer.Define): Add support for explicit interface method
15928         implementation. 
15929
15930 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
15931
15932         * typemanager.cs: Keep track of the parameters here instead of
15933         being a feature of the TypeContainer.
15934
15935         * class.cs: Drop the registration of parameters here, as
15936         InterfaceMethods are also interface declarations.
15937
15938         * delegate.cs: Register methods with the TypeManager not only with
15939         the TypeContainer.  This code was buggy.
15940
15941         * interface.cs: Full registation here.
15942
15943 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
15944
15945         * expression.cs: Remove reducer for binary expressions, it can not
15946         be done this way.
15947
15948         * const.cs: Put here the code that used to go into constant.cs
15949
15950         * constant.cs: Put here the code for constants, this is a new base
15951         class for Literals.
15952
15953         * literal.cs: Make Literal derive from Constant.
15954
15955 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
15956
15957         * statement.cs (Return.Emit): Report error 157 if the user
15958         attempts to return from a finally block.
15959
15960         (Return.Emit): Instead of emitting a return, jump to the end of
15961         the function.
15962
15963         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
15964         LocalBuilder to store the result of the function.  ReturnLabel is
15965         the target where we jump.
15966
15967
15968 2001-12-09  Radek Doulik  <rodo@ximian.com>
15969
15970         * cs-parser.jay: remember alias in current namespace
15971
15972         * ecore.cs (SimpleName::DoResolve): use aliases for types or
15973         namespaces
15974
15975         * class.cs (LookupAlias): lookup alias in my_namespace
15976
15977         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
15978         aliases hashtable
15979         (LookupAlias): lookup alias in this and if needed in parent
15980         namespaces
15981
15982 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
15983
15984         * support.cs: 
15985
15986         * rootcontext.cs: (ModuleBuilder) Made static, first step into
15987         making things static.  I need this to avoid passing the
15988         TypeContainer when calling ParameterType.
15989
15990         * support.cs (InternalParameters.ParameterType): Remove ugly hack
15991         that did string manipulation to compute the type and then call
15992         GetType.  Use Parameter.ParameterType instead.
15993
15994         * cs-tokenizer.cs: Consume the suffix for floating values.
15995
15996         * expression.cs (ParameterReference): figure out whether this is a
15997         reference parameter or not.  Kill an extra variable by computing
15998         the arg_idx during emission.
15999
16000         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16001         function that returns whether a parameter is an out/ref value or not.
16002
16003         (Parameter.ParameterType): The type of the parameter (base,
16004         without ref/out applied).
16005
16006         (Parameter.Resolve): Perform resolution here.
16007         (Parameter.ExternalType): The full type (with ref/out applied).
16008
16009         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16010         support for expressions on the using statement.
16011
16012 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * statement.cs (Using.EmitLocalVariableDecls): Split the
16015         localvariable handling of the using statement.
16016
16017         (Block.EmitMeta): Keep track of variable count across blocks.  We
16018         were reusing slots on separate branches of blocks.
16019
16020         (Try.Emit): Emit the general code block, we were not emitting it. 
16021
16022         Check the type of the declaration to be an IDisposable or
16023         something that can be implicity converted to it. 
16024
16025         Emit conversions if required.
16026
16027         * ecore.cs (EmptyExpression): New utility class.
16028         (Expression.ImplicitConversionExists): New utility function.
16029
16030 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16031
16032         * statement.cs (Using): Implement.
16033
16034         * expression.cs (LocalVariableReference): Support read only variables.
16035
16036         * statement.cs: Remove the explicit emit for the Leave opcode.
16037         (VariableInfo): Add a readonly field.
16038
16039 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16040
16041         * ecore.cs (ConvCast): new class used to encapsulate the various
16042         explicit integer conversions that works in both checked and
16043         unchecked contexts.
16044
16045         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16046         properly generate the overflow opcodes.
16047
16048 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16049
16050         * statement.cs: The correct type for the EmptyExpression is the
16051         element_type, not the variable type.  Ravi pointed this out.
16052
16053 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16054
16055         * class.cs (Method::Define): Handle PInvoke methods specially
16056         by using DefinePInvokeMethod instead of the usual one.
16057
16058         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16059         above to do the task of extracting information and defining the method.
16060
16061 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16062
16063         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16064         of the condition for string type.
16065
16066         (Emit): Move that here. 
16067
16068         (ArrayCreation::CheckIndices): Keep string literals in their expression
16069         form.
16070
16071         (EmitDynamicInitializers): Handle strings appropriately.
16072
16073 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16074
16075         * codegen.cs (EmitContext): Replace multiple variables with a
16076         single pointer to the current Switch statement.
16077
16078         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16079         EmitContext.
16080
16081 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16082
16083         * statement.cs 
16084
16085         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16086         default'.
16087
16088         (Foreach.Emit): Foreach on arrays was not setting
16089         up the loop variables (for break/continue).
16090
16091         (GotoCase): Semi-implented.
16092
16093 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16094
16095         * attribute.cs (CheckAttribute): Handle system attributes by using
16096         Attribute.GetAttributes to examine information we need.
16097
16098         (GetValidPlaces): Same here.
16099
16100         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16101
16102         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16103
16104         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16105
16106         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16107
16108         (Method::Emit): Handle the case when we are a PInvoke method.
16109
16110 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16111
16112         * expression.cs: Use ResolveWithSimpleName on compound names.
16113
16114 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16115
16116         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16117         before trying to reduce it.
16118
16119         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16120
16121         * constant.cs (LookupConstantValue): Implement.
16122
16123         (EmitConstant): Use the above in emitting the constant.
16124
16125         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16126         that are user-defined by doing a LookupConstantValue on them.
16127
16128         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16129         too, like above.
16130
16131 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16132
16133         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16134
16135         (BaseAccess.DoResolve): Implement.
16136
16137         (MemberAccess.DoResolve): Split this routine into a
16138         ResolveMemberAccess routine that can be used independently
16139
16140 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16143         As that share bits of the implementation.  Is returns a boolean,
16144         while As returns the Type that is being probed.
16145
16146 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16147
16148         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16149         instead of a Literal - much easier.
16150
16151         (EnumInTransit): Remove - utterly useless :-)
16152
16153         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16154
16155         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16156
16157         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16158         chain when we have no associated expression.
16159
16160 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16161
16162         * constant.cs (Define): Use Location while reporting the errror.
16163
16164         Also emit a warning when 'new' is used and there is no inherited
16165         member to hide.
16166
16167         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16168         populated.
16169
16170         (LookupEnumValue): Implement to lookup an enum member's value and define it
16171         if necessary.
16172
16173         (Populate): Re-write accordingly to use the above routine.
16174
16175 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16176
16177         * expression.cs (This): Fix prototype for DoResolveLValue to
16178         override the base class DoResolveLValue.
16179
16180         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16181         declarations) 
16182
16183         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16184         (we need to load the address of the field here).  This fixes
16185         test-22. 
16186
16187         (FieldExpr.DoResolveLValue): Call the DoResolve
16188         function to initialize the Instance expression.
16189
16190         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16191         correctly the GetEnumerator operation on a value type.
16192
16193         * cs-parser.jay: Add more simple parsing error catches.
16194
16195         * statement.cs (Switch): Add support for string switches.
16196         Handle null specially.
16197
16198         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16199
16200 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16201
16202         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16203
16204         (declare_local_constant): New helper function.
16205
16206         * statement.cs (AddConstant): Keep a separate record of constants
16207
16208         (IsConstant): Implement to determine if a variable is a constant.
16209
16210         (GetConstantExpression): Implement.
16211
16212         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16213
16214         * statement.cs (IsVariableDefined): Re-write.
16215
16216 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16217
16218         * class.cs (TypeContainer::FindMembers): Look for constants
16219         in the case when we are looking for MemberTypes.Field
16220
16221         * expression.cs (MemberAccess::DoResolve): Check that in the
16222         case we are a FieldExpr and a Literal, we are not being accessed
16223         by an instance reference.
16224
16225         * cs-parser.jay (local_constant_declaration): Implement.
16226
16227         (declaration_statement): Implement for constant declarations.
16228
16229 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16230
16231         * statement.cs (Switch): Catch double defaults.
16232
16233         (Switch): More work on the switch() statement
16234         implementation.  It works for integral values now, need to finish
16235         string support.
16236
16237
16238 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16239
16240         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16241         integer literals into other integer literals.  To be used by
16242         switch. 
16243
16244 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16245
16246         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16247         some memory.
16248
16249         (EmitDynamicInitializers): Cope with the above since we extract data
16250         directly from ArrayData now.
16251
16252         (ExpectInitializers): Keep track of whether initializers are mandatory
16253         or not.
16254
16255         (Bounds): Make it a hashtable to prevent the same dimension being 
16256         recorded for every element in that dimension.
16257
16258         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16259         from being found.
16260
16261         Also fix bug which was causing the indices to be emitted in the reverse
16262         order.
16263
16264 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16265
16266         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16267         unfinished.  They do not work, because the underlying code is
16268         sloppy.
16269
16270 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16271
16272         * cs-parser.jay: Remove bogus fixme.
16273
16274         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16275         on Switch statement.
16276
16277 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16278
16279         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16280         the same. 
16281
16282         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16283         parameter. Apparently, any expression is allowed. 
16284
16285         (ValidateInitializers): Update accordingly.
16286
16287         (CheckIndices): Fix some tricky bugs thanks to recursion.
16288
16289         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16290         I was being completely brain-dead.
16291
16292         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16293         and re-write acordingly.
16294
16295         (DelegateInvocation): Re-write accordingly.
16296
16297         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16298
16299         (MakeByteBlob): Handle types more correctly.
16300
16301         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16302         initialization from expressions but it is incomplete because I am a complete
16303         Dodo :-|
16304
16305 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16306
16307         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16308         on If.  Basically, we have to return `true' (ie, we do return to
16309         our caller) only if both branches of the if return.
16310
16311         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16312         short-circuit operators, handle them as short circuit operators. 
16313
16314         (Cast.DoResolve): Resolve type.
16315         (Cast.Cast): Take an expression as the target type.
16316
16317         * cs-parser.jay (cast_expression): Remove old hack that only
16318         allowed a limited set of types to be handled.  Now we take a
16319         unary_expression and we resolve to a type during semantic
16320         analysis.
16321
16322         Use the grammar productions from Rhys to handle casts (this is
16323         not complete like Rhys syntax yet, we fail to handle that corner
16324         case that C# has regarding (-x), but we will get there.
16325
16326 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16327
16328         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16329         field which is an array type.
16330
16331         * cs-parser.jay (declare_local_variables): Support array initialization too.
16332
16333         * typemanager.cs (MakeKey): Implement.
16334
16335         (everywhere): Use the above appropriately.
16336
16337         * cs-parser.jay (for_statement): Update for array initialization while
16338         declaring variables.
16339
16340         * ecore.cs : The error message was correct, it's the variable's names that
16341         were misleading ;-) Make the code more readable.
16342
16343         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16344         the correct type etc.
16345
16346         (ConvertExplicit): Handle Enum types by examining the underlying type.
16347
16348 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16349
16350         * parameter.cs (GetCallingConvention): Always return
16351         CallingConventions.Standard for now.
16352
16353 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16354
16355         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16356         and `r' after calling DoNumericPromotions.
16357
16358         * ecore.cs: Fix error message (the types were in the wrong order).
16359
16360         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16361         BindingFlags.Instance as well 
16362
16363         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16364         implicit int literal conversion in an empty cast so that we
16365         propagate the right type upstream.
16366
16367         (UnboxCast): new class used to unbox value types.
16368         (Expression.ConvertExplicit): Add explicit type conversions done
16369         by unboxing.
16370
16371         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16372         the target type before applying the implicit LongLiterals to ULong
16373         literal cast.
16374
16375 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16376
16377         * cs-parser.jay (for_statement): Reworked the way For works: now
16378         we declare manually any variables that are introduced in
16379         for_initializer to solve the problem of having out-of-band code
16380         emition (that is what got for broken).
16381
16382         (declaration_statement): Perform the actual variable declaration
16383         that used to be done in local_variable_declaration here.
16384
16385         (local_variable_declaration): Do not declare anything, just pass
16386         the information on a DictionaryEntry
16387
16388 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16389
16390         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16391         re-write of the logic to now make it recursive.
16392
16393         (UpdateIndices): Re-write accordingly.
16394
16395         Store element data in a separate ArrayData list in the above methods.
16396
16397         (MakeByteBlob): Implement to dump the array data into a byte array.
16398
16399 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16400
16401         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16402         into CheckIndices.
16403
16404         * constant.cs (Define): Implement.
16405
16406         (EmitConstant): Re-write fully.
16407
16408         Pass in location info.
16409
16410         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16411         respectively.
16412
16413         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16414         DictionaryEntry since we need location info too.
16415
16416         (constant_declaration): Update accordingly.
16417
16418         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16419         code into another method : UpdateIndices.
16420
16421 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16422
16423         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16424         some type checking etc.
16425
16426 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16427
16428         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16429         bits to provide dimension info if the user skips doing that.
16430
16431         Update second constructor to store the rank correctly.
16432
16433 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16434
16435         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16436         and try to implement.
16437
16438         * ../errors/cs0150.cs : Add.
16439
16440         * ../errors/cs0178.cs : Add.
16441
16442 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16443
16444         * statement.cs: Implement foreach on multi-dimensional arrays. 
16445
16446         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16447         name of the params argument.
16448
16449         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16450         initializing the array.
16451
16452         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16453         we can use this elsewhere.
16454
16455         * statement.cs: Finish implementation of foreach for single
16456         dimension arrays.
16457
16458         * cs-parser.jay: Use an out-of-band stack to pass information
16459         around, I wonder why I need this.
16460
16461         foreach_block: Make the new foreach_block the current_block.
16462
16463         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16464         function used to return a static Parameters structure.  Used for
16465         empty parameters, as those are created very frequently.
16466
16467         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16468
16469 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16470
16471         * interface.cs : Default modifier is private, not public. The
16472         make verify test passes again.
16473
16474 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16475
16476         * support.cs (ReflectionParameters): Fix logic to determine
16477         whether the last parameter is a params one. Test 9 passes again.
16478
16479         * delegate.cs (Populate): Register the builders we define with
16480         RegisterParameterForBuilder. Test 19 passes again.
16481
16482         * cs-parser.jay (property_declaration): Reference $6 instead
16483         of $$ to get at the location.
16484
16485         (indexer_declaration): Similar stuff.
16486
16487         (attribute): Ditto.
16488
16489         * class.cs (Property): Register parameters for the Get and Set methods
16490         if they exist. Test 23 passes again.
16491
16492         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16493         call to EmitArguments as we are sure there aren't any params arguments. 
16494         Test 32 passes again.
16495
16496         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16497         IndexOutOfRangeException. 
16498
16499         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16500         Test 33 now passes again.
16501
16502 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16503
16504         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16505         broke a bunch of things.  Will have to come up with a better way
16506         of tracking locations.
16507
16508         * statement.cs: Implemented foreach for single dimension arrays.
16509
16510 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16511
16512         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16513         an error.  This removes the lookup from the critical path.
16514
16515         * cs-parser.jay: Removed use of temporary_loc, which is completely
16516         broken. 
16517
16518 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16519
16520         * support.cs (ReflectionParameters.ParameterModifier): Report
16521         whether the argument is a PARAMS argument or not.
16522
16523         * class.cs: Set the attribute `ParamArrayAttribute' on the
16524         parameter argument.
16525
16526         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16527         and cons_param_array_attribute (ConstructorInfo for
16528         ParamArrayAttribute)., 
16529
16530         * codegen.cs: Emit the return using the `Return' statement, that
16531         way we can report the error correctly for missing return values. 
16532
16533         * class.cs (Method.Emit): Clean up.
16534
16535         * expression.cs (Argument.Resolve): Take another argument: the
16536         location where this argument is used.  Notice that this is not
16537         part of the "Argument" class as to reduce the size of the
16538         structure (we know the approximate location anyways).
16539
16540         Test if the argument is a variable-reference, if not, then
16541         complain with a 206.
16542
16543         (Argument.Emit): Emit addresses of variables.
16544
16545         (Argument.FullDesc): Simplify.
16546
16547         (Invocation.DoResolve): Update for Argument.Resolve.
16548
16549         (ElementAccess.DoResolve): ditto.
16550
16551         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
16552         method should be virtual, as this method is always virtual.
16553
16554         (NewDelegate.DoResolve): Update for Argument.Resolve.
16555
16556         * class.cs (ConstructorInitializer.DoResolve): ditto.
16557
16558         * attribute.cs (Attribute.Resolve): ditto.
16559
16560 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
16561
16562         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
16563
16564         * expression.cs (ParameterReference): Drop IStackStorage and implement
16565         IAssignMethod instead. 
16566
16567         (LocalVariableReference): ditto.
16568
16569         * ecore.cs (FieldExpr): Drop IStackStorage and implement
16570         IAssignMethod instead. 
16571
16572 2001-11-13  Miguel de Icaza <miguel@ximian.com>
16573
16574         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
16575         enumerations that are used in heavily used structures derive from
16576         byte in a laughable and pathetic attempt to reduce memory usage.
16577         This is the kind of pre-optimzations that you should not do at
16578         home without adult supervision.
16579
16580         * expression.cs (UnaryMutator): New class, used to handle ++ and
16581         -- separatedly from the other unary operators.  Cleans up the
16582         code, and kills the ExpressionStatement dependency in Unary.
16583
16584         (Unary): Removed `method' and `Arguments' from this class, making
16585         it smaller, and moving it all to SimpleCall, so I can reuse this
16586         code in other locations and avoid creating a lot of transient data
16587         strucutres when not required.
16588
16589         * cs-parser.jay: Adjust for new changes.
16590
16591 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
16592
16593         * enum.cs (Enum.Populate): If there is a failure during
16594         definition, return
16595
16596         * cs-parser.jay (opt_enum_base): we used to catch type errors
16597         here, but this is really incorrect.  The type error should be
16598         catched during semantic analysis.
16599
16600 2001-12-11  Ravi Pratap  <ravi@ximian.com>
16601
16602         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
16603         current_local_parameters as expected since I, in my stupidity, had forgotten
16604         to do this :-)
16605
16606         * attribute.cs (GetValidPlaces): Fix stupid bug.
16607
16608         * class.cs (Method::Emit): Perform check on applicability of attributes.
16609
16610         (Constructor::Emit): Ditto.
16611
16612         (Field::Emit): Ditto.
16613
16614         (Field.Location): Store location information.
16615
16616         (Property, Event, Indexer, Operator): Ditto.
16617
16618         * cs-parser.jay (field_declaration): Pass in location for each field.
16619
16620         * ../errors/cs0592.cs : Add.
16621
16622 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16623
16624         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
16625
16626         (InitCoreTypes): Update accordingly.
16627
16628         (RegisterAttrType, LookupAttr): Implement.
16629
16630         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
16631         info about the same.
16632
16633         (Resolve): Update to populate the above as necessary.
16634
16635         (Error592): Helper.
16636
16637         (GetValidPlaces): Helper to the above.
16638
16639         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
16640
16641         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
16642
16643 2001-11-12  Ravi Pratap  <ravi@ximian.com>
16644
16645         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
16646
16647         * ../errors/cs0617.cs : Add.
16648
16649 2001-11-11  Ravi Pratap  <ravi@ximian.com>
16650
16651         * enum.cs (Emit): Rename to Populate to be more consistent with what
16652         we expect it to do and when exactly it is called.
16653
16654         * class.cs, rootcontext.cs : Update accordingly.
16655
16656         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
16657         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
16658
16659         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
16660
16661         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
16662         of a fieldinfo using the above, when dealing with a FieldBuilder.
16663
16664 2001-11-10  Ravi Pratap  <ravi@ximian.com>
16665
16666         * ../errors/cs0031.cs : Add.
16667
16668         * ../errors/cs1008.cs : Add.
16669
16670         * ../errrors/cs0543.cs : Add.
16671
16672         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
16673         enum type.
16674
16675         (FindMembers): Implement.
16676
16677         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
16678         enums and delegates too.
16679
16680         (enum_types): Rename to builder_to_enum.
16681
16682         (delegate_types): Rename to builder_to_delegate.
16683
16684         * delegate.cs (FindMembers): Implement.
16685
16686 2001-11-09  Ravi Pratap  <ravi@ximian.com>
16687
16688         * typemanager.cs (IsEnumType): Implement.
16689
16690         * enum.cs (Emit): Re-write parts to account for the underlying type
16691         better and perform checking etc.
16692
16693         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
16694         of the underlying type.
16695
16696         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
16697         value
16698
16699         * enum.cs (error31): Helper to report error #31.
16700
16701         * cs-parser.jay (enum_declaration): Store location of each member too.
16702
16703         * enum.cs (member_to_location): New hashtable. 
16704
16705         (AddEnumMember): Update location hashtable.
16706
16707         (Emit): Use the location of each member while reporting errors.
16708
16709 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16710
16711         * cs-parser.jay: A for_initializer if is a
16712         local_variable_declaration really ammount to have an implicit
16713         block with the variable declaration and no initializer for for.
16714
16715         * statement.cs (For.Emit): Cope with null initializers.
16716
16717         This fixes the infinite loop on for initializers.
16718
16719 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
16720
16721         * enum.cs: More cleanup.
16722
16723         * ecore.cs: Remove dead code.
16724
16725         * class.cs (Property.Emit): More simplification.
16726         (Event.Emit): ditto.
16727
16728         Reworked to have less levels of indentation.
16729
16730 2001-11-08  Ravi Pratap  <ravi@ximian.com>
16731
16732         * class.cs (Property): Emit attributes.
16733
16734         (Field): Ditto.
16735
16736         (Event): Ditto.
16737
16738         (Indexer): Ditto.
16739
16740         (Operator): Ditto.
16741
16742         * enum.cs (Emit): Ditto.
16743
16744         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
16745         Enums too.
16746
16747         * class.cs (Field, Event, etc.): Move attribute generation into the
16748         Emit method everywhere.
16749
16750         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
16751         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
16752         as we had no way of defining nested enums !
16753
16754         * rootcontext.cs : Adjust code accordingly.
16755
16756         * typemanager.cs (AddEnumType): To keep track of enum types separately.
16757
16758 2001-11-07  Ravi Pratap  <ravi@ximian.com>
16759
16760         * expression.cs (EvalConstantExpression): Move into ecore.cs
16761
16762         * enum.cs (Enum): Rename some members and make them public and readonly
16763         according to our convention.
16764
16765         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
16766         nothing else.
16767
16768         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
16769
16770         (Enum::Emit): Write a simple version for now which doesn't try to compute
16771         expressions. I shall modify this to be more robust in just a while.
16772
16773         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
16774
16775         (TypeContainer::CloseType): Create the Enum types too.
16776
16777         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
16778
16779         * expression.cs (EvalConstantExpression): Get rid of completely.
16780
16781         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
16782         user-defined values and other cases.
16783
16784         (IsValidEnumLiteral): Helper function.
16785
16786         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
16787         out there in the case we had a literal FieldExpr.
16788
16789         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
16790
16791         (Literalize): Revamp a bit to take two arguments.
16792
16793         (EnumLiteral): New class which derives from Literal to wrap enum literals.
16794
16795 2001-11-06  Ravi Pratap  <ravi@ximian.com>
16796
16797         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
16798
16799         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
16800
16801         (Resolve): Use the above to ensure we have proper initializers.
16802
16803 2001-11-05  Ravi Pratap  <ravi@ximian.com>
16804
16805         * expression.cs (Expression::EvalConstantExpression): New method to 
16806         evaluate constant expressions.
16807
16808         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
16809
16810 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
16811
16812         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
16813         in an array.
16814
16815         (Binary.ResolveOperator): Handle operator != (object a, object b)
16816         and operator == (object a, object b);
16817
16818         (Binary.DoNumericPromotions): Indicate whether the numeric
16819         promotion was possible.
16820
16821         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
16822         Implement.  
16823
16824         Made the ArrayAccess implement interface IAssignMethod instead of
16825         IStackStore as the order in which arguments are passed reflects
16826         this.
16827
16828         * assign.cs: Instead of using expr.ExprClass to select the way of
16829         assinging, probe for the IStackStore/IAssignMethod interfaces.
16830
16831         * typemanager.cs: Load InitializeArray definition.
16832
16833         * rootcontext.cs (RootContext.MakeStaticData): Used to define
16834         static data that can be used to initialize arrays. 
16835
16836 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
16837
16838         * expression.cs: Handle operator== and operator!= for booleans.
16839
16840         (Conditioal.Reduce): Implement reducer for the ?: operator.
16841
16842         (Conditional.Resolve): Implement dead code elimination.
16843
16844         (Binary.Resolve): Catch string literals and return a new
16845         concatenated string.
16846
16847         (Unary.Reduce): Implement reduction of unary expressions.
16848
16849         * ecore.cs: Split out the expression core handling here.
16850
16851         (Expression.Reduce): New method used to perform constant folding
16852         and CSE.  This is needed to support constant-expressions. 
16853
16854         * statement.cs (Statement.EmitBoolExpression): Pass true and false
16855         targets, and optimize for !x.
16856
16857 2001-11-04  Ravi Pratap  <ravi@ximian.com>
16858
16859         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
16860         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
16861         set custom atttributes.
16862
16863         * literal.cs (Literal::GetValue): New abstract method to return the actual
16864         value of the literal, cast as an object.
16865
16866         (*Literal): Implement GetValue method.
16867
16868         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
16869         expressions to the arraylist but objects of type Argument.
16870
16871         * class.cs (TypeContainer::Emit): Emit our attributes too.
16872
16873         (Method::Emit, Constructor::Emit): Ditto.
16874
16875         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
16876         to be ignoring earlier.
16877
16878 2001-11-03  Ravi Pratap  <ravi@ximian.com>
16879
16880         * attribute.cs (AttributeSection::Define): Implement to do the business
16881         of constructing a CustomAttributeBuilder.
16882
16883         (Attribute): New trivial class. Increases readability of code.  
16884
16885         * cs-parser.jay : Update accordingly.
16886
16887         (positional_argument_list, named_argument_list, named_argument): New rules
16888
16889         (attribute_arguments): Use the above so that we are more correct.
16890
16891 2001-11-02  Ravi Pratap  <ravi@ximian.com>
16892
16893         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
16894         to perform all checks for a method with a params parameter.
16895
16896         (Invocation::OverloadResolve): Update to use the above method and therefore
16897         cope correctly with params method invocations.
16898
16899         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
16900         params too.
16901
16902         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
16903         constructors in our parent too because we can't afford to miss out on 
16904         protected ones ;-)
16905
16906         * attribute.cs (AttributeSection): New name for the class Attribute
16907
16908         Other trivial changes to improve readability.
16909
16910         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
16911         use the new class names.
16912
16913 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16914
16915         * class.cs (Method::Define): Complete definition for params types too
16916
16917         (Indexer::Define): Ditto.
16918
16919         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
16920         Cope everywhere with a request for info about the array parameter.
16921
16922 2001-11-01  Ravi Pratap  <ravi@ximian.com>
16923
16924         * tree.cs (RecordNamespace): Fix up to check for the correct key.
16925
16926         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
16927         local_variable_type to extract the string corresponding to the type.
16928
16929         (local_variable_type): Fixup the action to use the new helper method.
16930
16931         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
16932         go.
16933
16934         * expression.cs : Clean out code which uses the above.
16935
16936 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16937
16938         * typemanager.cs (RegisterMethod): Check if we already have an existing key
16939         and bale out if necessary by returning a false.
16940
16941         (RegisterProperty): Ditto.
16942
16943         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
16944         and print out appropriate error messages.
16945
16946         * interface.cs (everywhere): Ditto.
16947
16948         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
16949         location to constructor.
16950
16951         * class.cs (Property, Event, Indexer): Update accordingly.
16952
16953         * ../errors/cs111.cs : Added.
16954
16955         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
16956         of a method, as laid down by the spec.
16957
16958         (Invocation::OverloadResolve): Use the above method.
16959
16960 2001-10-31  Ravi Pratap  <ravi@ximian.com>
16961
16962         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
16963         now take a TypeContainer and a Parameters object.
16964
16965         (ParameterData): Modify return type of ParameterModifier method to be 
16966         Parameter.Modifier and not a string.
16967
16968         (ReflectionParameters, InternalParameters): Update accordingly.
16969
16970         * expression.cs (Argument::GetParameterModifier): Same here.
16971
16972         * support.cs (InternalParameters::ParameterType): Find a better way of determining
16973         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
16974         symbol in it at all so maybe this is only for now.
16975
16976 2001-10-30  Ravi Pratap  <ravi@ximian.com>
16977
16978         * support.cs (InternalParameters): Constructor now takes an extra argument 
16979         which is the actual Parameters class.
16980
16981         (ParameterDesc): Update to provide info on ref/out modifiers.
16982
16983         * class.cs (everywhere): Update call to InternalParameters to pass in
16984         the second argument too.
16985
16986         * support.cs (ParameterData): Add ParameterModifier, which is a method 
16987         to return the modifier info [ref/out etc]
16988
16989         (InternalParameters, ReflectionParameters): Implement the above.
16990
16991         * expression.cs (Argument::ParameterModifier): Similar function to return
16992         info about the argument's modifiers.
16993
16994         (Invocation::OverloadResolve): Update to take into account matching modifiers 
16995         too.
16996
16997         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
16998         a new SetFormalParameters object which we pass to InternalParameters.
16999
17000 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17001
17002         * expression.cs (NewArray): Merge into the ArrayCreation class.
17003
17004 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17005
17006         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17007         NewUserdefinedArray into one as there wasn't much of a use in having
17008         two separate ones.
17009
17010         * expression.cs (Argument): Change field's name to ArgType from Type.
17011
17012         (Type): New readonly property which returns the proper type, taking into 
17013         account ref/out modifiers.
17014
17015         (everywhere): Adjust code accordingly for the above.
17016
17017         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17018         whether we are emitting for a ref or out parameter.
17019
17020         * expression.cs (Argument::Emit): Use the above field to set the state.
17021
17022         (LocalVariableReference::Emit): Update to honour the flag and emit the
17023         right stuff.
17024
17025         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17026
17027         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17028
17029         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17030
17031         (ReflectionParameters, InternalParameters): Implement the above method.
17032
17033         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17034         reporting errors.
17035
17036         (Invocation::FullMethodDesc): Ditto. 
17037
17038 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * cs-parser.jay: Add extra production for the second form of array
17041         creation. 
17042
17043         * expression.cs (ArrayCreation): Update to reflect the above
17044         change. 
17045
17046         * Small changes to prepare for Array initialization.
17047
17048 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * typemanager.cs (ImplementsInterface): interface might be null;
17051         Deal with this problem;
17052
17053         Also, we do store negative hits on the cache (null values), so use
17054         this instead of calling t.GetInterfaces on the type everytime.
17055
17056 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17057
17058         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17059
17060         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17061         split functionality out into different classes.
17062
17063         (New::FormArrayType): Move into NewBuiltinArray.
17064
17065         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17066         quite useless.
17067
17068         (NewBuiltinArray): New class to handle creation of built-in arrays.
17069
17070         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17071         account creation of one-dimensional arrays.
17072
17073         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17074
17075         (NewUserdefinedArray::DoResolve): Implement.
17076
17077         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17078
17079         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17080         we maintain inside the TypeManager. This is necessary to perform lookups on the
17081         module builder.
17082
17083         (LookupType): Update to perform GetType on the module builders too.     
17084
17085         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17086
17087         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17088
17089 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17090
17091         * expression.cs (New::DoResolve): Implement guts of array creation.
17092
17093         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17094
17095 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17096
17097         * expression.cs: Fix bug I introduced lsat night that broke
17098         Delegates. 
17099
17100         (Expression.Resolve): Report a 246 error (can not resolve name)
17101         if we find a SimpleName in the stream.
17102
17103         (Expression.ResolveLValue): Ditto.
17104
17105         (Expression.ResolveWithSimpleName): This function is a variant of
17106         ResolveName, this one allows SimpleNames to be returned without a
17107         warning.  The only consumer of SimpleNames is MemberAccess
17108
17109 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17110
17111         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17112         might arrive here.  I have my doubts that this is correct.
17113
17114         * statement.cs (Lock): Implement lock statement.
17115
17116         * cs-parser.jay: Small fixes to support `lock' and `using'
17117
17118         * cs-tokenizer.cs: Remove extra space
17119
17120         * driver.cs: New flag --checked, allows to turn on integer math
17121         checking. 
17122
17123         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17124         Threading.Monitor.Exit 
17125
17126 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17127
17128         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17129         Expression Class to be IndexerAccess.
17130
17131         Notice that Indexer::DoResolve sets the eclass to Value.
17132
17133 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17134
17135         * class.cs (TypeContainer::Emit): Emit code for indexers.
17136
17137         * assign.cs (IAssignMethod): New interface implemented by Indexers
17138         and Properties for handling assignment.
17139
17140         (Assign::Emit): Simplify and reuse code. 
17141
17142         * expression.cs (IndexerAccess, PropertyExpr): Implement
17143         IAssignMethod, clean up old code. 
17144
17145 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17146
17147         * typemanager.cs (ImplementsInterface): New method to determine if a type
17148         implements a given interface. Provides a nice cache too.
17149
17150         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17151         method.
17152
17153         (ConvertReferenceExplicit): Ditto.
17154
17155         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17156         various methods, with correct names etc.
17157
17158         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17159         Operator.UnaryNegation.
17160
17161         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17162         we have a unary plus or minus operator.
17163
17164         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17165         UnaryMinus.
17166
17167         * everywhere : update accordingly.
17168
17169         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17170         respectively.
17171
17172         * class.cs (Method::Define): For the case where we are implementing a method
17173         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17174         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17175
17176 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17177
17178         * interface.cs (FindMembers): Implement to work around S.R.E
17179         lameness.
17180
17181         * typemanager.cs (IsInterfaceType): Implement.
17182
17183         (FindMembers): Update to handle interface types too.
17184
17185         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17186         use IsAssignableFrom as that is not correct - it doesn't work.
17187
17188         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17189         and accordingly override EmitStatement.
17190
17191         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17192         using the correct logic :-)
17193
17194 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17195
17196         * ../errors/cs-11.cs : Add to demonstrate error -11 
17197
17198 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17199
17200         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17201         then pass this as a hint to ResolveLValue.
17202
17203         * expression.cs (FieldExpr): Add Location information
17204
17205         (FieldExpr::LValueResolve): Report assignment to readonly
17206         variable. 
17207
17208         (Expression::ExprClassFromMemberInfo): Pass location information.
17209
17210         (Expression::ResolveLValue): Add new method that resolves an
17211         LValue. 
17212
17213         (Expression::DoResolveLValue): Default invocation calls
17214         DoResolve. 
17215
17216         (Indexers): New class used to keep track of indexers in a given
17217         Type. 
17218
17219         (IStackStore): Renamed from LValue, as it did not really describe
17220         what this did.  Also ResolveLValue is gone from this interface and
17221         now is part of Expression.
17222
17223         (ElementAccess): Depending on the element access type
17224
17225         * typemanager.cs: Add `indexer_name_type' as a Core type
17226         (System.Runtime.CompilerServices.IndexerNameAttribute)
17227
17228         * statement.cs (Goto): Take a location.
17229
17230 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17231
17232         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17233         if two delegates are compatible.
17234
17235         (NewDelegate::DoResolve): Update to take care of the case when
17236         we instantiate a delegate from another delegate.
17237
17238         * typemanager.cs (FindMembers): Don't even try to look up members
17239         of Delegate types for now.
17240
17241 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17242
17243         * delegate.cs (NewDelegate): New class to take care of delegate
17244         instantiation.
17245
17246         * expression.cs (New): Split the delegate related code out into 
17247         the NewDelegate class.
17248
17249         * delegate.cs (DelegateInvocation): New class to handle delegate 
17250         invocation.
17251
17252         * expression.cs (Invocation): Split out delegate related code into
17253         the DelegateInvocation class.
17254
17255 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17256
17257         * expression.cs (New::DoResolve): Implement delegate creation fully
17258         and according to the spec.
17259
17260         (New::DoEmit): Update to handle delegates differently.
17261
17262         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17263         because of which we were printing out arguments in reverse order !
17264
17265         * delegate.cs (VerifyMethod): Implement to check if the given method
17266         matches the delegate.
17267
17268         (FullDelegateDesc): Implement.
17269
17270         (VerifyApplicability): Implement.
17271
17272         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17273         delegate invocations too.
17274
17275         (Invocation::Emit): Ditto.
17276
17277         * ../errors/cs1593.cs : Added.
17278
17279         * ../errors/cs1594.cs : Added.
17280
17281         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17282
17283 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17284
17285         * typemanager.cs (intptr_type): Core type for System.IntPtr
17286
17287         (InitCoreTypes): Update for the same.
17288
17289         (iasyncresult_type, asynccallback_type): Ditto.
17290
17291         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17292         correct.
17293
17294         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17295         too.
17296
17297         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17298         the builders for the 4 members of a delegate type :-)
17299
17300         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17301         type.
17302
17303         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17304
17305         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17306
17307 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17308
17309         * statement.cs (Break::Emit): Implement.   
17310         (Continue::Emit): Implement.
17311
17312         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17313         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17314         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17315         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17316         end loop
17317
17318         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17319         properties that track the label for the current loop (begin of the
17320         loop and end of the loop).
17321
17322 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17323
17324         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17325         use of emitting anything at all.
17326
17327         * class.cs, rootcontext.cs : Get rid of calls to the same.
17328
17329         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17330
17331         (Populate): Define the constructor correctly and set the implementation
17332         attributes.
17333
17334         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17335         have been defined.
17336
17337         (AddDelegateType): Implement.
17338
17339         (IsDelegateType): Implement helper method.
17340
17341         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17342
17343         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17344         and accordingly handle it.
17345
17346         * delegate.cs (Populate): Take TypeContainer argument.
17347         Implement bits to define the Invoke method. However, I still haven't figured out
17348         how to take care of the native int bit :-(
17349
17350         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17351         Qualify the name of the delegate, not its return type !
17352
17353         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17354         conversion.
17355
17356         (StandardConversionExists): Checking for array types turns out to be recursive.
17357
17358         (ConvertReferenceExplicit): Implement array conversion.
17359
17360         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17361
17362 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17363
17364         * cs-parser.jay (delegate_declaration): Store the fully qualified
17365         name as it is a type declaration.
17366
17367         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17368         readonly.
17369
17370         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17371         as TypeContainer::DefineType.
17372
17373         (Populate): Method in which all the definition of the various methods (Invoke)
17374         etc is done.
17375
17376         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17377         see.
17378
17379         (CloseDelegate): Finally creates the delegate.
17380
17381         * class.cs (TypeContainer::DefineType): Update to define delegates.
17382         (Populate, Emit and CloseType): Do the same thing here too.
17383
17384         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17385         delegates in all these operations.
17386
17387 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17388
17389         * expression.cs: LocalTemporary: a new expression used to
17390         reference a temporary that has been created.
17391
17392         * assign.cs: Handle PropertyAccess back here, so that we can
17393         provide the proper semantic access to properties.
17394
17395         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17396         a few more explicit conversions. 
17397
17398         * modifiers.cs: `NEW' modifier maps to HideBySig.
17399
17400         * expression.cs (PropertyExpr): Make this into an
17401         ExpressionStatement, and support the EmitStatement code path. 
17402
17403         Perform get/set error checking, clean up the interface.
17404
17405         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17406         them into toplevel access objects.
17407
17408 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17409
17410         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17411         SRE.
17412
17413         * typemanager.cs: Keep track here of our PropertyBuilders again to
17414         work around lameness in SRE.
17415
17416 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17417
17418         * expression.cs (LValue::LValueResolve): New method in the
17419         interface, used to perform a second resolution pass for LValues. 
17420
17421         (This::DoResolve): Catch the use of this in static methods.
17422
17423         (This::LValueResolve): Implement.
17424
17425         (This::Store): Remove warning, assigning to `this' in structures
17426         is 
17427
17428         (Invocation::Emit): Deal with invocation of
17429         methods on value types.  We need to pass the address to structure
17430         methods rather than the object itself.  (The equivalent code to
17431         emit "this" for structures leaves the entire structure on the
17432         stack instead of a pointer to it). 
17433
17434         (ParameterReference::DoResolve): Compute the real index for the
17435         argument based on whether the method takes or not a `this' pointer
17436         (ie, the method is static).
17437
17438         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17439         value types returned from functions when we need to invoke a
17440         method on the sturcture.
17441
17442
17443 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17444
17445         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17446         defining the type in the Modulebuilder or Typebuilder. This is to take
17447         care of nested types which need to be defined on the TypeBuilder using
17448         DefineNestedMethod.
17449
17450         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17451         methods in RootContext, only ported to be part of TypeContainer.
17452
17453         (TypeContainer::GetInterfaceOrClass): Ditto.
17454
17455         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17456
17457         * interface.cs (Interface::DefineInterface): New method. Does exactly
17458         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17459         too.
17460
17461         (Interface::GetInterfaces): Move from RootContext here and port.
17462
17463         (Interface::GetInterfaceByName): Same here.
17464
17465         * rootcontext.cs (ResolveTree): Re-write.
17466
17467         (PopulateTypes): Re-write.
17468
17469         * class.cs (TypeContainer::Populate): Populate nested types too.
17470         (TypeContainer::Emit): Emit nested members too.
17471
17472         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17473         instead just use the name argument passed in as it is already fully
17474         qualified.
17475
17476         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17477         to TypeContainer mapping to see if a type is user-defined.
17478
17479         * class.cs (TypeContainer::CloseType): Implement. 
17480
17481         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17482         the default constructor.
17483
17484         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17485         twice.
17486
17487         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17488
17489         * interface.cs (CloseType): Create the type here.
17490
17491         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17492         the hierarchy.
17493
17494         Remove all the methods which are now in TypeContainer.
17495
17496 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17497
17498         * delegate.cs (Define): Re-write bits to define the delegate
17499         correctly.
17500
17501 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17502
17503         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17504
17505         * expression.cs (ImplicitReferenceConversion): handle null as well
17506         as a source to convert to any reference type.
17507
17508         * statement.cs (Return): Perform any implicit conversions to
17509         expected return type.  
17510
17511         Validate use of return statement.  
17512
17513         * codegen.cs (EmitContext): Pass the expected return type here.
17514
17515         * class.cs (Method, Constructor, Property): Pass expected return
17516         type to EmitContext.
17517
17518 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * expression.cs: Make DoResolve take an EmitContext instead of a
17521         TypeContainer.
17522
17523         Replaced `l' and `location' for `loc', for consistency.
17524
17525         (Error, Warning): Remove unneeded Tc argument.
17526
17527         * assign.cs, literal.cs, constant.cs: Update to new calling
17528         convention. 
17529
17530         * codegen.cs: EmitContext now contains a flag indicating whether
17531         code is being generated in a static method or not.
17532
17533         * cs-parser.jay: DecomposeQI, new function that replaces the old
17534         QualifiedIdentifier.  Now we always decompose the assembled
17535         strings from qualified_identifier productions into a group of
17536         memberaccesses.
17537
17538 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
17539
17540         * rootcontext.cs: Deal with field-less struct types correctly now
17541         by passing the size option to Define Type.
17542
17543         * class.cs: Removed hack that created one static field. 
17544
17545 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17546
17547         * statement.cs: Moved most of the code generation here. 
17548
17549 2001-10-09  Ravi Pratap  <ravi@ximian.com>
17550
17551         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
17552         seem very right.
17553
17554         (ElementAccess): Remove useless bits for now - keep checks as the spec
17555         says.
17556
17557 2001-10-08  Ravi Pratap  <ravi@ximian.com>
17558
17559         * expression.cs (ElementAccess::DoResolve): Remove my crap code
17560         and start performing checks according to the spec.
17561
17562 2001-10-07  Ravi Pratap  <ravi@ximian.com>
17563
17564         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
17565         rank_specifiers instead.
17566
17567         (rank_specifiers): Change the order in which the rank specifiers are stored
17568
17569         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
17570
17571         * expression.cs (ElementAccess): Implement the LValue interface too.
17572
17573 2001-10-06  Ravi Pratap  <ravi@ximian.com>
17574
17575         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
17576         except that user defined conversions are not included.
17577
17578         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
17579         perform the conversion of the return type, if necessary.
17580
17581         (New::DoResolve): Check whether we are creating an array or an object
17582         and accordingly do the needful.
17583
17584         (New::Emit): Same here.
17585
17586         (New::DoResolve): Implement guts of array creation.
17587
17588         (New::FormLookupType): Helper function.
17589
17590 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
17591
17592         * codegen.cs: Removed most of the code generation here, and move the
17593         corresponding code generation bits to the statement classes. 
17594
17595         Added support for try/catch/finalize and throw.
17596
17597         * cs-parser.jay: Added support for try/catch/finalize.
17598
17599         * class.cs: Catch static methods having the flags override,
17600         virtual or abstract.
17601
17602         * expression.cs (UserCast): This user cast was not really doing
17603         what it was supposed to do.  Which is to be born in fully resolved
17604         state.  Parts of the resolution were being performed at Emit time! 
17605
17606         Fixed this code.
17607
17608 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17609
17610         * expression.cs: Implicity convert the result from UserCast.
17611
17612 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17613
17614         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
17615         prevented it from working correctly. 
17616
17617         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
17618         merely ConvertImplicit.
17619
17620 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
17621
17622         * typemanager.cs: Make the LookupTypeContainer function static,
17623         and not per-instance.  
17624
17625         * class.cs: Make static FindMembers (the one that takes a Type
17626         argument). 
17627
17628         * codegen.cs: Add EmitForeach here.
17629
17630         * cs-parser.jay: Make foreach a toplevel object instead of the
17631         inline expansion, as we need to perform semantic analysis on it. 
17632
17633 2001-10-05  Ravi Pratap  <ravi@ximian.com>
17634
17635         * expression.cs (Expression::ImplicitUserConversion): Rename to
17636         UserDefinedConversion.
17637
17638         (Expression::UserDefinedConversion): Take an extra argument specifying 
17639         whether we look for explicit user conversions too.
17640
17641         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
17642
17643         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
17644
17645         (ExplicitUserConversion): Make it a call to UserDefinedConversion
17646         with the appropriate arguments.
17647
17648         * cs-parser.jay (cast_expression): Record location too.
17649
17650         * expression.cs (Cast): Record location info.
17651
17652         (Expression::ConvertExplicit): Take location argument.
17653
17654         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
17655         to determine if we are doing explicit conversions.
17656
17657         (UserCast::Emit): Update accordingly.
17658
17659         (Expression::ConvertExplicit): Report an error if everything fails.
17660
17661         * ../errors/cs0030.cs : Add.
17662
17663 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
17664
17665         * modifiers.cs: If the ABSTRACT keyword is present, also set the
17666         virtual and newslot bits. 
17667
17668         * class.cs (TypeContainer::RegisterRequiredImplementations):
17669         Record methods we need.
17670
17671         (TypeContainer::MakeKey): Helper function to make keys for
17672         MethodBases, since the Methodbase key is useless.
17673
17674         (TypeContainer::Populate): Call RegisterRequiredImplementations
17675         before defining the methods.   
17676
17677         Create a mapping for method_builders_to_methods ahead of time
17678         instead of inside a tight loop.
17679
17680         (::RequireMethods):  Accept an object as the data to set into the
17681         hashtable so we can report interface vs abstract method mismatch.
17682
17683 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17684
17685         * report.cs: Make all of it static.
17686
17687         * rootcontext.cs: Drop object_type and value_type computations, as
17688         we have those in the TypeManager anyways.
17689
17690         Drop report instance variable too, now it is a global.
17691
17692         * driver.cs: Use try/catch on command line handling.
17693
17694         Add --probe option to debug the error reporting system with a test
17695         suite. 
17696
17697         * report.cs: Add support for exiting program when a probe
17698         condition is reached.
17699
17700 2001-10-03  Ravi Pratap  <ravi@ximian.com>
17701
17702         * expression.cs (Binary::DoNumericPromotions): Fix the case when
17703         we do a forcible conversion regardless of type, to check if 
17704         ForceConversion returns a null.
17705
17706         (Binary::error19): Use location to report error.
17707
17708         (Unary::error23): Use location here too.
17709
17710         * ../errors/cs0019.cs : Check in.
17711
17712         * ../errors/cs0023.cs : Check in.
17713
17714         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
17715         case of a non-null MethodInfo object with a length of 0 !
17716
17717         (Binary::ResolveOperator): Flag error if overload resolution fails to find
17718         an applicable member - according to the spec :-)
17719         Also fix logic to find members in base types.
17720
17721         (Unary::ResolveOperator): Same here.
17722
17723         (Unary::report23): Change name to error23 and make first argument a TypeContainer
17724         as I was getting thoroughly confused between this and error19 :-)
17725
17726         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
17727         (::FindMostEncompassedType): Implement.
17728         (::FindMostEncompassingType): Implement.
17729         (::StandardConversionExists): Implement.
17730
17731         (UserImplicitCast): Re-vamp. We now need info about most specific
17732         source and target types so that we can do the necessary conversions.
17733
17734         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
17735         mathematical union with no duplicates.
17736
17737 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
17738
17739         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
17740         in order from base classes to child classes, so that we can in
17741         child classes look up in our parent for method names and
17742         attributes (required for handling abstract, virtual, new, override
17743         constructs: we need to instrospect our base class, and if we dont
17744         populate the classes in order, the introspection might be
17745         incorrect.  For example, a method could query its parent before
17746         the parent has any methods and would determine that the parent has
17747         no abstract methods (while it could have had them)).
17748
17749         (RootContext::CreateType): Record the order in which we define the
17750         classes.
17751
17752 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
17753
17754         * class.cs (TypeContainer::Populate): Also method definitions can
17755         fail now, keep track of this.
17756
17757         (TypeContainer::FindMembers): Implement support for
17758         DeclaredOnly/noDeclaredOnly flag.
17759
17760         (Constructor::Emit) Return the ConstructorBuilder.
17761
17762         (Method::Emit) Return the MethodBuilder. 
17763         Check for abstract or virtual methods to be public.
17764
17765         * rootcontext.cs (RootContext::CreateType): Register all the
17766         abstract methods required for the class to be complete and the
17767         interface methods that must be implemented. 
17768
17769         * cs-parser.jay: Report error 501 (method requires body if it is
17770         not marked abstract or extern).
17771
17772         * expression.cs (TypeOf::Emit): Implement.
17773
17774         * typemanager.cs: runtime_handle_type, new global type.
17775
17776         * class.cs (Property::Emit): Generate code for properties.
17777
17778 2001-10-02  Ravi Pratap  <ravi@ximian.com>
17779
17780         * expression.cs (Unary::ResolveOperator): Find operators on base type
17781         too - we now conform exactly to the spec.
17782
17783         (Binary::ResolveOperator): Same here.
17784
17785         * class.cs (Operator::Define): Fix minor quirk in the tests.
17786
17787         * ../errors/cs0215.cs : Added.
17788
17789         * ../errors/cs0556.cs : Added.
17790
17791         * ../errors/cs0555.cs : Added.
17792
17793 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17794
17795         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
17796         single integer which is really efficient
17797
17798 2001-10-01  Ravi Pratap  <ravi@ximian.com>
17799
17800         *  expression.cs (Expression::ImplicitUserConversion): Use location
17801         even in the case when we are examining True operators.
17802  
17803         * class.cs (Operator::Define): Perform extensive checks to conform
17804         with the rules for operator overloading in the spec.
17805
17806         * expression.cs (Expression::ImplicitReferenceConversion): Implement
17807         some of the other conversions mentioned in the spec.
17808
17809         * typemanager.cs (array_type): New static member for the System.Array built-in
17810         type.
17811
17812         (cloneable_interface): For System.ICloneable interface.
17813
17814         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
17815         we start resolving the tree and populating types.
17816
17817         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
17818  
17819 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * expression.cs (Expression::ExprClassFromMemberInfo,
17822         Expression::Literalize): Create literal expressions from
17823         FieldInfos which are literals.
17824
17825         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
17826         type casts, because they were wrong.  The test suite in tests
17827         caught these ones.
17828
17829         (ImplicitNumericConversion): ushort to ulong requires a widening
17830         cast. 
17831
17832         Int32 constant to long requires widening cast as well.
17833
17834         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
17835         for integers because the type on the stack is not i4.
17836
17837 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
17838
17839         * expression.cs (report118): require location argument. 
17840
17841         * parameter.cs: Do not dereference potential null value.
17842
17843         * class.cs: Catch methods that lack the `new' keyword when
17844         overriding a name.  Report warnings when `new' is used without
17845         anything being there to override.
17846
17847         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
17848
17849         * class.cs: Only add constructor to hashtable if it is non-null
17850         (as now constructors can fail on define).
17851
17852         (TypeManager, Class, Struct): Take location arguments.
17853
17854         Catch field instance initialization in structs as errors.
17855
17856         accepting_filter: a new filter for FindMembers that is static so
17857         that we dont create an instance per invocation.
17858
17859         (Constructor::Define): Catch errors where a struct constructor is
17860         parameterless 
17861
17862         * cs-parser.jay: Pass location information for various new
17863         constructs. 
17864
17865         * delegate.cs (Delegate): take a location argument.
17866
17867         * driver.cs: Do not call EmitCode if there were problesm in the
17868         Definition of the types, as many Builders wont be there. 
17869
17870         * decl.cs (Decl::Decl): Require a location argument.
17871
17872         * cs-tokenizer.cs: Handle properly hex constants that can not fit
17873         into integers, and find the most appropiate integer for it.
17874
17875         * literal.cs: Implement ULongLiteral.
17876
17877         * rootcontext.cs: Provide better information about the location of
17878         failure when CreateType fails.
17879
17880 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
17881
17882         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
17883         as well.
17884
17885         * expression.cs (Binary::CheckShiftArguments): Add missing type
17886         computation.
17887         (Binary::ResolveOperator): Add type to the logical and and logical
17888         or, Bitwise And/Or and Exclusive Or code paths, it was missing
17889         before.
17890
17891         (Binary::DoNumericPromotions): In the case where either argument
17892         is ulong (and most signed types combined with ulong cause an
17893         error) perform implicit integer constant conversions as well.
17894
17895 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * expression.cs (UserImplicitCast): Method should always be
17898         non-null. 
17899         (Invocation::BetterConversion): Simplified test for IntLiteral.
17900
17901         (Expression::ImplicitNumericConversion): Split this routine out.
17902         Put the code that performs implicit constant integer conversions
17903         here. 
17904
17905         (Expression::Resolve): Become a wrapper around DoResolve so we can
17906         check eclass and type being set after resolve.
17907
17908         (Invocation::Badness): Remove this dead function
17909
17910         (Binary::ResolveOperator): Do not compute the expensive argumnets
17911         unless we have a union for it.
17912
17913         (Probe::Emit): Is needs to do an isinst and then
17914         compare against null.
17915
17916         (::CanConvert): Added Location argument.  If the Location argument
17917         is null (Location.Null), then we do not report errors.  This is
17918         used by the `probe' mechanism of the Explicit conversion.  We do
17919         not want to generate an error for something that the user
17920         explicitly requested to be casted.  But the pipeline for an
17921         explicit cast first tests for potential implicit casts.
17922
17923         So for now, if the Location is null, it means `Probe only' to
17924         avoid adding another argument.   Might have to revise this
17925         strategy later.
17926
17927         (ClassCast): New class used to type cast objects into arbitrary
17928         classes (used in Explicit Reference Conversions).
17929
17930         Implement `as' as well.
17931
17932         Reverted all the patches from Ravi below: they were broken:
17933
17934                 * The use of `level' as a mechanism to stop recursive
17935                   invocations is wrong.  That was there just to catch the
17936                   bug with a strack trace but not as a way of addressing
17937                   the problem.
17938
17939                   To fix the problem we have to *understand* what is going
17940                   on and the interactions and come up with a plan, not
17941                   just get things going.
17942
17943                 * The use of the type conversion cache that I proposed
17944                   last night had an open topic: How does this work across
17945                   protection domains.  A user defined conversion might not
17946                   be public in the location where we are applying the
17947                   conversion, a different conversion might be selected
17948                   (ie, private A->B (better) but public B->A (worse),
17949                   inside A, A->B applies, but outside it, B->A will
17950                   apply).
17951
17952                 * On top of that (ie, even if the above is solved),
17953                   conversions in a cache need to be abstract.  Ie, `To
17954                   convert from an Int to a Short use an OpcodeCast', not
17955                   `To convert from an Int to a Short use the OpcodeCast on
17956                   the variable 5' (which is what this patch was doing).
17957
17958 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17959
17960         * expression.cs (Invocation::ConversionExists): Re-write to use
17961         the conversion cache
17962
17963         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
17964         cache all conversions done, not just user-defined ones.
17965
17966         (Invocation::BetterConversion): The real culprit. Use ConversionExists
17967         to determine if a conversion exists instead of acutually trying to 
17968         perform the conversion. It's faster too.
17969
17970         (Expression::ConvertExplicit): Modify to use ConversionExists to check
17971         and only then attempt the implicit conversion.
17972
17973 2001-09-28  Ravi Pratap  <ravi@ximian.com>
17974
17975         * expression.cs (ConvertImplicit): Use a cache for conversions
17976         already found. Check level of recursion and bail out if necessary.
17977
17978 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
17979
17980         * typemanager.cs (string_concat_string_string, string_concat_object_object):
17981         Export standard methods that we expect for string operations.
17982
17983         * statement.cs (Block::UsageWarning): Track usage of variables and
17984         report the errors for not used variables.
17985
17986         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
17987         operator. 
17988
17989 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * codegen.cs: remove unnneded code 
17992
17993         * expression.cs: Removed BuiltinTypeAccess class
17994
17995         Fix the order in which implicit conversions are
17996         done.  
17997
17998         The previous fixed dropped support for boxed conversions (adding a
17999         test to the test suite now)
18000
18001         (UserImplicitCast::CanConvert): Remove test for source being null,
18002         that code is broken.  We should not feed a null to begin with, if
18003         we do, then we should track the bug where the problem originates
18004         and not try to cover it up here.
18005
18006         Return a resolved expression of type UserImplicitCast on success
18007         rather than true/false.  Ravi: this is what I was talking about,
18008         the pattern is to use a static method as a "constructor" for
18009         objects. 
18010
18011         Also, do not create arguments until the very last minute,
18012         otherwise we always create the arguments even for lookups that
18013         will never be performed. 
18014
18015         (UserImplicitCast::Resolve): Eliminate, objects of type
18016         UserImplicitCast are born in a fully resolved state. 
18017
18018         * typemanager.cs (InitCoreTypes): Init also value_type
18019         (System.ValueType). 
18020
18021         * expression.cs (Cast::Resolve): First resolve the child expression.
18022
18023         (LValue): Add new method AddressOf to be used by
18024         the `&' operator.  
18025
18026         Change the argument of Store to take an EmitContext instead of an
18027         ILGenerator, because things like FieldExpr need to be able to call
18028         their children expression to generate the instance code. 
18029
18030         (Expression::Error, Expression::Warning): Sugar functions for
18031         reporting errors.
18032
18033         (Expression::MemberLookup): Accept a TypeContainer instead of a
18034         Report as the first argument.
18035
18036         (Expression::ResolvePrimary): Killed.  I still want to improve
18037         this as currently the code is just not right.
18038
18039         (Expression::ResolveMemberAccess): Simplify, but it is still
18040         wrong. 
18041
18042         (Unary::Resolve): Catch errors in AddressOf operators.
18043
18044         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18045         index to a byte for the short-version, or the compiler will choose
18046         the wrong Emit call, which generates the wrong data.
18047
18048         (ParameterReference::Emit, ::Store): same.
18049
18050         (FieldExpr::AddressOf): Implement.
18051
18052         * typemanager.cs: TypeManager: made public variable instead of
18053         property.
18054
18055         * driver.cs: document --fatal.
18056
18057         * report.cs (ErrorMessage, WarningMessage): new names for the old
18058         Error and Warning classes.
18059
18060         * cs-parser.jay (member_access): Turn built-in access to types
18061         into a normal simplename
18062
18063 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18064
18065         * expression.cs (Invocation::BetterConversion): Fix to cope
18066         with q being null, since this was introducing a bug.
18067
18068         * expression.cs (ConvertImplicit): Do built-in conversions first.
18069
18070 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18071
18072         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18073
18074 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18075
18076         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18077         I had introduced long ago (what's new ?).
18078
18079         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18080         the work of all the checking. 
18081         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18082         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18083
18084         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18085         that is the right way. 
18086
18087         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18088         overloading resolution. Use everywhere instead of cutting and pasting code.
18089
18090         (Binary::ResolveOperator): Use MakeUnionSet.
18091
18092         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18093         we have to convert to bool types. Not complete yet.
18094
18095 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18096
18097         * typemanager.cs (TypeManager::CSharpName): support ushort.
18098
18099         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18100         to provide an expression that performsn an implicit constant int
18101         conversion (section 6.1.6).
18102         (Expression::ConvertImplicitRequired): Reworked to include
18103         implicit constant expression conversions.
18104
18105         (Expression::ConvertNumericExplicit): Finished.
18106
18107         (Invocation::Emit): If InstanceExpression is null, then it means
18108         that we perform a call on this.
18109
18110 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18111
18112         * expression.cs (Unary::Emit): Remove some dead code.
18113         (Probe): Implement Resolve and Emit for `is'.
18114         (Expression::ConvertImplicitRequired): Attempt to do constant
18115         expression conversions here.  Maybe should be moved to
18116         ConvertImplicit, but I am not sure.
18117         (Expression::ImplicitLongConstantConversionPossible,
18118         Expression::ImplicitIntConstantConversionPossible): New functions
18119         that tell whether is it possible to apply an implicit constant
18120         expression conversion.
18121
18122         (ConvertNumericExplicit): Started work on explicit numeric
18123         conversions.
18124
18125         * cs-parser.jay: Update operator constants.
18126
18127         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18128         (Parameters::GetSignature): Hook up VerifyArgs here.
18129         (Parameters::VerifyArgs): Verifies that no two arguments have the
18130         same name. 
18131
18132         * class.cs (Operator): Update the operator names to reflect the
18133         ones that the spec expects (as we are just stringizing the
18134         operator names).
18135
18136         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18137         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18138         previous usage did only work for our methods.
18139         (Expression::ConvertImplicit): Handle decimal implicit numeric
18140         conversions as well.
18141         (Expression::InternalTypeConstructor): Used to invoke constructors
18142         on internal types for default promotions.
18143
18144         (Unary::Emit): Implement special handling for the pre/post
18145         increment/decrement for overloaded operators, as they need to have
18146         the same semantics as the other operators.
18147
18148         (Binary::ResolveOperator): ditto.
18149         (Invocation::ConversionExists): ditto.
18150         (UserImplicitCast::Resolve): ditto.
18151
18152 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18153
18154         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18155         operator, return after emitting body. Regression tests pass again !
18156
18157         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18158         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18159         (Invocation::OverloadResolve): Ditto.
18160         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18161
18162         * everywhere : update calls to the above methods accordingly.
18163
18164 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18165
18166         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18167
18168         * expression.cs (ExpressionStatement): New base class used for
18169         expressions that can appear in statements, so that we can provide
18170         an alternate path to generate expression that do not leave a value
18171         on the stack.
18172
18173         (Expression::Emit, and all the derivatives): We no longer return
18174         whether a value is left on the stack or not.  Every expression
18175         after being emitted leaves a single value on the stack.
18176
18177         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18178         facilties of ExpressionStatement if possible.
18179
18180         * cs-parser.jay: Update statement_expression.
18181
18182 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18183
18184         * driver.cs: Change the wording of message
18185
18186 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18187
18188         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18189         the type of the expression to the return type of the method if
18190         we have an overloaded operator match ! The regression tests pass again !
18191         (Unary::ResolveOperator): Ditto.
18192
18193         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18194         to find "op_Implicit", not "implicit" ;-)
18195         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18196         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18197
18198         * everywhere : Correct calls to the above accordingly.
18199
18200         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18201         (ConvertImplicit): Do user-defined conversion if it exists.
18202
18203 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * assign.cs: track location.
18206         (Resolve): Use implicit conversions on assignment.
18207
18208         * literal.cs: Oops.  Not good, Emit of short access values should
18209         pass (Bytes) or the wrong argument will be selected.
18210
18211         * expression.cs (Unary::Emit): Emit code for -expr.
18212
18213         (Unary::ResolveOperator): Handle `Substract' for non-constants
18214         (substract from zero from the non-constants).
18215         Deal with Doubles as well. 
18216
18217         (Expression::ConvertImplicitRequired): New routine that reports an
18218         error if no implicit conversion exists. 
18219
18220         (Invocation::OverloadResolve): Store the converted implicit
18221         expressions if we make them
18222
18223 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18224
18225         * class.cs (ConstructorInitializer): Take a Location argument.
18226         (ConstructorBaseInitializer): Same here.
18227         (ConstructorThisInitializer): Same here.
18228
18229         * cs-parser.jay : Update all calls accordingly.
18230
18231         * expression.cs (Unary, Binary, New): Take location argument.
18232         Update accordingly everywhere.
18233
18234         * cs-parser.jay : Update all calls to the above to take a location
18235         argument.
18236
18237         * class.cs : Ditto.
18238
18239 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18240
18241         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18242         (Invocation::BetterConversion): Same here
18243         (Invocation::ConversionExists): Ditto.
18244
18245         (Invocation::ConversionExists): Implement.
18246
18247 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18248
18249         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18250         Also take an additional TypeContainer argument.
18251
18252         * All over : Pass in TypeContainer as argument to OverloadResolve.
18253
18254         * typemanager.cs (CSharpName): Update to check for the string type and return
18255         that too.
18256
18257         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18258         a given method.
18259
18260 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18261
18262         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18263         (Invocation::BetterFunction): Implement.
18264         (Invocation::BetterConversion): Implement.
18265         (Invocation::ConversionExists): Skeleton, no implementation yet.
18266
18267         Okay, things work fine !
18268
18269 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * typemanager.cs: declare and load enum_type, delegate_type and
18272         void_type. 
18273
18274         * expression.cs (Expression::Emit): Now emit returns a value that
18275         tells whether a value is left on the stack or not.  This strategy
18276         might be reveted tomorrow with a mechanism that would address
18277         multiple assignments.
18278         (Expression::report118): Utility routine to report mismatches on
18279         the ExprClass.
18280
18281         (Unary::Report23): Report impossible type/operator combination
18282         utility function.
18283
18284         (Unary::IsIncrementableNumber): Whether the type can be
18285         incremented or decremented with add.
18286         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18287         complemented. 
18288         (Unary::ResolveOperator): Implement ++, !, ~,
18289
18290         (Invocation::Emit): Deal with new Emit convetion.
18291
18292         * All Expression derivatives: Updated their Emit method to return
18293         whether they leave values on the stack or not.
18294
18295         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18296         stack for expressions that are statements. 
18297
18298 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18299
18300         * expression.cs (LValue): New interface.  Must be implemented by
18301         LValue objects.
18302         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18303         LValue interface.
18304
18305         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18306         interface for generating code, simplifies the code.
18307
18308 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18309
18310         * expression.cs (everywhere): Comment out return statements in ::Resolve
18311         methods to avoid the warnings.
18312
18313 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18314
18315         * driver.cs (parse): Report error 2001 if we can not open the
18316         source file.
18317
18318         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18319         not resolve it.
18320
18321         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18322         object. 
18323
18324         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18325         otherwise nested blocks end up with the same index.
18326
18327         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18328
18329         * expression.cs:  Instead of having FIXMEs in the Resolve
18330         functions, throw exceptions so it is obvious that we are facing a
18331         bug. 
18332
18333         * cs-parser.jay (invocation_expression): Pass Location information.
18334
18335         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18336         Use a basename for those routines because .NET does not like paths
18337         on them. 
18338
18339         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18340         already defined.
18341
18342 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18343
18344         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18345         are loading the correct data types (throws an exception if not).
18346         (TypeManager::InitCoreTypes): Use CoreLookupType
18347
18348         * expression.cs (Unary::ResolveOperator): return the child
18349         expression for expressions which are just +expr.
18350         (Unary::ResolveOperator): Return negative literals for -LITERAL
18351         expressions (otherwise they are Unary {Literal}).
18352         (Invocation::Badness): Take into account `Implicit constant
18353         expression conversions'.
18354
18355         * literal.cs (LongLiteral): Implement long literal class.
18356         (IntLiteral): export the `Value' of the intliteral. 
18357
18358 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18359
18360         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18361
18362         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18363         instead of 'Operator'
18364
18365         * expression.cs (Binary::ResolveOperator): Update accordingly.
18366         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18367         and 'Minus'
18368
18369         * cs-parser.jay (unary_expression): Update to use the new names.
18370
18371         * gen-treedump.cs (GetUnary): Same here.
18372
18373         * expression.cs (Unary::Resolve): Implement.
18374         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18375         operators are found instead of making noise ;-)
18376         (Unary::ResolveOperator): New method to do precisely the same thing which
18377         Binary::ResolveOperator does for Binary expressions.
18378         (Unary.method, .Arguments): Add.
18379         (Unary::OperName): Implement.   
18380         (Unary::ForceConversion): Copy and Paste !
18381
18382         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18383         a unary operator.
18384
18385         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18386         for the inbuilt operators. Only overloading works for now ;-)
18387
18388 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18389
18390         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18391         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18392
18393         * expression.cs (This::Emit): Implement. 
18394         (This::Resolve): Implement.
18395         (TypeOf:Resolve): Implement.
18396         (Expression::ResolveSimpleName): Add an implicit this to instance
18397         field references. 
18398         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18399         Bind instance variable to Field expressions.
18400         (FieldExpr::Instance): New field used to track the expression that
18401         represents the object instance.
18402         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18403         binding 
18404         (FieldExpr::Emit): Implement.
18405
18406         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18407         the last instruction contains a return opcode to avoid generating
18408         the last `ret' instruction (this generates correct code, and it is
18409         nice to pass the peverify output).
18410
18411         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18412         initializer for static and instance variables.
18413         (Constructor::Emit): Allow initializer to be null in the case of
18414         static constructors.  Only emit initializer for instance
18415         constructors. 
18416
18417         (TypeContainer::FindMembers): Return a null array if there are no
18418         matches.
18419
18420         Also fix the code for the MemberTypes.Method branch, as it was not
18421         scanning that for operators (or tried to access null variables before).
18422
18423         * assign.cs (Assign::Emit): Handle instance and static fields. 
18424
18425         * TODO: Updated.
18426
18427         * driver.cs: Stop compilation if there are parse errors.
18428
18429         * cs-parser.jay (constructor_declaration): Provide default base
18430         initializer for non-static constructors.
18431         (constructor_declarator): Do not provide a default base
18432         initializers if none was specified.
18433         Catch the fact that constructors should not have parameters.
18434
18435         * class.cs: Do not emit parent class initializers for static
18436         constructors, that should be flagged as an error.
18437
18438 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18439
18440         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18441         Move back code into TypeContainer::Populate.
18442
18443 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18444
18445         * class.cs (TypeContainer::AddConstructor): Fix the check to
18446         compare against Name, not Basename. 
18447         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18448
18449         * cs-parser.jay : Update accordingly.
18450
18451         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18452         for methods, don't forget to look into the operators too.
18453         (RegisterMethodBuilder): Helper method to take care of this for
18454         methods, constructors and operators.
18455         (Operator::Define): Completely revamp.
18456         (Operator.OperatorMethod, MethodName): New fields.
18457         (TypeContainer::Populate): Move the registering of builders into
18458         RegisterMethodBuilder.
18459         (Operator::Emit): Re-write.
18460
18461         * expression.cs (Binary::Emit): Comment out code path to emit method
18462         invocation stuff for the case when we have a user defined operator. I am
18463         just not able to get it right !
18464
18465 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18466
18467         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18468         argument. 
18469
18470         (Expression::MemberLookup): Provide a version that allows to
18471         specify the MemberTypes and BindingFlags. 
18472
18473         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18474         so it was not fetching variable information from outer blocks.
18475
18476         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18477         Beforefieldinit as it was buggy.
18478
18479         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18480         that Ravi put here.  
18481
18482         * class.cs (Constructor::Emit): Only emit if block is not null.
18483         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18484         deal with this by semantically definining it as if the user had
18485         done it.
18486
18487         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18488         constructors as we now "emit" them at a higher level.
18489
18490         (TypeContainer::DefineDefaultConstructor): Used to define the
18491         default constructors if none was provided.
18492
18493         (ConstructorInitializer): Add methods Resolve and Emit. 
18494
18495         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18496
18497 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18498
18499         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18500         the default constructor builder with our hashtable for methodbuilders
18501         to methodcores.
18502
18503         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18504         and argument_count is 0 in which case we have a match.
18505         (Binary::ResolveOperator): More null checking and miscellaneous coding
18506         style cleanup.
18507
18508 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18509
18510         * rootcontext.cs (IsNameSpace): Compare against null.
18511
18512         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18513
18514         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18515         and Unary::Operator.
18516
18517         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18518         accordingly.
18519
18520         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18521         we have overloaded operators.
18522         (Binary::ResolveOperator): Implement the part which does the operator overload
18523         resolution.
18524
18525         * class.cs (Operator::Emit): Implement.
18526         (TypeContainer::Emit): Emit the operators we have too.
18527
18528         * expression.cs (Binary::Emit): Update to emit the appropriate code for
18529         the case when we have a user-defined operator.
18530
18531 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18532
18533         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
18534
18535 2001-09-16  Ravi Pratap  <ravi@ximian.com>
18536
18537         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
18538         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
18539         (Constructor::Emit): Implement.
18540         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
18541         if we have no work to do. 
18542         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
18543         Emit method.
18544
18545         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
18546         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
18547
18548         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
18549         of parent.parent.
18550
18551 2001-09-15  Ravi Pratap  <ravi@ximian.com>
18552
18553         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
18554         in the source.
18555         (Tree::RecordNamespace): Method to do what the name says ;-)
18556         (Tree::Namespaces): Property to get at the namespaces hashtable.
18557
18558         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
18559         keep track.
18560
18561         * rootcontext.cs (IsNamespace): Fixed it :-)
18562
18563 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18564
18565         * class.cs (TypeContainer::FindMembers): Add support for
18566         constructors. 
18567         (MethodCore): New class that encapsulates both the shared aspects
18568         of a Constructor and a Method.  
18569         (Method, Constructor): Factored pieces into MethodCore.
18570
18571         * driver.cs: Added --fatal which makes errors throw exceptions.
18572         Load System assembly as well as part of the standard library.
18573
18574         * report.cs: Allow throwing exceptions on errors for debugging.
18575
18576         * modifiers.cs: Do not use `parent', instead use the real type
18577         container to evaluate permission settings.
18578
18579         * class.cs: Put Ravi's patch back in.  He is right, and we will
18580         have to cope with the
18581
18582 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18583
18584         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
18585         FamORAssem, not FamANDAssem.
18586
18587 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
18588
18589         * driver.cs: Added --parse option that only parses its input files
18590         and terminates.
18591
18592         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
18593         incorrect.  IsTopLevel is not used to tell whether an object is
18594         root_types or not (that can be achieved by testing this ==
18595         root_types).  But to see if this is a top-level *class* (not
18596         necessarly our "toplevel" container). 
18597
18598 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18599
18600         * enum.cs (Enum::Define): Modify to call the Lookup method on the
18601         parent instead of a direct call to GetType.
18602
18603 2001-09-14  Ravi Pratap  <ravi@ximian.com>
18604
18605         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
18606         Modifiers.TypeAttr. This should just be a call to that method.
18607
18608         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
18609         object so that we can determine if we are top-level or not.
18610
18611         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
18612         TypeContainer too.
18613
18614         * enum.cs (Enum::Define): Ditto.
18615
18616         * modifiers.cs (FieldAttr): Re-write.
18617
18618         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
18619         (TypeContainer::HaveStaticConstructor): New property to provide access
18620         to precisely that info.
18621
18622         * modifiers.cs (MethodAttr): Re-write.
18623         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
18624
18625         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
18626         of top-level types as claimed.
18627
18628 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * expression.cs (MemberLookup): Fruitless attempt to lookup
18631         constructors.  Maybe I need to emit default constructors?  That
18632         might be it (currently .NET emits this for me automatically).
18633         (Invocation::OverloadResolve): Cope with Arguments == null.
18634         (Invocation::EmitArguments): new function, shared by the new
18635         constructor and us.
18636         (Invocation::Emit): Handle static and instance methods.  Emit
18637         proper call instruction for virtual or non-virtual invocations.
18638         (New::Emit): Implement.
18639         (New::Resolve): Implement.
18640         (MemberAccess:Resolve): Implement.
18641         (MethodGroupExpr::InstanceExpression): used conforming to the spec
18642         to track instances.
18643         (FieldExpr::Resolve): Set type.
18644
18645         * support.cs: Handle empty arguments.
18646                 
18647         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
18648         SimpleLookup): Auxiliary routines to help parse a qualifier
18649         identifier.  
18650
18651         Update qualifier_identifier rule.
18652
18653         * codegen.cs: Removed debugging messages.
18654
18655         * class.cs: Make this a global thing, this acts just as a "key" to
18656         objects that we might have around.
18657
18658         (Populate): Only initialize method_builders_to_methods once.
18659
18660         * expression.cs (PropertyExpr): Initialize type from the
18661         PropertyType. 
18662
18663         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
18664         Resolve pattern.  Attempt to implicitly convert value to boolean.
18665         Emit code.
18666
18667         * expression.cs: Set the type for the int32/int32 argument case.
18668         (Binary::ResolveOperator): Set the return type to boolean for
18669         comparission operators
18670
18671         * typemanager.cs: Remove debugging print code.
18672
18673         (Invocation::Resolve): resolve type.
18674
18675         * class.cs: Allocate a MemberInfo of the correct size, as the code
18676         elsewhere depends on the test to reflect the correct contents.
18677
18678         (Method::) Keep track of parameters, due to System.Reflection holes
18679
18680         (TypeContainer::Populate): Keep track of MethodBuilders to Method
18681         mapping here.
18682
18683         (TypeContainer::FindMembers): Use ArrayList and then copy an array
18684         of the exact size and return that.
18685
18686         (Class::LookupMethodByBuilder): New function that maps
18687         MethodBuilders to its methods.  Required to locate the information
18688         on methods because System.Reflection bit us again.
18689
18690         * support.cs: New file, contains an interface ParameterData and
18691         two implementations: ReflectionParameters and InternalParameters
18692         used to access Parameter information.  We will need to grow this
18693         as required.
18694
18695         * expression.cs (Invocation::GetParameterData): implement a cache
18696         and a wrapper around the ParameterData creation for methods. 
18697         (Invocation::OverloadResolve): Use new code.
18698
18699 2001-09-13  Ravi Pratap  <ravi@ximian.com>
18700
18701         * class.cs (TypeContainer::EmitField): Remove and move into 
18702         (Field::Define): here and modify accordingly.
18703         (Field.FieldBuilder): New member.
18704         (TypeContainer::Populate): Update accordingly.
18705         (TypeContainer::FindMembers): Implement.
18706
18707 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * statement.cs: (VariableInfo::VariableType): New field to be
18710         initialized with the full type once it is resolved. 
18711
18712 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
18713
18714         * parameter.cs (GetParameterInfo): Use a type cache to compute
18715         things only once, and to reuse this information
18716
18717         * expression.cs (LocalVariableReference::Emit): Implement.
18718         (OpcodeCast::Emit): fix.
18719
18720         (ParameterReference::Resolve): Implement.
18721         (ParameterReference::Emit): Implement.
18722
18723         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
18724         that are expressions need to stay as Expressions.
18725
18726         * typemanager.cs (CSharpName): Returns the C# name of a type if
18727         possible. 
18728
18729         * expression.cs (Expression::ConvertImplicit): New function that
18730         implements implicit type conversions.
18731
18732         (Expression::ImplicitReferenceConversion): Implements implicit
18733         reference conversions.
18734
18735         (EmptyCast): New type for transparent casts.
18736
18737         (OpcodeCast): New type for casts of types that are performed with
18738         a sequence of bytecodes.
18739
18740         (BoxedCast): New type used for casting value types into reference
18741         types.  Emits a box opcode.
18742
18743         (Binary::DoNumericPromotions): Implements numeric promotions of
18744         and computation of the Binary::Type.
18745
18746         (Binary::EmitBranchable): Optimization.
18747
18748         (Binary::Emit): Implement code emission for expressions.
18749
18750         * typemanager.cs (TypeManager): Added two new core types: sbyte
18751         and byte.
18752
18753 2001-09-12  Ravi Pratap  <ravi@ximian.com>
18754
18755         * class.cs (TypeContainer::FindMembers): Method which does exactly
18756         what Type.FindMembers does, only we don't have to use reflection. No
18757         implementation yet.
18758
18759         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
18760         typecontainer objects as we need to get at them.
18761         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
18762
18763         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
18764         typecontainer object.
18765
18766         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
18767         of just a Report object.
18768
18769 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18770
18771         * class.cs (Event::Define): Go back to using the prefixes "add_" and
18772         "remove_"
18773         (TypeContainer::Populate): Now define the delegates of the type too.
18774         (TypeContainer.Delegates): Property to access the list of delegates defined
18775         in the type.
18776
18777         * delegates.cs (Delegate::Define): Implement partially.
18778
18779         * modifiers.cs (TypeAttr): Handle more flags.
18780
18781 2001-09-11  Ravi Pratap  <ravi@ximian.com>
18782
18783         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
18784         and not <=
18785         (Operator::Define): Re-write logic to get types by using the LookupType method
18786         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
18787         (Indexer::Define): Ditto.
18788         (Event::Define): Ditto.
18789         (Property::Define): Ditto.
18790
18791 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18792
18793         * class.cs (TypeContainer::Populate): Now define operators too. 
18794         (TypeContainer.Operators): New property to access the list of operators
18795         in a type.
18796         (Operator.OperatorMethodBuilder): New member to hold the method builder
18797         for the operator we are defining.
18798         (Operator::Define): Implement.
18799
18800 2001-09-10  Ravi Pratap  <ravi@ximian.com>
18801
18802         * class.cs (Event::Define): Make the prefixes of the accessor methods
18803         addOn_ and removeOn_ 
18804
18805         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
18806         of the location being passed in too. Ideally, this should go later since all
18807         error reporting should be done through the Report object.
18808
18809         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
18810         (Populate): Iterate thru the indexers we have and define them too.
18811         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
18812         for the get and set accessors.
18813         (Indexer::Define): Implement.
18814
18815 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
18816
18817         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
18818         my previous implementation, did not work.
18819
18820         * typemanager.cs: Add a couple of missing types (the longs).
18821
18822         * literal.cs: Use TypeManager.bool_type instead of getting it.
18823
18824         * expression.cs (EventExpr): New kind of expressions.
18825         (Expressio::ExprClassFromMemberInfo): finish
18826
18827 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
18828
18829         * assign.cs: Emit stores to static fields differently.
18830
18831 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18832
18833         * Merge in changes and adjust code to tackle conflicts. Backed out my
18834         code in Assign::Resolve ;-) 
18835
18836 2001-09-08  Ravi Pratap  <ravi@ximian.com>
18837
18838         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
18839         instead Report.Error and also pass in the location.
18840         (CSharpParser::Lexer): New readonly property to return the reference
18841         to the Tokenizer object.
18842         (declare_local_variables): Use Report.Error with location instead of plain 
18843         old error.
18844         (CheckDef): Ditto.
18845
18846         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
18847         (Operator.CheckBinaryOperator): Ditto.
18848
18849         * cs-parser.jay (operator_declarator): Update accordingly.
18850
18851         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
18852         (CheckBinaryOperator): Same here.
18853
18854         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
18855         on the name without any prefixes of namespace names etc. This is because we
18856         already might have something already fully qualified like 
18857         'System.Console.WriteLine'
18858
18859         * assign.cs (Resolve): Begin implementation. Stuck ;-)
18860
18861 2001-09-07  Ravi Pratap  <ravi@ximian.com>
18862
18863         * cs-tokenizer.cs (location): Return a string which also contains
18864         the file name.
18865
18866         * expression.cs (ElementAccess): New class for expressions of the
18867         type 'element access.'
18868         (BaseAccess): New class for expressions of the type 'base access.'
18869         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
18870         respectively.
18871
18872         * cs-parser.jay (element_access): Implement action.
18873         (base_access): Implement actions.
18874         (checked_expression, unchecked_expression): Implement.
18875
18876         * cs-parser.jay (local_variable_type): Correct and implement.
18877         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
18878
18879         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
18880
18881         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
18882         name and the specifiers.
18883
18884         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
18885
18886         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
18887         making them all public ;-)
18888
18889         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
18890         class anyways.
18891
18892 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
18893
18894         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
18895         PropertyExprs.
18896         (FieldExpr, PropertyExprs): New resolved expressions.
18897         (SimpleName::MemberStaticCheck): Perform static checks for access
18898         to non-static fields on static methods. Maybe this should be
18899         generalized for MemberAccesses. 
18900         (SimpleName::ResolveSimpleName): More work on simple name
18901         resolution. 
18902
18903         * cs-parser.jay (primary_expression/qualified_identifier): track
18904         the parameter index.
18905
18906         * codegen.cs (CodeGen::Save): Catch save exception, report error.
18907         (EmitContext::EmitBoolExpression): Chain to expression generation
18908         instead of temporary hack.
18909         (::EmitStatementExpression): Put generic expression code generation.
18910
18911         * assign.cs (Assign::Emit): Implement variable assignments to
18912         local variables, parameters and fields.
18913
18914 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
18915
18916         * statement.cs (Block::GetVariableInfo): New method, returns the
18917         VariableInfo for a variable name in a block.
18918         (Block::GetVariableType): Implement in terms of GetVariableInfo
18919
18920         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
18921         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
18922
18923 2001-09-06  Ravi Pratap  <ravi@ximian.com>
18924
18925         * cs-parser.jay (operator_declaration): Continue on my quest : update
18926         to take attributes argument.
18927         (event_declaration): Ditto.
18928         (enum_declaration): Ditto.
18929         (indexer_declaration): Ditto.
18930
18931         * class.cs (Operator::Operator): Update constructor accordingly.
18932         (Event::Event): Ditto.
18933
18934         * delegate.cs (Delegate::Delegate): Same here.
18935
18936         * enum.cs (Enum::Enum): Same here.
18937
18938 2001-09-05  Ravi Pratap  <ravi@ximian.com>
18939
18940         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
18941
18942         * ../tests/cs0658.cs : New file to demonstrate error 0658.
18943
18944         * attribute.cs (Attributes): New class to encapsulate all attributes which were
18945         being passed around as an arraylist.
18946         (Attributes::AddAttribute): Method to add attribute sections.
18947
18948         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
18949         (struct_declaration): Update accordingly.
18950         (constant_declaration): Update.
18951         (field_declaration): Update.
18952         (method_header): Update.
18953         (fixed_parameter): Update.
18954         (parameter_array): Ditto.
18955         (property_declaration): Ditto.
18956         (destructor_declaration): Ditto.
18957
18958         * class.cs (Struct::Struct): Update constructors accordingly.
18959         (Class::Class): Ditto.
18960         (Field::Field): Ditto.
18961         (Method::Method): Ditto.
18962         (Property::Property): Ditto.
18963         (TypeContainer::OptAttribute): update property's return type.
18964
18965         * interface.cs (Interface.opt_attributes): New member.
18966         (Interface::Interface): Update to take the extra Attributes argument.
18967
18968         * parameter.cs (Parameter::Parameter): Ditto.
18969
18970         * constant.cs (Constant::Constant): Ditto.
18971
18972         * interface.cs (InterfaceMemberBase): New OptAttributes field.
18973         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
18974         the attributes as a parameter.
18975         (InterfaceProperty): Update constructor call.
18976         (InterfaceEvent): Ditto.
18977         (InterfaceMethod): Ditto.
18978         (InterfaceIndexer): Ditto.
18979
18980         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
18981         pass the attributes too.
18982         (interface_event_declaration): Ditto.
18983         (interface_property_declaration): Ditto.
18984         (interface_method_declaration): Ditto.
18985         (interface_declaration): Ditto.
18986
18987 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * class.cs (Method::Define): Track the "static Main" definition to
18990         create an entry point. 
18991
18992         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
18993         EntryPoint if we find it. 
18994
18995         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
18996         (EmitContext::ig): Make this variable public.
18997
18998         * driver.cs: Make the default output file be the first file name
18999         with the .exe extension.  
19000
19001         Detect empty compilations
19002
19003         Handle various kinds of output targets.  Handle --target and
19004         rename -t to --dumper.
19005
19006         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19007         methods inherited from Expression return now an Expression.  This
19008         will is used during the tree rewriting as we resolve them during
19009         semantic analysis.
19010
19011         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19012         the spec.  Missing entirely is the information about
19013         accessability of elements of it.
19014
19015         (Expression::ExprClassFromMemberInfo): New constructor for
19016         Expressions that creates a fully initialized Expression based on
19017         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19018         a Type.
19019
19020         (Invocation::Resolve): Begin implementing resolution of invocations.
19021
19022         * literal.cs (StringLiteral):  Implement Emit.
19023
19024 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19025
19026         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19027         member.
19028
19029 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19030
19031         * cs-parser.jay (attribute_arguments): Implement actions.
19032         (attribute): Fix bug in production. Implement action.
19033         (attribute_list): Implement.
19034         (attribute_target): Implement.
19035         (attribute_target_specifier, opt_target_specifier): Implement
19036         (CheckAttributeTarget): New method to check if the attribute target
19037         is valid.
19038         (attribute_section): Implement.
19039         (opt_attributes): Implement.
19040
19041         * attribute.cs : New file to handle attributes.
19042         (Attribute): Class to hold attribute info.
19043
19044         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19045         (attribute_section): Modify production to use 2 different rules to 
19046         achieve the same thing. 1 s/r conflict down !
19047         Clean out commented, useless, non-reducing dimension_separator rules.
19048
19049         * class.cs (TypeContainer.attributes): New member to hold list
19050         of attributes for a type.
19051         (Struct::Struct): Modify to take one more argument, the attribute list.
19052         (Class::Class): Ditto.
19053         (Field::Field): Ditto.
19054         (Method::Method): Ditto.
19055         (Property::Property): Ditto.
19056
19057         * cs-parser.jay (struct_declaration): Update constructor call to
19058         pass in the attributes too.
19059         (class_declaration): Ditto.
19060         (constant_declaration): Ditto.
19061         (field_declaration): Ditto.
19062         (method_header): Ditto.
19063         (fixed_parameter): Ditto.
19064         (parameter_array): Ditto.
19065         (property_declaration): Ditto.
19066
19067         * constant.cs (Constant::Constant): Update constructor similarly.
19068         Use System.Collections.
19069
19070         * parameter.cs (Parameter::Parameter): Update as above.
19071
19072 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19073
19074         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19075         (TypeContainer.delegates): New member to hold list of delegates.
19076
19077         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19078         this time as I seem to be on crack ;-)
19079
19080 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19081
19082         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19083         tell whether an identifier represents a namespace.
19084
19085         * expression.cs (NamespaceExpr): A namespace expression, used only
19086         temporarly during expression resolution.
19087         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19088         utility functions to resolve names on expressions.
19089
19090 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19091
19092         * codegen.cs: Add hook for StatementExpressions. 
19093
19094         * class.cs: Fix inverted test for static flag in methods.
19095
19096 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19097
19098         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19099         to make it coincide with MS' number.
19100         (Operator::CheckBinaryOperator): Ditto.
19101
19102         * ../errors/errors.txt : Remove error numbers added earlier.
19103
19104         * ../errors/cs1019.cs : Test case for error # 1019
19105
19106         * ../errros/cs1020.cs : Test case for error # 1020
19107
19108         * cs-parser.jay : Clean out commented cruft.
19109         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19110         used anywhere - non-reducing rule.
19111         (namespace_declarations): Non-reducing rule - comment out.
19112
19113         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19114         with TypeContainer::AddEnum.
19115
19116         * delegate.cs : New file for delegate handling classes.
19117         (Delegate): Class for declaring delegates.
19118
19119         * makefile : Update.
19120
19121         * cs-parser.jay (delegate_declaration): Implement.
19122
19123 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19124
19125         * class.cs (Event::Define): Implement.
19126         (Event.EventBuilder): New member.
19127
19128         * class.cs (TypeContainer::Populate): Update to define all enums and events
19129         we have.
19130         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19131         readonly fields for all these cases ?
19132
19133 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19134
19135         * class.cs (Property): Revamp to use the convention of making fields readonly.
19136         Accordingly modify code elsewhere.
19137
19138         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19139         the Define method of the Property class.
19140
19141         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19142         trivial bug.
19143         (TypeContainer::Populate): Update to define all the properties we have. Also
19144         define all enumerations.
19145
19146         * enum.cs (Define): Implement.
19147
19148 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19149
19150         * cs-parser.jay (overloadable_operator): The semantic value is an
19151         enum of the Operator class.
19152         (operator_declarator): Implement actions.
19153         (operator_declaration): Implement.
19154
19155         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19156         validity of definitions.
19157         (Operator::CheckBinaryOperator): Static method to check for binary operators
19158         (TypeContainer::AddOperator): New method to add an operator to a type.
19159
19160         * cs-parser.jay (indexer_declaration): Added line to actually call the
19161         AddIndexer method so it gets added ;-)
19162
19163         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19164         already taken care of by the MS compiler ?  
19165
19166 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19167
19168         * class.cs (Operator): New class for operator declarations.
19169         (Operator::OpType): Enum for the various operators.
19170
19171 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19172
19173         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19174         ostensibly handle this in semantic analysis.
19175
19176         * cs-parser.jay (general_catch_clause): Comment out
19177         (specific_catch_clauses, specific_catch_clause): Ditto.
19178         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19179         (catch_args, opt_catch_args): New productions.
19180         (catch_clause): Rewrite to use the new productions above
19181         (catch_clauses): Modify accordingly.
19182         (opt_catch_clauses): New production to use in try_statement
19183         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19184         and re-write the code in the actions to extract the specific and
19185         general catch clauses by being a little smart ;-)
19186
19187         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19188         Hooray, try and catch statements parse fine !
19189
19190 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19191
19192         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19193         string from the hashtable of variables.
19194
19195         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19196         I end up making that mistake ;-)
19197         (catch_clauses): Fixed gross error which made Key and Value of the 
19198         DictionaryEntry the same : $1 !!
19199
19200 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19201
19202         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19203
19204         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19205         when the add and remove accessors are specified. 
19206
19207 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19208
19209         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19210         information about indexer_declarator.
19211         (indexer_declarator): Implement actions.
19212         (parsing_indexer): New local boolean used to keep track of whether
19213         we are parsing indexers or properties. This is necessary because 
19214         implicit_parameters come into picture even for the get accessor in the 
19215         case of an indexer.
19216         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19217
19218         * class.cs (Indexer): New class for indexer declarations.
19219         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19220         (TypeContainer::indexers): New member to hold list of indexers for the
19221         type.
19222
19223 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19224
19225         * cs-parser.jay (add_accessor_declaration): Implement action.
19226         (remove_accessor_declaration): Implement action.
19227         (event_accessors_declaration): Implement
19228         (variable_declarators): swap statements for first rule - trivial.
19229
19230         * class.cs (Event): New class to hold information about event
19231         declarations.
19232         (TypeContainer::AddEvent): New method to add an event to a type
19233         (TypeContainer::events): New member to hold list of events.
19234
19235         * cs-parser.jay (event_declaration): Implement actions.
19236
19237 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19238
19239         * cs-parser.jay (dim_separators): Implement. Make it a string
19240         concatenating all the commas together, just as they appear.
19241         (opt_dim_separators): Modify accordingly
19242         (rank_specifiers): Update accordingly. Basically do the same
19243         thing - instead, collect the brackets here.
19244         (opt_rank_sepcifiers): Modify accordingly.
19245         (array_type): Modify to actually return the complete type string
19246         instead of ignoring the rank_specifiers.
19247         (expression_list): Implement to collect the expressions
19248         (variable_initializer): Implement. We make it a list of expressions
19249         essentially so that we can handle the array_initializer case neatly too.
19250         (variable_initializer_list): Implement.
19251         (array_initializer): Make it a list of variable_initializers
19252         (opt_array_initializer): Modify accordingly.
19253
19254         * expression.cs (New::NType): Add enumeration to help us
19255         keep track of whether we have an object/delegate creation
19256         or an array creation.
19257         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19258         members to hold data about array creation.
19259         (New:New): Modify to update NewType
19260         (New:New): New Overloaded contructor for the array creation
19261         case.
19262
19263         * cs-parser.jay (array_creation_expression): Implement to call
19264         the overloaded New constructor.
19265
19266 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19267
19268         * class.cs (TypeContainer::Constructors): Return member
19269         constructors instead of returning null.
19270
19271 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19272
19273         * typemanager.cs (InitCoreTypes): Initialize the various core
19274         types after we have populated the type manager with the user
19275         defined types (this distinction will be important later while
19276         compiling corlib.dll)
19277
19278         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19279         on Expression Classification.  Now all expressions have a method
19280         `Resolve' and a method `Emit'.
19281
19282         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19283         generation from working.     Also add some temporary debugging
19284         code. 
19285
19286 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * codegen.cs: Lots of code generation pieces.  This is only the
19289         beginning, will continue tomorrow with more touches of polish.  We
19290         handle the fundamentals of if, while, do, for, return.  Others are
19291         trickier and I need to start working on invocations soon.
19292
19293         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19294         s.InitStatement. 
19295
19296         * codegen.cs (EmitContext): New struct, used during code
19297         emission to keep a context.   Most of the code generation will be
19298         here. 
19299
19300         * cs-parser.jay: Add embedded blocks to the list of statements of
19301         this block.  So code generation proceeds in a top down fashion.
19302
19303 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19304
19305         * statement.cs: Add support for multiple child blocks.
19306
19307 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19308
19309         * codegen.cs (EmitCode): New function, will emit the code for a
19310         Block of code given a TypeContainer and its ILGenerator. 
19311
19312         * statement.cs (Block): Standard public readonly optimization.
19313         (Block::Block constructors): Link children. 
19314         (Block::Child): Child Linker.
19315         (Block::EmitVariables): Emits IL variable declarations.
19316
19317         * class.cs: Drop support for MethodGroups here, delay until
19318         Semantic Analysis.
19319         (Method::): Applied the same simplification that I did before, and
19320         move from Properties to public readonly fields.
19321         (Method::ParameterTypes): Returns the parameter types for the
19322         function, and implements a cache that will be useful later when I
19323         do error checking and the semantic analysis on the methods is
19324         performed.
19325         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19326         and made a method, optional argument tells whether this is a class
19327         or a structure to apply the `has-this' bit.
19328         (Method::GetCallingConvention): Implement, returns the calling
19329         convention. 
19330         (Method::Define): Defines the type, a second pass is performed
19331         later to populate the methods.
19332
19333         (Constructor::ParameterTypes): implement a cache similar to the
19334         one on Method::ParameterTypes, useful later when we do semantic
19335         analysis. 
19336
19337         (TypeContainer::EmitMethod):  New method.  Emits methods.
19338
19339         * expression.cs: Removed MethodGroup class from here.
19340
19341         * parameter.cs (Parameters::GetCallingConvention): new method.
19342
19343 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19344
19345         * class.cs (TypeContainer::Populate): Drop RootContext from the
19346         argument. 
19347
19348         (Constructor::CallingConvention): Returns the calling convention.
19349         (Constructor::ParameterTypes): Returns the constructor parameter
19350         types. 
19351
19352         (TypeContainer::AddConstructor): Keep track of default constructor
19353         and the default static constructor.
19354
19355         (Constructor::) Another class that starts using `public readonly'
19356         instead of properties. 
19357
19358         (Constructor::IsDefault): Whether this is a default constructor. 
19359
19360         (Field::) use readonly public fields instead of properties also.
19361
19362         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19363         track of static constructors;  If none is used, turn on
19364         BeforeFieldInit in the TypeAttributes. 
19365
19366         * cs-parser.jay (opt_argument_list): now the return can be null
19367         for the cases where there are no arguments. 
19368
19369         (constructor_declarator): If there is no implicit `base' or
19370         `this', then invoke the default parent constructor. 
19371
19372         * modifiers.cs (MethodAttr): New static function maps a set of
19373         modifiers flags into a MethodAttributes enum
19374         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19375         MethodAttr, TypeAttr to represent the various mappings where the
19376         modifiers are used.
19377         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19378
19379 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19380
19381         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19382         method arguments.
19383
19384         * interface.cs (PopulateIndexer): Implemented the code generator
19385         for interface indexers.
19386
19387 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19388
19389         * interface.cs (InterfaceMemberBase): Now we track the new status
19390         here.  
19391
19392         (PopulateProperty): Implement property population.  Woohoo!  Got
19393         Methods and Properties going today. 
19394
19395         Removed all the properties for interfaces, and replaced them with
19396         `public readonly' fields. 
19397
19398 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19401         initialize their hashtables/arraylists only when they are needed
19402         instead of doing this always.
19403
19404         * parameter.cs: Handle refs and out parameters.
19405
19406         * cs-parser.jay: Use an ArrayList to construct the arguments
19407         instead of the ParameterCollection, and then cast that to a
19408         Parameter[] array.
19409
19410         * parameter.cs: Drop the use of ParameterCollection and use
19411         instead arrays of Parameters.
19412
19413         (GetParameterInfo): Use the Type, not the Name when resolving
19414         types. 
19415
19416 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19417
19418         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19419         and instead use public readonly fields.
19420
19421         * class.cs: Put back walking code for type containers.
19422
19423 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19424
19425         * class.cs (MakeConstant): Code to define constants.
19426
19427         * rootcontext.cs (LookupType): New function.  Used to locate types 
19428
19429
19430 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19431
19432         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19433         this System.Reflection code is.  Kudos to Microsoft
19434
19435         * typemanager.cs: Implement a type cache and avoid loading all
19436         types at boot time.  Wrap in LookupType the internals.  This made
19437         the compiler so much faster.  Wow.  I rule!
19438
19439         * driver.cs: Make sure we always load mscorlib first (for
19440         debugging purposes, nothing really important).
19441
19442         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19443         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19444
19445         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19446         on namespaces that have been imported using the `using' keyword.
19447
19448         * class.cs (TypeContainer::TypeAttr): Virtualize.
19449         (Class::TypeAttr): Return attributes suitable for this bad boy.
19450         (Struct::TypeAttr): ditto.
19451         Handle nested classes.
19452         (TypeContainer::) Remove all the type visiting code, it is now
19453         replaced with the rootcontext.cs code
19454
19455         * rootcontext.cs (GetClassBases): Added support for structs. 
19456
19457 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19458
19459         * interface.cs, statement.cs, class.cs, parameter.cs,
19460         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19461         Drop use of TypeRefs, and use strings instead.
19462
19463 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19464
19465         * rootcontext.cs: 
19466
19467         * class.cs (Struct::Struct): set the SEALED flags after
19468         checking the modifiers.
19469         (TypeContainer::TypeAttr): new property, returns the
19470         TypeAttributes for a class.  
19471
19472         * cs-parser.jay (type_list): Oops, list production was creating a
19473         new list of base types.
19474
19475         * rootcontext.cs (StdLib): New property.
19476         (GetInterfaceTypeByName): returns an interface by type name, and
19477         encapsulates error handling here.
19478         (GetInterfaces): simplified.
19479         (ResolveTree): Encapsulated all the tree resolution here.
19480         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19481         types. 
19482
19483         * driver.cs: Add support for --nostdlib, to avoid loading the
19484         default assemblies.
19485         (Main): Do not put tree resolution here. 
19486
19487         * rootcontext.cs: Beginning of the class resolution.
19488
19489 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * rootcontext.cs: Provide better error reporting. 
19492
19493         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19494
19495         * rootcontext.cs (CreateInterface): Handle the case where there
19496         are no parent interfaces.
19497
19498         (CloseTypes): Routine to flush types at the end.
19499         (CreateInterface): Track types.
19500         (GetInterfaces): Returns an array of Types from the list of
19501         defined interfaces.
19502
19503         * typemanager.c (AddUserType): Mechanism to track user types (puts
19504         the type on the global type hash, and allows us to close it at the
19505         end). 
19506
19507 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19508
19509         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19510         RecordInterface instead.
19511
19512         * cs-parser.jay: Updated to reflect changes above.
19513
19514         * decl.cs (Definition): Keep track of the TypeBuilder type that
19515         represents this type here.  Not sure we will use it in the long
19516         run, but wont hurt for now.
19517
19518         * driver.cs: Smaller changes to accomodate the new code.
19519
19520         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19521         when done. 
19522
19523         * rootcontext.cs (CreateInterface):  New method, used to create
19524         the System.TypeBuilder type for interfaces.
19525         (ResolveInterfaces): new entry point to resolve the interface
19526         hierarchy. 
19527         (CodeGen): Property, used to keep track of the code generator.
19528
19529 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
19530
19531         * cs-parser.jay: Add a second production for delegate_declaration
19532         with `VOID'.
19533
19534         (enum_body): Put an opt_comma here instead of putting it on
19535         enum_body or enum_member_declarations so we can handle trailing
19536         commas on enumeration members.  Gets rid of a shift/reduce.
19537
19538         (type_list): Need a COMMA in the middle.
19539
19540         (indexer_declaration): Tell tokenizer to recognize get/set
19541
19542         * Remove old targets.
19543
19544         * Re-add the parser target.
19545
19546 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19547
19548         * cs-parser.jay: Add precendence rules for a number of operators
19549         ot reduce the number of shift/reduce conflicts in the grammar.
19550
19551 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
19552
19553         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
19554         and put it here.
19555
19556         Get rid of old crufty code.
19557
19558         * rootcontext.cs: Use this to keep track of the parsed
19559         representation and the defined types available to the program. 
19560
19561         * gen-treedump.cs: adjust for new convention.
19562
19563         * type.cs: Split out the type manager, and the assembly builder
19564         from here. 
19565
19566         * typemanager.cs: the type manager will live here now.
19567
19568         * cil-codegen.cs: And the code generator here. 
19569
19570 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
19571
19572         * makefile: Fixed up for easy making.
19573
19574 2001-07-13  Simon Cozens <simon@simon-cozens.org>
19575
19576         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
19577         the 
19578
19579         (unary_expression): Expand pre_increment_expression and
19580         post_decrement_expression to reduce a shift/reduce.
19581
19582 2001-07-11  Simon Cozens
19583
19584         * cs-tokenizer.cs: Hex numbers should begin with a 0.
19585
19586         Improve allow_keyword_as_indent name.
19587
19588 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * Adjustments for Beta2. 
19591
19592 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * decl.cs: Added `Define' abstract method.
19595         (InTransit): new property, used to catch recursive definitions. 
19596
19597         * interface.cs: Implement `Define'. 
19598
19599         * modifiers.cs: Map Modifiers.constants to
19600         System.Reflection.TypeAttribute flags.
19601
19602         * class.cs: Keep track of types and user-defined types.
19603         (BuilderInit): New method for creating an assembly
19604         (ResolveType): New function to launch the resolution process, only
19605         used by interfaces for now.
19606
19607         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
19608         that are inserted into the name space. 
19609
19610 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
19611
19612         * ARGH.  I have screwed up my tree so many times due to the use of
19613         rsync rather than using CVS.  Going to fix this at once. 
19614
19615         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
19616         load types.
19617
19618 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
19619
19620         * Experiment successful: Use System.Type rather that our own
19621         version of Type.  
19622
19623 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
19624
19625         * cs-parser.jay: Removed nsAliases from here.
19626
19627         Use new namespaces, handle `using XXX;' 
19628
19629         * namespace.cs: Reimplemented namespace handling, use a recursive
19630         definition of the class.  Now we can keep track of using clauses
19631         and catch invalid using clauses.
19632
19633 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
19634
19635         * gen-treedump.cs: Adapted for all the renaming.
19636
19637         * expression.cs (Expression): this class now has a Type property
19638         which returns an expression Type.
19639
19640         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
19641         `Type', as this has a different meaning now in the base
19642
19643 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
19644
19645         * interface.cs, class.cs: Removed from all the sources the
19646         references to signature computation, as we can not do method
19647         signature computation during the parsing time, as we are not
19648         trying to solve at that point distinguishing:
19649
19650         class X {
19651                 void a (Blah x) {}
19652                 void a (NS.Blah x) {}
19653         }
19654
19655         Which depending on the context might be valid or not, as we do not
19656         know if Blah is the same thing as NS.Blah at that point.
19657
19658         * Redid everything so the code uses TypeRefs now instead of
19659         Types.  TypeRefs are just temporary type placeholders, that need
19660         to be resolved.  They initially have a pointer to a string and the
19661         current scope in which they are used.  This is used later by the
19662         compiler to resolve the reference to an actual Type. 
19663
19664         * DeclSpace is no longer a CIR.Type, and neither are
19665         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
19666         are all DeclSpaces, but no Types. 
19667
19668         * type.cs (TypeRefManager): This implements the TypeRef manager,
19669         which keeps track of all the types that need to be resolved after
19670         the parsing has finished. 
19671
19672 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
19673
19674         * ARGH.  We are going to have to store `foreach' as a class rather
19675         than resolving it, as we need to verify error 1579 after name
19676         resolution.   *OR* we could keep a flag that says `This request to
19677         IEnumerator comes from a foreach statement' which we can then use
19678         to generate the error.
19679
19680 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
19681
19682         * class.cs (TypeContainer.AddMethod): we now add methods to the
19683         MethodGroup instead of the method hashtable.  
19684
19685         * expression.cs: Add MethodGroup abstraction, which gets us one
19686         step closer to the specification in the way we handle method
19687         declarations.  
19688
19689         * cs-parser.jay (primary_expression): qualified_identifier now
19690         tried to match up an identifier to a local variable reference or
19691         to a parameter reference.
19692
19693         current_local_parameters is now a parser global variable that
19694         points to the current parameters for the block, used during name
19695         lookup.
19696
19697         (property_declaration): Now creates an implicit `value' argument to
19698         the set accessor.
19699
19700 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
19701
19702         * parameter.cs: Do not use `param' arguments as part of the
19703         signature, per the spec.
19704
19705 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
19706
19707         * decl.cs: Base class for classes, structs and interfaces.  This
19708         is the "Declaration Space" 
19709
19710         * cs-parser.jay: Use CheckDef for checking declaration errors
19711         instead of having one on each function.
19712
19713         * class.cs: Factor out some code for handling error handling in
19714         accordance to the "Declarations" section in the "Basic Concepts"
19715         chapter in the ECMA C# spec.
19716
19717         * interface.cs: Make all interface member classes derive from
19718         InterfaceMemberBase.
19719
19720 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
19721
19722         * Many things: all interfaces are parsed and generated in
19723         gen-treedump.  Support for member variables, constructors,
19724         destructors, properties, constants is there.
19725
19726         Beginning of the IL backend, but very little done, just there for
19727         testing purposes. 
19728
19729 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
19730
19731         * cs-parser.jay: Fix labeled statement.
19732
19733         * cs-tokenizer.cs (escape): Escape " and ' always.
19734         ref_line, ref_name: keep track of the line/filename as instructed
19735         by #line by the compiler.
19736         Parse #line.
19737
19738 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
19739
19740         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
19741         to match the values in System.CodeDOM.
19742
19743         Divid renamed to Divide.
19744
19745         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
19746         statements. 
19747         (Statements.set): remove.
19748
19749         * System.CodeDOM/CodeCatchClause.cs: always have a valid
19750         statements. 
19751
19752         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
19753         falseStatements always have valid values. 
19754
19755         * cs-parser.jay: Use System.CodeDOM now.
19756