2005-05-31 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #75081.
4         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
5         Use it in the error message.
6         * assign.cs, expression.cs, statement.cs: Update.
7
8 2005-05-30  Raja R Harinath  <rharinath@novell.com>
9
10         Fix #75088.
11         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
12         the "almostMatchedMember" case too.
13         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
14         that failed the accessibility checks to 'almost_match'.
15
16 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
17
18         * attribute.cs: Use internal MethodBuilder methods to set
19         ExactSpelling and SetLastError on PInvoke methods, instead
20         of passing them via charset.  Fixes #75060.
21
22 2005-05-27  Raja R Harinath  <rharinath@novell.com>
23
24         * parameter.cs (Parameter): Remove TODO comment.
25         (Parameter.DefineParameter): Remove Location parameter.
26         (Parameters.LabelParameters): Likewise.
27         * class.cs (Constructor.Emit): Update to change.
28         (MethodData.Emit): Likewise.
29         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
30         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
31
32 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
33
34         * parameter.cs,
35           Removed Parameters.Location and added Parameter.Location instead.
36           Removed Location parameter from Emit() and GetSignature().
37         * anonymous.cs,
38           class.cs,
39           cs-parser.jay,
40           delegate.cs,
41           iterators.cs,
42           statement.cs :
43           Modified all related calls.
44
45 2005-05-26  Raja R Harinath  <rharinath@novell.com>
46
47         Improve user-defined conversion handling.
48         * convert.cs (GetConversionOperators): Rewrite.  Return only the
49         applicable operators.
50         (AddConversionOperators): New.  Helper for GetConversionOperators.
51         (FindMostEncompassedType, FindMostEncompassingType): Verify that
52         there is only one most encompassed/encompassing type.
53         (FindMostSpecificSource, FindMostSpecificTarget): Remove
54         "applicable operator" handling.
55         (UserConversion): Move cache here from GetConversionOperators.
56         Directly cache the chosen operator, rather than the whole
57         MethodGroup.
58         (ExplicitNumericConversion): Fix buggy implementation of Decimal
59         case.  Allow conversion of decimal to sbyte and byte too.
60         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
61         New static methods.  Used to avoid allocating EmptyExpressions in
62         convert.cs.
63
64 2005-05-24  Duncan Mak  <duncan@novell.com>
65
66         * ecore.cs (CastFromDecimal): New class for casting a decimal to
67         another class, used in Convert.ExplicitNumericConversion.
68         (CastToDecimal): New class, similar to above, but casts to
69         System.Decimal, used in Convert.ImplicitNumericConversion and also
70         in explicit convesion from double/float to decimal.
71
72         * convert.cs (ImplicitNumericConversion): Handle implicit
73         conversions to System.Decimal.
74         (ExplicitNumericConversion): handle explicit conversions to
75         System.Decimal.
76
77         This fixes #68711.
78         
79 2005-05-20  Miguel de Icaza  <miguel@novell.com>
80
81         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
82         know the type at this stage, just break through.   Fixes #75008 
83
84 2005-05-19  Martin Baulig  <martin@ximian.com>
85
86         * delegate.cs
87         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
88         to disable error reporting.
89
90         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
91         here since we don't want to report an error; see the new test-336.cs.
92
93 2005-05-19  Raja R Harinath  <rharinath@novell.com>
94
95         * statement.cs (ToplevelBlock.GetParameterReference)
96         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
97         Move here from class Block.
98         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
99         * expression.cs (ParameterReference.DoResolveBase): Likewise.
100
101 2005-05-18  Martin Baulig  <martin@ximian.com>
102
103         Fix #74978.
104
105         * flowanalysis.cs
106         (FlowBranching.Reachability): Add non-static public And() and Or()
107         methods.
108         (FlowBranchingSwitch): New class; do the `break_origins' thing
109         like in FlowBranchingLoop.
110         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
111         reachability, not just locals and parameters.
112         (FlowBranching.MergeChild): Remove some of the hacks for loop and
113         switch; MergeBreakOrigins() now takes care of that.
114
115 2005-05-18  Martin Baulig  <martin@ximian.com>
116
117         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
118         a loop and may leave it, reset the barrier; fixes #74974.
119
120 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
121         
122         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
123         is back.
124         
125         * cs-parser.jay: Catch more lexical errors.
126         
127         * report.cs: Add one more Error method.
128         
129         * rootcontext.cs,
130         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
131
132 2005-05-17  Martin Baulig  <martin@ximian.com>
133
134         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
135         #70970. 
136
137 2005-05-16  Raja R Harinath  <rharinath@novell.com>
138
139         Fix test-382.cs.  Emit values of decimal constants.
140         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
141         Carved out of ...
142         (TypeContainer.AddField): ... this.
143         (TypeContainer.EmitFieldInitializers): Allow the list of fields
144         with initializers to include 'Const's.
145         (ClassPart.RegisterFieldForInitialization): Forward to
146         PartialContainer.
147         * const.cs (Const.Const): Pass initializer to base class.
148         (Const.Define): In case of decimal constants, register them for
149         initialization in a static constructor.
150
151 2005-05-14  Martin Baulig  <martin@ximian.com>
152
153         * statement.cs (Block.Resolve): Correctly handle unreachable code;
154         do not call ResolveUnreachable() on unreachable statements in
155         here, see the comment in the source code.
156
157 2005-05-13  Raja R Harinath  <rharinath@novell.com>
158
159         Fix #74934.
160         * expression.cs (BinaryResolveOperator): If one of the operands of
161         an equality comparison is 'null' and the other is a pointer type,
162         convert the null to a NullPointer.
163         * convert.cs (ImplicitReferenceConversion): If the expression is a
164         NullLiteral and the target type is a pointer type, return a
165         NullPointer instead.
166         (ImplicitConversionStandard): Likewise.
167
168 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
169         
170         * cs-parser.jay: Set readonly context based on special constructs.
171         
172         * expression.cs (LocalVariableReference.DoResolveBase): Improved
173         readonly variable error handling.
174         
175         * rootcontext.cs (EmitCode): Don't verify members when error
176         occurred.
177         
178         * statement.cs (LocalInfo): Add reaodnly context information.
179         (SetReadOnlyContext, GetReadOnlyContext): New methods.
180
181 2005-05-13  Raja R Harinath  <rharinath@novell.com>
182
183         * statement.cs (Block.Resolve): Revert change below.  Modify fix
184         for #74041 to initialize 'resolved' to false only for explicit
185         blocks.  Fixes #74873.
186
187 2005-05-12  Raja R Harinath  <harinath@gmail.com>
188
189         Fix #74920.
190         * typemanager.cs (unmanaged_enclosing_types): New.
191         (IsUnmanagedType): Avoid infloops by using
192         'unmanaged_enclosing_types' to talk with recursive invocations.
193
194 2005-05-13  Martin Baulig  <martin@ximian.com>
195
196         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
197         instance variable, not a local.  Fix #74873.
198         (Block.ResolveUnreachable): Set it to true here.
199
200 2005-05-11  Duncan Mak  <duncan@novell.com>
201
202         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
203         continuing to process for 'arg'.
204         (handle_preprocessing_directive): Check the argument of the #endif
205         directive and report error CS1025 if there are any trailing
206         characters.
207
208         According to the C# spec, having even whitespace after the #endif
209         directive is illegal; however, because we call arg.TrimEnd ()
210         beforehand, we have the same behavior as csc, allowing whitespace
211         after the directive.
212
213         Fixes #74892.
214
215 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
216
217         Fix #74863.
218         
219         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
220         (Constructor.GetObsoleteAttribute): Implemented correctly.
221
222 2005-05-10  Martin Baulig  <martin@ximian.com>
223
224         * support.cs (ReflectionParameters.ParameterModifier): Use
225         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
226         and `ParameterAttributes.In'.  Fixes #74884.
227
228 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
229
230         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
231         
232         * expression.cs (Argument.GetParameterModifier): Turned to property.
233         (Invocation.Error_InvalidArguments): Add more descriptive errors.
234         
235         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
236         its C# equivalent.
237         
238 2005-05-09  Raja R Harinath  <rharinath@novell.com>
239
240         Fix #74852.
241         * decl.cs (MemberCache.AddMethods): Register override methods,
242         rather than non-override methods.
243         * typemanager.cs (RegisterOverride): New.
244         (IsOverride): Update.
245
246 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
247
248         Fix #73105.
249         
250         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
251         recursive declaration.
252         
253         * statement.cs (Block.ResolveMeta): Report any error in resolving.
254         
255 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
256
257         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
258         
259         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
260
261 2005-05-05  Raja R Harinath  <rharinath@novell.com>
262
263         Fix #74797.
264         * decl.cs (DeclSpace.FamilyAccessible): 
265         Use TypeManager.IsNestedFamilyAccessible.
266
267         Fix reopened #64812.
268         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
269         internal'.
270
271 2005-05-04  Raja R Harinath  <rharinath@novell.com>
272             Abin Thomas  <projectmonokochi@rediffmail.com>
273             Anoob V E  <projectmonokochi@rediffmail.com>
274             Harilal P R  <projectmonokochi@rediffmail.com>
275
276         Fix #64812.
277         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
278         allow access to all static members.
279
280 2005-05-04  Martin Baulig  <martin@ximian.com>
281
282         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
283
284 2005-05-04  Martin Baulig  <martin@ximian.com>
285
286         Fix #74655.
287
288         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
289         section at the end; make things work if `default' is not the last
290         section.        
291
292 2005-05-04  Martin Baulig  <martin@ximian.com>
293
294         Fix #70400.
295
296         * statement.cs (Switch): Replaced the `got_default' field with a
297         `default_section' one.
298         (Switch.CheckSwitch): Set `default_section' here.
299         (Switch.Resolve): If we're a constant switch and the constant is
300         not found, use the default section.
301
302 2005-05-03  Martin Baulig  <martin@ximian.com>
303
304         * expression.cs (ArrayAccess.EmitGetLength): New public method.
305
306         * statement.cs (Foreach.ArrayForeach): New nested class.
307         (Foreach.TemporaryVariable): New nested class.
308         (Foreach.EmitArrayForeach): Removed; this is now in the new
309         ArrayForeach class.
310
311 2005-05-03  Raja R Harinath  <rharinath@novell.com>
312
313         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
314         more conservative.
315         (VerifyPendingMethods): Revert change below.
316
317         * typemanager.cs (IsOverride, RegisterNonOverride): New.
318         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
319         that used to trigger warning -28.  Remove warning -28.
320         * expression.cs (Invocation.OverloadResolve): Use
321         TypeManager.IsOverride to distinguish override methods.
322
323         Fix #74773.
324         * pending.cs (VerifyPendingMethods): If a base type implements the
325         requested interface, don't bother checking individual methods of
326         the base type.  As a side-effect, this prevents the creation of
327         unnecessary proxies.
328
329 2005-05-02  Martin Baulig  <martin@ximian.com>
330
331         Fix #70182.
332
333         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
334         Also `And' the locals if the old vector is null.
335         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
336         null; in this case we basically reset all the variables.        
337
338 2005-05-02  Martin Baulig  <martin@ximian.com>
339
340         Fix #74529.
341
342         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
343         Added `FlowBranching branching' argument; always `and' the
344         variables instead of `or'ing them unless we're an infinite loop.
345
346         * statement.cs (While.Resolve): Create a new sibling unless we're
347         infinite.       
348
349 2005-05-02  Martin Baulig  <martin@ximian.com>
350
351         Fix #70140.
352
353         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
354         arguments; use it instead of creating a new TopLevelBlock.
355         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
356         our ConstructorInitializer.
357
358         * statement.cs
359         (TopLevelBlock.TopLevelBranching): New public property.
360         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
361         and create our `TopLevelBranching'.
362
363         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
364         anonymous method host, use `block.TopLevelBranching' rather than
365         creating a new branching.
366
367 2005-04-20  Miguel de Icaza  <miguel@novell.com>
368
369         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
370         a ScopeInfo, if any of the current children is a child of the new
371         entry, move those children there.
372
373 2005-04-30  Martin Baulig  <martin@ximian.com>
374
375         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
376         at the beginning of a SwitchSection.  Fix #73335.
377
378 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
379
380         Fix #74378
381         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
382         
383         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
384         (FieldExpr.DoResolve): Obsolete members are ignored for field
385         initializers.
386         
387 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
388
389         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
390         of arrays detection.
391
392         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
393         verification.
394         (Field.VerifyClsCompliance): Volatile fields are not compliant.
395
396         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
397         arrays report.
398
399 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
400
401         * cs-parser.jay: Use the prefered version of -unsafe in error
402         message.
403
404 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
405
406         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
407         circumstances.
408
409 2005-04-20  John Luke  <john.luke@gmail.com>
410
411         * driver.cs: fix typo in error message, --outout to --output
412
413 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
414
415         * codegen.cs (InRefOutArgumentResolving): New field.
416         
417         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
418         fields outside contructor.
419         
420         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
421         
422 2005-04-19  Miguel de Icaza  <miguel@novell.com>
423
424         * anonymous.cs (CaptureContext.EmitParameterInstance): The
425         parameter code was not completed ever, so it was not as up-to-date
426         as local variables.  Must finish it.
427
428         The bug fix was to compare the Toplevel of the block, not the
429         current block.  Thanks for Ben for pointing this out. 
430
431 2005-04-19  Raja R Harinath  <rharinath@novell.com>
432
433         * decl.cs (AddMethods): Use the declaring type of the problem
434         method to determine if we want to squash a warning.
435
436 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
437
438         * attribute.cs: Removed debug output.
439
440         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
441         
442         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
443         Report.Stderr.
444         
445 2005-04-18  Raja R Harinath  <rharinath@novell.com>
446
447         Fix #74481.
448         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
449         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
450         all null comparisons against reference types.
451
452 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
453
454         Fix# 74565
455         * class.cs (TypeContainer.CircularDepException) New nested
456         exception class.
457         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
458         (TypeContainer.DefineType): Removed error, reset InTransit before
459         exit.
460         (Class.DefineType): Throw exception when is in Transit.
461         Catch exception and report error.
462         (Struct.DefineType): Throw exception when is in Transit.
463         Catch exception and report error.
464         (Interface.DefineType): Throw exception when is in Transit.
465         Catch exception and report error.
466
467         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
468         handle nested exception handlers.
469
470         * flowanalysis.cs (InTryWithCatch): New method, search for try with
471         a catch.
472
473         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
474         InFinally and InCatch storage.
475
476         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
477         (Catch.Resolve): Set and Restore ec.InCatch.
478         (Try.Resolve): Set and Restore ec.InFinally.
479         (Try.HasCatch): True when try has catch.
480
481 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
482
483         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
484           for the same event member, so exclude such cases from warning 419.
485           Fixed bug #74633.
486
487 2005-04-16  Miguel de Icaza  <miguel@novell.com>
488
489         * expression.cs (Binary.ResolveOperator): Apply patch from John
490         Luke to fix bug 59864: operators &, | and ^ on enumerations
491         require that the same enum type on both sides.
492
493         * driver.cs: Add warnings to old flag usage, this is to assist
494         people who produce Makefiles and hope that the Makefiles will be
495         used on Windows.
496
497         * class.cs (TypeContainer.EmitType): Moved the definition of the
498         special $PRIVATE$ field from the resolve phase to the Emit phase.
499         During resolve we do not know if we are a struct with
500         HasExplicitLayout, we know this only after the attributes for the
501         type are emitted.
502
503         Set the FieldOffset to zero on the dummy field that we create for
504         the class.   Fixes 74590.
505
506 2005-04-16  Raja R Harinath  <rharinath@novell.com>
507
508         Fix #73834.
509         * ecore.cs (PropertyExpr.resolved): New.
510         (DoResolve): Use it to handle a case of double resolution here.
511         Handle a case of identical-name-and-type-name.
512         * expression.cs (ArrayCreation.CheckIndices): Avoid double
513         resolution by storing the results of expression resolution back
514         into the "probes" array.
515
516 2005-04-15  Raja R Harinath  <rharinath@novell.com>
517
518         Fix cs0208-7.cs and cs0208-8.cs.
519         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
520         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
521         error reporting to point out the reason a struct is not unmanaged.
522
523 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
524
525         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
526           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
527
528 2005-04-13  Raja R Harinath  <rharinath@novell.com>
529
530         Fix #74528.
531         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
532         IdenticalNameAndTypeName here.
533         (EventExpr.InstanceResolve): Likewise.
534
535 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
536
537         C# 2.0 DefaultCharSetAttribute implementation
538         
539         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
540         which allows us to set GlobalNamespace for every resolve.
541         (Attribute.ResolveArguments): Cut from Resolve.
542         (Attribute.GetCharSetValue): Returns CharSet named argument.
543         (Attribute.DefinePInvokeMethod): Gets default charset from
544         module settings.
545         (GlobalAttribute.ResolveAsTypeStep): Override.
546         (GlobalAttribute.ResolveArguments): Override.
547         
548         * class.cs (TypeAttr): Is protected.
549         
550         * codegen.cs (ModuleClass.DefaultCharSet): New member.
551         (ModuleClass.DefaultCharSetType): New memeber.
552         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
553         
554         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
555         charset from module.
556         
557         * delegate.cs (TypeAttr): Override.
558         (Delegate.DefineType): Use this TypeAttr.
559         
560         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
561         at very early stage (before types are defined) to resolve model
562         module attributes. It will probably not work with corlib but it
563         should be ok.
564         
565         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
566         charset from module.
567         
568         * typemanager.cs (default_charset_type): New type.
569
570 2005-04-13  Raja R Harinath  <rharinath@novell.com>
571
572         * decl.cs (MemberCache.AddMethods): Don't warn if
573         System.Object.Finalize has buggy MethodAttributes.
574
575         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
576         removed below.
577
578 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
579
580         * doc.cs : detect ambiguous reference to overloaded members.
581           Fixed bug #71603. MS 1.1 csc does not detect it.
582
583 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
584
585         * doc.cs : delegates must not be referenced with parameters.
586           Fixed bug #71605.
587
588 2005-04-12  Miguel de Icaza  <miguel@novell.com>
589
590         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
591
592 2005-04-10  Miguel de Icaza  <miguel@novell.com>
593
594         * driver.cs (MainDriver): Stop processing if the CLS stage found
595         errors. 
596
597         (CompilerCallableEntryPoint.InvokeCompiler): Always
598         reset after execution;   Take a TextWriter argument for the
599         output.
600
601         * report.cs: Use the error stream instead of hardcoding stderr. 
602
603 2005-04-09  Miguel de Icaza  <miguel@novell.com>
604
605         * class.cs: Reduce code paths to test, too small of an
606         optimization to make it worth the extra testing.  Always perform
607         it. 
608
609 2005-04-08  Raja R Harinath  <rharinath@novell.com>
610
611         Fix #74510.
612         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
613         operators that had errors reported on them.
614
615 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
616
617         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
618         argument types.
619         (Attribute.Resolve): Add named argument type checking.
620         
621         * class.cs (FixedField.Define): Use IsPrimitiveType
622         
623         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
624         
625         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
626         unsafe parameter types.
627         
628         * statement.cs (Using.ResolveExpression): Add better error description.
629         
630         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
631         
632 2005-04-08  Raja R Harinath  <rharinath@novell.com>
633
634         Fix #74484.
635         * attribute.cs (Attribute.GetAttributeUsage): Resolve
636         AttributeUsageAttribute in the emitcontext of the attribute class,
637         not in the emitcontext of the attributable entity it was attached to.
638         * cs-parser.jay: Use 'current_class', not 'current_container',
639         when creating a GlobalAttribute.
640
641 2005-04-08  Alp Toker  <alp@atoker.com>
642
643         * pending.cs: The fix to #58413 failed to compile methods implementing
644         interfaces with/without params modifiers and vice versa, even though
645         params modifiers aren't part of the signature. Make the modifier check
646         less strict as in csc.
647
648 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
649             Anoob V E  <projectmonokochi@rediffmail.com>
650             Harilal P R  <projectmonokochi@rediffmail.com>
651
652         Fix #58413.
653         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
654         modifiers of pending methods.
655         (PendingImplementation.PendingImplementation): Initialize it.
656         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
657         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
658         with ParameterData.  Add check for modifiers.
659         * class.cs (MethodData.Define): Update to changes.
660
661 2005-04-07  Raja R Harinath  <rharinath@novell.com>
662
663         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
664
665 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
666
667         * class.cs (PropertyMethod.Define): Check private accessor in abstract
668         property.
669         
670         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
671         
672         * rootcontext.cs,
673         * typemanager.cs: Registered RequiredAttributeAttribute.
674         
675 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
676
677         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
678         Warning CS0169 is back at level 3.
679         (IMethodData.SetMemberIsUsed): New method.
680         
681         * decl.cs (IsUsed): New value; moved from FieldBase.Status
682         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
683         
684         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
685
686         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
687         contants.
688         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
689         is used.
690         
691         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
692         is used.
693         
694         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
695         to avoid the problems with nested types.
696
697 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
698             Anoob V.E  <projectmonokochi@rediffmail.com>
699             Harilal P.R  <projectmonokochi@rediffmail.com>
700             Raja R Harinath  <rharinath@novell.com>
701
702         Fix #73820.
703         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
704         attribute.
705         * typemanager (GetConstructor): Make public.
706
707 2005-04-05  John Luke  <john.luke@gmail.com>
708             Raja R Harinath  <rharinath@novell.com>
709
710         Fix #62232.
711         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
712         struct too.  Return false quicker in a few cases.
713         (VerifyUnManaged): Use it.
714
715 2005-04-05  Raja R Harinath  <rharinath@novell.com>
716
717         Fix #74041.
718         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
719         not 'unreachable_seen'.
720
721 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
722
723         * attribute.cs (Attribute.GetValue): Removed unused.
724         
725         * codegen.cs (CodeGen.TrimExt): Removed unused.
726         
727         * cs-parser.jay (output): Removed unused.
728         
729         * cs-tokenizer.cs (hex_digits): Removed unused.
730         
731         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
732         
733         * expression.cs (Indirection.LoadExprValue): Removed unused.
734         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
735         
736         * iterators.cs (Iterator.param_types): Removed unused.
737         
738         * statement.cs (Goto.block): Removed unused.
739         (ToplevelBlock.did): Removed unused.
740         (Switch.ResolveConstantSwitch): Removed unused.
741
742 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
743
744         * rootcontext.cs: Allow mcs to bootstrap with the compilation
745         resetting thingy.
746
747 2005-04-01  Raja R Harinath  <rharinath@novell.com>
748
749         Fix #74232 and cs0208-3.cs.
750         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
751         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
752         unmanaged type.  Don't use FieldBuilders when 't' is a
753         TypeBuilder.  Use ModFlags and MemberType fields.
754         * class.cs (MemberBase.member_type): Rename from MemberType.
755         (MemberBase.MemberType): New property.  Determines member_type on
756         demand.
757         (MemberBase.DoDefine): Don't initialize MemberType here.
758         (FieldMember.Define): Likewise.
759
760 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
761
762         Fix #74241
763         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
764         Attributes are emitted there.
765         
766 2005-04-01  Raja R Harinath  <rharinath@novell.com>
767
768         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
769         keyword in 'partial enum' too.
770         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
771         is not allowed).
772         Report from Kamil Skalski <nazgul@omega.pl>.
773
774         Fix #74309.
775         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
776         have partial containers too.
777
778         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
779         in block' checks to Block.CheckInvariantMeaningInBlock.
780         * statement.cs (Block.GetKnownVariableInfo): Make private.
781         (Block.IsVariableUsedInChildBlock): Remove.
782         (Block.IsVariableUsedInBlock): Likewise.
783         (Block.CheckInvariantMeaningInBlock): New.  Show location of
784         conflicting declaration.
785         (Block.AddVariable): Make error messages less long-winded and more
786         specific.  Show location of conflicting declaration.
787         * parameter.cs (Parameters.Location): New readonly property.
788
789 2005-03-31  Raja R Harinath  <rharinath@novell.com>
790
791         Clean up semantics of invoking ResolveMemberAccess.
792         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
793         can have an instance, ensure that we pass in a non-TypeExpression
794         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
795         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
796         argument.  Update to changes and simplify.
797         (FieldExpr.Emitinstance): Remove CS0120 check.
798         (PropertyExpr.EmitInstance): Likewise.
799         * expression.cs (Argument.Resolve): Likewise.
800         (Invocation.DoResolve): Update to changes in semantics of
801         InstanceExpression.
802
803 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
804
805         Fix #74241
806         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
807         customization.
808         
809         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
810
811 2005-03-31  Raja R Harinath  <rharinath@novell.com>
812
813         Fix difference in behaviour with commandline invocation.
814         * driver.cs (Driver.Reset): New.
815         (CompilerCallableEntryPoint): Call it.
816
817         * statement.cs (If.Resolve): Avoid spurious "uninitialized
818         variable" warnings if the boolean expression failed to resolve.
819
820 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
821
822         * attribute.cs: Fix the union of several permissions when some of them
823         are unrestricted (so the result isn't an unrestricted permission set).
824         Fix #74036.
825
826 2005-03-30  Raja R Harinath  <rharinath@novell.com>
827
828         * ecore.cs (MemberExpr): New class.  Convert from interface
829         IMemberExpr.
830         (MemberExpr.ResolveMemberAccess): Refactor and move here from
831         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
832         error checks.
833         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
834         (MethodGroupExpr.IsExplicitImpl): Remove.
835         (Expression.GetFieldFromEvent): Remove.
836         (SimpleName.MemberStaticCheck): Remove.
837         (SimpleName.DoSimpleNameResolve): Update to changes.
838         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
839         (MemberAccess.IdenticalNameAndTypeName): Remove.
840         (MemberAccess.error176): Move to MemberExpr.
841         (MemberAccess.DoResolve): Update to changes.
842         (BaseAccess.DoResolve): Likewise.
843
844 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
845
846         C# 2.0 Conditional attribute class implementation
847         
848         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
849         Analyzes class whether it has attribute which has ConditionalAttribute
850         and its condition is not defined.
851         
852         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
853         (Class.IsExcluded): New method. Search for at least one defined
854         condition in ConditionalAttribute of attribute class.
855
856 2005-03-30  Raja R Harinath  <rharinath@novell.com>
857
858         * ecore.cs (PropertyExpr): Derive from Expression, not
859         ExpressionStatement.
860         (PropertyExpr.EmitStatement): Remove.
861
862 2005-03-29  Raja R Harinath  <rharinath@novell.com>
863
864         Fix #74060.
865         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
866         internal field "value__" of an enum be private.  The examples for
867         "value__" that I found on MSDN all used FieldAttributes.Private.
868
869         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
870         Don't mention IL method attribute names.
871
872         Fix #47991.  Remove a TODO.
873         * statement.cs (Block.Toplevel): Make into a field.
874         (Block.Parameters): Move into ToplevelBlock.
875         (Block.known_variables): Rename from child_variable_names.
876         (Block.Block): Remove variants that take Parameters.  Initialize
877         'Toplevel' with the immediately surrounding toplevel block.
878         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
879         LocalInfo parameter.
880         (Block.GetKnownVariableInfo): New.
881         (Block.IsVariableNameUsedInChildBlock): Update.
882         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
883         the block, even though it may not be in scope.
884         (Block.AddVariable): Remove Parameters parameter.  Use
885         Toplevel.Parameters instead.
886         (Block.AddConstant): Remove Parameters parameter.
887         (Block.GetParameterReference): Update to use Toplevel.Parameters.
888         (Block.IsParamaterReference): Likewise.
889         (Block.IsLocalParameter): Likewise.  Simplify a lot.
890         (ToplevelBlock.Parameters): New.  Moved from Block.
891         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
892         initialize Parameters to a non-null value.
893         * cs-parser.jay: Update to changes.
894         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
895         simple names that mean different things in the same block.  Use
896         Block.IsVariableNameUsedInBlock.
897
898 2005-03-28  Raja R Harinath  <rharinath@novell.com>
899
900         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
901         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
902         GetTypeHandle.  It is possible for a reflected type to derive from
903         a TypeBuilder (e.g., int[] derives from the TypeBuilder
904         System.Array during mscorlib compilation).
905         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
906         contain a method_hash, don't create one either.  Don't create a
907         deep copy of the base cache's method_hash.
908         (MemberCache.SetupCache): Rename back from DeepCopy.
909         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
910         already initialized.  If we see an override function, add its
911         underlying base virtual function to the member_hash too.
912
913         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
914
915 2005-03-26  Raja R Harinath  <harinath@acm.org>
916
917         Fix #73038.
918         * assign.cs (Assign.DoResolve): When the RHS of an assignment
919         fails to resolve, ensure that the LHS is still resolved as an
920         lvalue.
921
922 2005-03-25  Raja R Harinath  <harinath@acm.org>
923
924         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
925         ec.ContainerType.
926         (Enum.current_ec): Remove.
927         (Enum.LookupEnumValue): Remove EmitContext argument.
928         Just uses the one created during DefineType.
929         (Enum.FindMembers): Update.
930         * expression.cs (MemberAccess.DoResolve): Update.
931
932 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
933
934         * assign.cs (Assign.DoResolve): Check for CS1717 when
935         source and target are same (uses Equals).
936
937         * expression.cs (LocalVariableReference, ParameterReference,
938         This): Implemented Equals, GetHashCode.
939
940         * statement.cs (Block.GetParameterReference): Removed useless
941         local variable.
942
943 2005-03-22  Raja R Harinath  <rharinath@novell.com>
944
945         Fix cs0128.cs
946         * statement.cs (Block.AddVariable): Ensure that we skip implicit
947         blocks before deciding whether the error is cs0136 or cs0128.
948
949         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
950         (using_alias_directive, using_namespace_directive): Pass
951         MemberName, not an expression to Namespace.UsingAlias and
952         Namespace.Using.
953         (MakeName): Use the MemberName of the namespace.
954         * namespace.cs (Namespace.MemberName): New.
955         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
956         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
957         Likewise.
958         * decl.cs (MemberName.Name): Make readonly.
959         (MemberName.FromDotted): New "constructor".
960         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
961         (MemberCore.Name): Compute from MemberName on demand.
962         (MemberCore.SetMemberName): Provide a way to change the
963         MemberName.
964         (MemberCore.AddToContainer): Don't take a fullname parameter.
965         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
966         fully qualified name of the container to the member name.
967         (TypeContainer.AddToTypeContainer): Use a fully qualified name
968         only if the type is a member of the root container.
969         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
970         MemberName.Left rather than searching for an embedded ".".
971         (PartialContainer.CreatePart): Update to changes in RootContext.
972         (MemberBase.ShortName): Turn into a property.  Use
973         MemberCore.SetMemberName.
974         (MemberBase.ExplicitInterfaceName): Remove.
975         (MemberBase.UpdateMemberName): Remove.
976         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
977         (PropertyBase.SetMemberName): New override.
978         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
979         (Tree.GetDecl): New.
980         (Tree.AllDecls): Rename from Decls.
981         * attribute.cs, enum.cs, report.cs: Update to changes.
982         * driver.cs (MainDriver): Use MemberName.FromDotted on
983         RootContext.MainClass.
984
985 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
986
987         * class.cs (FixedField.Define): Check for CS1664 and more sanity
988         checks.
989
990         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
991
992 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
993
994         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
995         property accessor modifiers.
996
997         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
998         fixed buffer attribute (CS1716).
999         (PropertyMethod.HasCustomAccessModifier): When property accessor
1000         has custom modifier.
1001
1002         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
1003         modifiers.
1004         (PropertyExpr.DoResolveLValue): Add CS0272.
1005
1006 2005-03-17  Miguel de Icaza  <miguel@novell.com>
1007
1008         * convert.cs: When converting to a pointer, use the proper Conv.U
1009         or Conv.I depending on the source data type.
1010
1011         * cs-tokenizer.cs: Make the size for large decimal constants,
1012         fixes #72957.
1013
1014 2005-03-17  Martin Baulig  <martin@ximian.com>
1015
1016         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1017         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1018
1019 2005-03-17  Martin Baulig  <martin@ximian.com>
1020
1021         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1022         to bool so we can return an error condition.
1023         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1024         returned an error.
1025
1026 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
1027
1028         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
1029         attributes.
1030
1031 2005-03-16  Raja R Harinath  <rharinath@novell.com>
1032
1033         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
1034         Refactor to avoid traversing the list of assemblies, and to avoid
1035         string concatenation.
1036         * typemanager.cs (guid_attr_type): Remove.
1037         (negative_hits, pointers, references): Remove hashes.
1038         (type_hash): New.
1039         (GetConstructedType): New.  Uses type_hash to handle constructed
1040         types (arrays, references, pointers).
1041         (GetReferenceType, GetPointerType): Use it.
1042         (GetNestedType): New.  Uses type_hash to handle nested types of
1043         reflected types.
1044         (LookupType, LookupTypeDirect): Remove.
1045         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
1046         'types' hash and LookupTypeReflection directly.
1047         (params_string, params_object): Use GetConstructedType.
1048         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
1049         top-level types.
1050         (Namespace.Lookup): Use cached_types.
1051         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
1052         provided by old TypeManager.LookupType.
1053         * rootcontext.cs (MakeFQN): Remove.
1054         * decl.cs (DeclSpace.MakeFQN): Likewise.
1055         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
1056         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
1057         TypeManager.GetConstructedType.
1058         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
1059
1060 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
1061
1062         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
1063         indexers.
1064
1065         * cs-parser.jay: Reports CS1527 for any namespace element.
1066
1067         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
1068         Added CS0407.
1069
1070         * expression.cs (ParameterReference.IsAssigned): Changed error to
1071         CS0269.
1072         (Error_WrongNumArguments): Moved CS0245 detection here.
1073
1074         * statement.cs (Return.Resolve): Add CS1622 report.
1075
1076 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
1077
1078         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
1079
1080 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
1081
1082         * attribute.cs expression.cs: Get rid of some allocations.
1083
1084 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
1085
1086         * doc.cs : just eliminate the latest change.
1087
1088 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1089
1090         * doc.cs : commented out the latest change. It breaks xml-030.cs
1091
1092 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1093
1094         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
1095           fail. So invoke CreateType() in FindDocumentedType().
1096
1097 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
1098
1099         * cs-tokenizer.cs : added IsKeyword().
1100         * doc.cs : Detect keyword incorrectly used as identifier.
1101           Allow identifiers prefixed by @.
1102
1103 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
1104
1105         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
1106         It caused exception in namespace resolving (again!).
1107         
1108         * class.cs (Class.ctor): Removed exit.
1109         (PropertyMethod.ctor): ditto.
1110         
1111         * codegen.cs (Codegen.Reset): Reset static data.
1112         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
1113         
1114         * cs-tokenizer.cs (Cleanup): Removed.
1115         
1116         * driver.cs (GetSystemDir): Rewrote to one line command.
1117         It caused problem with unloaded dynamic modules.
1118         (UnixParseOption): Removed Exit.
1119         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
1120         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
1121         Now can be mcs used as library.
1122         
1123         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
1124         empty location.
1125         
1126         * location.cs (Reset): Reset static data.
1127         
1128         * namespace.cs (Reset): Reset static data.
1129         
1130         * report.cs (Report.Reset): Reset static data.
1131         
1132         * rootcontext.cs (RootContext.Reset): Reset static data.
1133         
1134         * tree.cs (RootTypes.ctor): Use Location.Null
1135         
1136         * typemanager.cs (TypeManager.Reset): Reset static data.
1137         (CoreLookupType): Removed Exit.
1138         (TypeHandle.Reset): Reset static data.
1139         
1140 2005-03-10  Raja R Harinath  <rharinath@novell.com>
1141
1142         Fix #73516.
1143         * typemanager.cs (ComputeNamespaces): Import namespaces from
1144         referenced modules too.
1145
1146 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1147
1148         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
1149         than '.'.
1150
1151 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1152
1153         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
1154         enclosing DeclSpace.  This ensures that a name-lookup populates
1155         more caches and there are fewer 'TypeExpression's.  Carve out
1156         nested type lookup into ...
1157         (LookupNestedTypeInHierarchy): ... this.
1158
1159 2005-03-09  Raja R Harinath  <rharinath@novell.com>
1160
1161         Clean up a few partial-class semantics.  
1162         Fixes test-357.cs and cs1618-2.cs.
1163         * cs-parser.jay (struct_declaration): Use 'current_class' as
1164         parent of newly-created struct.  Remove call to Register ().
1165         Use 'pop_current_class' to complete handing the current struct.
1166         (interface_declaration): Likewise.
1167         (class_declaration): Likewise.
1168         (enum_declaration): Use 'current_class' as parent of newly created
1169         enum.
1170         (delegate_declaration): Likewise.
1171         (pop_current_class): New function.  This is used to handle closing
1172         up the 'current_class' and 'current_container', and pointing them
1173         to the enclosing class/container.
1174         (CSharpParser): Initialize 'current_class' too.
1175         * decl.cs (MemberCore): Add check for invariant: a partial
1176         container is not a parsed entity, and thus does not enclose any
1177         parsed members.
1178         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
1179         (DeclSpace.BaseTypeExpr): Use it.
1180         (DeclSpace.LookupType): Add check for invariant.
1181         * class.cs (TypeContainer): Add check for invariant: a nested
1182         class should have the same NamespaceEntry as its enclosing class.
1183         (TypeContainer.EmitFieldInitializers): Make virtual.
1184         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
1185         MemberCore.
1186         (TypeContainer.Register): Remove.
1187         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
1188         null.  Use TypeResolveEmitContext for resolving base types and
1189         interfaces.  Move initialization of Parts.TypeBuilder here from
1190         ...
1191         (TypeContainer.DefineNestedTypes): ... here.
1192         (PartialContainer): Take a Namespace not a NamespaceEntry.
1193         (PartialContainer.Create): Don't use Register.  Call the
1194         appropriate Add... function directly.
1195         (ClassPart): Take both the PartialContainer and the enclosing
1196         class as constructor arguments.
1197         (ClassPart.EmitFieldInitializers): Override.
1198         (ClassPart.PartFindNestedTypes): Remove.
1199         (FieldBase.GetInitializerExpression): Resolve the initializer
1200         expression in the emit context of the enclosing class.
1201         * tree.cs (RootTypes): Remove Register ().
1202         
1203 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
1204
1205         * cs-parser.jay: Removed CS0134.
1206         
1207         * driver.cs: Removed CS1901.
1208         
1209         * expression.cs (SizeOf.DoResolve): Don't report CS0233
1210         for predefined types.
1211
1212 2005-03-07  Duncan Mak  <duncan@novell.com>
1213
1214         * codegen.cs (Save):  Catch UnauthorizedAccessException as
1215         well. Fixes bug #73454.
1216
1217 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
1218
1219         * cs-tokenizer.cs (xtoken): Add CS1035.
1220         
1221         * class.cs (MethodData.Define): Add CS0683.
1222         (FieldMember.ctor): Add CS0681.
1223
1224 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1225
1226         * ecore.cs (SimpleName.DoResolve): Rename from
1227         SimpleName.DoResolveAllowStatic.
1228         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1229         Pass 'intermediate' flag to MemberStaticCheck.
1230         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1231         of "intermediate" lookups via MemberAccess.
1232         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1233         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1234
1235 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1236
1237         Fix #73394.
1238         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1239         slipped in because of variable names that are identical to a
1240         builtin type's BCL equivalent ('string String;', 'int Int32;').
1241         (PropertyExpr.EmitInstance): Likewise.
1242
1243 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1244
1245         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1246         
1247         * report.cs (warning_ignore_table): Made public.
1248
1249 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1250
1251         Fix #73282.
1252         * class.cs (MethodData.Emit): Pass 'container' to
1253         container.GetObsoleteAttribute instead of 'container.Parent'.
1254
1255 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1256
1257         * cs-parser.jay: Add 1534 error test.
1258
1259         * iterators.cs (Yield.CheckContext): Add error 1629.
1260         (Iterator.ctor): Save unsafe modifier.
1261         (MoveNextMethod.DoEmit): Restore unsafe context.
1262
1263         * namespace.cs (UsingAlias): Better error message.
1264
1265 2005-03-03  Dan Winship  <danw@novell.com>
1266
1267         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1268         the warning message [#73219]
1269
1270 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1271
1272         Fix compile with MCS 1.0.0.0.
1273         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1274         w_restore to not depend on string constant folding.
1275
1276 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1277
1278         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1279         CS0246 check to users who passed 'silent = false'.
1280         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1281         check.
1282         (SimpleName.SimpleNameResolve): Update.
1283         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1284         (MemberAccess.IdenticalNameAndTypeName): Update.
1285         * doc.cs (FindDocumentedTypeNonArray): Update.
1286
1287 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1288
1289         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1290         * parameters.cs (ComputeAndDefineParameters): Remove.
1291         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1292         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1293         Use GetParameterInfo.
1294
1295 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1296
1297         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1298
1299 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1300
1301         Unify DeclSpace.LookupType and DeclSpace.FindType.
1302         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1303         is in charge of defining nested types on demand.
1304         (DeclSpace.LookupType): Use it when the current_type is a
1305         TypeBuilder.  Use LookupTypeDirect for reflected types.
1306         (DeclSpace.FindType): Remove.
1307         (DeclSpace.LookupInterfaceOrClass): Likewise.
1308         (DeclSpace.DefineTypeAndParents): Likewise.
1309         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1310         DeclSpace.LookupType.
1311         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1312         * typemanager.cs (LookupType): Simplify.
1313         (AddUserType): Remove type from negative_hits.
1314         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1315         * class.cs (TypeContainer.FindMembers): Move handling of nested
1316         types ...
1317         (TypeContainer.FindMembers_NestedTypes): ... here.
1318         (TypeContainer.FindNestedType): Implement override.
1319         (ClassPart.FindNestedType): Delegate to PartialContainer.
1320         (ClassPart.PartFindNestedType): Looks up the nested types of the
1321         part alone.
1322
1323 2005-03-02  Martin Baulig  <martin@ximian.com>
1324
1325         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1326         static constructor in static classes.
1327
1328 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1329
1330         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1331         sizeParamIndex is not specified.
1332
1333 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1334
1335         Fix #73117
1336         * report.cs (WarningMessage.IsEnabled): Missing null check.
1337
1338 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1339
1340         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1341         in the fields and not in the properties.
1342
1343 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1344
1345         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1346         fields as well.
1347
1348 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1349
1350         * attribute.cs: Small refactoring (improved robustness).
1351         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1352         (ValidateGuid): Removed.
1353         (Resolve): Removed referenced to above mentioned.
1354         (GetAttributeUsage): Made private and changed to work without
1355         class assistance.
1356         (GetIndexerAttributeValue): Don't crash.
1357         (GetConditionalAttributeValue): Ditto.
1358         (GetClsCompliantAttributeValue): Ditto.
1359         (ExtractSecurityPermissionSet): All attributes exceptions are
1360         error 648.
1361         (GetPropertyValue): New helper.
1362         (GetMethodImplOptions): New method.
1363         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1364         some missing properties.
1365         
1366         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1367         (Method.ApplyAttributeBuilder): Updated.
1368         
1369         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1370         exception.
1371
1372 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1373
1374         Fix #73052.
1375         * report.cs (Report.SymbolRelatedToPreviousError): Handle
1376         non-simple types (array, pointer, reference).
1377
1378 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1379
1380         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
1381
1382         * class.cs (MethodCore.IsDuplicateImplementation): Special error
1383         for operators.
1384         (Method.CheckBase): Catch wrong destructor here.
1385         (MethodData.Define): Add errors 550, 668.
1386
1387         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
1388
1389         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
1390
1391         * pending.cs (VerifyPendingMethods): Add error 551.
1392
1393         * typemanager.cs (CSharpName): Next error report helper.
1394
1395 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
1396
1397         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
1398         attributes. Removed useless attribute double check.
1399         It saves almost 2MBs for corlib.
1400
1401 2005-02-25  Raja R Harinath  <rharinath@novell.com>
1402
1403         Fix #72924.
1404         * statement.cs (ExpressionStatement.Resolve): Make robust to being
1405         called twice in case of error.
1406
1407 2005-02-23  Chris Toshok  <toshok@ximian.com>
1408
1409         Fix compiler portions of #72827.
1410         * statement.cs (Block.Emit): call Begin/EndScope on the
1411         EmitContext instead of the ILGenerator.
1412
1413         * codegen.cs (EmitContext.BeginScope): new method, call
1414         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
1415         we have one.)
1416         (EmitContext.BeginScope): same, but EndScope and CloseScope
1417
1418         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
1419         offset and call the superclass's OpenScope(int) with it.
1420         (SymbolWriter.CloseScope): get the current il
1421         offset and call superclass's CloseScope(int) with it.
1422
1423 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
1424
1425         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
1426         CS1677 for out and ref as well.
1427
1428         * class.cs (Method.Define): Add error CS1599 detection.
1429         
1430         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
1431         
1432         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
1433         
1434         * delegate.cs (Delegate.Define): Add error CS1599 detection.
1435         
1436         * support.cs.cs (ModifierDesc): New helper method.
1437
1438 2005-02-23  Raja R Harinath  <rharinath@novell.com>
1439             Abin Thomas  <projectmonokochi@rediffmail.com>
1440             Anoob V E  <projectmonokochi@rediffmail.com>
1441             Harilal P R  <projectmonokochi@rediffmail.com>
1442
1443         Fix #57851, #72718.
1444         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
1445         MemberLookup (used for error reporting) actually returns a result.
1446         Fix error report number (122, not 112).
1447
1448 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
1449             Anoob V E  <projectmonokochi@rediffmail.com>
1450             Harilal P R  <projectmonokochi@rediffmail.com>
1451
1452         Fix #71134.
1453         * pending.cs (PendingImplementation.GetAbstractMethods):
1454         Find NonPublic members too.
1455
1456 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
1457
1458         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
1459         Fixed error 217.
1460         
1461         * class.cs (MethodCore.CheckMethodAgainstBase):
1462         Add error 239 report.
1463
1464 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1465
1466         Fix #68955.
1467         * expression.cs (Invocation.IsApplicable): Make public.
1468         (Invocation.IsParamsMethodApplicable): Likewise.
1469         * delegate.cs (Delegate.VerifyApplicability): Don't use
1470         Invocation.VerifyArgumentCompat for parameter applicability
1471         testing.  Use Invocation.IsApplicable and
1472         Invocation.IsParamsMethodApplicable.
1473
1474 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1475
1476         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1477         
1478         * class.cs (Operator.Define): Add error 217 report.
1479         
1480 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1481
1482         * namespace.cs (UsingEntry.Resolve): Undo change below.
1483
1484 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1485
1486         Fix #72756.
1487         * ecore.cs (Expression.MemberLookupFailed): Add argument to
1488         disable the error message when the extended MemberLookup also
1489         fails.
1490         (Expression.MemberLookupFinal): Update.
1491         (SimpleName.DoSimpleNameResolve): Update.
1492         * expression.cs (MemberAccess.ResolveNamespaceOrType):
1493         Don't use MemberLookupFinal.
1494         (New.DoResolve): Update.
1495         (BaseAccess.CommonResolve): Update.
1496
1497 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1498
1499         Fix #72732.
1500         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
1501         occured previously, don't resolve again.
1502
1503 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1504
1505         Fix #69949
1506         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
1507         argument. Call ResolveAttributeUsage for unresolved.
1508         when types doesn't match ctor arguments.
1509         
1510         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
1511         for nested attribute classes.
1512         (Class.attribute_usage): Removed.
1513         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
1514         for attribute class.
1515         
1516         * ecore.cs (IsAttribute): Removed.
1517         
1518         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
1519         
1520         * rootcontext.cs (RegisterAttribute): Removed, attributes are
1521         now normal types.
1522         (attribute_types): Removed.
1523         (EmitCode): Global attributes are emited as the latest.
1524
1525 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
1526
1527         * class.cs (EmitFieldInitializers): Don't emit field initializer
1528         for default values when optimilization is on.
1529         
1530         * constant.cs (Constant.IsDefaultValue): New property.
1531         
1532         * driver.cs: Add /optimize handling.
1533         
1534         * constant.cs,
1535         * ecore.cs,
1536         * literal.cs: Implement new IsDefaultValue property.
1537         
1538         * rootcontext.cs (Optimize): New field, holds /optimize option.
1539
1540 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1541
1542         Fix crasher in re-opened #72347.
1543         * namespace.cs (Namespace.Lookup): Return null if
1544         DeclSpace.DefineType returns null.
1545
1546         Fix #72678.
1547         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
1548
1549 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1550
1551         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
1552         now returns null if it cannot resolve to an lvalue.
1553         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1554         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1555         returned null.  Remove check for SimpleName.
1556         (EventExpr.DoResolveLValue): New.
1557         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1558         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
1559         error from ...
1560         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
1561         avoid CS0131 error.
1562         (Unary.ResolveOperator): Move CS0211 check ...
1563         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
1564         CS0131 error.
1565         (Unary.DoResolveLValue): Simplify.
1566         (AddressOf.DoResolveLValue): New.
1567         (ArrayAccess.DoResolveLValue): New.
1568
1569 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
1570
1571         * attribute.cs (Attribute.Resolve): Add arguments casting for
1572         when types doesn't match ctor arguments.
1573
1574 2005-02-16  Raja R Harinath  <rharinath@novell.com>
1575
1576         Fix parts of #63202.
1577         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1578         lookup of operator in base type.  Ensure that all checks happen
1579         when the operator resolves to an "op_..." method.
1580
1581 2005-02-15  Raja R Harinath  <rharinath@novell.com>
1582
1583         Fix #71992.
1584         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1585         'ignore_cs0104' parameter.  Pass it to ...
1586         (NamespaceEntry.Lookup): ... this.
1587         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1588         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1589         (TypeLookupExpression.DoResolveAsTypeStep): Update.
1590         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1591         Update.  Request that cs0104 errors be ignored.
1592         (ComposedCast.ResolveAsTypeStep): Update.
1593
1594 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1595
1596         Fix #59209.
1597         * expression.cs (Invocation.BetterFunction): Remove support for
1598         comparing virtual functions and their overrides.
1599         (Invocation.IsOverride): New.
1600         (Invocation.OverloadResolve): Don't consider 'override' functions
1601         during candidate selection.  Store them in a lookaside list.
1602         If the selected method is a 'virtual' function, use the list to
1603         find any overrides that are closer to the LHS type.
1604
1605 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
1606
1607         * expression.cs (New.DoResolve): Add complex core type reduction.
1608         (New.Constantify): Converts complex core type syntax like 'new int ()'
1609         to simple constant.
1610         
1611 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1612
1613         * decl.cs (EntryType.EntryType): New constructor to create an
1614         updated copy of a cache entry.
1615         (MemberCache.AddMethods): Use it.
1616         (MemberCache.ClearDeclaredOnly): Remove.
1617         (MemberCache.MemberCache): Update.
1618
1619 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1620
1621         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1622         variable.  This one is represents the actual low-level declaration
1623         of the method, as opposed to the semantic level `IsStatic'.   
1624
1625         An anonymous method which is hosted into a static method might be
1626         actually an instance method.  IsStatic would reflect the
1627         container, while MethodIsStatic represents the actual code
1628         generated.
1629
1630         * expression.cs (ParameterReference): Use the new MethodIsStatic
1631         instead of IsStatic.
1632
1633         * anonymous.cs (AnonymousMethod.Compatible): Pass the
1634         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1635         set on the current EmitContext. 
1636
1637         * expression.cs (Cast): Overload DoResolveLValue so we can pass
1638         resolve our casted expression as an LValue.  This triggers the
1639         proper LValue processing that is later required by Assign.
1640
1641         This fixes 72347.
1642
1643         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1644
1645 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
1646
1647         C# 2.0 Fixed buffer implementation
1648
1649         * anonymous.cs: Update after RegisterHelperClass renaming.
1650
1651         * attribute.cs (AttributeTester.fixed_buffer_cache):
1652         Cache of external fixed buffers.
1653         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
1654         implementation if field is fixed buffer else null.
1655
1656         * class.cs
1657         (TypeContainer.AddField): Accept FieldMember instead of Field.
1658         (FieldBase.IsFieldClsCompliant): Extracted code from
1659         VerifyClsCompliance descendant customization.
1660         (FixedField): New class handles fixed buffer fields.
1661         (FixedFieldExternal): Keeps information about imported fixed
1662         buffer.
1663         (IFixedField): Make access to internal or external fixed buffer
1664         same.
1665
1666         * cs-parser.jay: Add fixed buffer parsing.
1667
1668         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
1669         buffer.
1670
1671         * expression.cs (Indirection): Extended implementation to accept
1672         fixed buffer field.
1673         (PointerArithmetic.Emit): Get element from fixed buffer as well.
1674         (ElementAccess.MakePointerAccess): Get type as parameter.
1675         (DoResolve): Add fixed buffer field expression conversion.
1676         (DoResolveLValue): Ditto.
1677         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
1678         (ArrayPtr): Derives from FixedBufferPtr.
1679         (ArrayPtr.Emit): Add extra emit for array elements.
1680
1681         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
1682
1683         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
1684         for compiler generated types.
1685         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
1686
1687         * statement.cs (Fixed): Refactored to be easier add fixed buffer
1688         and consume less memory.
1689         (Fixed.Resolve): Add fixed buffer case.
1690
1691         * typemanager.cs (compiler_generated_attr_ctor,
1692         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
1693         (HasElementType): Add our own implementation to work on every
1694         runtime.
1695
1696 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1697
1698         * anonymous.cs (CaptureContext): Track whether `this' has been
1699         referenced.   
1700
1701         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
1702         only captured `this' if it was implicitly done (instance
1703         methods/variables were used). 
1704
1705         * codegen.cs (EmitContext.CaptureThis): New method to flag that
1706         `this' must be captured.
1707
1708 2005-01-30  Miguel de Icaza  <miguel@novell.com>
1709  
1710         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
1711         is null it means that there has been no need to capture anything,
1712         so we just create a sibling.
1713
1714         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
1715
1716         Just a partial fix.  The other half is fairly elusive.
1717         
1718 2005-02-10  Raja R Harinath  <rharinath@novell.com>
1719
1720         Fix #52586, cs0121-4.cs.
1721         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
1722         and return a hashtable.
1723         (MemberCache.ClearDeclaredOnly): New.
1724         (MemberCache.MemberCache): Update to change.  Make a deep copy of
1725         the method_hash of a base type too.
1726         (MemberCache.AddMethods): Adapt to having a deep copy of the base
1727         type methods.  Overwrite entries with the same MethodHandle so
1728         that the ReflectedType is correct.  The process leaves in base
1729         virtual functions and their overrides as distinct entries.
1730         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
1731         matters since it was boxed in a ArrayList before.
1732         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
1733         modifier.
1734         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
1735         case of a virtual function and its override (choose the overload
1736         as better).
1737         (Invocation.OverloadResolve): Avoid 'override' members during
1738         'applicable_type' calculation.
1739
1740 2005-02-09  Raja R Harinath  <rharinath@novell.com>
1741
1742         Combine two near-redundant caches.
1743         * typemanager.cs (method_params): Rename from method_internal_params.
1744         (TypeManager.GetParameterData): New.  Replace
1745         Invocation.GetParameterData.
1746         (TypeManager.LookupParametersByBuilder): Remove.
1747         * expression.cs (Invocation.method_parameter_cache): Remove.
1748         (Invocation.GetParameterData): Remove.
1749         Update to changes.
1750         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
1751         Update to changes.
1752
1753 2005-02-08  Raja R Harinath  <rharinath@novell.com>
1754
1755         Fix #72015.
1756         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
1757         TypeManager.multicast_delegate_type is null, resolve it by looking
1758         up "System.MulticastDelegate".
1759         * rootcontext.cs (RootContext.ResolveCore): Simplify.
1760
1761 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
1762             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
1763             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
1764
1765         Fix cs0164.cs.
1766         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
1767         (LabeledStatement.AddReference): New.  Set 'referenced'.
1768         (Goto.Resolve): Use it.
1769
1770 2005-02-05  John Luke  <john.luke@gmail.com>
1771
1772         * driver.cs: remove duplicate -doc line in Usage ()
1773
1774 2005-02-04  Raja R Harinath  <rharinath@novell.com>
1775
1776         * location.cs (Location.AddFile): Fix CS2002 error report.
1777
1778 2005-02-02  Martin Baulig  <martin@ximian.com>
1779
1780         * delegate.cs (Delegate.DefineType): Report an internal error if
1781         TypeManager.multicast_delegate_type is null.  See bug #72015 for
1782         details.        
1783
1784 2005-02-02  Raja R Harinath  <rharinath@novell.com>
1785
1786         Fix a crasher in a variant of #31984.
1787         * const.cs (Constant.CheckBase): New override that defers the
1788         new-or-override check in case the base type hasn't been populated
1789         yet.
1790         (Constant.Define): Ensure the new-or-override check is performed.
1791
1792 2005-02-01  Duncan Mak  <duncan@ximian.com>
1793
1794         * const.cs (LookupConstantValue): Check that `ce' is not null
1795         before calling GetValue ().
1796
1797 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1798
1799         Fix test-334.cs (#69519).
1800         * cs-parser.jay (using_alias_directive): Pass in an expression to
1801         NamespaceEntry.UsingAlias.
1802         (using_namespace_directive): Pass in an expression to
1803         NamespaceEntry.Using.
1804         (namespace_name): Don't flatten to a string.
1805         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
1806         (NamespaceEntry.AliasEntry.Resolve): Lookup using
1807         ResolveAsTypeStep.
1808         (NamespaceEntry.UsingEntry): Likewise.
1809         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
1810         changes.
1811         (NamespaceEntry.LookupForUsing): Remove.
1812         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
1813         names.
1814         (NamespaceEntry.Lookup): Remove support for dotted names.
1815
1816 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1817
1818         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
1819         split into two.
1820         (NamespaceEntry.ImplicitParent): Compute on demand.
1821         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
1822         parallels the current.
1823         (NamespaceEntry.LookupForUsing): Use it.
1824         (NamespaceEntry.Lookup): If the current namespace-entry is
1825         implicit, don't search aliases and using tables.
1826
1827 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1828
1829         Fix #31984.
1830         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
1831         BaseCache here.
1832         (TypeContainer.BaseCache): Compute on demand.
1833         (TypeContainer.FindMembers): Define constants and types if they're
1834         not already created.
1835         (FieldMember.Define): Move resetting of ec.InUnsafe before error
1836         check.
1837         * const.cs (Constant.Define): Make idempotent.
1838
1839 2005-01-29  Miguel de Icaza  <miguel@novell.com>
1840
1841         * pending.cs: Produce better code (no nops produced by using Ldarg
1842         + value).
1843         
1844         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
1845         i - 1' it should be arg + 1.
1846
1847         Fixes bug #71819.
1848
1849 2005-01-28  Raja R Harinath  <rharinath@novell.com>
1850
1851         * attribute.cs (Attribute.CheckAttributeType): Make private
1852         non-virtual.
1853         (Attribute.ResolveType): Make virtual.
1854         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
1855         handling of RootContext.Tree.Types.
1856
1857 2005-01-27  Raja R Harinath  <rharinath@novell.com>
1858
1859         Update attribute-handling to use the SimpleName/MemberAccess
1860         mechanisms.
1861         * cs-parser.jay (attribute): Pass in an expression to the
1862         constructors of Attribute and GlobalAttribute.
1863         * attribute.cs (Attribute): Take an expression for the name.
1864         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
1865         passed in attribute name expression.
1866         (Attribute.CheckAttributeType): Use it.
1867         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
1868         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
1869         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
1870         argument to prevent error messages if the lookup fails.
1871
1872 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
1873
1874         * expression.cs (Indirection): Implemented IVariable interface
1875         to support indirection in AddressOf operator.
1876         (PointerArithmetic.Emit): Add optimalization for case where
1877         result can be precomputed.
1878
1879 2005-01-26  Martin Baulig  <martin@ximian.com>
1880
1881         * class.cs (TypeContainer.AttributeTargets): Return the correct
1882         AttributeTargets depending on our `Kind' instead of throwing an
1883         exception; fixes #71632.
1884
1885 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
1886
1887         Fix #71257
1888         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
1889         constant members.
1890
1891 2005-01-25  Raja R Harinath  <rharinath@novell.com>
1892
1893         Fix #71602.
1894         * expression.cs (MemberAccess.DoResolve): Don't complain with
1895         cs0572 when the LHS of a member access has identical name and type
1896         name.
1897
1898 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
1899
1900         Fix #71651, #71675
1901         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
1902         CreatePermission.
1903         Create custom PermissionSet only for PermissionSetAttribute.
1904
1905 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
1906
1907         Fix #71649
1908         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
1909         delegates in static class.
1910
1911 2005-01-24  Martin Baulig  <martin@ximian.com>
1912
1913         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1914         merging an implicit block, just use its reachability.
1915
1916         * statement.cs (Block.Resolve): Make the unreachable code check
1917         work wrt. implicit blocks; see test-337 from #63842.
1918
1919 2005-01-21  Alp Toker  <alp@atoker.com>
1920  
1921         * cs-parser.jay: destructor_declaration's container is PartialContainer
1922         not Class when partial types are used, so use Kind prop instead of
1923         'is'.
1924         
1925 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
1926
1927         * cs-parser.jay: Improve error reporting when an interface
1928         declares new types.
1929
1930 2005-01-20  Dick Porter  <dick@ximian.com>
1931
1932         * support.cs: SeekableStreamReader fix from Sandor Dobos
1933         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
1934         chars are read.  Fixes bug 70369.
1935
1936 2005-01-20  Raja R Harinath  <rharinath@novell.com>
1937
1938         * cs-parser.jay (catch_clause): Simplify current_block handling
1939         somewhat.
1940
1941 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
1942
1943         * convert.cs (ImplicitStandardConversionExists): Synchronize the
1944         code with ImplicitStandardConversion to handle the implicit
1945         conversion of method groups into valid delegate invocations. 
1946
1947         The problem is that in parameter handling we were using this code
1948         path.  Fixes bug #64698
1949
1950 2005-01-19  Raja R Harinath  <rharinath@novell.com>
1951
1952         * cs-parser.jay: Fix several infelicities.
1953         - Avoid assigning to the parser value stack.  Code like 
1954           '$3 = null' is unclean.  Synthesize a value for the code block
1955           instead. 
1956         - Avoid using oob_stack for storing location information.  Use ...
1957         (_mark_): ... this.  New (empty) rule.  Saves the current location
1958         in $$.
1959         (foreach_statement): Avoid using oob_stack for current_block
1960         handling.  Use technique used in for_statement and
1961         using_statement.  Synthesize a value for the code block to store
1962         additional intermediate information.
1963
1964 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
1965
1966         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
1967         of a different type is only allowed to private fields of a
1968         containing type, not on fields of a base class.
1969
1970         See test-174.cs and error cs0122-9.cs
1971
1972 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1973
1974         Fix test-335.cs (bug #58126).
1975         * cs-parser.jay (argument): Split out non-expression parts of the
1976         rule into 'non_simple_argument'.
1977         (invocation_expression): Support parenthesized invocations with
1978         multiple arguments, and with single non-simple arguments.
1979
1980 2005-01-13  Raja R Harinath  <rharinath@novell.com>
1981
1982         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
1983         places.
1984
1985 2005-01-12  Raja R Harinath  <rharinath@novell.com>
1986
1987         Fix cs0038-1.cs, cs1640-6.cs.
1988         * ecore.cs (Expression.Resolve): Remove special-case for
1989         SimpleName in error-handling.
1990         (Expression.almostMatchedMembers): Relax access permission to
1991         protected.
1992         (Expression.MemberLookupFailed): Handle duplicates in
1993         almostMatchedMembers list.
1994         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
1995         * expression.cs (New.DoResolve): Report CS1540 for more cases.
1996         * typemanager.cs (GetFullNameSignature): Use the MethodBase
1997         overload if the passed in MemberInfo is a MethodBase.
1998
1999 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2000
2001         Fix #70749
2002         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2003         for non-CAS & merge permission sets properly.
2004
2005 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2006
2007         Improve standard-compliance of simple name and member access 
2008         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2009         * ecore.cs (FullNamedExpression): New abstract base class 
2010         for Namespaces and TypeExpressions.
2011         (ResolveFlags.SimpleName): Remove.
2012         (SimpleName): Remove support for dotted names.
2013         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2014         DeclSpace.FindType and DeclSpace.LookupType.
2015         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2016         (Expression.ExprClassName): Make member function.
2017         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2018         a namespace.  Remove creation of dotted "SimpleName"s.
2019         (MemberAccess.DoResolve): Likewise.
2020         * decl.cs (DeclSpace.Cache): Make private.
2021         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2022         (DeclSpace.FindType): Update.
2023         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2024         FullNamedExpression.
2025         * namespace.cs (Namespace): Derive from FullNamedExpression
2026         so that it can be part of expression resolution.
2027         (Namespace.Lookup): Return an FullNamedExpression.
2028         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2029         namespace.
2030         * rootcontext.cs (NamespaceLookup): Remove.
2031         (LookupType): Move to DeclSpace.
2032         * attribute.cs (CheckAttributeType): Update.
2033         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2034         (FindDocumentedTypeNonArray): Likewise.
2035
2036 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2037
2038         Fix cs0509.cs, cs1632.cs.
2039         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2040         is the same as IsInterface.
2041         (TypeContainer.GetClassBases): Likewise.
2042         * statement.cs (LabeledStatement.ig): New field.
2043         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2044         label.
2045         (LabeledStatement.DoEmit): Check that the label was created with
2046         the same ILGenerator.
2047
2048 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2049
2050         Fix #71058
2051         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2052         accessors to its properties.
2053
2054         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2055         from accessors to property.
2056         
2057 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2058
2059         Fix #70722
2060         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2061         only for overrides.
2062         
2063 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2064
2065         * attribute.cs: Check for null and empty strings.  
2066
2067         I have lost another battle to Paolo.
2068
2069 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2070
2071         Fix #70942
2072         * class.cs (PropertyMethod): Set Parent field in ctors.
2073         (SetMethod.InternalParameters): Add unsafe switch hack.
2074         Override MarkForDuplicationCheck where it is appropriate.
2075
2076         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2077         It says whether container allows members with the same name.
2078         Base default is no.
2079         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2080         Removed is_method parameter.
2081
2082 2005-01-06  Duncan Mak  <duncan@ximian.com>
2083
2084         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2085         because the previous change led to incorrect reporting of CS1032
2086         ("Cannot define/undefine preprocessor symbols after first token in
2087         file"). Instead of using `tokens_seen' as the only flag that
2088         triggers CS1040, introduce `comments_seen'. This new flag is used
2089         to signify having seen comments on the current line, so it is
2090         unset after a newline.
2091
2092 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2093
2094         * doc.cs : When searching for a type, find nested type too.
2095           This fixes bug #71040.
2096
2097 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2098
2099         * doc.cs :
2100           - Warn missing member comment on those classes which also does not
2101             have doc comments. Fixed bug #71041.
2102           - Don't warn missing doc comment on default constructor.
2103             Fixed bug #71042.
2104
2105 2005-01-06  Duncan Mak  <duncan@ximian.com>
2106
2107         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2108         comments, set `tokens_seen' to true. This allows us to detect
2109         misplaced preprocessor directives (i.e. not at the beginning of
2110         the a line, nor after whitespaces). In that case, report error
2111         CS1040. This fixes bug #56460.
2112
2113         * cs-parser.jay (interface_member_declaration): Add checks for
2114         IsExplicitImpl, and report CS0541 error if an interface member is
2115         defined as an explicit interface declaration.
2116
2117 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2118
2119         Fix #70817
2120         * class.cs (PropertyMethod): Set Parent field in ctors.
2121         (SetMethod.InternalParameters): Add unsafe switch hack.
2122         
2123         * decl.cs (MemberCore.Parent): Cannot be readonly.
2124
2125 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2126
2127         * decl.cs (DeclSpace.ResolveType): Remove.
2128         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2129         Merge in code from ...
2130         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2131         * class.cs, enum.cs: Update to changes.
2132
2133 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2134
2135         * anonymous.cs: Ensure that we init the scope of our parent if it
2136         has not been initialized yet.
2137
2138 2004-12-30  Duncan Mak  <duncan@ximian.com>
2139
2140         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2141         if field.FieldBuilder is null. Fixes #70758.
2142
2143         * convert.cs: Fixed some typos and updated some of the comments.
2144         (ImplicitStandardConversionExists):
2145         (TryImplicitIntConversion): If `target_type' is an interface and
2146         the type of `ic' implements this interface, return true or a new
2147         BoxedCast instead of null. This fixes #70468.
2148
2149 2004-12-29  Duncan Mak  <duncan@ximian.com>
2150
2151         * expression.cs (Argument.Emit): Check that Expr is
2152         IMemoryLocation before casting to it, and report CS1510 otherwise.
2153
2154         This fixes #70402.
2155
2156 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2157
2158         * statement.cs (Block.ThisVariable): remove the recursion here, to
2159         make the --profile more sane.
2160
2161 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2162
2163         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2164         assembly, by JB Evain.
2165
2166 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2167
2168         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2169           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2170         "parent" refers to enclosing type/class.  "base" refers to superclass.
2171
2172 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2173
2174         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2175         Ensure that we only have GlobalAttributes.
2176         * attribute.cs (Attribute.Emit): Make non-virtual.
2177         (GlobalAttribute.Emit): Remove.
2178         (Attribute.Resolve): Make virtual.
2179         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2180         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2181         the argument. Don't create one.
2182         (Attribute.GetObsoleteAttribute): Likewise.
2183         (Attribute.GetClsCompliantAttributeValue): Likewise.
2184         * class.cs, decl.cs: Update to changes.
2185
2186 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2187
2188         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2189         
2190         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2191         
2192         * statement.cs (Foreach.Resolve): Add error 186 report.
2193
2194 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2195
2196         * expression.cs (Conditional.DoResolve): Add warning 429.
2197         
2198         * statement.cs (If.Resolve): Add warning 665.
2199
2200 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2201
2202         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2203         except when in the parser, and in GlobalAttribute.
2204         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2205         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2206         RootContext.Tree.Types.NamespaceEntry once work is done.
2207         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2208         and resets RootContext.Tree.Types.NamespaceEntry.
2209
2210 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2211
2212         * cs-parser.jay: Don't create a block for every variable.
2213
2214 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2215
2216         * location.cs: Provide extra information.
2217
2218         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2219         variables from the captured environment, it is the ldarg_0.
2220
2221 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2222
2223         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2224         find a conclusion.
2225         
2226         * class.cs: Changed warning level for 169 to avoid developer
2227         displeasure from warning flooding. It will be changed back when they
2228         fix most of current BCL warnings.
2229         
2230         * RootContext.cs: Pushed default WarningLevel to 3.
2231         
2232         * statement.cs: Removed unused variable.
2233
2234 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2235
2236         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
2237         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
2238         Add error 502 report.
2239         (StaticClass.DefineType): Add error 441 report.
2240         (Class.AllowedModifiersProp): New virtual property as temporary
2241         extension to AllowedModifiers.
2242         (Class.DefineType): Add error 418 report. Moved ModFlags check here
2243         to share implementation with StaticClass and don't call virtual
2244         methods from ctor.
2245         
2246         * driver.cs (MainDriver): Add error 1558 test.
2247
2248         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
2249         report. Moved error 36 test here.
2250
2251         * statement.cs (Throw.Resolve): Add error 724 report.
2252
2253         * typemanager.cs: Add out_attribute_type core type.
2254         
2255 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
2256
2257         * class.cs (TypeContainer.VerifyClsCompliance): Add error
2258         3018 report.
2259         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
2260
2261         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
2262         3017 report.
2263         
2264         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
2265
2266         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
2267         Add error 3023 report.
2268         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
2269
2270         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
2271         implementation.
2272
2273 2004-12-12  John Luke  <john.luke@gmail.com>
2274
2275         * driver.cs (AddArgs): take -- into account when
2276         adding arguments, fixes bug 65710 
2277
2278 2004-12-12  Martin Baulig  <martin@ximian.com>
2279
2280         * expression.cs (Unary.TryReduceNegative): Added support for
2281         SByteConstant and ByteConstant.
2282         (Unary.Reduce): Check error values from TryReduceNegative().
2283
2284 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
2285
2286         * attributes.cs (Attribute.Resolve): Avoid multiple error report
2287         and report exception as error 182.
2288
2289 2004-12-10  Raja R Harinath  <rharinath@novell.com>
2290
2291         * driver.cs (Main): Fix message when there are warnings.
2292
2293 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
2294
2295         * delegate.cs: Fixed my fix from yesterday, sorry about that.
2296
2297 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
2298
2299         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
2300         Reduced number of warnings.
2301         
2302         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2303
2304 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
2305
2306         * driver.cs: Removed message.
2307
2308         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
2309
2310 2004-12-08    <vargaz@freemail.hu>
2311
2312         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2313
2314 2004-12-08  Martin Baulig  <martin@ximian.com>
2315
2316         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2317         instead of a CS3002 for properties and indexer.
2318
2319 2004-12-08  Martin Baulig  <martin@ximian.com>
2320
2321         * decl.cs (MemberName.ToString): Make this work again.
2322
2323 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
2324
2325         * attribute.cs (Resolve): Add error 591 detection.
2326
2327         * class.cs (FieldMember.Define): Add error 1547 detection.
2328         (Indexer.Define): Add error 620 detection.
2329         (Operator.Define): Add error 590 detection.
2330
2331         * ecore.cs: Missing argument for error 79.
2332
2333         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
2334         detection.
2335
2336 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
2337
2338         Fix #70106
2339         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
2340         only.
2341
2342 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2343
2344         * cs-parser.jay : handle doc comments on implicit/explicit operators.
2345           Some operator comments were suppressed.
2346         * doc.cs : Implicit/explicit operator name in doc comments are like
2347           "op_Explicit(type)~returnType", so added suffix handling.
2348
2349 2004-12-07  Martin Baulig  <martin@ximian.com>
2350
2351         * decl.cs
2352         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2353         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2354         (DeclSpace.ec): New protected field; store the EmitContext here.
2355         (DeclSpace.EmitContext): New public property; moved here from
2356         `TypeContainer'.
2357         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2358         EmitContext.
2359
2360         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2361         (Enum.Emit): Don't create a new EmitContext.
2362
2363         * delegate.cs (Delegate.DefineType): Always create the
2364         EmitContext.
2365
2366         * iterators.cs (Iterators.DefineIterator): Create a new
2367         EmitContext and store it in `ec'.
2368
2369 2004-08-24  Martin Baulig  <martin@ximian.com>
2370
2371         * typemanager.cs
2372         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
2373         this for accessibility checks.
2374         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
2375         IsNestedFamilyAccessible.
2376         (TypeManager.IsSubclassOf): New method, do what the name actually
2377         says.   
2378
2379 2004-12-06  Raja R Harinath  <rharinath@novell.com>
2380
2381         Fix crash on cs0657-17.cs.
2382         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2383         Use RootContext.Tree.Types, not 'new RootTypes ()'.
2384         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
2385         the case where the NamespaceEntry gets overwritten.
2386
2387 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
2388
2389         Fixed #69195, #56821
2390         * ecore.cs (ResolveBoolean): Tiny refactoring.
2391
2392         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
2393         of right expression resolving when left is false constant and
2394         operator is LogicalAnd OR true constant and operator is LogicalOr.
2395
2396         * statement.cs (ResolveUnreachable): Always reports warning.
2397
2398 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
2399
2400         * class.cs: Distinguish between 1721 and 1722 (just a little help
2401         for the programmer).
2402
2403 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
2404
2405         * delegate.cs: Only allow this on new versions of the language. 
2406
2407 2004-12-02  Duncan Mak  <duncan@ximian.com>
2408
2409         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
2410         Expression class.
2411         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
2412         here as a static method. Take an additional bool out parameter
2413         `must_do_cs1540_check' for signaling to InstanceResolve.
2414         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
2415         member field from PropertyExpr class and made it an argument of
2416         the method instead.
2417         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
2418         check for MarshalByRefObject, and report CS0122 instead of CS1540.
2419         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
2420         and `remove_accessor' as well as InstanceResolve: report CS0122
2421         where applicable.
2422
2423         Fixes #70129.
2424
2425 2004-12-03  Raja R Harinath  <rharinath@novell.com>
2426
2427         Fix test-327.cs, test-328.cs, and put in early infrastructure
2428         for eventually fixing #52697.
2429         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
2430         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
2431         from other methods.
2432         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
2433         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
2434         (VerifyUsing, error246): Update.
2435         * rootcontext.cs (RootContext.NamespaceLookup): Just use
2436         'NamespaceEntry.LookupNamespaceOrType'.
2437
2438 2004-12-03  Martin Baulig  <martin@ximian.com>
2439
2440         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
2441         method as our child, call AnonymousMethod.Compatible() on it.
2442
2443 2004-12-03  Raja R Harinath  <rharinath@novell.com>
2444
2445         Disable XML documentation support in 'basic' profile.
2446         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
2447         Redirect XmlElement to System.Object.
2448         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
2449         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
2450         * mcs.exe.sources: Add doc-bootstrap.cs.
2451         * doc-bootstrap.cs: New file.  Contains empty stub implementation
2452         of doc.cs.
2453
2454 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
2455
2456         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
2457           comments are allowed.
2458
2459 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2460
2461         * delegate.cs: Add checks for subtypes in paramaters and return values
2462         in VerifyMethod () to add support for Covariance/Contravariance
2463         in delegates.
2464         
2465 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
2466
2467         * report.cs: Remove extra closing parenthesis.
2468
2469         * convert.cs (Error_CannotImplicitConversion): If the name of the
2470         types are the same, provide some extra information.
2471
2472         * class.cs (FieldBase): Use an unused bit field from the field to
2473         encode the `has_offset' property from the FieldMember.  This saves
2474         a couple of Ks on bootstrap compilation.
2475
2476         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
2477         method as our child, return the AnonymousMethod resolved
2478         expression.
2479
2480         * expression.cs (New.DoResolve): Allow return values from
2481         NewDelegate to also include AnonymousMethods.
2482
2483         Fixes #70150.
2484
2485 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
2486
2487         Fix bug #70102
2488         * attribute.cs (Resolve): Improved implementation of params
2489         attribute arguments.
2490
2491         * support.cs (ParameterData): Add HasParams to be faster.
2492
2493 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
2494
2495         all things are for /doc support:
2496
2497         * doc.cs: new file that supports XML documentation generation.
2498         * mcs.exe.sources: added doc.cs.
2499         * driver.cs:
2500           Handle /doc command line option.
2501           Report error 2006 instead of 5 for missing file name for /doc.
2502           Generate XML documentation when required, after type resolution.
2503         * cs-tokenizer.cs:
2504           Added support for picking up documentation (/// and /** ... */),
2505           including a new XmlCommentState enumeration.
2506         * cs-parser.jay:
2507           Added lines to fill Documentation element for field, constant,
2508           property, indexer, method, constructor, destructor, operator, event
2509           and class, struct, interface, delegate, enum.
2510           Added lines to warn incorrect comment.
2511         * rootcontext.cs :
2512           Added Documentation field (passed only when /doc was specified).
2513         * decl.cs:
2514           Added DocComment, DocCommentHeader, GenerateDocComment() and
2515           OnGenerateDocComment() and some supporting private members for
2516           /doc feature to MemberCore.
2517         * class.cs:
2518           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
2519         * delegate.cs:
2520           Added overriden DocCommentHeader.
2521         * enum.cs:
2522           Added overriden DocCommentHeader and GenerateDocComment().
2523
2524 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
2525
2526         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
2527         unwrapping the enumeration values, chain to
2528         DoConstantNumericPromotions again, so we can promote things to the
2529         fundamental types (takes care of enums that are bytes, sbytes).
2530
2531         Fixes bug #62054.
2532
2533 2004-12-01  Raja R Harinath  <rharinath@novell.com>
2534
2535         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
2536         Fix long-standing bug in type-lookup.  Use FindType instead of
2537         LookupType when ec.ResolvingTypeTree.
2538         (Attribute.ResolveType, Attribute.Resolve)
2539         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
2540         Update to changes.
2541         (Attributes.Search): Remove internal version.  Update.
2542         (Attributes.SearchMulti): Update.
2543         (Attributes.GetClsCompliantAttribute): Remove.
2544         (Attributes.GetIndexerNameAttribute): Remove.
2545         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
2546         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
2547         * class.cs (Indexer.Define): Likewise.
2548
2549 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
2550
2551         Fix bug #68790
2552         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
2553         MarshallByReference members access.
2554
2555         * expression.cs: Use CheckMarshallByRefAccess;
2556         Better error CS0197 message.
2557
2558         * report.cs: Print whole related error message.
2559
2560 2004-11-30  Raja R Harinath  <rharinath@novell.com>
2561
2562         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
2563         the current directory to help debugging.
2564
2565 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2566
2567         * class (GetClassBases): Better error 60 report.
2568         (EventProperty): Disabled warning 67 detection.
2569
2570 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2571
2572         Fix bug #60324
2573         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
2574
2575         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
2576         precise values.
2577
2578 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2579
2580         Fix bug #49488
2581         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
2582
2583         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
2584
2585 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
2586
2587         * attribute.cs (Attribute.Resolve): Refine error reporting and
2588         report a cs0117 if the identifier does not exist, to distinguish
2589         from 0617 which is a miss-use of the actual identifier.
2590
2591         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
2592         between cs0070 and cs0079.
2593
2594         * class.cs (MemberBase.DoDefine): When reporting a wrong
2595         accessibility level, we use MethodCore to compare instead of
2596         Method (this was a regression in some refactoring effort).
2597
2598         So now we correctly report cs0056 again.
2599
2600         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
2601         testing the target_type (which was known to be object_type) and
2602         not the source type (which is anonymous_method).
2603
2604         Fixed reporting of error cs1660.
2605
2606         * expression.cs (UserCast.Source): Expose the underlying cast.
2607
2608         * statement.cs (Switch.SwitchGoverningType): Sort the list of
2609         allowed types to find a match to int32 first (most common).
2610
2611         In addition, it ignores any ImplicitUserConversions that did an
2612         internal implicit conversion (as the switch statement allows only
2613         one integral conversion to exist).
2614
2615         * class.cs (PartialContainer.Create): rename `name' to
2616         `member_name' for clarity.  Then replace the string calls with a
2617         call to MemberName.GetPartialName, as now using
2618         MemberName.ToString is an error (this is due to the side effects
2619         it had, that were fixed in the past).
2620
2621         This will restore the error reporting on a number of partial class
2622         errors that were missusing this (and getting an exception as a
2623         results, which is now just a plain textual warning, because
2624         yyparse debug output would crash otherwise).
2625
2626 2004-11-26  Raja R Harinath  <rharinath@novell.com>
2627
2628         * Makefile (PROGRAM_INSTALL_DIR): Remove.
2629
2630 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2631
2632         * rootcontext.cs (LookupType): Make sure to cache lookups that
2633         don't give us a negative result. This saves about 5% of corlib
2634         compilation time.
2635
2636 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2637
2638         * report.cs (AbstractMessage.Print): messages are sent to stderr
2639
2640         * class.cs (TypeContainer.GetClassBases): It is an error to have a
2641         non-interface in the list of interfaces (at this point, either
2642         parent was properly set, or a base class is being listed in the
2643         interfaces section).
2644
2645         This flags error 1722, and resolves the crash from bug 69259.
2646
2647 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2648
2649         * statement.cs (Using.EmitExpressionFinally): make this work right
2650         for valuetypes. Fixes 69926.
2651
2652 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2653
2654         * const.cs (Const.ChangeType): Cope with the "0 literal can be
2655         converted to an enum" here, before we try to change the underlying
2656         type.  This code exists, but it is a different code path than the
2657         one used while encoding constants.
2658
2659         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
2660         old bug: when converting from the null literal to a pointer,
2661         return an EmptyCast, not the NullLiteral.
2662
2663         This fixes #69921, the recent null_type changes probably made this
2664         bug more prominent.
2665
2666         (ImplicitReferenceConversionExists): In addition, resynchronized
2667         the code here, so it matches the same code in
2668         ImplicitReferenceConversionExists for the `from any class-type S
2669         to any interface-type T'.
2670         
2671
2672 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
2673
2674         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
2675
2676 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
2677
2678         * cs-parser.jay: Use verbosity accordingly. 
2679
2680 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2681
2682         * expression.cs (Unary.ResolveOperator): Do not report warning;
2683         AddressOf reads from variable.
2684         
2685         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
2686
2687 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2688
2689         Fix bug #69462
2690
2691         * attribute.cs (Attributable): Removed CheckTargets.
2692         (Attributes.Emit): Explicit attribute targets are tested here.
2693
2694         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
2695         not enabled for interfaces.
2696
2697         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
2698         (GetAssemblyName): Ouch next bug there.
2699
2700 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2701
2702         * expression.cs: Error 275 added.
2703         
2704 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
2705
2706         Fix bug #69177 (Implemented decimal constant support)
2707
2708         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
2709         (BinaryFold): Add DecimalConstant.
2710
2711         * const.cs (Define): Decimal constant 
2712         (is not constant.
2713         (ChangeType): Add decimal type handling.
2714         (LookupConstantValue): Don't set value for decimal type but
2715         emit DecimalConstantAttribute. Needed for constant optimization.
2716
2717         * constant.cs (ToDecimal): New method.
2718         (ConvertToDecimal): New method.
2719         (IntConstant): Implemented ConvertToDecimal.
2720         (DecimalConstant.Emit): Emit optimized version for decimals in
2721         int range.
2722
2723         * expression.cs (ResolveOperator): Changed order of constant
2724         reduction to work correctly with native types which have
2725         overloaded operators.
2726         (ResolveMemberAccess): Extract constant value from attribute
2727         for decimal type.
2728
2729         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
2730
2731         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
2732         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
2733         (ChangeType): Decimal is special.
2734         (TypeToCoreType): Add decimal type.
2735
2736 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2737
2738         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
2739         decimal types.
2740
2741 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2742
2743         * class.cs (EventField.ApplyAttributeBuilder): Fix error
2744         test cs1667-5.cs.
2745
2746 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2747
2748         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
2749
2750         * pending.cs (PendingImplementation): Grab only interfaces.
2751
2752 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2753
2754         * statement.cs (ForeachHelperMethods): Add location member and
2755         error 202 detection.
2756
2757 2004-11-19  Raja R Harinath  <rharinath@novell.com>
2758
2759         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
2760         automatically handled by executable.make.
2761         (PROGRAM): Make profile-specific.
2762
2763 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
2764
2765         * expression.cs (DoResolveBase): Fixed wrong warning for out
2766         variables.
2767
2768 2004-11-18  Martin Baulig  <martin@ximian.com>
2769
2770         Merged latest changes into gmcs.  Please keep this comment in
2771         here, it makes it easier for me to see what changed in MCS since
2772         the last time I merged.
2773
2774 2004-11-17  Raja R Harinath  <rharinath@novell.com>
2775
2776         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
2777         (TypeHandle.GetMemberCache): New.
2778         (TypeHandle.TypeHandle): Update.
2779         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
2780         (TypeManager.LookupParentInterfacesCache):
2781         Rename from LookupInterfaceCache.  Optimize slightly.
2782         (TypeManager.MemberLookup_FindMembers): Update.
2783         * decl.cs (MemberCache.MemberCache): Set Container to null in the
2784         multi-type variant.
2785         (AddCacheContents): Rename from AddHashtable.
2786         * class.cs (TypeContainer.parent_container): Remove.
2787         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
2788         (TypeContainer.DoDefineMembers): Don't initialize it.
2789         Update to name changes.
2790         
2791 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
2792
2793         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
2794         that factors the code to check access modifiers on override.  
2795
2796         (PropertyBase): Use the code here.
2797
2798         Patch from Lluis S'anchez, fixes bug #69361.
2799
2800 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
2801
2802         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
2803         routine that is used to report the use of a captured variable
2804         whose address has been taken.
2805
2806         There are two checks: one when variables are being captured and
2807         the other check is when the address of a variable is taken. 
2808         
2809         (because an anonymous methods might be resolved before *or* after
2810         the address has been taken) and 
2811
2812         * expression.cs (Conditional.DoResolve): Remove the special
2813         casing that Martin added to trueExpr and falseExpr being both
2814         NullLiteral.  We get the right behavior now just by introducing
2815         the null_type into the compiler. 
2816
2817         * convert.cs (ExplicitConversion): Change the code to use
2818         null_type instead of testing `expr is NullLiteral'.
2819         (ImplicitConversionStandard): use null_type too.
2820         (ImplicitReferenceConversionExists): use null_type too.
2821         (ImplicitReferenceConversion): use null_type too.
2822
2823         * literal.cs: The type of `NullLiteral' is now null_type instead
2824         of object_type. 
2825         (Resolve): Set the type here.
2826
2827         * typemanager.cs: Introduce null_type.
2828
2829 2004-11-17  Martin Baulig  <martin@ximian.com>
2830
2831         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
2832         direction, like FindMembers() does.  Fixes #69546, testcase is in
2833         test-315.cs.    
2834
2835 2004-11-16  Martin Baulig  <martin@ximian.com>
2836
2837         This is based on a patch from Marek Safar, see bug #69082.
2838         Fixes bugs #63705 and #67130.
2839
2840         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
2841         method; create a MemberCache for an interface type and cache the
2842         result.
2843
2844         * decl.cs (IMemberContainer.ParentContainer): Removed.
2845         (IMemberContainer.ParentCache): New property.
2846         (MemberCache.SetupCacheForInterface): Removed.
2847         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
2848         to create a cache for an interface's "parent".
2849
2850         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
2851         interfaces too.
2852
2853 2004-11-16  Martin Baulig  <martin@ximian.com>
2854
2855         Merged back from gmcs; these changes already went into gmcs a
2856         couple of weeks ago.
2857
2858         * typemanager.cs
2859         (TypeManager.AddUserType): Removed the `ifaces' argument.
2860         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
2861         `TypeExpr []'.
2862         (TypeManager.AddUserInterface): Removed.
2863         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
2864         `TypeExpr []'.
2865         (TypeManager.GetInterfaces): Likewise.
2866         (TypeManager.GetExplicitInterfaces): Likewise.
2867
2868         * ecore.cs (TypeExpr.GetInterfaces): Removed.
2869
2870         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
2871         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
2872
2873 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
2874
2875         * statement.cs: Avoid adding bools to a hashtable.
2876
2877 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
2878
2879         * expression.cs (Invocation.OverloadResolve): Flag error if we are
2880         calling an unsafe method from a safe location.
2881
2882 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
2883
2884         Fix #69167
2885         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
2886
2887 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
2888
2889         * namespace.cs (VerifyUsing): use GetPartialName instead of
2890         ToString. 
2891
2892 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
2893
2894         * statement.cs (Return.Resolve): Fix regression in typo: if
2895         `in_exc', we have to request a NeedReturnLabel, this was a typo
2896         introduced in the anonymous method check-in.  Fixes #69131.
2897
2898         * Indexers were using the ShortName when defining themselves,
2899         causing a regression in the compiler bootstrap when applying the
2900         patch from 2004-11-02 (first part), now they use their full name
2901         and the bug is gone.
2902
2903 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
2904
2905         * driver.cs: Strip the path from the names of embedded resources. Fixes
2906         #68519.
2907
2908 2004-11-04  Raja R Harinath  <rharinath@novell.com>
2909
2910         Fix error message regression: cs0104-2.cs.
2911         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
2912         (AliasEntry.Resolve): Update.
2913         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
2914         'silent' flag.
2915         (RootContext.LookupType): Update.
2916
2917 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
2918
2919         * cs-parser.jay: Add support for handling accessor modifiers
2920         * class: Add support port accessor modifiers and error checking,
2921         define PropertyMethod.Define as virtual (not abstract anymore)
2922         * ecore.cs: Add checking for proeprties access with access modifiers
2923         * iterators.cs: Modify Accessor constructor call based in the modified
2924         constructor
2925 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
2926
2927         * expression.cs (StringConcat): Handle being called twice,
2928         as when we have a concat in a field init with more than two
2929         ctors in the class
2930
2931 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
2932
2933         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
2934         special case explicit implementations, we should always produce
2935         the .property or .event declaration.
2936         
2937         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
2938         since it will not return correct data if people use this
2939         unresolved in the presence of using statements (see test-313).
2940
2941         * class.cs (MethodData.Define): If we are an explicit interface
2942         implementation, set the method name to the full name of the
2943         interface plus the name of the method.  
2944
2945         Notice that using the method.MethodName.GetFullName() does not
2946         work, as it will only contain the name as declared on the source
2947         file (it can be a shorthand in the presence of using statements)
2948         and not the fully qualifed type name, for example:
2949
2950         using System;
2951
2952         class D : ICloneable {
2953                 object ICloneable.Clone ()  {
2954                 }
2955         }
2956
2957         Would produce a method called `ICloneable.Clone' instead of
2958         `System.ICloneable.Clone'.
2959
2960         * namespace.cs (Alias.Resolve): Use GetPartialName.
2961         
2962 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2963
2964         * cs-parser.jay: Add error 1055 report.
2965
2966 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
2967
2968         * assign.cs (Assign.DoResolve): Only do the transform of
2969         assignment into a New if the types are compatible, if not, fall
2970         through and let the implicit code deal with the errors and with
2971         the necessary conversions. 
2972
2973 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2974
2975         * cs-parser.jay: Add error 1031 report.
2976
2977         * cs-tokenizer.cs: Add location for error 1038.
2978
2979 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2980
2981         * cs-parser.jay: Add error 1016 report.
2982
2983 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2984
2985         * cs-parser.jay: Add errors 1575,1611 report.
2986
2987 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2988
2989         * cs-parser.jay: Add error 1001 report.
2990
2991 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2992
2993         Fix #68850
2994         * attribute.cs (GetMarshal): Add method argument for
2995         caller identification.
2996
2997         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
2998         agument for GetMarshal and RuntimeMissingSupport.
2999
3000 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3001
3002         * attribute.cs (ExtractSecurityPermissionSet): Removed
3003         TypeManager.code_access_permission_type.
3004
3005         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3006
3007 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3008
3009         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3010         for obsolete use of a variable here.   Fixes regression on errors
3011         cs0619-25 and cs0619-26.
3012
3013 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3014
3015         Fix #62358, implemented security attribute encoding.
3016
3017         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3018         Tests permitted SecurityAction for assembly or other types.
3019         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3020         data from SecurityPermissionAttribute to PermisionSet class.
3021
3022         * class.cs (ApplyAttributeBuilder): Added special handling
3023         for System.Security.Permissions.SecurityAttribute based types.
3024
3025         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3026         special handling for System.Security.Permissions.SecurityAttribute
3027         based types.
3028
3029         * enum.cs (ApplyAttributeBuilder): Added special handling
3030         for System.Security.Permissions.SecurityAttribute based types.
3031
3032         * parameter.cs (ApplyAttributeBuilder): Added special handling
3033         for System.Security.Permissions.SecurityAttribute based types.
3034
3035         * rootcontext.cs: Next 2 core types.
3036
3037         * typemanager.cs (TypeManager.security_permission_attr_type):
3038         Built in type for the SecurityPermission Attribute.
3039         (code_access_permission_type): Build in type.
3040
3041 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3042
3043         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3044         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3045         all of this information into
3046         EmitContext.EmitCapturedVariableInstance.
3047         
3048         * codegen.cs (EmitCapturedVariableInstance): move here the
3049         funcionality of emitting an ldarg.0 in the presence of a
3050         remapping.   This centralizes the instance emit code.
3051
3052         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3053         then emit a load of this: it means that we have reached the
3054         topmost ScopeInfo: the one that contains the pointer to the
3055         instance of the class hosting the anonymous method.
3056
3057         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3058         captures to the topmost CaptureContext.
3059
3060 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3061
3062         * expression.cs (LocalVariableReference): Move the knowledge about
3063         the iterators into codegen's EmitCapturedVariableInstance.
3064
3065 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3066
3067         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3068         all code paths return a value from an anonymous method (it is the
3069         same as the 161 error, but for anonymous methods).
3070
3071 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3072
3073         The introduction of anonymous methods in the compiler changed
3074         various ways of doing things in the compiler.  The most
3075         significant one is the hard split between the resolution phase
3076         and the emission phases of the compiler.
3077
3078         For instance, routines that referenced local variables no
3079         longer can safely create temporary variables during the
3080         resolution phase: they must do so from the emission phase,
3081         since the variable might have been "captured", hence access to
3082         it can not be done with the local-variable operations from the runtime.
3083         
3084         * statement.cs 
3085
3086         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3087         is a toplevel block.
3088
3089         (ToplevelBlock): A new kind of Block, these are the blocks that
3090         are created by the parser for all toplevel method bodies.  These
3091         include methods, accessors and anonymous methods.
3092
3093         These contain some extra information not found in regular blocks:
3094         A pointer to an optional CaptureContext (for tracking captured
3095         local variables and parameters).  A pointer to the parent
3096         ToplevelBlock.
3097         
3098         (Return.Resolve): Catch missmatches when returning a value from an
3099         anonymous method (error 1662).
3100         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3101         phase.
3102
3103         (Break.Resolve): ditto.
3104
3105         (SwitchLabel): instead of defining the labels during the
3106         resolution phase, we now turned the public ILLabel and ILLabelCode
3107         labels into methods called GetILLabelCode() and GetILLabel() that
3108         only define the label during the Emit phase.
3109
3110         (GotoCase): Track the SwitchLabel instead of the computed label
3111         (its contained therein).  Emit the code by using
3112         SwitchLabel.GetILLabelCode ().
3113
3114         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3115         whether the Local has been captured or not.
3116
3117         (LocalInfo.IsCaptured): New property, used to tell whether the
3118         local has been captured.
3119         
3120         * anonymous.cs: Vastly updated to contain the anonymous method
3121         support.
3122
3123         The main classes here are: CaptureContext which tracks any
3124         captured information for a toplevel block and ScopeInfo used to
3125         track the activation frames for various local variables.   
3126
3127         Each toplevel block has an optional capture context associated
3128         with it.  When a method contains an anonymous method both the
3129         toplevel method and the anonymous method will create a capture
3130         context.   When variables or parameters are captured, they are
3131         recorded on the CaptureContext that owns them, for example:
3132
3133         void Demo () {
3134              int a;
3135              MyDelegate d = delegate {
3136                  a = 1;
3137              }
3138         }
3139
3140         Here `a' will be recorded as captured on the toplevel
3141         CapturedContext, the inner captured context will not have anything
3142         (it will only have data if local variables or parameters from it
3143         are captured in a nested anonymous method.
3144
3145         The ScopeInfo is used to track the activation frames for local
3146         variables, for example:
3147
3148         for (int i = 0; i < 10; i++)
3149                 for (int j = 0; j < 10; j++){
3150                    MyDelegate d = delegate {
3151                         call (i, j);
3152                    }
3153                 }
3154
3155         At runtime this captures a single captured variable `i', but it
3156         captures 10 different versions of the variable `j'.  The variable
3157         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3158         recorded on a child.  
3159
3160         The toplevel ScopeInfo will also track information like the `this'
3161         pointer if instance variables were referenced (this is necessary
3162         as the anonymous method lives inside a nested class in the host
3163         type of the method). 
3164
3165         (AnonymousMethod): Expanded to track the Toplevel, implement
3166         `AnonymousMethod.Compatible' to tell whether an anonymous method
3167         can be converted to a target delegate type. 
3168
3169         The routine now also produces the anonymous method content
3170
3171         (AnonymousDelegate): A helper class that derives from
3172         DelegateCreation, this is used to generate the code necessary to
3173         produce the delegate for the anonymous method that was created. 
3174
3175         * assign.cs: API adjustments for new changes in
3176         Convert.ImplicitStandardConversionExists.
3177
3178         * class.cs: Adjustments to cope with the fact that now toplevel
3179         blocks are of type `ToplevelBlock'. 
3180
3181         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3182         insteda of standard blocks.
3183
3184         Flag errors if params arguments are passed to anonymous methods.
3185
3186         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3187         `CurrentAnonymousMethod' which points to the current Anonymous
3188         Method.  The variable points to the AnonymousMethod class that
3189         holds the code being compiled.  It is set in the new EmitContext
3190         created for the anonymous method.
3191
3192         (EmitContext.Phase): Introduce a variable and an enumeration to
3193         assist in enforcing some rules about when and where we are allowed
3194         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3195         only one that enfonces this right now).
3196
3197         (EmitContext.HaveCaptureInfo): new helper method that returns
3198         whether we have a CapturedContext initialized.
3199
3200         (EmitContext.CaptureVariable): New method used to register that a
3201         LocalInfo must be flagged for capturing. 
3202
3203         (EmitContext.CapturedParameter): New method used to register that a
3204         parameters must be flagged for capturing. 
3205         
3206         (EmitContext.CapturedField): New method used to register that a
3207         field must be flagged for capturing. 
3208
3209         (EmitContext.HaveCapturedVariables,
3210         EmitContext.HaveCapturedFields): Return whether there are captured
3211         variables or fields. 
3212
3213         (EmitContext.EmitMethodHostInstance): This is used to emit the
3214         instance for the anonymous method.  The instance might be null
3215         (static methods), this (for anonymous methods that capture nothing
3216         and happen to live side-by-side with the current method body) or a
3217         more complicated expression if the method has a CaptureContext.
3218
3219         (EmitContext.EmitTopBlock): Routine that drives the emission of
3220         code: it will first resolve the top block, then emit any metadata
3221         and then emit the code.  The split is done so that we can extract
3222         any anonymous methods and flag any captured variables/parameters.
3223         
3224         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
3225         during this phase, the ILGenerator should not be used as labels
3226         and local variables declared here might not be accessible to any
3227         code that is part of an anonymous method.  
3228
3229         Exceptions to this include the temporary variables that are
3230         created by some statements internally for holding temporary
3231         variables. 
3232         
3233         (EmitContext.EmitMeta): New routine, in charge of emitting all the
3234         metadata for a cb
3235
3236         (EmitContext.TemporaryReturn): This method is typically called
3237         from the Emit phase, and its the only place where we allow the
3238         ReturnLabel to be defined other than the EmitMeta.  The reason is
3239         that otherwise we would have to duplicate a lot of logic in the
3240         Resolve phases of various methods that today is on the Emit
3241         phase. 
3242
3243         (EmitContext.NeedReturnLabel): This no longer creates the label,
3244         as the ILGenerator is not valid during the resolve phase.
3245
3246         (EmitContext.EmitThis): Extended the knowledge in this class to
3247         work in anonymous methods in addition to iterators. 
3248
3249         (EmitContext.EmitCapturedVariableInstance): This emits whatever
3250         code is necessary on the stack to access the instance to a local
3251         variable (the variable will be accessed as a field).
3252
3253         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
3254         EmitContext.EmitAddressOfParameter): Routines to support
3255         parameters (not completed at this point). 
3256         
3257         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
3258         will also remove the parameters.
3259
3260         * convert.cs (Convert): Define a `ConstantEC' which points to a
3261         null.  This is just to prefity some code that uses
3262         ImplicitStandardConversion code and do not have an EmitContext
3263         handy.
3264
3265         The idea is to flag explicitly that at that point in time, it is
3266         known that the conversion will not trigger the delegate checking
3267         code in implicit conversions (which requires a valid
3268         EmitContext). 
3269
3270         Everywhere: pass new EmitContext parameter since
3271         ImplicitStandardConversionExists now requires it to check for
3272         anonymous method conversions. 
3273
3274         (Convert.ImplicitStandardConversionExists): If the type of an
3275         expression is the anonymous_method_type, and the type is a
3276         delegate, we invoke the AnonymousMethod.Compatible method to check
3277         whether an implicit conversion is possible. 
3278
3279         (Convert.ImplicitConversionStandard): Only do implicit method
3280         group conversions if the language level is not ISO_1.
3281
3282         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
3283         MethodInfo for the Invoke method.  used by Delegate and
3284         AnonymousDelegate.
3285
3286         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
3287         method conversions if the target type is a delegate.
3288
3289         Removed extra debugging nops.
3290
3291         (LocalVariableReference): Turn the `local_info' into a public
3292         field. 
3293
3294         Add `prepared' field, the same hack used for FieldExprs to cope
3295         with composed assignments, as Local variables do not necessarily
3296         operate purely on the stack as they used to: they can be captured
3297         fields. 
3298
3299         Add `temp' for a temporary result, like fields.
3300
3301         Refactor DoResolve and DoResolveLValue into DoResolveBase.
3302
3303         It now copes with Local variables that are captured and emits the
3304         proper instance variable to load it from a field in the captured
3305         case. 
3306
3307         (ParameterReference.DoResolveBase): During the resolve phase,
3308         capture parameters if we are in an anonymous method.
3309
3310         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
3311         anonymous method, use the EmitContext helper routines to emit the
3312         parameter reference.
3313
3314         * iterators.cs: Set RemapToProxy to true/false during the
3315         EmitDispose class.
3316
3317         * parameters.cs (GetParameterByName): New helper method. 
3318
3319         * typemanager.cs (anonymous_method_type) a new type that
3320         represents an anonyous method.  This is always an internal type,
3321         used as a fencepost to test against the anonymous-methodness of an
3322         expression. 
3323         
3324 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
3325
3326         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
3327         561 report.
3328         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
3329
3330 2004-10-18  Martin Baulig  <martin@ximian.com>
3331
3332         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
3333         `Type' directly, but call ResolveType() on it.
3334         (Catch.Resolve): Likewise.
3335         (Foreach.Resolve): Likewise.
3336
3337 2004-10-18  Martin Baulig  <martin@ximian.com>
3338
3339         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
3340         `Type' directly, but call ResolveType() on it.
3341         (Probe.DoResolve): Likewise.
3342         (ArrayCreation.LookupType): Likewise.
3343         (TypeOf.DoResolve): Likewise.
3344         (SizeOf.DoResolve): Likewise.
3345
3346 2004-10-18  Martin Baulig  <martin@ximian.com>
3347
3348         * expression.cs (Invocation.BetterFunction): Put back
3349         TypeManager.TypeToCoreType().
3350
3351 2004-10-18  Raja R Harinath  <rharinath@novell.com>
3352
3353         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
3354         the ResolveType.
3355
3356 2004-10-18  Martin Baulig  <martin@ximian.com>
3357
3358         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
3359         `Type' directly, but call ResolveType() on it.
3360
3361 2004-10-18  Martin Baulig  <martin@ximian.com>
3362
3363         * class.cs (FieldMember.Define): Don't access the TypeExpr's
3364         `Type' directly, but call ResolveType() on it.
3365         (MemberBase.DoDefine): Likewise.
3366
3367         * expression.cs (New.DoResolve): Don't access the TypeExpr's
3368         `Type' directly, but call ResolveType() on it.
3369         (ComposedCast.DoResolveAsTypeStep): Likewise.
3370
3371         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
3372         `Type' directly, but call ResolveType() on it.
3373
3374 2004-10-17  John Luke  <john.luke@gmail.com>
3375
3376         * class.cs (Operator.GetSignatureForError): use CSharpName
3377
3378         * parameter.cs (Parameter.GetSignatureForError): Returns
3379         correct name even if was not defined.
3380
3381 2004-10-13  Raja R Harinath  <rharinath@novell.com>
3382
3383         Fix #65816.
3384         * class.cs (TypeContainer.EmitContext): New property.
3385         (DefineNestedTypes): Create an emitcontext for each part.
3386         (MethodCore.DoDefineParameters): Use container's emitcontext.
3387         Pass type array to InternalParameters.
3388         (MemberBase.DoDefine): Use container's emitcontext.
3389         (FieldMember.Define): Likewise.
3390         (Event.Define): Likewise.
3391         (SetMethod.GetParameterInfo): Change argument to EmitContext.
3392         Pass type array to InternalParameters.
3393         (SetIndexerMethod.GetParameterInfo): Likewise.
3394         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
3395         * delegate.cs (Define): Pass emitcontext to
3396         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
3397         array to InternalParameters.
3398         * expression.cs (ParameterReference.DoResolveBase): Pass
3399         emitcontext to GetParameterInfo.
3400         (ComposedCast.DoResolveAsTypeStep): Remove check on
3401         ec.ResolvingTypeTree.
3402         * parameter.cs (Parameter.Resolve): Change argument to
3403         EmitContext.  Use ResolveAsTypeTerminal.
3404         (Parameter.GetSignature): Change argument to EmitContext.
3405         (Parameters.ComputeSignature): Likewise.
3406         (Parameters.ComputeParameterTypes): Likewise.
3407         (Parameters.GetParameterInfo): Likewise.
3408         (Parameters.ComputeAndDefineParameterTypes): Likewise.
3409         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
3410         * support.cs (InternalParameters..ctor): Remove variant that takes
3411         a DeclSpace.
3412         * typemanager.cs (system_intptr_expr): New.
3413         (InitExpressionTypes): Initialize it.
3414
3415 2004-10-12  Chris Toshok  <toshok@ximian.com>
3416
3417         * cs-parser.jay: fix location for try_statement and catch_clause.
3418
3419 2004-10-11  Martin Baulig  <martin@ximian.com>
3420
3421         * report.cs: Don't make --fatal abort on warnings, we have
3422         -warnaserror for that.
3423
3424 2004-10-07  Raja R Harinath  <rharinath@novell.com>
3425
3426         More DeclSpace.ResolveType avoidance.
3427         * decl.cs (MemberCore.InUnsafe): New property.
3428         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
3429         with newly created EmitContext.
3430         (FieldMember.Define): Likewise.
3431         * delegate.cs (Delegate.Define): Likewise.
3432         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
3433         only if normal name-lookup fails.
3434         (TypeExpr.DoResolve): Enable error-checking.
3435         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
3436         (SizeOf.DoResolve): Likewise.
3437         (ComposedCast.DoResolveAsTypeStep): Likewise.
3438         (StackAlloc.DoResolve): Likewise.
3439         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
3440         (Block.Unsafe): New property.
3441         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
3442         (Unsafe): Set 'unsafe' flag of contained block.
3443         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
3444         (Fixed.Resolve): Likewise.
3445         (Catch.Resolve): Likewise.
3446         (Using.ResolveLocalVariableDecls): Likewise.
3447         (Foreach.Resolve): Likewise.
3448
3449 2004-10-05  John Luke <john.luke@gmail.com>
3450
3451         * cs-parser.jay: add location to error CS0175
3452
3453 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
3454
3455         * ecore.cs (Expression.Constantity): Add support for turning null
3456         into a constant.
3457
3458         * const.cs (Const.Define): Allow constants to be reference types
3459         as long as the value is Null.
3460
3461 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
3462
3463         * namespace.cs (NamespaceEntry.Using): No matter which warning
3464         level is set, check if this namespace name has already been added.
3465
3466 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
3467
3468         * expression.cs: reftype [!=]= null should always use br[true,false].
3469         # 67410
3470
3471 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
3472
3473         Fix #67108
3474         * attribute.cs: Enum conversion moved to 
3475         GetAttributeArgumentExpression to be applied to the all
3476         expressions.
3477
3478 2004-10-01  Raja R Harinath  <rharinath@novell.com>
3479
3480         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
3481         * class.c (TypeContainer.DefineType): Flag error if
3482         base types aren't accessible due to access permissions.
3483         * decl.cs (DeclSpace.ResolveType): Move logic to
3484         Expression.ResolveAsTypeTerminal.
3485         (DeclSpace.ResolveTypeExpr): Thin layer over
3486         Expression.ResolveAsTypeTerminal.
3487         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
3488         Refactor code into NestedAccess.  Use it.
3489         (DeclSpace.NestedAccess): New.
3490         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
3491         argument to silence errors.  Check access permissions.
3492         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
3493         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
3494         (Cast.DoResolve): Likewise.
3495         (New.DoResolve): Likewise.
3496         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
3497         (TypeOf.DoResolve): Likewise.
3498
3499         * expression.cs (Invocation.BetterConversion): Return the Type of
3500         the better conversion.  Implement section 14.4.2.3 more faithfully.
3501         (Invocation.BetterFunction): Make boolean.  Make correspondence to
3502         section 14.4.2.2 explicit.
3503         (Invocation.OverloadResolve): Update.
3504         (Invocation): Remove is_base field.
3505         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
3506         (Invocation.Emit): Likewise.
3507
3508 2004-09-27  Raja R Harinath  <rharinath@novell.com>
3509
3510         * README: Update to changes.
3511
3512 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
3513
3514         * cs-parser.jay: Reverted 642 warning fix.
3515
3516 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3517
3518         Fix bug #66615
3519         * decl.cs (FindMemberWithSameName): Indexer can have more than
3520         1 argument.
3521
3522 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3523
3524         * expression.cs (LocalVariableReference.DoResolveLValue):
3525         Do not report warning 219 for out values.
3526         (EmptyExpression.Null): New member to avoid extra allocations.
3527
3528 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3529
3530         * cs-parser.jay: Fix wrong warning 642 report.
3531
3532         * cs-tokenizer.cs (CheckNextToken): New helper;
3533         Inspect next character if is same as expected.
3534
3535 2004-09-23  Martin Baulig  <martin@ximian.com>
3536
3537         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
3538         (Convert.ImplicitReferenceConversionExists): Likewise.
3539
3540 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3541
3542         * class.cs (Operator.Define): Add error 448 and 559 report.
3543
3544 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3545
3546         * class.cs (MemberBase.IsTypePermitted): New protected
3547         method for checking error CS0610.
3548
3549 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3550
3551         * class.cs (TypeContainer.HasExplicitLayout): New property
3552         Returns whether container has StructLayout attribute set Explicit.
3553         (FieldMember): New abstract class for consts and fields.
3554         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
3555         (Field): Reuse FieldMember.
3556
3557         * const.cs (Const): Reuse FieldMember.
3558
3559         * rootcontext.cs: EmitConstants call moved to class.
3560
3561 2004-09-22  Martin Baulig  <martin@ximian.com>
3562
3563         Thanks to Peter Sestoft for this bug report.
3564
3565         * expression.cs (Conditional): If both the `trueExpr' and the
3566         `falseExpr' is a NullLiteral, return a NullLiteral.
3567
3568 2004-09-22  Martin Baulig  <martin@ximian.com>
3569
3570         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
3571         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
3572         for the "get_Current" call.
3573
3574 2004-09-22  Martin Baulig  <martin@ximian.com>
3575
3576         Marek and me just fixed one of our oldest bugs: #28562 :-)
3577
3578         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
3579
3580         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
3581         we're an EnumConstant, just return that.
3582         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
3583         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
3584         to get the value which'll actually be written into the attribute.
3585         However, we have to use GetValue() to access the attribute's value
3586         in the compiler.        
3587
3588 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3589
3590         * constant.cs (Constant.IsNegative): New abstract property
3591         IsNegative.
3592
3593         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
3594         (StackAlloc.DoResolve): Reused IsNegative.
3595
3596 2004-09-21  Martin Baulig  <martin@ximian.com>
3597
3598         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
3599         if we're used in an iterator, we may be called from different
3600         methods.
3601
3602         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
3603         we actually have an exception block.
3604
3605 2004-09-20  John Luke <jluke@cfl.rr.com>
3606
3607         * class.cs, cs-parser.jay: Improve the error report for 1520:
3608         report the actual line where the error happens, not where the
3609         class was declared.
3610
3611         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
3612         Pass location information that was available elsewhere.
3613
3614 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
3615
3616         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
3617         runtime to delay sign assemblies.
3618
3619 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
3620
3621         * cs-parser.jay: Do not report the stack trace, this is barely
3622         used nowadays.
3623
3624 2004-08-22  John Luke  <john.luke@gmail.com>
3625  
3626         * driver.cs : check that a resource id is not already used
3627         before adding it, report CS1508 if it is, bug #63637
3628
3629 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
3630
3631         * ecore.cs: Removed dead code.
3632
3633 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
3634
3635         * class.cs: Do not report warning CS0067 on the interfaces.
3636
3637 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3638
3639         * cs-parser.jay: Add error 504 report.
3640
3641 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3642
3643         * rootcontext.cs: WarningLevel is 4 by default now.
3644
3645         * statement.cs (Fixed.Resolve): Do not null
3646         VariableInfo.
3647
3648 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
3649
3650         Fixed bug #55780
3651         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
3652         deep search when property is not virtual.
3653         (PropertyExpr.ResolveAccessors): Make one call for both
3654         accessors.
3655
3656 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3657
3658         Fixed bug #65766
3659         * statement.cs: Error 152 report constains also location.
3660
3661 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3662
3663         Fixed bug #65766
3664         * const.cs: Explicitly set constant as static.
3665
3666 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3667
3668         Fixed bug #64226
3669         * cs-parser.jay: Add error 1017 report.
3670
3671 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
3672
3673         Fixed bug #59980, #64224
3674         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
3675
3676         * typemanager.cs (IsSpecialMethod): Simplified
3677
3678 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3679
3680         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
3681         condition with better params.
3682
3683 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3684
3685         Fixed bug #65238
3686         * attribute.cs (Resolve): Property has to have both
3687         accessors.
3688
3689 2004-09-14  Martin Baulig  <martin@ximian.com>
3690
3691         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
3692
3693 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
3694
3695         Fixed bug #61902
3696         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
3697         called and is obsolete then this member suppress message
3698         when call is inside next [Obsolete] method or type.
3699
3700         * expression.cs: Use TestObsoleteMethodUsage member.
3701
3702 2004-09-14  Martin Baulig  <martin@ximian.com>
3703
3704         * cs-parser.jay: Sync a bit with the GMCS version.
3705
3706 2004-09-14  Martin Baulig  <martin@ximian.com>
3707
3708         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
3709         (CSharpParser.yacc_verbose_flag): New public field.
3710
3711         * genericparser.cs: Removed.
3712
3713 2004-09-14  Raja R Harinath  <rharinath@novell.com>
3714
3715         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
3716
3717 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
3718
3719         * class.cs (MethodCore.CheckBase): Fix bug #65757.
3720
3721 2004-09-10  Martin Baulig  <martin@ximian.com>
3722
3723         Backported my MemberName changes from GMCS into MCS.
3724
3725         - we are now using a special `MemberName' class instead of using
3726         strings; in GMCS, the `MemberName' also contains the type
3727         arguments.
3728
3729         - changed the grammar rules a bit:
3730           * the old `member_name' is now a `namespace_or_type_name':
3731             The rule is that we use `namespace_or_type_name' everywhere
3732             where we expect either a "member name" (GetEnumerator) or a
3733             "member name" with an explicit interface name
3734             (IEnumerable.GetEnumerator).
3735             In GMCS, the explicit interface name may include type arguments
3736             (IEnumerable<T>.GetEnumerator).
3737           * we use `member_name' instead of just `IDENTIFIER' for
3738             "member names":
3739             The rule is that we use `member_name' wherever a member may
3740             have type parameters in GMCS.       
3741
3742         * decl.cs (MemberName): New public class.
3743         (MemberCore.MemberName): New public readonly field.
3744         (MemberCore.ctor): Take a `MemberName' argument, not a string.
3745         (DeclSpace): Likewise.
3746
3747         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
3748         * enum.cs (Enum.ctor): Likewise.
3749
3750         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
3751         MemberName.     
3752         (AliasEntry.ctor): Take a MemberName, not an Expression.
3753         (AliasEntry.UsingAlias): Likewise.
3754
3755         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
3756         (IMethodData.MemberName): Changed type from string to MemberName.
3757         (MemberBase.ExplicitInterfaceName): Likewise.
3758         (AbstractPropertyEventMethod.SetupName): Make this private.
3759         (AbstractPropertyEventMethod.ctor): Added `string prefix'
3760         argument; compute the member name here.
3761         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
3762         on the `member.MemberName' and the `prefix'.
3763
3764         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
3765         not `type_name'.
3766         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
3767         thus, we get a `MemberName' instead of a `string'.  These
3768         declarations may have type parameters in GMCS.
3769         (interface_method_declaration, delegate_declaration): Likewise.
3770         (class_declaration, interface_declaration): Likewise.
3771         (method_header): Use `namespace_or_type_name' instead of
3772         `member_name'.  We may be an explicit interface implementation.
3773         (property_declaration, event_declaration): Likewise.
3774         (member_name): This is now just an `IDENTIFIER', not a
3775         `namespace_or_type_name'.
3776         (type_name, interface_type): Removed.
3777         (namespace_or_type_name): Return a MemberName, not an Expression.
3778         (primary_expression): Use `member_name' instead of `IDENTIFIER';
3779         call GetTypeExpression() on the MemberName to get an expression.
3780         (IndexerDeclaration.interface_type): Changed type from string to
3781         MemberName.
3782         (MakeName): Operate on MemberName's instead of string's.
3783
3784 2004-09-13  Raja R Harinath  <rharinath@novell.com>
3785
3786         Fix bug #55770.
3787         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
3788         (NamespaceEntry.Lookup): Add new argument to flag if we want the
3789         lookup to avoid symbols introduced by 'using'.
3790         * rootcontext.cs (NamespaceLookup): Update.
3791
3792 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
3793
3794         * class.cs (TypeContainer.DoDefineMembers): Do not call
3795         DefineDefaultConstructor for static classes.
3796
3797 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
3798
3799         * attribute.cs (Attribute.Resolve): Add error 653 report.
3800
3801         * class.cs (Class.ApplyAttributeBuilder): Add error 641
3802         report.
3803         (Method.ApplyAttributeBuilder): Add error 685 report.
3804         (Operator.Define): Add error 564 report.
3805
3806         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
3807
3808         * expression.cs (Invocation.DoResolve): Add error
3809         245 and 250 report.
3810
3811         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
3812         error 674 report.
3813
3814 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3815
3816         * class.cs (ConstructorInitializer.Resolve):
3817         Wrong error number (515->516).
3818
3819 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3820
3821         * class.cs (Indexer.Define): Add error 631 report.
3822
3823 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3824
3825         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
3826
3827 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3828
3829         * expression.cs (Probe.DoResolve): Add error CS0241 report.
3830
3831 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
3832
3833         * cs-parser.jay: Added error CS0241 report.
3834
3835 2004-09-10  Raja R Harinath  <rharinath@novell.com>
3836
3837         * cs-parser.jay (fixed_statement): Introduce a scope for the
3838         declaration in the 'fixed' statement.
3839
3840 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3841
3842         * cs-parser.jay: Added CS0230 error report.
3843
3844 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3845
3846         * cs-parser.jay: Added errors CS0231 and CS0257 report.
3847
3848 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3849
3850         * expression.cs (Argument.Resolve): Added error CS0192 and
3851         CS0199 report.
3852
3853 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3854
3855         C# 2.0 #pragma warning feature
3856
3857         * cs-tokenizer.cs (PreProcessPragma): New method; 
3858         Handles #pragma directive.
3859
3860         * report.cs (WarningRegions): New class; Support
3861         class for #pragma warning directive. It tests whether
3862         warning is enabled for a given line.
3863
3864 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
3865
3866         * const.cs: Add more descriptive error report, tahnks to
3867         Sebastien. 
3868
3869 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
3870
3871         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
3872
3873 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
3874
3875         * expression.cs: Apply patch from Ben: Remove dead code from
3876         ArrayCreation, and remove the TurnintoConstant call in const.cs,
3877         as that code just threw an exception anwyays.
3878
3879         * const.cs: Remove the call to the turnintoconstant, for details
3880         see bug: #63144
3881         
3882         * literal.cs: The type of the null-literal is the null type;  So
3883         we use a placeholder type (literal.cs:System.Null, defined here)
3884         for it.
3885
3886         * expression.cs (Conditional.DoResolve): Remove some old code that
3887         is no longer needed, conversions have been fixed.
3888
3889         (ArrayCreationExpression.DoResolve): Return false if we fail to
3890         resolve the inner expression.
3891
3892 2004-09-07  Raja R Harinath  <rharinath@novell.com>
3893
3894         Fix test-290.cs.
3895         * cs-parser.jay (delegate_declaration): Record a delegate
3896         declaration as a type declaration.
3897         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
3898
3899 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
3900
3901         * parameter.cs: Do not crash if the type can not be resolved. 
3902
3903         * expression.cs: Report errors with unsafe pointers, fixes #64896
3904
3905 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3906
3907         * expression.cs: Pointer arith always needs to do a conv.i
3908         if the operand is a long. fix 65320
3909
3910 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3911
3912         Fixed cs0619-37.cs, cs0619-38.cs
3913
3914         * enum.cs (GetObsoleteAttribute): Removed.
3915
3916         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
3917         on Enum member is double staged. The first is tested member
3918         and then enum.
3919
3920 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3921
3922         Fixed #56986, #63631, #65231
3923
3924         * class.cs: (TypeContainer.AddToMemberContainer): New method,
3925         adds member to name container.
3926         (TypeContainer.AddToTypeContainer): New method, adds type to
3927         name container.
3928         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
3929         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
3930         AddOperator): Simplified by reusing AddToMemberContainer.
3931         (TypeContainer.UserDefinedStaticConstructor): Changed to property
3932         instead of field.
3933         (Method.CheckForDuplications): Fixed implementation to test all
3934         possibilities.
3935         (MemberBase): Detection whether member is explicit interface
3936         implementation is now in constructor.
3937         (MemberBase.UpdateMemberName): Handles IndexerName.
3938         (Accessor): Changed to keep also location information.
3939         (AbstractPropertyEventMethod): Is derived from MemberCore.
3940         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
3941         will be emited or not.
3942         (PropertyBase.AreAccessorsDuplicateImplementation):
3943         Tests whether accessors are not in collision with some method.
3944         (Operator): Is derived from MethodCore to simplify common
3945         operations.
3946
3947         * decl.cs (Flags.TestMethodDuplication): Test for duplication
3948         must be performed.
3949         (DeclSpace.AddToContainer): Adds the member to defined_names
3950         table. It tests for duplications and enclosing name conflicts.
3951
3952         * enum.cs (EnumMember): Clean up to reuse the base structures
3953
3954 2004-09-03  Martin Baulig  <martin@ximian.com>
3955
3956         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3957         into TypeContainer, to make partial classes work again.
3958
3959 2004-09-03  Martin Baulig  <martin@ximian.com>
3960
3961         * rootcontext.cs (RootContext.V2): Removed.
3962
3963 2004-03-23  Martin Baulig  <martin@ximian.com>
3964
3965         * expression.cs (Invocation.OverloadResolve): Added `bool
3966         may_fail' argument and use it instead of the Location.IsNull() hack.
3967
3968 2004-09-03  Martin Baulig  <martin@ximian.com>
3969
3970         Merged latest changes into gmcs.  Please keep this comment in
3971         here, it makes it easier for me to see what changed in MCS since
3972         the last time I merged.
3973
3974 2004-09-03  Raja R Harinath  <rharinath@novell.com>
3975
3976         Fix #61128.
3977         * expression.cs (BetterConversion): Don't allow either conversion 
3978         to be null.  Remove redundant implicit conversion test when 'q ==
3979         null' -- when this function is invoked, we already know that the
3980         implicit conversion exists.
3981         (BetterFunction): Assume that 'best' is non-null.  Remove
3982         redundant reimplementation of IsApplicable when 'best' is null.
3983         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
3984         number of arguments.
3985         (IsAncestralType): Extract from OverloadResolve.
3986         (OverloadResolve): Make robust to the MethodGroupExpr being
3987         unsorted.  Implement all the logic of Section 14.5.5.1, and
3988         support overloading of methods from multiple applicable types.
3989         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
3990
3991         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3992         (RealError, Warning): Append type of report to related symbol.
3993
3994 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
3995
3996         * enum.cs: Fixed CLS-Compliance checks for enum members.
3997         Error tests cs3008-8.cs, cs3014-8.cs
3998
3999 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4000
4001         Fixed bug #62342, #63102
4002         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4003         like ImplementMethod.
4004
4005 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4006
4007         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4008         Fixed bug #65170.
4009
4010 2004-09-02  Martin Baulig  <martin@ximian.com>
4011
4012         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4013         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4014         on the MethodBase.
4015
4016 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4017
4018         C# 2.0 Static classes implemented
4019
4020         * class.cs (TypeContainer): instance_constructors,
4021         initialized_fields, initialized_static_fields,
4022         default_constructor, base_inteface_types are protected to be
4023         accessible from StaticClass.
4024         (TypeContainer.DefineDefaultConstructor): New virtual method
4025         for custom default constructor generating
4026         (StaticClass): New class to handle "Static classes" feature.
4027
4028         * cs-parser.jay: Handle static keyword on class like instance
4029         of StaticClass.
4030
4031         * driver.cs: Added "/langversion" command line switch with two
4032         options (iso-1, default).
4033
4034 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4035
4036         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4037
4038 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4039
4040         * delegate.cs: Style.
4041
4042 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4043
4044         * delegate.cs: Add seperate instance expr field for miguel.
4045
4046 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4047
4048         * PointerArithmetic (Resolve): make sure we are not doing
4049         pointer arith on void*. Also, make sure we are resolved
4050         by not setting eclass until resolve.
4051
4052         All callers: Make sure that PointerArithmetic gets resolved.
4053
4054 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4055
4056         * ArrayCreation (LookupType): If the type does not resolve 
4057         to an array, give an error.
4058
4059 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4060
4061         * statement.cs (Try.Resolve): Fixed bug #64222
4062
4063 2004-08-27  Martin Baulig  <martin@ximian.com>
4064
4065         * class.cs
4066         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4067         crash here.     
4068
4069 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4070
4071         * ecore.cs (Constantify): Get underlying type via
4072         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4073         Windows in special cases.
4074
4075 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4076
4077         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4078         for obtaining also private methods.
4079         (GetRemoveMethod): Used GetRemoveMethod (true)
4080         for obtaining also private methods.
4081
4082 2004-08-24  Martin Baulig  <martin@ximian.com>
4083
4084         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4085         MethodAttributes.HideBySig for operators.
4086
4087 2004-08-23  Martin Baulig  <martin@ximian.com>
4088
4089         Back to the old error reporting system :-)
4090
4091         * report.cs (Message): Removed.
4092         (Report.MessageData, ErrorData, WarningData): Removed.
4093         (Report.Error, Warning): Back to the old system.
4094
4095 2004-08-23  Martin Baulig  <martin@ximian.com>
4096
4097         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4098
4099         * class.cs (TypeContainer.ParentContainer): New public virtual
4100         method; replaces the explicit interface implementation.
4101         (ClassPart.ParentContainer): Override.
4102
4103 2004-08-23  Martin Baulig  <martin@ximian.com>
4104
4105         * statement.cs (Switch): Added support for constant switches; see
4106         #59428 or test-285.cs.
4107
4108 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4109
4110         Fixed bug #62740.
4111         * statement.cs (GetEnumeratorFilter): Removed useless
4112         logic because C# specs is strict. GetEnumerator must be
4113         public.
4114
4115 2004-08-22  Martin Baulig  <martin@ximian.com>
4116
4117         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4118         a switch and may break, reset the barrier.  Fixes #59867.
4119
4120 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4121
4122         CLS-Compliance speed up (~5% for corlib)
4123
4124         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
4125         New method. Tests container for CLS-Compliant names
4126
4127         * class.cs (TypeContainer.VerifyClsName): New method.
4128         Checks whether container name is CLS Compliant.
4129         (Constructor): Implements IMethodData.
4130
4131         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
4132         low-case table for CLS Compliance test.
4133         (MemberCache.VerifyClsParameterConflict): New method.
4134         Checks method parameters for CS3006 error.
4135
4136         * enum.cs (EnumMember): Is derived from MemberCore.
4137         (Enum.VerifyClsName): Optimized for better performance.
4138
4139 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4140
4141         * report.cs: Renamed Error_T to Error and changed all
4142         references.
4143
4144 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4145
4146         * class.cs (TypeContainer.IndexerArrayList): New inner class
4147         container for indexers.
4148         (TypeContainer.DefaultIndexerName): New constant for default
4149         indexer name. Replaced all "Item" with this constant.
4150         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
4151
4152         * typemanager.cs (TypeManager.default_member_ctor): Cache here
4153         DefaultMemberAttribute constructor.
4154
4155 2004-08-05  Martin Baulig  <martin@ximian.com>
4156
4157         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4158         Fix bug #59429.
4159
4160 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
4161
4162         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
4163         multi platforms problem.
4164
4165         * compiler.csproj: Included shared files.
4166
4167 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4168
4169         Fix bug 60333, 55971 in the more general way
4170         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4171         Added arg_type argument for constant conversion.
4172         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
4173
4174 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4175
4176         Fix bug #59760
4177         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
4178         OperatorArrayList, MethodCoreArrayList for typecontainer
4179         containers. Changed class member types to these new types.
4180         (MethodArrayList.DefineMembers): Added test for CS0659.
4181
4182 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
4183
4184         * cfold.cs: Synchronize the folding with the code in expression.cs
4185         Binary.DoNumericPromotions for uint operands.
4186
4187         * attribute.cs: Revert patch from Raja, it introduced a regression
4188         while building Blam-1.2.1 (hard to isolate a test case).
4189
4190 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4191
4192         Fix for #55382
4193         * class.cs:
4194         (TypeContainer.Define): Renamed to DefineContainerMembers because of
4195         name collision.
4196         (MethodCore.parent_method): New member. The method we're overriding
4197         if this is an override method.
4198         (MethodCore.CheckBase): Moved from Method class and made common.
4199         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
4200         private.
4201         (MethodCore.CheckForDuplications): New abstract method. For custom
4202         member duplication search in a container
4203         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
4204         method and its return type.
4205         (Event.conflict_symbol): New member. Symbol with same name in the
4206         parent class.
4207
4208         * decl.cs:
4209         (MemberCache.FindMemberWithSameName): New method. The method
4210         is looking for conflict with inherited symbols.
4211
4212 2004-08-04  Martin Baulig  <martin@ximian.com>
4213
4214         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
4215
4216         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
4217
4218 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4219
4220         * report.cs (Message): New enum for better error, warning reference in
4221         the code.
4222         (MessageData): New inner abstract class. It generally handles printing of
4223         error and warning messages.
4224         Removed unused Error, Warning, Message methods.
4225
4226 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4227
4228         Fix for cs0592-8.cs test
4229         * attribute.cs
4230         (Attributable.ValidAttributeTargets): Made public.
4231         (Attribute.ExplicitTarget): New member for explicit target value.
4232         (Attribute.CheckTargets): Now we translate explicit attribute
4233         target to Target here.
4234
4235 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
4236
4237         * ecore.cs (MethodGroupExpr): new IsBase property.
4238
4239         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
4240
4241         * delegate.cs (DelegateCreation): store a MethodGroupExpr
4242         rather than an instance expr.
4243
4244         (DelegateCreation.Emit): Use the method group rather than
4245         the instance expression. Also, if you have base.Foo as the
4246         method for a delegate, make sure to emit ldftn, not ldftnvirt.
4247
4248         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
4249
4250         (NewDelegate.DoResolve): Only check for the existance of Invoke
4251         if the method is going to be needed. Use MethodGroupExpr.
4252
4253         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
4254
4255         * expression.cs: For pointer arith., make sure to use
4256         the size of the type, not the size of the pointer to
4257         the type.
4258
4259 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4260
4261         Fix for #60722
4262         * class.cs (Class): Added error CS0502 test.
4263
4264 2004-08-03  John Luke  <jluke@cfl.rr.com>
4265             Raja R Harinath  <rharinath@novell.com>
4266
4267         Fix for #60997.
4268         * attribute.cs (Attribute.complained_before): New flag.
4269         (Attribute.ResolveType, Attribute.Resolve),
4270         (Attribute.DefinePInvokeMethod): Set it.
4271         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
4272         
4273 2004-08-03  Martin Baulig  <martin@ximian.com>
4274
4275         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
4276         use a user-defined operator; we still need to do numeric
4277         promotions in case one argument is a builtin type and the other
4278         one has an implicit conversion to that type.  Fixes #62322.
4279
4280 2004-08-02  Martin Baulig  <martin@ximian.com>
4281
4282         * statement.cs (LocalInfo.Flags): Added `IsThis'.
4283         (LocalInfo.IsThis): New public property.
4284         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
4285
4286 2004-08-01  Martin Baulig  <martin@ximian.com>
4287
4288         * class.cs (TypeContainer.GetClassBases): Don't set the default
4289         here since we may get called from GetPartialBases().
4290         (TypeContainer.DefineType): If GetClassBases() didn't return a
4291         parent, use the default one.
4292
4293 2004-07-30  Duncan Mak  <duncan@ximian.com>
4294
4295         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
4296
4297 2004-07-30  Martin Baulig  <martin@ximian.com>
4298
4299         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
4300
4301         * class.cs (SourceMethod): New public class, derive from the
4302         symbol writer's ISourceMethod.
4303         (Method): Use the new symbol writer API.
4304
4305         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
4306         as argument and use the new symbol writer.
4307
4308         * location.cs
4309         (SourceFile): Implement the symbol writer's ISourceFile.
4310         (Location.SymbolDocument): Removed.
4311         (Location.SourceFile): New public property.
4312
4313         * symbolwriter.cs: Use the new symbol writer API.
4314
4315 2004-07-30  Raja R Harinath  <rharinath@novell.com>
4316
4317         * Makefile (install-local): Remove.  Functionality moved to
4318         executable.make.
4319
4320 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
4321
4322         * Makefile: Install mcs.exe.config file together with mcs.exe.
4323         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
4324         correct runtime version.
4325         
4326 2004-07-25  Martin Baulig  <martin@ximian.com>
4327
4328         * class.cs
4329         (TypeContainer.RegisterOrder): Removed, this was unused.
4330         (TypeContainer, interface_order): Removed.
4331         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
4332         TypeContainer as argument since we can also be called with a
4333         `PartialContainer' for a partial class/struct/interface.
4334         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
4335         of checking whether we're an `Interface' - we could be a
4336         `PartialContainer'.
4337         (PartialContainer.Register): Override; call
4338         AddClass()/AddStruct()/AddInterface() on our parent.
4339
4340         * cs-parser.jay (interface_member_declaration): Add things to the
4341         `current_container', not the `current_class'.
4342
4343         * rootcontext.cs (RegisterOrder): The overloaded version which
4344         takes an `Interface' was unused, removed.
4345
4346         * typemanager.cs (TypeManager.LookupInterface): Return a
4347         `TypeContainer', not an `Interface'.
4348         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
4349         contain a `PartialContainer' for an interface, so check it's
4350         `Kind' to figure out what it is.
4351
4352 2004-07-25  Martin Baulig  <martin@ximian.com>
4353
4354         * class.cs (Class.DefaultTypeAttributes): New public constant.
4355         (Struct.DefaultTypeAttributes): Likewise.
4356         (Interface.DefaultTypeAttributes): Likewise.
4357         (PartialContainer.TypeAttr): Override this and add the
4358         DefaultTypeAttributes.
4359
4360 2004-07-25  Martin Baulig  <martin@ximian.com>
4361
4362         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
4363         we can just use the `Parent' field instead.
4364
4365 2004-07-25  Martin Baulig  <martin@ximian.com>
4366
4367         * class.cs (TypeContainer.Emit): Renamed to EmitType().
4368
4369 2004-07-25  Martin Baulig  <martin@ximian.com>
4370
4371         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
4372         our parts before defining any methods.
4373         (TypeContainer.VerifyImplements): Make this virtual.
4374         (ClassPart.VerifyImplements): Override and call VerifyImplements()
4375         on our PartialContainer.
4376
4377 2004-07-25  Martin Baulig  <martin@ximian.com>
4378
4379         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
4380
4381         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
4382         argument, we can just use the `Parent' field instead.
4383
4384         * class.cs
4385         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
4386         (MemberBase.DoDefine): Likewise.
4387
4388 2004-07-24  Martin Baulig  <martin@ximian.com>
4389
4390         * decl.cs (MemberCore.Parent): New public field.
4391         (DeclSpace.Parent): Moved to MemberCore.
4392
4393         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
4394         (MemberBase.ctor): Added TypeContainer argument, pass it to our
4395         parent's .ctor.
4396         (FieldBase, Field, Operator): Likewise.
4397         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
4398         (EventField, Event): Likewise.
4399
4400 2004-07-23  Martin Baulig  <martin@ximian.com>
4401
4402         * class.cs (PartialContainer): New public class.
4403         (ClassPart): New public class.
4404         (TypeContainer): Added support for partial classes.
4405         (TypeContainer.GetClassBases): Splitted some of the functionality
4406         out into GetNormalBases() and GetPartialBases().
4407
4408         * cs-tokenizer.cs (Token.PARTIAL): New token.
4409         (Tokenizer.consume_identifier): Added some hacks to recognize
4410         `partial', but only if it's immediately followed by `class',
4411         `struct' or `interface'.
4412
4413         * cs-parser.jay: Added support for partial clases.
4414
4415 2004-07-23  Martin Baulig  <martin@ximian.com>
4416
4417         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
4418         a `DeclSpace' and also made it readonly.
4419         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
4420         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
4421         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
4422
4423         * cs-parser.jay: Pass the `current_class', not the
4424         `current_container' (at the moment, this is still the same thing)
4425         to a new Method, Property, Event, Indexer or Constructor.
4426
4427 2004-07-23  Martin Baulig  <martin@ximian.com>
4428
4429         * cs-parser.jay (CSharpParser): Added a new `current_class' field
4430         and removed the `current_interface' one.
4431         (struct_declaration, class_declaration, interface_declaration):
4432         Set `current_class' to the newly created class/struct/interface;
4433         set their `Bases' and call Register() before parsing their body.
4434
4435 2004-07-23  Martin Baulig  <martin@ximian.com>
4436
4437         * class.cs (Kind): New public enum.
4438         (TypeContainer): Made this class abstract.
4439         (TypeContainer.Kind): New public readonly field.
4440         (TypeContainer.CheckDef): New public method; moved here from
4441         cs-parser.jay.
4442         (TypeContainer.Register): New public abstract method.
4443         (TypeContainer.GetPendingImplementations): New public abstract
4444         method.
4445         (TypeContainer.GetClassBases): Removed the `is_class' and
4446         `is_iface' parameters.
4447         (TypeContainer.DefineNestedTypes): Formerly known as
4448         DoDefineType().
4449         (ClassOrStruct): Made this class abstract.
4450
4451         * tree.cs (RootTypes): New public type. 
4452
4453 2004-07-20  Martin Baulig  <martin@ximian.com>
4454
4455         * tree.cs (Tree.RecordNamespace): Removed.
4456         (Tree.Namespaces): Removed.
4457
4458         * rootcontext.cs (RootContext.IsNamespace): Removed.
4459
4460         * cs-parser.jay (namespace_declaration): Just create a new
4461         NamespaceEntry here.
4462
4463 2004-07-20  Martin Baulig  <martin@ximian.com>
4464
4465         * statement.cs (ExceptionStatement): New abstract class.  This is
4466         now used as a base class for everyone who's using `finally'.
4467         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
4468         our local variables before using them.
4469
4470         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
4471         virtual method.  This is used by Yield.Resolve() to "steal" an
4472         outer block's `finally' clauses.
4473         (FlowBranchingException): The .ctor now takes an ExceptionStatement
4474         argument.
4475
4476         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
4477         version which takes an ExceptionStatement.  This version must be
4478         used to create exception branchings.
4479
4480         * iterator.cs
4481         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
4482         (Iterator.EmitMoveNext): Added exception support; protect the
4483         block with a `fault' clause, properly handle 'finally' clauses.
4484         (Iterator.EmitDispose): Run all the `finally' clauses here.
4485
4486 2004-07-20  Martin Baulig  <martin@ximian.com>
4487
4488         * iterator.cs: This is the first of a set of changes in the
4489         iterator code.  Match the spec more closely: if we're an
4490         IEnumerable, then GetEnumerator() must be called.  The first time
4491         GetEnumerator() is called, it returns the current instance; all
4492         subsequent invocations (if any) must create a copy.
4493
4494 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
4495
4496         * expression.cs: Resolve the constant expression before returning
4497         it. 
4498
4499 2004-07-19  Martin Baulig  <martin@ximian.com>
4500
4501         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
4502         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
4503         the return type of the new EmitContext.
4504
4505 2004-07-18  Martin Baulig  <martin@ximian.com>
4506
4507         * class.cs (Property.Define): Fix iterators.
4508
4509         * iterators.cs (Iterator.Define): Moved the
4510         `container.AddInterator (this)' call here from the .ctor; only do
4511         it if we resolved successfully.
4512
4513 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
4514
4515         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
4516         `true' for preprocessing directives that we parse.  The return
4517         value indicates whether we should return to regular tokenizing or
4518         not, not whether it was parsed successfully.
4519
4520         In the past if we were in: #if false ... #line #endif, we would
4521         resume parsing after `#line'.  See bug 61604.
4522
4523         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
4524         building: IsEnumType should return true only for enums, not for
4525         enums or System.Enum itself.  This fixes #61593.
4526
4527         Likely what happened is that corlib was wrong: mcs depended on
4528         this bug in some places.  The bug got fixed, we had to add the
4529         hack, which caused bug 61593.
4530
4531         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
4532         that was a workaround for the older conditions.
4533
4534 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
4535
4536         * assign.cs: IAssignMethod has a new interface, as documented
4537         inline. All assignment code now uses this new api.
4538
4539         * ecore.cs, expression.cs: All classes which implement
4540         IAssignMethod now use the new interface.
4541
4542         * expression.cs (Invocation): add a hack to EmitCall so that
4543         IndexerAccess can be the target of a compound assignment without
4544         evaluating its arguments twice.
4545
4546         * statement.cs: Handle changes in Invocation api.
4547
4548 2004-07-16  Martin Baulig  <martin@ximian.com>
4549
4550         * iterators.cs: Rewrote this.  We're now using one single Proxy
4551         class for both the IEnumerable and the IEnumerator interface and
4552         `Iterator' derives from Class so we can use the high-level API.
4553
4554         * class.cs (TypeContainer.AddIterator): New method.
4555         (TypeContainer.DoDefineType): New protected virtual method, which
4556         is called from DefineType().
4557         (TypeContainer.DoDefineMembers): Call DefineType() and
4558         DefineMembers() on all our iterators.
4559         (TypeContainer.Emit): Call Emit() on all our iterators.
4560         (TypeContainer.CloseType): Call CloseType() on all our iterators.
4561
4562         * codegen.cs (EmitContext.CurrentIterator): New public field.
4563
4564 2004-07-15  Martin Baulig  <martin@ximian.com>
4565
4566         * typemanager.cs
4567         (TypeManager.not_supported_exception_type): New type.   
4568
4569 2004-07-14  Martin Baulig  <martin@ximian.com>
4570
4571         * iterators.cs: Use real error numbers.
4572
4573 2004-07-14  Martin Baulig  <martin@ximian.com>
4574
4575         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
4576         requires this to be a System.Collection.IEnumerable and not a
4577         class implementing that interface.
4578         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
4579
4580 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
4581
4582         * class.cs: Fixed previous fix, it broke some error tests.
4583
4584 2004-07-12  Martin Baulig  <martin@ximian.com>
4585
4586         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
4587         Fixes #61293.
4588
4589 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
4590
4591         * assign.cs (LocalTemporary): Add new argument: is_address,If
4592         `is_address' is true, then the value that we store is the address
4593         to the real value, and not the value itself.
4594         
4595         * ecore.cs (PropertyExpr): use the new local temporary
4596         stuff to allow us to handle X.Y += z (where X is a struct)
4597
4598 2004-07-08  Martin Baulig  <martin@ximian.com>
4599
4600         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
4601         not always return, just like we're doing in Using.Resolve().
4602
4603 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
4604
4605         * cs-parser.jay (fixed_statement): flag this as Pinned.
4606
4607 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
4608
4609         * typemanager.cs (TypeManager): Removed MakePinned method, this
4610         mechanism is replaced with the .NET 2.x compatible mechanism of
4611         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
4612
4613         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
4614         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
4615         `IsFixed' property which has a different meaning.
4616
4617 2004-07-02  Raja R Harinath  <rharinath@novell.com>
4618
4619         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
4620         visible from inside a nested class, not just the names of the
4621         immediately enclosing class.
4622         Fix for bug #60730.
4623
4624 2004-06-24  Raja R Harinath  <rharinath@novell.com>
4625
4626         * expression.cs (BetterConversion): Remove buggy special-case
4627         handling of "implicit constant expression conversions".  At this
4628         point, we already know that the conversion is possible -- we're
4629         only checking to see which is better.
4630
4631 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4632
4633         * cs-parser.jay: Added error CS0210 test.
4634
4635 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4636
4637         * cs-parser.jay: Added error CS0134 test.
4638
4639 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4640
4641         Fix bug #52507
4642         * cs-parser.jay: Added error CS0145 test.
4643
4644 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
4645
4646         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
4647
4648 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
4649         
4650         * expression.cs (StackAlloc.Resolve): The argument may not
4651         be a constant; deal with this case.
4652         
4653 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
4654
4655         * attribute.cs (IndexerName_GetIndexerName): Renamed to
4656         GetIndexerAttributeValue.
4657         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
4658
4659         * class.cs (Indexer.Define): Added error tests for CS0415,
4660         CS0609.
4661
4662 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
4663
4664         * attribute.cs (Attribute.Resolve): Keep field code in sync with
4665         property code.
4666
4667 2004-06-23  Martin Baulig  <martin@ximian.com>
4668
4669         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
4670         neither return nor throw, reset the barrier as well.  Fixes #60457.
4671
4672 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
4673
4674         * class.cs : EventAttributes is now set to None by default.
4675           This fixes bug #60459.
4676
4677 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4678
4679         Fix bug #60219
4680         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4681         Don't throw exception but return null (it's sufficient now).
4682
4683 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4684
4685         * typemanager.cs (GetArgumentTypes): Faster implementation.
4686
4687 2004-06-18  Martin Baulig  <martin@ximian.com>
4688
4689         * attribute.cs (Attribute.Resolve): Check whether we're an
4690         EmptyCast which a Constant child.  Fixes #60333.
4691
4692 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
4693
4694         * statement.cs (EmitCollectionForeach): Account for the fact that
4695         not all valuetypes are in areas which we can take the address of.
4696         For these variables, we store to a temporary variable. Also, make
4697         sure that we dont emit a `callvirt' on a valuetype method.
4698
4699 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4700
4701         * expression.cs (StackAlloc.DoReSolve): Added test for
4702         negative parameter (CS0247).
4703
4704 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4705
4706         Fix bug #59792
4707         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
4708
4709 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4710
4711         Fix bug #59781
4712         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
4713         ulong.
4714
4715 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4716
4717         Fix bug #58254 & cs1555.cs, cs1556.cs
4718         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
4719
4720 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4721
4722         * cs-parser.jay: Added error CS1669 test for indexers.
4723
4724 2004-06-11  Martin Baulig  <martin@ximian.com>
4725
4726         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
4727         call this twice: for params and varargs methods.
4728
4729 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4730
4731         * class.cs:
4732         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
4733
4734 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4735
4736         * attribute.cs (Attribute.GetValidTargets): Made public.
4737
4738         * class.cs: 
4739         (AbstractPropertyEventMethod): New class for better code sharing.
4740         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
4741         CS1667 report.
4742         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
4743
4744 2004-06-11  Raja R Harinath  <rharinath@novell.com>
4745
4746         Fix bug #59477.
4747         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
4748         that the call to Resolve is part of a MemberAccess.
4749         (Expression.Resolve): Use it for SimpleName resolution.
4750         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
4751         Add 'intermediate' boolean argument.
4752         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
4753         error message when the SimpleName can be resolved ambiguously
4754         between an expression and a type.
4755         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
4756         public.
4757         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
4758         call on the left-side.
4759
4760 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4761
4762         * class.cs:
4763         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
4764
4765 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4766
4767         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
4768
4769 2004-06-11  Martin Baulig  <martin@ximian.com>
4770
4771         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
4772         varargs methods if applicable.
4773
4774 2004-06-11  Martin Baulig  <martin@ximian.com>
4775
4776         * expression.cs (Invocation.EmitCall): Don't use
4777         `method.CallingConvention == CallingConventions.VarArgs' since the
4778         method could also have `CallingConventions.HasThis'.
4779
4780 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4781
4782         * class.cs (Event.GetSignatureForError): Implemented.
4783         Fixed crash in error test cs3010.cs
4784
4785 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
4786
4787         * cs-tokenizer.cs: Change the way we track __arglist to be
4788         consistent with the other keywords.
4789
4790 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
4791
4792         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
4793         tomorrow.
4794
4795 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
4796
4797         * codegen.cs: Check that all referenced assemblies have a strongname
4798         before strongnaming the compiled assembly. If not report error CS1577.
4799         Fix bug #56563. Patch by Jackson Harper.
4800         * typemanager.cs: Added a method to return all referenced assemblies.
4801         Fix bug #56563. Patch by Jackson Harper.
4802
4803 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
4804
4805         * class.cs:
4806         (Method.ApplyAttributeBuilder): Moved and added conditional
4807         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
4808
4809         * delegate.cs:
4810         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
4811
4812 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
4813
4814         Fixed #59640
4815         * class.cs: (EventField.attribute_targets): Changed default target.
4816
4817 2004-06-08  Martin Baulig  <martin@ximian.com>
4818
4819         * expression.cs (Invocation.EmitCall): Enable varargs methods.
4820
4821 2004-06-08  Martin Baulig  <martin@ximian.com>
4822
4823         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
4824
4825 2004-06-07  Martin Baulig  <martin@ximian.com>
4826
4827         Added support for varargs methods.
4828
4829         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
4830         keyword.
4831
4832         * cs-parser.jay: Added support for `__arglist'.
4833
4834         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
4835
4836         * expression.cs (Argument.AType): Added `ArgList'.
4837         (Invocation): Added support for varargs methods.
4838         (ArglistAccess): New public class.
4839         (Arglist): New public class.
4840
4841         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
4842
4843         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
4844         a method's top-level block if the method has varargs.
4845
4846         * support.cs (ReflectionParameters, InternalParameters): Added
4847         support for varargs methods.    
4848
4849 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
4850
4851         * class.cs: Provide location in indexer error report.
4852
4853         * driver.cs: Use standard names.
4854
4855         * namespace.cs: Catch the use of using after a namespace has been
4856         declared also on using aliases.
4857
4858 2004-06-03  Raja R Harinath  <rharinath@novell.com>
4859
4860         Bug #50820.
4861         * typemanager.cs (closure_private_ok, closure_invocation_type)
4862         (closure_qualifier_type, closure_invocation_assembly)
4863         (FilterWithClosure): Move to ...
4864         (Closure): New internal nested class.
4865         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
4866         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
4867         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
4868         (MemberLookup, MemberLookupFailed): Use it.
4869         * expression.cs (New.DoResolve): Treat the lookup for the
4870         constructor as being qualified by the 'new'ed type.
4871         (Indexers.GetIndexersForTypeOrInterface): Update.
4872
4873 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
4874
4875         * attribute.cs
4876         (GetConditionalAttributeValue): New method. Returns
4877         condition of ConditionalAttribute.
4878         (SearchMulti): New method.  Returns all attributes of type 't'.
4879         Use it when attribute is AllowMultiple = true.
4880         (IsConditionalMethodExcluded): New method.
4881
4882         * class.cs
4883         (Method.IsExcluded): Implemented. Returns true if method has conditional
4884         attribute and the conditions is not defined (method is excluded).
4885         (IMethodData): Extended interface for ConditionalAttribute support.
4886         (PropertyMethod.IsExcluded): Implemented.
4887
4888         * decl.cs
4889         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
4890
4891         * expression.cs
4892         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
4893         on the method.
4894
4895 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
4896
4897         * expression.cs (ArrayCreationExpression): Make this just an
4898         `expression'. It can't be a statement, so the code here was
4899         dead.
4900
4901 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
4902
4903         Fixed #59072
4904         * typemanager.cs (GetFullNameSignature): New method for
4905         MethodBase types.
4906
4907 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
4908
4909         Fixed #56452
4910         * class.cs (MemberBase.GetSignatureForError): New virtual method.
4911         Use this method when MethodBuilder is null.
4912         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
4913         Added test for error CS0626 (MONO reports error for this situation).
4914         (IMethodData.GetSignatureForError): Extended interface.
4915
4916 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4917
4918         * attribute.cs
4919         (AttributeTester.GetObsoleteAttribute): Returns instance of
4920         ObsoleteAttribute when type is obsolete.
4921
4922         * class.cs
4923         (TypeContainer.VerifyObsoleteAttribute): Override.
4924         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4925         (MethodCode.VerifyObsoleteAttribute): Override.
4926         (MemberBase.VerifyObsoleteAttribute): Override.
4927
4928         * decl.cs
4929         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4930         and report proper error.
4931
4932         *delegate.cs
4933         Delegate.VerifyObsoleteAttribute): Override.
4934
4935         * ecore.cs
4936         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4937         and report proper error.
4938         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4939
4940         * enum.cs
4941         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4942         and enum member.
4943
4944         * expression.cs
4945         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4946         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4947         Added test for ObsoleteAttribute.
4948
4949         * statement.cs
4950         (Catch): Derived from Statement.
4951
4952 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
4953  
4954         Fixed bug #59071 & cs0160.cs
4955  
4956         * statement.cs (Try.Resolve): Check here whether order of catch
4957         clauses matches their dependencies.
4958
4959 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
4960
4961         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
4962         caused a regression: #59343.  Referencing nested classes from an
4963         assembly stopped working.
4964
4965 2004-05-31  Martin Baulig  <martin@ximian.com>
4966
4967         MCS is now frozen for beta 2.
4968
4969 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4970
4971         * convert.cs: add a trivial cache for overload operator resolution.
4972
4973 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4974
4975         * decl.cs: If possible, use lookuptypedirect here. We can only do
4976         this if there is no `.' after the namespace. Avoids using
4977         LookupType, which does lots of slow processing.
4978         (FindNestedType) New method, does what it says :-).
4979         * namespace.cs: use LookupTypeDirect.
4980         * rootcontext.cs: use membercache, if possible.
4981         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4982
4983 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4984
4985         * expression.cs:
4986         According to the spec, 
4987
4988         In a member access of the form E.I, if E is a single identifier,
4989         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4990         field, property, localvariable, or parameter with the same type as
4991         the meaning of E as a type-name (§3.8), then both possible
4992         meanings of E are permitted.
4993
4994         We did not check that E as a simple-name had the same type as E as
4995         a type name.
4996
4997         This trivial check gives us 5-7% on bootstrap time.
4998
4999 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5000
5001         * expression.cs (Invocation.OverloadResolve): Avoid the
5002         use of hashtables and boxing here by allocating on demand.
5003
5004 2004-05-30  Martin Baulig  <martin@ximian.com>
5005
5006         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5007         we're doing a silent lookup.  Don't try to lookup nested types in
5008         TypeManager.object_type (thanks to Ben Maurer).
5009
5010 2004-05-30  Martin Baulig  <martin@ximian.com>
5011
5012         Committing a patch from Ben Maurer.
5013
5014         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5015
5016 2004-05-29  Martin Baulig  <martin@ximian.com>
5017
5018         * class.cs (IMethodData.ShouldIgnore): New method.
5019
5020         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5021         `Location' argument, we don't need it anywhere.  Use
5022         `IMethodData.ShouldIgnore ()' instead of
5023         `MethodData.GetMethodFlags ()'.
5024         (TypeManager.AddMethod): Removed.
5025         (TypeManager.AddMethod2): Renamed to AddMethod.
5026
5027 2004-05-29  Martin Baulig  <martin@ximian.com>
5028
5029         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5030
5031         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5032         converting from a class type S to an interface type and we already
5033         have an object on the stack, don't box it again.  Fixes #52578.
5034
5035 2004-05-29  Martin Baulig  <martin@ximian.com>
5036
5037         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5038         Added support for `params' parameters.  Fixes #59267.
5039
5040 2004-05-29  Martin Baulig  <martin@ximian.com>
5041
5042         * literal.cs (NullPointer): Provide a private .ctor which sets
5043         `type' to TypeManager.object_type.  Fixes #59048.
5044
5045 2004-05-29  Martin Baulig  <martin@ximian.com>
5046
5047         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5048         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5049
5050         * ecore.cs (EventExpr.instance_expr): Make the field private.
5051
5052 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5053
5054         Fixed bug #50080 & cs0214-2.cs
5055         * expression.cs (Cast.DoResolve): Check unsafe context here.
5056         
5057         * statement.cs (Resolve.DoResolve): Likewise.
5058
5059 2004-05-26  Martin Baulig  <martin@ximian.com>
5060
5061         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5062
5063         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5064         (RootContext.LookupType): Pass down the `silent' flag.
5065
5066 2004-05-25  Martin Baulig  <martin@ximian.com>
5067
5068         * expression.cs
5069         (MethodGroupExpr.IdenticalTypeName): New public property.
5070         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5071         expression actually refers to a type.
5072
5073 2004-05-25  Martin Baulig  <martin@ximian.com>
5074
5075         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5076         for #56176 and made it actually work.
5077
5078 2004-05-25  Martin Baulig  <martin@ximian.com>
5079
5080         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5081         (FieldExpr, PropertyExpr): Override and implement
5082         CacheTemporaries.  Fixes #52279.
5083
5084 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5085
5086         * location.cs: In the new compiler listing a file twice is a
5087         warning, not an error.
5088
5089 2004-05-24  Martin Baulig  <martin@ximian.com>
5090
5091         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5092         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5093
5094 2004-05-24  Martin Baulig  <martin@ximian.com>
5095
5096         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5097         walking the `using' list.  Fixes #53921.
5098
5099 2004-05-24  Martin Baulig  <martin@ximian.com>
5100
5101         * const.cs (Const.LookupConstantValue): Added support for
5102         EmptyCast's; fixes #55251.
5103
5104 2004-05-24  Martin Baulig  <martin@ximian.com>
5105
5106         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5107         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5108         which does the CS0135 check.  The reason is that we first need to
5109         check whether the variable actually exists.
5110
5111 2004-05-24  Martin Baulig  <martin@ximian.com>
5112
5113         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5114         than RootContext.LookupType() to find the explicit interface
5115         type.  Fixes #58584.
5116
5117 2004-05-24  Raja R Harinath  <rharinath@novell.com>
5118
5119         * Makefile: Simplify.  Use executable.make.
5120         * mcs.exe.sources: New file.  List of sources of mcs.exe.
5121
5122 2004-05-24  Anders Carlsson  <andersca@gnome.org>
5123
5124         * decl.cs:
5125         * enum.cs:
5126         Use the invariant culture when doing String.Compare for CLS case
5127         sensitivity.
5128         
5129 2004-05-23  Martin Baulig  <martin@ximian.com>
5130
5131         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
5132         don't have any dots.  Fixes #52622, added cs0246-8.cs.
5133
5134         * namespace.cs (NamespaceEntry.Lookup): Likewise.
5135         
5136 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5137
5138         * class.cs (MemberBase.Define): Reuse MemberType member for 
5139         resolved type. Other methods can use it too.
5140
5141 2004-05-23  Martin Baulig  <martin@ximian.com>
5142
5143         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
5144         the variable also exists in the current block (otherwise, we need
5145         to report a CS0103).  Fixes #58670.
5146
5147 2004-05-23  Martin Baulig  <martin@ximian.com>
5148
5149         * flowanalysis.cs (Reachability.Reachable): Compute this
5150         on-the-fly rather than storing it as a field.
5151
5152 2004-05-23  Martin Baulig  <martin@ximian.com>
5153
5154         * flowanalysis.cs (Reachability.And): Manually compute the
5155         resulting `barrier' from the reachability.      
5156        
5157 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5158
5159         Fix bug #57835
5160         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
5161         instance of ObsoleteAttribute when symbol is obsolete.
5162
5163         * class.cs
5164         (IMethodData): Extended interface for ObsoleteAttribute support.
5165
5166 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5167
5168         * attribute.cs: Fix bug #55970
5169
5170 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5171
5172         Fix bug #52705
5173         * attribute.cs
5174         (GetObsoleteAttribute): New method. Creates the instance of
5175         ObsoleteAttribute.
5176         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
5177         ObsoleteAttribute when member is obsolete.
5178         (AttributeTester.Report_ObsoleteMessage): Common method for
5179         Obsolete error/warning reporting.
5180
5181         * class.cs
5182         (TypeContainer.base_classs_type): New member for storing parent type.
5183
5184         * decl.cs
5185         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
5186         for this MemberCore.
5187
5188 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5189
5190         * attribute.cs, const.cs: Fix bug #58590
5191
5192 2004-05-21  Martin Baulig  <martin@ximian.com>
5193
5194         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
5195         out parameters if the end of the method is unreachable.  Fixes
5196         #58098. 
5197
5198 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5199
5200         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
5201         Hari was right, why extra method.
5202
5203 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5204
5205         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
5206
5207 2004-05-20  Martin Baulig  <martin@ximian.com>
5208
5209         Merged this back from gmcs to keep the differences to a minumum.
5210
5211         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
5212         instead of a Declspace.
5213         (Attribute.ResolveType): Likewise.
5214         (Attributes.Search): Likewise.
5215         (Attributes.Contains): Likewise.
5216         (Attributes.GetClsCompliantAttribute): Likewise.
5217
5218         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
5219         argument.
5220         (MethodData.ApplyAttributes): Take an EmitContext instead of a
5221         DeclSpace.
5222
5223 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
5224
5225         Fix bug #58688 (MCS does not report error when the same attribute
5226         is assigned twice)
5227
5228         * attribute.cs (Attribute.Emit): Distinction between null and default.
5229
5230 2004-05-19  Raja R Harinath  <rharinath@novell.com>
5231
5232         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
5233         of a top-level attribute without an attribute target.
5234         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
5235         Make non-static.
5236         (Attribute.Conditional_GetConditionName), 
5237         (Attribute.Obsolete_GetObsoleteMessage): Update.
5238         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
5239         part of ScanForIndexerName.
5240         (Attribute.CanIgnoreInvalidAttribute): New function.
5241         (Attribute.ScanForIndexerName): Move to ...
5242         (Attributes.ScanForIndexerName): ... here.
5243         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
5244         (Attributes.Search): New internal variant that can choose not to
5245         complain if types aren't resolved.  The original signature now
5246         complains.
5247         (Attributes.GetClsCompliantAttribute): Use internal variant, with
5248         complaints suppressed.
5249         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
5250         only if it not useful.
5251         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
5252         top-level for attributes that are shared between the assembly
5253         and a top-level class.
5254         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
5255         * class.cs: Update to reflect changes.
5256         (DefineIndexers): Fuse loops.
5257         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
5258         a couple more variants of attribute names.
5259
5260 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
5261
5262         Fix bug #52585 (Implemented explicit attribute declaration)
5263
5264         * attribute.cs:
5265         (Attributable.ValidAttributeTargets): New abstract method. It gets
5266         list of valid attribute targets for explicit target declaration.
5267         (Attribute.Target): It holds target itself.
5268         (AttributeSection): Removed.
5269         (Attribute.CheckTargets): New method. It checks whether attribute
5270         target is valid for the current element.
5271
5272         * class.cs:
5273         (EventProperty): New class. For events that are declared like
5274         property (with add and remove accessors).
5275         (EventField): New class. For events that are declared like field.
5276         class.cs
5277
5278         * cs-parser.jay: Implemented explicit attribute target declaration.
5279
5280         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
5281         Override ValidAttributeTargets.
5282
5283         * parameter.cs:
5284         (ReturnParameter): Class for applying custom attributes on 
5285         the return type.
5286         (ParameterAtribute): New class. Class for applying custom
5287         attributes on the parameter type.
5288
5289 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
5290
5291         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
5292         definitions. 
5293
5294         (Method): Allow UNSAFE here.
5295
5296         * modifiers.cs: Support unsafe reporting.
5297
5298 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
5299
5300         * decl.cs: Fix bug #58478.
5301
5302 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5303
5304         * statement.cs: When checking for unreachable code on an EmptyStatement,
5305         set the location. Fixes bug #58488.
5306
5307 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
5308
5309         * driver.cs: Add -pkg handling.
5310
5311         From Gonzalo: UseShelLExecute=false
5312
5313 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
5314
5315         * attribute.cs:
5316         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
5317         for attribute.
5318         (Attribute.IsClsCompliaceRequired): Moved to base for better
5319         accesibility.
5320         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
5321         when attribute is AttributeUsageAttribute.
5322         (Attribute.GetValidTargets): Simplified.
5323         (Attribute.GetAttributeUsage): New method returns AttributeUsage
5324         attribute for this type.
5325         (Attribute.ApplyAttributes): Method renamed to Emit and make
5326         non-static.
5327         (GlobalAttributeSection): New class for special handling of global
5328         attributes (assembly, module).
5329         (AttributeSection.Emit): New method.
5330
5331         * class.cs: Implemented Attributable abstract methods.
5332         (MethodCore.LabelParameters): Moved to Parameter class.
5333         (Accessor): Is back simple class.
5334         (PropertyMethod): Implemented Attributable abstract class.
5335         (DelegateMethod): Implemented Attributable abstract class.
5336         (Event): New constructor for disctintion between normal Event
5337         and Event with accessors.
5338
5339         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
5340
5341         * codegen.cs, const.cs, decl.cs, delegate.cs:
5342         (CommonAssemblyModulClass): Implemented Attributable abstract class
5343         and simplified.
5344
5345         * enum.cs: Implement IAttributeSupport interface.
5346         (EnumMember): New class for emum members. Implemented Attributable
5347         abstract class
5348
5349         * parameter.cs:
5350         (ParameterBase): Is abstract.
5351         (ReturnParameter): New class for easier [return:] attribute handling.
5352
5353         * typemanager.cs: Removed builder_to_attr.
5354
5355 2004-05-11  Raja R Harinath  <rharinath@novell.com>
5356
5357         Fix bug #57151.
5358         * attribute.cs (Attribute.GetPositionalValue): New function.
5359         * class.cs (TypeContainer.VerifyMembers): New function.
5360         (TypeContainer.Emit): Use it.
5361         (ClassOrStruct): New base class for Class and Struct.
5362         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
5363         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
5364         class.
5365         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
5366         then each non-static field should have a FieldOffset attribute.
5367         Otherwise, none of the fields should have a FieldOffset attribute.
5368         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
5369         and FieldOffset attributes.
5370         * typemanager.cs (TypeManager.struct_layout_attribute_type)
5371         (TypeManager.field_offset_attribute_type): New core types.
5372         (TypeManager.InitCoreTypes): Initialize them.
5373
5374 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
5375
5376         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
5377         Return correct type.
5378         From bug #58270.
5379
5380 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
5381
5382         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
5383         be implicitly converted to ulong.
5384         
5385         * expression.cs: The logic for allowing operator &, | and ^ worked
5386         was wrong, it worked before because we did not report an error in
5387         an else branch.  Fixes 57895.
5388
5389         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
5390         allow volatile fields to be reference types.
5391
5392 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
5393
5394         * driver.cs: Add support for /debug-
5395
5396 2004-05-07  Raja R Harinath  <rharinath@novell.com>
5397
5398         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
5399         Add a 'complain' parameter to silence errors.
5400         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
5401         silently overlooked type-resolutions.
5402         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
5403         to reflect changes.
5404         (Attributes.Search): New function.
5405         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
5406         (Attributes.GetAttributeFullName): Remove hack.
5407         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
5408         Update to reflect changes.
5409         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5410         Use Attributes.Search instead of nested loops.
5411
5412 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
5413
5414         * decl.cs:
5415         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
5416         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
5417         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
5418
5419         * report.cs: (Report.Warning): Renamed to Warning_T because of
5420         parameter collision.
5421
5422 2004-05-05  Raja R Harinath  <rharinath@novell.com>
5423
5424         * expression.cs (MemberAccess.ResolveMemberAccess):
5425         Exit with non-zero status after Report.Error.
5426         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
5427         Likewise.
5428         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
5429
5430 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
5431
5432         * support.cs: Don't hang when the file is empty.
5433
5434 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
5435
5436         * support.cs: In SeekableStreamReader, compute the preamble size of the
5437           underlying stream. Position changes should take into account that initial
5438           count of bytes.
5439
5440 2004-05-03  Todd Berman  <tberman@sevenl.net>
5441
5442         * driver.cs: remove unused GetSysVersion function.
5443
5444 2004-05-03  Todd Berman  <tberman@sevenl.net>
5445
5446         * driver.cs: Remove the hack from saturday, as well as the hack
5447         from jackson (LoadAssemblyFromGac), also adds the CWD to the
5448         link_paths to get that bit proper.
5449
5450 2004-05-01  Todd Berman  <tberman@sevenl.net>
5451
5452         * driver.cs: Try a LoadFrom before a Load, this checks the current
5453         path. This is currently a bug in mono that is be fixed, however, this
5454         provides a workaround for now. This will be removed when the bug
5455         is fixed.
5456
5457 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
5458
5459         * CryptoConvert.cs: Updated to latest version. Fix issue with 
5460         incomplete key pairs (#57941).
5461
5462 2004-05-01  Todd Berman  <tberman@sevenl.net>
5463
5464         * driver.cs: Remove '.' from path_chars, now System.* loads properly
5465         from the GAC
5466
5467 2004-04-30  Jackson Harper  <jackson@ximian.com>
5468
5469         * codegen.cs: Open keys readonly.
5470         
5471 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5472
5473         * typemanager.cs: don't report cyclic struct layout when a struct
5474         contains 2 or more fields of the same type. Failed for Pango.AttrShape
5475         which has 2 Pango.Rectangle fields.
5476
5477 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5478
5479         * expression.cs: Handle IntPtr comparisons with IL code
5480         rather than a method call.
5481
5482 2004-04-29  Martin Baulig  <martin@ximian.com>
5483
5484         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
5485         the list of PropertyInfo's in class hierarchy and find the
5486         accessor.  Fixes #56013.
5487
5488 2004-04-29  Martin Baulig  <martin@ximian.com>
5489
5490         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
5491
5492 2004-04-29  Martin Baulig  <martin@ximian.com>
5493
5494         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
5495
5496         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
5497
5498 2004-04-29  Martin Baulig  <martin@ximian.com>
5499
5500         * class.cs (ConstructorInitializer.Resolve): Check whether the
5501         parent .ctor is accessible.  Fixes #52146.
5502
5503 2004-04-29  Martin Baulig  <martin@ximian.com>
5504
5505         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
5506
5507         * statement.cs (Using.EmitLocalVariableDecls): Use
5508         TypeManager.idisposable_type, not typeof (IDisposable).
5509         (Foreach.EmitCollectionForeach): Added support for valuetypes.
5510
5511 2004-04-29  Martin Baulig  <martin@ximian.com>
5512
5513         * class.cs (Event.Define): Don't emit the field and don't set
5514         RTSpecialName and SpecialName for events on interfaces.  Fixes
5515         #57703. 
5516
5517 2004-04-29  Raja R Harinath  <rharinath@novell.com>
5518
5519         Refactor Attribute.ApplyAttributes.
5520         * attribute.cs (Attributable): New base class for objects that can
5521         have Attributes applied on them.
5522         (Attribute): Make AttributeUsage fields public.
5523         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
5524         (Attribute.IsInternalCall): New property.
5525         (Attribute.UsageAttr): Convert to a public read-only property.
5526         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
5527         (Attribute.ResolveType, Attribute.Resolve)
5528         (Attribute.ScanForIndexerName): Update to reflect changes.
5529         (Attribute.CheckAttributeTarget): Re-format.
5530         (Attribute.ApplyAttributes): Refactor, to various
5531         Attributable.ApplyAttributeBuilder methods.
5532         * decl.cs (MemberCore): Make Attributable.
5533         * class.cs (Accessor): Make Attributable.
5534         (MethodData.ApplyAttributes): Use proper attribute types, not
5535         attribute names.
5536         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
5537         (TypeContainer.ApplyAttributeBuilder)
5538         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
5539         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
5540         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
5541         (Operator.ApplyAttributeBuilder): New factored-out methods.
5542         * const.cs (Const.ApplyAttributeBuilder): Likewise.
5543         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
5544         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
5545         * parameter.cs (ParameterBase): New Attributable base class
5546         that can also represent Return types.
5547         (Parameter): Update to the changes.
5548
5549 2004-04-29  Jackson Harper  <jackson@ximian.com>
5550
5551         * driver.cs: Prefer the corlib system version when looking for
5552         assemblies in the GAC. This is still a hack, but its a better hack
5553         now.
5554         
5555 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
5556
5557         * decl.cs, enum.cs: Improved error 3005 reporting.
5558   
5559         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
5560         (related_symbols): New private member for list of symbols
5561         related to reported error/warning.
5562         
5563         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
5564
5565 2004-04-29  Martin Baulig  <martin@ximian.com>
5566
5567         * ecore.cs (Expression.Constantify): If we're an enum and
5568         TypeManager.TypeToCoreType() doesn't give us another type, use
5569         t.UnderlyingSystemType.  Fixes #56178.  
5570
5571 2004-04-29  Martin Baulig  <martin@ximian.com>
5572
5573         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
5574         interfaces and for each interface, only add members directly
5575         declared in that interface.  Fixes #53255.
5576
5577 2004-04-28  Martin Baulig  <martin@ximian.com>
5578
5579         * expression.cs (ConditionalLogicalOperator): Use a temporary
5580         variable for `left' to avoid that we evaluate it more than once;
5581         bug #52588.
5582
5583 2004-04-28  Martin Baulig  <martin@ximian.com>
5584
5585         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
5586         `void[]' (CS1547).
5587
5588 2004-04-28  Martin Baulig  <martin@ximian.com>
5589
5590         * statement.cs (LocalInfo.Resolve): Check whether the type is not
5591         void (CS1547).
5592
5593         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
5594         whether the type is not void (CS1547).
5595
5596 2004-04-28  Martin Baulig  <martin@ximian.com>
5597
5598         * expression.cs (Unary.DoResolveLValue): Override this and report
5599         CS0131 for anything but Operator.Indirection.
5600
5601 2004-04-28  Martin Baulig  <martin@ximian.com>
5602
5603         Committing a patch from Ben Maurer; see bug #50820.
5604
5605         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5606         check for classes.
5607
5608         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5609         classes.        
5610
5611 2004-04-28  Martin Baulig  <martin@ximian.com>
5612
5613         Committing a patch from Ben Maurer; see bug #50820.
5614
5615         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5616         check for classes.
5617
5618         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5619         classes.        
5620
5621 2004-04-28  Martin Baulig  <martin@ximian.com>
5622
5623         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
5624         (Block.AddLabel): Call DoLookupLabel() to only search in the
5625         current block.
5626
5627 2004-04-28  Martin Baulig  <martin@ximian.com>
5628
5629         * cfold.cs (ConstantFold.BinaryFold): Added special support for
5630         comparing StringConstants and NullLiterals in Equality and Inequality.
5631
5632 2004-04-28  Jackson Harper  <jackson@ximian.com>
5633
5634         * driver.cs: Attempt to load referenced assemblies from the
5635         GAC. This is the quick and dirty version of this method that
5636         doesnt take into account versions and just takes the first
5637         canidate found. Will be good enough for now as we will not have more
5638         then one version installed into the GAC until I update this method.
5639
5640 2004-04-28  Martin Baulig  <martin@ximian.com>
5641
5642         * typemanager.cs (TypeManager.CheckStructCycles): New public
5643         static method to check for cycles in the struct layout.
5644
5645         * rootcontext.cs (RootContext.PopulateTypes): Call
5646         TypeManager.CheckStructCycles() for each TypeContainer.
5647         [Note: We only need to visit each type once.]
5648
5649 2004-04-28  Martin Baulig  <martin@ximian.com>
5650
5651         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
5652
5653         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
5654         success and added `out object value'.  Use a `bool resolved' field
5655         to check whether we've already been called rather than
5656         `ConstantValue != null' since this breaks for NullLiterals.
5657
5658 2004-04-28  Raja R Harinath  <rharinath@novell.com>
5659
5660         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
5661         setting of this flag, since the 'set' method may be non-public.
5662
5663 2004-04-28  Raja R Harinath  <rharinath@novell.com>
5664
5665         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
5666         check on current_vector.Block.
5667
5668 2004-04-27  Martin Baulig  <martin@ximian.com>
5669
5670         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
5671         a field initializer.  Fixes #56459.
5672
5673 2004-04-27  Martin Baulig  <martin@ximian.com>
5674
5675         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
5676         we're not attempting to use an indexer.  Fixes #52154.
5677
5678 2004-04-27  Martin Baulig  <martin@ximian.com>
5679
5680         * statement.cs (Return): Don't create a return label if we don't
5681         need it; reverts my change from January 20th.  Thanks to Ben
5682         Maurer for this.
5683
5684 2004-04-27  Martin Baulig  <martin@ximian.com>
5685
5686         According to the spec, `goto' can only leave a nested scope, but
5687         never enter it.
5688
5689         * statement.cs (Block.LookupLabel): Only lookup in the current
5690         block, don't recurse into parent or child blocks.
5691         (Block.AddLabel): Check in parent and child blocks, report
5692         CS0140/CS0158 if we find a duplicate.
5693         (Block): Removed this indexer for label lookups.
5694         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
5695         this already does the error reporting for us.
5696
5697         * flowanalysis.cs
5698         (FlowBranching.UsageVector.Block): New public variable; may be null.
5699         (FlowBranching.CreateSibling): Added `Block' argument.
5700         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
5701         label for the target of a `goto' and check whether we're not
5702         leaving a `finally'.
5703
5704 2004-04-27  Martin Baulig  <martin@ximian.com>
5705
5706         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5707         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
5708         just for returns).
5709
5710 2004-04-27  Martin Baulig  <martin@ximian.com>
5711
5712         * statement.cs (Block.AddLabel): Also check for implicit blocks
5713         and added a CS0158 check.
5714
5715 2004-04-27  Martin Baulig  <martin@ximian.com>
5716
5717         * flowanalysis.cs (FlowBranchingLoop): New class.
5718         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
5719         UsageVector's instead of an ArrayList.
5720         (FlowBranching.Label): Likewise.
5721         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
5722         (FlowBranching.AddBreakVector): New method.
5723
5724 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
5725
5726         * attribute.cs: Small regression fix: only convert the type if we
5727         the type is different, fixes System.Drawing build.
5728
5729 2004-04-27  Martin Baulig  <martin@ximian.com>
5730
5731         * attribute.cs (Attribute.Resolve): If we have a constant value
5732         for a named field or property, implicity convert it to the correct
5733         type.
5734
5735 2004-04-27  Raja R Harinath  <rharinath@novell.com>
5736
5737         * statement.cs (Block.Block): Implicit blocks share
5738         'child_variable_names' fields with parent blocks.
5739         (Block.AddChildVariableNames): Remove.
5740         (Block.AddVariable): Mark variable as "used by a child block" in
5741         every surrounding block.
5742         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
5743         been used in a child block, complain about violation of "Invariant
5744         meaning in blocks" rule.
5745         * cs-parser.jay (declare_local_variables): Don't use
5746         AddChildVariableNames.
5747         (foreach_statement): Don't create an implicit block: 'foreach'
5748         introduces a scope.
5749
5750 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
5751
5752         * convert.cs (ImplicitNumericConversion): 0 is also positive when
5753         converting from 0L to ulong.  Fixes 57522.
5754
5755 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5756
5757         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
5758         derived class hides via 'new' keyword field from base class (test-242.cs).
5759         TODO: Handle this in the more general way.
5760         
5761         * class.cs (CheckBase): Ditto.
5762
5763 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5764
5765         * decl.cs (caching_flags): New member for storing cached values
5766         as bit flags.
5767         (MemberCore.Flags): New enum where bit flags for caching_flags
5768         are defined.
5769         (MemberCore.cls_compliance): Moved to caching_flags.
5770         (DeclSpace.Created): Moved to caching_flags.
5771
5772         * class.cs: Use caching_flags instead of DeclSpace.Created
5773         
5774 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
5775
5776         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
5777         if we are only a derived class, not a nested class.
5778
5779         * typemanager.cs: Same as above, but do this at the MemberLookup
5780         level (used by field and methods, properties are handled in
5781         PropertyExpr).   Allow for the qualified access if we are a nested
5782         method. 
5783
5784 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
5785
5786         * class.cs: Refactoring.
5787         (IMethodData): New inteface; Holds links to parent members
5788         to avoid member duplication (reduced memory allocation).
5789         (Method): Implemented IMethodData interface.
5790         (PropertyBase): New inner classes for get/set methods.
5791         (PropertyBase.PropertyMethod): Implemented IMethodData interface
5792         (Event): New inner classes for add/remove methods.
5793         (Event.DelegateMethod): Implemented IMethodData interface.
5794
5795         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
5796         EmitContext (related to class.cs refactoring).
5797
5798 2004-04-21  Raja R Harinath  <rharinath@novell.com>
5799
5800         * delegate.cs (Delegate.VerifyApplicability): If the number of
5801         arguments are the same as the number of parameters, first try to
5802         verify applicability ignoring  any 'params' modifier on the last
5803         parameter.
5804         Fixes #56442.
5805
5806 2004-04-16  Raja R Harinath  <rharinath@novell.com>
5807
5808         * class.cs (TypeContainer.AddIndexer): Use
5809         'ExplicitInterfaceName' to determine if interface name was
5810         explicitly specified.  'InterfaceType' is not initialized at this time.
5811         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
5812         Indexers array is already in the required order.  Initialize
5813         'IndexerName' only if there are normal indexers.
5814         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
5815         (TypeContainer.Emit): Emit DefaultMember attribute only if
5816         IndexerName is initialized.
5817         Fixes #56300.
5818
5819 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
5820
5821         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
5822         Fixes #57007
5823
5824 2004-04-15  Raja R Harinath  <rharinath@novell.com>
5825
5826         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
5827         attributes.
5828         Fix for #56456.
5829
5830         * attribute.cs (Attribute.Resolve): Check for duplicate named
5831         attributes.
5832         Fix for #56463.
5833
5834 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
5835
5836         * iterators.cs (MarkYield): track whether we are in an exception,
5837         and generate code accordingly.  Use a temporary value to store the
5838         result for our state.
5839
5840         I had ignored a bit the interaction of try/catch with iterators
5841         since their behavior was not entirely obvious, but now it is
5842         possible to verify that our behavior is the same as MS .NET 2.0
5843
5844         Fixes 54814
5845
5846 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
5847
5848         * iterators.cs: Avoid creating temporaries if there is no work to
5849         do. 
5850
5851         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
5852         Enumerations, use TypeManager.EnumToUnderlying and call
5853         recursively. 
5854
5855         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
5856         bug #57013
5857
5858         (This.Emit): Use EmitContext.EmitThis to emit our
5859         instance variable.
5860
5861         (This.EmitAssign): Ditto.
5862
5863         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
5864         codepaths, we will move all the functionality into
5865         Mono.CSharp.This 
5866
5867         (FieldExpr.EmitAssign): Ditto.
5868
5869         This fixes several hidden bugs that I uncovered while doing a code
5870         review of this today.
5871
5872         * codegen.cs (EmitThis): reworked so the semantics are more clear
5873         and also support value types "this" instances.
5874
5875         * iterators.cs: Changed so that for iterators in value types, we
5876         do not pass the value type as a parameter.  
5877
5878         Initialization of the enumerator helpers is now done in the caller
5879         instead of passing the parameters to the constructors and having
5880         the constructor set the fields.
5881
5882         The fields have now `assembly' visibility instead of private.
5883
5884 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
5885
5886         * expression.cs (Argument.Resolve): Check if fields passed as ref
5887         or out are contained in a MarshalByRefObject.
5888
5889         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
5890         another compiler type.
5891
5892 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5893
5894         * class.cs (Indexer.Define): use the new name checking method.
5895         Also, return false on an error.
5896         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
5897         (is_identifier_[start/part]_character): make static.
5898
5899 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
5900
5901         * expression.cs (Binary.ResolveOperator): Do no append strings
5902         twice: since we can be invoked more than once (array evaluation)
5903         on the same concatenation, take care of this here.  Based on a fix
5904         from Ben (bug #56454)
5905
5906 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5907
5908         * codegen.cs: Fix another case where CS1548 must be reported (when 
5909         delay-sign isn't specified and no private is available #56564). Fix
5910         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
5911         error when MCS is used on the MS runtime and we need to delay-sign 
5912         (which seems unsupported by AssemblyBuilder - see #56621).
5913
5914 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
5915
5916         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
5917         (TypeManager.ComputeNamespaces): Faster implementation for
5918         Microsoft runtime.
5919
5920         * compiler.csproj: Updated AssemblyName to mcs.
5921
5922 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5923
5924         * rootcontext.cs: Add new types to the boot resolution.
5925
5926         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5927         MulticastDelegate is not allowed.
5928
5929         * typemanager.cs: Add new types to lookup: System.TypedReference
5930         and ArgIterator.
5931
5932         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5933         check for TypedReference or ArgIterator, they are not allowed. 
5934
5935         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5936         makes us properly catch 1510 in some conditions (see bug 56016 for
5937         details). 
5938
5939 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5940
5941         * CryptoConvert.cs: update from corlib version
5942         with endian fixes.
5943
5944 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5945
5946         * class.cs (Indexer.Define): Check indexername declaration
5947
5948 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5949
5950         * attribute.cs (IsClsCompliant): Fixed problem with handling
5951         all three states (compliant, not-compliant, undetected).
5952
5953 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5954
5955         * attribute.cs (Attribute): Location is now public.
5956         (Resolve): Store resolved arguments (pos_values) in attribute class.
5957         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5958         (GetClsCompliantAttributeValue): New method that gets
5959         CLSCompliantAttribute value.
5960         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5961         if exists else null.
5962         (AttributeTester): New class for CLS-Compliant verification routines.
5963
5964         * class.cs (Emit): Add CLS-Compliant verification.
5965         (Method.GetSignatureForError): Implemented.
5966         (Constructor.GetSignatureForError): Implemented
5967         (Constructor.HasCompliantArgs): Returns if constructor has
5968         CLS-Compliant arguments.
5969         (Constructor.Emit): Override.
5970         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5971         is needed to test only parameters.
5972         (FieldBase.GetSignatureForError): Implemented.
5973         (TypeContainer): New member for storing base interfaces.
5974         (TypeContainer.FindMembers): Search in base interfaces too.
5975
5976         * codegen.cs (GetClsComplianceAttribute): New method that gets
5977         assembly or module CLSCompliantAttribute value.
5978         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5979         for assembly.
5980         (ModuleClass.Emit): Add error 3012 test.
5981
5982         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5983
5984         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5985         state for all decl types.
5986         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5987         if CLS-Compliant tests are required.
5988         (IsClsCompliaceRequired): New method. Analyze whether code
5989         must be CLS-Compliant.
5990         (IsExposedFromAssembly): New method. Returns true when MemberCore
5991         is exposed from assembly.
5992         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5993         value or gets cached value.
5994         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5995         is explicitly marked with CLSCompliantAttribute.
5996         (IsIdentifierClsCompliant): New abstract method. This method is
5997         used to testing error 3005.
5998         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5999         for identifier and parameters CLS-Compliant testing.
6000         (VerifyClsCompliance): New method. The main virtual method for
6001         CLS-Compliant verifications.
6002         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6003         null. I don't know why is null (too many public members !).
6004         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6005         and get value of first CLSCompliantAttribute that found.
6006
6007         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6008         (VerifyClsCompliance): Override and add extra tests.
6009
6010         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6011         clscheck- disable CLS-Compliant verification event if assembly is has
6012         CLSCompliantAttribute(true).
6013
6014         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6015         ApllyAttribute is now called in emit section as in the other cases.
6016         Possible future Emit integration.
6017         (IsIdentifierClsCompliant): New override.
6018         (VerifyClsCompliance): New override.
6019         (GetEnumeratorName): Returns full enum name.
6020
6021         * parameter.cs (GetSignatureForError): Implemented.
6022
6023         * report.cs (WarningData): New struct for Warning message information.
6024         (LocationOfPreviousError): New method.
6025         (Warning): New method. Reports warning based on the warning table.
6026         (Error_T): New method. Reports error based on the error table.
6027
6028         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6029         verifications are done here.
6030
6031         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6032
6033         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6034         CLSCompliantAttribute.
6035         (all_imported_types): New member holds all imported types from other
6036         assemblies.
6037         (LoadAllImportedTypes): New method fills static table with exported types
6038         from all referenced assemblies.
6039         (Modules): New property returns all assembly modules.
6040
6041 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6042
6043         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6044         throwing a parser error.
6045
6046         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6047         which removes the hardcoded get_/set_ prefixes for properties, as
6048         IL allows for the properties to be named something else.  
6049
6050         Bug #56013
6051
6052         * expression.cs: Do not override operand before we know if it is
6053         non-null.  Fix 56207
6054
6055 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6056
6057         * typemanager.cs: support for pinned variables.
6058
6059 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6060
6061         * decl.cs, typemanager.cs: Avoid using an arraylist
6062         as a buffer if there is only one result set.
6063
6064 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6065
6066         * expression.cs: Make sure you cant call a static method
6067         with an instance expression, bug #56174.
6068
6069 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6070
6071         * class.cs (IsDuplicateImplementation): Improve error reporting to
6072         flag 663 (method only differs in parameter modifier).
6073
6074         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
6075         in preprocessor directives.
6076
6077         * location.cs (LookupFile): Allow for the empty path.
6078
6079         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
6080         better approach for some of that patch, but its failing with the
6081         CharSet enumeration.  For now try/catch will do.
6082
6083         * typemanager.cs: Do not crash if a struct does not have fields.
6084         Fixes 56150.
6085
6086 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6087
6088         * expression.cs: cs0213, cant fix a fixed expression.
6089         fixes 50231.
6090
6091 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6092
6093         * cs-parser.jay: detect invalid embeded statements gracefully.
6094         bug #51113.
6095
6096 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6097
6098         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
6099         As a regex:
6100         s/
6101         the invocation type may not be a subclass of the tye of the item/
6102         The type of the item must be a subclass of the invocation item.
6103         /g
6104
6105         Fixes bug #50820.
6106
6107 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6108
6109         * attribute.cs: Added methods to get a string and a bool from an
6110         attribute. Required to information from AssemblyKeyFileAttribute,
6111         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
6112         * codegen.cs: Modified AssemblyName creation to include support for
6113         strongnames. Catch additional exceptions to report them as CS1548.
6114         * compiler.csproj: Updated include CryptoConvert.cs.
6115         * compiler.csproj.user: Removed file - user specific configuration.
6116         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
6117         Mono.Security assembly. The original class is maintained and tested in
6118         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
6119         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
6120         like CSC 8.0 (C# v2) supports.
6121         * Makefile: Added CryptoConvert.cs to mcs sources.
6122         * rootcontext.cs: Added new options for strongnames.
6123
6124 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
6125
6126         * driver.cs: For --expect-error, report error code `2'
6127         if the program compiled with no errors, error code `1' if
6128         it compiled with an error other than the one expected.
6129
6130 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
6131
6132         * compiler.csproj: Updated for Visual Studio .NET 2003.
6133         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
6134         * compiler.sln: Updated for Visual Studio .NET 2003.
6135
6136 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
6137
6138         * expression.cs: Fix bug #47234. We basically need to apply the
6139         rule that we prefer the conversion of null to a reference type
6140         when faced with a conversion to 'object' (csc behaviour).
6141
6142 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6143
6144         * statement.cs: Shorter form for foreach, eliminates
6145         a local variable. r=Martin.
6146
6147 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6148
6149         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
6150         checks if we can use brtrue/brfalse to test for 0.
6151         * expression.cs: use the above in the test for using brtrue/brfalse.
6152         cleanup code a bit.
6153
6154 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6155
6156         * expression.cs: Rewrite string concat stuff. Benefits:
6157
6158         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
6159         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
6160         rather than a concat chain.
6161
6162         * typemanager.cs: Add lookups for more concat overloads.
6163
6164 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6165
6166         * expression.cs: Emit shorter il code for array init.
6167
6168         newarr
6169         dup
6170         // set 1
6171
6172         // set 2
6173
6174         newarr
6175         stloc.x
6176
6177         ldloc.x
6178         // set 1
6179
6180         ldloc.x
6181         // set 2
6182
6183 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
6184
6185         * statement.cs: Before, two switch blocks would be merged if the
6186         total size of the blocks (end_item - begin_item + 1) was less than
6187         two times the combined sizes of the blocks.
6188
6189         Now, it will only merge if after the merge at least half of the
6190         slots are filled.
6191
6192         fixes 55885.
6193
6194 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
6195
6196         * class.cs : csc build fix for GetMethods(). See bug #52503.
6197
6198 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
6199
6200         * expression.cs: Make sure fp comparisons work with NaN.
6201         This fixes bug #54303. Mig approved this patch a long
6202         time ago, but we were not able to test b/c the runtime
6203         had a related bug.
6204
6205 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
6206
6207         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
6208
6209 2004-03-19  Martin Baulig  <martin@ximian.com>
6210
6211         * class.cs (MemberCore.IsDuplicateImplementation): Report the
6212         error here and not in our caller.
6213
6214 2004-03-19  Martin Baulig  <martin@ximian.com>
6215
6216         * interface.cs: Completely killed this file.
6217         (Interface): We're now a TypeContainer and live in class.cs.
6218
6219         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
6220         argument; we're now also called for interfaces.
6221         (TypeContainer.DefineMembers): Allow this method being called
6222         multiple times.
6223         (TypeContainer.GetMethods): New public method; formerly known as
6224         Interface.GetMethod().  This is used by PendingImplementation.
6225         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
6226         it's now private and non-static.
6227         (Interface): Moved this here; it's now implemented similar to
6228         Class and Struct.
6229         (Method, Property, Event, Indexer): Added `bool is_interface'
6230         argument to their .ctor's.
6231         (MemberBase.IsInterface): New public field.
6232
6233         * cs-parser.jay: Create normal Method, Property, Event, Indexer
6234         instances instead of InterfaceMethod, InterfaceProperty, etc.
6235         (opt_interface_base): Removed; we now use `opt_class_base' instead.
6236         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
6237
6238 2004-03-19  Martin Baulig  <martin@ximian.com>
6239
6240         * class.cs (MethodCore.IsDuplicateImplementation): New private
6241         method which does the CS0111 checking.
6242         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
6243         Use IsDuplicateImplementation().
6244
6245 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
6246
6247         * decl.cs (FindMemberToOverride): New method to find the correct
6248         method or property to override in the base class.
6249         * class.cs
6250             - Make Method/Property use the above method to find the
6251               version in the base class.
6252             - Remove the InheritableMemberSignatureCompare as it is now
6253               dead code.
6254
6255         This patch makes large code bases much faster to compile, as it is
6256         O(n) rather than O(n^2) to do this validation.
6257
6258         Also, it fixes bug 52458 which is that nested classes are not
6259         taken into account when finding the base class member.
6260
6261         Reviewed/Approved by Martin.
6262
6263 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
6264
6265         * interface.cs: In all interface classes removed redundant
6266         member initialization.
6267
6268 2004-03-16  Martin Baulig  <martin@ximian.com>
6269
6270         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
6271
6272 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * decl.cs (DefineTypeAndParents): New helper method to define a
6275         type's containers before the type itself is defined;  This is a
6276         bug exposed by the recent changes to Windows.Forms when an
6277         implemented interface was defined inside a class that had not been
6278         built yet.   
6279
6280         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
6281
6282         (Check): Loop correctly to report errors modifiers
6283         (UNSAFE was not in the loop, since it was the same as TOP).
6284
6285         * interface.cs: Every interface member now takes a ModFlags,
6286         instead of a "is_new" bool, which we set on the base MemberCore. 
6287
6288         Every place where we called "UnsafeOk" in the interface, now we
6289         call the proper member (InterfaceMethod.UnsafeOK) instead to get
6290         the unsafe settings from the member declaration instead of the
6291         container interface. 
6292
6293         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
6294
6295         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6296         `set_indexer_name' to the pending bits (one per type).
6297
6298         We fixed a bug today that was picking the wrong method to
6299         override, since for properties the existing InterfaceMethod code
6300         basically ignored the method name.  Now we make sure that the
6301         method name is one of the valid indexer names.
6302
6303 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
6304  
6305         * support.cs (SeekableStreamReader): Keep track of stream byte
6306         positions and don't mix them with character offsets to the buffer.
6307
6308         Patch from Gustavo Giráldez
6309
6310 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
6311
6312         * interface.cs (InterfaceSetGetBase): Removed double member
6313         initialization, base class does it as well.
6314
6315 2004-03-13  Martin Baulig  <martin@ximian.com>
6316
6317         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
6318         when compiling corlib.
6319
6320 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
6321
6322         * convert.cs (ExplicitConversion): We were reporting an error on
6323         certain conversions (object_type source to a value type, when the
6324         expression was `null') before we had a chance to pass it through
6325         the user defined conversions.
6326
6327         * driver.cs: Replace / and \ in resource specifications to dots.
6328         Fixes 50752
6329
6330         * class.cs: Add check for duplicate operators.  Fixes 52477
6331
6332 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
6335         that are in the middle of the statements, not only at the end.
6336         Fixes #54987
6337
6338         * class.cs (TypeContainer.AddField): No longer set the
6339         `HaveStaticConstructor' flag, now we call it
6340         `UserDefineStaticConstructor' to diferentiate the slightly
6341         semantic difference.
6342
6343         The situation is that we were not adding BeforeFieldInit (from
6344         Modifiers.TypeAttr) to classes that could have it.
6345         BeforeFieldInit should be set to classes that have no static
6346         constructor. 
6347
6348         See:
6349
6350         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
6351
6352         And most importantly Zoltan's comment:
6353
6354         http://bugzilla.ximian.com/show_bug.cgi?id=44229
6355
6356         "I think beforefieldinit means 'it's ok to initialize the type sometime 
6357          before its static fields are used', i.e. initialization does not need
6358          to be triggered by the first access to the type. Setting this flag
6359          helps the JIT to compile better code, since it can run the static
6360          constructor at JIT time, and does not need to generate code to call it
6361          (possibly lots of times) at runtime. Unfortunately, mcs does not set
6362          this flag for lots of classes like String. 
6363          
6364          csc sets this flag if the type does not have an explicit static 
6365          constructor. The reasoning seems to be that if there are only static
6366          initalizers for a type, and no static constructor, then the programmer
6367          does not care when this initialization happens, so beforefieldinit
6368          can be used.
6369          
6370          This bug prevents the AOT compiler from being usable, since it 
6371          generates so many calls to mono_runtime_class_init that the AOT code
6372          is much slower than the JITted code. The JITted code is faster, 
6373          because it does not generate these calls if the vtable is type is
6374          already initialized, which is true in the majority of cases. But the
6375          AOT compiler can't do this."
6376
6377 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
6378
6379         * class.cs (MethodData.Emit): Refactor the code so symbolic
6380         information is generated for destructors;  For some reasons we
6381         were taking a code path that did not generate symbolic information
6382         before. 
6383
6384 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6385
6386         * class.cs: Create a Constructor.CheckBase method that
6387         takes care of all validation type code. The method
6388         contains some code that was moved from Define.
6389
6390         It also includes new code that checks for duplicate ctors.
6391         This fixes bug #55148.
6392
6393 2004-03-09  Joshua Tauberer <tauberer@for.net>
6394
6395         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
6396         a { ... }-style array creation invokes EmitStaticInitializers
6397         which is not good for reference-type arrays.  String, decimal
6398         and now null constants (NullCast) are not counted toward
6399         static initializers.
6400
6401 2004-03-05  Martin Baulig  <martin@ximian.com>
6402
6403         * location.cs (SourceFile.HasLineDirective): New public field;
6404         specifies whether the file contains or is referenced by a "#line"
6405         directive.
6406         (Location.DefineSymbolDocuments): Ignore source files which
6407         either contain or are referenced by a "#line" directive.        
6408
6409 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
6410
6411         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
6412         direct access to our parent, so check the method inline there.
6413
6414 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6415
6416         * expression.cs (Invocation.EmitCall): Miguel's last commit
6417         caused a regression. If you had:
6418
6419             T t = null;
6420             t.Foo ();
6421
6422         In Foo the implict this would be null.
6423
6424 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
6425
6426         * expression.cs (Invocation.EmitCall): If the method is not
6427         virtual, do not emit a CallVirt to it, use Call.
6428
6429         * typemanager.cs (GetFullNameSignature): Improve the method to
6430         cope with ".ctor" and replace it with the type name.
6431
6432         * class.cs (ConstructorInitializer.Resolve): Now the method takes
6433         as an argument the ConstructorBuilder where it is being defined,
6434         to catch the recursive constructor invocations.
6435
6436 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6437
6438         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6439         routines to check if a type is an enumerable/enumerator allow
6440         classes that implement the IEnumerable or IEnumerator interfaces.
6441
6442         * class.cs (Property, Operator): Implement IIteratorContainer, and
6443         implement SetYields.
6444
6445         (Property.Define): Do the block swapping for get_methods in the
6446         context of iterators.   We need to check if Properties also
6447         include indexers or not.
6448
6449         (Operator): Assign the Block before invoking the
6450         OperatorMethod.Define, so we can trigger the Iterator code
6451         replacement. 
6452
6453         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6454         Property and Operator classes are not created when we parse the
6455         declarator but until we have the block completed, so we use a
6456         singleton SimpleIteratorContainer.Simple to flag whether the
6457         SetYields has been invoked.
6458
6459         We propagate this setting then to the Property or the Operator to
6460         allow the `yield' to function.
6461
6462 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6463
6464         * codegen.cs: Implemented attribute support for modules.
6465         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6466         Assembly/Module functionality.
6467
6468         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6469         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6470         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6471
6472 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6473
6474         * interface.cs (FindMembers): The operation is performed on all base
6475         interfaces and not only on the first. It is required for future CLS Compliance patch.
6476
6477 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6478
6479         * statement.cs, codegen.cs:
6480         This patch deals with patterns such as:
6481
6482         public class List : IEnumerable {
6483
6484                 public MyEnumerator GetEnumerator () {
6485                         return new MyEnumerator(this);
6486                 }
6487
6488                 IEnumerator IEnumerable.GetEnumerator () {
6489                         ...
6490                 }
6491                 
6492                 public struct MyEnumerator : IEnumerator {
6493                         ...
6494                 }
6495         }
6496
6497         Before, there were a few things we did wrong:
6498         1) we would emit callvirt on a struct, which is illegal
6499         2) we emited ldarg when we needed to emit ldarga
6500         3) we would mistakenly call the interface methods on an enumerator
6501         type that derived from IEnumerator and was in another assembly. For example:
6502
6503         public class MyEnumerator : IEnumerator
6504
6505         Would have the interface methods called, even if there were public impls of the
6506         method. In a struct, this lead to invalid IL code.
6507
6508 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6509
6510         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6511           renamed to Emit.
6512
6513         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6514
6515 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6516
6517         * cs-parser.jay: Fix small regression: we were not testing V2
6518         compiler features correctly.
6519
6520         * interface.cs: If the emit context is null, then create one
6521
6522 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6523
6524         * decl.cs (GetSignatureForError): New virtual method to get full name
6525           for error messages.
6526
6527         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6528           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6529
6530         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6531           Duplicated members and code in these classes has been removed.
6532           Better encapsulation in these classes.
6533
6534 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6535
6536         * assign.cs (Assign.DoResolve): When dealing with compound
6537         assignments, there is a new rule in ECMA C# 2.4 (might have been
6538         there before, but it is documented here) that states that in:
6539
6540         a op= b;
6541
6542         If b is of type int, and the `op' is a shift-operator, then the
6543         above is evaluated as:
6544
6545         a = (int) a op b 
6546
6547         * expression.cs (Binary.ResolveOperator): Instead of testing for
6548         int/uint/long/ulong, try to implicitly convert to any of those
6549         types and use that in pointer arithmetic.
6550
6551         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6552         method to print information for from the type, not from the
6553         null-method we were given.
6554
6555 2004-02-01  Duncan Mak  <duncan@ximian.com>
6556
6557         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6558         parsing for cmd, fixes bug #53694.
6559
6560 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6561
6562         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6563         in the member name duplication tests. Property and operator name duplication
6564         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6565
6566 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6567
6568         * interface.cs (PopulateMethod): Fixed crash when interface method
6569         returns not existing type (error test cs0246-3.cs).
6570
6571 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6572
6573         * cs-parser.jay (interface_accessors): Re-write actions to also
6574         store attributes attached to get and set methods. Fix spelling
6575         while at it.
6576
6577         (inteface_property_declaration): Modify accordingly.
6578
6579         (InterfaceAccessorInfo): New helper class to store information to pass
6580         around between rules that use interface_accessors.
6581
6582         * interface.cs (Emit): Apply attributes on the get and set
6583         accessors of properties and indexers too.
6584
6585         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6586         right MethodBuilder when applying attributes to the get and set accessors.
6587
6588 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6589
6590         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6591
6592 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6593
6594         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6595
6596 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6597
6598         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6599         changes that treat `yield' specially when present before `break'
6600         or `return' tokens.
6601
6602         * cs-tokenizer.cs: yield is no longer a keyword.
6603
6604 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6605
6606         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6607         setting for default constructors.
6608         For default constructors are almost every time set wrong Modifier. The
6609         generated IL code has been alright. But inside mcs this values was
6610         wrong and this was reason why several of my CLS Compliance tests
6611         failed.
6612
6613 2004-01-22  Martin Baulig  <martin@ximian.com>
6614
6615         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6616         not a QualifiedIdentifier.  This is what `type_name_expression'
6617         was previously doing.
6618         (type_name_expression): Removed; the code is now in
6619         `namespace_or_type_name'.
6620         (qualified_identifier): Removed, use `namespace_or_type_name'
6621         instead.
6622         (QualifiedIdentifier): Removed this class.      
6623
6624 2004-01-22  Martin Baulig  <martin@ximian.com>
6625
6626         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6627         not a string as alias name.
6628
6629 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6630
6631         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6632         #52730 bug, and instead compute correctly the need to use a
6633         temporary variable when requesting an address based on the
6634         static/instace modified of the field and the constructor.
6635  
6636 2004-01-21  Martin Baulig  <martin@ximian.com>
6637
6638         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6639         class and namespace before looking up aliases.  Fixes #52517.
6640
6641 2004-01-21  Martin Baulig  <martin@ximian.com>
6642
6643         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6644         assinged in a 'try'; fixes exception4.cs.
6645
6646 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6647         * class.cs : Implemented parameter-less constructor for TypeContainer
6648
6649         * decl.cs: Attributes are now stored here. New property OptAttributes
6650
6651         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6652
6653         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6654
6655 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6656
6657         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6658           (CSharpSignature): New method for indexer and property signature.
6659
6660 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6661
6662         * pending.cs (IsVirtualFilter): Faster implementation.
6663
6664 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6665
6666         * typemanager.cs: Avoid inclusion of same assembly more than once.
6667
6668 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6669
6670         * cs-parser.jay: Fixed problem where the last assembly attribute
6671           has been applied also to following declaration (class, struct, etc.)
6672           
6673 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6674
6675         * class.cs: Added error CS0538, CS0539 reporting.
6676         Fixed crash on Microsoft runtime when field type is void.
6677
6678         * cs-parser.jay: Added error CS0537 reporting.
6679
6680         * pending.cs: Added error CS0535 reporting.
6681         Improved error report for errors CS0536, CS0534.
6682
6683 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6684
6685         Merge a few bits from the Anonymous Method MCS tree.
6686
6687         * statement.cs (ToplevelBlock): New class for toplevel methods,
6688         will hold anonymous methods, lifted variables.
6689
6690         * cs-parser.jay: Create toplevel blocks for delegates and for
6691         regular blocks of code. 
6692
6693 2004-01-20  Martin Baulig  <martin@ximian.com>
6694
6695         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6696         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6697         and `NeedExplicitReturn'; added `IsLastStatement'.
6698         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6699         have a `ReturnLabel' or we're not unreachable.
6700
6701         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6702         child's reachability; don't just override ours with it.  Fixes
6703         #58058 (lluis's example).
6704         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6705         InFinally(), InLoop(), InSwitch() and
6706         BreakCrossesTryCatchBoundary() methods.
6707
6708         * statement.cs (Return): Do all error checking in Resolve().
6709         Unless we are the last statement in a top-level block, always
6710         create a return label and jump to it.
6711         (Break, Continue): Do all error checking in Resolve(); also make
6712         sure we aren't leaving a `finally'.
6713         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6714         statement in a top-level block.
6715         (Block.Flags): Added `IsDestructor'.
6716         (Block.IsDestructor): New public property.
6717
6718 2004-01-20  Martin Baulig  <martin@ximian.com>
6719
6720         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6721
6722 2004-01-20  Martin Baulig  <martin@ximian.com>
6723
6724         * statement.cs (Statement.ResolveUnreachable): New public method.
6725         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6726         (Block.Resolve): Resolve unreachable statements.
6727
6728 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6729
6730         * expression.cs: We need to fix the case where we do
6731         not have a temp variable here.
6732
6733         * assign.cs: Only expression compound assignments need
6734         temporary variables.
6735
6736 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6737
6738         * flowanalysis.cs: Reduce memory allocation in a few ways:
6739           - A block with no variables should not allocate a bit
6740             vector for itself.
6741           - A method with no out parameters does not need any tracking
6742             for assignment of the parameters, so we need not allocate
6743             any data for it.
6744           - The arrays:
6745                 public readonly Type[] VariableTypes;
6746                 public readonly string[] VariableNames;
6747             Are redundant. The data is already stored in the variable
6748             map, so we need not allocate another array for it.
6749           - We need to add alot of checks for if (params | locals) == null
6750             due to the first two changes.
6751
6752 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6753
6754         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6755         implement IMemoryLocation, we store a copy on a local variable and
6756         take the address of it.  Patch from Benjamin Jemlich
6757
6758         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6759         to use a special "type_name_expression" rule which reduces the
6760         number of "QualifiedIdentifier" classes created, and instead
6761         directly creates MemberAccess expressions.
6762
6763 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6764
6765         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6766         that fixes #52853.  Null literal assignment to ValueType
6767
6768         * class.cs (MethodData.Emit): Instead of checking the name of the
6769         method to determine if its a destructor, create a new derived
6770         class from Method called Destructor, and test for that.  
6771
6772         * cs-parser.jay: Create a Destructor object instead of a Method.  
6773
6774         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6775
6776         Fixes: 52933
6777
6778 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6779
6780         * expression.cs (Binary.ResolveOperator): Perform an implicit
6781         conversion from MethodGroups to their delegate types on the
6782         Addition operation.
6783
6784         * delegate.cs: Introduce a new class DelegateCreation that is the
6785         base class for `NewDelegate' and `ImplicitDelegateCreation',
6786         factor some code in here.
6787
6788         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6789         conversion from MethodGroups to compatible delegate types. 
6790
6791         * ecore.cs (Expression.Resolve): Do not flag error 654
6792         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6793         we allow conversions from MethodGroups to delegate types now.
6794
6795         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6796         assignments in v2 either.
6797
6798 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6799
6800         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6801         static read-only fields in ctors.
6802
6803         Applied patch from Benjamin Jemlich 
6804
6805         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6806
6807 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6808
6809         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6810         here to return true, as they can be used like this:
6811
6812                 (XXX) int.MEMBER ()
6813
6814         Fixed 49836 and all the other dups
6815
6816 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6817
6818         * driver.cs: Implement /win32res and /win32icon.
6819
6820 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6821
6822         * cs-parser.jay: Add a rule to improve error handling for the
6823         common mistake of placing modifiers after the type.
6824
6825 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6826
6827         * cs-parser.jay (interface_event_declaration): Catch
6828         initialization of events on interfaces, and report cs0068
6829
6830         * cs-parser.jay (interface_event_declaration): Catch
6831         initialization of events. 
6832
6833         * ecore.cs: Better report missing constructors.
6834
6835         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6836         the error reporting done in the wrong place.  Fix.
6837
6838         * expression.cs (Binary.ResolveOperator): Catch the 
6839         operator + (E x, E y) error earlier, and later allow for implicit
6840         conversions in operator +/- (E e, U x) from U to the underlying
6841         type of E.
6842
6843         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6844         52596, if the container class is abstract, the default constructor
6845         is protected otherwise its public (before, we were always public).
6846
6847         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6848         fixed statement.
6849
6850         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6851         Jemlich that fixes bug #52597, MCS was generating invalid code for
6852         idisposable structs.   Thanks to Ben for following up with this
6853         bug as well.
6854
6855 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6856
6857         * driver.cs: Allow assemblies without code to be generated, fixes
6858         52230.
6859
6860 2004-01-07  Nick Drochak <ndrochak@gol.com>
6861
6862         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6863
6864 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6865
6866         * cs-parser.jay: Add rules to improve error reporting if fields or
6867         methods are declared at the namespace level (error 116)
6868
6869         * Add rules to catch event add/remove
6870
6871 2004-01-04  David Sheldon <dave-mono@earth.li>
6872
6873   * expression.cs: Added matching ")" to error message for 
6874   CS0077
6875
6876 2004-01-03 Todd Berman <tberman@gentoo.org>
6877
6878         * ecore.cs, attribute.cs:
6879         Applying fix from #52429.
6880
6881 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6882
6883         * ecore.cs, expression.cs, statement.cs:
6884         Total rewrite of how we handle branching. We
6885         now handle complex boolean expressions with fewer
6886         jumps. As well if (x == 0) no longer emits a ceq.
6887
6888         if (x is Foo) is much faster now, because we generate
6889         better code.
6890
6891         Overall, we get a pretty big improvement on our benchmark
6892         tests. The code we generate is smaller and more readable.
6893
6894         I did a full two-stage bootstrap. The patch was reviewed
6895         by Martin and Miguel.
6896
6897 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6898
6899         * cs-parser.jay: Make primary_expression not take a QI.
6900         we dont need this because the member_access rule covers
6901         us here. So we replace the rule with just IDENTIFIER.
6902
6903         This has two good effects. First, we remove a s/r conflict.
6904         Second, we allocate many fewer QualifiedIdentifier objects.
6905
6906 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6907
6908         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6909         set the correct information via SRE. This prevents
6910         hanging on the MS runtime. Fixes #29374.
6911
6912 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6913
6914         * convert.cs: correctly handle conversions to value types
6915         from Enum and ValueType as unboxing conversions.
6916
6917         Fixes bug #52569. Patch by Benjamin Jemlich.
6918
6919 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6920
6921         * expression.cs (BetterConversion): Prefer int -> uint
6922         over int -> ulong (csc's behaviour). This fixed bug #52046.
6923
6924 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6925
6926         * decl.cs (MemberCache.FindMembers): now returns a
6927         MemberInfo [].
6928
6929         * typemanager.cs: In general, go with with ^^.
6930         (CopyNewMethods): take an IList.
6931         (RealMemberLookup): Only allocate an arraylist
6932         if we copy from two sets of methods.
6933
6934         This change basically does two things:
6935         1) Fewer array lists allocated due to CopyNewMethods.
6936         2) the explicit cast in MemberList costed ALOT.
6937
6938 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6939
6940         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6941         a hashtable to avoid needless string allocations when an identifier is
6942         used more than once (the common case).
6943
6944 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6945
6946         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6947         is broken, it will not return anything. So, we
6948         have to use the information we have in mcs to
6949         do the task.
6950
6951         * typemanager.cs: Add a cache for GetInterfaces,
6952         since this will now be used more often (due to ^^)
6953
6954         (GetExplicitInterfaces) New method that gets the
6955         declared, not effective, interfaces on a type
6956         builder (eg, if you have interface IFoo, interface
6957         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6958         { IBar }.
6959
6960         This patch makes MCS able to bootstrap itself on
6961         Windows again.
6962
6963 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6964
6965         * expression.cs: Remove the Nop's that Miguel put
6966         in by mistake.
6967
6968 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6969
6970         * report.cs, codegen.cs: Give the real stack trace to
6971         the error when an exception is thrown.
6972
6973 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6974
6975         * decl.cs: only allocate hashtables for ifaces if 
6976         it is an iface!
6977
6978 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6979
6980         * expression.cs: fix the error from cs0121-2.cs
6981         (a parent interface has two child interfaces that
6982         have a function with the same name and 0 params
6983         and the function is called through the parent).
6984
6985 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6986
6987         * class.cs, rootcontext.cs, typmanager.cs: do not
6988         leak pointers.
6989
6990 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6991
6992         * codegen.cs: remove stack for the ec flow branching.
6993         It is already a linked list, so no need.
6994
6995 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6996
6997         * Makefile: Allow custom profiler here.
6998
6999 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7000
7001         * typemanager.cs (LookupType):
7002           - Use a static char [], because split takes
7003             a param array for args, so it was allocating
7004             every time.
7005           - Do not store true in a hashtable, it boxes.
7006
7007 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
7008
7009         * flowanalysis.cs: bytify common enums.
7010
7011 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7012
7013         * modifiers.cs: Add a new set of flags for the
7014         flags allowed on explicit interface impls.
7015         * cs-parser.jay: catch the use of modifiers in
7016         interfaces correctly.
7017         * class.cs: catch private void IFoo.Blah ().
7018
7019         All related to bug #50572.
7020
7021 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7022
7023         * decl.cs: Rewrite the consistant accessability checking.
7024         Accessability is not linear, it must be implemented in
7025         a tableish way. Fixes #49704.
7026
7027 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
7028
7029         * expression.cs: Handle negation in a checked context.
7030         We must use subtraction from zero. Fixes #38674.
7031
7032 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7033
7034         * class.cs: Ignore static void main in DLLs.
7035         * rootcontext.cs: Handle the target type here,
7036         since we are have to access it from class.cs
7037         * driver.cs: account for the above.
7038
7039 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7040
7041         * report.cs: Give line numbers and files if available.
7042
7043 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7044
7045         * driver.cs: Implement /addmodule.
7046
7047         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7048         ModuleBuilders.
7049
7050 2003-12-20  Martin Baulig  <martin@ximian.com>
7051
7052         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7053         (FieldBase.IsAssigned): Removed this field.
7054         (FieldBase.SetAssigned): New public method.
7055         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7056
7057 2003-12-20  Martin Baulig  <martin@ximian.com>
7058
7059         * expression.cs (LocalVariableReference.DoResolve): Don't set
7060         `vi.Used' if we're called from DoResolveLValue().
7061
7062         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7063         returns the usage vector it just merged into the current one -
7064         pass this one to UsageWarning().
7065         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7066         of the `EmitContext', don't call this recursively on our children.
7067
7068 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7069
7070         * driver.cs: Implement /target:module.
7071
7072 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
7073
7074         * support.cs (CharArrayHashtable): New helper class.
7075
7076         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
7077         char arrays, not strings, so we can avoid creating a string in
7078         consume_identifier if the identifier is a keyword.
7079
7080 2003-12-16  Martin Baulig  <martin@ximian.com>
7081
7082         * statement.cs (LocalInfo.Assigned): Removed this property.
7083         (LocalInfo.Flags): Removed `Assigned'.
7084         (LocalInfo.IsAssigned): New public method; takes the EmitContext
7085         and uses flow analysis.
7086         (Block.UsageWarning): Made this method private.
7087         (Block.Resolve): Call UsageWarning() if appropriate.
7088
7089         * expression.cs (LocalVariableReference.DoResolve): Always set
7090         LocalInfo.Used here.
7091
7092 2003-12-13  Martin Baulig  <martin@ximian.com>
7093
7094         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
7095         any value here; we're now using flow analysis to figure out
7096         whether a statement/block returns a value.
7097
7098 2003-12-13  Martin Baulig  <martin@ximian.com>
7099
7100         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
7101         working again.
7102         (FlowBranching.MergeFinally): Don't call
7103         `branching.CheckOutParameters()' here, this is called in
7104         MergeTopBlock().
7105         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
7106         when adding the `finally' vector.       
7107
7108 2003-12-13  Martin Baulig  <martin@ximian.com>
7109
7110         * flowanalysis.cs
7111         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
7112         actually work and also fix #48962.
7113
7114 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7115
7116         * decl.cs: Do not check System.Object for nested types,
7117         since we know it does not have any. Big bang for buck:
7118
7119         BEFORE:
7120            Run 1:   8.35 seconds
7121            Run 2:   8.32 seconds
7122            corlib:  17.99 seconds
7123         AFTER:
7124            Run 1:   8.17 seconds
7125            Run 2:   8.17 seconds
7126            corlib:  17.39 seconds
7127
7128 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7129
7130         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
7131         time we are returning 0 members, so we save alot here.
7132
7133 2003-12-11  Martin Baulig  <martin@ximian.com>
7134
7135         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
7136         `MergeChild()', also just take the `FlowBranching' as argument;
7137         call Merge() on it and return the result.
7138         (FlowBranching.Merge): We don't need to do anything if we just
7139         have one sibling.
7140
7141 2003-12-11  Martin Baulig  <martin@ximian.com>
7142
7143         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
7144         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
7145         Maurer for this idea.
7146
7147 2003-12-11  Martin Baulig  <martin@ximian.com>
7148
7149         * flowanalysis.cs (MergeResult): This class is now gone; we now
7150         use the `UsageVector' for this.  The reason for this is that if a
7151         branching just has one sibling, we don't need to "merge" them at
7152         all - that's the next step to do.
7153         (FlowBranching.Merge): We now return a `UsageVector' instead of a
7154         `MergeResult'.
7155
7156 2003-12-11  Martin Baulig  <martin@ximian.com>
7157
7158         Reworked flow analyis and made it more precise and bug-free.  The
7159         most important change is that we're now using a special `Reachability'
7160         class instead of having "magic" meanings of `FlowReturns'.  I'll
7161         do some more cleanups and optimizations and also add some more
7162         documentation this week.
7163
7164         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
7165         largely reworked this class.
7166         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
7167         the new `Reachability' class instead of having "magic" values here.
7168         (FlowBranching): We're now using an instance of `Reachability'
7169         instead of having separate `Returns', `Breaks' etc. fields.
7170
7171         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
7172         based on flow analysis; ignore the return value of block.Emit ().
7173
7174 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
7175
7176         * driver.cs typemanager.cs: Find the mono extensions to corlib even
7177         if they are private.
7178
7179 2003-12-09  Martin Baulig  <martin@ximian.com>
7180
7181         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
7182         call them directly on the UsageVector.
7183
7184 2003-12-09  Martin Baulig  <martin@ximian.com>
7185
7186         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
7187         Changed return type from `FlowReturns' to `Reachability'.
7188
7189 2003-12-09  Martin Baulig  <martin@ximian.com>
7190
7191         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
7192         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
7193         `Reachable' fields with a single `Reachability' one.
7194
7195 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7196
7197         * class.cs (FindMembers): Remove foreach's.
7198
7199         Bootstrap times:
7200
7201         BEFORE
7202                 Run 1:   8.74 seconds
7203                 Run 2:   8.71 seconds
7204
7205         AFTER
7206                 Run 1:   8.64 seconds
7207                 Run 2:   8.58 seconds
7208
7209
7210 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7211
7212         * cs-parser.jay:
7213         * gen-treedump.cs:
7214         * statement.cs:
7215         This patch does a few things:
7216                 1. EmptyStatement is now a singleton, so it is never reallocated.
7217                 2. All blah is EmptyStatement constructs have been changed to
7218                    blah == EmptyStatement.Value, which is much faster and valid
7219                    now that EmptyStatement is a singleton.
7220                 3. When resolving a block, rather than allocating a new array for
7221                    the non-empty statements, empty statements are replaced with
7222                    EmptyStatement.Value
7223                 4. Some recursive functions have been made non-recursive.
7224         Mainly the performance impact is from (3), however (1) and (2) are needed for
7225         this to work. (4) does not make a big difference in normal situations, however
7226         it makes the profile look saner.
7227
7228         Bootstrap times:
7229
7230         BEFORE
7231         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7232         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7233         Total memory allocated: 56397 KB
7234
7235         AFTER
7236         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
7237         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
7238         Total memory allocated: 55666 KB
7239
7240 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7241
7242         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
7243         than the hashtable in a hashtable version
7244
7245         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
7246         we always end up concating a string. This results in a huge perf
7247         loss, because many strings have to be tracked by the GC. In this
7248         patch, we first use a hashtable that works with two keys, so that
7249         the strings do not need to be concat'ed.
7250
7251         Bootstrap times:
7252         BEFORE
7253                 Run 1:   8.74 seconds
7254                 Run 2:   8.71 seconds
7255
7256         AFTER
7257                 Run 1:   8.65 seconds
7258                 Run 2:   8.56 seconds
7259
7260 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7261
7262         * Makefile: Add a new target `do-time' that does a quick and simple
7263         profile, leaving easy to parse output.
7264
7265 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7266
7267         * codegen.cs (Init): Create the dynamic assembly with 
7268         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7269
7270 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7271
7272         * support.cs: Make the PtrHashtable use only one
7273         instance of its comparer.
7274
7275 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7276
7277         * typemanager.cs: Fix lookup of GetNamespaces.
7278
7279 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7280
7281         * expression.cs: Removed redundant line.
7282
7283         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7284         ArrayLists, use for loops with bounds.  
7285
7286         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7287         arraylist.
7288
7289         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7290         arraylists, use for loop with bounds.
7291
7292         The above three changes give us a 0.071 second performance
7293         improvement out of 3.294 seconds down to 3.223.  On my machine
7294         the above changes reduced the memory usage by 1,387 KB during
7295         compiler bootstrap.
7296
7297         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7298         QualifiedIdentifiers.  Before we created a new string through
7299         concatenation, and mostly later on, the result would be
7300         manipulated by DecomposeQI through string manipulation.
7301
7302         This reduced the compiler memory usage for bootstrapping from
7303         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7304         compile times in 0.05 seconds.
7305
7306 2003-11-28  Dick Porter  <dick@ximian.com>
7307
7308         * support.cs: Do string compares with the Invariant culture.
7309
7310         * rootcontext.cs: 
7311         * gen-treedump.cs: 
7312         * expression.cs: 
7313         * driver.cs: 
7314         * decl.cs: 
7315         * codegen.cs: 
7316         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7317         the comparison is done with the Invariant culture.
7318
7319 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7320
7321         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7322         GetEnumerator method.
7323
7324         (ProbeCollectionType): Iterate starting at the most specific type
7325         upwards looking for a GetEnumerator
7326
7327         * expression.cs: Shift count can be up to 31 for int/uint and 63
7328         for long/ulong.
7329
7330 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7331
7332         * statement.cs (Block.LookupLabel): Also look for the label on the
7333         children blocks.  Use a hash table to keep track of visited
7334         nodes. 
7335
7336         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7337         we actually did transform the other operand, otherwise fall back
7338         to the common codepath that casts to long.
7339
7340         * cs-tokenizer.cs: Use the same code pattern as the int case.
7341         Maybe I should do the parsing myself, and avoid depending on the
7342         Parse routines to get this done.
7343
7344 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7345
7346         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7347         which fixes bug 51347.  This time test it.
7348
7349         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7350         attributes for example can not tell the difference between these.
7351         The difference was only a syntax feature of the language. 
7352
7353         * attribute.cs: Apply attributes to delegates.
7354
7355         * delegate.cs: Call the apply attributes method.
7356
7357 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7358
7359         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7360         comparing 0 vs Byte.MinValue, not the value
7361
7362         (ImplicitConversionRequired): When reporting a conversion error,
7363         use error 31 to print out the constant error instead of the
7364         simpler 29.
7365
7366         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7367         which fixes bug 51347.
7368
7369 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7370
7371         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7372         which fixes the -warnaserror command line option.
7373
7374 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7375
7376         * cfold.cs (DoNumericPromotions): During constant folding of
7377         additions on UIntConstant, special case intconstants with
7378         IntConstants like we do on the expression binary operator. 
7379
7380 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7381
7382         * convert.cs (ImplicitReferenceConversion): We were missing a case
7383         (System.Enum are not value types or class types, so we need to
7384         classify them separatedly).
7385
7386         * driver.cs: We do not support error 2007.
7387
7388 2003-11-12 Jackson Harper <jackson@ximian.com>
7389
7390         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7391         system directory. Also use the full file name so users can
7392         libraries names mscorlib-o-tron.dll in a non system dir.
7393
7394 2003-11-10  Martin Baulig  <martin@ximian.com>
7395
7396         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7397         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7398         calling `ResolveType()' on them, directly assign their `Type'.
7399
7400 2003-11-08  Martin Baulig  <martin@ximian.com>
7401
7402         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7403         return value and the `out parent' parameter.
7404         (TypeContainer.DefineType): Moved the CS0644 check into
7405         GetClassBases().  Don't pass the interface types to the
7406         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7407         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7408
7409         * ecore.cs (TypeExpr.IsAttribute): New property.
7410         (TypeExpr.GetInterfaces): New method.
7411
7412         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7413         TypeExpr instead of a Type.
7414         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7415         (Interface.DefineType): Don't pass the interface types to the
7416         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7417         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7418
7419         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7420         instead of a `Type[]'.
7421         (TypeManager.RegisterBuilder): Likewise.
7422         (TypeManager.AddUserInterface): Likewise.
7423         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7424         `Type[]' and also return a `TypeExpr[]'.
7425         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7426
7427 2003-11-08  Martin Baulig  <martin@ximian.com>
7428
7429         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7430         Expression.     
7431
7432 2003-11-08  Martin Baulig  <martin@ximian.com>
7433
7434         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7435         TypeManager.ResolveExpressionTypes().
7436
7437         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7438         instead of an Expression.
7439         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7440         (TypeExpression): New public class; formerly known as `TypeExpr'.
7441
7442         * expression.cs (ComposedCast): Derive from TypeExpr.
7443
7444         * typemanager.cs (TypeManager.system_*_expr): These are now
7445         TypExpr's instead of Expression's.
7446         (TypeManager.ResolveExpressionTypes): New public static function;
7447         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7448         of them.        
7449
7450 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7451
7452         * expression.cs (New.DoResolve): Do not dereference value that
7453         might be a null return.
7454
7455         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7456         sure that the constant value has the right type.  Fixes an
7457         unreported bug, similar to 50425.
7458
7459         * const.cs (Const.LookupConstantValue): Call
7460         ImplicitStandardConversionExists before doing a conversion to
7461         avoid havng the TypeManager.ChangeType do conversions.
7462
7463         Reduced the number of casts used
7464
7465         (Const.ChangeType): New routine to enable reuse of the constant
7466         type changing code from statement.
7467
7468         * typemanager.cs (ChangeType): Move common initialization to
7469         static global variables.
7470
7471         Fixes #50425.
7472
7473         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7474         every value type to go through, even if it was void.  Fix that. 
7475
7476         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7477         character of the define, and the is_identifier_part_character for
7478         the rest of the string.
7479
7480 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7481
7482         * expression.cs (UnaryMutator.EmitCode): When I updated
7483         LocalVariableReference.DoResolve, I overdid it, and dropped an
7484         optimization done on local variable references.
7485
7486 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7487
7488         * ecore.cs: Convert the return from Ldlen into an int.
7489
7490 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7491
7492         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7493         the accessibility, this is a special case for toplevel non-public
7494         classes (internal for instance).
7495
7496 2003-10-20  Nick Drochak <ndrochak@gol.com>
7497
7498         * ecore.cs: Fix typo and build.  Needed another right paren.
7499
7500 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7501
7502         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7503         `internal' case regular and protected, but not allowing protected
7504         to be evaluated later.  Bug 49840
7505
7506 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7507
7508         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7509         to kb.Nlast, and not the kb.nFirst to isolate the switch
7510         statement.
7511
7512         Extract the underlying type, so enumerations of long/ulong are
7513         treated like long/ulong.
7514
7515 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7516
7517         * expression.cs (New): Overload the meaning of RequestedType to
7518         track the possible creation of the NewDelegate type, since
7519         DoResolve is invoked more than once for new constructors on field
7520         initialization.
7521
7522         See bugs: #48800 and #37014
7523
7524         * cs-parser.jay (declare_local_constants): Take an arraylist
7525         instead of a single constant.
7526
7527         (local_constant_declaration): It should take a
7528         constant_declarators, not a constant_declarator.  Fixes 49487
7529
7530         * convert.cs: Fix error report.
7531
7532 2003-10-13 Jackson Harper <jackson@ximian.com>
7533
7534         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7535         bug #49611
7536
7537 2003-10-09  Martin Baulig  <martin@ximian.com>
7538
7539         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7540         to the .ctor.
7541         (MethodCore.DoDefineParameters): Removed the TypeContainer
7542         argument; use the DeclSpace which was passed to the .ctor instead.
7543         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7544         TypeContainer; we only need a DeclSpace here.
7545
7546 2003-10-09  Martin Baulig  <martin@ximian.com>
7547
7548         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7549         to the .ctor.
7550         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7551         EmitContext's .ctor.    
7552
7553 2003-10-09  Martin Baulig  <martin@ximian.com>
7554
7555         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7556         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7557         AsAccessible(), moved them as well.
7558
7559         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7560
7561 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7562
7563         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7564
7565 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7566
7567         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7568         generation for >=, as spotted by Paolo, bug 48679.  
7569         Patch from David Waite.
7570
7571         * cs-tokenizer.cs: Add handling for #pragma.
7572
7573         * cs-parser.jay: Allow for both yield and yield return in the
7574         syntax.  The anti-cobolization of C# fight will go on!
7575
7576         * class.cs (TypeBuilder.DefineType): Catch error condition here
7577         (Parent.DefineType erroring out and returning null).
7578
7579         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7580         coping with enumerations variables, we were mistakenly processing
7581         them as a regular value type instead of built-in types.  Fixes the
7582         bug #48063
7583
7584         * typemanager.cs (IsBuiltinOrEnum): New method.
7585
7586 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7587
7588         * cs-parser.jay: Upgrade: yield now needs the return clause.
7589
7590 2003-09-19  Martin Baulig  <martin@ximian.com>
7591
7592         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7593         `MemberCache parent' argument.  Normally, an interface doesn't
7594         have a parent type except System.Object, but we use this in gmcs
7595         for generic type parameters.
7596
7597 2003-09-18  Martin Baulig  <martin@ximian.com>
7598
7599         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7600         on `type.IsInterface'; don't check whether the type has a parent
7601         to determine whether it's an interface.
7602
7603 2003-09-15  Martin Baulig  <martin@ximian.com>
7604
7605         * class.cs (TypeContainer.DefineType): Added an error flag to
7606         avoid reporting duplicate CS0146's ("class definition is
7607         circular.").
7608
7609         * driver.cs (Driver.MainDriver): Abort if
7610         RootContext.ResolveTree() reported any errors.
7611
7612 2003-09-07  Martin Baulig  <martin@ximian.com>
7613
7614         * report.cs (Error, Warning): Added overloaded versions which take
7615         a `params object[] args' and call String.Format().
7616
7617 2003-09-07  Martin Baulig  <martin@ximian.com>
7618
7619         * decl.cs (DeclSpace..ctor): Don't call
7620         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7621         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7622         (DeclSpace.RecordDecl): New method.
7623
7624         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7625
7626 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7627
7628         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7629         value attributes to be applied to ParameterBuilders.
7630
7631         * class.cs (MethodCore.LabelParameters): Make static and more
7632         generic so that it can be used from other places - like interface
7633         methods, for instance.
7634
7635         * interface.cs (Interface.Emit): Call LabelParameters before
7636         emitting attributes on the InterfaceMethod.
7637
7638 2003-08-26  Martin Baulig  <martin@ximian.com>
7639
7640         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7641         resolving aliases; fixes #47927.
7642
7643 2003-08-26  Martin Baulig  <martin@ximian.com>
7644
7645         * statement.cs (Using.DoResolve): This is internally emitting a
7646         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7647         do not always return.  Fixes #47681.
7648
7649 2003-08-26  Martin Baulig  <martin@ximian.com>
7650
7651         * decl.cs (MemberCore): Moved WarningNotHiding(),
7652         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7653         into MemberBase.
7654         (AdditionResult): Make this nested in DeclSpace.
7655         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7656         argument; call NamespaceEntry.Define() unless we're nested in a
7657         class or struct.
7658
7659         * namespace.cs (Namespace.DefineName): New public function.  This
7660         is called from DeclSpace's .ctor to add 
7661         (Namespace.Lookup): Include DeclSpaces in the lookup.
7662
7663         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7664
7665         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7666
7667 2003-08-25  Martin Baulig  <martin@ximian.com>
7668
7669         * convert.cs (Convert.ExplicitReferenceConversion): When
7670         converting from an interface type to a class, unbox if the target
7671         type is a struct type.  Fixes #47822.
7672
7673 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7674
7675         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7676         #47854.
7677
7678 2003-08-22  Martin Baulig  <martin@ximian.com>
7679
7680         * class.cs (TypeManager.DefineType): When defining a nested type,
7681         call DefineType() on our parent; fixes #47801.
7682
7683 2003-08-22  Martin Baulig  <martin@ximian.com>
7684
7685         * class.cs (MethodData.Define): While checking if a method is an
7686         interface implementation, improve the test a bit more to fix #47654.
7687
7688 2003-08-22  Martin Baulig  <martin@ximian.com>
7689
7690         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7691         correctly; fixes #47722.
7692
7693 2003-08-22  Martin Baulig  <martin@ximian.com>
7694
7695         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7696         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7697
7698         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7699
7700 2003-08-22  Martin Baulig  <martin@ximian.com>
7701
7702         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7703         can only be assigned in static constructors.  Fixes #47161.
7704
7705 2003-08-22  Martin Baulig  <martin@ximian.com>
7706
7707         Rewrote and improved the flow analysis code.
7708
7709         * flowbranching.cs (FlowBranching): Make this class abstract.
7710         (FlowBranching.CreateBranching): New static function to create a
7711         new flow branching.
7712         (FlowBranchingBlock, FlowBranchingException): New classes.
7713         (FlowBranching.UsageVector.Type): New public readonly field.
7714         (FlowBranching.UsageVector.Breaks): Removed the setter.
7715         (FlowBranching.UsageVector.Returns): Removed the setter.
7716         (FlowBranching.UsageVector): Added Break(), Return(),
7717         NeverReachable() and Throw() methods to modify the reachability.
7718         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7719         done by FlowBranching.Merge().
7720         (FlowBranching.UsageVector.MergeChild): New method; merges the
7721         merge result into the current vector.
7722         (FlowBranching.Merge): New abstract method to merge a branching.
7723
7724 2003-08-12  Martin Baulig  <martin@ximian.com>
7725
7726         * expression.cs (Indirection.CacheTemporaries): Create the
7727         LocalTemporary with the pointer type, not its element type.
7728
7729 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
7730
7731         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7732         token was a keyword or not.
7733
7734         Add `error' options where an IDENTIFIER was expected;  Provide
7735         CheckToken and CheckIdentifierToken convenience error reporting
7736         functions. 
7737
7738         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7739
7740         * decl.cs: Rename `NamespaceEntry Namespace' public field into
7741         NameSpaceEntry NameSpaceEntry.
7742
7743         (LookupInterfaceOrClass): Avoid creating a full qualified name
7744         from namespace and name: avoid doing lookups when we know the
7745         namespace is non-existant.   Use new Tree.LookupByNamespace which
7746         looks up DeclSpaces based on their namespace, name pair.
7747
7748         * driver.cs: Provide a new `parser verbose' to display the
7749         exception thrown during parsing.  This is turned off by default
7750         now, so the output of a failure from mcs is more graceful.
7751
7752         * namespace.cs: Track all the namespaces defined in a hashtable
7753         for quick lookup.
7754
7755         (IsNamespace): New method
7756
7757 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
7758
7759         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
7760         we know that we need to concatenate (full typename can never be
7761         null). 
7762
7763         * class.cs: ditto.
7764
7765         * statement.cs: Use a bitfield;  Do not initialize to null things
7766         which are done by the constructor by default.
7767
7768         * cs-parser.jay: bug fix, parameter was 4, not 3.
7769
7770         * expression.cs: Just use the property;
7771
7772         * statement.cs: No need for GetVariableInfo method.
7773
7774 2003-08-08  Martin Baulig  <martin@ximian.com>
7775
7776         * flowanalysis.cs (FlowReturns): This is now nested in the
7777         `FlowBranching' class.
7778         (MyBitVector): Moved this here from statement.cs.
7779         (FlowBranching.SiblingType): New enum type.
7780         (FlowBranching.CreateSibling): Added `SiblingType' argument.
7781
7782 2003-08-07  Martin Baulig  <martin@ximian.com>
7783
7784         * flowanalysis.cs (FlowBranchingType): This is now nested in the
7785         `FlowBranching' class and called `BranchingType'.
7786
7787 2003-08-07  Martin Baulig  <martin@ximian.com>
7788
7789         * flowanalysis.cs: Moved all the control flow analysis code into
7790         its own file.
7791
7792 2003-08-07  Martin Baulig  <martin@ximian.com>
7793
7794         * assign.cs (Assign.DoResolve): `target' must either be an
7795         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
7796         #37319.
7797
7798 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
7799
7800         * expression.cs (BinaryMethod): This kind of expression is created by the
7801         Binary class if it determines that the operator has to be handled
7802         by a method.
7803
7804         (BinaryDelegate): This kind of expression is created if we are
7805         dealing with a + or - operator on delegates.
7806
7807         (Binary): remove method, argumetns, and DelegateOperator: when
7808         dealing with methods, 
7809
7810         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7811
7812         * statement.cs (Block): use bitfields for the three extra booleans
7813         we had in use.   Remove unused topblock parameter.
7814
7815         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7816
7817         * assign.cs: Drop extra unneeded tests.
7818
7819 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
7820
7821         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7822
7823         * statement.cs (Foreach): Use VariableStorage instead of
7824         LocalBuilders.   
7825
7826         * codegen.cs (VariableStorage): New class used by clients that
7827         require a variable stored: locals or fields for variables that
7828         need to live across yield.
7829
7830         Maybe provide a convenience api for EmitThis+EmitLoad?
7831
7832         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7833         these bad boys.
7834
7835 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
7836
7837         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7838         RemapParameterLValue): New methods that are used to turn a
7839         precomputed FieldInfo into an expression like this:
7840
7841                 instance.FieldInfo
7842
7843         The idea is to use this instead of making LocalVariableReference
7844         have more than one meaning.
7845
7846         * cs-parser.jay: Add error production to BASE.
7847
7848         * ecore.cs: Deal with TypeManager.GetField returning null, which
7849         is now a valid return value.
7850
7851         (FieldExprNoAddress): New expression for Fields whose address can
7852         not be taken.
7853
7854         * expression.cs (LocalVariableReference): During the resolve
7855         phases, create new expressions if we are in a remapping context.
7856         Remove code that dealt with remapping here.
7857
7858         (ParameterReference): same.
7859
7860         (ProxyInstance): New expression, like the `This' expression, but
7861         it is born fully resolved.  We know what we are doing, so remove
7862         the errors that are targeted to user-provided uses of `this'.
7863
7864         * statement.cs (Foreach): our variable is now stored as an
7865         Expression;  During resolution, follow the protocol, dont just
7866         assume it will return this.
7867
7868 2003-08-06  Martin Baulig  <martin@ximian.com>
7869
7870         * support.cs (SeekableStreamReader.cs): New public class.
7871
7872         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7873         SeekableStreamReader instead of the normal StreamReader.
7874
7875 2003-08-04  Martin Baulig  <martin@ximian.com>
7876
7877         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7878         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7879         deambiguate casts and delegate invocations.
7880         (parenthesized_expression): Use the new tokens to ensure this is
7881         not a cast of method invocation.
7882
7883         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7884         when reading a `)' and Deambiguate_CloseParens () was previously
7885         called.
7886
7887         * expression.cs (ParenthesizedExpression): New class.  This is
7888         just used for the CS0075 test.
7889         (Binary.DoResolve): Check for CS0075.   
7890
7891 2003-07-29  Ravi Pratap  <ravi@ximian.com>
7892
7893         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7894         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7895         reference comparison.
7896
7897         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7898         examine the ReturnType for equality - this is necessary in the
7899         cases of implicit and explicit operators whose signature also
7900         includes the return type.
7901
7902 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
7903
7904         * namespace.cs: Cache the result of the namespace computation,
7905         instead of computing it every time.
7906
7907 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
7908
7909         * decl.cs: Use a global arraylist that we reuse over invocations
7910         to avoid excesive memory consumption.  Reduces memory usage on an
7911         mcs compile by one meg (45 average).
7912
7913         * typemanager.cs (LookupTypeReflection): In .NET pointers are
7914         private, work around that.
7915
7916 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * literal.cs (IntLiteral): Define Zero and One static literals. 
7919
7920         * cs-parser.jay (integer_literal): use static literals to reduce
7921         memory usage for the most used literals (0, 1 and -1).  211kb
7922         reduced in memory usage.
7923
7924         Replace all calls to `new ArrayList' with `new
7925         ArrayList(4)' which is a good average number for most allocations,
7926         and also requires only 16 bytes of memory for its buffer by
7927         default. 
7928
7929         This reduced MCS memory usage in seven megabytes for the RSS after
7930         bootstrapping.
7931
7932 2003-07-28  Ravi Pratap  <ravi@ximian.com>
7933
7934         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7935         handle params methods the correct way by forming only one
7936         applicable set with params and normal methods in them. Earlier we
7937         were looking at params methods only if we found no normal methods
7938         which was not the correct thing to do.
7939
7940         (Invocation.BetterFunction): Take separate arguments indicating
7941         when candidate and the best method are params methods in their
7942         expanded form.
7943
7944         This fixes bugs #43367 and #46199.
7945
7946         * attribute.cs: Documentation updates.
7947
7948         (CheckAttribute): Rename to CheckAttributeTarget.
7949         (GetValidPlaces): Rename to GetValidTargets.
7950
7951         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7952         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7953
7954         Fixes bug #44468.
7955
7956 2003-07-28  Martin Baulig  <martin@ximian.com>
7957
7958         * class.cs (TypeContainer.DefineMembers): Use the base type's full
7959         name when looking up the base class of a nested class.  Fixes #46977.
7960
7961 2003-07-26  Martin Baulig  <martin@ximian.com>
7962
7963         * expression.cs (Indexers.Indexer): New nested struct; contains
7964         getter, setter and the indexer's type.
7965         (Indexers.Properties): This is now an ArrayList of
7966         Indexers.Indexer's.
7967         (IndexerAccess.DoResolveLValue): Correctly set the type if the
7968         indexer doesn't have any getters.
7969
7970         * assign.cs (Assign.DoResolve): Also do the implicit conversions
7971         for embedded property and indexer assignments.
7972
7973 2003-07-26  Martin Baulig  <martin@ximian.com>
7974
7975         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
7976         preprocessor directive is not the first non-whitespace character
7977         on a line.
7978
7979 2003-07-26  Martin Baulig  <martin@ximian.com>
7980
7981         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
7982         namespace parsing, follow the spec more closely.
7983
7984         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
7985         NamespaceEntry.Lookup().
7986
7987 2003-07-25  Martin Baulig  <martin@ximian.com>
7988
7989         * MethodCore.cs (OverridesSomething): New public field; it's set
7990         from TypeContainer.DefineMembers if this method overrides
7991         something (which doesn't need to be a method).  Fix #39462.
7992
7993 2003-07-25  Ravi Pratap  <ravi@ximian.com>
7994
7995         * typemanager.cs (GetMembers): Ensure that the list of members is
7996         reversed. This keeps things in sync.
7997
7998         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
7999         find an AttributeUsage attribute.
8000
8001         * expression.cs (Invocation.OverloadResolve): Perform the check
8002         which disallows Invoke to be directly called on a Delegate.
8003
8004         (Error_InvokeOnDelegate): Report error cs1533.
8005
8006 2003-07-25  Martin Baulig  <martin@ximian.com>
8007
8008         * expression.cs (Indexers.GetIndexersForType): Only look in the
8009         interface hierarchy if the requested type is already an
8010         interface.  Fixes #46788 while keeping #46502 fixed.
8011
8012 2003-07-25  Martin Baulig  <martin@ximian.com>
8013
8014         * class.cs (TypeContainer.DefineMembers): Check whether all
8015         readonly fields have been assigned and report warning CS0649 if
8016         not.
8017
8018         * statement.cs (LocalInfo.IsFixed): Always return true if this is
8019         a valuetype.
8020
8021 2003-07-24  Ravi Pratap  <ravi@ximian.com>
8022
8023         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
8024         returned from GetMethods to make things consistent with the
8025         assumptions MCS makes about ordering of methods.
8026
8027         This should comprehensively fix bug #45127 and it does :-)
8028
8029         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
8030         ordering is actually reverse.
8031
8032         * Clean up some debug messages I left lying around.
8033
8034         * interface.cs (Populate*): Get rid of code which emits attributes
8035         since the stage in which we emit attributes is the 'Emit' stage,
8036         not the define stage.
8037
8038         (Emit): Move attribute emission for interface members here.
8039
8040 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8041
8042         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8043         closely: we eliminate methods in base types when we have an
8044         applicable method in a top-level type.
8045
8046         Please see section 14.5.5.1 for an exact description of what goes
8047         on. 
8048
8049         This fixes bug #45127 and a host of other related to corlib compilation.
8050
8051         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8052         array is the method corresponding to the top-level type (this is
8053         because of the changes made to icall.c) so we change this
8054         accordingly.
8055
8056         (MethodGroupExpr.Name): This too.
8057
8058         * typemanager.cs (GetElementType): New method which does the right
8059         thing when compiling corlib. 
8060
8061         * everywhere: Make use of the above in the relevant places.
8062
8063 2003-07-22  Martin Baulig  <martin@ximian.com>
8064
8065         * cs-parser.jay (invocation_expression): Moved
8066         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8067         `cast_expression', but create a InvocationOrCast which later
8068         resolves to either an Invocation or a Cast.
8069
8070         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8071         method; call this before EmitStatement() to make sure that this
8072         expression can be used as a statement.
8073
8074         * expression.cs (InvocationOrCast): New class; resolves to either
8075         an Invocation or a Cast.
8076
8077         * statement.cs (StatementExpression): Call ResolveStatement() on
8078         the ExpressionStatement before emitting it.
8079
8080 2003-07-21  Martin Baulig  <martin@ximian.com>
8081
8082         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8083         `ref' and `out' attributes match; fixes #46220.
8084         (MemberAccess.ResolveMemberAccess): You can't reference a type
8085         through an expression; fixes #33180.
8086         (Indexers.GetIndexersForType): Don't return the indexers from
8087         interfaces the class implements; fixes #46502.
8088
8089 2003-07-21  Martin Baulig  <martin@ximian.com>
8090
8091         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8092         CS0661 checks; fixes bug #30442.
8093
8094 2003-07-21  Martin Baulig  <martin@ximian.com>
8095
8096         * decl.cs (AdditionResult): Added `Error'.
8097
8098         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8099
8100         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
8101         makes cs0031.cs actually work.
8102
8103 2003-07-20  Martin Baulig  <martin@ximian.com>
8104
8105         * namespace.cs: Fixed that bug which caused a crash when compiling
8106         the debugger's GUI.
8107
8108 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8109
8110         * typemanager.cs (LookupTypeReflection): Never expose types which
8111         are NotPublic, NestedPrivate, NestedAssembly, or
8112         NestedFamANDAssem.  We used to return these, and later do a check
8113         that would report a meaningful error, but the problem is that we
8114         would not get the real match, if there was a name override.
8115
8116 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8117
8118         * namespace.cs (Namespace, Name): Do not compute the namespace
8119         name dynamically, compute it in the constructor.  This reduced
8120         memory usage by 1697 KB.
8121
8122         * driver.cs: Use --pause to pause at the end.
8123
8124 2003-07-17  Peter Williams  <peter@newton.cx>
8125
8126         * Makefile: Change the name of the test target so that it doesn't
8127         conflict with the recursive test target.
8128
8129 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8130
8131         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8132         AddressOf): Do not use EmitThis, that was wrong, use the actual
8133         this pointer.
8134
8135 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8136
8137         * class.cs (MethodData.Define): While checking if a method is an
8138         interface implementation, improve the test: If we are not public
8139         (use new test here: use the computed MethodAttributes directly,
8140         instead of the parsed modifier flags) check if the `implementing'
8141         method comes from an interface or not.
8142
8143         * pending.cs (VerifyPendingMethods): Slightly better error
8144         message.
8145
8146         * makefile: add test target that does the mcs bootstrap.
8147
8148 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8149
8150         * interface.cs (Define): Do nothing here since there are no
8151         members to populate etc. Move the attribute emission out of here
8152         since this was just totally the wrong place to put it. Attribute
8153         application happens during the 'Emit' phase, not in the 'Define'
8154         phase.
8155
8156         (Emit): Add this method and move the attribute emission here
8157
8158         * rootcontext.cs (EmitCode): Call the Emit method on interface
8159         types too.
8160
8161 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8162
8163         * expression.cs (OverloadResolve): Report error only if Location
8164         is not 'Null' which means that there was a probe going on.
8165
8166 2003-07-14  Martin Baulig  <martin@ximian.com>
8167
8168         * expression.cs (ConditionalLogicalOperator): New public class to
8169         implement user defined conditional logical operators.
8170         This is section 14.11.2 in the spec and bug #40505.
8171
8172 2003-07-14  Martin Baulig  <martin@ximian.com>
8173
8174         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8175
8176 2003-07-14  Martin Baulig  <martin@ximian.com>
8177
8178         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8179
8180         * ecore.cs (IVariable.VerifyFixed): New interface method.
8181
8182         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8183         operator, check whether the variable is actually fixed.  Fixes bug
8184         #36055.  Set a variable definitely assigned when taking its
8185         address as required by the spec.
8186
8187         * statement.cs (LocalInfo.IsFixed): New field.
8188         (LocalInfo.MakePinned): Set `IsFixed' to true.
8189
8190 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8191
8192         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8193         for .ctors, ensure that we only ask for members declared in the
8194         attribute type (BindingFlags.DeclaredOnly).
8195
8196         Fixes bug #43632.
8197
8198         * expression.cs (Error_WrongNumArguments): Report error 1501
8199         correctly the way CSC does.
8200
8201 2003-07-13  Martin Baulig  <martin@ximian.com>
8202
8203         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8204         lookup on the fully qualified name, to make things like "X.X" work
8205         where "X.X" is a fully qualified type name, but we also have a
8206         namespace "X" in the using list.  Fixes #41975.
8207
8208 2003-07-13  Martin Baulig  <martin@ximian.com>
8209
8210         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8211         function. If we're a CompoundAssign, we need to create an embedded
8212         CompoundAssign, not an embedded Assign.
8213         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8214         Fixes #45854.
8215
8216 2003-07-13  Martin Baulig  <martin@ximian.com>
8217
8218         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8219         work to fix bug #46088.
8220
8221 2003-07-13  Ravi Pratap <ravi@ximian.com>
8222
8223         * class.cs (Operator.Emit): Do not emit attributes here - it is
8224         taken care of by the Method class that we delegate too. This takes
8225         care of bug #45876.
8226
8227 2003-07-10  Martin Baulig  <martin@ximian.com>
8228
8229         * expression.cs (TypeOfVoid): New class.
8230         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8231
8232 2003-07-10  Martin Baulig  <martin@ximian.com>
8233
8234         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8235         bug #35957.
8236
8237 2003-07-10  Martin Baulig  <martin@ximian.com>
8238
8239         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8240         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8241
8242         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8243
8244         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8245
8246 2003-07-10  Martin Baulig  <martin@ximian.com>
8247
8248         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8249         of decimal.  Fixes #42850.
8250
8251         NOTE: I also fixed the created byte blob, but this doesn't work on
8252         the MS runtime and csc never produces any byte blobs for decimal
8253         arrays.
8254
8255 2003-07-10  Martin Baulig  <martin@ximian.com>
8256
8257         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8258         structs; fixes #32068.
8259         (Block.AddChildVariableNames): Fixed #44302.
8260
8261 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8262
8263         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8264
8265 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8266
8267         * attribute.cs: And this test is onger needed.
8268
8269 2003-07-08  Martin Baulig  <martin@ximian.com>
8270
8271         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8272         inaccessible types.  Fixes #36313.
8273
8274         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8275
8276         * namespace.cs (NamespaceEntry): Create implicit entries for all
8277         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8278         implicit entries for N1.N2 and N1.
8279
8280 2003-07-08  Martin Baulig  <martin@ximian.com>
8281
8282         Rewrote the handling of namespaces to fix a lot of the issues
8283         wrt. `using' aliases etc.
8284
8285         * namespace.cs (Namespace): Splitted this class into a
8286         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8287
8288         * typemanager.cs (TypeManager.IsNamespace): Removed.
8289         (TypeManager.ComputeNamespaces): Only compute namespaces from
8290         loaded assemblies here, not the namespaces from the assembly we're
8291         currently compiling.
8292
8293 2003-07-08  Martin Baulig  <martin@ximian.com>
8294
8295         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8296
8297 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8298
8299         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8300         already fixed it.  
8301
8302         I thought about the memory savings here, but LookupTypeReflection
8303         is used under already very constrained scenarios.  Compiling
8304         corlib or mcs only exposes one hit, so it would not really reduce
8305         any memory consumption.
8306
8307 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8308
8309         * typemanager.cs: fixes bug #45889 by only adding public types from
8310         other assemblies to the list of known types.
8311
8312 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8313
8314         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8315         on the type we resolved.
8316
8317 2003-07-05  Martin Baulig  <martin@ximian.com>
8318
8319         * pending.cs (PendingImplementation.ParentImplements): Don't
8320         create the proxy if the parent is abstract.
8321
8322         * class.cs (TypeContainer.DefineIndexers): Process explicit
8323         interface implementations first.  Fixes #37714.
8324
8325 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8326
8327         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8328         defined recursively;  but since we modify the input parameters
8329         (left is set to `this' temporarily), we reset this value if the
8330         left_is_explicit is false, which gives the original semantics to
8331         the code.  
8332
8333         * literal.cs (NullPointer): new class used to represent a null
8334         literal in a pointer context.
8335
8336         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8337         type is a pointer, use a NullPointer object instead of a
8338         NullLiteral.   Closes 43687
8339
8340         (ExplicitConversion): Convert pointer values using
8341         the conv opcode to the proper type.
8342
8343         * ecore.cs (New): change ValueTypeVariable property into a method,
8344         that returns whether the valuetype is suitable for being used.
8345
8346         * expression.cs (Binary.DoNumericPromotions): Only return if we
8347         the int constant was a valid uint, and we can return both left and
8348         right as uints.  If not, we continue processing, to trigger the
8349         type conversion.  This fixes 39018.
8350
8351         * statement.cs (Block.EmitMeta): During constant resolution, set
8352         the CurrentBlock property on the emitcontext, so that we resolve
8353         constants propertly.
8354
8355 2003-07-02  Martin Baulig  <martin@ximian.com>
8356
8357         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8358         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8359
8360         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8361         than emitting it here.
8362
8363         * statement.cs: Fixed some more flow analysis bugs.
8364
8365 2003-07-02  Martin Baulig  <martin@ximian.com>
8366
8367         * class.cs (MethodData.Define): When implementing interface
8368         methods, set Final unless we're Virtual.
8369
8370         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8371         check work for interface methods.
8372
8373 2003-07-01  Martin Baulig  <martin@ximian.com>
8374
8375         * ecore.cs (EmitContext.This): Replaced this property with a
8376         GetThis() method which takes a Location argument.  This ensures
8377         that we get the correct error location for a CS0188.
8378
8379 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8380
8381         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8382         ImplicitStandardConversion.
8383
8384         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8385
8386 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8387
8388         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8389         optimization.
8390
8391 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8392
8393         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8394         constructors.
8395
8396         (MethodData.Define): Turn off initlocals for unsafe methods.
8397
8398 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8399
8400         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8401         complete;  Fixes #37521.
8402
8403         * delegate.cs: Use Modifiers.TypeAttr to compute the
8404         TypeAttributes, instead of rolling our own.  This makes the flags
8405         correct for the delegates.
8406
8407 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8408
8409         * class.cs (Constructor.Define): Set the private flag for static
8410         constructors as well.
8411
8412         * cs-parser.jay (statement_expression): Set the return value to
8413         null, to avoid a crash when we catch an error.
8414
8415 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8416
8417         * cs-parser.jay: Applied patch from Jackson that adds support for
8418         extern and unsafe modifiers to destructor declarations.
8419
8420         * expression.cs: Report error 21 if the user is trying to index a
8421         System.Array.
8422
8423         * driver.cs: Add an error message, suggested by the bug report.
8424
8425         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8426         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8427
8428 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8429
8430         * namespace.cs: Add some information to reduce FAQs.
8431
8432 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8433
8434         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8435         underlying enumeration types.  Fixes #43915.
8436
8437         * expression.cs: Treat ushort/short as legal values to be used in
8438         bitwise operations.
8439
8440 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8441
8442         * delegate.cs: transfer custom attributes for paramenters from
8443         the delegate declaration to Invoke and BeginInvoke.
8444
8445 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8446
8447         * attribute.cs: handle custom marshalers and emit marshal info
8448         for fields, too.
8449
8450 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8451
8452         * makefile.gnu: Added anonymous.cs to the compiler sources.
8453
8454 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8455
8456         * iterators.cs: Change the name of the proxy class to include two
8457         underscores.
8458
8459         * cs-parser.jay: Update grammar to include anonymous methods.
8460
8461         * anonymous.cs: new file.
8462
8463 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8464
8465         * class.cs (Field.Define): Add missing test for pointers and
8466         safety. 
8467
8468 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8469
8470         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8471         we use the stobj opcode.
8472
8473         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8474         since it wasn't the correct fix. 
8475
8476         It still is puzzling that we are required to use stobj for IntPtr
8477         which seems to be a ValueType.
8478
8479 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8480
8481         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8482         during regular simple name resolution.   Now, the trick is that
8483         instead of returning for processing the simplename, we do a
8484         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8485         contextual lookup type).   If a match is found, return that, if
8486         not, return for further composition.
8487
8488         This fixes long-standing 30485.
8489
8490         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8491         using the address to initialize an object, do an Stobj instead of
8492         using the regular Stelem.
8493
8494         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8495         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8496         Because if we are a BaseIndexerAccess that value will be true.
8497         Fixes 43643.
8498
8499         * statement.cs (GotoCase.Resolve): Return after reporting an
8500         error, do not attempt to continue. 
8501
8502         * expression.cs (PointerArithmetic.Emit): If our operand is a
8503         long, convert our constants to match the operand before
8504         multiplying.  Convert to I type before adding.   Fixes 43670.
8505
8506 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8507
8508         * enum.cs (ImplicitConversionExists) : Rename to
8509         ImplicitEnumConversionExists to remove ambiguity. 
8510
8511         * ecore.cs (NullCast): New type of cast expression class which
8512         basically is very similar to EmptyCast with the difference being
8513         it still is a constant since it is used only to cast a null to
8514         something else
8515         (eg. (string) null)
8516
8517         * convert.cs (ImplicitReferenceConversion): When casting a null
8518         literal, we return a NullCast.
8519
8520         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8521         should be around anymore.
8522
8523         The renaming (reported was slightly wrong). Corrections:
8524
8525         ConvertImplicitStandard -> ImplicitConversionStandard
8526         ConvertExplicitStandard -> ExplicitConversionStandard
8527
8528         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8529         before passing them in !
8530
8531         * convert.cs (ImplicitConversionStandard): When comparing for
8532         equal expr and target types, ensure that expr is not a
8533         NullLiteral.
8534
8535         In general, we must not be checking (expr_type ==
8536         target_type) in the top level conversion methods
8537         (ImplicitConversion, ExplicitConversion etc). This checking is
8538         done in the methods that they delegate to.
8539
8540 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8541
8542         * convert.cs: Move Error_CannotConvertType,
8543         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8544         ImplicitNumericConversion, ImplicitConversionExists,
8545         ImplicitUserConversionExists, StandardConversionExists,
8546         FindMostEncompassedType, FindMostSpecificSource,
8547         FindMostSpecificTarget, ImplicitUserConversion,
8548         ExplicitUserConversion, GetConversionOperators,
8549         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8550         TryImplicitIntConversion, Error_CannotConvertImplicit,
8551         ConvertImplicitRequired, ConvertNumericExplicit,
8552         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8553         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8554         its own file.
8555
8556         Perform the following renames:
8557
8558         StandardConversionExists -> ImplicitStandardConversionExists
8559         ConvertImplicit -> ImplicitConversion
8560         ConvertImplicitStandard -> ImplicitStandardConversion
8561         TryImplicitIntConversion -> ImplicitIntConversion
8562         ConvertImplicitRequired -> ImplicitConversionRequired
8563         ConvertNumericExplicit -> ExplicitNumericConversion
8564         ConvertReferenceExplicit -> ExplicitReferenceConversion
8565         ConvertExplicit -> ExplicitConversion
8566         ConvertExplicitStandard -> ExplicitStandardConversion
8567
8568 2003-05-19  Martin Baulig  <martin@ximian.com>
8569
8570         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8571         (TypeInfo): Added support for structs having structs as fields.
8572
8573         * ecore.cs (FieldExpr): Implement IVariable.
8574         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8575         VariableInfo for the field.
8576
8577 2003-05-18  Martin Baulig  <martin@ximian.com>
8578
8579         * expression.cs (This.DoResolve): Report a CS0027 if we're
8580         emitting a field initializer.
8581
8582 2003-05-18  Martin Baulig  <martin@ximian.com>
8583
8584         * expression.cs (This.ResolveBase): New public function.
8585         (This.DoResolve): Check for CS0188.
8586
8587         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8588         This.Resolve().
8589
8590         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8591         `instance_expression' to null if we don't have any non-static
8592         methods.
8593
8594 2003-05-18  Martin Baulig  <martin@ximian.com>
8595
8596         Reworked the way how local variables and parameters are handled by
8597         the flow analysis code.
8598
8599         * statement.cs (TypeInfo, VariableMap): New public classes.
8600         (VariableInfo): New public class.  This is now responsible for
8601         checking whether a variable has been assigned.  It is used for
8602         parameters and local variables.
8603         (Block.EmitMeta): Take the InternalParameters as argument; compute
8604         the layout of the flow vectors here.
8605         (Block.LocalMap, Block.ParameterMap): New public properties.
8606         (FlowBranching): The .ctor doesn't get the InternalParameters
8607         anymore since Block.EmitMeta() now computes the layout of the flow
8608         vector.
8609         (MyStructInfo): This class is now known as `StructInfo' and nested
8610         in `TypeInfo'; we don't access this directly anymore.
8611
8612         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8613         property and removed IsAssigned(), IsFieldAssigned(),
8614         SetAssigned() and SetFieldAssigned(); we now call them on the
8615         VariableInfo so we don't need to duplicate this code everywhere.
8616
8617         * expression.cs (ParameterReference): Added `Block block' argument
8618         to the .ctor.
8619         (LocalVariableReference, ParameterReference, This): The new
8620         VariableInfo class is now responsible for all the definite
8621         assignment stuff.
8622
8623         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8624         IsParameterAssigned, SetParameterAssigned): Removed.
8625
8626 2003-05-18  Martin Baulig  <martin@ximian.com>
8627
8628         * typemanager.cs (InitCoreTypes): Try calling
8629         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8630         the 3-args-version.  Corlib now also needs our `void_type'.
8631         (GetMethod): Added overloaded version which takes an optional
8632         `bool report_errors' to allow lookups of optional methods.
8633
8634 2003-05-12  Martin Baulig  <martin@ximian.com>
8635
8636         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8637         only used for locals and not for parameters.
8638
8639 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8640
8641         * support.cs (InternalParameters.ParameterType): Return the
8642         ExternalType of the parameter.
8643
8644         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8645         they were unused.
8646
8647 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8648
8649         * class.cs (MethodData.Define): Do not set the `newslot' on
8650         interface members, if they are also flagged as "override".
8651
8652         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8653         better code for ++i and i++.  This only works for static fields
8654         and local variables.
8655
8656         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8657         want to pull the DeclSpace out of the builder_to_declspace instead
8658         of the TypeBuilder (like in TypeContainer.FindMembers).
8659
8660         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8661         instead of LookupTypeContainer.  Fixes the crash on .NET for
8662         looking up interface members.
8663
8664         * const.cs: Create our own emit context during the Definition
8665         stage, so that constants are evaluated in the proper context, when
8666         a recursive definition happens.
8667
8668 2003-05-11  Martin Baulig  <martin@ximian.com>
8669
8670         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8671         new block for a switch section.
8672         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8673         the adding/lookup in the switch block.  Fixes #39828.
8674
8675 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8676
8677         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8678         functionality: I needed to convert the data after I had performed
8679         the add/sub operation into the operands type size.
8680
8681         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8682         pass the type for the box operation, otherwise the resulting
8683         object would have been of type object.
8684
8685         (BoxedCast): Add constructor to specify the type to box as.
8686
8687 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8688
8689         * iterators.cs: I was reusing the `count' variable inadvertently,
8690         take steps to not allow this to happen.
8691
8692 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8695         by creating an array at the point where the params starts and
8696         putting all those arguments there, then adjusting the size of the
8697         array.
8698
8699 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
8700
8701         * expression.cs (New.AddressOf): Implement interface
8702         IMemoryLocation.  This is used when the `new' operator is used in
8703         the context of an invocation to a method on a value type.
8704
8705         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8706         example. 
8707
8708         * namespace.cs: Also check the using aliases here.
8709
8710         * driver.cs: Move the test for using validity after the types have
8711         been entered, so we do a single pass that also includes the using
8712         aliases. 
8713
8714         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8715         in the regular case.   CreateSiblingForFinally is doing extra
8716         error checking.
8717
8718         * attribute.cs (GetAttributeArgumentExpression): Store the result
8719         on an out value, and use the return value to indicate failure
8720         instead of using null (which is a valid return for Constant.GetValue).
8721
8722         * statement.cs: Perform the analysis flow for the increment
8723         portion after the statement, because this will be the real flow of
8724         execution.  Fixes #42385
8725
8726         * codegen.cs (EmitContext.EmitArgument,
8727         EmitContext.EmitStoreArgument): New helper functions when the
8728         RemapToProxy flag is set.
8729
8730         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8731         function.
8732
8733         Add support for remapping parameters. 
8734
8735         * iterators.cs: Propagate parameter values;  Store parameter
8736         values in the proxy classes.
8737
8738 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
8739
8740         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
8741         need a proxy reference;  I do not know what I was thinking
8742
8743         * cs-parser.jay (constructor_initializer): catch another error,
8744         and display nice message.
8745
8746         (field_declaration): catch void field declaration
8747         to flag a better error. 
8748
8749         * class.cs (MemberBase.CheckBase): Report an error instead of a
8750         warning if a new protected member is declared in a struct. 
8751         (Field.Define): catch the error of readonly/volatile.
8752
8753         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8754
8755         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
8756         volatile variable is taken
8757
8758 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
8759
8760         * statement.cs (Fixed.Resolve): Report an error if we are not in
8761         an unsafe context.
8762
8763 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
8764
8765         * typemanager.cs: reuse the code that handles type clashes for
8766         delegates and enumerations.
8767
8768         * class.cs (Report28): Always report.
8769
8770         * expression.cs (EncodeAsAttribute): Allow nulls here.
8771
8772 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
8773
8774         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8775         the functionality for testing whether an expression is valid for
8776         an attribute here.  Also handle the case of arrays of elements
8777         being stored. 
8778
8779         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8780         encoding a linear array into an array of objects that are suitable
8781         to be passed to an CustomAttributeBuilder.
8782
8783         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8784
8785         * ecore.cs: (FieldExpr): Handle field remapping here.
8786
8787         * iteratators.cs: Pass the instance variable (if the method is an
8788         instance method) to the constructors, so we can access the field
8789         variables on the class.
8790
8791         TODO: Test this with structs.  I think the THIS variable on
8792         structs might have to be a pointer, and not a refenrece
8793
8794 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
8795
8796         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8797         local variables to fields in a proxy class.
8798
8799         * iterators.cs (PopulateProxy): Rename our internal fields to
8800         <XXX>.  
8801         Create a <THIS> field if we are an instance method, so we can
8802         reference our parent container variables.
8803         (MapVariable): Called back from the EmitContext code to enter a
8804         new variable to field mapping into the proxy class (we just create
8805         a FieldBuilder).
8806
8807         * expression.cs
8808         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8809         for using the remapped locals to fields.
8810
8811         I placed the code here, because that gives the same semantics to
8812         local variables, and only changes the Emit code.
8813
8814         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8815         statements inside iterators.
8816         (VariableInfo): Add a FieldBuilder for the cases when we are
8817         remapping local variables to fields in a proxy class
8818
8819         * ecore.cs (SimpleNameResolve): Avoid testing two times for
8820         current_block != null.
8821
8822         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8823         not cope with strings, as it has been moved to the
8824         TableSwitchEmit.  Fixed bug in switch generation.
8825
8826         * expression.cs (New.DoResolve): Provide more context for the user
8827         when reporting an error.
8828
8829         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8830         pointers. 
8831
8832         * expression.cs (MemberAccess.DoResolve): When we get a type back,
8833         check the permissions for it.  Note than in a type-resolution
8834         context the check was already present in DeclSpace.ResolveType,
8835         but was missing from the MemberAccess.
8836
8837         (ArrayCreation.CheckIndices): warn if the user has
8838         more nested levels of expressions, but there are no more
8839         dimensions specified.  Avoids crash on bug 41906.
8840
8841 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
8842
8843         * statement.cs (Block): replace Implicit bool, for a generic
8844         flags.   
8845         New flag: `Unchecked'.  This is used during the EmitMeta phase
8846         (which is out-of-line with the regular Resolve/Emit process for a
8847         statement, as this is done ahead of time, but still gets a chance
8848         to call constant resolve).
8849
8850         (Block.Flags): new enum for adding a new flag.
8851
8852         (Block.EmitMeta): track the state of unchecked.
8853
8854         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8855         to enable constant resolution to work there as well.
8856
8857 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
8858
8859         * typemanager.cs (ienumerable_type): Also look up
8860         System.Collections.IEnumerable. 
8861
8862 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
8863
8864         TODO: Test more than one conditional per method.
8865
8866         * class.cs (Indexer.Define): Report the location where the user is
8867         referencing the unsupported feature.
8868
8869         (MethodData): Overload the use of `conditionals' to
8870         minimize the creation of needless ArrayLists.   This saves roughly
8871         212kb on my machine.
8872
8873         (Method): Implement the new IIteratorContainer interface.
8874         (Method.SetYields): Implement the method by setting the ModFlags
8875         to contain METHOD_YIELDS.
8876
8877         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8878         which just got set to null.
8879
8880         * iterators.cs: New file.
8881
8882         (Yield, YieldBreak): New statements.
8883
8884         * statement.cs (Return.Resolve): Flag an error if we are used in
8885         an iterator method.
8886
8887         * codegen.cs (InIterator): New flag set if the code is being
8888         compiled in an iterator method.
8889
8890         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
8891         internal modifier, and we just use it to avoid adding extra
8892         fields, as this is seldom used.  
8893
8894         * cs-parser.jay: Add yield_statement (yield and yield break).
8895
8896         * driver.cs: New flag -v2 to turn on version 2 features. 
8897
8898         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8899         hashtable when v2 is enabled.
8900
8901 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
8902
8903         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8904         there is already a namespace defined with this name.
8905
8906         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8907         people upgraded their corlibs.
8908
8909         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8910         always use fully qualified types, no need to use the compiler
8911         front end.
8912
8913         (TypeManager.IsNamespace): Use binarysearch.
8914
8915         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8916         AddDelegate): I did not quite use the new IsValid API properly: I
8917         have to pass the short-name and the fullname.  I was passing only
8918         the basename instead of the fullname sometimes. 
8919
8920         (TypeContainer.DefineType): call NamespaceClash.
8921
8922         * interface.cs (Interface.DefineType): use NamespaceClash before
8923         defining the type.
8924
8925         * delegate.cs (Delegate.DefineType): use NamespaceClash before
8926         defining the type.
8927
8928         * enum.cs: (Enum.DefineType): use NamespaceClash before
8929         defining the type.
8930
8931         * typemanager.cs (: 3-line patch that gives us some tasty 11%
8932         speed increase.  First, use the negative_hits cache when we get a
8933         negative.  Second, add the type with its full original name
8934         instead of the new . and + encoded name (reflection uses + to
8935         separate type from a nested type).  Use LookupTypeReflection
8936         directly which bypasses the type->name hashtable (that we already
8937         know does not contain the type.
8938
8939         * decl.cs (DeclSpace.ResolveTypeExpr): track the
8940         location/container type. 
8941
8942         * driver.cs: When passing utf8, use directly the UTF8Encoding.
8943
8944 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
8945
8946         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8947
8948         * delegate.cs (NewDelegate.Resolve): Test whether an instance
8949         method is being referenced in the method group from a static
8950         context, and report error 120 if so.
8951
8952         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8953         Error118. 
8954
8955         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8956         is created, we create the A namespace).
8957
8958         * cs-parser.jay: A namespace also introduces a DeclarationFound.
8959         Fixes #41591
8960
8961 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
8962
8963         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
8964         invocation to ModuleBuilder.GetType with the same values will
8965         return a new type instance, so we need to cache its return
8966         values. 
8967
8968         * expression.cs (Binary.ResolveOperator): Only allow the compare
8969         operators on enums if they are of the same type.
8970
8971         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
8972         types of ValueType on their own case.  Before we were giving them
8973         the same treatment as objects.
8974
8975         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
8976         fullname.  Short name is used to compare against container name.
8977         Fullname is used to check against defined namespace names.
8978
8979         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
8980         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
8981
8982         (Method.CheckBase): Call parent.
8983         (MemberBase.CheckBase): Check for protected members on sealed
8984         classes.
8985         (PropertyBase.CheckBase): Call parent.
8986         (Field.Define): Call parent.
8987
8988         * report.cs: Negative error codes are now mapped to 8000 - code,
8989         so that the display is render more nicely.
8990
8991         * typemanager.cs: Do not use try/catch, instead report a regular
8992         error. 
8993
8994         (GetPointerType, GetReferenceType): These methods provide
8995         mechanisms to obtain the T* and T& from a T.  We had the code
8996         previously scattered around the code base, and it also used
8997         TypeManager.LookupType that would go through plenty of caches.
8998         This one goes directly to the type source.
8999
9000         In some places we did the Type.GetType followed by
9001         ModuleBuilder.GetType, but not in others, so this unifies the
9002         processing as well.
9003
9004         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9005         statements now that we have namespace information.
9006
9007         * typemanager.cs (IsNamespace): New method, returns whether the
9008         string presented is a namespace or not.
9009
9010         (ComputeNamespaces): New public entry point, computes the list of
9011         available namespaces, using the GetNamespaces API call in Mono, or
9012         the slower version in MS.NET.   
9013
9014         Now before we start the semantic analysis phase, we have a
9015         complete list of namespaces including everything that the user has
9016         provided.
9017
9018         Deleted old code to cache namespaces in .nsc files.
9019
9020 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9021
9022         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9023         class/struct location definition Location for the implicit
9024         constructor location.
9025
9026         (Operator.Define): Use the location of the operator for the
9027         implicit Method definition.
9028
9029         (Constructor.Emit): use the constructor location for the implicit
9030         base initializer constructor.
9031
9032         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9033         and the Expression class now contains two new methods:
9034
9035         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9036         isolate type lookup from the rest of the resolution process.
9037
9038         Since we use Expressions to hold type definitions due to the way
9039         we parse the input we have historically overloaded Resolve to
9040         perform the Type lookups if a special flag is passed.  Now this is
9041         eliminated and two methods take their place. 
9042
9043         The differences in the two methods between xStep and xTerminal is
9044         that xStep is involved in our current lookup system that uses
9045         SimpleNames to compose a name, while xTerminal is used just to
9046         catch the case where the simplename lookup failed.
9047
9048 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9049
9050         * expression.cs (ResolveMemberAccess): Remove redundant code.
9051         TypeExpr expressions are always born fully resolved.
9052
9053         * interface.cs (PopulateMethod): Do not lookup the types twice.
9054         We were doing it once during SemanticAnalysis and once during
9055         PopulateMethod.
9056
9057         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9058         in local variable type definitions, were being returned as a
9059         SimpleName (we decomposed everything into a string), that is
9060         because primary_expression was being used instead of a type in the
9061         grammar (reduce/reduce conflicts).
9062
9063         The part that was wrong is that we converted the expression into a
9064         string (an oversimplification in one hand, compounded with primary
9065         expressions doing string concatenation).
9066
9067         So things like:
9068
9069         A.B.C [] x;
9070
9071         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9072         using clauses from working on this particular context.  And a type
9073         was being matched directly against "A.B.C[]".
9074
9075         We now use the correct approach, and allow for ComposedCast to be
9076         part of the unary expression.  So the "A.B.C []" become a composed
9077         cast of "A.B.C" (as a nested group of MemberAccess with a
9078         SimpleName at the end) plus the rank composition "[]". 
9079
9080         Also fixes 35567
9081
9082 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9083
9084         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9085         for the access level checking.
9086
9087         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9088         `TypeContainer container', because I kept getting confused when I
9089         was debugging this code.
9090
9091         * expression.cs (Indexers): Instead of tracking getters/setters,
9092         we now track them in parallel.  We create one arraylist less, but
9093         most importantly it is possible now for the LValue code to find a
9094         matching get for a set.
9095
9096         (IndexerAccess.DoResolveLValue): Update the code.
9097         GetIndexersForType has been modified already to extract all the
9098         indexers from a type.  The code assumed it did not.
9099
9100         Also make the code set the correct return type for the indexer.
9101         This was fixed a long time ago for properties, but was missing for
9102         indexers.  It used to be void_type.
9103
9104         (Binary.Emit): Test first for doubles instead of
9105         floats, as they are more common.
9106
9107         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9108         when dealing with floats and the <=, >= operators.  This fixes bug
9109         #39314 
9110
9111         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9112         to load the array value by emitting a load on the foreach variable
9113         type.  This was incorrect.  
9114
9115         We now emit the code to load an element using the the array
9116         variable type, and then we emit the conversion operator.
9117
9118         Fixed #40176
9119
9120 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9121
9122         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9123
9124 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9125
9126         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9127         test for protection before we test for signatures. 
9128
9129         (MethodSignature.ToString): implement.
9130
9131         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9132         to the case where we reduced into a LongConstant.
9133
9134         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9135         depend on whether the information is acurrate, because the
9136         Microsoft runtime will always claim that the array type is public,
9137         regardless of the real state.
9138
9139         If the type is a pointer, another problem happens: the type is
9140         reported as non-public in Microsoft.  
9141
9142         In both cases we have to call CheckAccessLevel recursively with
9143         the underlying type as the argument to be tested.
9144
9145 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9146
9147         * assign.cs (Assign.Emit): If we are dealing with a compound
9148         assignment expression, we should use the code path that stores the
9149         intermediate result in a temporary value.  This fixes #40903.
9150
9151         *expression.cs (Indirection.ToString): Provide ToString method for
9152         debugging. 
9153
9154 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9155
9156         * class.cs: Null out fields holding references to Block objects so
9157         they can be garbage collected.
9158
9159         * expression.cs (OverloadResolve): Remove unused local.
9160
9161 2003-04-07  Martin Baulig  <martin@ximian.com>
9162
9163         * codegen.cs (EmitContext.CurrentFile): New public field.
9164         (EmitContext.Mark): Use the CurrentFile to check whether the
9165         location is in the correct file.
9166         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9167
9168 2003-04-07  Martin Baulig  <martin@ximian.com>
9169
9170         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9171
9172         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9173         location.  [FIXME: The location argument which gets passed to this
9174         method is sometimes wrong!]
9175
9176 2003-04-07  Nick Drochak <ndrochak@gol.com>
9177
9178         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9179
9180 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9181
9182         * expression.cs (Indirection.EmitAssign): We were using the
9183         temporary, but returning immediately instead of continuing the
9184         EmitAssing flow.
9185
9186 2003-04-06  Martin Baulig  <martin@ximian.com>
9187
9188         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9189         if it's a nested child, but also deriving from the outer class.
9190         See test 190.cs.
9191
9192         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9193         nested child, but also deriving from the outer class.  See
9194         test-190.cs.
9195         (FilterWithClosure): We may access private members of the outer
9196         class if we're a nested child and deriving from the outer class.
9197         (RealMemberLookup): Only set `closure_private_ok' if the
9198         `original_bf' contained BindingFlags.NonPublic.
9199
9200 2003-04-05  Martin Baulig  <martin@ximian.com>
9201
9202         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
9203
9204 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * class.cs (Event.Define): Do not allow abstract events to have
9207         initializers. 
9208
9209 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9210
9211         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9212         block in event declarations.
9213
9214         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9215         value type, get its address.
9216
9217         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9218         leaving a class on the stack instead of a boolean value (int
9219         0/1).  Change the code so we compare against null, and then the
9220         result against zero.
9221
9222         * class.cs (TypeContainer.GetClassBases): We were checking for the
9223         parent class being sealed too late.
9224
9225         * expression.cs (Binary.Emit): For <= and >= when dealing with
9226         floating point values, use cgt.un and clt.un instead of cgt and
9227         clt alone.
9228
9229 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9230
9231         * statement.cs: Apply the same optimization as MS: skip the 
9232         GetEnumerator returning an IEnumerator, and use the one returning a 
9233         CharEnumerator instead. This allows us to avoid the try-finally block 
9234         and the boxing.
9235
9236 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9237
9238         * cs-parser.jay: Attributes cannot be applied to
9239                          namespaces. Fixes #40473
9240
9241 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9242
9243         * class.cs:
9244         (Add*): check if the name is valid using the full name for constants,
9245         fields, properties and events.
9246
9247 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9248
9249         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9250         char constants to be part of the enumeration.
9251
9252         * expression.cs (Conditional.DoResolve): Add support for operator
9253         true. Implements the missing functionality from 14.12
9254
9255         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9256         operator true/false as required by the spec.
9257
9258         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9259         implicit conversion to boolean.
9260
9261         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9262         also one where the type implements `operator true'. 
9263
9264         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9265         get an expression that will invoke operator true based on an
9266         expression.  
9267
9268         (GetConversionOperators): Removed the hack that called op_True
9269         here.  
9270
9271         (Expression.ResolveBoolean): Move this from Statement.
9272
9273 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9274
9275         * ecore.cs (FieldExpr): do not allow initialization of initonly
9276         fields on derived classes
9277
9278 2003-03-13  Martin Baulig  <martin@ximian.com>
9279
9280         * statement.cs (Block.Emit): Call ig.BeginScope() and
9281         ig.EndScope() when compiling with debugging info; call
9282         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9283
9284 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9285
9286         * expression.cs (Indexers): Do not construct immediately, allow
9287         for new members to be appended as we go.  Fixes 38143
9288
9289 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9290
9291         * expression.cs: save/restore context when resolving an unchecked
9292         expression.
9293
9294 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9295
9296         * cfold.cs: Catch division by zero in modulus operator during
9297         constant folding.
9298
9299 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9300
9301         * interface.cs (Interface.DefineMembers): Avoid defining members
9302         twice. 
9303
9304 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9305
9306         * driver.cs: handle the +/- options for -noconfig
9307
9308         * statement.cs (Unckeched.Resolve): Also track the state of
9309         unchecked in the Resolve phase.
9310
9311 2003-02-27  Martin Baulig  <martin@ximian.com>
9312
9313         * ecore.cs (Expression.MemberLookup): Don't create a
9314         MethodGroupExpr for something which is not a method.  Fixes #38291.
9315
9316 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9317
9318         * class.cs (MemberBase.CheckParameters): Also check that the type
9319         is unmanaged if it is a pointer.
9320
9321         * expression.cs (SizeOf.Resolve): Add location information.
9322
9323         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9324         a managed type is declared.
9325
9326         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9327         parameter modifiers as well.  Fixes bug 38606
9328
9329         * class.cs: Very sad.  Am backing out the speed up changes
9330         introduced by the ArrayList -> Array in the TypeContainer, as they
9331         were not actually that much faster, and introduced a bug (no error
9332         reports on duplicated methods).
9333
9334         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9335         source first, this will guarantee that we have a valid expression
9336         before calling in lower levels functions that will require a
9337         resolved object.  Then use this original_source in the
9338         target.ResolveLValue instead of the original source that was
9339         passed to us.
9340
9341         Another change.  Use target.Resolve instead of LValueResolve.
9342         Although we are resolving for LValues, we will let the Assign code
9343         take care of that (it will be called again from Resolve).  This
9344         basically allows code like this:
9345
9346         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9347         class Y { void A (X x) { x [0] += o; }
9348
9349         The problem was that the indexer was trying to resolve for
9350         set_Item (idx, object o) and never finding one.  The real set_Item
9351         was set_Item (idx, X).  By delaying the process we get the right
9352         semantics. 
9353
9354         Fixes bug 36505
9355
9356 2003-02-23  Martin Baulig  <martin@ximian.com>
9357
9358         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9359         while calling DoEmit ().
9360
9361         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9362         source files; if you use the #line directive inside a method, the
9363         compiler stops emitting line numbers for the debugger until it
9364         reaches the end of the method or another #line directive which
9365         restores the original file.
9366
9367 2003-02-23  Martin Baulig  <martin@ximian.com>
9368
9369         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9370
9371 2003-02-23  Martin Baulig  <martin@ximian.com>
9372
9373         * statement.cs (Block.AddChildVariableNames): We need to call this
9374         recursively, not just for our immediate children.
9375
9376 2003-02-23  Martin Baulig  <martin@ximian.com>
9377
9378         * class.cs (Event.Define): Always make the field private, like csc does.
9379
9380         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9381         actually work, fixes bug #37521.
9382
9383 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9384
9385         * delegate.cs: When creating the various temporary "Parameters"
9386         classes, make sure that we call the ComputeAndDefineParameterTypes
9387         on those new parameters (just like we do with the formal ones), to
9388         allow them to be resolved in the context of the DeclSpace.
9389
9390         This fixes the bug that Dick observed in Bugzilla #38530.
9391
9392 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9393
9394         * expression.cs (ResolveMemberAccess): When resolving a constant,
9395         do not attempt to pull a constant if the value was not able to
9396         generate a valid constant.
9397
9398         * const.cs (LookupConstantValue): Do not report more errors than required.
9399
9400 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9401
9402         * expression.cs: fixes bug #38328.
9403
9404 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9405
9406         * class.cs: Changed all the various members that can be part of a
9407         class from being an ArrayList to be an Array of the right type.
9408         During the DefineType type_list, interface_list, delegate_list and
9409         enum_list are turned into types, interfaces, delegates and enums
9410         arrays.  
9411
9412         And during the member population, indexer_list, event_list,
9413         constant_list, field_list, instance_constructor_list, method_list,
9414         operator_list and property_list are turned into their real arrays.
9415
9416         Although we could probably perform this operation earlier, for
9417         good error reporting we need to keep the lists and remove the
9418         lists for longer than required.
9419
9420         This optimization was triggered by Paolo profiling the compiler
9421         speed on the output of `gen-sample-program.pl' perl script. 
9422
9423         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9424         not crash in methods like MemberLookupFailed that use this field.  
9425
9426         This problem arises when the compiler fails to resolve a type
9427         during interface type definition for example.
9428
9429 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9430
9431         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9432         inherit from System.Object, so we have to stop at null, not only
9433         when reaching System.Object.
9434
9435 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9436
9437         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9438         DeclaredOnly because the parent indexer might have had a different
9439         name, but did not loop until the top of the hierarchy was reached.
9440
9441         The problem this one fixes is 35492: when a class implemented an
9442         indexer from an interface, we were getting the interface method
9443         (which was abstract) and we were flagging an error (can not invoke
9444         abstract method).
9445
9446         This also keeps bug 33089 functioning, and test-148 functioning.
9447
9448         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9449         out if a method is special is to see if it is declared in a
9450         property or event, or whether it is one of the predefined operator
9451         names.   This should fix correctly #36804.
9452
9453 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9454
9455         The goal here is to remove the dependency on EmptyCast.Peel ().
9456         Killing it completely.
9457
9458         The problem is that currently in a number of places where
9459         constants are expected, we have to "probe" for an EmptyCast, and
9460         Peel, which is not the correct thing to do, as this will be
9461         repetitive and will likely lead to errors. 
9462
9463         The idea is to remove any EmptyCasts that are used in casts that
9464         can be reduced to constants, so we only have to cope with
9465         constants. 
9466
9467         This bug hunt was triggered by Bug 37363 and the desire to remove
9468         the duplicate pattern where we were "peeling" emptycasts to check
9469         whether they were constants.  Now constants will always be
9470         constants.
9471
9472         * ecore.cs: Use an enumconstant here instead of wrapping with
9473         EmptyCast.  
9474
9475         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9476         throwing me off.  By handling this we can get rid of a few hacks.
9477
9478         * statement.cs (Switch): Removed Peel() code.
9479
9480 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9481
9482         * class.cs: Location information for error 508
9483
9484         * expression.cs (New.DoResolve): Add a guard against double
9485         resolution of an expression.  
9486
9487         The New DoResolve might be called twice when initializing field
9488         expressions (see EmitFieldInitializers, the call to
9489         GetInitializerExpression will perform a resolve on the expression,
9490         and later the assign will trigger another resolution
9491
9492         This leads to bugs (#37014)
9493
9494         * delegate.cs: The signature for EndInvoke should contain any ref
9495         or out parameters as well.  We were not doing this in the past. 
9496
9497         * class.cs (Field.Define): Do not overwrite the type definition
9498         inside the `volatile' group.  Turns out that volatile enumerations
9499         were changing the type here to perform a validity test, which
9500         broke conversions. 
9501
9502 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9503
9504         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9505         and structs, we do not want to load the instance variable
9506
9507         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9508         enum_type has to be handled like an object reference (implicit
9509         conversions exists from this to object), but the regular IsClass
9510         and IsValueType tests will never return true for this one.
9511
9512         Also we use TypeManager.IsValueType instead of type.IsValueType,
9513         just for consistency with the rest of the code (this is only
9514         needed if we ever use the construct exposed by test-180.cs inside
9515         corlib, which we dont today).
9516
9517 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9518
9519         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9520         just InternalCall.
9521
9522 2003-02-09  Martin Baulig  <martin@ximian.com>
9523
9524         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9525         (Namespace.DefineNamespaces): New static public method; this is
9526         called when we're compiling with debugging to add all namespaces
9527         to the symbol file.
9528
9529         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9530         pass it to the Namespace's .ctor.
9531
9532         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9533         and MethodBase arguments; pass the namespace ID to the symwriter;
9534         pass the MethodBase instead of the token to the symwriter.
9535         (SymbolWriter.DefineNamespace): New method to add a namespace to
9536         the symbol file.
9537
9538 2003-02-09  Martin Baulig  <martin@ximian.com>
9539
9540         * symbolwriter.cs: New file.  This is a wrapper around
9541         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9542         methods here in near future.
9543
9544 2003-02-09  Martin Baulig  <martin@ximian.com>
9545
9546         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9547         ILGenerator.MarkSequencePoint() which are actually used by the
9548         symbol writer.
9549
9550 2003-02-09  Martin Baulig  <martin@ximian.com>
9551
9552         * location.cs (SourceFile): New public sealed class.  This
9553         contains the name and an index which is used in the location's token.
9554         (Location): Reserve an appropriate number of bits in the token for
9555         the source file instead of walking over that list, this gives us a
9556         really huge performance improvement when compiling with debugging.
9557
9558         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9559         `SourceFile' argument instead of a string.
9560         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9561         but don't parse/tokenize here, we need to generate the list of all
9562         source files before we do that.
9563         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9564         the files.
9565
9566         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9567         instead of a string.
9568
9569         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9570         of a string.
9571
9572 2003-02-09  Martin Baulig  <martin@ximian.com>
9573
9574         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9575         filename on `#line default'.
9576
9577 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9578
9579         * statement.cs: don't clear the pinned var when the fixed statement
9580         returns from the method (fixes bug#37752).
9581
9582 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9583
9584         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9585         to IsValueType.
9586
9587 2003-02-07  Martin Baulig  <martin@ximian.com>
9588
9589         * driver.cs: Removed the `--debug-args' command line argument.
9590
9591         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9592         automatically by the AsssemblyBuilder.
9593         (CodeGen.InitializeSymbolWriter): We don't need to call any
9594         initialization function on the symbol writer anymore.  This method
9595         doesn't take any arguments.
9596
9597 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9598
9599         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9600         from referenced assemblies as well.
9601
9602 2003-02-02  Martin Baulig  <martin@ximian.com>
9603
9604         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9605
9606 2003-02-02  Martin Baulig  <martin@ximian.com>
9607
9608         * class.cs (Constructor.Emit): Open the symbol writer before
9609         emitting the constructor initializer.
9610         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9611         single-stepping through constructor initializers.
9612
9613 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9614
9615         * class.cs: Handle error 549: do not allow virtual methods in
9616         sealed classes. 
9617
9618 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9619
9620         * decl.cs: Check access levels when resolving types
9621
9622 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9623
9624         * statement.cs: Add parameters and locals set in catch blocks that might 
9625         return to set vector
9626
9627 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * class.cs (Operator): Set the SpecialName flags for operators.
9630
9631         * expression.cs (Invocation.DoResolve): Only block calls to
9632         accessors and operators on SpecialName methods.
9633
9634         (Cast.TryReduce): Handle conversions from char constants.
9635
9636
9637 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9638
9639         * statement.cs: small memory and time optimization in FlowBranching.
9640
9641 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9642
9643         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9644         problem that the last fix but in the other sid (Set).
9645
9646         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9647         access when there is no indexer in the hierarchy.
9648
9649 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9650
9651         * class.cs: Combine some if statements.
9652
9653 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9654
9655         * driver.cs: fixed bug #37187.
9656
9657 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9658
9659         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9660         any indexer, it's needed to build a list with all the indexers in the
9661         hierarchy (AllGetters), else we have problems. Fixes #35653.
9662
9663 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9664
9665         * class.cs (MethodData.Define): It is wrong for an interface
9666         implementation to be static in both cases: explicit and implicit.
9667         We were only handling this in one case.
9668
9669         Improve the if situation there to not have negations.
9670
9671         * class.cs (Field.Define): Turns out that we do not need to check
9672         the unsafe bit on field definition, only on usage.  Remove the test.
9673
9674 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9675
9676         * driver.cs: use assembly.Location instead of Codebase (the latest
9677         patch made mcs fail when using MS assemblies).
9678
9679 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
9680
9681         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9682         get the path to *corlib.dll.
9683
9684 2003-01-21  Nick Drochak <ndrochak@gol.com>
9685
9686         * cs-tokenizer.cs:
9687         * pending.cs:
9688         * typemanager.cs: Remove compiler warnings
9689
9690 2003-01-20  Duncan Mak  <duncan@ximian.com>
9691
9692         * AssemblyInfo.cs: Bump the version number to 0.19.
9693
9694 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9695
9696         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9697
9698 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
9699
9700         * class.cs (Constructor::Emit): Emit debugging info for constructors.
9701
9702 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
9703
9704         * cs-parser.jay: Small fix: we were not comparing the constructor
9705         name correctly.   Thanks to Zoltan for the initial pointer.
9706
9707 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9708
9709         * cs-tokenizer.cs: Set file name when specified with #line
9710
9711 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
9712
9713         * cs-parser.jay: Only perform the constructor checks here if we
9714         are named like the class;  This will help provider a better
9715         error.  The constructor path is taken when a type definition is
9716         not found, but most likely the user forgot to add the type, so
9717         report that rather than the constructor error.
9718
9719 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9720
9721         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9722         allocations.
9723
9724 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9725
9726         * cs-parser.jay: Add cleanup call.
9727
9728 2003-01-13  Duncan Mak  <duncan@ximian.com>
9729
9730         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9731         consistent with other methods.
9732
9733 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9734
9735         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9736
9737 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9738
9739         * attribute.cs: only set GuidAttr to true when we have a
9740         GuidAttribute.
9741
9742 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9743
9744         * ecore.cs:
9745         * expression.cs:
9746         * typemanager.cs: fixes to allow mcs compile corlib with the new
9747         Type.IsSubclassOf fix.
9748
9749 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
9750
9751         * expression.cs (LocalVariableReference.DoResolve): Classify a
9752         constant as a value, not as a variable.   Also, set the type for
9753         the variable.
9754
9755         * cs-parser.jay (fixed_statement): take a type instead of a
9756         pointer_type, so we can produce a better error message later.
9757
9758         * statement.cs (Fixed.Resolve): Flag types that are not pointers
9759         as an error.  
9760
9761         (For.DoEmit): Make inifinite loops have a
9762         non-conditional branch back.
9763
9764         (Fixed.DoEmit): First populate the pinned variables, then emit the
9765         statement, then clear the variables.  Before I was emitting the
9766         code once for each fixed piece.
9767
9768
9769 2003-01-08  Martin Baulig  <martin@ximian.com>
9770
9771         * statement.cs (FlowBranching.MergeChild): A break in a
9772         SWITCH_SECTION does not leave a loop.  Fixes #36155.
9773
9774 2003-01-08  Martin Baulig  <martin@ximian.com>
9775
9776         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9777         lives in the same number space than `param_map'.  Fixes #36154.
9778
9779 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
9780
9781         * cs-parser.jay (constructor_declaration): Set the
9782         Constructor.ModFlags before probing for it.  This makes the
9783         compiler report 514, 515 and 132 (the code was there, but got
9784         broken). 
9785
9786         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9787         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9788         (GotoCase.Resolve): Set `Returns' to ALWAYS.
9789
9790 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9791
9792         * enum.cs: create the enum static fields using the enum type.
9793
9794 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9795
9796         * class.cs: don't try to create the ParamBuilder for the return
9797         type if it's not needed (and handle it breaking for the ms runtime
9798         anyway).
9799
9800 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9801
9802         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9803
9804 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
9805
9806         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9807         the command.   This showed up while compiling the JANET source
9808         code, which used \r as its only newline separator.
9809
9810 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
9811
9812         * class.cs (Method.Define): If we are an operator (because it
9813         reuses our code), then set the SpecialName and HideBySig.  #36128
9814
9815 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
9816
9817         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9818         exception, report error 120 `object reference required'.
9819
9820         * driver.cs: Add --pause option, used during to measure the size
9821         of the process as it goes with --timestamp.
9822
9823         * expression.cs (Invocation.DoResolve): Do not allow methods with
9824         SpecialName to be invoked.
9825
9826 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
9827
9828         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9829         number before adding it.
9830
9831 2002-12-21  Ravi Pratap  <ravi@ximian.com>
9832
9833         * ecore.cs (StandardImplicitConversion): When in an unsafe
9834         context, we allow conversion between void * to any other pointer
9835         type. This fixes bug #35973.
9836
9837 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9838
9839         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9840         is not thrown when extensionless outputs are used 
9841
9842 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9843
9844         * rootcontext.cs: fixed compilation of corlib.
9845
9846 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
9847
9848         * attribute.cs (Attributes.Contains): Add new method.
9849
9850         * class.cs (MethodCore.LabelParameters): if the parameter is an
9851         `out' parameter, check that no attribute `[In]' has been passed.
9852
9853         * enum.cs: Handle the `value__' name in an enumeration.
9854
9855 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
9856
9857         * decl.cs: Added special case to allow overrides on "protected
9858         internal" methods
9859
9860 2002-12-18  Ravi Pratap  <ravi@ximian.com>
9861
9862         * attribute.cs (Attributes.AddAttributeSection): Rename to this
9863         since it makes much more sense.
9864
9865         (Attributes.ctor): Don't require a Location parameter.
9866
9867         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9868
9869         * attribute.cs (ApplyAttributes): Remove extra Location parameters
9870         since we already have that information per attribute.
9871
9872         * everywhere : make appropriate changes.
9873
9874         * class.cs (LabelParameters): Write the code which actually
9875         applies attributes to the return type. We can't do this on the MS
9876         .NET runtime so we flag a warning in the case an exception is
9877         thrown.
9878
9879 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
9880
9881         * const.cs: Handle implicit null conversions here too.
9882
9883 2002-12-17  Ravi Pratap  <ravi@ximian.com>
9884
9885         * class.cs (MethodCore.LabelParameters): Remove the extra
9886         Type [] parameter since it is completely unnecessary. Instead
9887         pass in the method's attributes so that we can extract
9888         the "return" attribute.
9889
9890 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
9891
9892         * cs-parser.jay (parse): Use Report.Error to flag errors instead
9893         of ignoring it and letting the compile continue.
9894
9895         * typemanager.cs (ChangeType): use an extra argument to return an
9896         error condition instead of throwing an exception.
9897
9898 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
9899
9900         * expression.cs (Unary.TryReduce): mimic the code for the regular
9901         code path.  Perform an implicit cast in the cases where we can
9902         implicitly convert to one of the integral types, and then reduce
9903         based on that constant.   This fixes bug #35483.
9904
9905 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9906
9907         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9908
9909 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9910
9911         * namespace.cs: fixed bug #35489.
9912
9913 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
9914
9915         * class.cs: Remove some dead code.
9916
9917         * cs-parser.jay: Estimate the number of methods needed
9918         (RootContext.MethodCount);
9919
9920         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9921         numbers instead of StringBuilders.
9922
9923         * support.cs (PtrHashtable): Add constructor with initial size;
9924         We can now reduce reallocations of the method table.
9925
9926 2002-12-10  Ravi Pratap  <ravi@ximian.com>
9927
9928         * attribute.cs (ApplyAttributes): Keep track of the emitted
9929         attributes on a per-target basis. This fixes bug #35413.
9930
9931 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
9932
9933         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9934         default to the Windows 1252 encoding.
9935
9936         (UnixParseOption): Support version, thanks to Alp for the missing
9937         pointer. 
9938
9939         * AssemblyInfo.cs: Add nice assembly information.
9940
9941         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
9942         (bug 35169).
9943
9944         * cs-parser.jay: Allow a trailing comma before the close bracked
9945         in the attribute_section production.
9946
9947         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
9948         address of the instance was being taken, I will take this out,
9949         because we take the address of the object immediately here.
9950
9951 2002-12-09  Ravi Pratap  <ravi@ximian.com>
9952
9953         * typemanager.cs (AreMultipleAllowed): Take care of the most
9954         obvious case where attribute type is not in the current assembly -
9955         stupid me ;-)
9956
9957 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
9958
9959         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
9960         definitions, instead of doing that afterwards.  
9961
9962         Also we use a nice little hack, depending on the constructor, we
9963         know if we are a "composed" name or a simple name.  Hence, we
9964         avoid the IndexOf test, and we avoid 
9965
9966         * codegen.cs: Add code to assist in a bug reporter to track down
9967         the source of a compiler crash. 
9968
9969 2002-12-07  Ravi Pratap  <ravi@ximian.com>
9970
9971         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
9972         types have been emitted for a given element and flag an error
9973         if something which does not have AllowMultiple set is used more
9974         than once.
9975
9976         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
9977         attribute types and their corresponding AllowMultiple properties
9978
9979         (AreMultipleAllowed): Check the property for a given type.
9980
9981         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
9982         property in the case we have a TypeContainer.
9983
9984         (Attributes.AddAttribute): Detect duplicates and just skip on
9985         adding them. This trivial fix catches a pretty gross error in our
9986         attribute emission - global attributes were being emitted twice!
9987
9988         Bugzilla bug #33187 is now fixed.
9989
9990 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
9991
9992         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
9993         instead of pp_and).
9994
9995         * expression.cs (Binary.ResolveOperator): I can only use the
9996         Concat (string, string, string) and Concat (string, string,
9997         string, string) if the child is actually a concatenation of
9998         strings. 
9999
10000 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10001
10002         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10003         context where we need a 2-character lookahead.
10004
10005         * pending.cs (PendingImplementation): Rework so we can keep track
10006         of interface types all the time, and flag those which were
10007         implemented by parents as optional.
10008
10009 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10010
10011         * expression.cs (Binary.ResolveOperator): Use
10012         String.Concat(string,string,string) or
10013         String.Concat(string,string,string,string) when possible. 
10014
10015         * typemanager: More helper methods.
10016
10017
10018 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10019
10020         * pending.cs: remove the bogus return from GetMissingInterfaces()
10021         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10022
10023 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10024
10025         * namespace.cs: avoid duplicated 'using xxx' being added to
10026         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10027         when we get more than one 'using' statement for the same namespace.
10028         Report a CS0105 warning for it.
10029
10030 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10033         of calling getChar/putback, uses internal knowledge of it.    
10034
10035         (xtoken): Reorder tokenizer so most common patterns are checked
10036         first.  This reduces the compilation time in another 5% (from 8.11s
10037         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10038
10039         The parsing time is 22% of the compilation in mcs, and from that
10040         64% is spent on the tokenization process.  
10041
10042         I tried using a binary search for keywords, but this is slower
10043         than the hashtable.  Another option would be to do a couple of
10044         things:
10045
10046                 * Not use a StringBuilder, instead use an array of chars,
10047                   with a set value.  Notice that this way we could catch
10048                   the 645 error without having to do it *afterwards*.
10049
10050                 * We could write a hand-parser to avoid the hashtable
10051                   compares altogether.
10052
10053         The identifier consumption process takes 37% of the tokenization
10054         time.  Another 15% is spent on is_number.  56% of the time spent
10055         on is_number is spent on Int64.Parse:
10056
10057                 * We could probably choose based on the string length to
10058                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10059                   computations. 
10060
10061         Another 3% is spend on wrapping `xtoken' in the `token' function.
10062
10063         Handle 0xa0 as whitespace (#34752)
10064
10065 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10066
10067         * typemanager.cs (IsCLRType): New routine to tell whether a type
10068         is one of the builtin types.  
10069
10070         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10071         typecode in more places instead of doing pointer comparissions.
10072         We could leverage some knowledge about the way the typecodes are
10073         laid out.
10074
10075         New code to cache namespaces in assemblies, it is currently not
10076         invoked, to be used soon.
10077
10078         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10079
10080         * expression.cs (Binary.ResolveOperator): specially handle
10081         strings, and do not perform user-defined operator overloading for
10082         built-in types.
10083
10084 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10085
10086         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10087         internalcall as it is a pretty simple operation;  Avoid whenever
10088         possible to call Char.IsLetter.
10089
10090         (consume_identifier): Cut by half the number of
10091         hashtable calls by merging the is_keyword and GetKeyword behavior.
10092
10093         Do not short-circuit, because if we do, we
10094         report errors (ie, #if false && true would produce an invalid
10095         directive error);
10096
10097
10098 2002-11-24  Martin Baulig  <martin@ximian.com>
10099
10100         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10101         check constant ranges and report a CS0221.  Fixes #33186.
10102
10103 2002-11-24  Martin Baulig  <martin@ximian.com>
10104
10105         * cs-parser.jay: Make this work for uninitialized variable
10106         declarations in the `for' initializer.  Fixes #32416.
10107
10108 2002-11-24  Martin Baulig  <martin@ximian.com>
10109
10110         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10111         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10112
10113 2002-11-24  Martin Baulig  <martin@ximian.com>
10114
10115         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10116         argument; if true, we also check for user-defined conversions.
10117         This is only needed if both arguments are of a user-defined type.
10118         Fixes #30443, added test-175.cs.
10119         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10120
10121         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10122
10123 2002-11-24  Martin Baulig  <martin@ximian.com>
10124
10125         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10126         function to get the store opcode.
10127         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10128         only emit the Ldelema if the store opcode is Stobj.  You must run
10129         both test-34 and test-167 to test this.  Fixes #34529.
10130
10131 2002-11-23  Martin Baulig  <martin@ximian.com>
10132
10133         * ecore.cs (Expression.MemberLookup): Added additional
10134         `qualifier_type' argument which is used when we're being called
10135         from MemberAccess.DoResolve() and null if we're called from a
10136         SimpleName lookup.
10137         (Expression.MemberLookupFailed): New method to report errors; this
10138         does the CS1540 check and reports the correct error message.
10139
10140         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10141         argument for the CS1540 check and redone the way how we're dealing
10142         with private members.  See the comment in the source code for details.
10143         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10144         `closure_start_type' to `closure_qualifier_type' and check whether
10145         it's not null.  It was not this filter being broken, it was just
10146         being called with the wrong arguments.
10147
10148         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10149         and pass it the correct `qualifier_type'; this also does the error
10150         handling for us.
10151
10152 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10153
10154         * expression.cs (Invocation.EmitParams): If the we are dealing
10155         with a non-built-in value type, load its address as well.
10156
10157         (ArrayCreation): Use a a pretty constant instead
10158         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10159         static initializers.  
10160
10161         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10162         because they are not really value types, just glorified integers. 
10163
10164         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10165
10166         * ecore.cs: Remove redundant code for enumerations, make them use
10167         the same code path as everything else, fixes the casting issue
10168         with enumerations in Windows.Forms.
10169
10170         * attribute.cs: Do only cast to string if it is a string, the
10171         validation happens later.
10172
10173         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10174         people upgrade their corlibs.
10175
10176         * ecore.cs: Oops, enumerations were not following the entire code path
10177
10178 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * typemanager.cs (FilterWithClosure): Commented out the test for
10181         1540 in typemanager.cs, as it has problems when accessing
10182         protected methods from a parent class (see test-174.cs). 
10183
10184         * attribute.cs (Attribute.ValidateGuid): new method.
10185         (Attribute.Resolve): Use above.
10186
10187 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10188
10189         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10190
10191         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10192         handling for enumerations, as we only needed the TypeContainer
10193         functionality to begin with (this is required for the fix below to
10194         work for enums that reference constants in a container class for
10195         example). 
10196
10197         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10198
10199         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10200         a valid TypeBuilder to perform lookups on.o
10201
10202         * class.cs (InheritableMemberSignatureCompare): Use true in the
10203         call to GetGetMethod and GetSetMethod, because we are comparing
10204         the signature, and we need to get the methods *even* if they are
10205         private. 
10206
10207         (PropertyBase.CheckBase): ditto.
10208
10209         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10210         GotoCase.Resolve): Use Peel on EmpytCasts.
10211
10212         * ecore.cs (EmptyCast): drop child, add Peel method.
10213
10214 2002-11-17  Martin Baulig  <martin@ximian.com>
10215
10216         * ecore.cs (EmptyCast.Child): New public property.
10217
10218         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10219         label resolved to an EmptyCast.  Fixes #34162.
10220         (GotoCase.Resolve): Likewise.
10221         (Block.EmitMeta): Likewise.
10222
10223 2002-11-17  Martin Baulig  <martin@ximian.com>
10224
10225         * expression.cs (Invocation.BetterConversion): Prefer int over
10226         uint; short over ushort; long over ulong for integer literals.
10227         Use ImplicitConversionExists instead of StandardConversionExists
10228         since we also need to check for user-defined implicit conversions.
10229         Fixes #34165.  Added test-173.cs.
10230
10231 2002-11-16  Martin Baulig  <martin@ximian.com>
10232
10233         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10234         with the `true' and `false' literals.  Fixes #33151.
10235
10236 2002-11-16  Martin Baulig  <martin@ximian.com>
10237
10238         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10239         October 22nd; don't do the cs1540 check for static members.
10240
10241         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10242         now using our own filter here and doing the cs1540 check again.
10243
10244 2002-11-16  Martin Baulig  <martin@ximian.com>
10245
10246         * support.cs (InternalParameters): Don't crash if we don't have
10247         any fixed parameters.  Fixes #33532.
10248
10249 2002-11-16  Martin Baulig  <martin@ximian.com>
10250
10251         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10252         when looking up static methods to make this work on Windows.
10253         Fixes #33773.
10254
10255 2002-11-16  Martin Baulig  <martin@ximian.com>
10256
10257         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10258         a setter rather than using PropertyInfo.CanWrite.
10259
10260 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10261
10262         * class.cs: Allow acces to block member by subclasses. Fixes build
10263         breaker.
10264
10265 2002-11-14  Martin Baulig  <martin@ximian.com>
10266
10267         * class.cs (Constructor.Emit): Added the extern/block check.
10268         Fixes bug #33678.
10269
10270 2002-11-14  Martin Baulig  <martin@ximian.com>
10271
10272         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10273         iteration while looking for indexers, this is needed because the
10274         indexer may have a different name in our base classes.  Fixed the
10275         error reporting (no indexers at all, not get accessor, no
10276         overloaded match).  Fixes bug #33089.
10277         (IndexerAccess.DoResolveLValue): Likewise.
10278
10279 2002-11-14  Martin Baulig  <martin@ximian.com>
10280
10281         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10282         indexers.  Fixes the first part of bug #33089.
10283         (MethodSignature.InheritableMemberSignatureCompare): Added support
10284         for properties.
10285
10286 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10287
10288         * attribute.cs (Attribute.Resolve): Catch the
10289         NullReferenceException and report it since it isn't supposed to
10290         happen. 
10291
10292 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10293
10294         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10295         LogicalOr and LogicalAnd that can benefit from recursively
10296         handling EmitBranchable.  The code now should be nice for Paolo.
10297
10298 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10299
10300         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10301         the Type lookups, as we perform quite a number of lookups on
10302         non-Types.  This can be removed once we can deterministically tell
10303         whether we have a type or a namespace in advance.
10304
10305         But this might require special hacks from our corlib.
10306
10307         * TODO: updated.
10308
10309         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10310         and double which avoids a conversion from an integer to a double.
10311
10312         * expression.cs: tiny optimization, avoid calling IsConstant,
10313         because it effectively performs the lookup twice.
10314
10315 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10316
10317         But a bogus return here to keep the semantics of the old code
10318         until the Mono runtime is fixed.
10319
10320         * pending.cs (GetMissingInterfaces): New method used to remove all
10321         the interfaces that are already implemented by our parent
10322         classes from the list of pending methods. 
10323
10324         * interface.cs: Add checks for calls after ResolveTypeExpr.
10325
10326 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10327
10328         * class.cs (Class.Emit): Report warning 67: event not used if the
10329         warning level is beyond 3.
10330
10331         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10332         being a NullLiteral.
10333
10334         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10335         specifiers. 
10336
10337         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10338         path that might fail if a type can not be resolved.
10339
10340         * expression.cs (Binary.Emit): Emit unsigned versions of the
10341         operators. 
10342
10343         * driver.cs: use error 5.
10344
10345 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10346
10347         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10348
10349 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10350
10351         * cs-parser.jay (switch_section): A beautiful patch from Martin
10352         Baulig that fixed 33094.
10353
10354 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10355
10356         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10357         Check whether the base is abstract and report an error if so.
10358
10359         * expression.cs (IndexerAccess.DoResolveLValue,
10360         IndexerAccess.DoResolve): ditto. 
10361
10362         (Invocation.DoResolve): ditto.
10363
10364         (Invocation.FullMethodDesc): Improve the report string.
10365
10366         * statement.cs (Block): Eliminate IsVariableDefined as it is
10367         basically just a wrapper for GetVariableInfo.
10368
10369         * ecore.cs (SimpleName): Use new 
10370
10371         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10372         type, as we return the actual parameter ref/unref state on a
10373         different call.
10374
10375 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10376
10377         * support.cs: Return proper flags REF/OUT fixing the previous
10378         commit.  
10379
10380         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10381         not used to mean `ref' but `ref or out' in ParameterReference
10382
10383         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10384         full type signature instead of calling TypeManger.CSharpName
10385         ourselves. 
10386
10387         * support.cs (InternalParameters.ParameterDesc): Do not compare
10388         directly to the modflags, because REF/OUT will actually be bitsets
10389         if set. 
10390
10391         * delegate.cs (VerifyMethod): Check also the modifiers.
10392
10393         * cs-tokenizer.cs: Fix bug where floating point values with an
10394         exponent where a sign was missing was ignored.
10395
10396         * driver.cs: Allow multiple assemblies to be specified in a single
10397         /r: argument
10398
10399 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10400
10401         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10402         because identifiers after a parenthesis would end up in this kind
10403         of production, and we needed to desamiguate it for having casts
10404         like:
10405
10406                 (UserDefinedType *) xxx
10407
10408 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10409
10410         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10411         we should set on the Bindingflags.NonPublic, but not turn on
10412         private_ok.  private_ok controls whether a Private member is
10413         returned (this is chekced on the filter routine), while the
10414         BindingFlags.NonPublic just controls whether private/protected
10415         will be allowed.   This fixes the problem part of the problem of
10416         private properties being allowed to be used in derived classes.
10417
10418         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10419         so we can call the children DoResolveLValue method (this will
10420         properly signal errors on lvalue assignments to base properties)
10421
10422         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10423         getter are null, and we have a property info, we know that this
10424         happened because the lookup failed, so we report an error 122 for
10425         protection level violation.
10426
10427         We also silently return if setter and getter are null in the
10428         resolve functions, this condition only happens if we have flagged
10429         the error before.  This is the other half of the problem. 
10430
10431         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10432         not have accessibility information, that is why we were returning
10433         true in the filter function in typemanager.cs.
10434
10435         To properly report 122 (property is inaccessible because of its
10436         protection level) correctly, we report this error in ResolveAccess
10437         by failing if both the setter and the getter are lacking (ie, the
10438         lookup failed). 
10439
10440         DoResolve and DoLResolve have been modified to check for both
10441         setter/getter being null and returning silently, the reason being
10442         that I did not want to put the knowledge about this error in upper
10443         layers, like:
10444
10445         int old = Report.Errors;
10446         x = new PropertyExpr (...);
10447         if (old != Report.Errors)
10448                 return null;
10449         else
10450                 return x;
10451
10452         So the property expr is returned, but it is invalid, so the error
10453         will be flagged during the resolve process. 
10454
10455         * class.cs: Remove InheritablePropertySignatureCompare from the
10456         class, as we no longer depend on the property signature to compute
10457         whether it is possible to implement a method or not.
10458
10459         The reason is that calling PropertyInfo.GetGetMethod will return
10460         null (in .NET, in Mono it works, and we should change this), in
10461         cases where the Get Method does not exist in that particular
10462         class.
10463
10464         So this code:
10465
10466         class X { public virtual int A { get { return 1; } } }
10467         class Y : X { }
10468         class Z : Y { public override int A { get { return 2; } } }
10469
10470         Would fail in Z because the parent (Y) would not have the property
10471         defined.  So we avoid this completely now (because the alternative
10472         fix was ugly and slow), and we now depend exclusively on the
10473         method names.
10474
10475         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10476         reference method, instead of using the property.
10477
10478         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10479         routines are gone now.
10480
10481         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10482         names, they were incorrectly named.
10483
10484         * cs-tokenizer.cs: Return are more gentle token on failure. 
10485
10486         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10487         had an out-of-sync index variable, which caused it to remove from
10488         the list of pending methods the wrong method sometimes.
10489
10490 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10493         CanWrite, because those refer to this particular instance of the
10494         property, and do not take into account the fact that we can
10495         override single members of a property.
10496
10497         Constructor requires an EmitContext.  The resolution process does
10498         not happen here, but we need to compute the accessors before,
10499         because the resolution does not always happen for properties.
10500
10501         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10502         subclass, before we did not update this flag, but we did update
10503         bindingflags. 
10504
10505         (GetAccessors): Drop this routine, as it did not work in the
10506         presence of partially overwritten set/get methods. 
10507
10508         Notice that this broke the cs1540 detection, but that will require
10509         more thinking. 
10510
10511 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10512
10513         * class.cs:
10514         * codegen.cs:
10515         * driver.cs: issue a warning instead of an error if we don't support
10516         debugging for the platform. Also ignore a couple of errors that may
10517         arise when trying to write the symbols. Undo my previous patch.
10518
10519 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10520
10521         * driver.cs: ignore /debug switch except for Unix platforms.
10522
10523 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10524
10525         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10526
10527 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10528
10529         * driver.cs: Do not make mcs-debug conditional, so we do not break
10530         builds that use it.
10531
10532         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10533         review this patch.  But basically after all the children variables
10534         have been merged, the value of "Breaks" was not being set to
10535         new_breaks for Switch blocks.  I think that it should be set after
10536         it has executed.  Currently I set this to the value of new_breaks,
10537         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10538         conservative, but I do not understand this code very well.
10539
10540         I did not break anything in the build, so that is good ;-)
10541
10542         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10543
10544 2002-10-20  Mark Crichton  <crichton@gimp.org>
10545
10546         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10547
10548 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10549
10550         * cfold.cs: Fixed compile blocker.
10551
10552 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10553
10554         * driver.cs: I was chekcing the key, not the file.
10555
10556 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10557
10558         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10559         message that we were generating - we just need to silently return
10560         a null.
10561
10562 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10563
10564         * class.cs (Event.Define): Change my previous commit, as this
10565         breaks the debugger.  This is a temporary hack, as it seems like
10566         the compiler is generating events incorrectly to begin with.
10567
10568         * expression.cs (Binary.ResolveOperator): Added support for 
10569         "U operator - (E x, E y)"
10570
10571         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10572         y)".
10573
10574         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10575         init-only variables, but this path did not take into account that
10576         there might be also instance readonly variables.  Correct this
10577         problem. 
10578
10579         This fixes bug 32253
10580
10581         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10582         delegates as well.
10583
10584         * driver.cs: Change the extension for modules to `netmodule'
10585
10586         * cs-parser.jay: Improved slightly the location tracking for
10587         the debugger symbols.
10588
10589         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10590         modifiers that were specified instead of the hardcoded value
10591         (FamAndAssem).  This was basically ignoring the static modifier,
10592         and others.  Fixes 32429.
10593
10594         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10595         fixed a bug in the process (32476)
10596
10597         * expression.cs (ArrayAccess.EmitAssign): Patch from
10598         hwang_rob@yahoo.ca that fixes bug 31834.3
10599
10600 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10601
10602         * driver.cs: Make the module extension .netmodule.
10603
10604 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10605
10606         * driver.cs: Report an error if the resource file is not found
10607         instead of crashing.
10608
10609         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10610         false, like Emit does.
10611
10612 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10613
10614         * typemanager.cs: Remove unused private member.  Also reported mcs
10615         bug to report this as a warning like csc.
10616
10617 2002-10-15  Martin Baulig  <martin@gnome.org>
10618
10619         * statement.cs (Statement.Emit): Made this a virtual method; emits
10620         the line number info and calls DoEmit().
10621         (Statement.DoEmit): New protected abstract method, formerly knows
10622         as Statement.Emit().
10623
10624         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10625
10626 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10627
10628         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10629         have fixed a remaining problem: not every AddXXXX was adding a
10630         fully qualified name.  
10631
10632         Now everyone registers a fully qualified name in the DeclSpace as
10633         being defined instead of the partial name.  
10634
10635         Downsides: we are slower than we need to be due to the excess
10636         copies and the names being registered this way.  
10637
10638         The reason for this is that we currently depend (on the corlib
10639         bootstrap for instance) that types are fully qualified, because
10640         we dump all the types in the namespace, and we should really have
10641         types inserted into the proper namespace, so we can only store the
10642         basenames in the defined_names array.
10643
10644 2002-10-10  Martin Baulig  <martin@gnome.org>
10645
10646         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10647         from bug #31834, see the bug report for a testcase which is
10648         miscompiled.
10649
10650 2002-10-10  Martin Baulig  <martin@gnome.org>
10651
10652         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10653         flow analysis code for this.
10654
10655         * statement.cs (Do, While, For): Tell the flow analysis code about
10656         infinite loops.
10657         (FlowBranching.UsageVector): Added support for infinite loops.
10658         (Block.Resolve): Moved the dead code elimination here and use flow
10659         analysis to do it.
10660
10661 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10662
10663         * class.cs (Field.Define): Catch cycles on struct type
10664         definitions. 
10665
10666         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10667         fields if the fields are static.  We only need to check instance
10668         fields. 
10669
10670         * expression.cs (As.DoResolve): Test for reference type.
10671
10672         * statement.cs (Using.ResolveExpression): Use
10673         ConvertImplicitRequired, not ConvertImplicit which reports an
10674         error on failture
10675         (Using.ResolveLocalVariableDecls): ditto.
10676
10677         * expression.cs (Binary.ResolveOperator): Report errors in a few
10678         places where we had to.
10679
10680         * typemanager.cs (IsUnmanagedtype): Finish implementation.
10681
10682 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * expression.cs: Use StoreFromPtr instead of extracting the type
10685         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
10686
10687         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10688         an enumeration value to a System.Enum, but System.Enum is not a
10689         value type, but an class type, so we need to box.
10690
10691         (Expression.ConvertExplicit): One codepath could return
10692         errors but not flag them.  Fix this.  Fixes #31853
10693
10694         * parameter.cs (Resolve): Do not allow void as a parameter type.
10695
10696 2002-10-06  Martin Baulig  <martin@gnome.org>
10697
10698         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10699         if it's a class type and not a struct.  Fixes #31815.
10700
10701 2002-10-06  Martin Baulig  <martin@gnome.org>
10702
10703         * statement.cs: Reworked the flow analysis code a bit to make it
10704         usable for dead code elimination.
10705
10706 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10707
10708         * cs-parser.jay: allow empty source files. Fixes bug #31781.
10709
10710 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10711
10712         * expression.cs (ComposedCast.DoResolveType): A quick workaround
10713         to fix the test 165, will investigate deeper.
10714
10715 2002-10-04  Martin Baulig  <martin@gnome.org>
10716
10717         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10718         finally blocks actually work.
10719         (Try.Resolve): We don't need to create a sibling for `finally' if
10720         there is no finally block.
10721
10722 2002-10-04  Martin Baulig  <martin@gnome.org>
10723
10724         * class.cs (Constructor.Define): The default accessibility for a
10725         non-default constructor is private, not public.
10726
10727 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
10728
10729         * class.cs (Constructor): Make AllowedModifiers public, add
10730         EXTERN.
10731
10732         * cs-parser.jay: Perform the modifiers test here, as the
10733         constructor for the Constructor class usually receives a zero
10734         because of the way we create it (first we create, later we
10735         customize, and we were never checking the modifiers).
10736
10737         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10738         is a version of LookupTypeReflection that includes the type-name
10739         cache.  This can be used as a fast path for functions that know
10740         the fully qualified name and are only calling into *.GetType() to
10741         obtain a composed type.
10742
10743         This is also used by TypeManager.LookupType during its type
10744         composition.
10745
10746         (LookupType): We now also track the real type name, as sometimes
10747         we can get a quey for the real type name from things like
10748         ComposedCast.  This fixes bug 31422.
10749
10750         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10751         complete type fullname, it does not have to go through the type
10752         resolution system to obtain the composed version of the type (for
10753         obtaining arrays or pointers).
10754
10755         (Conditional.Emit): Use the EmitBoolExpression to
10756         generate nicer code, as requested by Paolo.
10757
10758         (ArrayCreation.CheckIndices): Use the patch from
10759         hwang_rob@yahoo.ca to validate the array initializers. 
10760
10761 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
10762
10763         * class.cs (ConstructorInitializer.Emit): simplify code by using
10764         Invocation.EmitCall, and at the same time, fix the bugs in calling
10765         parent constructors that took variable arguments. 
10766
10767         * ecore.cs (Expression.ConvertNumericExplicit,
10768         Expression.ImplicitNumericConversion): Remove the code that
10769         manually wrapped decimal (InternalTypeConstructor call is now gone
10770         as well).
10771
10772         * expression.cs (Cast.TryReduce): Also handle decimal types when
10773         trying to perform a constant fold on the type.
10774
10775         * typemanager.cs (IsUnmanagedtype): Partially implemented.
10776
10777         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10778         that only turned off an error report, and did nothing else. 
10779
10780 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
10781
10782         * driver.cs: Handle and ignore /fullpaths
10783
10784 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
10785
10786         * expression.cs (Binary.ResolveOperator): Catch the case where
10787         DoNumericPromotions returns true, 
10788
10789         (Binary.DoNumericPromotions): Simplify the code, and the tests.
10790
10791 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
10792
10793         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10794         report error 70.
10795
10796 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
10797
10798         * ecore.cs (ConvertNumericExplicit): It is not enough that the
10799         conversion exists, but it is also required that the conversion be
10800         performed.  This manifested in "(Type64Enum) 2".  
10801
10802         * class.cs (TypeManager.AddMethod): The fix is not to change
10803         AddEnum, because that one was using a fully qualified name (every
10804         DeclSpace derivative does), but to change the AddMethod routine
10805         that was using an un-namespaced name.  This now correctly reports
10806         the duplicated name.
10807
10808         Revert patch until I can properly fix it.  The issue
10809         is that we have a shared Type space across all namespaces
10810         currently, which is wrong.
10811
10812         Options include making the Namespace a DeclSpace, and merge
10813         current_namespace/current_container in the parser.
10814
10815 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
10816
10817         * cs-parser.jay: Improve error reporting when we get a different
10818         kind of expression in local_variable_type and
10819         local_variable_pointer_type. 
10820
10821         Propagate this to avoid missleading errors being reported.
10822
10823         * ecore.cs (ImplicitReferenceConversion): treat
10824         TypeManager.value_type as a target just like object_type.   As
10825         code like this:
10826
10827         ValueType v = 1;
10828
10829         Is valid, and needs to result in the int 1 being boxed before it
10830         is assigned to the value type v.
10831
10832         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10833         to validate the enumeration name.
10834
10835         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10836         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
10837         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10838
10839         * ecore.cs (TryImplicitIntConversion): When doing an
10840         implicit-enumeration-conversion, check if the type is 64-bits and
10841         perform a conversion before passing to EnumConstant.
10842
10843 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
10844
10845         * decl.cs (Error_AmbiguousTypeReference); New routine used to
10846         report ambiguous type references.  Unlike the MS version, we
10847         report what the ambiguity is.   Innovation at work ;-)
10848
10849         (DeclSpace.FindType): Require a location argument to
10850         display when we display an ambiguous error.
10851
10852         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10853
10854         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10855
10856         * expression.cs (EmitDynamicInitializers): Apply patch from
10857         hwang_rob@yahoo.ca that fixes the order in which we emit our
10858         initializers. 
10859
10860 2002-09-21  Martin Baulig  <martin@gnome.org>
10861
10862         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10863         delegate takes no arguments.
10864
10865 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
10866
10867         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10868         from integers.
10869
10870         * expression.cs: Extract the underlying type.
10871
10872         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10873
10874         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10875
10876 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
10877
10878         * class.cs (TypeContainer.DefineType): We can not use the nice
10879         PackingSize with the size set to 1 DefineType method, because it
10880         will not allow us to define the interfaces that the struct
10881         implements.
10882
10883         This completes the fixing of bug 27287
10884
10885         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10886         means also structs.  This fixes part of the problem. 
10887         (Expresion.ImplicitReferenceConversionExists): ditto.
10888
10889         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10890         error if there were no errors reported during the type lookup
10891         process, to avoid duplicates or redundant errors.  Without this
10892         you would get an ambiguous errors plus a type not found.  We have
10893         beaten the user enough with the first error.  
10894
10895         (DeclSparce.FindType): Emit a warning if we have an ambiguous
10896         reference. 
10897
10898         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10899         during the resolution process, stop the lookup, this avoids
10900         repeated error reports (same error twice).
10901
10902         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10903
10904         * typemanager.cs (LookupType): Redo the type lookup code to match
10905         the needs of System.Reflection.  
10906
10907         The issue is that System.Reflection requires references to nested
10908         types to begin with a "+" sign instead of a dot.  So toplevel
10909         types look like: "NameSpace.TopLevelClass", and nested ones look
10910         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10911         levels. 
10912
10913 2002-09-19  Martin Baulig  <martin@gnome.org>
10914
10915         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10916         says that a method always returns or always throws an exception,
10917         don't report the CS0161.
10918
10919         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10920         set `Returns = new_returns'.
10921
10922 2002-09-19  Martin Baulig  <martin@gnome.org>
10923
10924         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10925         to an enum constant, check for a CS0176.
10926
10927 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
10928
10929         * class.cs (TypeContainer.CheckPairedOperators): Now we check
10930         for operators that must be in pairs and report errors.
10931
10932         * ecore.cs (SimpleName.DoResolveType): During the initial type
10933         resolution process, when we define types recursively, we must
10934         check first for types in our current scope before we perform
10935         lookups in the enclosing scopes.
10936
10937         * expression.cs (MakeByteBlob): Handle Decimal blobs.
10938
10939         (Invocation.VerifyArgumentsCompat): Call
10940         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
10941         I thought we were supposed to always call this, but there are a
10942         few places in the code where we dont do it.
10943
10944 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
10945
10946         * driver.cs: Add support in -linkres and -resource to specify the
10947         name of the identifier.
10948
10949 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10950
10951         * ecore.cs (StandardConversionExists): Sync with the conversion
10952         code: allow anything-* to void* conversions.
10953
10954         (FindMostSpecificSource): Use an Expression argument
10955         instead of a Type, because we might be handed over a Literal which
10956         gets a few more implicit conversions that plain types do not.  So
10957         this information was being lost.
10958
10959         Also, we drop the temporary type-holder expression when not
10960         required.
10961
10962 2002-09-17  Martin Baulig  <martin@gnome.org>
10963
10964         * class.cs (PropertyBase.CheckBase): Don't check the base class if
10965         this is an explicit interface implementation.
10966
10967 2002-09-17  Martin Baulig  <martin@gnome.org>
10968
10969         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
10970         different `IndexerName' attributes.
10971
10972         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
10973         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
10974         virtual CommonResolve().
10975
10976 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
10977
10978         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
10979         and convert that to the UnderlyingType.
10980
10981         * statement.cs (Foreach.Resolve): Indexers are just like variables
10982         or PropertyAccesses.
10983
10984         * cs-tokenizer.cs (consume_string): Track line numbers and columns
10985         inside quoted strings, we were not doing this before.
10986
10987 2002-09-16  Martin Baulig  <martin@gnome.org>
10988
10989         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
10990         resolve it.  This is needed for the definite assignment check of the
10991         instance expression, fixes bug #29846.
10992         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
10993
10994 2002-09-16  Nick Drochak  <ndrochak@gol.com>
10995
10996         * parameter.cs: Fix compile error.  Cannot reference static member
10997         from an instance object.  Is this an mcs bug?
10998
10999 2002-09-14  Martin Baulig  <martin@gnome.org>
11000
11001         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11002         multiple times.  Fixes bug #30295, added test-166.cs.
11003
11004 2002-09-14  Martin Baulig  <martin@gnome.org>
11005
11006         * statement.cs (Block.Emit): Don't emit unreachable code.
11007         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11008         `break' statements.
11009         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11010
11011 2002-09-14  Martin Baulig  <martin@gnome.org>
11012
11013         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11014         is set.
11015
11016 2002-09-14  Martin Baulig  <martin@gnome.org>
11017
11018         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11019         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11020         be false on the ms runtime.
11021
11022 2002-09-13  Martin Baulig  <martin@gnome.org>
11023
11024         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11025         the CS0038 error message.
11026
11027 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11028
11029         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11030         constant inside, return it.
11031
11032 2002-09-12  Martin Baulig  <martin@gnome.org>
11033
11034         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11035         implicit conversion can be done between enum types.
11036
11037         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11038         check whether an implicit conversion to the current enum's UnderlyingType
11039         exists and report an error if not.
11040
11041         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11042         without debugging support.
11043
11044         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11045         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11046
11047 2002-09-12  Martin Baulig  <martin@gnome.org>
11048
11049         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11050
11051         * ecore.cs (IMemberExpr.DeclaringType): New property.
11052         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11053         nonstatic member of an outer type (CS0038).
11054
11055 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * driver.cs: Activate the using-error detector at warning level
11058         4 (at least for MS-compatible APIs).
11059
11060         * namespace.cs (VerifyUsing): Small buglett fix.
11061
11062         * pending.cs (PendingImplementation): pass the container pointer. 
11063
11064         * interface.cs (GetMethods): Allow for recursive definition.  Long
11065         term, I would like to move every type to support recursive
11066         definitions, not the current ordering mechanism that we have right
11067         now.
11068
11069         The situation is this: Attributes are handled before interfaces,
11070         so we can apply attributes to interfaces.  But some attributes
11071         implement interfaces, we will now handle the simple cases
11072         (recursive definitions will just get an error).  
11073
11074         * parameter.cs: Only invalidate types at the end if we fail to
11075         lookup all types.  
11076
11077 2002-09-09  Martin Baulig  <martin@gnome.org>
11078
11079         * ecore.cs (PropertyExpr.Emit): Also check for
11080         TypeManager.system_int_array_get_length so this'll also work when
11081         compiling corlib.  Fixes #30003.
11082
11083 2002-09-09  Martin Baulig  <martin@gnome.org>
11084
11085         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11086         and throw an exception if we can't get the type's size.  Fixed #30040,
11087         added test-165.cs.
11088
11089 2002-09-09  Martin Baulig  <martin@gnome.org>
11090
11091         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11092
11093         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11094         context.  Fixes bug #30027.
11095
11096         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11097         virtual functions.  Fixes bug #30043, added test-164.cs.
11098
11099 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11100
11101         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11102
11103 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11104
11105         * driver.cs: Use an object to get the windows codepage since it's not a
11106         static property.
11107
11108 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11109
11110         * statement.cs (For.Emit): for infinite loops (test == null)
11111         return whether there is a break inside, not always "true".
11112
11113         * namespace.cs (UsingEntry): New struct to hold the name of the
11114         using definition, the location where it is defined, and whether it
11115         has been used in a successful type lookup.
11116
11117         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11118         strings.
11119
11120         * decl.cs: ditto.
11121
11122 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11123
11124         * attribute.cs : Fix incorrect code which relied on catching
11125         a NullReferenceException to detect a null being passed in
11126         where an object was expected.
11127
11128 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11129
11130         * statement.cs (Try): flag the catch variable as assigned
11131
11132         * expression.cs (Cast): Simplified by using ResolveType instead of
11133         manually resolving.
11134
11135         * statement.cs (Catch): Fix bug by using ResolveType.
11136
11137 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11138
11139         * expression.cs (BetterConversion): Special case for when we have
11140         a NullLiteral as the argument and we have to choose between string
11141         and object types - we choose string the way csc does.
11142
11143         * attribute.cs (Attribute.Resolve): Catch the
11144         NullReferenceException and report error #182 since the Mono
11145         runtime no more has the bug and having this exception raised means
11146         we tried to select a constructor which takes an object and is
11147         passed a null.
11148
11149 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11150
11151         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11152         message (1502, 1503) when we can't locate a method after overload
11153         resolution. This is much more informative and closes the bug
11154         Miguel reported.
11155
11156         * interface.cs (PopulateMethod): Return if there are no argument
11157         types. Fixes a NullReferenceException bug.
11158
11159         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11160         expressions too. Previously we were checking only in one place for
11161         positional arguments leaving out named arguments.
11162
11163         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11164         type to the enum type is not allowed. Remove code corresponding to
11165         that.
11166
11167         (ConvertNumericExplicit): Allow explicit conversions from
11168         the underlying type to enum type. This precisely follows the spec
11169         and closes a bug filed by Gonzalo.
11170
11171 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11172
11173         * compiler.csproj:
11174         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11175
11176 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11177
11178         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11179         it was important that we stored the right value after the
11180         reduction in `converted'.
11181
11182 2002-09-04  Martin Baulig  <martin@gnome.org>
11183
11184         * location.cs (Location.SymbolDocument): Use full pathnames for the
11185         source files.
11186
11187 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11188
11189         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11190         of the expression resolve mechanism, because that will catch the
11191         SimpleName error failures.
11192
11193         (Conditional): If we can not resolve the
11194         expression, return, do not crash.
11195
11196 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11197
11198         * cs-tokenizer.cs:
11199         (location): display token name instead of its number.
11200
11201 2002-08-28  Martin Baulig  <martin@gnome.org>
11202
11203         * expression.cs (Binary.ResolveOperator): Don't silently return
11204         but return an error if an operator cannot be applied between two
11205         enum types.
11206
11207 2002-08-28  Martin Baulig  <martin@gnome.org>
11208
11209         * class.cs (Constructor.Define): Set the permission attributes
11210         correctly instead of making all constructors public.
11211
11212 2002-08-28  Martin Baulig  <martin@gnome.org>
11213
11214         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11215         for private members before reporting a CS0103; if we find anything,
11216         it's a CS0122.
11217
11218 2002-08-28  Martin Baulig  <martin@gnome.org>
11219
11220         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11221         to check whether `closure_start_type == closure_invocation_type',
11222         we also need to check whether `m.DeclaringType == closure_invocation_type'
11223         before bypassing the permission checks.  We might be accessing
11224         protected/private members from the base class.
11225         (TypeManager.RealMemberLookup): Only set private_ok if private
11226         members were requested via BindingFlags.NonPublic.
11227
11228         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11229
11230         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11231         MethodGroupExpr.IsExplicitImpl if appropriate.
11232         (Invocation.DoResolve): Don't report the CS0120 for explicit
11233         interface implementations.
11234
11235 2002-08-27  Martin Baulig  <martin@gnome.org>
11236
11237         * expression.cs (Invocation.DoResolve): If this is a static
11238         method and we don't have an InstanceExpression, we must report
11239         a CS0120.
11240
11241 2002-08-25  Martin Baulig  <martin@gnome.org>
11242
11243         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11244         `==' between a valuetype and an object.
11245
11246 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11247
11248         * ecore.cs (TypeExpr): Provide a ToString method.
11249
11250 2002-08-24  Martin Baulig  <martin@gnome.org>
11251
11252         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11253         now called proggie.dbg and it's a binary file.
11254
11255 2002-08-23  Martin Baulig  <martin@gnome.org>
11256
11257         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11258
11259 2002-08-23  Martin Baulig  <martin@gnome.org>
11260
11261         * struct.cs (MyStructInfo.ctor): Make this work with empty
11262         structs; it's not allowed to use foreach() on null.
11263
11264 2002-08-23  Martin Baulig  <martin@gnome.org>
11265
11266         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11267         writer the full pathname of the generated assembly.
11268
11269 2002-08-23  Martin Baulig  <martin@gnome.org>
11270
11271         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11272         A `finally' block never returns or breaks; improved handling of
11273         unreachable code.
11274
11275 2002-08-23  Martin Baulig  <martin@gnome.org>
11276
11277         * statement.cs (Throw.Resolve): Allow `throw null'.
11278
11279 2002-08-23  Martin Baulig  <martin@gnome.org>
11280
11281         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11282         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11283         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11284         MemberLookup would return a wrong event if this is an explicit
11285         interface implementation and the class has an event with the same
11286         name.
11287
11288 2002-08-23  Martin Baulig  <martin@gnome.org>
11289
11290         * statement.cs (Block.AddChildVariableNames): New public method.
11291         (Block.AddChildVariableName): Likewise.
11292         (Block.IsVariableNameUsedInChildBlock): Likewise.
11293         (Block.AddVariable): Check whether a variable name has already
11294         been used in a child block.
11295
11296         * cs-parser.jay (declare_local_variables): Mark all variable names
11297         from the current block as being used in a child block in the
11298         implicit block.
11299
11300 2002-08-23  Martin Baulig  <martin@gnome.org>
11301
11302         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11303         find the symbol writer.
11304
11305         * driver.cs: csc also allows the arguments to /define being
11306         separated by commas, not only by semicolons.
11307
11308 2002-08-23  Martin Baulig  <martin@gnome.org>
11309
11310         * interface.cs (Interface.GetMembers): Added static check for events.
11311
11312 2002-08-15  Martin Baulig  <martin@gnome.org>
11313
11314         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11315         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11316
11317         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11318         why the MethodData.EmitDestructor() change was necessary.
11319
11320 2002-08-20  Martin Baulig  <martin@gnome.org>
11321
11322         * class.cs (TypeContainer.FindMembers): Added static check for events.
11323
11324         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11325
11326         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11327         use Type.GetEvents(), not Type.FindMembers().
11328
11329 2002-08-20  Martin Baulig  <martin@gnome.org>
11330
11331         * decl.cs (MemberCache): Added a special method cache which will
11332         be used for method-only searched.  This ensures that a method
11333         search will return a MethodInfo with the correct ReflectedType for
11334         inherited methods.      
11335
11336 2002-08-20  Martin Baulig  <martin@gnome.org>
11337
11338         * decl.cs (DeclSpace.FindMembers): Made this public.
11339
11340 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11341
11342         * delegate.cs: fixed build on windows.
11343         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11344
11345 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11346
11347         * ecore.cs (StandardConversionExists): Return a false
11348         if we are trying to convert the void type to anything else
11349         since that is not allowed.
11350
11351         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11352         we flag error 70 in the event an event is trying to be accessed
11353         directly from outside the declaring type.
11354
11355 2002-08-20  Martin Baulig  <martin@gnome.org>
11356
11357         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11358         MemberCache from typemanager.cs to decl.cs.
11359
11360 2002-08-19  Martin Baulig  <martin@gnome.org>
11361
11362         * class.cs (TypeContainer): Implement IMemberContainer.
11363         (TypeContainer.DefineMembers): Create the MemberCache.
11364         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11365         return public members if BindingFlags.Public was given, check
11366         whether members are static.
11367
11368 2002-08-16  Martin Baulig  <martin@gnome.org>
11369
11370         * decl.cs (DeclSpace.Define): Splitted this in Define and
11371         DefineMembers.  DefineMembers is called first and initializes the
11372         MemberCache.
11373
11374         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11375         DefineMembers() on all our DeclSpaces.
11376
11377         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11378         but call DefineMembers() on all nested interfaces.  We call their
11379         Define() in our new Define() function.
11380
11381         * interface.cs (Interface): Implement IMemberContainer.
11382         (Interface.Define): Moved all code except the attribute stuf to
11383         DefineMembers().
11384         (Interface.DefineMembers): Initialize the member cache.
11385
11386         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11387         need this anymore since we can use MemberCache.FindMembers directly.
11388
11389 2002-08-19  Martin Baulig  <martin@gnome.org>
11390
11391         * typemanager.cs (MemberCache): When creating the cache for an
11392         interface type, add all inherited members.
11393         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11394         to `out bool used_cache' and documented it.
11395         (TypeManager.MemberLookup): If we already used the cache in the first
11396         iteration, we don't need to do the interfaces check.
11397
11398 2002-08-19  Martin Baulig  <martin@gnome.org>
11399
11400         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11401         here from IMemberFinder and don't implement this interface anymore.
11402         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11403
11404         * typemanager.cs (IMemberFinder): This interface is now only used by
11405         classes which actually support the member cache.
11406         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11407         since we only put DeclSpaces into this Hashtable.
11408         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11409         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11410
11411 2002-08-16  Martin Baulig  <martin@gnome.org>
11412
11413         * typemanager.cs (ICachingMemberFinder): Removed.
11414         (IMemberFinder.MemberCache): New property.
11415         (TypeManager.FindMembers): Merged this with RealFindMembers().
11416         This function will never be called from TypeManager.MemberLookup()
11417         so we can't use the cache here, just the IMemberFinder.
11418         (TypeManager.MemberLookup_FindMembers): Check whether the
11419         IMemberFinder has a MemberCache and call the cache's FindMembers
11420         function.
11421         (MemberCache): Rewrote larger parts of this yet another time and
11422         cleaned it up a bit.
11423
11424 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11425
11426         * driver.cs (LoadArgs): Support quoting.
11427
11428         (Usage): Show the CSC-like command line arguments.
11429
11430         Improved a few error messages.
11431
11432 2002-08-15  Martin Baulig  <martin@gnome.org>
11433
11434         * typemanager.cs (IMemberContainer.Type): New property.
11435         (IMemberContainer.IsInterface): New property.
11436
11437         The following changes are conditional to BROKEN_RUNTIME, which is
11438         defined at the top of the file.
11439
11440         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11441         class'es members, but add all members from TypeHandle.ObjectType
11442         if we're an interface.
11443         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11444         is the current type.
11445         (MemberCache.CacheEntry.Container): Removed this field.
11446         (TypeHandle.GetMembers): Include inherited members.
11447
11448 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11449
11450         * typemanager.cs: fixed compilation and added a comment on a field that
11451         is never used.
11452
11453 2002-08-15  Martin Baulig  <martin@gnome.org>
11454
11455         * class.cs (ConstructorInitializer.Resolve): In the
11456         Expression.MemberLookup call, use the queried_type as
11457         invocation_type.
11458
11459         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11460         declared' attribute, it's always true.
11461         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11462         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11463         temporary wrapper for FindMembers which tells MemberLookup whether
11464         members from the base classes are included in the return value.
11465         This will go away soon.
11466         (TypeManager.MemberLookup): Use this temporary hack here; once the
11467         new MemberCache is completed, we don't need to do the DeclaredOnly
11468         looping here anymore since the MemberCache will take care of this.
11469         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11470         (MemberCache): When creating the MemberCache for a class, get
11471         members from the current class and all its base classes.
11472         (MemberCache.CacheEntry.Container): New field.  This is a
11473         temporary hack until the Mono runtime is fixed to distinguish
11474         between ReflectedType and DeclaringType.  It allows us to use MCS
11475         with both the MS runtime and the unfixed Mono runtime without
11476         problems and without accecting performance.
11477         (MemberCache.SearchMembers): The DeclaredOnly looping from
11478         TypeManager.MemberLookup is now done here.      
11479
11480 2002-08-14  Martin Baulig  <martin@gnome.org>
11481
11482         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11483         Type.GetFields on dynamic types but get the fields from the
11484         corresponding TypeContainer.
11485         (MyStructInfo.GetStructInfo): Added check for enum types.
11486
11487         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11488         (MemberList.SyncRoot): Implemented.
11489         (TypeManager.FilterWithClosure): No need to check permissions if
11490         closure_start_type == closure_invocation_type, don't crash if
11491         closure_invocation_type is null.
11492
11493 2002-08-13  Martin Baulig  <martin@gnome.org>
11494
11495         Rewrote TypeContainer.FindMembers to use a member cache.  This
11496         gives us a speed increase of about 35% for the self-hosting MCS
11497         build and of about 15-20% for the class libs (both on GNU/Linux).
11498
11499         * report.cs (Timer): New class to get enhanced profiling.  This
11500         whole class is "TIMER" conditional since it remarkably slows down
11501         compilation speed.
11502
11503         * class.cs (MemberList): New class.  This is an IList wrapper
11504         which we're now using instead of passing MemberInfo[]'s around to
11505         avoid copying this array unnecessarily.
11506         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11507         (ICachingMemberFinder, IMemberContainer): New interface.
11508         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11509         has already been checked, otherwise use it for the name comparision.
11510         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11511         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11512         if possible.  Returns a MemberList, not a MemberInfo [].
11513         (TypeHandle): New class, implements IMemberContainer.  We create
11514         one instance of this class per type, it contains a MemberCache
11515         which is used to do the member lookups.
11516         (MemberCache): New class.  Each instance of this class contains
11517         all members of a type and a name-based hash table.
11518         (MemberCache.FindMembers): This is our new member lookup
11519         function.  First, it looks up all members of the requested name in
11520         the hash table.  Then, it walks this list and sorts out all
11521         applicable members and returns them.
11522
11523 2002-08-13  Martin Baulig  <martin@gnome.org>
11524
11525         In addition to a nice code cleanup, this gives us a performance
11526         increase of about 1.4% on GNU/Linux - not much, but it's already
11527         half a second for the self-hosting MCS compilation.
11528
11529         * typemanager.cs (IMemberFinder): New interface.  It is used by
11530         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11531         Enum, Delegate or Interface.
11532         (TypeManager.finder_to_member_finder): New PtrHashtable.
11533         (TypeManager.finder_to_container): Removed.
11534         (TypeManager.finder_to_delegate): Removed.
11535         (TypeManager.finder_to_interface): Removed.
11536         (TypeManager.finder_to_enum): Removed.
11537
11538         * interface.cs (Interface): Implement IMemberFinder.
11539
11540         * delegate.cs (Delegate): Implement IMemberFinder.
11541
11542         * enum.cs (Enum): Implement IMemberFinder.
11543
11544         * class.cs (TypeContainer): Implement IMemberFinder.
11545
11546 2002-08-12  Martin Baulig  <martin@gnome.org>
11547
11548         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11549
11550 2002-08-12  Martin Baulig  <martin@gnome.org>
11551
11552         * ecore.cs (ITypeExpression): New interface for expressions which
11553         resolve to a type.
11554         (TypeExpression): Renamed to TypeLookupExpression.
11555         (Expression.DoResolve): If we're doing a types-only lookup, the
11556         expression must implement the ITypeExpression interface and we
11557         call DoResolveType() on it.
11558         (SimpleName): Implement the new ITypeExpression interface.
11559         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11560         hack, the situation that we're only looking up types can't happen
11561         anymore when this method is called.  Moved the type lookup code to
11562         DoResolveType() and call it.
11563         (SimpleName.DoResolveType): This ITypeExpression interface method
11564         is now doing the types-only lookup.
11565         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11566         (ResolveFlags): Added MaskExprClass.
11567
11568         * expression.cs (MemberAccess): Implement the ITypeExpression
11569         interface.
11570         (MemberAccess.DoResolve): Added support for a types-only lookup
11571         when we're called via ITypeExpression.DoResolveType().
11572         (ComposedCast): Implement the ITypeExpression interface.
11573
11574         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11575         Expression.Resolve() with ResolveFlags.Type instead.
11576
11577 2002-08-12  Martin Baulig  <martin@gnome.org>
11578
11579         * interface.cs (Interface.Define): Apply attributes.
11580
11581         * attribute.cs (Attribute.ApplyAttributes): Added support for
11582         interface attributes.
11583
11584 2002-08-11  Martin Baulig  <martin@gnome.org>
11585
11586         * statement.cs (Block.Emit): Only check the "this" variable if we
11587         do not always throw an exception.
11588
11589         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11590         whether the property has a set accessor.
11591
11592 2002-08-11  Martin Baulig  <martin@gnome.org>
11593
11594         Added control flow analysis support for structs.
11595
11596         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11597         with control flow analysis turned off.
11598         (IVariable): New interface.
11599         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11600         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11601         (FieldExpr.DoResolve): Resolve the instance expression with flow
11602         analysis turned off and do the definite assignment check after the
11603         resolving when we know what the expression will resolve to.
11604
11605         * expression.cs (LocalVariableReference, ParameterReference):
11606         Implement the new IVariable interface, only call the flow analysis
11607         code if ec.DoFlowAnalysis is true.
11608         (This): Added constructor which takes a Block argument.  Implement
11609         the new IVariable interface.
11610         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11611         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11612         This does the definite assignment checks for struct members.
11613
11614         * class.cs (Constructor.Emit): If this is a non-static `struct'
11615         constructor which doesn't have any initializer, call
11616         Block.AddThisVariable() to tell the flow analysis code that all
11617         struct elements must be initialized before control returns from
11618         the constructor.
11619
11620         * statement.cs (MyStructInfo): New public class.
11621         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11622         argument to this indexer.  If non-zero, check an individual struct
11623         member, not the whole struct.
11624         (FlowBranching.CheckOutParameters): Check struct members.
11625         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11626         overloaded versions of these methods which take an additional
11627         `int field_idx' argument to check struct members.
11628         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11629         overloaded versions of these methods which take an additional
11630         `string field_name' argument to check struct member.s
11631         (VariableInfo): Implement the IVariable interface.
11632         (VariableInfo.StructInfo): New public property.  Returns the
11633         MyStructInfo instance of the variable if it's a struct or null.
11634         (Block.AddThisVariable): New public method.  This is called from
11635         Constructor.Emit() for non-static `struct' constructor which do
11636         not have any initializer.  It creates a special variable for the
11637         "this" instance variable which will be checked by the flow
11638         analysis code to ensure that all of the struct's fields are
11639         initialized before control returns from the constructor.
11640         (UsageVector): Added support for struct members.  If a
11641         variable/parameter is a struct with N members, we reserve a slot
11642         in the usage vector for each member.  A struct is considered fully
11643         initialized if either the struct itself (slot 0) or all its
11644         members are initialized.
11645
11646 2002-08-08  Martin Baulig  <martin@gnome.org>
11647
11648         * driver.cs (Driver.MainDriver): Only report an error CS5001
11649         if there were no compilation errors.
11650
11651         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11652         `UnsafeContext' property to determine whether the parent is in
11653         unsafe context rather than checking the parent's ModFlags:
11654         classes nested in an unsafe class are unsafe as well.
11655
11656 2002-08-08  Martin Baulig  <martin@gnome.org>
11657
11658         * statement.cs (UsageVector.MergeChildren): Distinguish between
11659         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11660         we return.  Added test17() and test18() to test-154.cs.
11661
11662 2002-08-08  Martin Baulig  <martin@gnome.org>
11663
11664         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11665         Family access, make sure the invoking type isn't a subclass of the
11666         queried type (that'd be a CS1540).
11667
11668         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11669         this method which takes an additional `Type invocation_type'.
11670
11671         * expression.cs (BaseAccess.DoResolve): Use the base type as
11672         invocation and query type.
11673         (MemberAccess.DoResolve): If the lookup failed and we're about to
11674         report a CS0122, try a lookup with the ec.ContainerType - if this
11675         succeeds, we must report a CS1540.
11676
11677 2002-08-08  Martin Baulig  <martin@gnome.org>
11678
11679         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11680         (MethodGroupExpr): Implement the IMemberExpr interface.
11681
11682         * expression (MemberAccess.ResolveMemberAccess): No need to have
11683         any special code for MethodGroupExprs anymore, they're now
11684         IMemberExprs.   
11685
11686 2002-08-08  Martin Baulig  <martin@gnome.org>
11687
11688         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11689         Family, FamANDAssem and FamORAssem permissions.
11690         (TypeManager.IsSubclassOrNestedChildOf): New public method.
11691
11692 2002-08-08  Martin Baulig  <martin@gnome.org>
11693
11694         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11695         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11696         or loop block.
11697
11698 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11699
11700         * driver.cs: implemented /resource option to embed managed resources.
11701
11702 2002-08-07  Martin Baulig  <martin@gnome.org>
11703
11704         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11705         (FieldBase.HasFieldInitializer): New public property.
11706         (FieldBase.GetInitializerExpression): New public method.  Resolves and
11707         returns the field initializer and makes sure it is only resolved once.
11708         (TypeContainer.EmitFieldInitializers): Call
11709         FieldBase.GetInitializerExpression to get the initializer, this ensures
11710         that it isn't resolved multiple times.
11711
11712         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
11713         the resolving process (SimpleName/MemberLookup) that we're currently
11714         emitting a field initializer (which must not access any instance members,
11715         this is an error CS0236).
11716
11717         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11718         argument, if the `IsFieldInitializer' flag is set, we must report and
11719         error CS0236 and not an error CS0120.   
11720
11721 2002-08-07  Martin Baulig  <martin@gnome.org>
11722
11723         * ecore.cs (IMemberExpr): New public interface.
11724         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11725         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11726         if the expression is an IMemberExpr.
11727
11728         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11729         to be null, implicitly default to `this' if we're non-static in
11730         this case.  Simplified the code a lot by using the new IMemberExpr
11731         interface.  Also fixed bug #28176 here.
11732
11733 2002-08-06  Martin Baulig  <martin@gnome.org>
11734
11735         * cs-parser.jay (SimpleLookup): Removed.  We need to create
11736         ParameterReferences during semantic analysis so that we can do a
11737         type-only search when resolving Cast, TypeOf and SizeOf.
11738         (block): Pass the `current_local_parameters' to the Block's
11739         constructor.
11740
11741         * class.cs (ConstructorInitializer): Added `Parameters parameters'
11742         argument to the constructor.
11743         (ConstructorInitializer.Resolve): Create a temporary implicit
11744         block with the parameters.
11745
11746         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11747         references here if we aren't doing a type-only search.
11748
11749         * statement.cs (Block): Added constructor which takes a
11750         `Parameters parameters' argument.
11751         (Block.Parameters): New public property.
11752
11753         * support.cs (InternalParameters.Parameters): Renamed `parameters'
11754         to `Parameters' and made it public readonly.
11755
11756 2002-08-06  Martin Baulig  <martin@gnome.org>
11757
11758         * ecore.cs (Expression.Warning): Made this public as well.
11759
11760         * report.cs (Report.Debug): Print the contents of collections.
11761
11762 2002-08-06  Martin Baulig  <martin@gnome.org>
11763
11764         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
11765         used to tell Resolve() which kinds of expressions it may return.
11766         (Expression.Resolve): Added overloaded version of this method which
11767         takes a `ResolveFlags flags' argument.  This can be used to tell
11768         Resolve() which kinds of expressions it may return.  Reports a
11769         CS0118 on error.
11770         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11771         ResolveFlags.SimpleName.
11772         (Expression.Error118): Added overloaded version of this method which
11773         takes a `ResolveFlags flags' argument.  It uses the flags to determine
11774         which kinds of expressions are allowed.
11775
11776         * expression.cs (Argument.ResolveMethodGroup): New public method.
11777         Resolves an argument, but allows a MethodGroup to be returned.
11778         This is used when invoking a delegate.
11779
11780         * TODO: Updated a bit.
11781
11782 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11783
11784         Fixed compilation with csc.
11785
11786         * ecore.cs: Expression.Error made public. Is this correct? Should
11787         Warning be made public too?
11788
11789         * expression.cs: use ea.Location instead of ea.loc.
11790         [FIXME:  Filed as bug #28607: MCS must report these errors.]
11791
11792 2002-08-06  Martin Baulig  <martin@gnome.org>
11793
11794         * ecore.cs (Expression.loc): Moved the location here instead of
11795         duplicating it in all derived classes.
11796         (Expression.Location): New public property.
11797         (Expression.Error, Expression.Warning): Made them non-static and
11798         removed the location argument.
11799         (Expression.Warning): Added overloaded version which takes an
11800         `int level' argument.
11801         (Expression.Error118): Make this non-static and removed the
11802         expression and location arguments.
11803         (TypeExpr): Added location argument to the constructor.
11804
11805         * expression.cs (StaticCallExpr): Added location argument to
11806         the constructor.
11807         (Indirection, PointerArithmetic): Likewise.
11808         (CheckedExpr, UnCheckedExpr): Likewise.
11809         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11810         (StringPtr): Likewise.
11811
11812
11813 2002-08-05  Martin Baulig  <martin@gnome.org>
11814
11815         * expression.cs (BaseAccess.DoResolve): Actually report errors.
11816
11817         * assign.cs (Assign.DoResolve): Check whether the source
11818         expression is a value or variable.
11819
11820         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11821         while resolving the corresponding blocks.
11822
11823         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11824         an error, don't silently return null.
11825
11826         * statement.cs (Block.AddVariable): Do the error reporting here
11827         and distinguish between CS0128 and CS0136.
11828         (Block.DoResolve): Report all unused labels (warning CS0164).
11829         (LabeledStatement): Pass the location to the constructor.
11830         (LabeledStatement.HasBeenReferenced): New property.
11831         (LabeledStatement.Resolve): Set it to true here.
11832
11833         * statement.cs (Return.Emit): Return success even after reporting
11834         a type mismatch error (CS0126 or CS0127), this is what csc does and
11835         it avoids confusing the users with any consecutive errors.
11836
11837 2002-08-05  Martin Baulig  <martin@gnome.org>
11838
11839         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11840
11841         * const.cs (Const.LookupConstantValue): Catch circular definitions.
11842
11843         * expression.cs (MemberAccess.DoResolve): Silently return if an
11844         error has already been reported.
11845
11846         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11847         error has already been reported.
11848
11849 2002-08-05  Martin Baulig  <martin@gnome.org>
11850
11851         * statement.cs (UsageVector): Only initialize the `parameters'
11852         vector if we actually have any "out" parameters.
11853
11854 2002-08-05  Martin Baulig  <martin@gnome.org>
11855
11856         * expression.cs (Binary.ResolveOperator): When combining delegates,
11857         they must have the same type.
11858
11859 2002-08-05  Martin Baulig  <martin@gnome.org>
11860
11861         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11862         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11863         work with the ms runtime and we also don't need it: if we're a
11864         PropertyBuilder and not in the `indexer_arguments' hash, then we
11865         are a property and not an indexer.
11866
11867         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11868         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11869         since the latter one doesn't work with the ms runtime.
11870
11871 2002-08-03  Martin Baulig  <martin@gnome.org>
11872
11873         Fixed bugs #27998 and #22735.
11874
11875         * class.cs (Method.IsOperator): New public field.
11876         (Method.CheckBase): Report CS0111 if there's already a method
11877         with the same parameters in the current class.  Report CS0508 when
11878         attempting to change the return type of an inherited method.
11879         (MethodData.Emit): Report CS0179 if a method doesn't have a body
11880         and it's not marked abstract or extern.
11881         (PropertyBase): New abstract base class for Property and Indexer.
11882         (PropertyBase.CheckBase): Moved here from Property and made it work
11883         for indexers.
11884         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11885         the same so we can reuse it there.
11886         (Property, Indexer): Derive from PropertyBase.
11887         (MethodSignature.inheritable_property_signature_filter): New delegate
11888         to find properties and indexers.
11889
11890         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11891         argument and improved error reporting.
11892
11893         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11894         EmptyReadOnlyParameters and made it a property.
11895
11896         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11897         version of this method which takes a `PropertyInfo indexer'.
11898         (TypeManager.RegisterIndexer): New method.
11899
11900         * class.cs: Added myself as author of this file :-)
11901
11902 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11903
11904         * class.cs: fixed compilation on windoze.
11905
11906 2002-08-03  Martin Baulig  <martin@gnome.org>
11907
11908         * interface.cs (Interface.GetInterfaceBases): Check whether all
11909         base interfaces are at least as accessible than the current one.
11910
11911         * class.cs (TypeContainer.GetClassBases): Check whether base types
11912         are at least as accessible than the current type.
11913         (TypeContainer.AsAccessible): Implemented and made non-static.
11914         (MemberBase.CheckParameters): Report errors if the accessibility
11915         checks fail.
11916
11917         * delegate.cs (Delegate.Delegate): The default visibility is
11918         internal for top-level types and private for nested types.
11919         (Delegate.Define): Report errors if the accessibility checks fail.
11920
11921         * enum.cs (Enum.Enum): The default visibility is internal for
11922         top-level types and private for nested types.
11923         (Enum.DefineType): Compute the correct visibility.
11924
11925         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11926         function which takes a `bool is_toplevel' instead of a TypeContainer.
11927
11928         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11929         builtin type.
11930
11931 2002-08-02  Martin Baulig  <martin@gnome.org>
11932
11933         * expression.cs (LocalVariableReferenc): Added constructor which
11934         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11935         (LocalVariableReference.IsReadOnly): New property.
11936         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
11937         variable is readonly, use our own readonly flag to do this; you can
11938         use the new constructor to get a writable reference to a read-only
11939         variable.
11940
11941         * cs-parser.jay (foreach_statement, using_statement): Get a writable
11942         reference to the local variable.
11943
11944 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
11945
11946         * rootcontext.cs (ResolveCore): Also include System.Exception
11947
11948         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
11949         we reach an EmptyStatement.
11950
11951         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
11952         is also fine.
11953
11954         * expression.cs (Binary.ResolveOperator): Check error result in
11955         two places.
11956
11957         use brtrue/brfalse directly and avoid compares to null.
11958
11959 2002-08-02  Martin Baulig  <martin@gnome.org>
11960
11961         * class.cs (TypeContainer.Define): Define all nested interfaces here.
11962         Fixes bug #28407, added test-155.cs.
11963
11964 2002-08-01  Martin Baulig  <martin@gnome.org>
11965
11966         * class.cs (Event.EmitDefaultMethod): Make this work with static
11967         events.  Fixes #28311, added verify-3.cs.
11968
11969 2002-08-01  Martin Baulig  <martin@gnome.org>
11970
11971         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
11972         `is_disposable' fields.
11973         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
11974         `hm.is_disposable' if we're using the collection pattern.
11975         (Foreach.EmitCollectionForeach): Use the correct type for the
11976         enumerator's local variable, only emit the try/finally block if
11977         necessary (fixes #27713).
11978
11979 2002-08-01  Martin Baulig  <martin@gnome.org>
11980
11981         * ecore.cs (Expression.report118): Renamed to Error118 and made
11982         it public static.
11983
11984         * statement.cs (Throw.Resolve): Check whether the expression is of
11985         the correct type (CS0118) and whether the type derives from
11986         System.Exception (CS0155).
11987         (Catch.Resolve): New method.  Do the type lookup here and check
11988         whether it derives from System.Exception (CS0155).
11989         (Catch.CatchType, Catch.IsGeneral): New public properties.
11990
11991         * typemanager.cs (TypeManager.exception_type): Added.
11992
11993 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
11994
11995         * driver.cs: Updated About function.
11996
11997 2002-07-31  Martin Baulig  <martin@gnome.org>
11998
11999         Implemented Control Flow Analysis.
12000
12001         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12002         (EmitContext.CurrentBranching): Added.
12003         (EmitContext.StartFlowBranching): Added.
12004         (EmitContext.EndFlowBranching): Added.
12005         (EmitContext.KillFlowBranching): Added.
12006         (EmitContext.IsVariableAssigned): Added.
12007         (EmitContext.SetVariableAssigned): Added.
12008         (EmitContext.IsParameterAssigned): Added.
12009         (EmitContext.SetParameterAssigned): Added.
12010         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12011         Added control flow analysis stuff here.
12012
12013         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12014         resolve the expression as lvalue.
12015         (LocalVariableReference.DoResolve): Check whether the variable has
12016         already been assigned.
12017         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12018         the parameter as assigned here.
12019         (ParameterReference.DoResolve): Check whether the parameter has already
12020         been assigned.
12021         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12022         expression as lvalue.
12023
12024         * statement.cs (FlowBranching): New class for the flow analysis code.
12025         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12026         (LabeledStatement.IsDefined): New public property.
12027         (LabeledStatement.AddUsageVector): New public method to tell flow
12028         analyis that the label may be reached via a forward jump.
12029         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12030         flow analysis.
12031         (VariableInfo.Number): New public field.  This is used by flow analysis
12032         to number all locals of a block.
12033         (Block.CountVariables): New public property.  This is the number of
12034         local variables in this block (including the locals from all parent
12035         blocks).
12036         (Block.EmitMeta): Number all the variables.
12037
12038         * statement.cs: Added flow analysis support to all classes.
12039
12040 2002-07-31  Martin Baulig  <martin@gnome.org>
12041
12042         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12043         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12044         then use this argument.
12045
12046         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12047
12048         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12049         use this to specify /define options.
12050
12051 2002-07-29  Martin Baulig  <martin@gnome.org>
12052
12053         * statement.cs (Fixed): Moved all code that does variable lookups
12054         and resolvings from Emit to Resolve.
12055
12056         * statement.cs (For): Moved all code that does variable lookups
12057         and resolvings from Emit to Resolve.
12058
12059         * statement.cs (Using): Moved all code that does variable lookups
12060         and resolvings from Emit to Resolve.
12061
12062 2002-07-29  Martin Baulig  <martin@gnome.org>
12063
12064         * attribute.cs (Attribute.Resolve): Explicitly catch a
12065         System.NullReferenceException when creating the
12066         CustromAttributeBuilder and report a different warning message.
12067
12068 2002-07-29  Martin Baulig  <martin@gnome.org>
12069
12070         * support.cs (ParameterData.ParameterName): Added method to
12071         get the name of a parameter.
12072
12073         * typemanager.cs (TypeManager.IsValueType): New public method.
12074
12075 2002-07-29  Martin Baulig  <martin@gnome.org>
12076
12077         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12078         is a flag which specifies that it's either ref or out.
12079         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12080         the out parameter to `out Parameter.Modifier mod', also set the
12081         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12082
12083         * support.cs (InternalParameters.ParameterModifier): Distinguish
12084         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12085         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12086
12087         * expression.cs (Argument.GetParameterModifier): Distinguish
12088         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12089         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12090
12091 2002-07-29  Martin Baulig  <martin@gnome.org>
12092
12093         * expression.cs (ParameterReference.ParameterReference): Added
12094         `Location loc' argument to the constructor.
12095
12096         * cs-parser.jay: Pass location to ParameterReference.
12097
12098 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12099
12100         * statement.cs (Try): Initialize the location.
12101
12102         * cs-parser.jay: pass location to Try.
12103
12104         * expression.cs (Unary.Reduce): Change the prototype to return
12105         whether a constant fold could be performed or not.  The result is
12106         returned in an out parameters.  In the case of Indirection and
12107         AddressOf, we want to perform the full tests.
12108
12109 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12110
12111         * statement.cs (Statement.Emit): Flag dead code.
12112
12113 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12114
12115         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12116
12117 2002-07-27  Martin Baulig  <martin@gnome.org>
12118
12119         * class.cs (MethodData.Define): Put back call to
12120         TypeManager.AddMethod(), accidentally commented this out.
12121
12122         * report.cs (Debug): New public method to print debugging information,
12123         this is `[Conditional ("DEBUG")]'.
12124
12125 2002-07-26  Martin Baulig  <martin@gnome.org>
12126
12127         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12128         (switch_statement): Push the current_block to the switch_stack and
12129         pop it again when we're done with the switch.
12130         (switch_section): The new block is a child of the current_block.
12131         Fixes bug #24007, added test-152.cs.
12132
12133 2002-07-27  Martin Baulig  <martin@gnome.org>
12134
12135         * expression.cs (Invocation.EmitArguments): When calling a varargs
12136         function with only its fixed arguments, we need to pass an empty
12137         array.
12138
12139 2002-07-27  Martin Baulig  <martin@gnome.org>
12140
12141         Mono 0.13 has been released.
12142
12143 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12144
12145         * driver.cs: Rename --resource to --linkres, because that is what
12146         we do currently, we dont support --resource yet.
12147
12148         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12149
12150 2002-07-25  Martin Baulig  <martin@gnome.org>
12151
12152         * class.cs (MethodData): New public class.  This is a `method builder'
12153         class for a method or one accessor of a Property/Indexer/Event.
12154         (MethodData.GetMethodFlags): Moved here from MemberBase.
12155         (MethodData.ApplyAttributes): Likewise.
12156         (MethodData.ApplyObsoleteAttribute): Likewise.
12157         (MethodData.ApplyConditionalAttribute): Likewise.
12158         (MethodData.ApplyDllImportAttribute): Likewise.
12159         (MethodData.CheckAbstractAndExternal): Likewise.
12160         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12161         (MethodData.Emit): Formerly known as Method.Emit().
12162         (MemberBase): Moved everything which was specific to a single
12163         accessor/method to MethodData.
12164         (Method): Create a new MethodData and call Define() and Emit() on it.
12165         (Property, Indexer, Event): Create a new MethodData objects for each
12166         accessor and call Define() and Emit() on them.
12167
12168 2002-07-25  Martin Baulig  <martin@gnome.org>
12169
12170         Made MethodCore derive from MemberBase to reuse the code from there.
12171         MemberBase now also checks for attributes.
12172
12173         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12174         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12175         as virtual.
12176         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12177         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12178         (MemberBase.ApplyAttributes): New virtual method; applies the
12179         attributes to a method or accessor.
12180         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12181         (MemberBase.ApplyConditionalAttribute): Likewise.
12182         (MemberBase.ApplyDllImportAttribute): Likewise.
12183         (MemberBase.CheckAbstractAndExternal): Likewise.
12184         (MethodCore.ParameterTypes): This is now a property instead of a
12185         method, it's initialized from DoDefineParameters().
12186         (MethodCore.ParameterInfo): Removed the set accessor.
12187         (MethodCore.DoDefineParameters): New protected virtual method to
12188         initialize ParameterTypes and ParameterInfo.
12189         (Method.GetReturnType): We can now simply return the MemberType.
12190         (Method.GetMethodFlags): Override the MemberBase version and add
12191         the conditional flags.
12192         (Method.CheckBase): Moved some code from Define() here, call
12193         DoDefineParameters() here.
12194         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12195         here to avoid some larger code duplication.
12196         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12197         ensure that abstract and external accessors don't declare a body.
12198
12199         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12200         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12201         lookup in the attribute's parent classes, so we need to abort as soon
12202         as we found the first match.
12203         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12204         the attribute has no arguments.
12205
12206         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12207         of a Method.
12208
12209 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12210
12211         * cs-parser.jay: reverted previous patch.
12212
12213 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12214
12215         * cs-parser.jay: fixed bug #22119.
12216
12217 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12218
12219         * attribute.cs: fixed compilation. The error was:
12220         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12221         be assigned to before control leaves the current method."
12222         [FIXME:  Filed as bug #28186: MCS must report this error.]
12223
12224 2002-07-25  Martin Baulig  <martin@gnome.org>
12225
12226         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12227         method to pull the condition name ouf of a Conditional attribute.
12228         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12229         the obsolete message and error flag out of an Obsolete attribute.
12230
12231         * class.cs (Method.GetMethodFlags): New public method to get the
12232         TypeManager.MethodFlags for this method.
12233         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12234         private methods.
12235         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12236         if we're overriding a virtual function, set the new private variable
12237         `parent_method'; call the new TypeManager.AddMethod().
12238
12239         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12240         the MethodBuilder and the Method in a PtrHashtable.
12241         (TypeManager.builder_to_method): Added for this purpose.
12242         (TypeManager.MethodFlags): Added IsObsoleteError.
12243         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12244         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12245         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12246         the message from the attribute.
12247
12248 2002-07-24  Martin Baulig  <martin@gnome.org>
12249
12250         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12251         preprocessor directives, ensure that the argument to #define/#undef is
12252         exactly one identifier and that it's actually an identifier.
12253
12254         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12255         did not work ....
12256
12257 2002-07-24  Martin Baulig  <martin@gnome.org>
12258
12259         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12260         initialize it to TypeManager.object_type in the constructor.
12261         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12262         of the `hm.get_current' method if we're using the collection pattern.
12263         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12264         for the explicit conversion to make it work when we're using the collection
12265         pattern and the `Current' property has a different return type than `object'.
12266         Fixes #27713.
12267
12268 2002-07-24  Martin Baulig  <martin@gnome.org>
12269
12270         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12271         does not match, but don't report any errors.  This method is called in
12272         order for all methods in a MethodGroupExpr until a matching method is
12273         found, so we don't want to bail out if the first method doesn't match.
12274         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12275         matches, report the 123.  Fixes #28070.
12276
12277 2002-07-24  Martin Baulig  <martin@gnome.org>
12278
12279         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12280         TypeManager.TypeToCoreType() to the top of the method so the
12281         following equality checks will work.  Fixes #28107.
12282
12283 2002-07-24  Martin Baulig  <martin@gnome.org>
12284
12285         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12286         operand is of type uint, and the other operand is of type sbyte,
12287         short or int, the operands are converted to type long." -
12288         Actually do what this comment already told us.  Fixes bug #28106,
12289         added test-150.cs.
12290
12291 2002-07-24  Martin Baulig  <martin@gnome.org>
12292
12293         * class.cs (MethodBase): New abstract class.  This is now a base
12294         class for Property, Indexer and Event to avoid some code duplication
12295         in their Define() and DefineMethods() methods.
12296         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12297         generic methods for Define() and DefineMethods().
12298         (FieldBase): Derive from MemberBase, not MemberCore.
12299         (Property): Derive from MemberBase, not MemberCore.
12300         (Property.DefineMethod): Moved all the code from this method to the
12301         new MethodBase.DefineAccessor(), just call it with appropriate
12302         argumetnts.
12303         (Property.Define): Call the new Property.DoDefine(), this does some
12304         sanity checks and we don't need to duplicate the code everywhere.
12305         (Event): Derive from MemberBase, not MemberCore.
12306         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12307         accessors, this will also make them work with interface events.
12308         (Indexer): Derive from MemberBase, not MemberCore.
12309         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12310         (Indexer.Define): Use the new MethodBase functions.
12311
12312         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12313         argument to the constructor.
12314         (Interface.FindMembers): Added support for interface events.
12315         (Interface.PopluateEvent): Implemented.
12316
12317         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12318
12319 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12320
12321         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12322         but this is required to check for a method name being the same as
12323         the containing class.  
12324
12325         Handle this now.
12326
12327 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12328
12329         * interface.cs: initialize variable.
12330
12331 2002-07-23  Martin Baulig  <martin@gnome.org>
12332
12333         Implemented the IndexerName attribute in interfaces.
12334
12335         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12336         name if this is an explicit interface implementation.
12337         (Indexer.InterfaceIndexerName): New public variable.  If we're
12338         implementing an interface indexer, this is the IndexerName in that
12339         interface.  Otherwise, it's the IndexerName.
12340         (Indexer.DefineMethod): If we're implementing interface indexer,
12341         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12342         and Pending.ImplementIndexer methods.
12343         (Indexer.Define): Also define the PropertyBuilder if we're
12344         implementing an interface indexer and this is neither an explicit
12345         interface implementation nor do the IndexerName match the one in
12346         the interface.
12347
12348         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12349         If a method is defined here, then we always need to create a proxy
12350         for it.  This is used when implementing interface indexers.
12351         (Pending.IsInterfaceIndexer): New public method.
12352         (Pending.ImplementIndexer): New public method.
12353         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12354         This is used when implementing interface indexers to define a proxy
12355         if necessary.
12356         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12357         define a proxy if necessary.
12358
12359         * interface.cs (Interface.IndexerName): New public variable.
12360         (Interface.PopulateIndexer): Set the IndexerName.
12361         (Interface.DefineIndexers): New private method.  Populate all the
12362         indexers and make sure their IndexerNames match.
12363
12364         * typemanager.cs (IndexerPropertyName): Added support for interface
12365         indexers.
12366
12367 2002-07-22  Martin Baulig  <martin@gnome.org>
12368
12369         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12370         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12371         ret if HasReturnLabel.
12372         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12373         variables.
12374
12375         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12376         and set the ec.LoopBeginTryCatchLevel.
12377         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12378         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12379         the current ec.TryCatchLevel, the branch goes out of an exception
12380         block.  In this case, we need to use Leave and not Br.
12381
12382 2002-07-22  Martin Baulig  <martin@gnome.org>
12383
12384         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12385         block unless the block does not always return or it is contained in
12386         another try { ... } catch { ... } block.  Fixes bug #26506.
12387         Added verify-1.cs to the test suite.
12388
12389 2002-07-22  Martin Baulig  <martin@gnome.org>
12390
12391         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12392         then we do not always return.  Fixes bug #24985.
12393
12394 2002-07-22  Martin Baulig  <martin@gnome.org>
12395
12396         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12397         lookup on a per-class level; ie. walk up the class hierarchy until we
12398         found at least one applicable method, then choose the best among them.
12399         Fixes bug #24463 and test-29.cs.
12400
12401 2002-07-22  Martin Baulig  <martin@gnome.org>
12402
12403         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12404         return types of the methods.  The return type is not part of the
12405         signature and we must not check it to make the `new' modifier work.
12406         Fixes bug #27999, also added test-147.cs.
12407         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12408
12409         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12410         on the method's return type.
12411
12412 2002-07-21  Martin Baulig  <martin@gnome.org>
12413
12414         * assign.cs: Make this work if the rightmost source is a constant and
12415         we need to do an implicit type conversion.  Also adding a few more tests
12416         to test-38.cs which should have caught this.
12417
12418         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12419         target in the makefile for this.  The makefile.gnu is primarily intended
12420         for end-users who don't want to debug the compiler.
12421
12422 2002-07-21  Martin Baulig  <martin@gnome.org>
12423
12424         * assign.cs: Improved the Assign class so it can now handle embedded
12425         assignments (X = Y = Z = something).  As a side-effect this'll now also
12426         consume less local variables.  test-38.cs now passes with MCS, added
12427         a few new test cases to that test.
12428
12429 2002-07-20  Martin Baulig  <martin@gnome.org>
12430
12431         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12432         instructions.  Fixes bug #27977, also added test-146.cs.
12433
12434 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12435
12436         * cs-tokenizer.cs: fixed getHex ().
12437
12438 2002-07-19  Martin Baulig  <martin@gnome.org>
12439
12440         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12441         not Type.GetType() to lookup the array type.  This is needed when
12442         we're constructing an array of a user-defined type.
12443         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12444         single-dimensional arrays, but also for single-dimensial arrays of
12445         type decimal.
12446
12447 2002-07-19  Martin Baulig  <martin@gnome.org>
12448
12449         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12450         this function is called, it's not allowed to share LocalBuilders
12451         among ILGenerators.
12452
12453 2002-07-19  Martin Baulig  <martin@gnome.org>
12454
12455         * expression.cs (Argument.Resolve): Report an error 118 when trying
12456         to pass a type as argument.
12457
12458 2002-07-18  Martin Baulig  <martin@gnome.org>
12459
12460         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12461         Conv_R_Un for the signed `long' type.
12462
12463 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12464
12465         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12466         `expr' for the temporary result, as that will fail if we do
12467         multiple resolves on the same expression.
12468
12469 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12470
12471         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12472         ec.TypeContainer for looking up aliases. 
12473
12474         * class.cs (TypeContainer): Remove LookupAlias from here.
12475
12476         * decl.cs (DeclSpace); Move here.
12477
12478 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12479
12480         * class.cs (FindMembers): Only call filter if the constructor
12481         bulider is not null.
12482
12483         Also handle delegates in `NestedTypes' now.  Now we will perform
12484         type lookups using the standard resolution process.  This also
12485         fixes a bug.
12486
12487         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12488         This uses Expressions (the limited kind that can be parsed by the
12489         tree) instead of strings.
12490
12491         * expression.cs (ComposedCast.ToString): Implement, used to flag
12492         errors since now we have to render expressions.
12493
12494         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12495         FormArrayType. 
12496
12497         * ecore.cs (SimpleName.ToString): ditto.
12498
12499         * cs-parser.jay: Instead of using strings to assemble types, use
12500         Expressions to assemble the type (using SimpleName, ComposedCast,
12501         MemberAccess).  This should fix the type lookups in declarations,
12502         because we were using a different code path for this.
12503
12504         * statement.cs (Block.Resolve): Continue processing statements
12505         even when there is an error.
12506
12507 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12508
12509         * class.cs (Event.Define): Also remove the `remove' method from
12510         the list of pending items.
12511
12512         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12513         generate more compact code. 
12514
12515 2002-07-17  Martin Baulig  <martin@gnome.org>
12516
12517         * const.cs (Const.LookupConstantValue): Add support for constant
12518         `unchecked' and `checked' expressions.
12519         Also adding test case test-140.cs for this.
12520
12521 2002-07-17  Martin Baulig  <martin@gnome.org>
12522
12523         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12524         check whether mi.ReturnType implements the IEnumerator interface; the
12525         `==' and the IsAssignableFrom() will fail in this situation.
12526
12527 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12528
12529         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12530         here too.
12531
12532 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12533
12534         * expression.cs: fixed bug #27811.
12535
12536 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12537
12538         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12539         Molaro: when we are a ref, the value already contains a pointer
12540         value, do not take the address of it.
12541
12542 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12543         * removed mb-parser.jay and mb-tokenizer.cs
12544
12545 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12546
12547         * expression.cs: check against the building corlib void type.
12548
12549 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12550
12551         * ecore.cs: fix for valuetype static readonly fields: when 
12552         initializing them, we need their address, not the address of a copy.
12553
12554 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12555
12556         * typemanager.cs: register also enum_type in corlib.
12557
12558 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12559
12560         * class.cs: allow calling this (but not base) initializers in structs.
12561
12562 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12563
12564         * ecore.cs: make sure we compare against the building base types
12565         in GetTypeSize ().
12566
12567 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12568
12569         * typemanager.cs: fix TypeToCoreType() to handle void and object
12570         (corlib gets no more typerefs after this change).
12571
12572 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12573
12574         * expression.cs (ArrayCreation.EmitArrayArguments): use
12575         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12576
12577         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12578         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12579         array indexes, the runtime actually forbids them.
12580
12581         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12582         for array arguments here.
12583
12584         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12585         instead of the default for ValueTypes.
12586
12587         (New.DoEmit): Use IsValueType instead of
12588         IsSubclassOf (value_type)
12589         (New.DoResolve): ditto.
12590         (Invocation.EmitCall): ditto.
12591
12592         * assign.cs (Assign): ditto.
12593
12594         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12595         Statements *are* currently doing part of their resolution during
12596         Emit.  
12597
12598         Expressions do always resolve during resolve, but statements are
12599         only required to propagate resolution to their children.
12600
12601 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12602
12603         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12604
12605         (LoadAssembly): Do not add the dll if it is already specified
12606
12607         (MainDriver): Add the System directory to the link path at the end,
12608         after all the other -L arguments. 
12609
12610         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12611         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12612         ldelem.u1) and using the opposite for sbytes.
12613
12614         This fixes Digger, and we can finally run it.
12615
12616         * driver.cs (UnixParseOption): Move the option parsing here.  
12617         (CSCParseOption): Implement CSC-like parsing of options.
12618
12619         We now support both modes of operation, the old Unix way, and the
12620         new CSC-like way.  This should help those who wanted to make cross
12621         platform makefiles.
12622
12623         The only thing broken is that /r:, /reference: and /lib: are not
12624         implemented, because I want to make those have the same semantics
12625         as the CSC compiler has, and kill once and for all the confussion
12626         around this.   Will be doing this tomorrow.
12627
12628         * statement.cs (Unsafe.Resolve): The state is checked during
12629         resolve, not emit, so we have to set the flags for IsUnsfe here.
12630
12631 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12634         not catch the Error_ObjectRefRequired in SimpleName (as it is
12635         possible to have a class/instance variable name that later gets
12636         deambiguated), we have to check this here.      
12637
12638 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12639
12640         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12641         make static and put into Expression.
12642
12643         (Event.Define): Register the private field of the event with the 
12644         TypeManager so that GetFieldFromEvent can get at it.
12645
12646         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12647         keep track of the private field associated with an event which
12648         has no accessors.
12649
12650         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12651         private field.
12652
12653         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12654
12655 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12656
12657         * expression.cs (Binary.EmitBranchable): this routine emits the
12658         Binary expression in a branchable context.  This basically means:
12659         we need to branch somewhere, not just get the value on the stack.
12660
12661         This works together with Statement.EmitBoolExpression.
12662
12663         * statement.cs (Statement.EmitBoolExpression): Use
12664         EmitBranchable. 
12665
12666 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12667
12668         * statement.cs (For): Reduce the number of jumps in loops.
12669
12670         (For): Implement loop inversion for the For statement.
12671
12672         (Break): We can be breaking out of a Try/Catch controlled section
12673         (foreach might have an implicit try/catch clause), so we need to
12674         use Leave instead of Br.
12675
12676         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12677         now).  If the instace expression supports IMemoryLocation, we use
12678         the AddressOf method from the IMemoryLocation to extract the
12679         address instead of emitting the instance.
12680
12681         This showed up with `This', as we were emitting the instance
12682         always (Emit) instead of the Address of This.  Particularly
12683         interesting when This is a value type, as we dont want the Emit
12684         effect (which was to load the object).
12685
12686 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
12687
12688         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12689
12690         * statement.cs (Checked): Set the CheckedState during the resolve
12691         process too, as the ConvCast operations track the checked state on
12692         the resolve process, and not emit.
12693
12694         * cs-parser.jay (namespace_member_declaration): Flag that we have
12695         found a declaration when we do.  This is used to flag error 1529
12696
12697         * driver.cs: Report ok when we display the help only.
12698
12699 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
12700
12701         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12702
12703 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
12704
12705         * cs-tokenizer.cs (define): We also have to track locally the
12706         defines.  AllDefines is just used for the Conditional Attribute,
12707         but we also need the local defines for the current source code. 
12708
12709 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
12710
12711         * statement.cs (While, For, Do): These loops can exit through a
12712         Break statement, use this information to tell whether the
12713         statement is the last piece of code.
12714
12715         (Break): Flag that we break.
12716
12717         * codegen.cs (EmitContexts): New `Breaks' state variable.
12718
12719 2002-07-03  Martin Baulig  <martin@gnome.org>
12720
12721         * class.cs (TypeContainer.MethodModifiersValid): Allow override
12722         modifiers in method declarations in structs.  Otherwise, you won't
12723         be able to override things like Object.Equals().
12724
12725 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12726
12727         * class.cs (Method, Property, Indexer): Do not allow the public
12728         modifier to be used in explicit interface implementations.
12729
12730         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12731         override modifiers in method declarations in structs
12732
12733 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
12734
12735         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12736         integer or real overflow, report an error
12737
12738 2002-07-02  Martin Baulig  <martin@gnome.org>
12739
12740         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12741         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12742         to tell the runtime about our newly created System.Object and
12743         System.ValueType types.
12744
12745 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
12746
12747         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12748         struct instead of Ldarg/Starg.
12749
12750 2002-07-02  Martin Baulig  <martin@gnome.org>
12751
12752         * expression.cs (Indirection.Indirection): Call
12753         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12754
12755 2002-07-02  Martin Baulig  <martin@gnome.org>
12756
12757         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12758         ValueType, call TypeManager.TypeToCoreType() on it.
12759         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12760         the OpCodes.Newarr argument.
12761
12762 2002-07-02  Martin Baulig  <martin@gnome.org>
12763
12764         * expression.cs (Invocation.EmitCall): When compiling corlib,
12765         replace all calls to the system's System.Array type to calls to
12766         the newly created one.
12767
12768         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12769         System.Array methods.
12770         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12771         from the system's System.Array type which must be replaced.
12772
12773 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12774
12775         * typemanager.cs: load unverifiable_code_ctor so we can build
12776         corlib using the correct type. Avoid using GetTypeCode() with
12777         TypeBuilders.
12778         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12779         TypeManager.object_type to allow building corlib.
12780
12781 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12782
12783         * ecore.cs: handle System.Enum separately in LoadFromPtr().
12784
12785 2002-07-01  Martin Baulig  <martin@gnome.org>
12786
12787         * class.cs: Make the last change actually work, we need to check
12788         whether `ifaces != null' to avoid a crash.
12789
12790 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12791
12792         * class.cs: when we build structs without fields that implement
12793         interfaces, we need to add the interfaces separately, since there is
12794         no API to both set the size and add the interfaces at type creation
12795         time.
12796
12797 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12798
12799         * expression.cs: the dimension arguments to the array constructors
12800         need to be converted if they are a long.
12801
12802 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12803
12804         * class.cs: don't emit ldarg.0 if there is no parent constructor
12805         (fixes showstopper for corlib).
12806
12807 2002-06-29  Martin Baulig  <martin@gnome.org>
12808
12809         MCS now compiles corlib on GNU/Linux :-)
12810
12811         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12812         ie. check for MethodImplOptions.InternalCall.
12813
12814         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12815         and TypeManager.attribute_type are null, so we must explicitly check
12816         whether parent is not null to find out whether it's an attribute type.
12817         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12818         and SetBuilder, not only if the property is neither abstract nor external.
12819         This is necessary to set the MethodImplOptions on the accessor methods.
12820         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12821         SetBuilder, see Property.Emit().
12822
12823         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12824         populate "System.Object", "System.ValueType" and "System.Attribute" since
12825         they've already been populated from BootCorlib_PopulateCoreTypes().
12826
12827 2002-06-29  Martin Baulig  <martin@gnome.org>
12828
12829         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12830         is the NullLiteral, we also need to make sure that target_type is not
12831         an enum type.   
12832
12833 2002-06-29  Martin Baulig  <martin@gnome.org>
12834
12835         * rootcontext.cs (RootContext.ResolveCore): We must initialize
12836         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12837         before calling BootstrapCorlib_ResolveDelegate ().
12838
12839 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12840
12841         * statement.cs: fixed build-breaker. All tests passed ok.
12842
12843 2002-06-27  Martin Baulig  <martin@gnome.org>
12844
12845         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12846         for System.Decimal when compiling corlib.
12847
12848 2002-06-27  Martin Baulig  <martin@gnome.org>
12849
12850         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12851         switch blocks which contain nothing but a default clause.
12852
12853 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
12854
12855        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12856
12857 2002-06-27  Martin Baulig  <martin@gnome.org>
12858
12859         * ecore.cs (PropertyExpr.PropertyExpr): Call
12860         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12861
12862         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12863         is already a TypeBuilder.
12864
12865 2002-06-27  Martin Baulig  <martin@gnome.org>
12866
12867         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12868         `target_type == TypeManager.array_type', not IsAssignableFrom() in
12869         the "from an array-type to System.Array" case.  This makes it work
12870         when compiling corlib.
12871
12872 2002-06-27  Martin Baulig  <martin@gnome.org>
12873
12874         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12875         non-static PropertyExpr, set its InstanceExpression.  This makes
12876         the `ICollection.Count' property work in System/Array.cs.
12877
12878 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
12879
12880         * driver.cs: Made error handling more consistent.  Errors now
12881         tracked by Report class, so many methods which used to return int
12882         now return void.  Main() now prints success/failure and 
12883         errors/warnings message.
12884
12885         Renamed '--probe' compiler argument to '--expect-error'.  Removed
12886         the magic number return values (123 and 124).  Now, if the
12887         expected error occurs, the compiler exits with success (exit value
12888         0).  If the compilation completes without seeing that particular
12889         error, the compiler exits with failure (exit value 1).  The
12890         makefile in mcs/errors has been changed to handle the new behaviour.
12891
12892         * report.cs: Made 'expected error' number a property and renamed
12893         it from 'Probe' to 'ExpectedError'.
12894
12895         * genericparser.cs: Removed error handling support, since it is
12896         now all done by Report class.
12897
12898         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12899         class, so parse() no longer returns an int.
12900
12901         * namespace.cs: Use Report.Error instead of GenericParser.error
12902
12903 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
12904
12905         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12906         TypeContainer.AddOperator): At the front of the list put the
12907         explicit implementations, so they get resolved/defined first. 
12908
12909 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
12910
12911         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12912         interface type is implemented by this TypeContainer.  Used during
12913         explicit interface implementation.
12914
12915         (Property.Define, Indexer.Define, Method.Define): Validate that
12916         the given interface in the explicit implementation is one of the
12917         base classes for the containing type.
12918
12919         Also if we are explicitly implementing an interface, but there is
12920         no match in the pending implementation table, report an error.
12921
12922         (Property.Define): Only define the property if we are
12923         not explicitly implementing a property from an interface.  Use the
12924         correct name also for those properties (the same CSC uses,
12925         although that is really not needed).
12926
12927         (Property.Emit): Do not emit attributes for explicitly implemented
12928         properties, as there is no TypeBuilder.
12929
12930         (Indexer.Emit): ditto.
12931
12932         Hiding then means that we do not really *implement* a pending
12933         implementation, which makes code fail.
12934
12935 2002-06-22  Martin Baulig  <martin@gnome.org>
12936
12937         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
12938         the return value of Object.GetType().  [FIXME: we need to do this whenever
12939         we get a type back from the reflection library].
12940
12941 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
12942
12943         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
12944
12945 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
12946
12947         * attribute.cs: Return null if we can not look up the type.
12948
12949         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
12950         the interface types found.
12951
12952         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
12953         interface types found.
12954
12955         * typemanager.cs (GetInterfaces): Make this routine returns alll
12956         the interfaces and work around the lame differences between
12957         System.Type and System.Reflection.Emit.TypeBuilder in the results
12958         result for GetInterfaces.
12959
12960         (ExpandInterfaces): Given an array of interface types, expand and
12961         eliminate repeated ocurrences of an interface.  This expands in
12962         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
12963         be IA, IB, IC.
12964
12965 2002-06-21  Martin Baulig  <martin@gnome.org>
12966
12967         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
12968         on System.Enum.
12969
12970 2002-06-21  Martin Baulig  <martin@gnome.org>
12971
12972         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
12973         and called with one of the core types, return the corresponding typebuilder for
12974         that type.
12975
12976         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
12977         element type.
12978
12979 2002-06-21  Martin Baulig  <martin@gnome.org>
12980
12981         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
12982         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
12983         (Expression.ConvertReferenceExplicit): Likewise.
12984
12985         * expression.cs (ElementAccess.DoResolve): Likewise.
12986         (ElementAccess.DoResolveLValue): Likewise.
12987
12988 2002-06-10  Martin Baulig  <martin@gnome.org>
12989
12990         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
12991         add the "value" parameter to the parameter list.
12992
12993         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
12994         to our caller.
12995
12996 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
12997
12998         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
12999         the argument to an int, uint, long or ulong, per the spec.  Also
13000         catch negative constants in array creation.
13001
13002 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13003
13004         * class.cs: do not allow the same interface to appear twice in
13005         the definition list.
13006
13007 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13008
13009         * ecore.cs: don't use ldlen with System.Array.
13010
13011 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13012
13013         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13014
13015 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13016
13017         * modifiers.cs: produce correct field attributes for protected
13018         internal. Easy fix so miguel can work on ther harder stuff:-)
13019
13020 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13021
13022         * pending.cs: New file.  Move the code from class.cs here.
13023         Support clearning the pending flag for all methods (when not doing
13024         explicit interface implementation).
13025
13026 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13027
13028         * rootcontext.cs: added a couple more types needed to bootstrap.
13029
13030 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13031
13032         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13033         constructor in the type, instead of any constructor in the type
13034         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13035         a bug in the Mono runtime when applying the params attribute). 
13036
13037 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13038         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13039
13040 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13041
13042         * expression.cs (Unary.ResolveOperator): Use TypeManager
13043         to resolve the type.
13044
13045 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13046
13047         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13048         attached.
13049
13050         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13051         with each member too.
13052
13053         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13054         field builders too - this takes care of the enum member case.
13055
13056 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13057
13058         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13059         address-of operator on both value types and pointers.
13060
13061 2002-06-10  Martin Baulig  <martin@gnome.org>
13062
13063         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13064         PropertyBuilder to the `property_builders' list.
13065
13066         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13067         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13068         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13069         find any indexers which are inherited from an interface.
13070
13071 2002-06-09  Martin Baulig  <martin@gnome.org>
13072
13073         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13074         the same type as the constant if necessary.  There's also a test-130.cs
13075         for this.
13076
13077         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13078
13079         * typemanager.cs (TypeManager.ChangeType): Previously known as
13080         Enum.ChangeEnumType().
13081
13082 2002-06-09  Martin Baulig  <martin@gnome.org>
13083
13084         * expression.cs (Cast.TryReduce): Added support for consts.
13085
13086 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13087
13088         * class.cs (Accessor): Hold attributes information so we can pass
13089         it along.
13090
13091         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13092         Modify to pass in attributes attached to the methods.
13093
13094         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13095
13096         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13097         to handle the Accessor kind :-)
13098
13099         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13100
13101 2002-06-08  Martin Baulig  <martin@gnome.org>
13102
13103         * expression.cs (Unary.TryReduceNegative): Added support for
13104         ULongConstants.
13105
13106 2002-06-08  Martin Baulig  <martin@gnome.org>
13107
13108         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13109         name can't be found in the `defined_names' - the caller will do a
13110         MemberLookup in this case and thus find methods in System.Enum
13111         such as Enum.IsDefined().
13112
13113 2002-06-08  Martin Baulig  <martin@gnome.org>
13114
13115         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13116         Convert.ChangeType() which works with TypeBuilder created types.
13117         (Enum.LookupEnumValue, Enum.Define): Use it here.
13118
13119         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13120         `TypeBuilder.BaseType != null' check.
13121         (TypeContainer.FindMembers): Only lookup parent members if we
13122         actually have a parent.
13123         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13124         (ConstructorInitializer.Resolve): Likewise.
13125
13126         * interface.cs (Interface.FindMembers): Added
13127         `TypeBuilder.BaseType != null' check.
13128
13129         * rootcontext.cs (RootContext.ResolveCore): Added
13130         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13131         classes_second_stage.
13132
13133         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13134         debug_type and trace_type when compiling with --nostdlib.       
13135
13136 2002-06-07  Martin Baulig  <martin@gnome.org>
13137
13138         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13139         (AddField): Set it to true when adding a non-static field.
13140         (DefineType): Use `have_nonstatic_fields' to find out whether we
13141         have non-static fields, not `Fields != null'.
13142
13143 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13144
13145         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13146         dereferencing a null on the static-field code path)
13147
13148 2002-05-30  Martin Baulig  <martin@gnome.org>
13149
13150         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13151         to take command line arguments.  Use reflection to call the new
13152         custom `Initialize' function on the symbol writer and pass it the
13153         command line arguments.
13154
13155         * driver.cs (--debug-args): New command line argument to pass command
13156         line arguments to the symbol writer.
13157
13158 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13161         the target type for indexers and properties.  Thanks to Joe for
13162         catching this.
13163
13164 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13165
13166         * typemanager.cs (MethodFlags): returns the method flags
13167         (Obsolete/ShouldIgnore) that control warning emission and whether
13168         the invocation should be made, or ignored. 
13169
13170         * expression.cs (Invocation.Emit): Remove previous hack, we should
13171         not do this on matching a base type, we should do this based on an attribute
13172
13173         Only emit calls to System.Diagnostics.Debug and
13174         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13175         on the command line.
13176
13177         * rootcontext.cs: Global settings for tracing and debugging.
13178
13179         * cs-tokenizer.cs (define): New utility function to track
13180         defines.   Set the global settings for TRACE and DEBUG if found.
13181
13182 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13183
13184         * interface.cs (Populate*): Pass in the TypeContainer as well as
13185         the DeclSpace as parameters so that we can create EmitContexts and
13186         then use that to apply attributes etc.
13187
13188         (PopulateMethod, PopulateEvent, PopulateProperty)
13189         (PopulateIndexer): Apply attributes everywhere.
13190
13191         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13192         etc.
13193
13194         (ApplyAttributes): Update accordingly.
13195
13196         We now apply interface attributes for all members too.
13197
13198 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13199
13200         * class.cs (Indexer.Define); Correctly check if we are explicit
13201         implementation (instead of checking the Name for a ".", we
13202         directly look up if the InterfaceType was specified).
13203
13204         Delay the creation of the PropertyBuilder.
13205
13206         Only create the PropertyBuilder if we are not an explicit
13207         interface implementation.   This means that explicit interface
13208         implementation members do not participate in regular function
13209         lookups, and hence fixes another major ambiguity problem in
13210         overload resolution (that was the visible effect).
13211
13212         (DefineMethod): Return whether we are doing an interface
13213         implementation. 
13214
13215         * typemanager.cs: Temporary hack until we get attributes in
13216         interfaces (Ravi is working on that) and we get IndexerName
13217         support in interfaces.
13218
13219         * interface.cs: Register the indexers as properties.
13220
13221         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13222         warning, I have verified that this is a bug in the .NET runtime
13223         (JavaScript suffers of the same problem).
13224
13225         * typemanager.cs (MemberLookup): When looking up members for
13226         interfaces, the parent of an interface is the implicit
13227         System.Object (so we succeed in searches of Object methods in an
13228         interface method invocation.  Example:  IEnumerable x;  x.ToString
13229         ()) 
13230
13231 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13232
13233         * class.cs (Event): Events should also register if they do
13234         implement the methods that an interface requires.
13235
13236         * typemanager.cs (MemberLookup); use the new GetInterfaces
13237         method. 
13238
13239         (GetInterfaces): The code used to lookup interfaces for a type is
13240         used in more than one place, factor it here. 
13241
13242         * driver.cs: Track the errors at the bottom of the file, we kept
13243         on going.
13244
13245         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13246         instance if the method we are calling is static!
13247
13248 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13249
13250         * attribute.cs (ApplyAttributes): Make this function filter out
13251         the IndexerName attribute (as that attribute in reality is never
13252         applied) and return the string constant for the IndexerName
13253         attribute. 
13254
13255         * class.cs (TypeContainer.Emit): Validate that all the indexers
13256         have the same IndexerName attribute, and if so, set the
13257         DefaultName attribute on the class. 
13258
13259         * typemanager.cs: The return value might contain other stuff (not
13260         only methods).  For instance, consider a method with an "Item"
13261         property and an Item method.
13262
13263         * class.cs: If there is a problem with the parameter types,
13264         return. 
13265
13266 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13267
13268         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13269         looks at user defined conversion after making a call to 
13270         StandardConversionExists - we need this for overload resolution.
13271
13272         * expression.cs : Update accordingly the various method calls.
13273
13274         This fixes 2 bugs filed against implicit user defined conversions 
13275
13276 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13277
13278         * statement.cs: Track the result of the assignment.
13279
13280 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13281
13282         * expression.cs (MemberAccess): Improved error reporting for
13283         inaccessible members.
13284
13285 2002-05-22  Martin Baulig  <martin@gnome.org>
13286
13287         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13288         itself with debugging support.
13289
13290 2002-05-22  Martin Baulig  <martin@gnome.org>
13291
13292         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13293         Removed, this isn't needed anymore.
13294
13295 2002-05-20  Martin Baulig  <martin@gnome.org>
13296
13297         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13298         be underlying type for an enum.
13299
13300 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13301
13302         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13303         that splits out the loading of just the core types.
13304
13305         * rootcontext.cs (ResolveCore): Split the struct resolution in
13306         two, so we can load the enumeration underlying types before any
13307         enums are used.
13308
13309         * expression.cs (Is): Bandaid until we fix properly Switch (see
13310         bug #24985 for details).
13311
13312         * typemanager.cs (ImplementsInterface): The hashtable will contain
13313         a null if there are no interfaces implemented.
13314
13315 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13316
13317         * cs-parser.jay (indexer_declarator): It is fine to have array
13318         parameters
13319
13320 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13321
13322         * typemanager.cs: (RegisterBuilder): New function used to register
13323         TypeBuilders that implement interfaces.  Since
13324         TypeBuilder.GetInterfaces (as usual) does not work with lame
13325         Reflection.Emit. 
13326         (AddUserType): register interfaces.
13327
13328         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13329         dealing with TypeBuilder.  Also, arrays are showing up as
13330         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13331         methods can not be invoked on them!
13332
13333         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13334         (ImplicitReferenceConversionExists): Split out from
13335         StandardConversionExists. 
13336
13337         * expression.cs (As): We were only implementing one of the three
13338         cases for the as operator.  We now implement them all.
13339         (Is): Implement the various other cases for Is as well.
13340
13341         * typemanager.cs (CACHE): New define used to control if we want or
13342         not the FindMembers cache.  Seems to have a negative impact on
13343         performance currently
13344
13345         (MemberLookup): Nested types have full acess to
13346         enclosing type members
13347
13348         Remove code that coped with instance/static returns for events, we
13349         now catch this in RealFindMembers.
13350
13351         (RealFindMembers): only perform static lookup if the instance
13352         lookup did not return a type or an event.  
13353
13354 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13355
13356         * assign.cs (CompoundAssign): We pass more semantic information
13357         now to Compound Assignments than we did before: now we have all
13358         the information at hand, and now we resolve the target *before* we
13359         do the expression expansion, which allows the "CacheValue" method
13360         to have the effect we intended (before, a [x] += 1 would generate
13361         two differen ArrayAccess expressions from the ElementAccess,
13362         during the resolution process).
13363
13364         (CompoundAssign.DoResolve): Resolve target and original_source here.
13365
13366 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13367
13368         * expression.cs (ArrayAccess): dropped debugging information. 
13369
13370         * typemanager.cs: Small bug fix: I was always returning i_members,
13371         instead of one of i_members or s_members (depending on which had
13372         the content).
13373
13374         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13375         method is invoked before any code generation takes place, and it
13376         is a mechanism to inform that the expression will be invoked more
13377         than once, and that the method should use temporary values to
13378         avoid having side effects
13379
13380         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13381
13382         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13383         implementation.
13384
13385         * expression.cs (Indirection, ArrayAccess): Add support for
13386         CacheTemporaries in these two bad boys. 
13387
13388         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13389         ldobj or ldind_ref.  
13390         (StoreFromPtr): Handle stobj as well.
13391
13392         * expression.cs (UnaryMutator): Share more code.
13393
13394         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13395         down: I was not tracking the Filter function as well, which
13396         was affecting the results of the cache.
13397
13398 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13399
13400         * attribute.cs: Remove the hack to handle the CharSet property on
13401         StructLayouts. 
13402
13403 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13404
13405         * attribute.cs (DoResolve): More uglyness, we now only try to
13406         resolve the attribute partially, to extract the CharSet
13407         information (only if we are a StructLayout attribute).  Otherwise 
13408
13409         (GetExtraTypeInfo): Add some code to conditionally kill in the
13410         future this.   I am more and more convinced that the .NET
13411         framework has special code to handle the attribute setting on
13412         certain elements.
13413
13414         * expression.cs (IsParamsMethodApplicable): Revert my previous
13415         foreach change here, it was wrong.
13416
13417 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13418
13419         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13420         (pp_expr): do not abort on unknown input, just return.
13421         (eval): abort if there are pending chars.
13422
13423         * attribute.cs (Attribute.Resolve): Positional parameters are
13424         optional.  Deal with that case.
13425
13426         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13427         the Ansi/Unicode/Auto information for the type.
13428
13429         (TypeContainer.DefineType): instantiate the EmitContext here, as
13430         we will be using it during the type definition (to resolve
13431         attributes) and during the emit phase.
13432
13433         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13434         to pull type information out of the attributes
13435
13436         (Attribute.Resolve): track the constructor builder, and allow for
13437         multiple invocations (structs and classes will use this).
13438
13439         * ecore.cs (MemberLookupFinal): new version with all the
13440         parameters customizable.
13441
13442         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13443         constructors.  Return if the result value is null (as the error
13444         would have been flagged already by MemberLookupFinal)
13445
13446         Do not allow instances of abstract classes or interfaces to be
13447         created.
13448
13449         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13450         We have to compare the assembly property here when dealing with
13451         FamANDAssem and Assembly access modifiers, because we might be
13452         creating an assembly from *modules* (that means that we are not
13453         getting TypeBuilders for types defined in other modules that are
13454         part of this assembly).
13455
13456         (Method.Emit): If the method is marked abstract and has a body,
13457         emit an error. 
13458
13459         (TypeContainer.DefineMembers): If both the defined member and the
13460         parent name match are methods, then do not emit any warnings: let
13461         the Method.Define routine take care of flagging warnings.  But if
13462         there is a mismatch (method overrides something else, or method is
13463         overriwritten by something, then emit warning).
13464
13465         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13466         set to null, this means `do not check for the return type on the
13467         signature'. 
13468
13469         (Method.Define): set the return type for the method signature to
13470         null, so that we get methods with the same name and parameters and
13471         different return types.  This is used to flag warning 114 (you are
13472         hiding a method, and you probably want to use the new/override
13473         keywords instead).
13474
13475         * typemanager.cs (MemberLookup): Implemented proper access
13476         control, closing a long standing set of bug reports.  The problem
13477         was that the Framework only has two bits: Public and NonPublic,
13478         and NonPublic includes private and protected methods, but we need
13479         to enforce the FamANDAssem, FamOrAssem and Family. 
13480
13481 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13482
13483         * statement.cs (GotoCase): Return true: Ammounts to giving up
13484         knowledge on whether we return or not, and letting the other case
13485         be responsible for it.
13486
13487 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13488
13489         * driver.cs: Do not load directories for each file processed, only
13490         do it if there is a pattern.
13491
13492         * ecore.cs: Report readonly assigns here as well, as we might have
13493         been resolved only by MemberAccess.
13494
13495         (SimpleName.SimpleNameResolve): Also be useful for LValue
13496         resolution.   We need this to propagate assign to local readonly variables
13497
13498         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13499         do not want to reuse potential criteria memory.
13500
13501         * class.cs (MyEventBuilder): Set reflected_type;
13502
13503         * ecore.cs (Constantify): Added support for constifying bools.
13504
13505         (RootContext.LookupType): Added a cache for values looked up in
13506         the declaration space.
13507
13508         * typemanager.cs (FindMembers): Now is a front-end to
13509         RealFindMembers, and provides a two-level hashtable-based cache to
13510         the request.  
13511
13512         15% performance improvement: from 22.5 to 19.2 seconds.
13513
13514         * expression.cs (IsParamsMethodApplicable): use foreach.
13515         (Invocation.DoResolve): ditto.
13516         (New.DoResolve): ditto.
13517         (ArrayCreation.DoResolve): ditto.
13518
13519         * ecore.cs (FindMostEncompassingType): use foreach.
13520
13521         * delegate.cs (NewDelegate.DoResolve): Use foreach
13522
13523         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13524         (RemoveMethods): use foreach.
13525
13526         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13527         nested foreach statements instead of for, and also break out of
13528         the inner loop once a match is found.
13529
13530         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13531
13532 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13533
13534         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13535         we actually unwrap the expression to allow for extra information
13536         to be extracted. 
13537
13538         * expression.cs: Use Shr_Un on unsigned operations. 
13539
13540 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13541
13542         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13543         applicable operators was not being considered correctly. This closes
13544         the bug Miguel reported.
13545
13546 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13547
13548         * attribute.cs: check that the type derives from System.Attribute
13549         and report the correct error in that case (moved the duplicate code to
13550         its own method, too).
13551
13552 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13553
13554         * attribute.cs: lookup attribute type name as the spec says: first the
13555         bare attribute name and then name + "Attribute" (nant compiles with
13556         mcs after this fix).
13557
13558 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13559
13560         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13561         Because of the way we parse things, we should try to see if a
13562         UIntConstant can fit in an integer.
13563
13564 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13565
13566         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13567         when we are in an explicit context.
13568
13569         (ConvertReferenceExplicit): When converting from Iface type S to Class
13570         T make sure the rules are implemented as an OR.
13571
13572         * parameter.cs (ParameterType): Make it a property for now although the
13573         purpose really isn't anything immediate.
13574
13575         * expression.cs (Is*Applicable): Do better checking on the parameter type
13576         of a ref/out parameter. The ones from the system assemblies are already 
13577         marked with the correct type so we don't need to do any correction.
13578
13579         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13580         the object type is standard too so include that.
13581
13582 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13583
13584         * ecore.cs (StandardConversionExists): Augment with missing code:
13585         deal with IntConstant, LongConstants and Enumerations.
13586
13587         * assign.cs: Report the error, instead of failing silently
13588
13589         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13590         typecontainer that they are declared, because the
13591         typecontainer/namespace will have the list of using clauses that
13592         need to be applied.
13593
13594         Assembly Attributes were escaping the normal registration
13595         mechanism. 
13596
13597         (EmitCode): Apply attributes within an EmitContext that represents
13598         the container they were declared on.
13599
13600         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13601
13602 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13603
13604         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13605         Revamp completely - make much cleaner as we now operate only
13606         on a set of Types.
13607
13608         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13609         to implement the logic detailed in the spec more correctly.
13610
13611         (UserDefinedConversion): Update accordingly.
13612
13613 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13614
13615         * statement.cs: Return flow analysis information up.
13616
13617         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13618         and the default.
13619
13620         (token): Do not consume an extra character before calling
13621         decimal_digits.
13622
13623 2002-05-06  Piers Haken <piersh@friskit.com>
13624
13625         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13626
13627 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13628
13629         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13630         EmitContext during the instance constructor initializer
13631         resolution, to stop access to instance variables.
13632
13633         This is mandated by the spec, last paragraph of the `constructor
13634         initializers' section. 
13635
13636 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13637
13638         * cs-parser.jay, class.cs (Accessor): new class used to represent
13639         an accessor (get or set).  In the past we used `null' to represent
13640         a missing accessor.  But this is ambiguous because there was no
13641         way to tell in abstract indexers/properties if one of them was
13642         specified.
13643
13644         Now there is a way of addressing that.
13645
13646         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13647         instead of FindMembers.
13648
13649         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13650         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13651
13652         * attribute.cs: Treat indexers and properties as the same in terms
13653         of applying attributes
13654
13655         * ecore.cs (FindMostEncompassedType): Use statically initialized
13656         EmptyExpressions()s like we do elsewhere to avoid creating useless
13657         objects (and we take this out of the tight loop).
13658
13659         (GetConversionOperators): Move the code to extract the actual
13660         operators to a separate routine to clean things up.
13661
13662 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13663
13664         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13665         events are always registered FieldBuilders.
13666
13667         * class.cs (FieldBase): New class shared by Fields 
13668
13669         * delegate.cs: If we are a toplevel delegate, use our full name.
13670         If we are a nested delegate, then only use our tail name.
13671
13672 2002-05-02  Ravi Pratap  <ravi@ximian.com>
13673
13674         * expression.cs (IsApplicable): Ensure that we add the "&" to
13675         ref/out types before comparing it with the type of the argument.
13676
13677         (IsParamsMethodApplicable): Ditto.
13678
13679         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
13680         silly me ;-)
13681
13682         * delegate.cs : Handle the case when we have more than one applicable
13683         method. Flag an error only when we finish checking all.
13684
13685 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
13686
13687         * expression.cs: Add support for boolean static initializers.
13688
13689 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
13690
13691         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13692
13693         * parameter.cs (ComputeParameterTypes,
13694         ComputeAndDefineParameterTypes): Better error handling: now we
13695         clear the `types' cache if we fail during any of the type lookups.
13696         We also return the status code correctly to our caller
13697
13698         * delegate.cs: If we fail to define a delegate, abort the extra
13699         steps. 
13700
13701         * expression.cs (Binary.ResolveOperator): for
13702         operator==(object,object) and operator !=(object, object) we also
13703         have to verify that there is an implicit conversion from one to
13704         the other.
13705
13706         (ArrayAccess.DoResolve): Array Access can operate on
13707         non-variables. 
13708
13709 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
13710
13711         * assign.cs (CompoundAssign): A new class used as a "flag" that
13712         the assignment actually is happening as part of a compound
13713         assignment operator.
13714
13715         During compound assignment, a few new rules exist to enable things
13716         like:
13717
13718         byte b |= 1 + 2
13719
13720         From the spec:
13721
13722         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13723         to the type of x) if y is implicitly convertible to the type of x,
13724         and the operator is a builtin operator and the return type of the
13725         operator is explicitly convertible to the type of x. 
13726
13727         * rootcontext.cs: Reset warning level to 2.  4 catches various
13728         "interesting" features in mcs, we must clean this up at some
13729         point, but currently am trying to kill other bugs ;-)
13730
13731         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13732         in container classes as well.  
13733
13734         * expression.cs (Binary.ResolveOperator): Handle string case
13735         before anything else (as operator overloading does emit an error
13736         before doing anything else).
13737
13738         This code could go away when we move to a table driven model, but
13739         i could not come up with a good plan last night.
13740
13741 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
13742
13743         * typemanager.cs (CSharpName): reimplementation using regex.
13744         * class.cs: added null check for fields in Emit
13745         * rootcontext.cs: set warninglevel to 4
13746
13747 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
13748
13749         * typemanager.cs (CSharpName): reimplemented with Lupus
13750         suggestion.
13751
13752 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
13753
13754         * statement.cs (If): correclty implement Resolve, because we were
13755         not catching sem errors in there.  The same process is needed
13756         everywhere else. 
13757         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13758
13759
13760         (Statement.Warning_DeadCodeFound): Factorize code.
13761         (While): Report dead code here too.
13762
13763         (Statement): Added Resolve virtual method to allow
13764         for resolution split from the emit code.
13765
13766 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13767
13768         * statement.cs (EmitBoolExpression): No longer try to resolve the
13769         expression here.    
13770         (MakeBoolean): New utility function that resolve, implicitly
13771         converts to boolean and tags the expression. 
13772
13773
13774         (If, Do): Implement dead code elimination.
13775         (While): Implement loop inversion
13776
13777         (Do, While, For, If): Resolve the expression prior to calling our
13778         code generation.
13779
13780 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
13781
13782         * class.cs:
13783           - added method Report28 (warning: program has more than one entry point)
13784           - added method IsEntryPoint, implements paragraph 10.1 of the spec
13785           - modified method Method.Define, the part at the end of the method
13786
13787         * rootcontext.cs: added static public Location EntryPointLocation;
13788           
13789         * ../errors/cs0028.cs : Add test case for the above warning.              
13790
13791         * typemanager.cs:
13792           - modified method CSharpName to allow arrays of primitive type to
13793             be printed nicely (e.g. instead of System.Int32[][] it now prints
13794             int[][])
13795           - added method CSharpSignature: returns the signature of a method
13796             in string format to be used in reporting errors, warnings, etc.
13797
13798         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13799         with String.Empty.
13800
13801 2002-04-26  Ravi Pratap  <ravi@ximian.com>
13802
13803         * delegate.cs (Define): Fix extremely silly bug where I was
13804         setting the type of the 'object' parameter of the BeginInvoke
13805         method to System.IAsyncResult instead of System.Object ;-)
13806
13807 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
13808
13809         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13810         here. 
13811
13812         (Constructor.Emit): return if we fail to initialize the
13813         constructor.  Another door closed!  
13814
13815         * expression.cs (New.DoResolve): Improve error message (from -6 to
13816         1501).  Use DeclaredOnly lookup to find the exact constructor.
13817
13818         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13819         loop.  This is useful.
13820
13821         * cs-parser.jay: Adjust the default parameters so that destructors
13822         have the proper signature.
13823
13824 2002-04-26  Martin Baulig  <martin@gnome.org>
13825
13826         * driver.cs (LoadAssembly): If `assembly' contains any characters
13827         which are only valid in path names and not in assembly names
13828         (currently slash, backslash and point), use Assembly.LoadFrom ()
13829         instead of Assembly.Load () on the `assembly' (before iteration
13830         over the link_paths).
13831
13832 2002-04-26  Martin Baulig  <martin@gnome.org>
13833
13834         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13835
13836 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
13837
13838         * class.cs (Property): use the new typemanager.MemberLookup
13839
13840         (TypeContainer.MemberLookup): Implement using the
13841         TypeManager.MemberLookup now. 
13842
13843         * typemanager.cs: Make MemberLookup a function of the TypeManager,
13844         and return MemberInfos, so that these can be used without an
13845         EmitContext (what we had before).
13846
13847 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
13848
13849         * expression.cs: Fix the case where the argument to params if the
13850         type of the params.  I omitted handling this before.   Fixed
13851
13852 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13853
13854         * driver.cs: Call BootCorlib_PopulateCoreType
13855
13856         * class.cs (Property.CheckBase): Check for properties only, not
13857         for all members. 
13858
13859         * interface.cs: Temporary hack: try/catch around the
13860         CustomAttributeBuilder, because I am getting an exception that I
13861         do not understand.
13862
13863         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13864         types whose definitions are required to be there (attributes are
13865         defined before standard types).
13866
13867         Compute definitions as we boot the various types, as they are used
13868         immediately (value_type class will need object_type, but if we do
13869         not initialize object_type, we will pass a null, which will let
13870         the runtime pick the System.Object from the existing corlib, which
13871         is not what we want).
13872
13873 2002-04-22  Patrik Torstensson <totte@labs2.com>
13874
13875         * cs-tokenizer.cs: fixed a number of trim() issues.
13876
13877 2002-04-22  Ravi Pratap  <ravi@ximian.com>
13878
13879         * expression.cs (Argument.Type): Ensure that we return the correct
13880         type when we have out or ref parameters [in which case we 
13881         append a "&"].
13882
13883 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
13884
13885         * class.cs (Property, Indexer): Allow extern modifier in there. 
13886
13887         * typemanager.cs (InitBaseTypes): Initializes object_type and
13888         value_type, since those will be used early on during the bootstrap
13889         process to compile corlib.
13890
13891         (InitCoreTypes): Move code from here to InitBaseTypes.
13892
13893 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
13894
13895         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13896         single-dimension arrays as using the ldlen opcode.  
13897
13898         Daniel Lewis discovered this optimization.  
13899
13900         * typemanager.cs: Add signature for System.Array::get_Length
13901
13902 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13903
13904         * statement.cs: report the error when the foreach does not apply to an
13905         array nor a collection.
13906
13907 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
13908
13909         * expression.cs: Add implicit conversions to the operator ~.
13910
13911         * constant.cs (DecimalConstant.Emit): Emit decimal value.
13912
13913         * typemanager.cs: Locate the decimal constructor.
13914
13915 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13916
13917         * attribute.cs: use the new property of TypeOf.
13918         * expression.cs: added 'get' property around typearg.
13919
13920         These changes fix a build breaker reported by NickD. Is this the
13921         correct way to fix?  If not, please, revert my changes and make it
13922         work :-).
13923
13924 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
13925
13926         * attribute.cs: Add support for typeof in attribute invocations.
13927         I am not sure that this is right though.
13928
13929 2002-04-14  Duncan Mak  <duncan@ximian.com>
13930
13931         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13932         Binary.Operator.Division case.
13933
13934 2002-04-13  Ravi Pratap  <ravi@ximian.com>
13935
13936         * class.cs (DefineType): Ensure that we do a proper check on
13937         attribute types and also register it with the TypeManager.
13938
13939         (TypeContainer.Targets): The default for attribute types is
13940         AttributeTargets.All.
13941
13942         * attribute.cs (ApplyAttributes): Registering the attribute type
13943         is done elsewhere, not when we discover we have a Usage attribute.
13944
13945 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13946
13947         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
13948         and get rid of is_delegate parameter.
13949
13950         * everywhere : update.
13951
13952 2002-04-12  Ravi Pratap  <ravi@ximian.com>
13953
13954         * cs-parser.jay (compilation_unit): Revamp completely to use
13955         some new ideas that I got from Rhys' grammar to solve the problems
13956         with assembly level attributes.
13957
13958         (outer_declaration): New grammar production.
13959
13960         (attribute_sections): Add.
13961
13962         (opt_attributes): Base on attribute_sections
13963
13964         (namespace_declaration): Allow opt_attributes to tackle the case
13965         when we have assembly level attributes - we are clever in this
13966         regard now ;-)
13967
13968         * attribute.cs (ApplyAttributes): Do not worry about assembly 
13969         attributes in the non-global context.
13970
13971         * rootcontext.cs (AddGlobalAttributes): Go back to using this
13972         instead of SetGlobalAttributes.
13973
13974         * class.cs, rootcontext.cs : Ensure we define and generate 
13975         attribute types before anything else.
13976
13977         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
13978         and flag the new error -20 for the case when the attribute type
13979         does not have valid targets specified. csc does not catch this.
13980
13981         * ../errors/errors.txt : update for error # -20
13982
13983 2002-04-11  Ravi Pratap  <ravi@ximian.com>
13984
13985         * support.cs (InternalParameters.ParameterModifier): Do some null
13986         checking and return sane values.
13987
13988         * class.cs (Method.Define): If we are a PInvoke method, ensure
13989         that we are static and extern. Report error # 601
13990
13991         * ../errors/cs0601.cs : Add test case for the above error.
13992
13993 2002-04-07  Ravi Pratap  <ravi@ximian.com>
13994
13995         * rootcontext.cs (attribute_types): We need to keep type of
13996         all attribute types separately and emit code for them first.
13997
13998         (RegisterAttribute) : Implement.
13999
14000         * class.cs (DefineType): Check if the current Type is a custom
14001         attribute type and register it accordingly.
14002
14003         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14004         adding the first attribute twice and rename to
14005
14006         (SetGlobalAttributes): this.
14007
14008         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14009         lookups.
14010
14011         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14012         if we are processing global arguments. Hmm, I am unsure of this.
14013
14014 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14015
14016         * expression.cs: added static array of strings to avoid calling
14017         Enum.ToString () for Operator in Binary. Significant recover of
14018         performance.
14019
14020 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14021
14022         * class.cs (FindMembers): Allow the Builders of the various
14023         members to be null.  If they are skip them.  This only happens
14024         during the PInvoke declaration.
14025
14026 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14029         failure, so we do not keep going afterwards.
14030
14031         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14032         wanted to pass `false' as the `is_delegate' argument.  If this is
14033         the case, why not use delegate_type == null to mean `is_delegate =
14034         false' and anything else as is_delegate = true.
14035
14036 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14037
14038         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14039         code for the section, not the beginning of the tests.
14040
14041 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14042
14043         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14044
14045         * expression.cs (Binary): same.  Warn about errors where we have
14046         Enum/Enum in operator + as well.
14047
14048 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14049
14050         * statement.cs:
14051                 - added support for switch(bool)
14052                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14053                 - add TableSwitchEmit() to handle table-based switch statements
14054
14055 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14056
14057         * expression.cs (Invocation.OverloadResolve): Factor out code which
14058         does parameter compatibility checking with arguments so that we can 
14059         re-use the code even from Delegate.VerifyApplicability
14060
14061         (VerifyArgumentsCompat): Move above code here.
14062
14063         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14064         and instead make a call to the above method.
14065
14066 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14067
14068         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14069         We use it to keep track of classes which are attribute types.
14070
14071 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14072
14073         * delegate.cs (Delegate.Define): Correctly define the types in the
14074         presence of fixed and array parameters.
14075
14076         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14077         doing FindMembers.
14078
14079         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14080         include NonPublic after the first iteration.
14081
14082         * class.cs (Indexer.CheckBase): Only check if both parents are
14083         non-null. 
14084
14085         * cs-parser.jay (accessor_body): If empty, set to null.
14086
14087         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14088         same code path here to resolve constants names that we did have in
14089         MemberAccess.DoResolve.  There is too much code duplicated here.
14090
14091 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14092
14093         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14094
14095         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14096         to MakeUnionSet.
14097
14098         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14099         tokens, numbers and strings.
14100
14101         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14102         parenthesis.
14103
14104         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14105         asyncronous parameters and the regular parameters.  
14106
14107         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14108         specify the target directory.
14109
14110         * expression.cs: (This.DoResolve): Simplify
14111         (As.Emit): Optimize, do not generate IsInst if the expression is
14112         always of the given type.
14113
14114         (Is.DoResolve): Bug fix, we were reporting both always/never for
14115         the is expression.
14116
14117         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14118         creating too many unnecessary arrays.
14119
14120 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14121
14122         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14123         fields instead of rolling our own initializer.   Takes care of all
14124         implicit conversions, and drops unnecessary static checks/argument.
14125
14126 2002-03-31  Dick Porter  <dick@ximian.com>
14127
14128         * driver.cs: use the GetDirectories() return values properly, and
14129         use "/" as path separator.
14130
14131 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14132
14133         * expression.cs (Unary): Optimize - - expr into expr.
14134         (Binary): Optimize a + (-b) into a -b.
14135
14136         * codegen.cs (CodeGen): Made all methods static.
14137
14138 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14139
14140         * rootcontext.cs: 
14141
14142         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14143         TypeBuilder property.
14144
14145         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14146         instead. 
14147
14148         * tree.cs: Removed the various RecordXXXX, and replaced with a
14149         single RecordDecl.  Removed all the accessor methods, and just
14150         left a single access point Type 
14151
14152         * enum.cs: Rename DefineEnum to DefineType.
14153
14154         * decl.cs: New abstract method `DefineType' used to unify the
14155         Defines for Enumerations, Interfaces, TypeContainers and
14156         Delegates.
14157
14158         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14159         LookupBaseClasses method that used to live in class.cs and
14160         interface.cs here, and renamed to FindType.
14161
14162         * delegate.cs: Implement DefineType.  Take advantage of the
14163         refactored pattern for locating the parent builder without taking
14164         the parent_builder argument (which we know does not work if we are
14165         nested, and triggering a toplevel definition).
14166
14167 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14168
14169         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14170         accessibility of a member has changed during override and report
14171         an error if so.
14172
14173         * class.cs (Method.Define, Property.Define): Only complain on
14174         overrides if the method is private, any other accessibility is
14175         fine (and since we just checked the permission is the same, we are
14176         good to go).
14177
14178         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14179         and elif are processed always.  The other pre-processing
14180         directives are only processed if we are "taking" the path
14181
14182 2002-03-29  Martin Baulig  <martin@gnome.org>
14183
14184         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14185         current location is not Null.
14186
14187         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14188         a separate method so we can profile it.
14189
14190         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14191         `span.Seconds' are just seconds, but no minutes or hours.
14192         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14193
14194 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14195
14196         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14197         Remove the gratuitous set of Final:
14198
14199                                 // If an interface implementation, then we can set Final.
14200                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14201                                     implementing.DeclaringType.IsInterface)
14202                                         flags |= MethodAttributes.Final;
14203
14204         I do not know what I was smoking when I used that.
14205
14206
14207         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14208         step into fixing the name resolution issues for delegates and
14209         unifying the toplevel name resolution.
14210
14211 2002-03-28  Martin Baulig  <martin@gnome.org>
14212
14213         * class.cs (Method.Emit): If we have a symbol writer, call its
14214         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14215         tell it about the current method.
14216
14217         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14218         writer that we're going to emit the first byte of IL code for a new
14219         statement (a new source line).
14220         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14221         EmitContext.Mark() before emitting any code.
14222
14223         * location.cs (SymbolDocument): Return null when we're Null.
14224
14225         * statement.cs (Statement): Moved the `Location loc' variable here.
14226         (Statement.EmitBoolExpression): If we have a symbol writer, call
14227         ec.Mark() before emitting any code to tell it that we're at the
14228         beginning of a new statement.
14229         (StatementExpression): Added `Location' argument to the constructor.
14230         (Block): Added public readonly variable `StartLocation' and public
14231         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14232         (Block): Added constructor which takes a start and end location.
14233         (Block.SetEndLocation): New method. This sets the end location.
14234         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14235         local variables we create.
14236         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14237         each statement and do also mark the begin and end of the block.
14238
14239         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14240         tell it the current lexer.Location, use Location.Null for the end of the
14241         block.
14242         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14243         current block, set its end location using SetEndLocation().
14244         (statement_expression): StatementExpression constructor now takes the
14245         lexer.Location as additional argument.
14246         (for_statement, declare_local_variables): Likewise.
14247         (declare_local_variables): When creating a new implicit block, use the
14248         new Block constructor and pass it the lexer.Location.
14249
14250 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14251
14252         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14253         members also on the parent interfaces recursively.
14254
14255 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14256
14257         * report.cs: Use new formats, since Gonzalo finished the missing
14258         bits. 
14259
14260         * expression.cs (Binary.ResolveOperator): added missing operator|
14261         operator& and operator^ for bool/bool.
14262
14263         * cs-parser.jay: CheckDef now takes a Location argument that is
14264         used to report errors more precisly (instead of reporting the end
14265         of a definition, we try to track something which is a lot closer
14266         to the source of the problem).
14267
14268         * cs-tokenizer.cs: Track global token use, so we can properly flag
14269         the use of #define/#undef after the first token has been seen.
14270
14271         Also, rename the reportXXXX to Error_DescriptiveName
14272
14273         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14274         TypeContainer, so that Enum and Interface can use this too.
14275
14276         * class.cs (TypeContainer.LookupInterfaceOrClass,
14277         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14278         `builder' argument.  Typically this was used to pass the parent
14279         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14280         the definition).  
14281
14282         The problem is that a nested class could trigger the definition of
14283         a toplevel class, and the builder would be obviously wrong in that
14284         case. 
14285
14286         So we drop this argument, and we compute dynamically the
14287         TypeBuilder/ModuleBuilder (the correct information was available
14288         to us anyways from DeclSpace.Parent)
14289
14290         * interface.cs (Interface.DefineInterface): Drop builder
14291         parameter cleanup like class.cs
14292
14293         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14294         like class.cs
14295
14296         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14297         values. 
14298
14299         (Try.Emit): Propagate the returns value from the statement.
14300
14301         (Return.Emit): Even if we are leavning 
14302
14303         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14304
14305         * modifiers.cs: Fix the computation of MethodAttributes flags.
14306
14307 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14308
14309         * driver.cs: allow compilation of files that start with '/'.
14310         Add a default case when checking the argument of --target.
14311
14312 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14313
14314         * interface.cs: Implement the same search algorithm for types in
14315         the interface code.
14316
14317         * delegate.cs: Do not allow multiple definition.
14318
14319         * Recovered ChangeLog that got accidentally amputated
14320
14321         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14322
14323         * rootcontext.cs: Load manually enum to allow core classes to
14324         contain enumerations.
14325
14326         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14327         Update to new static methods in TypeManager.
14328
14329         * typemanager.cs (GetMethod, GetConstructor): Use our
14330         implementation of FindMembers to find the members, since during
14331         corlib compilation, the types are TypeBuilders and GetMethod and
14332         GetConstructor do not work.
14333
14334         Make all methods in TypeManager static.
14335
14336         (InitCodeHelpers): Split the functionality from
14337         the InitCodeTypes function.
14338
14339         * driver.cs: Call InitCodeHelpers after we have populated the
14340         types. 
14341
14342         * cs-parser.jay (delegate_declaration): we did not used to compute
14343         the delegate name correctly for void delegates.
14344
14345 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * rootcontext.cs (RootContext): Init the interface_resolve_order
14348         and type_container_resolve_order always.
14349
14350         (ResolveCore, BootstrapCorlib_ResolveClass,
14351         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14352         compiler when compiling with --nostdlib
14353
14354         * class.cs (TypeContainer.DefineType): Check that our parent is
14355         not null.  This test is most important when we are bootstraping
14356         the core types.
14357
14358         * codegen.cs: Split out the symbol writing code.
14359
14360 2002-03-25  Martin Baulig  <martin@gnome.org>
14361
14362         * driver.cs (-g): Made -g an alias for --debug.
14363
14364 2002-03-24  Martin Baulig  <martin@gnome.org>
14365
14366         * codegen.cs (SymbolWriter): New public variable. Returns the
14367         current symbol writer.
14368         (CodeGen): Added `bool want_debugging_support' argument to the
14369          constructor. If true, tell the ModuleBuild that we want debugging
14370         support and ask it for the ISymbolWriter.
14371         (Save): If we have a symbol writer, call it's Close() method after
14372         saving the assembly.
14373
14374         * driver.c (--debug): New command line argument to create a
14375         debugger information file.
14376
14377         * location.cs (SymbolDocument): New public property. Returns an
14378         ISymbolDocumentWriter object for the current source file or null
14379         if we don't have a symbol writer.
14380
14381 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14382
14383         * driver.cs (LoadAssembly): Correctly return when all the paths
14384         have been tried and not before.
14385
14386         * statement.cs (Switch.Emit): return the actual coverage for this
14387         statement (returns/not-returns)
14388
14389         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14390         switch of the statement if we are the last switch section.  That
14391         kills two problems: try/catch problems (we used to emit an empty
14392         nop at the end) and switch statements where all branches would
14393         return. 
14394
14395 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14396
14397         * driver.cs: Add default assemblies (the equivalent to the
14398         Microsoft CSC.RSP file)
14399
14400         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14401         also update tokens_seen and set it to false.
14402
14403         * driver.cs: Implement --recurse for Mike.
14404
14405         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14406         correctly splitting out the paths.
14407
14408 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14409
14410         * interface.cs (Interface.PopulateProperty): Instead of using
14411         `parent' as the declaration space for the set parameters, use
14412         `this' 
14413
14414         * support.cs (InternalParameters): InternalParameters constructor
14415         takes a DeclSpace instead of a TypeContainer.
14416
14417         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14418         types are being initialized, load the address of it before calling
14419         the function.  
14420
14421         (New): Provide a mechanism to disable the generation of local
14422         value type temporaries when the caller will be providing us with
14423         an address to store it.
14424
14425         (ArrayCreation.EmitDynamicInitializers): Use it.
14426
14427 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14428
14429         * expression.cs (Invocation.EmitArguments): Only probe for array
14430         property if there is more than one argument.  Sorry about that.
14431
14432         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14433         empty param arrays.
14434
14435         * class.cs (Method.LabelParameters): Fix incorrect code path that
14436         prevented the `ParamArrayAttribute' from being applied to the
14437         params attribute.
14438
14439 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14440
14441         * support.cs (ReflectionParameters): Correctly compute whether the
14442         last argument is a params array.  Fixes the problem with
14443         string.Split ('a')
14444
14445         * typemanager.cs: Make the assemblies array always be non-null
14446         (empty, but non-null)
14447
14448         * tree.cs (RecordDecl): New function that abstracts the recording
14449         of names.  This reports error 101, and provides a pointer to the
14450         previous declaration.  Fixes a crash in the compiler.
14451
14452         * cs-parser.jay (constructor_declaration): Update to new grammar,
14453         and provide a constructor_body that can be empty.
14454
14455 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14456
14457         * driver.cs: Add support for --resources.
14458
14459         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14460         Make all types for the various array helper methods be integer.
14461
14462         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14463         CheckState to ConvCast.
14464
14465         (ConvCast): Now it takes a `checked' state argument, to avoid
14466         depending on the emit context for the conversion, and just using
14467         the resolve time setting.
14468
14469         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14470         instead of Invocation.EmitArguments.  We do not emit the original
14471         arguments, instead we emit those which have been converted to
14472         unsigned int expressions.
14473
14474         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14475
14476         * codegen.cs: ditto.
14477
14478         * expression.cs (LocalVariableReference): Drop the use of the
14479         Store function that depended on the variable index.
14480
14481         * statement.cs (VariableInfo): Drop the `Idx' property from this
14482         class, as this is not taking into account the indexes for
14483         temporaries tat we generate during the execution, getting the
14484         indexes wrong.
14485
14486         * class.cs: First emit class initializers, then call the parent
14487         constructor. 
14488
14489         * expression.cs (Binary): Fix opcode emision.
14490         (UnaryMutator.EmitCode): Support checked code generation
14491
14492         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14493         matches for events for both the Static and Instance scans,
14494         pointing to the same element.   Fix that.
14495
14496 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14497
14498         * rootcontext.cs (ResolveTree): Always set the
14499         interface_resolve_order, because nested interfaces will be calling
14500         into us.
14501
14502         * class.cs (GetInterfaceOrClass): Track the same resolution
14503         process used by TypeManager.LookupType.  This fixes the nested
14504         type lookups in class declarations (separate path from
14505         LookupType). 
14506
14507         (TypeContainer.DefineType): Also define nested interfaces.
14508         (TypeContainer.RegisterOrder): New public function used to
14509         register the order in which child interfaces need to be closed.
14510
14511         Nested interfaces need to be closed after their parents have been
14512         created. 
14513
14514         * interface.cs (InterfaceAttr): Put all the logic for computing
14515         the interface attribute here. 
14516
14517         (DefineInterface): Register our interface order with the
14518         RootContext or with the TypeContainer depending on the case.
14519
14520 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14521
14522         * cs-parser.jay: rework foreach statement to work with the new
14523         changes to the policy on SimpleNames.
14524
14525         * report.cs: support Stacktrace on warnings as well.
14526
14527         * makefile: drop --unsafe and /unsafe from the compile.
14528
14529 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14530
14531         * ecore.cs (StandardConversionExists): Modify to take an Expression
14532         as the first parameter. Ensure we do null -> reference type conversion
14533         checking.
14534
14535         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14536         temporary Expression objects.
14537
14538 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14539
14540         * interface.cs: workaround bug in method overloading resolution
14541         (there is already a bugzilla bug for it).
14542
14543 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14544
14545         We could also solve this problem by having a separate path for
14546         performing type lookups, instead of DoResolve, we could have a
14547         ResolveType entry point, and only participating pieces of the
14548         production (simplename, deref, array) would implement this. 
14549
14550         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14551         signal SimpleName to only resolve type names and not attempt to
14552         resolve anything else.
14553
14554         * expression.cs (Cast): Set the flag.
14555
14556         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14557
14558         * class.cs: Only report 108 if there is no `new' modifier.
14559
14560         * cs-parser.jay: rework foreach statement to work with the new
14561         changes to the policy on SimpleNames.
14562
14563         * report.cs: support Stacktrace on warnings as well.
14564
14565         * makefile: drop --unsafe and /unsafe from the compile.
14566
14567 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14568
14569         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14570         lookups here, instead of doing that at parse time.  This means
14571         that our grammar will not introduce `LocalVariableReferences' as
14572         expressions at this point.  That solves the problem of code like
14573         this:
14574
14575         class X {
14576            static void Main ()
14577            { int X = 1;
14578             { X x = null }}}
14579
14580         This is only half the fix.  The full fix requires parameters to
14581         also be handled in this way.
14582
14583         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14584         makes the use more obvious of the DeclSpace.  The
14585         ec.TypeContainer.TypeBuilder is now only used to pull the
14586         TypeBuilder for it.
14587
14588         My theory is that I can get rid of the TypeBuilder completely from
14589         the EmitContext, and have typecasts where it is used (from
14590         DeclSpace to where it matters).  
14591
14592         The only pending problem is that the code that implements Aliases
14593         is on TypeContainer, and probably should go in DeclSpace.
14594
14595         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14596         lookups here, instead of doing that at parse time.  This means
14597         that our grammar will not introduce `LocalVariableReferences' as
14598         expressions at this point.  That solves the problem of code like
14599         this:
14600
14601         class X {
14602            static void Main ()
14603            { int X = 1;
14604             { X x = null }}}
14605
14606         This is only half the fix.  The full fix requires parameters to
14607         also be handled in this way.
14608
14609         * class.cs (Property.DefineMethod): When implementing an interface
14610         method, set newslot, when implementing an abstract method, do not
14611         set the flag (before we tried never setting it, or always setting
14612         it, which is the difference).
14613         (Indexer.DefineMethod): same.
14614         (Method.DefineMethod): same.
14615
14616         * ecore.cs: Only set the status used flag if we get back a Field.
14617
14618         * attribute.cs: Temporary hack, so Paolo can keep working.
14619
14620 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14621
14622         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14623         the unmanaged type in the case we have a MarshalAs attribute.
14624
14625         (Resolve): Handle the case when we are parsing the special MarshalAs
14626         attribute [we need to store the unmanaged type to use later]
14627
14628         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14629         MarshalAs Attribute.
14630
14631         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14632         on parameters and accordingly set the marshalling info.
14633
14634 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14635
14636         * class.cs: Optimizing slightly by removing redundant code after
14637         we switched to the `NoTypes' return value.
14638         (Property.DefineMethod): use NoTypes here too.
14639
14640         This fixes the bug I introduced in my last batch of changes.
14641
14642 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14643
14644         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14645
14646         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14647         Enums since those are types too. 
14648
14649         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14650
14651         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14652         thanks to a call during the lookup process.
14653
14654 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14655
14656         * statement.cs (Foreach): Lots of work to accomodate a particular
14657         kind of foreach statement that I had not kept in mind.  It is
14658         possible to have foreachs on classes that provide a GetEnumerator
14659         method that return objects that implement the "pattern" for using
14660         a foreach, there is no need to support GetEnumerator
14661         specifically. 
14662
14663         This is needed to compile nant.
14664
14665         * decl.cs: Only report 114 if the member is not `Finalize' and if
14666         the warning level is at least 2.
14667
14668         * class.cs: Moved the compare function from Method to
14669         MethodSignature. 
14670
14671         (MethodSignature.InheritableMemberSignatureCompare): Add new
14672         filter function that is used to extract inheritable methods from a
14673         class. 
14674
14675         (Method.Define): Use the new `inheritable_method_signature_filter'
14676         delegate
14677
14678         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14679         command. 
14680
14681 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
14682
14683         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14684
14685         * cs-parser.jay: Add opt_semicolon to the interface declaration.
14686
14687         * expression.cs: Pass location information to
14688         ConvertImplicitStandard. 
14689
14690         * class.cs: Added debugging code to track return values from
14691         interfaces. 
14692
14693 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
14694
14695         * expression.cs (Is.DoResolve): If either side of the `is' is an
14696         interface, do not flag the warning.
14697
14698         * ecore.cs (ImplicitReferenceConversion): We need a separate test
14699         for interfaces
14700
14701         * report.cs: Allow for --fatal to be used with --probe.
14702
14703         * typemanager.cs (NoTypes): Move the definition for the empty Type
14704         array here. 
14705
14706         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14707         properties. 
14708         (TypeContainer.DefineProxy): New function used to proxy to parent
14709         implementations when implementing interfaces.
14710         (TypeContainer.ParentImplements): used to lookup if our parent
14711         implements a public function that is required by an interface.
14712         (TypeContainer.VerifyPendingMethods): Hook this up.
14713
14714         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14715         `modules' and `assemblies' arraylists into arrays.  We only grow
14716         these are the very early start up of the program, so this improves
14717         the speedof LookupType (nicely measured).
14718
14719         * expression.cs (MakeByteBlob): Replaced unsafe code with
14720         BitConverter, as suggested by Paolo.
14721
14722         * cfold.cs (ConstantFold.Binary): Special case: perform constant
14723         folding of string concatenation, but if either side is a string,
14724         and the other is not, then return null, and let the runtime use
14725         the concatenation on the string plus the object (using
14726         `Object.ToString'). 
14727
14728 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
14729
14730         Constant Folding has been implemented now.
14731
14732         * expression.cs (Unary.Reduce): Do not throw an exception, catch
14733         the error instead on types that are not supported in one's
14734         complement. 
14735
14736         * constant.cs (Constant and all children): New set of functions to
14737         perform implict and explicit conversions.
14738
14739         * ecore.cs (EnumConstant): Implement the new functions to perform
14740         conversion by proxying to the child expression.
14741
14742         * codegen.cs: (ConstantCheckState): Constant evaluation has its
14743         own separate setting that can not be turned off from the command
14744         line using --unchecked or --checked and is only controlled using
14745         the checked/unchecked statements and expressions.  This setting is
14746         used by the constant folder to flag errors.
14747
14748         * expression.cs (CheckedExpr, UncheckedExpr): Set the
14749         ConstantCheckState as well.   
14750
14751         During Resolve, they also have to flag the state, because the
14752         constant folder runs completely in the Resolve phase.
14753
14754         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14755         well.
14756
14757 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14758
14759         * cfold.cs: New file, this file contains the constant folder.
14760
14761         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14762         argument to track whether we are using the resulting address to
14763         load or store a value and provide better error messages. 
14764
14765         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14766         new AddressOf arguments.
14767
14768         * statement.cs (Foreach.EmitCollectionForeach): Update
14769
14770         * expression.cs (Argument.Emit): Call AddressOf with proper
14771         arguments to track usage.
14772
14773         (New.DoEmit): Call AddressOf with new arguments.
14774
14775         (Unary.Emit): Adjust AddressOf call.
14776
14777 2002-03-01  Ravi Pratap  <ravi@ximian.com>
14778
14779         * cs-parser.jay (member_access): Change the case for pre-defined types
14780         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
14781         this suggestion.
14782
14783         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14784         a method body.
14785
14786         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14787         essentially like methods and apply attributes like MethodImplOptions to them too.
14788
14789         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14790         not being null.
14791
14792         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14793         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14794         is the DeclSpace.
14795
14796         * Update code everywhere accordingly.
14797
14798         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14799
14800         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14801
14802 2002-02-28  Ravi Pratap  <ravi@ximian.com>
14803
14804         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14805         try performing lookups against those instead of jumping straight into using
14806         the 'using' clauses.
14807
14808         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14809
14810         (LookupType): Perform lookups in implicit parents too.
14811
14812         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14813         sequence as RootContext.LookupType. 
14814
14815         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
14816         the various cases of namespace lookups into this method.
14817
14818 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
14819
14820         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14821         in positional arguments)
14822
14823         * class.cs (Operator): Update the AllowedModifiers to contain
14824         extern. 
14825
14826         * cs-parser.jay: Update operator declaration to allow for the
14827         operator body to be empty.
14828
14829         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14830         values. 
14831
14832 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
14833
14834         * class.cs (Method.Emit): Label parameters.
14835
14836         * driver.cs: Return 1 or 0 as the program exit code.
14837
14838 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
14839
14840         * expression.cs: Special case the `null' object when trying to
14841         auto-compute the type, as anything can be explicitly converted to
14842         that. 
14843
14844         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14845         spotting this Paolo.
14846
14847         (Expression.ImplicitNumericConversion): Perform comparissions of
14848         the type using the underlying type in the case of an enumeration
14849         rather than using the enumeration type for the compare.
14850
14851         Cope with the underlying == type case, which is not possible to
14852         catch before. 
14853
14854         (Expression.ConvertNumericExplicit): Perform comparissions of
14855         the type using the underlying type in the case of an enumeration
14856         rather than using the enumeration type for the compare.
14857
14858         * driver.cs: If the user does not supply an extension, assume .exe
14859
14860         * cs-parser.jay (if_statement): Rewrote so that we can track the
14861         location for the if statement.
14862
14863         * expression.cs (Binary.ConstantFold): Only concat strings when
14864         the operation is "+", not everything ;-)
14865
14866         * statement.cs (Statement.EmitBoolExpression): Take a location
14867         argument. 
14868         (If, While, Do): Track location.
14869
14870         * expression.cs (Binary.ResolveOperator): In the object + string
14871         case, I was missing a call to ConvertImplicit
14872
14873 2002-02-25  Ravi Pratap  <ravi@ximian.com>
14874
14875         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14876         Location arguments. Ensure we use RootContext.LookupType to do our work
14877         and not try to do a direct Type.GetType and ModuleBuilder.GetType
14878
14879         * interface.cs (PopulateMethod): Handle the type of the parameter being
14880         null gracefully.
14881
14882         * expression.cs (Invocation.BetterFunction): Handle the case when we 
14883         have a params method with no fixed arguments and a call is made with no
14884         arguments.
14885
14886 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14889         the verbatim-string-literal
14890
14891         * support.cs (InternalParameters.ParameterModifier): handle null
14892         fixed parameters.
14893         (InternalParameters.ParameterType): ditto.
14894
14895         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14896         duplicating the name of the variable parameter.
14897         (GetParameterByName): Fix bug where we were not looking up array
14898         paramters if they were the only present (thanks Paolo!).
14899         (GetParameterInfo): We only have an empty set of types if both
14900         fixed and array are set to null.
14901         (GetParameterInfo-idx): Handle FixedParameter == null
14902
14903         * cs-parser.jay: Handle the case where there is no catch
14904         statements (missing null test).
14905
14906 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
14907
14908         * driver.cs (MainDriver): Be conservative on our command line
14909         handling.
14910
14911         Catch DirectoryNotFoundException when calling GetFiles.
14912
14913         (SplitPathAndPattern): Used to split the input specification into
14914         a path and a pattern that we can feed to Directory.GetFiles.
14915
14916 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
14917
14918         * statement.cs (Fixed): Implement the last case of the Fixed
14919         statement (string handling).
14920
14921         * expression.cs (StringPtr): New class used to return a char * to
14922         a string;  Used by the Fixed statement.
14923
14924         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
14925
14926         * expression.cs (Binary.ResolveOperator): Remove redundant
14927         MemberLookup pn parent type.
14928         Optimize union call, we do not need a union if the types are the same.
14929         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14930         type.
14931
14932         Specialize the use of MemberLookup everywhere, instead of using
14933         the default settings. 
14934
14935         (StackAlloc): Implement stackalloc keyword.
14936
14937         * cs-parser.jay: Add rule to parse stackalloc.
14938
14939         * driver.cs: Handle /h, /help, /?
14940
14941         * expression.cs (MakeByteBlob): Removed the hacks we had in place
14942         before we supported unsafe code.
14943
14944         * makefile: add --unsafe to the self compilation of mcs.
14945
14946 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * expression.cs (PointerArithmetic): New class that is used to
14949         perform pointer arithmetic.
14950         (Binary.Resolve): Handle pointer arithmetic
14951         Handle pointer comparission.
14952         (ArrayPtr): Utility expression class that is used to take the
14953         address of an array.
14954
14955         (ElementAccess): Implement array access for pointers
14956
14957         * statement.cs (Fixed): Implement fixed statement for arrays, we
14958         are missing one more case before we are done.
14959
14960         * expression.cs (Indirection): Implement EmitAssign and set the
14961         ExprClass to Variable.  This allows pointer dereferences to be
14962         treated as variables, and to have values assigned to them.
14963
14964         * ecore.cs (Expression.StoreFromPtr): New utility function to
14965         store values dereferencing.
14966
14967 2002-02-20  Ravi Pratap  <ravi@ximian.com>
14968
14969         * expression.cs (Binary.ResolveOperator): Ensure that we are
14970         not trying to operate on a void type - this fixes the reported
14971         bug.
14972
14973         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
14974         the parent implementation is sealed.
14975
14976         * ../errors/cs0239.cs : Add.
14977
14978         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
14979
14980         * typemanager.cs (unverifiable_code_type): Corresponds to 
14981         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
14982         which have unsafe code in them.
14983
14984         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
14985         unsafe context.
14986
14987 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
14988
14989         * cs-tokenizer.cs: Add support for @"litreal strings"
14990
14991         Make tokenizer accept pre-processor directives
14992         on any column (remove the old C-like limitation). 
14993
14994         * rootcontext.cs (EmitCode): Emit any global attributes.
14995         (AddGlobalAttributes): Used to keep track of assembly attributes. 
14996
14997         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
14998
14999         * cs-parser.jay: Add support for global attributes.  
15000
15001 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15002
15003         * expression.cs (Indirection): New helper class.  Unary will
15004         create Indirection classes to be able to implement the
15005         IMemoryLocation interface on it.
15006
15007 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15008
15009         * cs-parser.jay (fixed_statement): reference the right statement.
15010
15011         * statement.cs (Fixed.Emit): Finish implementing the fixed
15012         statement for the &x case.
15013
15014 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15015
15016         * class.cs (Property.Define, Method.Define): Remove newslot when
15017         `implementing'.  
15018
15019         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15020         wrong.  NewSlot should only be used if the `new' keyword is present.
15021
15022         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15023         locating our system dir.  Sorry about this.
15024
15025 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15026
15027         * driver.cs (GetSystemDir): Compute correctly the location of our
15028         system assemblies.  I was using the compiler directory instead of
15029         the library directory.
15030
15031 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15032
15033         * expression.cs (BetterFunction): Put back in what Miguel commented out
15034         since it is the correct fix. The problem is elsewhere ;-)
15035
15036         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15037         parameters of the parms method are themselves compatible or not !
15038
15039         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15040         to check that a class implements an interface before saying that an implicit
15041         conversion was allowed. Use ImplementsInterface to do the checking.
15042
15043 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15044
15045         * class.cs (Method.Define): Track whether we are an explicit
15046         implementation or not.  And only call DefineMethodOverride if we
15047         are an explicit implementation.
15048
15049         (Property.DefineMethod): Ditto.
15050
15051 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15052
15053         * expression.cs (BetterFunction): Catch hideous bug which was
15054          preventing us from detecting ambiguous calls due to implicit casts i.e
15055         cs0121.
15056
15057 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * support.cs (Pair): Remove un-needed method.  I figured why I was
15060         getting the error in cs-parser.jay, the variable in a foreach loop
15061         is readonly, and the compiler does not really treat this as a variable.
15062
15063         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15064         instead of EQUALS in grammar.  
15065
15066         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15067
15068         * expression.cs (Unary.DoResolve): Check whether the argument is
15069         managed or not.
15070
15071 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * support.cs: Api for Pair to set a value.  Despite the fact that
15074         the variables are public the MS C# compiler refuses to compile
15075         code that accesses the field if the variable is part of a foreach
15076         statement. 
15077
15078         * statement.cs (Fixed): Begin implementation of the fixed
15079         statement.
15080
15081         (Block.AddVariable): Return the VariableInfo on success and null
15082         on failure instead of true/false. 
15083
15084         * cs-parser.jay (foreach): Catch errors on variables already
15085         defined (we were ignoring this value before) and properly unwind
15086         the block hierarchy
15087
15088         (fixed_statement): grammar for the fixed statement.
15089
15090 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15091
15092         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15093         pointer types to be incretemented.
15094
15095         (SizeOf): Implement.
15096
15097         * cs-parser.jay (pointer_member_access): Implement
15098         expr->IDENTIFIER production.
15099
15100         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15101         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15102         on safe contexts.
15103
15104         (Unary): Implement indirection.
15105
15106         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15107         use in non-unsafe context).
15108
15109         (SimpleName.DoResolve): Check for pointers in field access on safe
15110         contexts. 
15111
15112         (Expression.LoadFromPtr): Factor the load-indirect code in this
15113         function.  This was duplicated in UnboxCast and ParameterReference
15114
15115 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15116
15117         * expression.cs (ComposedCast): report an error if a pointer cast
15118         is used in a safe region.
15119
15120         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15121         pointer type casts in unsafe context.
15122
15123         * codegen.cs (EmitContext): Set up IsUnsafe.
15124
15125         * cs-parser.jay (non_expression_type): Add productions for pointer
15126         casts. 
15127
15128         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15129         code.  We should not use force into static mode if the method is
15130         not virtual.  Fixes bug in MIS
15131
15132         * statement.cs (Do.Emit, While.Emit, For.Emit,
15133         Statement.EmitBoolExpression): Add support to Do and While to
15134         propagate infinite loop as `I do return' semantics.
15135
15136         Improve the For case to also test for boolean constants.
15137
15138         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15139         to the list of attributes we can add.
15140
15141         Remove `EmitContext' argument.
15142
15143         * class.cs (Method.Define): Apply parameter attributes.
15144         (Constructor.Define): Apply parameter attributes.
15145         (MethodCore.LabelParameters): Move here the core of labeling
15146         parameters. 
15147
15148         * support.cs (ReflectionParameters.ParameterModifier,
15149         InternalParameters.ParameterModifier): Use IsByRef on the type and
15150         only return the OUT bit for these parameters instead of in/out/ref
15151         flags.
15152
15153         This is because I miss-understood things.  The ParameterInfo.IsIn
15154         and IsOut represent whether the parameter has the [In] and [Out]
15155         attributes set.  
15156
15157 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15158
15159         * ecore.cs (FieldExpr.Emit): Release temporaries.
15160
15161         * assign.cs (LocalTemporary.Release): new function.
15162
15163         * codegen.cs (EmitContext.GetTemporaryStorage,
15164         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15165         temporary storage.  Now we can "put back" localbuilders when we
15166         are done with them
15167
15168 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15169
15170         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15171         need to make a copy of the variable to generate verifiable code.
15172
15173 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15174
15175         * driver.cs: Compute dynamically the system directory.
15176
15177         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15178         Slower, but more generally useful.  Used by the abstract
15179         registering implementation. 
15180
15181         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15182         the rules for the special rule on Type/instances.  First check if
15183         we have the same name, and if so, try that special static path
15184         rather than the instance path.
15185
15186 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15187
15188         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15189         for, while and if.
15190
15191         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15192         Enum, ValueType, Delegate or Array for non-corlib compiles.
15193
15194         * cs-tokenizer.cs: Catch long identifiers (645)
15195
15196         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15197         piece of code.
15198
15199         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15200         fix, we were returning too early, so we were not registering
15201         pending methods from abstract classes.
15202
15203         Do not register pending methods if the class is abstract.
15204
15205         * expression.cs (Conditional.DoResolve): Report circular implicit
15206         conversions when we neecd to compute it for conditional
15207         expressions. 
15208
15209         (Is.DoResolve): If the expression is always of the provided type,
15210         flag warning 183.  If the expression can not ever be of the
15211         provided type flag warning 184.
15212
15213         * class.cs: Catch 169 as well.
15214
15215         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15216         read. 
15217
15218 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15219
15220         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15221
15222 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15223
15224         * interface.cs: (PopulateMethod): Check for pointers being defined
15225         only if the unsafe context is active.
15226         (PopulateProperty): ditto.
15227         (PopulateIndexer): ditto.
15228
15229         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15230         specified.  If pointers are present, make sure that they are
15231         present in an unsafe context.
15232         (Constructor, Constructor.Define): ditto.
15233         (Field, Field.Define): ditto.
15234         (Property, Property.Define): ditto.
15235         (Event, Event.Define): ditto.
15236
15237         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15238         hashtable if there are classes or structs defined.
15239
15240         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15241         code, as the constant resolution moved.
15242
15243         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15244         the metadata, so we can flag error 133. 
15245
15246         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15247         pointer is being declared in an unsafe context.
15248
15249 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15250
15251         * modifiers.cs (Modifiers.Check): Require a Location argument.
15252         Report error 227 for Unsafe use.
15253
15254         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15255
15256         * statement.cs (For.Emit): If the test is null, then report that
15257         we do `return', as we wont reach anything afterwards.
15258
15259         (Switch.SwitchGoverningType): Track the expression that matched
15260         the conversion.
15261
15262         * driver.cs: Allow negative numbers as an error code to flag.
15263
15264         * cs-parser.jay: Handle 1551.
15265
15266         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15267
15268 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15269
15270         * cs-parser.jay: Report 1518 (type declaration can only contain
15271         class, struct, interface, enum or delegate)
15272
15273         (switch_label): Report 1523 (keywords `case' or `default' must
15274         preced code)
15275
15276         (opt_switch_sections): Report 1522 (empty switch)
15277
15278         * driver.cs: Report 1515 (response file specified multiple times)
15279         Report 1516 (Source file specified multiple times).
15280
15281         * expression.cs (Argument.Resolve): Signal 1510
15282
15283         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15284         access not allowed in static code)
15285
15286 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15287
15288         * typemanager.cs (IsPointerType): Utility method which we are going
15289         to need a lot.
15290
15291         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15292         the object type, so we take care of that.
15293
15294         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15295
15296         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15297         added to non-params parameters :-)
15298
15299         * typemanager.cs (CSharpName): Include 'void' type too. 
15300
15301         (void_ptr_type): Include in the set of core types.
15302
15303         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15304         duplicating code.
15305
15306         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15307         an unsafe context.
15308
15309         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15310         completely forgotten about it.
15311
15312 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15313
15314         * cs-parser.jay (pointer_type): Add. This begins our implementation
15315         of parsing rules for unsafe code.
15316
15317         (unsafe_statement): Implement.
15318
15319         (embedded_statement): Modify to include the above.
15320
15321         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15322
15323         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15324         if the current context is an unsafe one.
15325
15326         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15327         are handled differently, we need separate rules for them.
15328
15329         (local_variable_declaration): Update to use local_variable_pointer_type
15330         to allow variable declarations of unmanaged pointer types.
15331
15332         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15333         in unsafe contexts.
15334
15335         * ../errors/cs0214.cs : Add.
15336
15337 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15338
15339         * makefile: remove 'response' file when cleaning.
15340
15341 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15342
15343         * cs-parser.jay: Report 1524.
15344
15345 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15346
15347         * typemanager.cs (RegisterMethod): drop checking if we have
15348         registered this from here
15349
15350 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15351
15352         * class.cs (Method.EmitDestructor): Implement calling our base
15353         destructor. 
15354
15355         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15356         value of InFinally.
15357
15358         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15359         this routine and will wrap the call in a try/catch block.  Deal
15360         with the case.
15361
15362 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15363
15364         * ecore.cs (Expression.MemberLookup): instead of taking a
15365         parameter `same_type' that was used to tell whether we could
15366         access private members we compute our containing type from the
15367         EmitContext.
15368
15369         (FieldExpr): Added partial support for volatile fields.  This does
15370         not work for volatile fields exposed from assemblies, as I can not
15371         figure out how to extract the modreq from it.
15372
15373         Updated all the source files to use this.
15374
15375         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15376         because it is referenced by MemberLookup very often. 
15377
15378 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15379
15380         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15381         TypeBuilder.GetCustomAttributes to retrieve what we need.
15382
15383         Get rid of redundant default_member_attr_type as this is the same as
15384         default_member_type which already exists.
15385
15386         * interface.cs, attribute.cs : Update accordingly.
15387
15388 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15389
15390         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15391         work for TYpeBuilders though.  Ravi, can you please fix this?
15392
15393         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15394
15395         * expression.cs (Argument.Emit): Handle the case of ref objects
15396         being passed to ref functions;  
15397
15398         (ParameterReference.EmitLoad): Loads the content of the pointer
15399         without dereferencing.
15400
15401 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15402
15403         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15404
15405 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15406
15407         * class.cs (Indexer.DefineMethod): Incorporate the interface
15408         type in the name of the method if we are doing explicit interface
15409         implementation.
15410
15411         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15412
15413         (BetterConversion): Fix extremely trivial bug where we were referring to
15414         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15415         again !
15416
15417         * ../errors/bug16.cs : Add although we have fixed it.
15418
15419 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15420
15421         * expression.cs (BaseIndexer): Begin implementation.
15422
15423         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15424
15425         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15426         production directly to remove a shift/reduce, and implement
15427         explicit interface implementation.
15428
15429         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15430         after a floating point suffix.
15431
15432         * expression.cs (DoNumericPromotions): Improved the conversion for
15433         uint/uint.  If we have a constant, we avoid doing a typecast to a
15434         larger type.
15435
15436         * class.cs (Indexer): Implement explicit interface implementation
15437         for indexers.
15438
15439 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15440
15441         * class.cs: make the default instance constructor public and hidebysig.
15442
15443 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15444
15445         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15446         so we can call it from elsewhere.
15447
15448         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15449         we emit it internally if the class has a defined indexer; otherwise the user
15450         emits it by decorating the class definition with the DefaultMemberAttribute.
15451
15452         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15453         attribute is not used on a type which defines an indexer.
15454
15455         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15456         character when we skip whitespace.
15457
15458         * ../errors/cs0646.cs : Add.
15459
15460 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15461
15462         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15463         again. 
15464
15465         * makefile: Add practical target `mcs3.exe' which builds the third
15466         generation compiler. 
15467
15468         * expression.cs (New): Fix structures constructor calling.
15469
15470         * class.cs (Property, Method, Indexer): Emit Final flag on the
15471         method if we are an interface implementation and we are not
15472         abstract. 
15473
15474         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15475         whether this property is referencing a `base' method.
15476
15477         * expression.cs (Invocation.EmitCall): take an extra argument:
15478         is_base, this is used to determine whether the `call' or
15479         `callvirt' opcode should be used.
15480
15481
15482         * delegate.cs: update EmitCall.
15483
15484         * class.cs (Method.Define): Set NewSlot for the cases where we are
15485         not implementing an interface method.
15486
15487         (Property.Define): ditto.
15488
15489 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15490
15491         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15492         'r'.  Allows mcs to parse itself fully.
15493
15494 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15495
15496         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15497         of the number of initializers that require the InitializeArray method.
15498
15499         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15500         update the above field where necessary.
15501
15502         (MakeByteBlob): Update accordingly.
15503
15504         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15505         greater than 2.
15506
15507         (EmitDynamicInitializers): Update in accordance with the new optimization.
15508
15509         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15510         same OpCode applies.
15511
15512         * cs-parser.jay : Fix some glaring errors I introduced.
15513
15514 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15515
15516         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15517         so that we can check for name clashes there too.
15518
15519         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15520         for interface indexers.
15521
15522         * interfaces.cs (Define): Emit the default member attribute.
15523
15524         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15525         variable was being referred to while setting the value ;-)
15526
15527 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15528
15529         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15530         byte-by-byte information when we know the data is zero.
15531
15532         Make the block always a multiple of 4, because
15533         DefineInitializedData has a bug.
15534
15535         * assign.cs: Fix, we should assign from the temporary, not from
15536         the source. 
15537
15538         * expression.cs (MakeByteBlob): Fix my incorrect code.
15539
15540 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * typemanager.cs (EnumToUnderlying): This function is used to get
15543         the underlying type from an enumeration, because it does not
15544         always work. 
15545
15546         * constant.cs: Use the I4_S form for values between -128 and 127.
15547
15548         * statement.cs (Block.LookupLabel): Looks up a label.
15549         (Block): Drop support for labeled blocks.
15550
15551         (LabeledStatement): New kind of statement that represents a label
15552         only.
15553
15554         (Goto): Finally implement this bad boy.
15555
15556         * cs-parser.jay: Update to reflect new mechanism to implement
15557         labels.
15558
15559 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15560
15561         * codegen.cs (EmitContext.This): a codegen property that keeps the
15562         a single instance of this instead of creating many different this
15563         instances. 
15564
15565         * delegate.cs (Delegate.DoResolve): Update to use the property;
15566
15567         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15568
15569         * expression.cs (BaseAccess.DoResolve): Ditto.
15570
15571 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15572
15573         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15574         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15575
15576         (InitCoreTypes): Update accordingly.
15577
15578         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15579         so we can quickly store the state.
15580
15581         (ApplyAttributes): Set the correct implementation flags
15582         for InternalCall methods.
15583
15584 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * expression.cs (EmitCall): if a method is not virtual, then do
15587         not use callvirt on it.
15588
15589         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15590         user defined stuff) requires the use of stobj, which takes an
15591         address on the stack instead of an array and an index.  So emit
15592         the Ldelema operation for it.
15593
15594         (EmitStoreOpcode): Use stobj for valuetypes.
15595
15596         (UnaryMutator.EmitCode): Use the right 1 value depending on
15597         whether we are dealing with int64/uint64, float or doubles.
15598
15599         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15600         constructors that I implemented last night.
15601
15602         (Constructor.IsDefault): Fix to work properly for static
15603         constructors.
15604
15605         * cs-parser.jay (CheckDef): report method signature errors.
15606         Update error number 103 to be 132.
15607
15608         * decl.cs: New AdditionResult enumeration value: MethodExists.
15609         Although we do this check for methods later on in the semantic
15610         analysis, catching repeated default constructors is so easy that
15611         we catch these here. 
15612
15613         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15614         promotions code.
15615
15616         (ParameterReference.EmitAssign, Emit): handle
15617         bools as bytes.
15618
15619         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15620         (ArrayAccess.EmitStoreOpcode): ditto.
15621
15622         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15623
15624         * expression.cs (MakeByteBlob): Complete all the missing types
15625         (uint, short, ushort, byte, sbyte)
15626
15627         * class.cs: Only init instance field initializers on instance
15628         constructors. 
15629
15630         Rename `constructors' to instance_constructors. 
15631
15632         (TypeContainer.AddConstructor): Only add constructors to the list
15633         if it is not static.
15634
15635         Make sure that we handle default_static_constructor independently
15636         everywhere where we handle instance_constructors
15637
15638 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15639
15640         * class.cs: Do not lookup or create a base initializer for a
15641         static constructor.
15642
15643         (ConstructorInitializer.Resolve): use the proper type to lookup
15644         for constructors.
15645
15646         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15647
15648         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15649         in DeclSpace. 
15650
15651         * decl.cs: CloseType is now an virtual method, the default
15652         implementation just closes this type.
15653
15654 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15655
15656         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15657         to PreserveSig by default. Also emit HideBySig on such methods.
15658
15659         Basically, set the defaults to standard values.
15660
15661         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15662         argument, if candidate is better, it can't be worse than the best !
15663
15664         (Invocation): Re-write bits to differentiate between methods being
15665         applicable in their expanded form and their normal form - for params
15666         methods of course.
15667
15668         Get rid of use_standard everywhere as only standard conversions are allowed
15669         in overload resolution. 
15670
15671         More spec conformance.
15672
15673 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15674
15675         * driver.cs: Add --timestamp, to see where the compiler spends
15676         most of its time.
15677
15678         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15679         `this' in static code.
15680
15681         (SimpleName.DoResolve): Implement in terms of a helper function
15682         that allows static-references to be passed upstream to
15683         MemberAccess.
15684
15685         (Expression.ResolveWithSimpleName): Resolve specially simple
15686         names when called by MemberAccess to implement the special
15687         semantics. 
15688
15689         (Expression.ImplicitReferenceConversion): Handle conversions from
15690         Null to reference types before others, as Null's type is
15691         System.Object. 
15692
15693         * expression.cs (Invocation.EmitCall): Handle the special case of
15694         calling methods declared on a reference type from a ValueType
15695         (Base classes System.Object and System.Enum)
15696
15697         (MemberAccess.Resolve): Only perform lookups on Enumerations if
15698         the left hand side is a TypeExpr, not on every enumeration. 
15699
15700         (Binary.Resolve): If types are reference types, then do a cast to
15701         object on operators != and == of both arguments.
15702
15703         * typemanager.cs (FindMembers): Extract instance and static
15704         members if requested.
15705
15706         * interface.cs (PopulateProperty): Use void_type instead of null
15707         as the return type for the setter method.
15708
15709         (PopulateIndexer): ditto.
15710
15711 2001-12-27  Ravi Pratap  <ravi@ximian.com>
15712
15713         * support.cs (ReflectionParameters): Fix minor bug where we
15714         were examining the wrong parameter for the ParamArray attribute.
15715
15716         Cope with requests for the type of the parameter at position
15717         greater than the params parameter's. We now return the element
15718         type of the params array as that makes more sense.
15719
15720         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
15721         accordingly as we no longer have to extract the element type
15722         ourselves.
15723
15724         (Invocation.OverloadResolve): Update.
15725
15726 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
15727
15728         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15729         against IEnumerator, test whether the return value is a descendant
15730         of the IEnumerator interface.
15731
15732         * class.cs (Indexer.Define): Use an auxiliary method to implement
15733         the other bits of the method definition.  Begin support for
15734         explicit interface implementation.
15735
15736         (Property.DefineMethod): Use TypeManager.void_type instead of null
15737         for an empty return value.
15738
15739 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
15740
15741         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15742         dealing with a FieldExpr which is composed of a FieldBuilder, in
15743         the code path we did extract the constant, but we should have
15744         obtained the underlying value to be able to cast it (otherwise we
15745         end up in an infinite loop, this is what Ravi was running into).
15746
15747         (ArrayCreation.UpdateIndices): Arrays might be empty.
15748
15749         (MemberAccess.ResolveMemberAccess): Add support for section
15750         14.5.4.1 that deals with the special case of E.I when E is a type
15751         and something else, that I can be a reference to a static member.
15752
15753         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15754         handle a particular array type to create byte blobs, it is just
15755         something we dont generate byteblobs for.
15756
15757         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15758         arguments. 
15759
15760         * location.cs (Push): remove the key from the hashtable that we
15761         are about to add.   This happens for empty files.
15762
15763         * driver.cs: Dispose files after we have parsed them.
15764
15765         (tokenize): new function that only runs the tokenizer on its
15766         input, for speed testing.
15767
15768 2001-12-26  Ravi Pratap  <ravi@ximian.com>
15769
15770         * class.cs (Event.Define): Define the private field only if there
15771         are no accessors defined.
15772
15773         * expression.cs (ResolveMemberAccess): If there is no associated
15774         field with the event, that means we have an event defined with its
15775         own accessors and we should flag error cs0070 since transforming
15776         ourselves into a field is not valid in that case.
15777
15778         * ecore.cs (SimpleName.DoResolve): Same as above.
15779
15780         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15781         and charset to sane values.
15782
15783 2001-12-25  Ravi Pratap  <ravi@ximian.com>
15784
15785         * assign.cs (DoResolve): Perform check on events only if they 
15786         are being accessed outside the declaring type.
15787
15788         * cs-parser.jay (event_declarations): Update rules to correctly
15789         set the type of the implicit parameter etc.
15790
15791         (add_accessor, remove_accessor): Set current local parameters.
15792
15793         * expression.cs (Binary): For delegate addition and subtraction,
15794         cast the return value from the method into the appropriate delegate
15795         type.
15796
15797 2001-12-24  Ravi Pratap  <ravi@ximian.com>
15798
15799         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15800         of these as the workaround is unnecessary.
15801
15802         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15803         delegate data - none of that is needed at all.
15804
15805         Re-write bits to extract the instance expression and the delegate method
15806         correctly.
15807
15808         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
15809         on delegates too.
15810
15811         * attribute.cs (ApplyAttributes): New method to take care of common tasks
15812         of attaching attributes instead of duplicating code everywhere.
15813
15814         * everywhere : Update code to do attribute emission using the above method.
15815
15816 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15817
15818         * expression.cs (IsParamsMethodApplicable): if there are not
15819         parameters, return immediately.
15820
15821         * ecore.cs: The 0 literal can be implicity converted to an enum
15822         type. 
15823
15824         (SimpleName.DoResolve): First lookup the type, then lookup the
15825         members. 
15826
15827         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15828         want to get its address.  If the InstanceExpression is not
15829         addressable, store the result in a temporary variable, then get
15830         the address of it.
15831
15832         * codegen.cs: Only display 219 errors on warning level or above. 
15833
15834         * expression.cs (ArrayAccess): Make it implement the
15835         IMemoryLocation interface.
15836
15837         (Binary.DoResolve): handle the operator == (object a, object b)
15838         and operator != (object a, object b) without incurring into a
15839         BoxedCast (because 5 != o should never be performed).
15840
15841         Handle binary enumerator operators.
15842
15843         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15844         value type, otherwise use Ldelem_ref.
15845
15846         Use precomputed names;
15847
15848         (AddressOf): Implement address of
15849
15850         * cs-parser.jay (labeled_statement): Fix recursive block
15851         addition by reworking the production.
15852
15853         * expression.cs (New.DoEmit): New has a special case:
15854                 
15855                  If we are dealing with a ValueType, we have a few
15856                  situations to deal with:
15857                 
15858                     * The target of New is a ValueType variable, that is
15859                       easy, we just pass this as the variable reference
15860                 
15861                     * The target of New is being passed as an argument,
15862                       to a boxing operation or a function that takes a
15863                       ValueType.
15864                 
15865                       In this case, we need to create a temporary variable
15866                       that is the argument of New.
15867
15868
15869 2001-12-23  Ravi Pratap  <ravi@ximian.com>
15870
15871         * rootcontext.cs (LookupType): Check that current_type is not null before
15872         going about looking at nested types.
15873
15874         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15875         not implement the IAssignMethod interface any more.
15876
15877         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15878         where we tranform them into FieldExprs if they are being resolved from within
15879         the declaring type.
15880
15881         * ecore.cs (SimpleName.DoResolve): Do the same here.
15882
15883         * assign.cs (DoResolve, Emit): Clean up code considerably. 
15884
15885         * ../errors/bug10.cs : Add.
15886
15887         * ../errors/cs0070.cs : Add.
15888
15889         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15890
15891         * assign.cs : Get rid of EventIsLocal everywhere.
15892
15893 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
15894
15895         * ecore.cs (ConvertIntLiteral): finished the implementation.
15896
15897         * statement.cs (SwitchLabel): Convert the value we are using as a
15898         key before looking up the table.
15899
15900 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * codegen.cs (EmitTopBlock): Require a Location argument now.
15903
15904         * cs-parser.jay (constructor_declarator): We need to setup
15905         current_local_parameters before we parse the
15906         opt_constructor_initializer, to allow the variables to be bound
15907         to the constructor arguments.
15908
15909         * rootcontext.cs (LookupType): First lookup nested classes in our
15910         class and our parents before we go looking outside our class.
15911
15912         * expression.cs (ConstantFold): Extract/debox the values at the
15913         beginnning. 
15914
15915         * rootcontext.cs (EmitCode): Resolve the constants first before we
15916         resolve the types.  This is not really needed, but it helps debugging.
15917
15918         * statement.cs: report location.
15919
15920         * cs-parser.jay: pass location to throw statement.
15921
15922         * driver.cs: Small bug fix.
15923
15924         * report.cs: Updated format to be 4-zero filled digits.
15925
15926 2001-12-22  Ravi Pratap  <ravi@ximian.com>
15927
15928         * expression.cs (CheckIndices): Fix minor bug where the wrong
15929         variable was being referred to ;-)
15930
15931         (DoEmit): Do not call EmitStaticInitializers when the 
15932         underlying type is System.Object.
15933
15934 2001-12-21  Ravi Pratap  <ravi@ximian.com>
15935
15936         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
15937         and do the usual workaround for SRE.
15938
15939         * class.cs (MyEventBuilder.EventType): New member to get at the type
15940         of the event, quickly.
15941
15942         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
15943
15944         * assign.cs (Assign.DoResolve): Handle the case when the target
15945         is an EventExpr and perform the necessary checks.
15946
15947         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
15948         interface.
15949
15950         (SimpleName.MemberStaticCheck): Include check for EventExpr.
15951
15952         (EventExpr): Set the type in the constructor itself since we 
15953         are meant to be born fully resolved.
15954
15955         (EventExpr.Define): Revert code I wrote earlier.
15956                 
15957         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
15958         instance expression is null. The instance expression is a This in that case
15959         or a null, depending on whether it is a static method or not.
15960
15961         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
15962         refers to more than one method.
15963
15964         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
15965         and accordingly flag errors.
15966
15967 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15968
15969         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
15970
15971 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
15972
15973         * location.cs (ToString): Provide useful rutine.
15974
15975 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
15976
15977         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
15978         objects, return the actual integral boxed.
15979
15980         * statement.cs (SwitchLabel): define an ILLabel for each
15981         SwitchLabel. 
15982
15983         (Switch.CheckSwitch): If the value is a Literal, extract
15984         the underlying literal.
15985
15986         Also in the unused hashtable we had, add the SwitchLabel so we can
15987         quickly look this value up.
15988
15989         * constant.cs: Implement a bunch of new constants.  Rewrite
15990         Literal based on this.  Made changes everywhere to adapt to this.
15991
15992         * expression.cs (Expression.MakeByteBlob): Optimize routine by
15993         dereferencing array only once, and also copes with enumrations.
15994
15995         bytes are two bytes wide, not one.
15996
15997         (Cast): Perform constant conversions.
15998
15999         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16000         wrappers to the literals here.
16001
16002         * expression.cs (DoNumericPromotions): long literals can converted
16003         to ulong implicity (this is taken care of elsewhere, but I was
16004         missing this spot).
16005
16006         * ecore.cs (Expression.Literalize): Make the return type Literal,
16007         to improve type checking.
16008
16009         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16010
16011 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * literal.cs: Revert code from ravi that checked the bounds.  The
16014         bounds are sane by the definition of the type itself. 
16015
16016         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16017         need to actually look up in our parent hierarchy for interfaces
16018         implemented. 
16019
16020         * const.cs: Use the underlying type for enumerations
16021
16022         * delegate.cs: Compute the basename for the delegate creation,
16023         that should fix the delegate test case, and restore the correct
16024         Type Lookup semantics in rootcontext
16025
16026         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16027         referencing a nested type with the Reflection API is using the "+"
16028         sign. 
16029
16030         * cs-parser.jay: Do not require EOF token at the end.
16031
16032 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16033
16034         * rootcontext.cs (LookupType): Concatenate type names with
16035         a '.' instead of a '+' The test suite passes again.
16036
16037         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16038         field of the enumeration.
16039
16040         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16041         the case when the member is an EventExpr.
16042
16043         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16044         static has an associated instance expression.
16045
16046         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16047
16048         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16049
16050         * class.cs (Event.Define): Register event and perform appropriate checks
16051         for error #111.
16052
16053         We define the Add and Remove methods even if the use provides none because
16054         in that case, we provide default implementations ourselves.
16055
16056         Define a private field of the type of the event. This is done by the CSC compiler
16057         and we should be doing it too ;-)
16058
16059         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16060         More methods we use in code we generate.
16061
16062         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16063         is important.
16064
16065         (InitCoreTypes): Update accordingly for the above.
16066
16067         * class.cs (Event.Emit): Generate code for default accessors that we provide
16068
16069         (EmitDefaultMethod): Do the job in the above.
16070
16071         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16072         appropriate place.
16073
16074 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16077         builders even if we were missing one.
16078
16079         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16080         pass the Basename as our class name instead of the Name.  The
16081         basename will be correctly composed for us.
16082
16083         * parameter.cs (Paramters): Now takes a Location argument.
16084
16085         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16086         make all the code call directly LookupType in RootContext and take
16087         this chance to pass the Location information everywhere.
16088
16089         * Everywhere: pass Location information.
16090
16091 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16092
16093         * class.cs (Constructor.Define): Updated way of detecting the
16094         length of the parameters.
16095
16096         (TypeContainer.DefineType): Use basename as the type name for
16097         nested types.
16098
16099         (TypeContainer.Define): Do not recursively define types here, as
16100         definition is taken care in order by the RootContext.
16101
16102         * tree.cs: Keep track of namespaces in a per-file basis.
16103
16104         * parameter.cs (Parameter.ComputeSignature): Update to use
16105         DeclSpace. 
16106
16107         (Parameters.GetSignature): ditto.
16108
16109         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16110         instead of a TypeContainer.
16111
16112         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16113         resolve names.  Because we need to be resolve in our context, not
16114         our parents.
16115
16116         * driver.cs: Implement response files.
16117
16118         * class.cs (TypeContainer.DefineType): If we are defined, do not
16119         redefine ourselves.
16120
16121         (Event.Emit): Emit the code for add/remove handlers.
16122         (Event.Define): Save the MethodBuilders for add/remove.
16123
16124         * typemanager.cs: Use pair here too.
16125
16126         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16127         DictionaryEntry requires the first argument to be non-null.  
16128
16129         (enum_declaration): Compute full name for registering the
16130         enumeration.
16131
16132         (delegate_declaration): Instead of using
16133         formal_parameter_list, use opt_formal_parameter_list as the list
16134         can be empty.
16135
16136         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16137         (EventParsing): New property that controls whether `add' and
16138         `remove' are returned as tokens or identifiers (for events);
16139
16140 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16141
16142         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16143         use MyEventBuilder only and let it wrap the real builder for us.
16144
16145         (MyEventBuilder): Revamp constructor etc.
16146
16147         Implement all operations that we perform on EventBuilder in precisely the same
16148         way here too.
16149
16150         (FindMembers): Update to use the EventBuilder member.
16151
16152         (Event.Emit): Update accordingly.
16153
16154 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16155
16156         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16157         by calling the appropriate methods.
16158
16159         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16160         useful.
16161
16162         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16163
16164 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16165
16166         * delegate.cs (Delegate.Populate): Check that the return type
16167         and various parameters types are indeed accessible.
16168
16169         * class.cs (Constructor.Define): Same here.
16170
16171         (Field.Define): Ditto.
16172
16173         (Event.Define): Ditto.
16174
16175         (Operator.Define): Check that the underlying Method defined itself
16176         correctly - so it's MethodBuilder should not be null.
16177
16178         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16179         expression happens to be null.
16180
16181         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16182         members but as of now we don't seem to be able to do anything really useful with it.
16183
16184         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16185         not the EventBuilder.
16186
16187 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16188
16189         * cs-tokenizer.cs: Add support for defines.
16190         Add support for #if, #elif, #else, #endif
16191
16192         (eval_var): evaluates a variable.
16193         (eval): stubbed for evaluating functions.
16194
16195         * cs-parser.jay: Pass the defines information
16196
16197         * driver.cs: Add --define command line option.
16198
16199         * decl.cs: Move MemberCore here.
16200
16201         Make it the base class for DeclSpace.  This allows us to catch and
16202         report 108 and 109 for everything now.
16203
16204         * class.cs (TypeContainer.Define): Extract all the members
16205         before populating and emit the warning 108 (new keyword required
16206         to override) instead of having each member implement this.
16207
16208         (MemberCore.Define): New abstract method, we will be using this in
16209         the warning reporting engine in Populate.
16210
16211         (Operator.Define): Adjust to new MemberCore protocol. 
16212
16213         * const.cs (Const): This does not derive from Expression, it is a
16214         temporary object we use to create fields, it is a MemberCore. 
16215
16216         * class.cs (Method.Define): Allow the entry point to be in a
16217         specific class.
16218
16219         * driver.cs: Rewrite the argument handler to clean it up a bit.
16220
16221         * rootcontext.cs: Made it just an auxiliary namespace feature by
16222         making everything static.
16223
16224         * driver.cs: Adapt code to use RootContext type name instead of
16225         instance variable.
16226
16227         * delegate.cs: Remove RootContext argument.
16228
16229         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16230         argument. 
16231
16232         * class.cs (Event.Define): The lookup can fail.
16233
16234         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16235
16236         * expression.cs: Resolve the this instance before invoking the code.
16237
16238 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16239
16240         * cs-parser.jay: Add a production in element_access that allows
16241         the thing to become a "type" reference.  This way we can parse
16242         things like "(string [])" as a type.
16243
16244         Note that this still does not handle the more complex rules of
16245         casts. 
16246
16247
16248         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16249
16250         * ecore.cs: (CopyNewMethods): new utility function used to
16251         assemble the list of methods from running FindMembers.
16252
16253         (MemberLookup): Rework FindMembers so that 
16254
16255 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16256
16257         * class.cs (TypeContainer): Remove Delegates who fail to be
16258         defined.
16259
16260         * delegate.cs (Populate): Verify that we dont get null return
16261         values.   TODO: Check for AsAccessible.
16262
16263         * cs-parser.jay: Use basename to emit error 574 (destructor should
16264         have the same name as container class), not the full name.
16265
16266         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16267         possible representation.  
16268
16269         Also implements integer type suffixes U and L.
16270
16271 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16272
16273         * expression.cs (ArrayCreation.DoResolve): We need to do the
16274         argument resolution *always*.
16275
16276         * decl.cs: Make this hold the namespace.  Hold the root context as
16277         well.
16278         (LookupType): Move here.
16279
16280         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16281
16282         * location.cs (Row, Name): Fixed the code, it was always returning
16283         references to the first file.
16284
16285         * interface.cs: Register properties defined through interfaces.
16286
16287         * driver.cs: Add support for globbing on the command line
16288
16289         * class.cs (Field): Make it derive from MemberCore as well.
16290         (Event): ditto.
16291
16292 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16293
16294         * class.cs (Event::Define): Check that the type of the event is a delegate
16295         type else flag error #66.
16296
16297         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16298         same.
16299
16300         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16301         values of EntryPoint, CharSet etc etc.
16302
16303         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16304
16305         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16306         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16307         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16308         which needs this to do its work.
16309
16310         * ../errors/cs0066.cs : Add.
16311
16312 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16313
16314         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16315         helper functions.
16316
16317         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16318         clears out the parameters field.
16319         (MemberSignatureCompare): Cleanup
16320
16321         (MemberCore): New base class used to share code between MethodCore
16322         and Property.
16323
16324         (RegisterRequiredImplementations) BindingFlags.Public requires
16325         either BindingFlags.Instace or Static.  Use instance here.
16326
16327         (Property): Refactored code to cope better with the full spec.
16328
16329         * parameter.cs (GetParameterInfo): Return an empty array instead
16330         of null on error.
16331
16332         * class.cs (Property): Abstract or extern properties have no bodies.
16333
16334         * parameter.cs (GetParameterInfo): return a zero-sized array.
16335
16336         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16337         method modifier validation to the typecontainer so we can reuse
16338         this on properties.
16339
16340         (MethodCore.ParameterTypes): return an empty sized array of types.
16341
16342         (Property.Define): Test property modifier validity.
16343
16344         Add tests for sealed/override too.
16345
16346         (Method.Emit): abstract or extern methods have no bodies.
16347
16348 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16349
16350         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16351         thing.
16352
16353         (Method::Define, ::Emit): Modify accordingly.
16354
16355         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16356
16357         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16358
16359         * makefile: Pass in /unsafe.
16360
16361 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16362
16363         * class.cs (MakeKey): Kill routine.
16364
16365         * class.cs (TypeContainer.Define): Correctly define explicit
16366         method implementations (they require the full interface name plus
16367         the method name).
16368
16369         * typemanager.cs: Deply the PtrHashtable here and stop using the
16370         lame keys.  Things work so much better.
16371
16372         This of course broke everyone who depended on `RegisterMethod' to
16373         do the `test for existance' test.  This has to be done elsewhere.
16374
16375         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16376         the object stupid Equals method (because, that like fails all over
16377         the place).  We still do not use it.
16378
16379         * class.cs (TypeContainer.SetRequiredInterface,
16380         TypeContainer.RequireMethods): Killed these two routines and moved
16381         all the functionality to RegisterRequiredImplementations.
16382
16383         (TypeContainer.RegisterRequiredImplementations): This routine now
16384         registers all the implementations required in an array for the
16385         interfaces and abstract methods.  We use an array of structures
16386         which can be computed ahead of time to reduce memory usage and we
16387         also assume that lookups are cheap as most classes will not
16388         implement too many interfaces.
16389
16390         We also avoid creating too many MethodSignatures.
16391
16392         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16393         clear the "pending" bit if we find that there are problems with
16394         the declaration.
16395
16396         (TypeContainer.VerifyPendingMethods): Update to report errors of
16397         methods that look like implementations but are not.
16398
16399         (TypeContainer.Define): Add support for explicit interface method
16400         implementation. 
16401
16402 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * typemanager.cs: Keep track of the parameters here instead of
16405         being a feature of the TypeContainer.
16406
16407         * class.cs: Drop the registration of parameters here, as
16408         InterfaceMethods are also interface declarations.
16409
16410         * delegate.cs: Register methods with the TypeManager not only with
16411         the TypeContainer.  This code was buggy.
16412
16413         * interface.cs: Full registation here.
16414
16415 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16416
16417         * expression.cs: Remove reducer for binary expressions, it can not
16418         be done this way.
16419
16420         * const.cs: Put here the code that used to go into constant.cs
16421
16422         * constant.cs: Put here the code for constants, this is a new base
16423         class for Literals.
16424
16425         * literal.cs: Make Literal derive from Constant.
16426
16427 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16428
16429         * statement.cs (Return.Emit): Report error 157 if the user
16430         attempts to return from a finally block.
16431
16432         (Return.Emit): Instead of emitting a return, jump to the end of
16433         the function.
16434
16435         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16436         LocalBuilder to store the result of the function.  ReturnLabel is
16437         the target where we jump.
16438
16439
16440 2001-12-09  Radek Doulik  <rodo@ximian.com>
16441
16442         * cs-parser.jay: remember alias in current namespace
16443
16444         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16445         namespaces
16446
16447         * class.cs (LookupAlias): lookup alias in my_namespace
16448
16449         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16450         aliases hashtable
16451         (LookupAlias): lookup alias in this and if needed in parent
16452         namespaces
16453
16454 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16455
16456         * support.cs: 
16457
16458         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16459         making things static.  I need this to avoid passing the
16460         TypeContainer when calling ParameterType.
16461
16462         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16463         that did string manipulation to compute the type and then call
16464         GetType.  Use Parameter.ParameterType instead.
16465
16466         * cs-tokenizer.cs: Consume the suffix for floating values.
16467
16468         * expression.cs (ParameterReference): figure out whether this is a
16469         reference parameter or not.  Kill an extra variable by computing
16470         the arg_idx during emission.
16471
16472         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16473         function that returns whether a parameter is an out/ref value or not.
16474
16475         (Parameter.ParameterType): The type of the parameter (base,
16476         without ref/out applied).
16477
16478         (Parameter.Resolve): Perform resolution here.
16479         (Parameter.ExternalType): The full type (with ref/out applied).
16480
16481         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16482         support for expressions on the using statement.
16483
16484 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16485
16486         * statement.cs (Using.EmitLocalVariableDecls): Split the
16487         localvariable handling of the using statement.
16488
16489         (Block.EmitMeta): Keep track of variable count across blocks.  We
16490         were reusing slots on separate branches of blocks.
16491
16492         (Try.Emit): Emit the general code block, we were not emitting it. 
16493
16494         Check the type of the declaration to be an IDisposable or
16495         something that can be implicity converted to it. 
16496
16497         Emit conversions if required.
16498
16499         * ecore.cs (EmptyExpression): New utility class.
16500         (Expression.ImplicitConversionExists): New utility function.
16501
16502 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16503
16504         * statement.cs (Using): Implement.
16505
16506         * expression.cs (LocalVariableReference): Support read only variables.
16507
16508         * statement.cs: Remove the explicit emit for the Leave opcode.
16509         (VariableInfo): Add a readonly field.
16510
16511 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16512
16513         * ecore.cs (ConvCast): new class used to encapsulate the various
16514         explicit integer conversions that works in both checked and
16515         unchecked contexts.
16516
16517         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16518         properly generate the overflow opcodes.
16519
16520 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16521
16522         * statement.cs: The correct type for the EmptyExpression is the
16523         element_type, not the variable type.  Ravi pointed this out.
16524
16525 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16526
16527         * class.cs (Method::Define): Handle PInvoke methods specially
16528         by using DefinePInvokeMethod instead of the usual one.
16529
16530         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16531         above to do the task of extracting information and defining the method.
16532
16533 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16534
16535         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16536         of the condition for string type.
16537
16538         (Emit): Move that here. 
16539
16540         (ArrayCreation::CheckIndices): Keep string literals in their expression
16541         form.
16542
16543         (EmitDynamicInitializers): Handle strings appropriately.
16544
16545 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16546
16547         * codegen.cs (EmitContext): Replace multiple variables with a
16548         single pointer to the current Switch statement.
16549
16550         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16551         EmitContext.
16552
16553 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16554
16555         * statement.cs 
16556
16557         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16558         default'.
16559
16560         (Foreach.Emit): Foreach on arrays was not setting
16561         up the loop variables (for break/continue).
16562
16563         (GotoCase): Semi-implented.
16564
16565 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16566
16567         * attribute.cs (CheckAttribute): Handle system attributes by using
16568         Attribute.GetAttributes to examine information we need.
16569
16570         (GetValidPlaces): Same here.
16571
16572         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16573
16574         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16575
16576         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16577
16578         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16579
16580         (Method::Emit): Handle the case when we are a PInvoke method.
16581
16582 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16583
16584         * expression.cs: Use ResolveWithSimpleName on compound names.
16585
16586 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16587
16588         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16589         before trying to reduce it.
16590
16591         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16592
16593         * constant.cs (LookupConstantValue): Implement.
16594
16595         (EmitConstant): Use the above in emitting the constant.
16596
16597         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16598         that are user-defined by doing a LookupConstantValue on them.
16599
16600         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16601         too, like above.
16602
16603 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16604
16605         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16606
16607         (BaseAccess.DoResolve): Implement.
16608
16609         (MemberAccess.DoResolve): Split this routine into a
16610         ResolveMemberAccess routine that can be used independently
16611
16612 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16613
16614         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16615         As that share bits of the implementation.  Is returns a boolean,
16616         while As returns the Type that is being probed.
16617
16618 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16619
16620         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16621         instead of a Literal - much easier.
16622
16623         (EnumInTransit): Remove - utterly useless :-)
16624
16625         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16626
16627         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16628
16629         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16630         chain when we have no associated expression.
16631
16632 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16633
16634         * constant.cs (Define): Use Location while reporting the errror.
16635
16636         Also emit a warning when 'new' is used and there is no inherited
16637         member to hide.
16638
16639         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16640         populated.
16641
16642         (LookupEnumValue): Implement to lookup an enum member's value and define it
16643         if necessary.
16644
16645         (Populate): Re-write accordingly to use the above routine.
16646
16647 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16648
16649         * expression.cs (This): Fix prototype for DoResolveLValue to
16650         override the base class DoResolveLValue.
16651
16652         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16653         declarations) 
16654
16655         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16656         (we need to load the address of the field here).  This fixes
16657         test-22. 
16658
16659         (FieldExpr.DoResolveLValue): Call the DoResolve
16660         function to initialize the Instance expression.
16661
16662         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16663         correctly the GetEnumerator operation on a value type.
16664
16665         * cs-parser.jay: Add more simple parsing error catches.
16666
16667         * statement.cs (Switch): Add support for string switches.
16668         Handle null specially.
16669
16670         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16671
16672 2001-11-28  Ravi Pratap  <ravi@ximian.com>
16673
16674         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16675
16676         (declare_local_constant): New helper function.
16677
16678         * statement.cs (AddConstant): Keep a separate record of constants
16679
16680         (IsConstant): Implement to determine if a variable is a constant.
16681
16682         (GetConstantExpression): Implement.
16683
16684         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16685
16686         * statement.cs (IsVariableDefined): Re-write.
16687
16688 2001-11-27  Ravi Pratap  <ravi@ximian.com>
16689
16690         * class.cs (TypeContainer::FindMembers): Look for constants
16691         in the case when we are looking for MemberTypes.Field
16692
16693         * expression.cs (MemberAccess::DoResolve): Check that in the
16694         case we are a FieldExpr and a Literal, we are not being accessed
16695         by an instance reference.
16696
16697         * cs-parser.jay (local_constant_declaration): Implement.
16698
16699         (declaration_statement): Implement for constant declarations.
16700
16701 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
16702
16703         * statement.cs (Switch): Catch double defaults.
16704
16705         (Switch): More work on the switch() statement
16706         implementation.  It works for integral values now, need to finish
16707         string support.
16708
16709
16710 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16711
16712         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16713         integer literals into other integer literals.  To be used by
16714         switch. 
16715
16716 2001-11-24  Ravi Pratap  <ravi@ximian.com>
16717
16718         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16719         some memory.
16720
16721         (EmitDynamicInitializers): Cope with the above since we extract data
16722         directly from ArrayData now.
16723
16724         (ExpectInitializers): Keep track of whether initializers are mandatory
16725         or not.
16726
16727         (Bounds): Make it a hashtable to prevent the same dimension being 
16728         recorded for every element in that dimension.
16729
16730         (EmitDynamicInitializers): Fix bug which prevented the Set array method
16731         from being found.
16732
16733         Also fix bug which was causing the indices to be emitted in the reverse
16734         order.
16735
16736 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
16737
16738         * expression.cs (ArrayCreation): Implement the bits that Ravi left
16739         unfinished.  They do not work, because the underlying code is
16740         sloppy.
16741
16742 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16743
16744         * cs-parser.jay: Remove bogus fixme.
16745
16746         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16747         on Switch statement.
16748
16749 2001-11-23  Ravi Pratap  <ravi@ximian.com>
16750
16751         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16752         the same. 
16753
16754         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16755         parameter. Apparently, any expression is allowed. 
16756
16757         (ValidateInitializers): Update accordingly.
16758
16759         (CheckIndices): Fix some tricky bugs thanks to recursion.
16760
16761         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
16762         I was being completely brain-dead.
16763
16764         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16765         and re-write acordingly.
16766
16767         (DelegateInvocation): Re-write accordingly.
16768
16769         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16770
16771         (MakeByteBlob): Handle types more correctly.
16772
16773         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16774         initialization from expressions but it is incomplete because I am a complete
16775         Dodo :-|
16776
16777 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16778
16779         * statement.cs (If.Emit): Fix a bug that generated incorrect code
16780         on If.  Basically, we have to return `true' (ie, we do return to
16781         our caller) only if both branches of the if return.
16782
16783         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16784         short-circuit operators, handle them as short circuit operators. 
16785
16786         (Cast.DoResolve): Resolve type.
16787         (Cast.Cast): Take an expression as the target type.
16788
16789         * cs-parser.jay (cast_expression): Remove old hack that only
16790         allowed a limited set of types to be handled.  Now we take a
16791         unary_expression and we resolve to a type during semantic
16792         analysis.
16793
16794         Use the grammar productions from Rhys to handle casts (this is
16795         not complete like Rhys syntax yet, we fail to handle that corner
16796         case that C# has regarding (-x), but we will get there.
16797
16798 2001-11-22  Ravi Pratap  <ravi@ximian.com>
16799
16800         * class.cs (EmitFieldInitializer): Take care of the case when we have a
16801         field which is an array type.
16802
16803         * cs-parser.jay (declare_local_variables): Support array initialization too.
16804
16805         * typemanager.cs (MakeKey): Implement.
16806
16807         (everywhere): Use the above appropriately.
16808
16809         * cs-parser.jay (for_statement): Update for array initialization while
16810         declaring variables.
16811
16812         * ecore.cs : The error message was correct, it's the variable's names that
16813         were misleading ;-) Make the code more readable.
16814
16815         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16816         the correct type etc.
16817
16818         (ConvertExplicit): Handle Enum types by examining the underlying type.
16819
16820 2001-11-21  Ravi Pratap  <ravi@ximian.com>
16821
16822         * parameter.cs (GetCallingConvention): Always return
16823         CallingConventions.Standard for now.
16824
16825 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
16826
16827         * expression.cs (Binary.ResolveOperator): Update the values of `l'
16828         and `r' after calling DoNumericPromotions.
16829
16830         * ecore.cs: Fix error message (the types were in the wrong order).
16831
16832         * statement.cs (Foreach.ProbeCollectionType): Need to pass
16833         BindingFlags.Instance as well 
16834
16835         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16836         implicit int literal conversion in an empty cast so that we
16837         propagate the right type upstream.
16838
16839         (UnboxCast): new class used to unbox value types.
16840         (Expression.ConvertExplicit): Add explicit type conversions done
16841         by unboxing.
16842
16843         (Expression.ImplicitNumericConversion): Oops, forgot to test for
16844         the target type before applying the implicit LongLiterals to ULong
16845         literal cast.
16846
16847 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
16848
16849         * cs-parser.jay (for_statement): Reworked the way For works: now
16850         we declare manually any variables that are introduced in
16851         for_initializer to solve the problem of having out-of-band code
16852         emition (that is what got for broken).
16853
16854         (declaration_statement): Perform the actual variable declaration
16855         that used to be done in local_variable_declaration here.
16856
16857         (local_variable_declaration): Do not declare anything, just pass
16858         the information on a DictionaryEntry
16859
16860 2001-11-20  Ravi Pratap  <ravi@ximian.com>
16861
16862         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16863         re-write of the logic to now make it recursive.
16864
16865         (UpdateIndices): Re-write accordingly.
16866
16867         Store element data in a separate ArrayData list in the above methods.
16868
16869         (MakeByteBlob): Implement to dump the array data into a byte array.
16870
16871 2001-11-19  Ravi Pratap  <ravi@ximian.com>
16872
16873         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16874         into CheckIndices.
16875
16876         * constant.cs (Define): Implement.
16877
16878         (EmitConstant): Re-write fully.
16879
16880         Pass in location info.
16881
16882         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16883         respectively.
16884
16885         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16886         DictionaryEntry since we need location info too.
16887
16888         (constant_declaration): Update accordingly.
16889
16890         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16891         code into another method : UpdateIndices.
16892
16893 2001-11-18  Ravi Pratap  <ravi@ximian.com>
16894
16895         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16896         some type checking etc.
16897
16898 2001-11-17  Ravi Pratap  <ravi@ximian.com>
16899
16900         * expression.cs (ArrayCreation::ValidateInitializers): Implement
16901         bits to provide dimension info if the user skips doing that.
16902
16903         Update second constructor to store the rank correctly.
16904
16905 2001-11-16  Ravi Pratap  <ravi@ximian.com>
16906
16907         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16908         and try to implement.
16909
16910         * ../errors/cs0150.cs : Add.
16911
16912         * ../errors/cs0178.cs : Add.
16913
16914 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
16915
16916         * statement.cs: Implement foreach on multi-dimensional arrays. 
16917
16918         * parameter.cs (Parameters.GetParameterByName): Also lookup the
16919         name of the params argument.
16920
16921         * expression.cs: Use EmitStoreOpcode to get the right opcode while
16922         initializing the array.
16923
16924         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16925         we can use this elsewhere.
16926
16927         * statement.cs: Finish implementation of foreach for single
16928         dimension arrays.
16929
16930         * cs-parser.jay: Use an out-of-band stack to pass information
16931         around, I wonder why I need this.
16932
16933         foreach_block: Make the new foreach_block the current_block.
16934
16935         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
16936         function used to return a static Parameters structure.  Used for
16937         empty parameters, as those are created very frequently.
16938
16939         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
16940
16941 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16942
16943         * interface.cs : Default modifier is private, not public. The
16944         make verify test passes again.
16945
16946 2001-11-15  Ravi Pratap  <ravi@ximian.com>
16947
16948         * support.cs (ReflectionParameters): Fix logic to determine
16949         whether the last parameter is a params one. Test 9 passes again.
16950
16951         * delegate.cs (Populate): Register the builders we define with
16952         RegisterParameterForBuilder. Test 19 passes again.
16953
16954         * cs-parser.jay (property_declaration): Reference $6 instead
16955         of $$ to get at the location.
16956
16957         (indexer_declaration): Similar stuff.
16958
16959         (attribute): Ditto.
16960
16961         * class.cs (Property): Register parameters for the Get and Set methods
16962         if they exist. Test 23 passes again.
16963
16964         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
16965         call to EmitArguments as we are sure there aren't any params arguments. 
16966         Test 32 passes again.
16967
16968         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
16969         IndexOutOfRangeException. 
16970
16971         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
16972         Test 33 now passes again.
16973
16974 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
16975
16976         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
16977         broke a bunch of things.  Will have to come up with a better way
16978         of tracking locations.
16979
16980         * statement.cs: Implemented foreach for single dimension arrays.
16981
16982 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
16983
16984         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
16985         an error.  This removes the lookup from the critical path.
16986
16987         * cs-parser.jay: Removed use of temporary_loc, which is completely
16988         broken. 
16989
16990 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
16991
16992         * support.cs (ReflectionParameters.ParameterModifier): Report
16993         whether the argument is a PARAMS argument or not.
16994
16995         * class.cs: Set the attribute `ParamArrayAttribute' on the
16996         parameter argument.
16997
16998         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
16999         and cons_param_array_attribute (ConstructorInfo for
17000         ParamArrayAttribute)., 
17001
17002         * codegen.cs: Emit the return using the `Return' statement, that
17003         way we can report the error correctly for missing return values. 
17004
17005         * class.cs (Method.Emit): Clean up.
17006
17007         * expression.cs (Argument.Resolve): Take another argument: the
17008         location where this argument is used.  Notice that this is not
17009         part of the "Argument" class as to reduce the size of the
17010         structure (we know the approximate location anyways).
17011
17012         Test if the argument is a variable-reference, if not, then
17013         complain with a 206.
17014
17015         (Argument.Emit): Emit addresses of variables.
17016
17017         (Argument.FullDesc): Simplify.
17018
17019         (Invocation.DoResolve): Update for Argument.Resolve.
17020
17021         (ElementAccess.DoResolve): ditto.
17022
17023         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17024         method should be virtual, as this method is always virtual.
17025
17026         (NewDelegate.DoResolve): Update for Argument.Resolve.
17027
17028         * class.cs (ConstructorInitializer.DoResolve): ditto.
17029
17030         * attribute.cs (Attribute.Resolve): ditto.
17031
17032 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17035
17036         * expression.cs (ParameterReference): Drop IStackStorage and implement
17037         IAssignMethod instead. 
17038
17039         (LocalVariableReference): ditto.
17040
17041         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17042         IAssignMethod instead. 
17043
17044 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17045
17046         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17047         enumerations that are used in heavily used structures derive from
17048         byte in a laughable and pathetic attempt to reduce memory usage.
17049         This is the kind of pre-optimzations that you should not do at
17050         home without adult supervision.
17051
17052         * expression.cs (UnaryMutator): New class, used to handle ++ and
17053         -- separatedly from the other unary operators.  Cleans up the
17054         code, and kills the ExpressionStatement dependency in Unary.
17055
17056         (Unary): Removed `method' and `Arguments' from this class, making
17057         it smaller, and moving it all to SimpleCall, so I can reuse this
17058         code in other locations and avoid creating a lot of transient data
17059         strucutres when not required.
17060
17061         * cs-parser.jay: Adjust for new changes.
17062
17063 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17064
17065         * enum.cs (Enum.Populate): If there is a failure during
17066         definition, return
17067
17068         * cs-parser.jay (opt_enum_base): we used to catch type errors
17069         here, but this is really incorrect.  The type error should be
17070         catched during semantic analysis.
17071
17072 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17073
17074         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17075         current_local_parameters as expected since I, in my stupidity, had forgotten
17076         to do this :-)
17077
17078         * attribute.cs (GetValidPlaces): Fix stupid bug.
17079
17080         * class.cs (Method::Emit): Perform check on applicability of attributes.
17081
17082         (Constructor::Emit): Ditto.
17083
17084         (Field::Emit): Ditto.
17085
17086         (Field.Location): Store location information.
17087
17088         (Property, Event, Indexer, Operator): Ditto.
17089
17090         * cs-parser.jay (field_declaration): Pass in location for each field.
17091
17092         * ../errors/cs0592.cs : Add.
17093
17094 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17095
17096         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17097
17098         (InitCoreTypes): Update accordingly.
17099
17100         (RegisterAttrType, LookupAttr): Implement.
17101
17102         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17103         info about the same.
17104
17105         (Resolve): Update to populate the above as necessary.
17106
17107         (Error592): Helper.
17108
17109         (GetValidPlaces): Helper to the above.
17110
17111         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17112
17113         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17114
17115 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17116
17117         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17118
17119         * ../errors/cs0617.cs : Add.
17120
17121 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17122
17123         * enum.cs (Emit): Rename to Populate to be more consistent with what
17124         we expect it to do and when exactly it is called.
17125
17126         * class.cs, rootcontext.cs : Update accordingly.
17127
17128         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17129         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17130
17131         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17132
17133         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17134         of a fieldinfo using the above, when dealing with a FieldBuilder.
17135
17136 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17137
17138         * ../errors/cs0031.cs : Add.
17139
17140         * ../errors/cs1008.cs : Add.
17141
17142         * ../errrors/cs0543.cs : Add.
17143
17144         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17145         enum type.
17146
17147         (FindMembers): Implement.
17148
17149         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17150         enums and delegates too.
17151
17152         (enum_types): Rename to builder_to_enum.
17153
17154         (delegate_types): Rename to builder_to_delegate.
17155
17156         * delegate.cs (FindMembers): Implement.
17157
17158 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17159
17160         * typemanager.cs (IsEnumType): Implement.
17161
17162         * enum.cs (Emit): Re-write parts to account for the underlying type
17163         better and perform checking etc.
17164
17165         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17166         of the underlying type.
17167
17168         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17169         value
17170
17171         * enum.cs (error31): Helper to report error #31.
17172
17173         * cs-parser.jay (enum_declaration): Store location of each member too.
17174
17175         * enum.cs (member_to_location): New hashtable. 
17176
17177         (AddEnumMember): Update location hashtable.
17178
17179         (Emit): Use the location of each member while reporting errors.
17180
17181 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17182
17183         * cs-parser.jay: A for_initializer if is a
17184         local_variable_declaration really ammount to have an implicit
17185         block with the variable declaration and no initializer for for.
17186
17187         * statement.cs (For.Emit): Cope with null initializers.
17188
17189         This fixes the infinite loop on for initializers.
17190
17191 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17192
17193         * enum.cs: More cleanup.
17194
17195         * ecore.cs: Remove dead code.
17196
17197         * class.cs (Property.Emit): More simplification.
17198         (Event.Emit): ditto.
17199
17200         Reworked to have less levels of indentation.
17201
17202 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17203
17204         * class.cs (Property): Emit attributes.
17205
17206         (Field): Ditto.
17207
17208         (Event): Ditto.
17209
17210         (Indexer): Ditto.
17211
17212         (Operator): Ditto.
17213
17214         * enum.cs (Emit): Ditto.
17215
17216         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17217         Enums too.
17218
17219         * class.cs (Field, Event, etc.): Move attribute generation into the
17220         Emit method everywhere.
17221
17222         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17223         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17224         as we had no way of defining nested enums !
17225
17226         * rootcontext.cs : Adjust code accordingly.
17227
17228         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17229
17230 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17231
17232         * expression.cs (EvalConstantExpression): Move into ecore.cs
17233
17234         * enum.cs (Enum): Rename some members and make them public and readonly
17235         according to our convention.
17236
17237         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17238         nothing else.
17239
17240         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17241
17242         (Enum::Emit): Write a simple version for now which doesn't try to compute
17243         expressions. I shall modify this to be more robust in just a while.
17244
17245         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17246
17247         (TypeContainer::CloseType): Create the Enum types too.
17248
17249         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17250
17251         * expression.cs (EvalConstantExpression): Get rid of completely.
17252
17253         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17254         user-defined values and other cases.
17255
17256         (IsValidEnumLiteral): Helper function.
17257
17258         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17259         out there in the case we had a literal FieldExpr.
17260
17261         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17262
17263         (Literalize): Revamp a bit to take two arguments.
17264
17265         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17266
17267 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17268
17269         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17270
17271         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17272
17273         (Resolve): Use the above to ensure we have proper initializers.
17274
17275 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17276
17277         * expression.cs (Expression::EvalConstantExpression): New method to 
17278         evaluate constant expressions.
17279
17280         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17281
17282 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17283
17284         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17285         in an array.
17286
17287         (Binary.ResolveOperator): Handle operator != (object a, object b)
17288         and operator == (object a, object b);
17289
17290         (Binary.DoNumericPromotions): Indicate whether the numeric
17291         promotion was possible.
17292
17293         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17294         Implement.  
17295
17296         Made the ArrayAccess implement interface IAssignMethod instead of
17297         IStackStore as the order in which arguments are passed reflects
17298         this.
17299
17300         * assign.cs: Instead of using expr.ExprClass to select the way of
17301         assinging, probe for the IStackStore/IAssignMethod interfaces.
17302
17303         * typemanager.cs: Load InitializeArray definition.
17304
17305         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17306         static data that can be used to initialize arrays. 
17307
17308 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17309
17310         * expression.cs: Handle operator== and operator!= for booleans.
17311
17312         (Conditioal.Reduce): Implement reducer for the ?: operator.
17313
17314         (Conditional.Resolve): Implement dead code elimination.
17315
17316         (Binary.Resolve): Catch string literals and return a new
17317         concatenated string.
17318
17319         (Unary.Reduce): Implement reduction of unary expressions.
17320
17321         * ecore.cs: Split out the expression core handling here.
17322
17323         (Expression.Reduce): New method used to perform constant folding
17324         and CSE.  This is needed to support constant-expressions. 
17325
17326         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17327         targets, and optimize for !x.
17328
17329 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17330
17331         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17332         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17333         set custom atttributes.
17334
17335         * literal.cs (Literal::GetValue): New abstract method to return the actual
17336         value of the literal, cast as an object.
17337
17338         (*Literal): Implement GetValue method.
17339
17340         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17341         expressions to the arraylist but objects of type Argument.
17342
17343         * class.cs (TypeContainer::Emit): Emit our attributes too.
17344
17345         (Method::Emit, Constructor::Emit): Ditto.
17346
17347         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17348         to be ignoring earlier.
17349
17350 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17351
17352         * attribute.cs (AttributeSection::Define): Implement to do the business
17353         of constructing a CustomAttributeBuilder.
17354
17355         (Attribute): New trivial class. Increases readability of code.  
17356
17357         * cs-parser.jay : Update accordingly.
17358
17359         (positional_argument_list, named_argument_list, named_argument): New rules
17360
17361         (attribute_arguments): Use the above so that we are more correct.
17362
17363 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17364
17365         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17366         to perform all checks for a method with a params parameter.
17367
17368         (Invocation::OverloadResolve): Update to use the above method and therefore
17369         cope correctly with params method invocations.
17370
17371         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17372         params too.
17373
17374         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17375         constructors in our parent too because we can't afford to miss out on 
17376         protected ones ;-)
17377
17378         * attribute.cs (AttributeSection): New name for the class Attribute
17379
17380         Other trivial changes to improve readability.
17381
17382         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17383         use the new class names.
17384
17385 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17386
17387         * class.cs (Method::Define): Complete definition for params types too
17388
17389         (Indexer::Define): Ditto.
17390
17391         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17392         Cope everywhere with a request for info about the array parameter.
17393
17394 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17395
17396         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17397
17398         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17399         local_variable_type to extract the string corresponding to the type.
17400
17401         (local_variable_type): Fixup the action to use the new helper method.
17402
17403         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17404         go.
17405
17406         * expression.cs : Clean out code which uses the above.
17407
17408 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17409
17410         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17411         and bale out if necessary by returning a false.
17412
17413         (RegisterProperty): Ditto.
17414
17415         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17416         and print out appropriate error messages.
17417
17418         * interface.cs (everywhere): Ditto.
17419
17420         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17421         location to constructor.
17422
17423         * class.cs (Property, Event, Indexer): Update accordingly.
17424
17425         * ../errors/cs111.cs : Added.
17426
17427         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17428         of a method, as laid down by the spec.
17429
17430         (Invocation::OverloadResolve): Use the above method.
17431
17432 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17433
17434         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17435         now take a TypeContainer and a Parameters object.
17436
17437         (ParameterData): Modify return type of ParameterModifier method to be 
17438         Parameter.Modifier and not a string.
17439
17440         (ReflectionParameters, InternalParameters): Update accordingly.
17441
17442         * expression.cs (Argument::GetParameterModifier): Same here.
17443
17444         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17445         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17446         symbol in it at all so maybe this is only for now.
17447
17448 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17449
17450         * support.cs (InternalParameters): Constructor now takes an extra argument 
17451         which is the actual Parameters class.
17452
17453         (ParameterDesc): Update to provide info on ref/out modifiers.
17454
17455         * class.cs (everywhere): Update call to InternalParameters to pass in
17456         the second argument too.
17457
17458         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17459         to return the modifier info [ref/out etc]
17460
17461         (InternalParameters, ReflectionParameters): Implement the above.
17462
17463         * expression.cs (Argument::ParameterModifier): Similar function to return
17464         info about the argument's modifiers.
17465
17466         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17467         too.
17468
17469         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17470         a new SetFormalParameters object which we pass to InternalParameters.
17471
17472 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17473
17474         * expression.cs (NewArray): Merge into the ArrayCreation class.
17475
17476 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17477
17478         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17479         NewUserdefinedArray into one as there wasn't much of a use in having
17480         two separate ones.
17481
17482         * expression.cs (Argument): Change field's name to ArgType from Type.
17483
17484         (Type): New readonly property which returns the proper type, taking into 
17485         account ref/out modifiers.
17486
17487         (everywhere): Adjust code accordingly for the above.
17488
17489         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17490         whether we are emitting for a ref or out parameter.
17491
17492         * expression.cs (Argument::Emit): Use the above field to set the state.
17493
17494         (LocalVariableReference::Emit): Update to honour the flag and emit the
17495         right stuff.
17496
17497         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17498
17499         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17500
17501         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17502
17503         (ReflectionParameters, InternalParameters): Implement the above method.
17504
17505         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17506         reporting errors.
17507
17508         (Invocation::FullMethodDesc): Ditto. 
17509
17510 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17511
17512         * cs-parser.jay: Add extra production for the second form of array
17513         creation. 
17514
17515         * expression.cs (ArrayCreation): Update to reflect the above
17516         change. 
17517
17518         * Small changes to prepare for Array initialization.
17519
17520 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17521
17522         * typemanager.cs (ImplementsInterface): interface might be null;
17523         Deal with this problem;
17524
17525         Also, we do store negative hits on the cache (null values), so use
17526         this instead of calling t.GetInterfaces on the type everytime.
17527
17528 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17529
17530         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17531
17532         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17533         split functionality out into different classes.
17534
17535         (New::FormArrayType): Move into NewBuiltinArray.
17536
17537         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17538         quite useless.
17539
17540         (NewBuiltinArray): New class to handle creation of built-in arrays.
17541
17542         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17543         account creation of one-dimensional arrays.
17544
17545         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17546
17547         (NewUserdefinedArray::DoResolve): Implement.
17548
17549         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17550
17551         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17552         we maintain inside the TypeManager. This is necessary to perform lookups on the
17553         module builder.
17554
17555         (LookupType): Update to perform GetType on the module builders too.     
17556
17557         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17558
17559         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17560
17561 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17562
17563         * expression.cs (New::DoResolve): Implement guts of array creation.
17564
17565         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17566
17567 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17568
17569         * expression.cs: Fix bug I introduced lsat night that broke
17570         Delegates. 
17571
17572         (Expression.Resolve): Report a 246 error (can not resolve name)
17573         if we find a SimpleName in the stream.
17574
17575         (Expression.ResolveLValue): Ditto.
17576
17577         (Expression.ResolveWithSimpleName): This function is a variant of
17578         ResolveName, this one allows SimpleNames to be returned without a
17579         warning.  The only consumer of SimpleNames is MemberAccess
17580
17581 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17582
17583         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17584         might arrive here.  I have my doubts that this is correct.
17585
17586         * statement.cs (Lock): Implement lock statement.
17587
17588         * cs-parser.jay: Small fixes to support `lock' and `using'
17589
17590         * cs-tokenizer.cs: Remove extra space
17591
17592         * driver.cs: New flag --checked, allows to turn on integer math
17593         checking. 
17594
17595         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17596         Threading.Monitor.Exit 
17597
17598 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17599
17600         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17601         Expression Class to be IndexerAccess.
17602
17603         Notice that Indexer::DoResolve sets the eclass to Value.
17604
17605 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17606
17607         * class.cs (TypeContainer::Emit): Emit code for indexers.
17608
17609         * assign.cs (IAssignMethod): New interface implemented by Indexers
17610         and Properties for handling assignment.
17611
17612         (Assign::Emit): Simplify and reuse code. 
17613
17614         * expression.cs (IndexerAccess, PropertyExpr): Implement
17615         IAssignMethod, clean up old code. 
17616
17617 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17618
17619         * typemanager.cs (ImplementsInterface): New method to determine if a type
17620         implements a given interface. Provides a nice cache too.
17621
17622         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17623         method.
17624
17625         (ConvertReferenceExplicit): Ditto.
17626
17627         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17628         various methods, with correct names etc.
17629
17630         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17631         Operator.UnaryNegation.
17632
17633         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17634         we have a unary plus or minus operator.
17635
17636         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17637         UnaryMinus.
17638
17639         * everywhere : update accordingly.
17640
17641         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17642         respectively.
17643
17644         * class.cs (Method::Define): For the case where we are implementing a method
17645         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17646         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17647
17648 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17649
17650         * interface.cs (FindMembers): Implement to work around S.R.E
17651         lameness.
17652
17653         * typemanager.cs (IsInterfaceType): Implement.
17654
17655         (FindMembers): Update to handle interface types too.
17656
17657         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17658         use IsAssignableFrom as that is not correct - it doesn't work.
17659
17660         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17661         and accordingly override EmitStatement.
17662
17663         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17664         using the correct logic :-)
17665
17666 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17667
17668         * ../errors/cs-11.cs : Add to demonstrate error -11 
17669
17670 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17671
17672         * assign.cs (Assign::Resolve): Resolve right hand side first, and
17673         then pass this as a hint to ResolveLValue.
17674
17675         * expression.cs (FieldExpr): Add Location information
17676
17677         (FieldExpr::LValueResolve): Report assignment to readonly
17678         variable. 
17679
17680         (Expression::ExprClassFromMemberInfo): Pass location information.
17681
17682         (Expression::ResolveLValue): Add new method that resolves an
17683         LValue. 
17684
17685         (Expression::DoResolveLValue): Default invocation calls
17686         DoResolve. 
17687
17688         (Indexers): New class used to keep track of indexers in a given
17689         Type. 
17690
17691         (IStackStore): Renamed from LValue, as it did not really describe
17692         what this did.  Also ResolveLValue is gone from this interface and
17693         now is part of Expression.
17694
17695         (ElementAccess): Depending on the element access type
17696
17697         * typemanager.cs: Add `indexer_name_type' as a Core type
17698         (System.Runtime.CompilerServices.IndexerNameAttribute)
17699
17700         * statement.cs (Goto): Take a location.
17701
17702 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17703
17704         * delegate.cs (Delegate::VerifyDelegate): New method to verify
17705         if two delegates are compatible.
17706
17707         (NewDelegate::DoResolve): Update to take care of the case when
17708         we instantiate a delegate from another delegate.
17709
17710         * typemanager.cs (FindMembers): Don't even try to look up members
17711         of Delegate types for now.
17712
17713 2001-10-18  Ravi Pratap  <ravi@ximian.com>
17714
17715         * delegate.cs (NewDelegate): New class to take care of delegate
17716         instantiation.
17717
17718         * expression.cs (New): Split the delegate related code out into 
17719         the NewDelegate class.
17720
17721         * delegate.cs (DelegateInvocation): New class to handle delegate 
17722         invocation.
17723
17724         * expression.cs (Invocation): Split out delegate related code into
17725         the DelegateInvocation class.
17726
17727 2001-10-17  Ravi Pratap  <ravi@ximian.com>
17728
17729         * expression.cs (New::DoResolve): Implement delegate creation fully
17730         and according to the spec.
17731
17732         (New::DoEmit): Update to handle delegates differently.
17733
17734         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17735         because of which we were printing out arguments in reverse order !
17736
17737         * delegate.cs (VerifyMethod): Implement to check if the given method
17738         matches the delegate.
17739
17740         (FullDelegateDesc): Implement.
17741
17742         (VerifyApplicability): Implement.
17743
17744         * expression.cs (Invocation::DoResolve): Update to accordingly handle
17745         delegate invocations too.
17746
17747         (Invocation::Emit): Ditto.
17748
17749         * ../errors/cs1593.cs : Added.
17750
17751         * ../errors/cs1594.cs : Added.
17752
17753         * delegate.cs (InstanceExpression, TargetMethod): New properties.
17754
17755 2001-10-16  Ravi Pratap  <ravi@ximian.com>
17756
17757         * typemanager.cs (intptr_type): Core type for System.IntPtr
17758
17759         (InitCoreTypes): Update for the same.
17760
17761         (iasyncresult_type, asynccallback_type): Ditto.
17762
17763         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17764         correct.
17765
17766         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17767         too.
17768
17769         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17770         the builders for the 4 members of a delegate type :-)
17771
17772         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17773         type.
17774
17775         * expression.cs (New::DoResolve): Implement guts for delegate creation.
17776
17777         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17778
17779 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
17780
17781         * statement.cs (Break::Emit): Implement.   
17782         (Continue::Emit): Implement.
17783
17784         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17785         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17786         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
17787         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
17788         end loop
17789
17790         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17791         properties that track the label for the current loop (begin of the
17792         loop and end of the loop).
17793
17794 2001-10-15  Ravi Pratap  <ravi@ximian.com>
17795
17796         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17797         use of emitting anything at all.
17798
17799         * class.cs, rootcontext.cs : Get rid of calls to the same.
17800
17801         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17802
17803         (Populate): Define the constructor correctly and set the implementation
17804         attributes.
17805
17806         * typemanager.cs (delegate_types): New hashtable to hold delegates that
17807         have been defined.
17808
17809         (AddDelegateType): Implement.
17810
17811         (IsDelegateType): Implement helper method.
17812
17813         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17814
17815         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17816         and accordingly handle it.
17817
17818         * delegate.cs (Populate): Take TypeContainer argument.
17819         Implement bits to define the Invoke method. However, I still haven't figured out
17820         how to take care of the native int bit :-(
17821
17822         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
17823         Qualify the name of the delegate, not its return type !
17824
17825         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17826         conversion.
17827
17828         (StandardConversionExists): Checking for array types turns out to be recursive.
17829
17830         (ConvertReferenceExplicit): Implement array conversion.
17831
17832         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17833
17834 2001-10-12  Ravi Pratap  <ravi@ximian.com>
17835
17836         * cs-parser.jay (delegate_declaration): Store the fully qualified
17837         name as it is a type declaration.
17838
17839         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
17840         readonly.
17841
17842         (DefineDelegate): Renamed from Define. Does the same thing essentially,
17843         as TypeContainer::DefineType.
17844
17845         (Populate): Method in which all the definition of the various methods (Invoke)
17846         etc is done.
17847
17848         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17849         see.
17850
17851         (CloseDelegate): Finally creates the delegate.
17852
17853         * class.cs (TypeContainer::DefineType): Update to define delegates.
17854         (Populate, Emit and CloseType): Do the same thing here too.
17855
17856         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17857         delegates in all these operations.
17858
17859 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
17860
17861         * expression.cs: LocalTemporary: a new expression used to
17862         reference a temporary that has been created.
17863
17864         * assign.cs: Handle PropertyAccess back here, so that we can
17865         provide the proper semantic access to properties.
17866
17867         * expression.cs (Expression::ConvertReferenceExplicit): Implement
17868         a few more explicit conversions. 
17869
17870         * modifiers.cs: `NEW' modifier maps to HideBySig.
17871
17872         * expression.cs (PropertyExpr): Make this into an
17873         ExpressionStatement, and support the EmitStatement code path. 
17874
17875         Perform get/set error checking, clean up the interface.
17876
17877         * assign.cs: recognize PropertyExprs as targets, and if so, turn
17878         them into toplevel access objects.
17879
17880 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
17881
17882         * expression.cs: PropertyExpr::PropertyExpr: use work around the
17883         SRE.
17884
17885         * typemanager.cs: Keep track here of our PropertyBuilders again to
17886         work around lameness in SRE.
17887
17888 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
17889
17890         * expression.cs (LValue::LValueResolve): New method in the
17891         interface, used to perform a second resolution pass for LValues. 
17892
17893         (This::DoResolve): Catch the use of this in static methods.
17894
17895         (This::LValueResolve): Implement.
17896
17897         (This::Store): Remove warning, assigning to `this' in structures
17898         is 
17899
17900         (Invocation::Emit): Deal with invocation of
17901         methods on value types.  We need to pass the address to structure
17902         methods rather than the object itself.  (The equivalent code to
17903         emit "this" for structures leaves the entire structure on the
17904         stack instead of a pointer to it). 
17905
17906         (ParameterReference::DoResolve): Compute the real index for the
17907         argument based on whether the method takes or not a `this' pointer
17908         (ie, the method is static).
17909
17910         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17911         value types returned from functions when we need to invoke a
17912         method on the sturcture.
17913
17914
17915 2001-10-11  Ravi Pratap  <ravi@ximian.com>
17916
17917         * class.cs (TypeContainer::DefineType): Method to actually do the business of
17918         defining the type in the Modulebuilder or Typebuilder. This is to take
17919         care of nested types which need to be defined on the TypeBuilder using
17920         DefineNestedMethod.
17921
17922         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
17923         methods in RootContext, only ported to be part of TypeContainer.
17924
17925         (TypeContainer::GetInterfaceOrClass): Ditto.
17926
17927         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17928
17929         * interface.cs (Interface::DefineInterface): New method. Does exactly
17930         what RootContext.CreateInterface did earlier, only it takes care of nested types 
17931         too.
17932
17933         (Interface::GetInterfaces): Move from RootContext here and port.
17934
17935         (Interface::GetInterfaceByName): Same here.
17936
17937         * rootcontext.cs (ResolveTree): Re-write.
17938
17939         (PopulateTypes): Re-write.
17940
17941         * class.cs (TypeContainer::Populate): Populate nested types too.
17942         (TypeContainer::Emit): Emit nested members too.
17943
17944         * typemanager.cs (AddUserType): Do not make use of the FullName property,
17945         instead just use the name argument passed in as it is already fully
17946         qualified.
17947
17948         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
17949         to TypeContainer mapping to see if a type is user-defined.
17950
17951         * class.cs (TypeContainer::CloseType): Implement. 
17952
17953         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
17954         the default constructor.
17955
17956         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
17957         twice.
17958
17959         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
17960
17961         * interface.cs (CloseType): Create the type here.
17962
17963         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
17964         the hierarchy.
17965
17966         Remove all the methods which are now in TypeContainer.
17967
17968 2001-10-10  Ravi Pratap  <ravi@ximian.com>
17969
17970         * delegate.cs (Define): Re-write bits to define the delegate
17971         correctly.
17972
17973 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
17974
17975         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
17976
17977         * expression.cs (ImplicitReferenceConversion): handle null as well
17978         as a source to convert to any reference type.
17979
17980         * statement.cs (Return): Perform any implicit conversions to
17981         expected return type.  
17982
17983         Validate use of return statement.  
17984
17985         * codegen.cs (EmitContext): Pass the expected return type here.
17986
17987         * class.cs (Method, Constructor, Property): Pass expected return
17988         type to EmitContext.
17989
17990 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
17991
17992         * expression.cs: Make DoResolve take an EmitContext instead of a
17993         TypeContainer.
17994
17995         Replaced `l' and `location' for `loc', for consistency.
17996
17997         (Error, Warning): Remove unneeded Tc argument.
17998
17999         * assign.cs, literal.cs, constant.cs: Update to new calling
18000         convention. 
18001
18002         * codegen.cs: EmitContext now contains a flag indicating whether
18003         code is being generated in a static method or not.
18004
18005         * cs-parser.jay: DecomposeQI, new function that replaces the old
18006         QualifiedIdentifier.  Now we always decompose the assembled
18007         strings from qualified_identifier productions into a group of
18008         memberaccesses.
18009
18010 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18011
18012         * rootcontext.cs: Deal with field-less struct types correctly now
18013         by passing the size option to Define Type.
18014
18015         * class.cs: Removed hack that created one static field. 
18016
18017 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18018
18019         * statement.cs: Moved most of the code generation here. 
18020
18021 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18022
18023         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18024         seem very right.
18025
18026         (ElementAccess): Remove useless bits for now - keep checks as the spec
18027         says.
18028
18029 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18030
18031         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18032         and start performing checks according to the spec.
18033
18034 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18035
18036         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18037         rank_specifiers instead.
18038
18039         (rank_specifiers): Change the order in which the rank specifiers are stored
18040
18041         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18042
18043         * expression.cs (ElementAccess): Implement the LValue interface too.
18044
18045 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18046
18047         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18048         except that user defined conversions are not included.
18049
18050         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18051         perform the conversion of the return type, if necessary.
18052
18053         (New::DoResolve): Check whether we are creating an array or an object
18054         and accordingly do the needful.
18055
18056         (New::Emit): Same here.
18057
18058         (New::DoResolve): Implement guts of array creation.
18059
18060         (New::FormLookupType): Helper function.
18061
18062 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18063
18064         * codegen.cs: Removed most of the code generation here, and move the
18065         corresponding code generation bits to the statement classes. 
18066
18067         Added support for try/catch/finalize and throw.
18068
18069         * cs-parser.jay: Added support for try/catch/finalize.
18070
18071         * class.cs: Catch static methods having the flags override,
18072         virtual or abstract.
18073
18074         * expression.cs (UserCast): This user cast was not really doing
18075         what it was supposed to do.  Which is to be born in fully resolved
18076         state.  Parts of the resolution were being performed at Emit time! 
18077
18078         Fixed this code.
18079
18080 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18081
18082         * expression.cs: Implicity convert the result from UserCast.
18083
18084 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18085
18086         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18087         prevented it from working correctly. 
18088
18089         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18090         merely ConvertImplicit.
18091
18092 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18093
18094         * typemanager.cs: Make the LookupTypeContainer function static,
18095         and not per-instance.  
18096
18097         * class.cs: Make static FindMembers (the one that takes a Type
18098         argument). 
18099
18100         * codegen.cs: Add EmitForeach here.
18101
18102         * cs-parser.jay: Make foreach a toplevel object instead of the
18103         inline expansion, as we need to perform semantic analysis on it. 
18104
18105 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18106
18107         * expression.cs (Expression::ImplicitUserConversion): Rename to
18108         UserDefinedConversion.
18109
18110         (Expression::UserDefinedConversion): Take an extra argument specifying 
18111         whether we look for explicit user conversions too.
18112
18113         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18114
18115         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18116
18117         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18118         with the appropriate arguments.
18119
18120         * cs-parser.jay (cast_expression): Record location too.
18121
18122         * expression.cs (Cast): Record location info.
18123
18124         (Expression::ConvertExplicit): Take location argument.
18125
18126         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18127         to determine if we are doing explicit conversions.
18128
18129         (UserCast::Emit): Update accordingly.
18130
18131         (Expression::ConvertExplicit): Report an error if everything fails.
18132
18133         * ../errors/cs0030.cs : Add.
18134
18135 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18138         virtual and newslot bits. 
18139
18140         * class.cs (TypeContainer::RegisterRequiredImplementations):
18141         Record methods we need.
18142
18143         (TypeContainer::MakeKey): Helper function to make keys for
18144         MethodBases, since the Methodbase key is useless.
18145
18146         (TypeContainer::Populate): Call RegisterRequiredImplementations
18147         before defining the methods.   
18148
18149         Create a mapping for method_builders_to_methods ahead of time
18150         instead of inside a tight loop.
18151
18152         (::RequireMethods):  Accept an object as the data to set into the
18153         hashtable so we can report interface vs abstract method mismatch.
18154
18155 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18156
18157         * report.cs: Make all of it static.
18158
18159         * rootcontext.cs: Drop object_type and value_type computations, as
18160         we have those in the TypeManager anyways.
18161
18162         Drop report instance variable too, now it is a global.
18163
18164         * driver.cs: Use try/catch on command line handling.
18165
18166         Add --probe option to debug the error reporting system with a test
18167         suite. 
18168
18169         * report.cs: Add support for exiting program when a probe
18170         condition is reached.
18171
18172 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18173
18174         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18175         we do a forcible conversion regardless of type, to check if 
18176         ForceConversion returns a null.
18177
18178         (Binary::error19): Use location to report error.
18179
18180         (Unary::error23): Use location here too.
18181
18182         * ../errors/cs0019.cs : Check in.
18183
18184         * ../errors/cs0023.cs : Check in.
18185
18186         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18187         case of a non-null MethodInfo object with a length of 0 !
18188
18189         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18190         an applicable member - according to the spec :-)
18191         Also fix logic to find members in base types.
18192
18193         (Unary::ResolveOperator): Same here.
18194
18195         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18196         as I was getting thoroughly confused between this and error19 :-)
18197
18198         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18199         (::FindMostEncompassedType): Implement.
18200         (::FindMostEncompassingType): Implement.
18201         (::StandardConversionExists): Implement.
18202
18203         (UserImplicitCast): Re-vamp. We now need info about most specific
18204         source and target types so that we can do the necessary conversions.
18205
18206         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18207         mathematical union with no duplicates.
18208
18209 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18210
18211         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18212         in order from base classes to child classes, so that we can in
18213         child classes look up in our parent for method names and
18214         attributes (required for handling abstract, virtual, new, override
18215         constructs: we need to instrospect our base class, and if we dont
18216         populate the classes in order, the introspection might be
18217         incorrect.  For example, a method could query its parent before
18218         the parent has any methods and would determine that the parent has
18219         no abstract methods (while it could have had them)).
18220
18221         (RootContext::CreateType): Record the order in which we define the
18222         classes.
18223
18224 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18225
18226         * class.cs (TypeContainer::Populate): Also method definitions can
18227         fail now, keep track of this.
18228
18229         (TypeContainer::FindMembers): Implement support for
18230         DeclaredOnly/noDeclaredOnly flag.
18231
18232         (Constructor::Emit) Return the ConstructorBuilder.
18233
18234         (Method::Emit) Return the MethodBuilder. 
18235         Check for abstract or virtual methods to be public.
18236
18237         * rootcontext.cs (RootContext::CreateType): Register all the
18238         abstract methods required for the class to be complete and the
18239         interface methods that must be implemented. 
18240
18241         * cs-parser.jay: Report error 501 (method requires body if it is
18242         not marked abstract or extern).
18243
18244         * expression.cs (TypeOf::Emit): Implement.
18245
18246         * typemanager.cs: runtime_handle_type, new global type.
18247
18248         * class.cs (Property::Emit): Generate code for properties.
18249
18250 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18251
18252         * expression.cs (Unary::ResolveOperator): Find operators on base type
18253         too - we now conform exactly to the spec.
18254
18255         (Binary::ResolveOperator): Same here.
18256
18257         * class.cs (Operator::Define): Fix minor quirk in the tests.
18258
18259         * ../errors/cs0215.cs : Added.
18260
18261         * ../errors/cs0556.cs : Added.
18262
18263         * ../errors/cs0555.cs : Added.
18264
18265 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18268         single integer which is really efficient
18269
18270 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18271
18272         *  expression.cs (Expression::ImplicitUserConversion): Use location
18273         even in the case when we are examining True operators.
18274  
18275         * class.cs (Operator::Define): Perform extensive checks to conform
18276         with the rules for operator overloading in the spec.
18277
18278         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18279         some of the other conversions mentioned in the spec.
18280
18281         * typemanager.cs (array_type): New static member for the System.Array built-in
18282         type.
18283
18284         (cloneable_interface): For System.ICloneable interface.
18285
18286         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18287         we start resolving the tree and populating types.
18288
18289         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18290  
18291 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * expression.cs (Expression::ExprClassFromMemberInfo,
18294         Expression::Literalize): Create literal expressions from
18295         FieldInfos which are literals.
18296
18297         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18298         type casts, because they were wrong.  The test suite in tests
18299         caught these ones.
18300
18301         (ImplicitNumericConversion): ushort to ulong requires a widening
18302         cast. 
18303
18304         Int32 constant to long requires widening cast as well.
18305
18306         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18307         for integers because the type on the stack is not i4.
18308
18309 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18310
18311         * expression.cs (report118): require location argument. 
18312
18313         * parameter.cs: Do not dereference potential null value.
18314
18315         * class.cs: Catch methods that lack the `new' keyword when
18316         overriding a name.  Report warnings when `new' is used without
18317         anything being there to override.
18318
18319         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18320
18321         * class.cs: Only add constructor to hashtable if it is non-null
18322         (as now constructors can fail on define).
18323
18324         (TypeManager, Class, Struct): Take location arguments.
18325
18326         Catch field instance initialization in structs as errors.
18327
18328         accepting_filter: a new filter for FindMembers that is static so
18329         that we dont create an instance per invocation.
18330
18331         (Constructor::Define): Catch errors where a struct constructor is
18332         parameterless 
18333
18334         * cs-parser.jay: Pass location information for various new
18335         constructs. 
18336
18337         * delegate.cs (Delegate): take a location argument.
18338
18339         * driver.cs: Do not call EmitCode if there were problesm in the
18340         Definition of the types, as many Builders wont be there. 
18341
18342         * decl.cs (Decl::Decl): Require a location argument.
18343
18344         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18345         into integers, and find the most appropiate integer for it.
18346
18347         * literal.cs: Implement ULongLiteral.
18348
18349         * rootcontext.cs: Provide better information about the location of
18350         failure when CreateType fails.
18351
18352 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18353
18354         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18355         as well.
18356
18357         * expression.cs (Binary::CheckShiftArguments): Add missing type
18358         computation.
18359         (Binary::ResolveOperator): Add type to the logical and and logical
18360         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18361         before.
18362
18363         (Binary::DoNumericPromotions): In the case where either argument
18364         is ulong (and most signed types combined with ulong cause an
18365         error) perform implicit integer constant conversions as well.
18366
18367 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18368
18369         * expression.cs (UserImplicitCast): Method should always be
18370         non-null. 
18371         (Invocation::BetterConversion): Simplified test for IntLiteral.
18372
18373         (Expression::ImplicitNumericConversion): Split this routine out.
18374         Put the code that performs implicit constant integer conversions
18375         here. 
18376
18377         (Expression::Resolve): Become a wrapper around DoResolve so we can
18378         check eclass and type being set after resolve.
18379
18380         (Invocation::Badness): Remove this dead function
18381
18382         (Binary::ResolveOperator): Do not compute the expensive argumnets
18383         unless we have a union for it.
18384
18385         (Probe::Emit): Is needs to do an isinst and then
18386         compare against null.
18387
18388         (::CanConvert): Added Location argument.  If the Location argument
18389         is null (Location.Null), then we do not report errors.  This is
18390         used by the `probe' mechanism of the Explicit conversion.  We do
18391         not want to generate an error for something that the user
18392         explicitly requested to be casted.  But the pipeline for an
18393         explicit cast first tests for potential implicit casts.
18394
18395         So for now, if the Location is null, it means `Probe only' to
18396         avoid adding another argument.   Might have to revise this
18397         strategy later.
18398
18399         (ClassCast): New class used to type cast objects into arbitrary
18400         classes (used in Explicit Reference Conversions).
18401
18402         Implement `as' as well.
18403
18404         Reverted all the patches from Ravi below: they were broken:
18405
18406                 * The use of `level' as a mechanism to stop recursive
18407                   invocations is wrong.  That was there just to catch the
18408                   bug with a strack trace but not as a way of addressing
18409                   the problem.
18410
18411                   To fix the problem we have to *understand* what is going
18412                   on and the interactions and come up with a plan, not
18413                   just get things going.
18414
18415                 * The use of the type conversion cache that I proposed
18416                   last night had an open topic: How does this work across
18417                   protection domains.  A user defined conversion might not
18418                   be public in the location where we are applying the
18419                   conversion, a different conversion might be selected
18420                   (ie, private A->B (better) but public B->A (worse),
18421                   inside A, A->B applies, but outside it, B->A will
18422                   apply).
18423
18424                 * On top of that (ie, even if the above is solved),
18425                   conversions in a cache need to be abstract.  Ie, `To
18426                   convert from an Int to a Short use an OpcodeCast', not
18427                   `To convert from an Int to a Short use the OpcodeCast on
18428                   the variable 5' (which is what this patch was doing).
18429
18430 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18431
18432         * expression.cs (Invocation::ConversionExists): Re-write to use
18433         the conversion cache
18434
18435         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18436         cache all conversions done, not just user-defined ones.
18437
18438         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18439         to determine if a conversion exists instead of acutually trying to 
18440         perform the conversion. It's faster too.
18441
18442         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18443         and only then attempt the implicit conversion.
18444
18445 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18446
18447         * expression.cs (ConvertImplicit): Use a cache for conversions
18448         already found. Check level of recursion and bail out if necessary.
18449
18450 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18451
18452         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18453         Export standard methods that we expect for string operations.
18454
18455         * statement.cs (Block::UsageWarning): Track usage of variables and
18456         report the errors for not used variables.
18457
18458         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18459         operator. 
18460
18461 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18462
18463         * codegen.cs: remove unnneded code 
18464
18465         * expression.cs: Removed BuiltinTypeAccess class
18466
18467         Fix the order in which implicit conversions are
18468         done.  
18469
18470         The previous fixed dropped support for boxed conversions (adding a
18471         test to the test suite now)
18472
18473         (UserImplicitCast::CanConvert): Remove test for source being null,
18474         that code is broken.  We should not feed a null to begin with, if
18475         we do, then we should track the bug where the problem originates
18476         and not try to cover it up here.
18477
18478         Return a resolved expression of type UserImplicitCast on success
18479         rather than true/false.  Ravi: this is what I was talking about,
18480         the pattern is to use a static method as a "constructor" for
18481         objects. 
18482
18483         Also, do not create arguments until the very last minute,
18484         otherwise we always create the arguments even for lookups that
18485         will never be performed. 
18486
18487         (UserImplicitCast::Resolve): Eliminate, objects of type
18488         UserImplicitCast are born in a fully resolved state. 
18489
18490         * typemanager.cs (InitCoreTypes): Init also value_type
18491         (System.ValueType). 
18492
18493         * expression.cs (Cast::Resolve): First resolve the child expression.
18494
18495         (LValue): Add new method AddressOf to be used by
18496         the `&' operator.  
18497
18498         Change the argument of Store to take an EmitContext instead of an
18499         ILGenerator, because things like FieldExpr need to be able to call
18500         their children expression to generate the instance code. 
18501
18502         (Expression::Error, Expression::Warning): Sugar functions for
18503         reporting errors.
18504
18505         (Expression::MemberLookup): Accept a TypeContainer instead of a
18506         Report as the first argument.
18507
18508         (Expression::ResolvePrimary): Killed.  I still want to improve
18509         this as currently the code is just not right.
18510
18511         (Expression::ResolveMemberAccess): Simplify, but it is still
18512         wrong. 
18513
18514         (Unary::Resolve): Catch errors in AddressOf operators.
18515
18516         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18517         index to a byte for the short-version, or the compiler will choose
18518         the wrong Emit call, which generates the wrong data.
18519
18520         (ParameterReference::Emit, ::Store): same.
18521
18522         (FieldExpr::AddressOf): Implement.
18523
18524         * typemanager.cs: TypeManager: made public variable instead of
18525         property.
18526
18527         * driver.cs: document --fatal.
18528
18529         * report.cs (ErrorMessage, WarningMessage): new names for the old
18530         Error and Warning classes.
18531
18532         * cs-parser.jay (member_access): Turn built-in access to types
18533         into a normal simplename
18534
18535 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18536
18537         * expression.cs (Invocation::BetterConversion): Fix to cope
18538         with q being null, since this was introducing a bug.
18539
18540         * expression.cs (ConvertImplicit): Do built-in conversions first.
18541
18542 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18543
18544         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18545
18546 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18547
18548         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18549         I had introduced long ago (what's new ?).
18550
18551         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18552         the work of all the checking. 
18553         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18554         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18555
18556         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18557         that is the right way. 
18558
18559         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18560         overloading resolution. Use everywhere instead of cutting and pasting code.
18561
18562         (Binary::ResolveOperator): Use MakeUnionSet.
18563
18564         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18565         we have to convert to bool types. Not complete yet.
18566
18567 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18568
18569         * typemanager.cs (TypeManager::CSharpName): support ushort.
18570
18571         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18572         to provide an expression that performsn an implicit constant int
18573         conversion (section 6.1.6).
18574         (Expression::ConvertImplicitRequired): Reworked to include
18575         implicit constant expression conversions.
18576
18577         (Expression::ConvertNumericExplicit): Finished.
18578
18579         (Invocation::Emit): If InstanceExpression is null, then it means
18580         that we perform a call on this.
18581
18582 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18583
18584         * expression.cs (Unary::Emit): Remove some dead code.
18585         (Probe): Implement Resolve and Emit for `is'.
18586         (Expression::ConvertImplicitRequired): Attempt to do constant
18587         expression conversions here.  Maybe should be moved to
18588         ConvertImplicit, but I am not sure.
18589         (Expression::ImplicitLongConstantConversionPossible,
18590         Expression::ImplicitIntConstantConversionPossible): New functions
18591         that tell whether is it possible to apply an implicit constant
18592         expression conversion.
18593
18594         (ConvertNumericExplicit): Started work on explicit numeric
18595         conversions.
18596
18597         * cs-parser.jay: Update operator constants.
18598
18599         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18600         (Parameters::GetSignature): Hook up VerifyArgs here.
18601         (Parameters::VerifyArgs): Verifies that no two arguments have the
18602         same name. 
18603
18604         * class.cs (Operator): Update the operator names to reflect the
18605         ones that the spec expects (as we are just stringizing the
18606         operator names).
18607
18608         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18609         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18610         previous usage did only work for our methods.
18611         (Expression::ConvertImplicit): Handle decimal implicit numeric
18612         conversions as well.
18613         (Expression::InternalTypeConstructor): Used to invoke constructors
18614         on internal types for default promotions.
18615
18616         (Unary::Emit): Implement special handling for the pre/post
18617         increment/decrement for overloaded operators, as they need to have
18618         the same semantics as the other operators.
18619
18620         (Binary::ResolveOperator): ditto.
18621         (Invocation::ConversionExists): ditto.
18622         (UserImplicitCast::Resolve): ditto.
18623
18624 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18625
18626         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18627         operator, return after emitting body. Regression tests pass again !
18628
18629         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18630         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18631         (Invocation::OverloadResolve): Ditto.
18632         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18633
18634         * everywhere : update calls to the above methods accordingly.
18635
18636 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18637
18638         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18639
18640         * expression.cs (ExpressionStatement): New base class used for
18641         expressions that can appear in statements, so that we can provide
18642         an alternate path to generate expression that do not leave a value
18643         on the stack.
18644
18645         (Expression::Emit, and all the derivatives): We no longer return
18646         whether a value is left on the stack or not.  Every expression
18647         after being emitted leaves a single value on the stack.
18648
18649         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18650         facilties of ExpressionStatement if possible.
18651
18652         * cs-parser.jay: Update statement_expression.
18653
18654 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18655
18656         * driver.cs: Change the wording of message
18657
18658 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18659
18660         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18661         the type of the expression to the return type of the method if
18662         we have an overloaded operator match ! The regression tests pass again !
18663         (Unary::ResolveOperator): Ditto.
18664
18665         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18666         to find "op_Implicit", not "implicit" ;-)
18667         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18668         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18669
18670         * everywhere : Correct calls to the above accordingly.
18671
18672         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18673         (ConvertImplicit): Do user-defined conversion if it exists.
18674
18675 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
18676
18677         * assign.cs: track location.
18678         (Resolve): Use implicit conversions on assignment.
18679
18680         * literal.cs: Oops.  Not good, Emit of short access values should
18681         pass (Bytes) or the wrong argument will be selected.
18682
18683         * expression.cs (Unary::Emit): Emit code for -expr.
18684
18685         (Unary::ResolveOperator): Handle `Substract' for non-constants
18686         (substract from zero from the non-constants).
18687         Deal with Doubles as well. 
18688
18689         (Expression::ConvertImplicitRequired): New routine that reports an
18690         error if no implicit conversion exists. 
18691
18692         (Invocation::OverloadResolve): Store the converted implicit
18693         expressions if we make them
18694
18695 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18696
18697         * class.cs (ConstructorInitializer): Take a Location argument.
18698         (ConstructorBaseInitializer): Same here.
18699         (ConstructorThisInitializer): Same here.
18700
18701         * cs-parser.jay : Update all calls accordingly.
18702
18703         * expression.cs (Unary, Binary, New): Take location argument.
18704         Update accordingly everywhere.
18705
18706         * cs-parser.jay : Update all calls to the above to take a location
18707         argument.
18708
18709         * class.cs : Ditto.
18710
18711 2001-09-24  Ravi Pratap  <ravi@ximian.com>
18712
18713         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18714         (Invocation::BetterConversion): Same here
18715         (Invocation::ConversionExists): Ditto.
18716
18717         (Invocation::ConversionExists): Implement.
18718
18719 2001-09-22  Ravi Pratap  <ravi@ximian.com>
18720
18721         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18722         Also take an additional TypeContainer argument.
18723
18724         * All over : Pass in TypeContainer as argument to OverloadResolve.
18725
18726         * typemanager.cs (CSharpName): Update to check for the string type and return
18727         that too.
18728
18729         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18730         a given method.
18731
18732 2001-09-21  Ravi Pratap  <ravi@ximian.com>
18733
18734         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18735         (Invocation::BetterFunction): Implement.
18736         (Invocation::BetterConversion): Implement.
18737         (Invocation::ConversionExists): Skeleton, no implementation yet.
18738
18739         Okay, things work fine !
18740
18741 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
18742
18743         * typemanager.cs: declare and load enum_type, delegate_type and
18744         void_type. 
18745
18746         * expression.cs (Expression::Emit): Now emit returns a value that
18747         tells whether a value is left on the stack or not.  This strategy
18748         might be reveted tomorrow with a mechanism that would address
18749         multiple assignments.
18750         (Expression::report118): Utility routine to report mismatches on
18751         the ExprClass.
18752
18753         (Unary::Report23): Report impossible type/operator combination
18754         utility function.
18755
18756         (Unary::IsIncrementableNumber): Whether the type can be
18757         incremented or decremented with add.
18758         (Unary::ResolveOperator): Also allow enumerations to be bitwise
18759         complemented. 
18760         (Unary::ResolveOperator): Implement ++, !, ~,
18761
18762         (Invocation::Emit): Deal with new Emit convetion.
18763
18764         * All Expression derivatives: Updated their Emit method to return
18765         whether they leave values on the stack or not.
18766
18767         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18768         stack for expressions that are statements. 
18769
18770 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18771
18772         * expression.cs (LValue): New interface.  Must be implemented by
18773         LValue objects.
18774         (LocalVariableReference, ParameterReference, FieldExpr): Implement
18775         LValue interface.
18776
18777         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18778         interface for generating code, simplifies the code.
18779
18780 2001-09-20  Ravi Pratap  <ravi@ximian.com>
18781
18782         * expression.cs (everywhere): Comment out return statements in ::Resolve
18783         methods to avoid the warnings.
18784
18785 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
18786
18787         * driver.cs (parse): Report error 2001 if we can not open the
18788         source file.
18789
18790         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18791         not resolve it.
18792
18793         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18794         object. 
18795
18796         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18797         otherwise nested blocks end up with the same index.
18798
18799         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18800
18801         * expression.cs:  Instead of having FIXMEs in the Resolve
18802         functions, throw exceptions so it is obvious that we are facing a
18803         bug. 
18804
18805         * cs-parser.jay (invocation_expression): Pass Location information.
18806
18807         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18808         Use a basename for those routines because .NET does not like paths
18809         on them. 
18810
18811         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18812         already defined.
18813
18814 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18817         are loading the correct data types (throws an exception if not).
18818         (TypeManager::InitCoreTypes): Use CoreLookupType
18819
18820         * expression.cs (Unary::ResolveOperator): return the child
18821         expression for expressions which are just +expr.
18822         (Unary::ResolveOperator): Return negative literals for -LITERAL
18823         expressions (otherwise they are Unary {Literal}).
18824         (Invocation::Badness): Take into account `Implicit constant
18825         expression conversions'.
18826
18827         * literal.cs (LongLiteral): Implement long literal class.
18828         (IntLiteral): export the `Value' of the intliteral. 
18829
18830 2001-09-19  Ravi Pratap  <ravi@ximian.com>
18831
18832         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18833
18834         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
18835         instead of 'Operator'
18836
18837         * expression.cs (Binary::ResolveOperator): Update accordingly.
18838         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18839         and 'Minus'
18840
18841         * cs-parser.jay (unary_expression): Update to use the new names.
18842
18843         * gen-treedump.cs (GetUnary): Same here.
18844
18845         * expression.cs (Unary::Resolve): Implement.
18846         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
18847         operators are found instead of making noise ;-)
18848         (Unary::ResolveOperator): New method to do precisely the same thing which
18849         Binary::ResolveOperator does for Binary expressions.
18850         (Unary.method, .Arguments): Add.
18851         (Unary::OperName): Implement.   
18852         (Unary::ForceConversion): Copy and Paste !
18853
18854         * class.cs (Operator::Define): Fix a small bug for the case when we have 
18855         a unary operator.
18856
18857         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18858         for the inbuilt operators. Only overloading works for now ;-)
18859
18860 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18863         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18864
18865         * expression.cs (This::Emit): Implement. 
18866         (This::Resolve): Implement.
18867         (TypeOf:Resolve): Implement.
18868         (Expression::ResolveSimpleName): Add an implicit this to instance
18869         field references. 
18870         (MemberAccess::Resolve): Deal with Parameters and Fields. 
18871         Bind instance variable to Field expressions.
18872         (FieldExpr::Instance): New field used to track the expression that
18873         represents the object instance.
18874         (FieldExpr::Resolve): Track potential errors from MemberLookup not
18875         binding 
18876         (FieldExpr::Emit): Implement.
18877
18878         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18879         the last instruction contains a return opcode to avoid generating
18880         the last `ret' instruction (this generates correct code, and it is
18881         nice to pass the peverify output).
18882
18883         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18884         initializer for static and instance variables.
18885         (Constructor::Emit): Allow initializer to be null in the case of
18886         static constructors.  Only emit initializer for instance
18887         constructors. 
18888
18889         (TypeContainer::FindMembers): Return a null array if there are no
18890         matches.
18891
18892         Also fix the code for the MemberTypes.Method branch, as it was not
18893         scanning that for operators (or tried to access null variables before).
18894
18895         * assign.cs (Assign::Emit): Handle instance and static fields. 
18896
18897         * TODO: Updated.
18898
18899         * driver.cs: Stop compilation if there are parse errors.
18900
18901         * cs-parser.jay (constructor_declaration): Provide default base
18902         initializer for non-static constructors.
18903         (constructor_declarator): Do not provide a default base
18904         initializers if none was specified.
18905         Catch the fact that constructors should not have parameters.
18906
18907         * class.cs: Do not emit parent class initializers for static
18908         constructors, that should be flagged as an error.
18909
18910 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18911
18912         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18913         Move back code into TypeContainer::Populate.
18914
18915 2001-09-18  Ravi Pratap  <ravi@ximian.com>
18916
18917         * class.cs (TypeContainer::AddConstructor): Fix the check to
18918         compare against Name, not Basename. 
18919         (Operator::OpType): Change Plus and Minus to Add and Subtract.
18920
18921         * cs-parser.jay : Update accordingly.
18922
18923         * class.cs (TypeContainer::FindMembers): For the case where we are searching
18924         for methods, don't forget to look into the operators too.
18925         (RegisterMethodBuilder): Helper method to take care of this for
18926         methods, constructors and operators.
18927         (Operator::Define): Completely revamp.
18928         (Operator.OperatorMethod, MethodName): New fields.
18929         (TypeContainer::Populate): Move the registering of builders into
18930         RegisterMethodBuilder.
18931         (Operator::Emit): Re-write.
18932
18933         * expression.cs (Binary::Emit): Comment out code path to emit method
18934         invocation stuff for the case when we have a user defined operator. I am
18935         just not able to get it right !
18936
18937 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
18940         argument. 
18941
18942         (Expression::MemberLookup): Provide a version that allows to
18943         specify the MemberTypes and BindingFlags. 
18944
18945         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
18946         so it was not fetching variable information from outer blocks.
18947
18948         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
18949         Beforefieldinit as it was buggy.
18950
18951         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
18952         that Ravi put here.  
18953
18954         * class.cs (Constructor::Emit): Only emit if block is not null.
18955         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
18956         deal with this by semantically definining it as if the user had
18957         done it.
18958
18959         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
18960         constructors as we now "emit" them at a higher level.
18961
18962         (TypeContainer::DefineDefaultConstructor): Used to define the
18963         default constructors if none was provided.
18964
18965         (ConstructorInitializer): Add methods Resolve and Emit. 
18966
18967         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
18968
18969 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18970
18971         * class.cs (TypeContainer::EmitDefaultConstructor): Register
18972         the default constructor builder with our hashtable for methodbuilders
18973         to methodcores.
18974
18975         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
18976         and argument_count is 0 in which case we have a match.
18977         (Binary::ResolveOperator): More null checking and miscellaneous coding
18978         style cleanup.
18979
18980 2001-09-17  Ravi Pratap  <ravi@ximian.com>
18981
18982         * rootcontext.cs (IsNameSpace): Compare against null.
18983
18984         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
18985
18986         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
18987         and Unary::Operator.
18988
18989         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
18990         accordingly.
18991
18992         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
18993         we have overloaded operators.
18994         (Binary::ResolveOperator): Implement the part which does the operator overload
18995         resolution.
18996
18997         * class.cs (Operator::Emit): Implement.
18998         (TypeContainer::Emit): Emit the operators we have too.
18999
19000         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19001         the case when we have a user-defined operator.
19002
19003 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19004
19005         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19006
19007 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19008
19009         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19010         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19011         (Constructor::Emit): Implement.
19012         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19013         if we have no work to do. 
19014         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19015         Emit method.
19016
19017         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19018         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19019
19020         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19021         of parent.parent.
19022
19023 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19024
19025         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19026         in the source.
19027         (Tree::RecordNamespace): Method to do what the name says ;-)
19028         (Tree::Namespaces): Property to get at the namespaces hashtable.
19029
19030         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19031         keep track.
19032
19033         * rootcontext.cs (IsNamespace): Fixed it :-)
19034
19035 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19036
19037         * class.cs (TypeContainer::FindMembers): Add support for
19038         constructors. 
19039         (MethodCore): New class that encapsulates both the shared aspects
19040         of a Constructor and a Method.  
19041         (Method, Constructor): Factored pieces into MethodCore.
19042
19043         * driver.cs: Added --fatal which makes errors throw exceptions.
19044         Load System assembly as well as part of the standard library.
19045
19046         * report.cs: Allow throwing exceptions on errors for debugging.
19047
19048         * modifiers.cs: Do not use `parent', instead use the real type
19049         container to evaluate permission settings.
19050
19051         * class.cs: Put Ravi's patch back in.  He is right, and we will
19052         have to cope with the
19053
19054 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19055
19056         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19057         FamORAssem, not FamANDAssem.
19058
19059 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * driver.cs: Added --parse option that only parses its input files
19062         and terminates.
19063
19064         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19065         incorrect.  IsTopLevel is not used to tell whether an object is
19066         root_types or not (that can be achieved by testing this ==
19067         root_types).  But to see if this is a top-level *class* (not
19068         necessarly our "toplevel" container). 
19069
19070 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19071
19072         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19073         parent instead of a direct call to GetType.
19074
19075 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19076
19077         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19078         Modifiers.TypeAttr. This should just be a call to that method.
19079
19080         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19081         object so that we can determine if we are top-level or not.
19082
19083         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19084         TypeContainer too.
19085
19086         * enum.cs (Enum::Define): Ditto.
19087
19088         * modifiers.cs (FieldAttr): Re-write.
19089
19090         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19091         (TypeContainer::HaveStaticConstructor): New property to provide access
19092         to precisely that info.
19093
19094         * modifiers.cs (MethodAttr): Re-write.
19095         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19096
19097         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19098         of top-level types as claimed.
19099
19100 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * expression.cs (MemberLookup): Fruitless attempt to lookup
19103         constructors.  Maybe I need to emit default constructors?  That
19104         might be it (currently .NET emits this for me automatically).
19105         (Invocation::OverloadResolve): Cope with Arguments == null.
19106         (Invocation::EmitArguments): new function, shared by the new
19107         constructor and us.
19108         (Invocation::Emit): Handle static and instance methods.  Emit
19109         proper call instruction for virtual or non-virtual invocations.
19110         (New::Emit): Implement.
19111         (New::Resolve): Implement.
19112         (MemberAccess:Resolve): Implement.
19113         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19114         to track instances.
19115         (FieldExpr::Resolve): Set type.
19116
19117         * support.cs: Handle empty arguments.
19118                 
19119         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19120         SimpleLookup): Auxiliary routines to help parse a qualifier
19121         identifier.  
19122
19123         Update qualifier_identifier rule.
19124
19125         * codegen.cs: Removed debugging messages.
19126
19127         * class.cs: Make this a global thing, this acts just as a "key" to
19128         objects that we might have around.
19129
19130         (Populate): Only initialize method_builders_to_methods once.
19131
19132         * expression.cs (PropertyExpr): Initialize type from the
19133         PropertyType. 
19134
19135         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19136         Resolve pattern.  Attempt to implicitly convert value to boolean.
19137         Emit code.
19138
19139         * expression.cs: Set the type for the int32/int32 argument case.
19140         (Binary::ResolveOperator): Set the return type to boolean for
19141         comparission operators
19142
19143         * typemanager.cs: Remove debugging print code.
19144
19145         (Invocation::Resolve): resolve type.
19146
19147         * class.cs: Allocate a MemberInfo of the correct size, as the code
19148         elsewhere depends on the test to reflect the correct contents.
19149
19150         (Method::) Keep track of parameters, due to System.Reflection holes
19151
19152         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19153         mapping here.
19154
19155         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19156         of the exact size and return that.
19157
19158         (Class::LookupMethodByBuilder): New function that maps
19159         MethodBuilders to its methods.  Required to locate the information
19160         on methods because System.Reflection bit us again.
19161
19162         * support.cs: New file, contains an interface ParameterData and
19163         two implementations: ReflectionParameters and InternalParameters
19164         used to access Parameter information.  We will need to grow this
19165         as required.
19166
19167         * expression.cs (Invocation::GetParameterData): implement a cache
19168         and a wrapper around the ParameterData creation for methods. 
19169         (Invocation::OverloadResolve): Use new code.
19170
19171 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19172
19173         * class.cs (TypeContainer::EmitField): Remove and move into 
19174         (Field::Define): here and modify accordingly.
19175         (Field.FieldBuilder): New member.
19176         (TypeContainer::Populate): Update accordingly.
19177         (TypeContainer::FindMembers): Implement.
19178
19179 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19180
19181         * statement.cs: (VariableInfo::VariableType): New field to be
19182         initialized with the full type once it is resolved. 
19183
19184 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * parameter.cs (GetParameterInfo): Use a type cache to compute
19187         things only once, and to reuse this information
19188
19189         * expression.cs (LocalVariableReference::Emit): Implement.
19190         (OpcodeCast::Emit): fix.
19191
19192         (ParameterReference::Resolve): Implement.
19193         (ParameterReference::Emit): Implement.
19194
19195         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19196         that are expressions need to stay as Expressions.
19197
19198         * typemanager.cs (CSharpName): Returns the C# name of a type if
19199         possible. 
19200
19201         * expression.cs (Expression::ConvertImplicit): New function that
19202         implements implicit type conversions.
19203
19204         (Expression::ImplicitReferenceConversion): Implements implicit
19205         reference conversions.
19206
19207         (EmptyCast): New type for transparent casts.
19208
19209         (OpcodeCast): New type for casts of types that are performed with
19210         a sequence of bytecodes.
19211
19212         (BoxedCast): New type used for casting value types into reference
19213         types.  Emits a box opcode.
19214
19215         (Binary::DoNumericPromotions): Implements numeric promotions of
19216         and computation of the Binary::Type.
19217
19218         (Binary::EmitBranchable): Optimization.
19219
19220         (Binary::Emit): Implement code emission for expressions.
19221
19222         * typemanager.cs (TypeManager): Added two new core types: sbyte
19223         and byte.
19224
19225 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19226
19227         * class.cs (TypeContainer::FindMembers): Method which does exactly
19228         what Type.FindMembers does, only we don't have to use reflection. No
19229         implementation yet.
19230
19231         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19232         typecontainer objects as we need to get at them.
19233         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19234
19235         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19236         typecontainer object.
19237
19238         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19239         of just a Report object.
19240
19241 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19242
19243         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19244         "remove_"
19245         (TypeContainer::Populate): Now define the delegates of the type too.
19246         (TypeContainer.Delegates): Property to access the list of delegates defined
19247         in the type.
19248
19249         * delegates.cs (Delegate::Define): Implement partially.
19250
19251         * modifiers.cs (TypeAttr): Handle more flags.
19252
19253 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19254
19255         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19256         and not <=
19257         (Operator::Define): Re-write logic to get types by using the LookupType method
19258         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19259         (Indexer::Define): Ditto.
19260         (Event::Define): Ditto.
19261         (Property::Define): Ditto.
19262
19263 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19264
19265         * class.cs (TypeContainer::Populate): Now define operators too. 
19266         (TypeContainer.Operators): New property to access the list of operators
19267         in a type.
19268         (Operator.OperatorMethodBuilder): New member to hold the method builder
19269         for the operator we are defining.
19270         (Operator::Define): Implement.
19271
19272 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19273
19274         * class.cs (Event::Define): Make the prefixes of the accessor methods
19275         addOn_ and removeOn_ 
19276
19277         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19278         of the location being passed in too. Ideally, this should go later since all
19279         error reporting should be done through the Report object.
19280
19281         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19282         (Populate): Iterate thru the indexers we have and define them too.
19283         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19284         for the get and set accessors.
19285         (Indexer::Define): Implement.
19286
19287 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19288
19289         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19290         my previous implementation, did not work.
19291
19292         * typemanager.cs: Add a couple of missing types (the longs).
19293
19294         * literal.cs: Use TypeManager.bool_type instead of getting it.
19295
19296         * expression.cs (EventExpr): New kind of expressions.
19297         (Expressio::ExprClassFromMemberInfo): finish
19298
19299 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19300
19301         * assign.cs: Emit stores to static fields differently.
19302
19303 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19304
19305         * Merge in changes and adjust code to tackle conflicts. Backed out my
19306         code in Assign::Resolve ;-) 
19307
19308 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19309
19310         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19311         instead Report.Error and also pass in the location.
19312         (CSharpParser::Lexer): New readonly property to return the reference
19313         to the Tokenizer object.
19314         (declare_local_variables): Use Report.Error with location instead of plain 
19315         old error.
19316         (CheckDef): Ditto.
19317
19318         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19319         (Operator.CheckBinaryOperator): Ditto.
19320
19321         * cs-parser.jay (operator_declarator): Update accordingly.
19322
19323         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19324         (CheckBinaryOperator): Same here.
19325
19326         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19327         on the name without any prefixes of namespace names etc. This is because we
19328         already might have something already fully qualified like 
19329         'System.Console.WriteLine'
19330
19331         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19332
19333 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19334
19335         * cs-tokenizer.cs (location): Return a string which also contains
19336         the file name.
19337
19338         * expression.cs (ElementAccess): New class for expressions of the
19339         type 'element access.'
19340         (BaseAccess): New class for expressions of the type 'base access.'
19341         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19342         respectively.
19343
19344         * cs-parser.jay (element_access): Implement action.
19345         (base_access): Implement actions.
19346         (checked_expression, unchecked_expression): Implement.
19347
19348         * cs-parser.jay (local_variable_type): Correct and implement.
19349         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19350
19351         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19352
19353         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19354         name and the specifiers.
19355
19356         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19357
19358         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19359         making them all public ;-)
19360
19361         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19362         class anyways.
19363
19364 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19367         PropertyExprs.
19368         (FieldExpr, PropertyExprs): New resolved expressions.
19369         (SimpleName::MemberStaticCheck): Perform static checks for access
19370         to non-static fields on static methods. Maybe this should be
19371         generalized for MemberAccesses. 
19372         (SimpleName::ResolveSimpleName): More work on simple name
19373         resolution. 
19374
19375         * cs-parser.jay (primary_expression/qualified_identifier): track
19376         the parameter index.
19377
19378         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19379         (EmitContext::EmitBoolExpression): Chain to expression generation
19380         instead of temporary hack.
19381         (::EmitStatementExpression): Put generic expression code generation.
19382
19383         * assign.cs (Assign::Emit): Implement variable assignments to
19384         local variables, parameters and fields.
19385
19386 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19387
19388         * statement.cs (Block::GetVariableInfo): New method, returns the
19389         VariableInfo for a variable name in a block.
19390         (Block::GetVariableType): Implement in terms of GetVariableInfo
19391
19392         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19393         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19394
19395 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19396
19397         * cs-parser.jay (operator_declaration): Continue on my quest : update
19398         to take attributes argument.
19399         (event_declaration): Ditto.
19400         (enum_declaration): Ditto.
19401         (indexer_declaration): Ditto.
19402
19403         * class.cs (Operator::Operator): Update constructor accordingly.
19404         (Event::Event): Ditto.
19405
19406         * delegate.cs (Delegate::Delegate): Same here.
19407
19408         * enum.cs (Enum::Enum): Same here.
19409
19410 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19411
19412         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19413
19414         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19415
19416         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19417         being passed around as an arraylist.
19418         (Attributes::AddAttribute): Method to add attribute sections.
19419
19420         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19421         (struct_declaration): Update accordingly.
19422         (constant_declaration): Update.
19423         (field_declaration): Update.
19424         (method_header): Update.
19425         (fixed_parameter): Update.
19426         (parameter_array): Ditto.
19427         (property_declaration): Ditto.
19428         (destructor_declaration): Ditto.
19429
19430         * class.cs (Struct::Struct): Update constructors accordingly.
19431         (Class::Class): Ditto.
19432         (Field::Field): Ditto.
19433         (Method::Method): Ditto.
19434         (Property::Property): Ditto.
19435         (TypeContainer::OptAttribute): update property's return type.
19436
19437         * interface.cs (Interface.opt_attributes): New member.
19438         (Interface::Interface): Update to take the extra Attributes argument.
19439
19440         * parameter.cs (Parameter::Parameter): Ditto.
19441
19442         * constant.cs (Constant::Constant): Ditto.
19443
19444         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19445         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19446         the attributes as a parameter.
19447         (InterfaceProperty): Update constructor call.
19448         (InterfaceEvent): Ditto.
19449         (InterfaceMethod): Ditto.
19450         (InterfaceIndexer): Ditto.
19451
19452         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19453         pass the attributes too.
19454         (interface_event_declaration): Ditto.
19455         (interface_property_declaration): Ditto.
19456         (interface_method_declaration): Ditto.
19457         (interface_declaration): Ditto.
19458
19459 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19460
19461         * class.cs (Method::Define): Track the "static Main" definition to
19462         create an entry point. 
19463
19464         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19465         EntryPoint if we find it. 
19466
19467         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19468         (EmitContext::ig): Make this variable public.
19469
19470         * driver.cs: Make the default output file be the first file name
19471         with the .exe extension.  
19472
19473         Detect empty compilations
19474
19475         Handle various kinds of output targets.  Handle --target and
19476         rename -t to --dumper.
19477
19478         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19479         methods inherited from Expression return now an Expression.  This
19480         will is used during the tree rewriting as we resolve them during
19481         semantic analysis.
19482
19483         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19484         the spec.  Missing entirely is the information about
19485         accessability of elements of it.
19486
19487         (Expression::ExprClassFromMemberInfo): New constructor for
19488         Expressions that creates a fully initialized Expression based on
19489         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19490         a Type.
19491
19492         (Invocation::Resolve): Begin implementing resolution of invocations.
19493
19494         * literal.cs (StringLiteral):  Implement Emit.
19495
19496 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19497
19498         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19499         member.
19500
19501 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19502
19503         * cs-parser.jay (attribute_arguments): Implement actions.
19504         (attribute): Fix bug in production. Implement action.
19505         (attribute_list): Implement.
19506         (attribute_target): Implement.
19507         (attribute_target_specifier, opt_target_specifier): Implement
19508         (CheckAttributeTarget): New method to check if the attribute target
19509         is valid.
19510         (attribute_section): Implement.
19511         (opt_attributes): Implement.
19512
19513         * attribute.cs : New file to handle attributes.
19514         (Attribute): Class to hold attribute info.
19515
19516         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19517         (attribute_section): Modify production to use 2 different rules to 
19518         achieve the same thing. 1 s/r conflict down !
19519         Clean out commented, useless, non-reducing dimension_separator rules.
19520
19521         * class.cs (TypeContainer.attributes): New member to hold list
19522         of attributes for a type.
19523         (Struct::Struct): Modify to take one more argument, the attribute list.
19524         (Class::Class): Ditto.
19525         (Field::Field): Ditto.
19526         (Method::Method): Ditto.
19527         (Property::Property): Ditto.
19528
19529         * cs-parser.jay (struct_declaration): Update constructor call to
19530         pass in the attributes too.
19531         (class_declaration): Ditto.
19532         (constant_declaration): Ditto.
19533         (field_declaration): Ditto.
19534         (method_header): Ditto.
19535         (fixed_parameter): Ditto.
19536         (parameter_array): Ditto.
19537         (property_declaration): Ditto.
19538
19539         * constant.cs (Constant::Constant): Update constructor similarly.
19540         Use System.Collections.
19541
19542         * parameter.cs (Parameter::Parameter): Update as above.
19543
19544 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19545
19546         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19547         (TypeContainer.delegates): New member to hold list of delegates.
19548
19549         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19550         this time as I seem to be on crack ;-)
19551
19552 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19555         tell whether an identifier represents a namespace.
19556
19557         * expression.cs (NamespaceExpr): A namespace expression, used only
19558         temporarly during expression resolution.
19559         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19560         utility functions to resolve names on expressions.
19561
19562 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19563
19564         * codegen.cs: Add hook for StatementExpressions. 
19565
19566         * class.cs: Fix inverted test for static flag in methods.
19567
19568 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19569
19570         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19571         to make it coincide with MS' number.
19572         (Operator::CheckBinaryOperator): Ditto.
19573
19574         * ../errors/errors.txt : Remove error numbers added earlier.
19575
19576         * ../errors/cs1019.cs : Test case for error # 1019
19577
19578         * ../errros/cs1020.cs : Test case for error # 1020
19579
19580         * cs-parser.jay : Clean out commented cruft.
19581         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19582         used anywhere - non-reducing rule.
19583         (namespace_declarations): Non-reducing rule - comment out.
19584
19585         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19586         with TypeContainer::AddEnum.
19587
19588         * delegate.cs : New file for delegate handling classes.
19589         (Delegate): Class for declaring delegates.
19590
19591         * makefile : Update.
19592
19593         * cs-parser.jay (delegate_declaration): Implement.
19594
19595 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19596
19597         * class.cs (Event::Define): Implement.
19598         (Event.EventBuilder): New member.
19599
19600         * class.cs (TypeContainer::Populate): Update to define all enums and events
19601         we have.
19602         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19603         readonly fields for all these cases ?
19604
19605 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19606
19607         * class.cs (Property): Revamp to use the convention of making fields readonly.
19608         Accordingly modify code elsewhere.
19609
19610         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19611         the Define method of the Property class.
19612
19613         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19614         trivial bug.
19615         (TypeContainer::Populate): Update to define all the properties we have. Also
19616         define all enumerations.
19617
19618         * enum.cs (Define): Implement.
19619
19620 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19621
19622         * cs-parser.jay (overloadable_operator): The semantic value is an
19623         enum of the Operator class.
19624         (operator_declarator): Implement actions.
19625         (operator_declaration): Implement.
19626
19627         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19628         validity of definitions.
19629         (Operator::CheckBinaryOperator): Static method to check for binary operators
19630         (TypeContainer::AddOperator): New method to add an operator to a type.
19631
19632         * cs-parser.jay (indexer_declaration): Added line to actually call the
19633         AddIndexer method so it gets added ;-)
19634
19635         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19636         already taken care of by the MS compiler ?  
19637
19638 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19639
19640         * class.cs (Operator): New class for operator declarations.
19641         (Operator::OpType): Enum for the various operators.
19642
19643 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19644
19645         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19646         ostensibly handle this in semantic analysis.
19647
19648         * cs-parser.jay (general_catch_clause): Comment out
19649         (specific_catch_clauses, specific_catch_clause): Ditto.
19650         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19651         (catch_args, opt_catch_args): New productions.
19652         (catch_clause): Rewrite to use the new productions above
19653         (catch_clauses): Modify accordingly.
19654         (opt_catch_clauses): New production to use in try_statement
19655         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19656         and re-write the code in the actions to extract the specific and
19657         general catch clauses by being a little smart ;-)
19658
19659         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19660         Hooray, try and catch statements parse fine !
19661
19662 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19663
19664         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19665         string from the hashtable of variables.
19666
19667         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19668         I end up making that mistake ;-)
19669         (catch_clauses): Fixed gross error which made Key and Value of the 
19670         DictionaryEntry the same : $1 !!
19671
19672 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19673
19674         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19675
19676         * cs-parser.jay (event_declaration): Correct to remove the semicolon
19677         when the add and remove accessors are specified. 
19678
19679 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19680
19681         * cs-parser.jay (IndexerDeclaration): New helper class to hold
19682         information about indexer_declarator.
19683         (indexer_declarator): Implement actions.
19684         (parsing_indexer): New local boolean used to keep track of whether
19685         we are parsing indexers or properties. This is necessary because 
19686         implicit_parameters come into picture even for the get accessor in the 
19687         case of an indexer.
19688         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19689
19690         * class.cs (Indexer): New class for indexer declarations.
19691         (TypeContainer::AddIndexer): New method to add an indexer to a type.
19692         (TypeContainer::indexers): New member to hold list of indexers for the
19693         type.
19694
19695 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19696
19697         * cs-parser.jay (add_accessor_declaration): Implement action.
19698         (remove_accessor_declaration): Implement action.
19699         (event_accessors_declaration): Implement
19700         (variable_declarators): swap statements for first rule - trivial.
19701
19702         * class.cs (Event): New class to hold information about event
19703         declarations.
19704         (TypeContainer::AddEvent): New method to add an event to a type
19705         (TypeContainer::events): New member to hold list of events.
19706
19707         * cs-parser.jay (event_declaration): Implement actions.
19708
19709 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
19710
19711         * cs-parser.jay (dim_separators): Implement. Make it a string
19712         concatenating all the commas together, just as they appear.
19713         (opt_dim_separators): Modify accordingly
19714         (rank_specifiers): Update accordingly. Basically do the same
19715         thing - instead, collect the brackets here.
19716         (opt_rank_sepcifiers): Modify accordingly.
19717         (array_type): Modify to actually return the complete type string
19718         instead of ignoring the rank_specifiers.
19719         (expression_list): Implement to collect the expressions
19720         (variable_initializer): Implement. We make it a list of expressions
19721         essentially so that we can handle the array_initializer case neatly too.
19722         (variable_initializer_list): Implement.
19723         (array_initializer): Make it a list of variable_initializers
19724         (opt_array_initializer): Modify accordingly.
19725
19726         * expression.cs (New::NType): Add enumeration to help us
19727         keep track of whether we have an object/delegate creation
19728         or an array creation.
19729         (New:NewType, New::Rank, New::Indices, New::Initializers): New
19730         members to hold data about array creation.
19731         (New:New): Modify to update NewType
19732         (New:New): New Overloaded contructor for the array creation
19733         case.
19734
19735         * cs-parser.jay (array_creation_expression): Implement to call
19736         the overloaded New constructor.
19737
19738 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
19739
19740         * class.cs (TypeContainer::Constructors): Return member
19741         constructors instead of returning null.
19742
19743 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
19744
19745         * typemanager.cs (InitCoreTypes): Initialize the various core
19746         types after we have populated the type manager with the user
19747         defined types (this distinction will be important later while
19748         compiling corlib.dll)
19749
19750         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19751         on Expression Classification.  Now all expressions have a method
19752         `Resolve' and a method `Emit'.
19753
19754         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19755         generation from working.     Also add some temporary debugging
19756         code. 
19757
19758 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
19759
19760         * codegen.cs: Lots of code generation pieces.  This is only the
19761         beginning, will continue tomorrow with more touches of polish.  We
19762         handle the fundamentals of if, while, do, for, return.  Others are
19763         trickier and I need to start working on invocations soon.
19764
19765         * gen-treedump.cs: Bug fix, use s.Increment here instead of
19766         s.InitStatement. 
19767
19768         * codegen.cs (EmitContext): New struct, used during code
19769         emission to keep a context.   Most of the code generation will be
19770         here. 
19771
19772         * cs-parser.jay: Add embedded blocks to the list of statements of
19773         this block.  So code generation proceeds in a top down fashion.
19774
19775 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
19776
19777         * statement.cs: Add support for multiple child blocks.
19778
19779 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
19780
19781         * codegen.cs (EmitCode): New function, will emit the code for a
19782         Block of code given a TypeContainer and its ILGenerator. 
19783
19784         * statement.cs (Block): Standard public readonly optimization.
19785         (Block::Block constructors): Link children. 
19786         (Block::Child): Child Linker.
19787         (Block::EmitVariables): Emits IL variable declarations.
19788
19789         * class.cs: Drop support for MethodGroups here, delay until
19790         Semantic Analysis.
19791         (Method::): Applied the same simplification that I did before, and
19792         move from Properties to public readonly fields.
19793         (Method::ParameterTypes): Returns the parameter types for the
19794         function, and implements a cache that will be useful later when I
19795         do error checking and the semantic analysis on the methods is
19796         performed.
19797         (Constructor::GetCallingConvention): Renamed from CallingConvetion
19798         and made a method, optional argument tells whether this is a class
19799         or a structure to apply the `has-this' bit.
19800         (Method::GetCallingConvention): Implement, returns the calling
19801         convention. 
19802         (Method::Define): Defines the type, a second pass is performed
19803         later to populate the methods.
19804
19805         (Constructor::ParameterTypes): implement a cache similar to the
19806         one on Method::ParameterTypes, useful later when we do semantic
19807         analysis. 
19808
19809         (TypeContainer::EmitMethod):  New method.  Emits methods.
19810
19811         * expression.cs: Removed MethodGroup class from here.
19812
19813         * parameter.cs (Parameters::GetCallingConvention): new method.
19814
19815 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
19816
19817         * class.cs (TypeContainer::Populate): Drop RootContext from the
19818         argument. 
19819
19820         (Constructor::CallingConvention): Returns the calling convention.
19821         (Constructor::ParameterTypes): Returns the constructor parameter
19822         types. 
19823
19824         (TypeContainer::AddConstructor): Keep track of default constructor
19825         and the default static constructor.
19826
19827         (Constructor::) Another class that starts using `public readonly'
19828         instead of properties. 
19829
19830         (Constructor::IsDefault): Whether this is a default constructor. 
19831
19832         (Field::) use readonly public fields instead of properties also.
19833
19834         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19835         track of static constructors;  If none is used, turn on
19836         BeforeFieldInit in the TypeAttributes. 
19837
19838         * cs-parser.jay (opt_argument_list): now the return can be null
19839         for the cases where there are no arguments. 
19840
19841         (constructor_declarator): If there is no implicit `base' or
19842         `this', then invoke the default parent constructor. 
19843
19844         * modifiers.cs (MethodAttr): New static function maps a set of
19845         modifiers flags into a MethodAttributes enum
19846         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
19847         MethodAttr, TypeAttr to represent the various mappings where the
19848         modifiers are used.
19849         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
19850
19851 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
19852
19853         * parameter.cs (GetParameterInfo): Fix bug where there would be no
19854         method arguments.
19855
19856         * interface.cs (PopulateIndexer): Implemented the code generator
19857         for interface indexers.
19858
19859 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
19860
19861         * interface.cs (InterfaceMemberBase): Now we track the new status
19862         here.  
19863
19864         (PopulateProperty): Implement property population.  Woohoo!  Got
19865         Methods and Properties going today. 
19866
19867         Removed all the properties for interfaces, and replaced them with
19868         `public readonly' fields. 
19869
19870 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
19871
19872         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19873         initialize their hashtables/arraylists only when they are needed
19874         instead of doing this always.
19875
19876         * parameter.cs: Handle refs and out parameters.
19877
19878         * cs-parser.jay: Use an ArrayList to construct the arguments
19879         instead of the ParameterCollection, and then cast that to a
19880         Parameter[] array.
19881
19882         * parameter.cs: Drop the use of ParameterCollection and use
19883         instead arrays of Parameters.
19884
19885         (GetParameterInfo): Use the Type, not the Name when resolving
19886         types. 
19887
19888 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
19889
19890         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19891         and instead use public readonly fields.
19892
19893         * class.cs: Put back walking code for type containers.
19894
19895 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
19896
19897         * class.cs (MakeConstant): Code to define constants.
19898
19899         * rootcontext.cs (LookupType): New function.  Used to locate types 
19900
19901
19902 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
19905         this System.Reflection code is.  Kudos to Microsoft
19906
19907         * typemanager.cs: Implement a type cache and avoid loading all
19908         types at boot time.  Wrap in LookupType the internals.  This made
19909         the compiler so much faster.  Wow.  I rule!
19910
19911         * driver.cs: Make sure we always load mscorlib first (for
19912         debugging purposes, nothing really important).
19913
19914         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
19915         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
19916
19917         * rootcontext.cs: Lookup types on their namespace;  Lookup types
19918         on namespaces that have been imported using the `using' keyword.
19919
19920         * class.cs (TypeContainer::TypeAttr): Virtualize.
19921         (Class::TypeAttr): Return attributes suitable for this bad boy.
19922         (Struct::TypeAttr): ditto.
19923         Handle nested classes.
19924         (TypeContainer::) Remove all the type visiting code, it is now
19925         replaced with the rootcontext.cs code
19926
19927         * rootcontext.cs (GetClassBases): Added support for structs. 
19928
19929 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
19930
19931         * interface.cs, statement.cs, class.cs, parameter.cs,
19932         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19933         Drop use of TypeRefs, and use strings instead.
19934
19935 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
19936
19937         * rootcontext.cs: 
19938
19939         * class.cs (Struct::Struct): set the SEALED flags after
19940         checking the modifiers.
19941         (TypeContainer::TypeAttr): new property, returns the
19942         TypeAttributes for a class.  
19943
19944         * cs-parser.jay (type_list): Oops, list production was creating a
19945         new list of base types.
19946
19947         * rootcontext.cs (StdLib): New property.
19948         (GetInterfaceTypeByName): returns an interface by type name, and
19949         encapsulates error handling here.
19950         (GetInterfaces): simplified.
19951         (ResolveTree): Encapsulated all the tree resolution here.
19952         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
19953         types. 
19954
19955         * driver.cs: Add support for --nostdlib, to avoid loading the
19956         default assemblies.
19957         (Main): Do not put tree resolution here. 
19958
19959         * rootcontext.cs: Beginning of the class resolution.
19960
19961 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
19962
19963         * rootcontext.cs: Provide better error reporting. 
19964
19965         * cs-parser.jay (interface_base): set our $$ to be interfaces.
19966
19967         * rootcontext.cs (CreateInterface): Handle the case where there
19968         are no parent interfaces.
19969
19970         (CloseTypes): Routine to flush types at the end.
19971         (CreateInterface): Track types.
19972         (GetInterfaces): Returns an array of Types from the list of
19973         defined interfaces.
19974
19975         * typemanager.c (AddUserType): Mechanism to track user types (puts
19976         the type on the global type hash, and allows us to close it at the
19977         end). 
19978
19979 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
19980
19981         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
19982         RecordInterface instead.
19983
19984         * cs-parser.jay: Updated to reflect changes above.
19985
19986         * decl.cs (Definition): Keep track of the TypeBuilder type that
19987         represents this type here.  Not sure we will use it in the long
19988         run, but wont hurt for now.
19989
19990         * driver.cs: Smaller changes to accomodate the new code.
19991
19992         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
19993         when done. 
19994
19995         * rootcontext.cs (CreateInterface):  New method, used to create
19996         the System.TypeBuilder type for interfaces.
19997         (ResolveInterfaces): new entry point to resolve the interface
19998         hierarchy. 
19999         (CodeGen): Property, used to keep track of the code generator.
20000
20001 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20002
20003         * cs-parser.jay: Add a second production for delegate_declaration
20004         with `VOID'.
20005
20006         (enum_body): Put an opt_comma here instead of putting it on
20007         enum_body or enum_member_declarations so we can handle trailing
20008         commas on enumeration members.  Gets rid of a shift/reduce.
20009
20010         (type_list): Need a COMMA in the middle.
20011
20012         (indexer_declaration): Tell tokenizer to recognize get/set
20013
20014         * Remove old targets.
20015
20016         * Re-add the parser target.
20017
20018 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20019
20020         * cs-parser.jay: Add precendence rules for a number of operators
20021         ot reduce the number of shift/reduce conflicts in the grammar.
20022
20023 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20024
20025         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20026         and put it here.
20027
20028         Get rid of old crufty code.
20029
20030         * rootcontext.cs: Use this to keep track of the parsed
20031         representation and the defined types available to the program. 
20032
20033         * gen-treedump.cs: adjust for new convention.
20034
20035         * type.cs: Split out the type manager, and the assembly builder
20036         from here. 
20037
20038         * typemanager.cs: the type manager will live here now.
20039
20040         * cil-codegen.cs: And the code generator here. 
20041
20042 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20043
20044         * makefile: Fixed up for easy making.
20045
20046 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20047
20048         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20049         the 
20050
20051         (unary_expression): Expand pre_increment_expression and
20052         post_decrement_expression to reduce a shift/reduce.
20053
20054 2001-07-11  Simon Cozens
20055
20056         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20057
20058         Improve allow_keyword_as_indent name.
20059
20060 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20061
20062         * Adjustments for Beta2. 
20063
20064 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20065
20066         * decl.cs: Added `Define' abstract method.
20067         (InTransit): new property, used to catch recursive definitions. 
20068
20069         * interface.cs: Implement `Define'. 
20070
20071         * modifiers.cs: Map Modifiers.constants to
20072         System.Reflection.TypeAttribute flags.
20073
20074         * class.cs: Keep track of types and user-defined types.
20075         (BuilderInit): New method for creating an assembly
20076         (ResolveType): New function to launch the resolution process, only
20077         used by interfaces for now.
20078
20079         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20080         that are inserted into the name space. 
20081
20082 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20083
20084         * ARGH.  I have screwed up my tree so many times due to the use of
20085         rsync rather than using CVS.  Going to fix this at once. 
20086
20087         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20088         load types.
20089
20090 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20091
20092         * Experiment successful: Use System.Type rather that our own
20093         version of Type.  
20094
20095 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20096
20097         * cs-parser.jay: Removed nsAliases from here.
20098
20099         Use new namespaces, handle `using XXX;' 
20100
20101         * namespace.cs: Reimplemented namespace handling, use a recursive
20102         definition of the class.  Now we can keep track of using clauses
20103         and catch invalid using clauses.
20104
20105 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20106
20107         * gen-treedump.cs: Adapted for all the renaming.
20108
20109         * expression.cs (Expression): this class now has a Type property
20110         which returns an expression Type.
20111
20112         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20113         `Type', as this has a different meaning now in the base
20114
20115 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20116
20117         * interface.cs, class.cs: Removed from all the sources the
20118         references to signature computation, as we can not do method
20119         signature computation during the parsing time, as we are not
20120         trying to solve at that point distinguishing:
20121
20122         class X {
20123                 void a (Blah x) {}
20124                 void a (NS.Blah x) {}
20125         }
20126
20127         Which depending on the context might be valid or not, as we do not
20128         know if Blah is the same thing as NS.Blah at that point.
20129
20130         * Redid everything so the code uses TypeRefs now instead of
20131         Types.  TypeRefs are just temporary type placeholders, that need
20132         to be resolved.  They initially have a pointer to a string and the
20133         current scope in which they are used.  This is used later by the
20134         compiler to resolve the reference to an actual Type. 
20135
20136         * DeclSpace is no longer a CIR.Type, and neither are
20137         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20138         are all DeclSpaces, but no Types. 
20139
20140         * type.cs (TypeRefManager): This implements the TypeRef manager,
20141         which keeps track of all the types that need to be resolved after
20142         the parsing has finished. 
20143
20144 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * ARGH.  We are going to have to store `foreach' as a class rather
20147         than resolving it, as we need to verify error 1579 after name
20148         resolution.   *OR* we could keep a flag that says `This request to
20149         IEnumerator comes from a foreach statement' which we can then use
20150         to generate the error.
20151
20152 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20153
20154         * class.cs (TypeContainer.AddMethod): we now add methods to the
20155         MethodGroup instead of the method hashtable.  
20156
20157         * expression.cs: Add MethodGroup abstraction, which gets us one
20158         step closer to the specification in the way we handle method
20159         declarations.  
20160
20161         * cs-parser.jay (primary_expression): qualified_identifier now
20162         tried to match up an identifier to a local variable reference or
20163         to a parameter reference.
20164
20165         current_local_parameters is now a parser global variable that
20166         points to the current parameters for the block, used during name
20167         lookup.
20168
20169         (property_declaration): Now creates an implicit `value' argument to
20170         the set accessor.
20171
20172 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20173
20174         * parameter.cs: Do not use `param' arguments as part of the
20175         signature, per the spec.
20176
20177 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20178
20179         * decl.cs: Base class for classes, structs and interfaces.  This
20180         is the "Declaration Space" 
20181
20182         * cs-parser.jay: Use CheckDef for checking declaration errors
20183         instead of having one on each function.
20184
20185         * class.cs: Factor out some code for handling error handling in
20186         accordance to the "Declarations" section in the "Basic Concepts"
20187         chapter in the ECMA C# spec.
20188
20189         * interface.cs: Make all interface member classes derive from
20190         InterfaceMemberBase.
20191
20192 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20193
20194         * Many things: all interfaces are parsed and generated in
20195         gen-treedump.  Support for member variables, constructors,
20196         destructors, properties, constants is there.
20197
20198         Beginning of the IL backend, but very little done, just there for
20199         testing purposes. 
20200
20201 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20202
20203         * cs-parser.jay: Fix labeled statement.
20204
20205         * cs-tokenizer.cs (escape): Escape " and ' always.
20206         ref_line, ref_name: keep track of the line/filename as instructed
20207         by #line by the compiler.
20208         Parse #line.
20209
20210 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20211
20212         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20213         to match the values in System.CodeDOM.
20214
20215         Divid renamed to Divide.
20216
20217         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20218         statements. 
20219         (Statements.set): remove.
20220
20221         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20222         statements. 
20223
20224         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20225         falseStatements always have valid values. 
20226
20227         * cs-parser.jay: Use System.CodeDOM now.
20228