2005-05-09 Marek Safar <marek.safar@seznam.cz>
[mono.git] / mcs / gmcs / ChangeLog
1 2005-05-06  Martin Baulig  <martin@ximian.com>
2
3         * attribute.cs
4         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
5         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
6
7 2005-05-04  Martin Baulig  <martin@ximian.com>
8
9         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
10
11 2005-05-04  Martin Baulig  <martin@ximian.com>
12
13         Fix #74655.
14
15         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
16         section at the end; make things work if `default' is not the last
17         section.        
18
19 2005-05-04  Martin Baulig  <martin@ximian.com>
20
21         Fix #70400.
22
23         * statement.cs (Switch): Replaced the `got_default' field with a
24         `default_section' one.
25         (Switch.CheckSwitch): Set `default_section' here.
26         (Switch.Resolve): If we're a constant switch and the constant is
27         not found, use the default section.
28
29 2005-05-03  Martin Baulig  <martin@ximian.com>
30
31         * expression.cs (ArrayAccess.EmitGetLength): New public method.
32
33         * statement.cs (Foreach.ArrayForeach): New nested class.
34         (Foreach.TemporaryVariable): New nested class.
35         (Foreach.EmitArrayForeach): Removed; this is now in the new
36         ArrayForeach class.
37
38 2005-05-02  Martin Baulig  <martin@ximian.com>
39
40         Fix #70182.
41
42         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
43         Also `And' the locals if the old vector is null.
44         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
45         null; in this case we basically reset all the variables.        
46
47 2005-05-02  Martin Baulig  <martin@ximian.com>
48
49         Fix #74529.
50
51         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
52         Added `FlowBranching branching' argument; always `and' the
53         variables instead of `or'ing them unless we're an infinite loop.
54
55         * statement.cs (While.Resolve): Create a new sibling unless we're
56         infinite.       
57
58 2005-05-02  Martin Baulig  <martin@ximian.com>
59
60         Fix #70140.
61
62         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
63         arguments; use it instead of creating a new TopLevelBlock.
64         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
65         our ConstructorInitializer.
66
67         * statement.cs
68         (TopLevelBlock.TopLevelBranching): New public property.
69         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
70         and create our `TopLevelBranching'.
71
72         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
73         anonymous method host, use `block.TopLevelBranching' rather than
74         creating a new branching.
75
76 2005-04-20  Miguel de Icaza  <miguel@novell.com>
77
78         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
79         a ScopeInfo, if any of the current children is a child of the new
80         entry, move those children there.
81
82 2005-04-30  Martin Baulig  <martin@ximian.com>
83
84         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
85         at the beginning of a SwitchSection.  Fix #73335.
86
87 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
88
89         Fix #74378
90         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
91         
92         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
93         (FieldExpr.DoResolve): Obsolete members are ignored for field
94         initializers.
95         
96 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
97
98         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
99         of arrays detection.
100
101         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
102         verification.
103         (Field.VerifyClsCompliance): Volatile fields are not compliant.
104
105         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
106         arrays report.
107
108 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
109
110         * cs-parser.jay: Use the prefered version of -unsafe in error
111         message.
112
113 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
114
115         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
116         circumstances.
117
118 2005-04-20  John Luke  <john.luke@gmail.com>
119
120         * driver.cs: fix typo in error message, --outout to --output
121
122 2005-04-30  Martin Baulig  <martin@ximian.com>
123
124         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
125         handle the .NET 2.x security attributes.
126
127 2005-04-30  Martin Baulig  <martin@ximian.com>
128
129         * typemanager.cs
130         (TypeManager.ExpandInterfaces): Don't add things twice.
131
132         * class.cs
133         (TypeContainer.VerifyClsCompliance): Allow generic instances.
134
135 2005-04-29  Martin Baulig  <martin@ximian.com>
136
137         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
138
139         * anonymous.cs: Added support for anonymous generic methods.
140
141 2005-04-29  Martin Baulig  <martin@ximian.com>
142
143         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
144         generic instances.
145
146 2005-04-29  Martin Baulig  <martin@ximian.com>
147
148         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
149
150         * expression.cs (New.DoResolve): Fix the CS0304 check.
151
152 2005-04-29  Martin Baulig  <martin@ximian.com>
153
154         * typemanager.cs (TypeManager.GetFullName): Updated to the new
155         naming schema.
156
157         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
158         explicit interface implementation, compare the interface types.
159         (MethodData.Define): Use the new naming scheme from the latest
160         .NET 2.x beta2.
161         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
162
163         * decl.cs (MemberName.GetMemberName): Removed.
164         (MemberName.MethodName, FullName): New properties.
165
166 2005-04-25  Raja R Harinath  <rharinath@novell.com>
167
168         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
169
170 2005-04-22  Martin Baulig  <martin@ximian.com>
171
172         * generic.cs (GenericMethod): Create the EmitContext in the
173         `Define()'; in `Define(MethodBuilder)', create the type parameters
174         before calling `Define()'.  Fixes #73933.
175
176 2005-04-22  Martin Baulig  <martin@ximian.com>
177
178         * generic.cs
179         (Constraints.Resolve): Make things work wrt. the new type lookup system.
180         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
181
182         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
183         ConstructedType, check its constraints.
184
185 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
186
187         * codegen.cs (InRefOutArgumentResolving): New field.
188         
189         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
190         fields outside contructor.
191         
192         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
193         
194 2005-04-19  Miguel de Icaza  <miguel@novell.com>
195
196         * anonymous.cs (CaptureContext.EmitParameterInstance): The
197         parameter code was not completed ever, so it was not as up-to-date
198         as local variables.  Must finish it.
199
200         The bug fix was to compare the Toplevel of the block, not the
201         current block.  Thanks for Ben for pointing this out. 
202
203 2005-04-19  Raja R Harinath  <rharinath@novell.com>
204
205         * decl.cs (AddMethods): Use the declaring type of the problem
206         method to determine if we want to squash a warning.
207
208 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
209
210         * attribute.cs: Removed debug output.
211
212         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
213         
214         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
215         Report.Stderr.
216         
217 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
218
219         Fix# 74565
220         * class.cs (TypeContainer.CircularDepException) New nested
221         exception class.
222         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
223         (TypeContainer.DefineType): Removed error, reset InTransit before
224         exit.
225         (Class.DefineType): Throw exception when is in Transit.
226         Catch exception and report error.
227         (Struct.DefineType): Throw exception when is in Transit.
228         Catch exception and report error.
229         (Interface.DefineType): Throw exception when is in Transit.
230         Catch exception and report error.
231
232         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
233         handle nested exception handlers.
234
235         * flowanalysis.cs (InTryWithCatch): New method, search for try with
236         a catch.
237
238         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
239         InFinally and InCatch storage.
240
241         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
242         (Catch.Resolve): Set and Restore ec.InCatch.
243         (Try.Resolve): Set and Restore ec.InFinally.
244         (Try.HasCatch): True when try has catch.
245
246 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
247
248         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
249           for the same event member, so exclude such cases from warning 419.
250           Fixed bug #74633.
251
252 2005-04-16  Miguel de Icaza  <miguel@novell.com>
253
254         * expression.cs (Binary.ResolveOperator): Apply patch from John
255         Luke to fix bug 59864: operators &, | and ^ on enumerations
256         require that the same enum type on both sides.
257
258         * driver.cs: Add warnings to old flag usage, this is to assist
259         people who produce Makefiles and hope that the Makefiles will be
260         used on Windows.
261
262         * class.cs (TypeContainer.EmitType): Moved the definition of the
263         special $PRIVATE$ field from the resolve phase to the Emit phase.
264         During resolve we do not know if we are a struct with
265         HasExplicitLayout, we know this only after the attributes for the
266         type are emitted.
267
268         Set the FieldOffset to zero on the dummy field that we create for
269         the class.   Fixes 74590.
270
271 2005-04-16  Raja R Harinath  <rharinath@novell.com>
272
273         Fix #73834.
274         * ecore.cs (PropertyExpr.resolved): New.
275         (DoResolve): Use it to handle a case of double resolution here.
276         Handle a case of identical-name-and-type-name.
277         * expression.cs (ArrayCreation.CheckIndices): Avoid double
278         resolution by storing the results of expression resolution back
279         into the "probes" array.
280
281 2005-04-15  Raja R Harinath  <rharinath@novell.com>
282
283         Fix cs0208-7.cs and cs0208-8.cs.
284         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
285         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
286         error reporting to point out the reason a struct is not unmanaged.
287
288 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
289
290         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
291           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
292
293 2005-04-13  Raja R Harinath  <rharinath@novell.com>
294
295         Fix #74528.
296         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
297         IdenticalNameAndTypeName here.
298         (EventExpr.InstanceResolve): Likewise.
299
300 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
301
302         C# 2.0 DefaultCharSetAttribute implementation
303         
304         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
305         which allows us to set GlobalNamespace for every resolve.
306         (Attribute.ResolveArguments): Cut from Resolve.
307         (Attribute.GetCharSetValue): Returns CharSet named argument.
308         (Attribute.DefinePInvokeMethod): Gets default charset from
309         module settings.
310         (GlobalAttribute.ResolveAsTypeStep): Override.
311         (GlobalAttribute.ResolveArguments): Override.
312         
313         * class.cs (TypeAttr): Is protected.
314         
315         * codegen.cs (ModuleClass.DefaultCharSet): New member.
316         (ModuleClass.DefaultCharSetType): New memeber.
317         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
318         
319         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
320         charset from module.
321         
322         * delegate.cs (TypeAttr): Override.
323         (Delegate.DefineType): Use this TypeAttr.
324         
325         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
326         at very early stage (before types are defined) to resolve model
327         module attributes. It will probably not work with corlib but it
328         should be ok.
329         
330         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
331         charset from module.
332         
333         * typemanager.cs (default_charset_type): New type.
334
335 2005-04-13  Raja R Harinath  <rharinath@novell.com>
336
337         * decl.cs (MemberCache.AddMethods): Don't warn if
338         System.Object.Finalize has buggy MethodAttributes.
339
340         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
341         removed below.
342
343 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
344
345         * doc.cs : detect ambiguous reference to overloaded members.
346           Fixed bug #71603. MS 1.1 csc does not detect it.
347
348 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
349
350         * doc.cs : delegates must not be referenced with parameters.
351           Fixed bug #71605.
352
353 2005-04-12  Miguel de Icaza  <miguel@novell.com>
354
355         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
356
357 2005-04-10  Miguel de Icaza  <miguel@novell.com>
358
359         * driver.cs (MainDriver): Stop processing if the CLS stage found
360         errors. 
361
362         (CompilerCallableEntryPoint.InvokeCompiler): Always
363         reset after execution;   Take a TextWriter argument for the
364         output.
365
366         * report.cs: Use the error stream instead of hardcoding stderr. 
367
368 2005-04-09  Miguel de Icaza  <miguel@novell.com>
369
370         * class.cs: Reduce code paths to test, too small of an
371         optimization to make it worth the extra testing.  Always perform
372         it. 
373
374 2005-04-08  Raja R Harinath  <rharinath@novell.com>
375
376         Fix #74510.
377         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
378         operators that had errors reported on them.
379
380 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
381
382         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
383         argument types.
384         (Attribute.Resolve): Add named argument type checking.
385         
386         * class.cs (FixedField.Define): Use IsPrimitiveType
387         
388         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
389         
390         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
391         unsafe parameter types.
392         
393         * statement.cs (Using.ResolveExpression): Add better error description.
394         
395         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
396         
397 2005-04-08  Raja R Harinath  <rharinath@novell.com>
398
399         Fix #74484.
400         * attribute.cs (Attribute.GetAttributeUsage): Resolve
401         AttributeUsageAttribute in the emitcontext of the attribute class,
402         not in the emitcontext of the attributable entity it was attached to.
403         * cs-parser.jay: Use 'current_class', not 'current_container',
404         when creating a GlobalAttribute.
405
406 2005-04-08  Alp Toker  <alp@atoker.com>
407
408         * pending.cs: The fix to #58413 failed to compile methods implementing
409         interfaces with/without params modifiers and vice versa, even though
410         params modifiers aren't part of the signature. Make the modifier check
411         less strict as in csc.
412
413 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
414             Anoob V E  <projectmonokochi@rediffmail.com>
415             Harilal P R  <projectmonokochi@rediffmail.com>
416
417         Fix #58413.
418         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
419         modifiers of pending methods.
420         (PendingImplementation.PendingImplementation): Initialize it.
421         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
422         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
423         with ParameterData.  Add check for modifiers.
424         * class.cs (MethodData.Define): Update to changes.
425
426 2005-04-07  Raja R Harinath  <rharinath@novell.com>
427
428         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
429
430 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
431
432         * class.cs (PropertyMethod.Define): Check private accessor in abstract
433         property.
434         
435         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
436         
437         * rootcontext.cs,
438         * typemanager.cs: Registered RequiredAttributeAttribute.
439         
440 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
441
442         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
443         Warning CS0169 is back at level 3.
444         (IMethodData.SetMemberIsUsed): New method.
445         
446         * decl.cs (IsUsed): New value; moved from FieldBase.Status
447         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
448         
449         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
450
451         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
452         contants.
453         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
454         is used.
455         
456         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
457         is used.
458         
459         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
460         to avoid the problems with nested types.
461
462 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
463             Anoob V.E  <projectmonokochi@rediffmail.com>
464             Harilal P.R  <projectmonokochi@rediffmail.com>
465             Raja R Harinath  <rharinath@novell.com>
466
467         Fix #73820.
468         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
469         attribute.
470         * typemanager (GetConstructor): Make public.
471
472 2005-04-05  John Luke  <john.luke@gmail.com>
473             Raja R Harinath  <rharinath@novell.com>
474
475         Fix #62232.
476         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
477         struct too.  Return false quicker in a few cases.
478         (VerifyUnManaged): Use it.
479
480 2005-04-05  Raja R Harinath  <rharinath@novell.com>
481
482         Fix #74041.
483         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
484         not 'unreachable_seen'.
485
486 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
487
488         * attribute.cs (Attribute.GetValue): Removed unused.
489         
490         * codegen.cs (CodeGen.TrimExt): Removed unused.
491         
492         * cs-parser.jay (output): Removed unused.
493         
494         * cs-tokenizer.cs (hex_digits): Removed unused.
495         
496         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
497         
498         * expression.cs (Indirection.LoadExprValue): Removed unused.
499         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
500         
501         * iterators.cs (Iterator.param_types): Removed unused.
502         
503         * statement.cs (Goto.block): Removed unused.
504         (ToplevelBlock.did): Removed unused.
505         (Switch.ResolveConstantSwitch): Removed unused.
506
507 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
508
509         * rootcontext.cs: Allow mcs to bootstrap with the compilation
510         resetting thingy.
511
512 2005-04-19  Martin Baulig  <martin@ximian.com>
513
514         Merged r42462 from MCS and made it work for GMCS.
515
516         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
517
518         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
519
520 2005-04-01  Raja R Harinath  <rharinath@novell.com>
521
522         Fix #74232 and cs0208-3.cs.
523         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
524         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
525         unmanaged type.  Don't use FieldBuilders when 't' is a
526         TypeBuilder.  Use ModFlags and MemberType fields.
527         * class.cs (MemberBase.member_type): Rename from MemberType.
528         (MemberBase.MemberType): New property.  Determines member_type on
529         demand.
530         (MemberBase.DoDefine): Don't initialize MemberType here.
531         (FieldMember.Define): Likewise.
532
533 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
534
535         Fix #74241
536         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
537         Attributes are emitted there.
538         
539 2005-04-01  Raja R Harinath  <rharinath@novell.com>
540
541         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
542         keyword in 'partial enum' too.
543         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
544         is not allowed).
545         Report from Kamil Skalski <nazgul@omega.pl>.
546
547         Fix #74309.
548         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
549         have partial containers too.
550
551         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
552         in block' checks to Block.CheckInvariantMeaningInBlock.
553         * statement.cs (Block.GetKnownVariableInfo): Make private.
554         (Block.IsVariableUsedInChildBlock): Remove.
555         (Block.IsVariableUsedInBlock): Likewise.
556         (Block.CheckInvariantMeaningInBlock): New.  Show location of
557         conflicting declaration.
558         (Block.AddVariable): Make error messages less long-winded and more
559         specific.  Show location of conflicting declaration.
560         * parameter.cs (Parameters.Location): New readonly property.
561
562 2005-03-31  Raja R Harinath  <rharinath@novell.com>
563
564         Clean up semantics of invoking ResolveMemberAccess.
565         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
566         can have an instance, ensure that we pass in a non-TypeExpression
567         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
568         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
569         argument.  Update to changes and simplify.
570         (FieldExpr.Emitinstance): Remove CS0120 check.
571         (PropertyExpr.EmitInstance): Likewise.
572         * expression.cs (Argument.Resolve): Likewise.
573         (Invocation.DoResolve): Update to changes in semantics of
574         InstanceExpression.
575
576 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
577
578         Fix #74241
579         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
580         customization.
581         
582         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
583
584 2005-03-31  Raja R Harinath  <rharinath@novell.com>
585
586         Fix difference in behaviour with commandline invocation.
587         * driver.cs (Driver.Reset): New.
588         (CompilerCallableEntryPoint): Call it.
589
590         * statement.cs (If.Resolve): Avoid spurious "uninitialized
591         variable" warnings if the boolean expression failed to resolve.
592
593 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
594
595         * attribute.cs: Fix the union of several permissions when some of them
596         are unrestricted (so the result isn't an unrestricted permission set).
597         Fix #74036.
598
599 2005-03-30  Raja R Harinath  <rharinath@novell.com>
600
601         * ecore.cs (MemberExpr): New class.  Convert from interface
602         IMemberExpr.
603         (MemberExpr.ResolveMemberAccess): Refactor and move here from
604         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
605         error checks.
606         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
607         (MethodGroupExpr.IsExplicitImpl): Remove.
608         (Expression.GetFieldFromEvent): Remove.
609         (SimpleName.MemberStaticCheck): Remove.
610         (SimpleName.DoSimpleNameResolve): Update to changes.
611         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
612         (MemberAccess.IdenticalNameAndTypeName): Remove.
613         (MemberAccess.error176): Move to MemberExpr.
614         (MemberAccess.DoResolve): Update to changes.
615         (BaseAccess.DoResolve): Likewise.
616
617 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
618
619         C# 2.0 Conditional attribute class implementation
620         
621         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
622         Analyzes class whether it has attribute which has ConditionalAttribute
623         and its condition is not defined.
624         
625         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
626         (Class.IsExcluded): New method. Search for at least one defined
627         condition in ConditionalAttribute of attribute class.
628
629 2005-03-30  Raja R Harinath  <rharinath@novell.com>
630
631         * ecore.cs (PropertyExpr): Derive from Expression, not
632         ExpressionStatement.
633         (PropertyExpr.EmitStatement): Remove.
634
635 2005-03-29  Raja R Harinath  <rharinath@novell.com>
636
637         Fix #74060.
638         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
639         internal field "value__" of an enum be private.  The examples for
640         "value__" that I found on MSDN all used FieldAttributes.Private.
641
642         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
643         Don't mention IL method attribute names.
644
645         Fix #47991.  Remove a TODO.
646         * statement.cs (Block.Toplevel): Make into a field.
647         (Block.Parameters): Move into ToplevelBlock.
648         (Block.known_variables): Rename from child_variable_names.
649         (Block.Block): Remove variants that take Parameters.  Initialize
650         'Toplevel' with the immediately surrounding toplevel block.
651         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
652         LocalInfo parameter.
653         (Block.GetKnownVariableInfo): New.
654         (Block.IsVariableNameUsedInChildBlock): Update.
655         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
656         the block, even though it may not be in scope.
657         (Block.AddVariable): Remove Parameters parameter.  Use
658         Toplevel.Parameters instead.
659         (Block.AddConstant): Remove Parameters parameter.
660         (Block.GetParameterReference): Update to use Toplevel.Parameters.
661         (Block.IsParamaterReference): Likewise.
662         (Block.IsLocalParameter): Likewise.  Simplify a lot.
663         (ToplevelBlock.Parameters): New.  Moved from Block.
664         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
665         initialize Parameters to a non-null value.
666         * cs-parser.jay: Update to changes.
667         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
668         simple names that mean different things in the same block.  Use
669         Block.IsVariableNameUsedInBlock.
670
671 2005-03-28  Raja R Harinath  <rharinath@novell.com>
672
673         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
674
675 2005-03-26  Raja R Harinath  <harinath@acm.org>
676
677         Fix #73038.
678         * assign.cs (Assign.DoResolve): When the RHS of an assignment
679         fails to resolve, ensure that the LHS is still resolved as an
680         lvalue.
681
682 2005-03-25  Raja R Harinath  <harinath@acm.org>
683
684         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
685         ec.ContainerType.
686         (Enum.current_ec): Remove.
687         (Enum.LookupEnumValue): Remove EmitContext argument.
688         Just uses the one created during DefineType.
689         (Enum.FindMembers): Update.
690         * expression.cs (MemberAccess.DoResolve): Update.
691
692 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
693
694         * assign.cs (Assign.DoResolve): Check for CS1717 when
695         source and target are same (uses Equals).
696
697         * expression.cs (LocalVariableReference, ParameterReference,
698         This): Implemented Equals, GetHashCode.
699
700         * statement.cs (Block.GetParameterReference): Removed useless
701         local variable.
702
703 2005-03-22  Raja R Harinath  <rharinath@novell.com>
704
705         Fix cs0128.cs
706         * statement.cs (Block.AddVariable): Ensure that we skip implicit
707         blocks before deciding whether the error is cs0136 or cs0128.
708
709         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
710         (using_alias_directive, using_namespace_directive): Pass
711         MemberName, not an expression to Namespace.UsingAlias and
712         Namespace.Using.
713         (MakeName): Use the MemberName of the namespace.
714         * namespace.cs (Namespace.MemberName): New.
715         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
716         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
717         Likewise.
718         * decl.cs (MemberName.Name): Make readonly.
719         (MemberName.FromDotted): New "constructor".
720         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
721         (MemberCore.Name): Compute from MemberName on demand.
722         (MemberCore.SetMemberName): Provide a way to change the
723         MemberName.
724         (MemberCore.AddToContainer): Don't take a fullname parameter.
725         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
726         fully qualified name of the container to the member name.
727         (TypeContainer.AddToTypeContainer): Use a fully qualified name
728         only if the type is a member of the root container.
729         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
730         MemberName.Left rather than searching for an embedded ".".
731         (PartialContainer.CreatePart): Update to changes in RootContext.
732         (MemberBase.ShortName): Turn into a property.  Use
733         MemberCore.SetMemberName.
734         (MemberBase.ExplicitInterfaceName): Remove.
735         (MemberBase.UpdateMemberName): Remove.
736         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
737         (PropertyBase.SetMemberName): New override.
738         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
739         (Tree.GetDecl): New.
740         (Tree.AllDecls): Rename from Decls.
741         * attribute.cs, enum.cs, report.cs: Update to changes.
742         * driver.cs (MainDriver): Use MemberName.FromDotted on
743         RootContext.MainClass.
744
745 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
746
747         * class.cs (FixedField.Define): Check for CS1664 and more sanity
748         checks.
749
750         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
751
752 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
753
754         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
755         property accessor modifiers.
756
757         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
758         fixed buffer attribute (CS1716).
759         (PropertyMethod.HasCustomAccessModifier): When property accessor
760         has custom modifier.
761
762         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
763         modifiers.
764         (PropertyExpr.DoResolveLValue): Add CS0272.
765
766 2005-03-17  Miguel de Icaza  <miguel@novell.com>
767
768         * convert.cs: When converting to a pointer, use the proper Conv.U
769         or Conv.I depending on the source data type.
770
771         * cs-tokenizer.cs: Make the size for large decimal constants,
772         fixes #72957.
773
774 2005-03-17  Martin Baulig  <martin@ximian.com>
775
776         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
777         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
778
779 2005-03-17  Martin Baulig  <martin@ximian.com>
780
781         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
782         to bool so we can return an error condition.
783         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
784         returned an error.
785
786 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
787
788         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
789         attributes.
790
791 2005-03-16  Raja R Harinath  <rharinath@novell.com>
792
793         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
794         Refactor to avoid traversing the list of assemblies, and to avoid
795         string concatenation.
796         * typemanager.cs (guid_attr_type): Remove.
797         (negative_hits, pointers, references): Remove hashes.
798         (type_hash): New.
799         (GetConstructedType): New.  Uses type_hash to handle constructed
800         types (arrays, references, pointers).
801         (GetReferenceType, GetPointerType): Use it.
802         (GetNestedType): New.  Uses type_hash to handle nested types of
803         reflected types.
804         (LookupType, LookupTypeDirect): Remove.
805         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
806         'types' hash and LookupTypeReflection directly.
807         (params_string, params_object): Use GetConstructedType.
808         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
809         top-level types.
810         (Namespace.Lookup): Use cached_types.
811         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
812         provided by old TypeManager.LookupType.
813         * rootcontext.cs (MakeFQN): Remove.
814         * decl.cs (DeclSpace.MakeFQN): Likewise.
815         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
816         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
817         TypeManager.GetConstructedType.
818         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
819
820 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
821
822         * cs-parser.jay: Fix build.
823
824 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
825
826         * class.cs (TypeContainer.CircularDepException) New nested
827         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
828
829         * cs-parser.jay: Reports CS1527 for any namespace element.
830
831         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
832         Added CS0407.
833
834         * expression.cs (ParameterReference.IsAssigned): Changed error to
835         CS0269.
836         (Error_WrongNumArguments): Moved CS0245 detection here.
837
838         * statement.cs (Return.Resolve): Add CS1622 report.
839
840 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
841
842         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
843
844 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
845
846         * attribute.cs expression.cs: Get rid of some allocations.
847
848 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
849
850         * doc.cs : just eliminate the latest change.
851
852 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
853
854         * doc.cs : commented out the latest change. It breaks xml-030.cs
855
856 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
857
858         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
859           fail. So invoke CreateType() in FindDocumentedType().
860
861 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
862
863         * cs-tokenizer.cs : added IsKeyword().
864         * doc.cs : Detect keyword incorrectly used as identifier.
865           Allow identifiers prefixed by @.
866
867 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
868
869         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
870         It caused exception in namespace resolving (again!).
871         
872         * class.cs (Class.ctor): Removed exit.
873         (PropertyMethod.ctor): ditto.
874         
875         * codegen.cs (Codegen.Reset): Reset static data.
876         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
877         
878         * cs-tokenizer.cs (Cleanup): Removed.
879         
880         * driver.cs (GetSystemDir): Rewrote to one line command.
881         It caused problem with unloaded dynamic modules.
882         (UnixParseOption): Removed Exit.
883         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
884         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
885         Now can be mcs used as library.
886         
887         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
888         empty location.
889         
890         * location.cs (Reset): Reset static data.
891         
892         * namespace.cs (Reset): Reset static data.
893         
894         * report.cs (Report.Reset): Reset static data.
895         
896         * rootcontext.cs (RootContext.Reset): Reset static data.
897         
898         * tree.cs (RootTypes.ctor): Use Location.Null
899         
900         * typemanager.cs (TypeManager.Reset): Reset static data.
901         (CoreLookupType): Removed Exit.
902         (TypeHandle.Reset): Reset static data.
903         
904 2005-03-10  Raja R Harinath  <rharinath@novell.com>
905
906         Fix #73516.
907         * typemanager.cs (ComputeNamespaces): Import namespaces from
908         referenced modules too.
909
910 2005-03-09  Raja R Harinath  <rharinath@novell.com>
911
912         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
913         than '.'.
914
915 2005-03-09  Raja R Harinath  <rharinath@novell.com>
916
917         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
918         enclosing DeclSpace.  This ensures that a name-lookup populates
919         more caches and there are fewer 'TypeExpression's.  Carve out
920         nested type lookup into ...
921         (LookupNestedTypeInHierarchy): ... this.
922
923 2005-04-15  Martin Baulig  <martin@ximian.com>
924
925         Merged r41590 from MCS and make it work in the generics land.
926
927         * generic.cs (TypeParameter.UpdateConstraints): Removed the
928         `check' argument.
929
930         * class.cs (PartialContainer.UpdateConstraints): Removed.
931         (PartialContainer.CheckConstraints): Removed.
932         (PartialContainer.SetParameterInfo): Store the constraints here.
933         (PartialContainer.DefineTypeParameters): New public method;
934         resolve the type parameter's constraints here.  Note that the
935         PartialContainer doesn't have an EmitContext anymore, so we must
936         do this in the ClassPart.
937
938 2005-03-09  Raja R Harinath  <rharinath@novell.com>
939
940         Clean up a few partial-class semantics.  
941         Fixes test-357.cs and cs1618-2.cs.
942         * cs-parser.jay (struct_declaration): Use 'current_class' as
943         parent of newly-created struct.  Remove call to Register ().
944         Use 'pop_current_class' to complete handing the current struct.
945         (interface_declaration): Likewise.
946         (class_declaration): Likewise.
947         (enum_declaration): Use 'current_class' as parent of newly created
948         enum.
949         (delegate_declaration): Likewise.
950         (pop_current_class): New function.  This is used to handle closing
951         up the 'current_class' and 'current_container', and pointing them
952         to the enclosing class/container.
953         (CSharpParser): Initialize 'current_class' too.
954         * decl.cs (MemberCore): Add check for invariant: a partial
955         container is not a parsed entity, and thus does not enclose any
956         parsed members.
957         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
958         (DeclSpace.BaseTypeExpr): Use it.
959         (DeclSpace.LookupType): Add check for invariant.
960         * class.cs (TypeContainer): Add check for invariant: a nested
961         class should have the same NamespaceEntry as its enclosing class.
962         (TypeContainer.EmitFieldInitializers): Make virtual.
963         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
964         MemberCore.
965         (TypeContainer.Register): Remove.
966         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
967         null.  Use TypeResolveEmitContext for resolving base types and
968         interfaces.  Move initialization of Parts.TypeBuilder here from
969         ...
970         (TypeContainer.DefineNestedTypes): ... here.
971         (PartialContainer): Take a Namespace not a NamespaceEntry.
972         (PartialContainer.Create): Don't use Register.  Call the
973         appropriate Add... function directly.
974         (ClassPart): Take both the PartialContainer and the enclosing
975         class as constructor arguments.
976         (ClassPart.EmitFieldInitializers): Override.
977         (ClassPart.PartFindNestedTypes): Remove.
978         (FieldBase.GetInitializerExpression): Resolve the initializer
979         expression in the emit context of the enclosing class.
980         * tree.cs (RootTypes): Remove Register ().
981         
982 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
983
984         * cs-parser.jay: Removed CS0134.
985         
986         * driver.cs: Removed CS1901.
987         
988         * expression.cs (SizeOf.DoResolve): Don't report CS0233
989         for predefined types.
990
991 2005-03-07  Duncan Mak  <duncan@novell.com>
992
993         * codegen.cs (Save):  Catch UnauthorizedAccessException as
994         well. Fixes bug #73454.
995
996 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
997
998         * cs-tokenizer.cs (xtoken): Add CS1035.
999         
1000         * class.cs (MethodData.Define): Add CS0683.
1001         (FieldMember.ctor): Add CS0681.
1002
1003 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1004
1005         * ecore.cs (SimpleName.DoResolve): Rename from
1006         SimpleName.DoResolveAllowStatic.
1007         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
1008         Pass 'intermediate' flag to MemberStaticCheck.
1009         (SimpleName.MemberStaticCheck): Skip "static check" only in case
1010         of "intermediate" lookups via MemberAccess.
1011         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
1012         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
1013
1014 2005-03-07  Raja R Harinath  <rharinath@novell.com>
1015
1016         Fix #73394.
1017         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
1018         slipped in because of variable names that are identical to a
1019         builtin type's BCL equivalent ('string String;', 'int Int32;').
1020         (PropertyExpr.EmitInstance): Likewise.
1021
1022 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
1023
1024         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
1025         
1026         * report.cs (warning_ignore_table): Made public.
1027
1028 2005-03-04  Raja R Harinath  <rharinath@novell.com>
1029
1030         Fix #73282.
1031         * class.cs (MethodData.Emit): Pass 'container' to
1032         container.GetObsoleteAttribute instead of 'container.Parent'.
1033
1034 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
1035
1036         * cs-parser.jay: Add 1534 error test.
1037
1038         * iterators.cs (Yield.CheckContext): Add error 1629.
1039         (Iterator.ctor): Save unsafe modifier.
1040         (MoveNextMethod.DoEmit): Restore unsafe context.
1041
1042         * namespace.cs (UsingAlias): Better error message.
1043
1044 2005-03-03  Dan Winship  <danw@novell.com>
1045
1046         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
1047         the warning message [#73219]
1048
1049 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1050
1051         Fix compile with MCS 1.0.0.0.
1052         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
1053         w_restore to not depend on string constant folding.
1054
1055 2005-03-03  Raja R Harinath  <rharinath@novell.com>
1056
1057         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
1058         CS0246 check to users who passed 'silent = false'.
1059         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
1060         check.
1061         (SimpleName.SimpleNameResolve): Update.
1062         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
1063         (MemberAccess.IdenticalNameAndTypeName): Update.
1064         * doc.cs (FindDocumentedTypeNonArray): Update.
1065
1066 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
1067
1068         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
1069         * parameters.cs (ComputeAndDefineParameters): Remove.
1070         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
1071         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
1072         Use GetParameterInfo.
1073
1074 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
1075
1076         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
1077
1078 2005-03-02  Raja R Harinath  <rharinath@novell.com>
1079
1080         Unify DeclSpace.LookupType and DeclSpace.FindType.
1081         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
1082         is in charge of defining nested types on demand.
1083         (DeclSpace.LookupType): Use it when the current_type is a
1084         TypeBuilder.  Use LookupTypeDirect for reflected types.
1085         (DeclSpace.FindType): Remove.
1086         (DeclSpace.LookupInterfaceOrClass): Likewise.
1087         (DeclSpace.DefineTypeAndParents): Likewise.
1088         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
1089         DeclSpace.LookupType.
1090         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
1091         * typemanager.cs (LookupType): Simplify.
1092         (AddUserType): Remove type from negative_hits.
1093         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
1094         * class.cs (TypeContainer.FindMembers): Move handling of nested
1095         types ...
1096         (TypeContainer.FindMembers_NestedTypes): ... here.
1097         (TypeContainer.FindNestedType): Implement override.
1098         (ClassPart.FindNestedType): Delegate to PartialContainer.
1099         (ClassPart.PartFindNestedType): Looks up the nested types of the
1100         part alone.
1101
1102 2005-04-14  Martin Baulig  <martin@ximian.com>
1103
1104         * generic.cs (ConstructedType): Moved all the type lookup and
1105         nested class logic into SimpleName.
1106         (ConstructedType.ResolveConstructedType): Our underlying type is
1107         already fully resolved; all the type lookup stuff is in
1108         SimpleName.
1109
1110         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
1111         constructed types here instead of in ConstructedType.
1112
1113         * decl.cs (MemberName.GetTypeExpression): Always create a
1114         SimpleName, not a ConstructedType.
1115         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
1116
1117 2005-03-02  Martin Baulig  <martin@ximian.com>
1118
1119         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1120         static constructor in static classes.
1121
1122 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
1123
1124         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
1125         sizeParamIndex is not specified.
1126
1127 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
1128
1129         Fix #73117
1130         * report.cs (WarningMessage.IsEnabled): Missing null check.
1131
1132 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1133
1134         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
1135         in the fields and not in the properties.
1136
1137 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
1138
1139         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
1140         fields as well.
1141
1142 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1143
1144         * attribute.cs: Small refactoring (improved robustness).
1145         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
1146         (ValidateGuid): Removed.
1147         (Resolve): Removed referenced to above mentioned.
1148         (GetAttributeUsage): Made private and changed to work without
1149         class assistance.
1150         (GetIndexerAttributeValue): Don't crash.
1151         (GetConditionalAttributeValue): Ditto.
1152         (GetClsCompliantAttributeValue): Ditto.
1153         (ExtractSecurityPermissionSet): All attributes exceptions are
1154         error 648.
1155         (GetPropertyValue): New helper.
1156         (GetMethodImplOptions): New method.
1157         (DefinePInvokeMethod): Reuse common code. Implemented handling of
1158         some missing properties.
1159         
1160         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
1161         (Method.ApplyAttributeBuilder): Updated.
1162         
1163         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
1164         exception.
1165
1166 2005-02-28  Raja R Harinath  <rharinath@novell.com>
1167
1168         Fix #73052.
1169         * report.cs (Report.SymbolRelatedToPreviousError): Handle
1170         non-simple types (array, pointer, reference).
1171
1172 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
1173
1174         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
1175
1176         * class.cs (MethodCore.IsDuplicateImplementation): Special error
1177         for operators.
1178         (Method.CheckBase): Catch wrong destructor here.
1179         (MethodData.Define): Add errors 550, 668.
1180
1181         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
1182
1183         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
1184
1185         * pending.cs (VerifyPendingMethods): Add error 551.
1186
1187         * typemanager.cs (CSharpName): Next error report helper.
1188
1189 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
1190
1191         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
1192         attributes. Removed useless attribute double check.
1193         It saves almost 2MBs for corlib.
1194
1195 2005-02-25  Raja R Harinath  <rharinath@novell.com>
1196
1197         Fix #72924.
1198         * statement.cs (ExpressionStatement.Resolve): Make robust to being
1199         called twice in case of error.
1200
1201 2005-02-23  Chris Toshok  <toshok@ximian.com>
1202
1203         Fix compiler portions of #72827.
1204         * statement.cs (Block.Emit): call Begin/EndScope on the
1205         EmitContext instead of the ILGenerator.
1206
1207         * codegen.cs (EmitContext.BeginScope): new method, call
1208         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
1209         we have one.)
1210         (EmitContext.BeginScope): same, but EndScope and CloseScope
1211
1212         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
1213         offset and call the superclass's OpenScope(int) with it.
1214         (SymbolWriter.CloseScope): get the current il
1215         offset and call superclass's CloseScope(int) with it.
1216
1217 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
1218
1219         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
1220         CS1677 for out and ref as well.
1221
1222         * class.cs (Method.Define): Add error CS1599 detection.
1223         
1224         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
1225         
1226         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
1227         
1228         * delegate.cs (Delegate.Define): Add error CS1599 detection.
1229         
1230         * support.cs.cs (ModifierDesc): New helper method.
1231
1232 2005-02-23  Raja R Harinath  <rharinath@novell.com>
1233             Abin Thomas  <projectmonokochi@rediffmail.com>
1234             Anoob V E  <projectmonokochi@rediffmail.com>
1235             Harilal P R  <projectmonokochi@rediffmail.com>
1236
1237         Fix #57851, #72718.
1238         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
1239         MemberLookup (used for error reporting) actually returns a result.
1240         Fix error report number (122, not 112).
1241
1242 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
1243             Anoob V E  <projectmonokochi@rediffmail.com>
1244             Harilal P R  <projectmonokochi@rediffmail.com>
1245
1246         Fix #71134.
1247         * pending.cs (PendingImplementation.GetAbstractMethods):
1248         Find NonPublic members too.
1249
1250 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
1251
1252         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
1253         Fixed error 217.
1254         
1255         * class.cs (MethodCore.CheckMethodAgainstBase):
1256         Add error 239 report.
1257
1258 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1259
1260         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1261         
1262         * class.cs (Operator.Define): Add error 217 report.
1263         
1264 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1265
1266         Fix #68955.
1267         * expression.cs (Invocation.IsApplicable): Make public.
1268         (Invocation.IsParamsMethodApplicable): Likewise.
1269         * delegate.cs (Delegate.VerifyApplicability): Don't use
1270         Invocation.VerifyArgumentCompat for parameter applicability
1271         testing.  Use Invocation.IsApplicable and
1272         Invocation.IsParamsMethodApplicable.
1273
1274 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1275
1276         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
1277         
1278         * class.cs (Operator.Define): Add error 217 report.
1279         
1280 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1281
1282         * namespace.cs (UsingEntry.Resolve): Undo change below.
1283
1284 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1285
1286         Fix #72756.
1287         * ecore.cs (Expression.MemberLookupFailed): Add argument to
1288         disable the error message when the extended MemberLookup also
1289         fails.
1290         (Expression.MemberLookupFinal): Update.
1291         (SimpleName.DoSimpleNameResolve): Update.
1292         * expression.cs (MemberAccess.ResolveNamespaceOrType):
1293         Don't use MemberLookupFinal.
1294         (New.DoResolve): Update.
1295         (BaseAccess.CommonResolve): Update.
1296
1297 2005-02-21  Raja R Harinath  <rharinath@novell.com>
1298
1299         Fix #72732.
1300         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
1301         occured previously, don't resolve again.
1302
1303 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
1304
1305         Fix #69949
1306         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
1307         argument. Call ResolveAttributeUsage for unresolved.
1308         when types doesn't match ctor arguments.
1309         
1310         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
1311         for nested attribute classes.
1312         (Class.attribute_usage): Removed.
1313         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
1314         for attribute class.
1315         
1316         * ecore.cs (IsAttribute): Removed.
1317         
1318         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
1319         
1320         * rootcontext.cs (RegisterAttribute): Removed, attributes are
1321         now normal types.
1322         (attribute_types): Removed.
1323         (EmitCode): Global attributes are emited as the latest.
1324
1325 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
1326
1327         * class.cs (EmitFieldInitializers): Don't emit field initializer
1328         for default values when optimilization is on.
1329         
1330         * constant.cs (Constant.IsDefaultValue): New property.
1331         
1332         * driver.cs: Add /optimize handling.
1333         
1334         * constant.cs,
1335         * ecore.cs,
1336         * literal.cs: Implement new IsDefaultValue property.
1337         
1338         * rootcontext.cs (Optimize): New field, holds /optimize option.
1339
1340 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1341
1342         Fix crasher in re-opened #72347.
1343         * namespace.cs (Namespace.Lookup): Return null if
1344         DeclSpace.DefineType returns null.
1345
1346         Fix #72678.
1347         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
1348
1349 2005-02-18  Raja R Harinath  <rharinath@novell.com>
1350
1351         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
1352         now returns null if it cannot resolve to an lvalue.
1353         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
1354         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
1355         returned null.  Remove check for SimpleName.
1356         (EventExpr.DoResolveLValue): New.
1357         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
1358         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
1359         error from ...
1360         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
1361         avoid CS0131 error.
1362         (Unary.ResolveOperator): Move CS0211 check ...
1363         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
1364         CS0131 error.
1365         (Unary.DoResolveLValue): Simplify.
1366         (AddressOf.DoResolveLValue): New.
1367         (ArrayAccess.DoResolveLValue): New.
1368
1369 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
1370
1371         * attribute.cs (Attribute.Resolve): Add arguments casting for
1372         when types doesn't match ctor arguments.
1373
1374 2005-02-16  Raja R Harinath  <rharinath@novell.com>
1375
1376         Fix parts of #63202.
1377         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
1378         lookup of operator in base type.  Ensure that all checks happen
1379         when the operator resolves to an "op_..." method.
1380
1381 2005-02-15  Raja R Harinath  <rharinath@novell.com>
1382
1383         Fix #71992.
1384         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
1385         'ignore_cs0104' parameter.  Pass it to ...
1386         (NamespaceEntry.Lookup): ... this.
1387         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
1388         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
1389         (TypeLookupExpression.DoResolveAsTypeStep): Update.
1390         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
1391         Update.  Request that cs0104 errors be ignored.
1392         (ComposedCast.ResolveAsTypeStep): Update.
1393
1394 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1395
1396         Fix #59209.
1397         * expression.cs (Invocation.BetterFunction): Remove support for
1398         comparing virtual functions and their overrides.
1399         (Invocation.IsOverride): New.
1400         (Invocation.OverloadResolve): Don't consider 'override' functions
1401         during candidate selection.  Store them in a lookaside list.
1402         If the selected method is a 'virtual' function, use the list to
1403         find any overrides that are closer to the LHS type.
1404
1405 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
1406
1407         * expression.cs (New.DoResolve): Add complex core type reduction.
1408         (New.Constantify): Converts complex core type syntax like 'new int ()'
1409         to simple constant.
1410         
1411 2005-02-14  Raja R Harinath  <rharinath@novell.com>
1412
1413         * decl.cs (EntryType.EntryType): New constructor to create an
1414         updated copy of a cache entry.
1415         (MemberCache.AddMethods): Use it.
1416         (MemberCache.ClearDeclaredOnly): Remove.
1417         (MemberCache.MemberCache): Update.
1418
1419 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1420
1421         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
1422         variable.  This one is represents the actual low-level declaration
1423         of the method, as opposed to the semantic level `IsStatic'.   
1424
1425         An anonymous method which is hosted into a static method might be
1426         actually an instance method.  IsStatic would reflect the
1427         container, while MethodIsStatic represents the actual code
1428         generated.
1429
1430         * expression.cs (ParameterReference): Use the new MethodIsStatic
1431         instead of IsStatic.
1432
1433         * anonymous.cs (AnonymousMethod.Compatible): Pass the
1434         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
1435         set on the current EmitContext. 
1436
1437         * expression.cs (Cast): Overload DoResolveLValue so we can pass
1438         resolve our casted expression as an LValue.  This triggers the
1439         proper LValue processing that is later required by Assign.
1440
1441         This fixes 72347.
1442
1443         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
1444
1445 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
1446
1447         C# 2.0 Fixed buffer implementation
1448
1449         * anonymous.cs: Update after RegisterHelperClass renaming.
1450
1451         * attribute.cs (AttributeTester.fixed_buffer_cache):
1452         Cache of external fixed buffers.
1453         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
1454         implementation if field is fixed buffer else null.
1455
1456         * class.cs
1457         (TypeContainer.AddField): Accept FieldMember instead of Field.
1458         (FieldBase.IsFieldClsCompliant): Extracted code from
1459         VerifyClsCompliance descendant customization.
1460         (FixedField): New class handles fixed buffer fields.
1461         (FixedFieldExternal): Keeps information about imported fixed
1462         buffer.
1463         (IFixedField): Make access to internal or external fixed buffer
1464         same.
1465
1466         * cs-parser.jay: Add fixed buffer parsing.
1467
1468         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
1469         buffer.
1470
1471         * expression.cs (Indirection): Extended implementation to accept
1472         fixed buffer field.
1473         (PointerArithmetic.Emit): Get element from fixed buffer as well.
1474         (ElementAccess.MakePointerAccess): Get type as parameter.
1475         (DoResolve): Add fixed buffer field expression conversion.
1476         (DoResolveLValue): Ditto.
1477         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
1478         (ArrayPtr): Derives from FixedBufferPtr.
1479         (ArrayPtr.Emit): Add extra emit for array elements.
1480
1481         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
1482
1483         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
1484         for compiler generated types.
1485         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
1486
1487         * statement.cs (Fixed): Refactored to be easier add fixed buffer
1488         and consume less memory.
1489         (Fixed.Resolve): Add fixed buffer case.
1490
1491         * typemanager.cs (compiler_generated_attr_ctor,
1492         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
1493         (HasElementType): Add our own implementation to work on every
1494         runtime.
1495
1496 2005-02-11  Miguel de Icaza  <miguel@novell.com>
1497
1498         * anonymous.cs (CaptureContext): Track whether `this' has been
1499         referenced.   
1500
1501         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
1502         only captured `this' if it was implicitly done (instance
1503         methods/variables were used). 
1504
1505         * codegen.cs (EmitContext.CaptureThis): New method to flag that
1506         `this' must be captured.
1507
1508 2005-01-30  Miguel de Icaza  <miguel@novell.com>
1509  
1510         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
1511         is null it means that there has been no need to capture anything,
1512         so we just create a sibling.
1513
1514         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
1515
1516         Just a partial fix.  The other half is fairly elusive.
1517         
1518 2005-02-10  Raja R Harinath  <rharinath@novell.com>
1519
1520         Fix #52586, cs0121-4.cs.
1521         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
1522         and return a hashtable.
1523         (MemberCache.ClearDeclaredOnly): New.
1524         (MemberCache.MemberCache): Update to change.  Make a deep copy of
1525         the method_hash of a base type too.
1526         (MemberCache.AddMethods): Adapt to having a deep copy of the base
1527         type methods.  Overwrite entries with the same MethodHandle so
1528         that the ReflectedType is correct.  The process leaves in base
1529         virtual functions and their overrides as distinct entries.
1530         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
1531         matters since it was boxed in a ArrayList before.
1532         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
1533         modifier.
1534         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
1535         case of a virtual function and its override (choose the overload
1536         as better).
1537         (Invocation.OverloadResolve): Avoid 'override' members during
1538         'applicable_type' calculation.
1539
1540 2005-03-28  Raja R Harinath  <rharinath@novell.com>
1541
1542         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
1543         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
1544         GetTypeHandle.  It is possible for a reflected type to derive from
1545         a TypeBuilder (e.g., int[] derives from the TypeBuilder
1546         System.Array during mscorlib compilation).
1547         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
1548         contain a method_hash, don't create one either.  Don't create a
1549         deep copy of the base cache's method_hash.
1550         (MemberCache.SetupCache): Rename back from DeepCopy.
1551         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
1552         already initialized.  If we see an override function, add its
1553         underlying base virtual function to the member_hash too.
1554
1555 2005-02-09  Raja R Harinath  <rharinath@novell.com>
1556
1557         Combine two near-redundant caches.
1558         * typemanager.cs (method_params): Rename from method_internal_params.
1559         (TypeManager.GetParameterData): New.  Replace
1560         Invocation.GetParameterData.
1561         (TypeManager.LookupParametersByBuilder): Remove.
1562         * expression.cs (Invocation.method_parameter_cache): Remove.
1563         (Invocation.GetParameterData): Remove.
1564         Update to changes.
1565         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
1566         Update to changes.
1567
1568 2005-02-08  Raja R Harinath  <rharinath@novell.com>
1569
1570         Fix #72015.
1571         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
1572         TypeManager.multicast_delegate_type is null, resolve it by looking
1573         up "System.MulticastDelegate".
1574         * rootcontext.cs (RootContext.ResolveCore): Simplify.
1575
1576 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
1577             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
1578             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
1579
1580         Fix cs0164.cs.
1581         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
1582         (LabeledStatement.AddReference): New.  Set 'referenced'.
1583         (Goto.Resolve): Use it.
1584
1585 2005-02-05  John Luke  <john.luke@gmail.com>
1586
1587         * driver.cs: remove duplicate -doc line in Usage ()
1588
1589 2005-02-04  Raja R Harinath  <rharinath@novell.com>
1590
1591         * location.cs (Location.AddFile): Fix CS2002 error report.
1592
1593 2005-02-02  Martin Baulig  <martin@ximian.com>
1594
1595         * delegate.cs (Delegate.DefineType): Report an internal error if
1596         TypeManager.multicast_delegate_type is null.  See bug #72015 for
1597         details.        
1598
1599 2005-02-02  Raja R Harinath  <rharinath@novell.com>
1600
1601         Fix a crasher in a variant of #31984.
1602         * const.cs (Constant.CheckBase): New override that defers the
1603         new-or-override check in case the base type hasn't been populated
1604         yet.
1605         (Constant.Define): Ensure the new-or-override check is performed.
1606
1607 2005-02-01  Duncan Mak  <duncan@ximian.com>
1608
1609         * const.cs (LookupConstantValue): Check that `ce' is not null
1610         before calling GetValue ().
1611
1612 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1613
1614         Fix test-334.cs (#69519).
1615         * cs-parser.jay (using_alias_directive): Pass in an expression to
1616         NamespaceEntry.UsingAlias.
1617         (using_namespace_directive): Pass in an expression to
1618         NamespaceEntry.Using.
1619         (namespace_name): Don't flatten to a string.
1620         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
1621         (NamespaceEntry.AliasEntry.Resolve): Lookup using
1622         ResolveAsTypeStep.
1623         (NamespaceEntry.UsingEntry): Likewise.
1624         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
1625         changes.
1626         (NamespaceEntry.LookupForUsing): Remove.
1627         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
1628         names.
1629         (NamespaceEntry.Lookup): Remove support for dotted names.
1630
1631 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1632
1633         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
1634         split into two.
1635         (NamespaceEntry.ImplicitParent): Compute on demand.
1636         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
1637         parallels the current.
1638         (NamespaceEntry.LookupForUsing): Use it.
1639         (NamespaceEntry.Lookup): If the current namespace-entry is
1640         implicit, don't search aliases and using tables.
1641
1642 2005-02-01  Raja R Harinath  <rharinath@novell.com>
1643
1644         Fix #31984.
1645         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
1646         BaseCache here.
1647         (TypeContainer.BaseCache): Compute on demand.
1648         (TypeContainer.FindMembers): Define constants and types if they're
1649         not already created.
1650         (FieldMember.Define): Move resetting of ec.InUnsafe before error
1651         check.
1652         * const.cs (Constant.Define): Make idempotent.
1653
1654 2005-01-29  Miguel de Icaza  <miguel@novell.com>
1655
1656         * pending.cs: Produce better code (no nops produced by using Ldarg
1657         + value).
1658         
1659         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
1660         i - 1' it should be arg + 1.
1661
1662         Fixes bug #71819.
1663
1664 2005-01-28  Raja R Harinath  <rharinath@novell.com>
1665
1666         * attribute.cs (Attribute.CheckAttributeType): Make private
1667         non-virtual.
1668         (Attribute.ResolveType): Make virtual.
1669         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
1670         handling of RootContext.Tree.Types.
1671
1672 2005-01-27  Raja R Harinath  <rharinath@novell.com>
1673
1674         Update attribute-handling to use the SimpleName/MemberAccess
1675         mechanisms.
1676         * cs-parser.jay (attribute): Pass in an expression to the
1677         constructors of Attribute and GlobalAttribute.
1678         * attribute.cs (Attribute): Take an expression for the name.
1679         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
1680         passed in attribute name expression.
1681         (Attribute.CheckAttributeType): Use it.
1682         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
1683         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
1684         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
1685         argument to prevent error messages if the lookup fails.
1686
1687 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
1688
1689         * expression.cs (Indirection): Implemented IVariable interface
1690         to support indirection in AddressOf operator.
1691         (PointerArithmetic.Emit): Add optimalization for case where
1692         result can be precomputed.
1693
1694 2005-01-26  Martin Baulig  <martin@ximian.com>
1695
1696         * class.cs (TypeContainer.AttributeTargets): Return the correct
1697         AttributeTargets depending on our `Kind' instead of throwing an
1698         exception; fixes #71632.
1699
1700 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
1701
1702         Fix #71257
1703         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
1704         constant members.
1705
1706 2005-03-17  Martin Baulig  <martin@ximian.com>
1707
1708         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
1709         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
1710
1711 2005-03-17  Martin Baulig  <martin@ximian.com>
1712
1713         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
1714         to bool so we can return an error condition.
1715         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
1716         returned an error.
1717
1718 2005-03-17  Martin Baulig  <martin@ximian.com>
1719
1720         * generic.cs (TypeMananager.IsIEnumerable): New public method.
1721
1722         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
1723         converting from an array-type of T to `IEnumerable<T>'.
1724
1725 2005-03-16  Martin Baulig  <martin@ximian.com>
1726
1727         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
1728         (Nullable.LiftedUnaryMutator): New public class.
1729
1730         * expression.cs (UnaryMutator.DoResolve): Added support for
1731         Nullable Types.
1732
1733 2005-03-14  Martin Baulig  <martin@ximian.com>
1734
1735         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
1736
1737 2005-03-14  Martin Baulig  <martin@ximian.com>
1738
1739         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
1740         the comparision operators `<', `>', `<=' and `>='.
1741
1742 2005-03-13  Martin Baulig  <martin@ximian.com>
1743
1744         * generic.cs
1745         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
1746         avoid confusion with the `NullLiteral'.
1747         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
1748
1749 2005-03-13  Martin Baulig  <martin@ximian.com>
1750
1751         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
1752         comparing arbitrary types with the null literal.
1753
1754 2005-03-13  Martin Baulig  <martin@ximian.com>
1755
1756         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
1757         boolean operators '&&', '||', '&' and '|'.
1758         (Nullable.OperatorTrueOrFalse): New public class.
1759
1760         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
1761         instead of a `StaticCallExpr'; added support for nullables.
1762
1763 2005-03-10  Martin Baulig  <martin@ximian.com>
1764
1765         * expression.cs
1766         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
1767         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
1768
1769 2005-03-07  Martin Baulig  <martin@ximian.com>
1770
1771         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
1772         it work if `expr' is not an IMemoryLocation.
1773         (Nullable.Lifted): Implement IMemoryLocation.
1774         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
1775         target type.
1776
1777 2005-03-05  Martin Baulig  <martin@ximian.com>
1778
1779         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
1780         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
1781         (Nullable): Added support for lifted unary and binary operators.
1782
1783         * expression.cs (Unary.DoResolve): Added support for nullable types.
1784         (Binary.DoResolve): Likewise.
1785         (Conditional.DoResolve): Likewise.
1786
1787 2005-03-02  Martin Baulig  <martin@ximian.com>
1788
1789         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
1790
1791         * class.cs (ClassPart.SetParameterInfo): Override this.
1792         (PartialContainer.SetParameterInfo): Override this.
1793         (TypeContainer.CheckConstraints): New protected method.
1794         (PartialContainer.CheckConstraints): Override this and check
1795         whether the same contraints were specified in all parts of a
1796         partial generic type definition.
1797         (PartialContainer.UpdateConstraints): New public method.
1798
1799         * generic.cs (TypeParameter.UpdateConstraints): New public method.
1800
1801 2005-03-02  Martin Baulig  <martin@ximian.com>
1802
1803         Committing a patch from Carlos Alberto Cortez to fix #72887.
1804
1805         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
1806         casts from `T []' to `int []'.
1807
1808 2005-03-02  Martin Baulig  <martin@ximian.com>
1809
1810         * generic.cs (TypeManager.IsEqual): Make this symmetric.
1811
1812         * expression.cs (Binary.ResolveOperator): When resolving a
1813         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
1814         `=='.  Fixes #71866.  See gen-127.cs.
1815
1816 2005-03-02  Martin Baulig  <martin@ximian.com>
1817
1818         * class.cs (TypeContainer.DoDefineMembers): We also need a default
1819         static constructor in static classes.
1820
1821 2005-03-02  Martin Baulig  <martin@ximian.com>
1822
1823         * generic.cs
1824         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
1825         (Nullable.LiftedConversion): Added support for user-defined
1826         conversions.
1827
1828         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
1829
1830         * cs-parser.jay: Use ComposedCast everywhere instead of
1831         NullableType, so we don't need to check for NullableType
1832         everywhere.
1833         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
1834         case where we'll be resolved into a `parenthesized_expression_0'
1835         afterwards.
1836
1837         * convert.cs
1838         (Convert.UserDefinedConversion): Added nullable conversions.
1839
1840 2005-02-28  Martin Baulig  <martin@ximian.com>
1841
1842         * generic.cs (TypeManager.IsNullableType): New static method.
1843         (Nullable): New abstract class.
1844         (Nullable.NullLiteral): New public class.
1845         (Nullable.LiftedConversion): New public class.
1846
1847         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
1848         `builtin_types opt_nullable'.
1849
1850         * convert.cs
1851         (Convert.ImplicitConversionStandard): Added nullable conversions.
1852         (Convert.ExplicitConversionStandard): Likewise.
1853         (Convert.ExplicitConversion): Likewise.
1854
1855 2005-02-26  Martin Baulig  <martin@ximian.com>
1856
1857         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
1858         begin with a "?", for instance "?[]".  Don't do a type lookup if
1859         `dim' is empty.
1860
1861 2005-02-25  Martin Baulig  <martin@ximian.com>
1862
1863         The first part of Nullable Types :-)
1864
1865         * generic.cs (NullableType): New public class.
1866         (NullCoalescingOperator): New public class.
1867         (TypeArguments.Resolve): Add a CS0306 check.
1868
1869         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
1870         (opt_nullable): New rule.
1871         (type): Added `opt_nullable' to `namespace_or_type_name',
1872         `builtin_types' and `pointer_type'.
1873         (array_type): Added `opt_nullable'.
1874         (opt_rank_specifier_or_nullable): New rule; this is the
1875         combination of `opt_rank_specifier' and `opt_nullable'.
1876         (opt_error): New rule; catch errors here.
1877         (nullable_type_or_conditional): New rule; we use this to check for
1878         nullable and still detect the conditional operator.
1879         (local_variable_type): Use `opt_rank_specifier_or_nullable'
1880         instead `opt_rank_specifier'.
1881
1882         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
1883         for nullables.
1884
1885 2005-02-24  Martin Baulig  <martin@ximian.com>
1886
1887         * README, README.Changes: Removed; they're old and obsolete.
1888
1889 2005-02-22  Martin Baulig  <martin@ximian.com>
1890
1891         * generic.cs (TypeParameter.Resolve): If resolving the constraints
1892         returned an error, set `constraints' to null to avoid a crash
1893         later on.
1894         (TypeParameter.ResolveType): Likewise.
1895
1896 2005-02-22  Martin Baulig  <martin@ximian.com>
1897
1898         * generic.cs
1899         (Constraints.ResolveTypes): Protect against being called twice.
1900         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
1901         (TypeParameter.ResolveType): New public method; calls
1902         constraints.ResolveTypes().
1903         (TypeParameter.DefineType): Moved constraints.ResolveType() out
1904         into the new ResolveType().
1905         (GenericMethod.Define): Call ResolveType() on all our
1906         TypeParameter's.        
1907
1908 2005-02-21  Martin Baulig  <martin@ximian.com>
1909
1910         * generic.cs
1911         (TypeManager.generic_nullable_type): New static public field.
1912         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
1913
1914         * rootcontext.cs
1915         (RootContext.ResolveCore): Resolve "System.Nullable`1".
1916
1917 2005-02-15  Martin Baulig  <martin@ximian.com>
1918
1919         * generic.cs (ConstructedType.Constraints): Correctly check
1920         constraints if the argument type is a type parameter; fixes
1921         #72326. 
1922
1923 2005-02-02  Martin Baulig  <martin@ximian.com>
1924
1925         * delegate.cs (Delegate.DefineType): Report an internal error if
1926         TypeManager.multicast_delegate_type is null.  See bug #72015 for
1927         details.        
1928
1929 2005-01-29  Miguel de Icaza  <miguel@novell.com>
1930
1931         * pending.cs: Produce better code (no nops produced by using Ldarg
1932         + value).
1933         
1934         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
1935         i - 1' it should be arg + 1.
1936
1937         Fixes bug #71819.
1938         
1939 2005-01-26  Martin Baulig  <martin@ximian.com>
1940
1941         * cs-parser.jay (indexer_declarator): Don't report an error if we
1942         have type parameters since we can be an explicit interface
1943         implementation; fixes #71449.
1944
1945 2005-01-26  Martin Baulig  <martin@ximian.com>
1946
1947         * class.cs (TypeContainer.AttributeTargets): Return the correct
1948         AttributeTargets depending on our `Kind' instead of throwing an
1949         exception; fixes #71632.
1950
1951 2005-01-26  Martin Baulig  <martin@ximian.com>
1952
1953         * delegate.cs (Delegate.DefineType): Correctly define our type
1954         parameters.  Fixes #71483.
1955
1956 2005-01-25  Raja R Harinath  <rharinath@novell.com>
1957
1958         Fix #71602.
1959         * expression.cs (MemberAccess.DoResolve): Don't complain with
1960         cs0572 when the LHS of a member access has identical name and type
1961         name.
1962
1963 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
1964
1965         Fix #71651, #71675
1966         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
1967         CreatePermission.
1968         Create custom PermissionSet only for PermissionSetAttribute.
1969
1970 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
1971
1972         Fix #71649
1973         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
1974         delegates in static class.
1975
1976 2005-01-24  Martin Baulig  <martin@ximian.com>
1977
1978         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
1979         merging an implicit block, just use its reachability.
1980
1981         * statement.cs (Block.Resolve): Make the unreachable code check
1982         work wrt. implicit blocks; see test-337 from #63842.
1983
1984 2005-01-21  Alp Toker  <alp@atoker.com>
1985  
1986         * cs-parser.jay: destructor_declaration's container is PartialContainer
1987         not Class when partial types are used, so use Kind prop instead of
1988         'is'.
1989         
1990 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
1991
1992         * cs-parser.jay: Improve error reporting when an interface
1993         declares new types.
1994
1995 2005-01-20  Dick Porter  <dick@ximian.com>
1996
1997         * support.cs: SeekableStreamReader fix from Sandor Dobos
1998         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
1999         chars are read.  Fixes bug 70369.
2000
2001 2005-01-20  Raja R Harinath  <rharinath@novell.com>
2002
2003         * cs-parser.jay (catch_clause): Simplify current_block handling
2004         somewhat.
2005
2006 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
2007
2008         * convert.cs (ImplicitStandardConversionExists): Synchronize the
2009         code with ImplicitStandardConversion to handle the implicit
2010         conversion of method groups into valid delegate invocations. 
2011
2012         The problem is that in parameter handling we were using this code
2013         path.  Fixes bug #64698
2014
2015 2005-01-19  Raja R Harinath  <rharinath@novell.com>
2016
2017         * cs-parser.jay: Fix several infelicities.
2018         - Avoid assigning to the parser value stack.  Code like 
2019           '$3 = null' is unclean.  Synthesize a value for the code block
2020           instead. 
2021         - Avoid using oob_stack for storing location information.  Use ...
2022         (_mark_): ... this.  New (empty) rule.  Saves the current location
2023         in $$.
2024         (foreach_statement): Avoid using oob_stack for current_block
2025         handling.  Use technique used in for_statement and
2026         using_statement.  Synthesize a value for the code block to store
2027         additional intermediate information.
2028
2029 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
2030
2031         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
2032         of a different type is only allowed to private fields of a
2033         containing type, not on fields of a base class.
2034
2035         See test-174.cs and error cs0122-9.cs
2036
2037 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2038
2039         Fix test-335.cs (bug #58126).
2040         * cs-parser.jay (argument): Split out non-expression parts of the
2041         rule into 'non_simple_argument'.
2042         (invocation_expression): Support parenthesized invocations with
2043         multiple arguments, and with single non-simple arguments.
2044
2045 2005-01-13  Raja R Harinath  <rharinath@novell.com>
2046
2047         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
2048         places.
2049
2050 2005-01-12  Raja R Harinath  <rharinath@novell.com>
2051
2052         Fix cs0038-1.cs, cs1640-6.cs.
2053         * ecore.cs (Expression.Resolve): Remove special-case for
2054         SimpleName in error-handling.
2055         (Expression.almostMatchedMembers): Relax access permission to
2056         protected.
2057         (Expression.MemberLookupFailed): Handle duplicates in
2058         almostMatchedMembers list.
2059         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
2060         * expression.cs (New.DoResolve): Report CS1540 for more cases.
2061         * typemanager.cs (GetFullNameSignature): Use the MethodBase
2062         overload if the passed in MemberInfo is a MethodBase.
2063
2064 2005-01-25  Martin Baulig  <martin@ximian.com>
2065
2066         * doc.cs
2067         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
2068
2069 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
2070
2071         Fix #70749
2072         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
2073         for non-CAS & merge permission sets properly.
2074
2075 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2076
2077         Improve standard-compliance of simple name and member access 
2078         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
2079         * ecore.cs (FullNamedExpression): New abstract base class 
2080         for Namespaces and TypeExpressions.
2081         (ResolveFlags.SimpleName): Remove.
2082         (SimpleName): Remove support for dotted names.
2083         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
2084         DeclSpace.FindType and DeclSpace.LookupType.
2085         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
2086         (Expression.ExprClassName): Make member function.
2087         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
2088         a namespace.  Remove creation of dotted "SimpleName"s.
2089         (MemberAccess.DoResolve): Likewise.
2090         * decl.cs (DeclSpace.Cache): Make private.
2091         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
2092         (DeclSpace.FindType): Update.
2093         (DeclSpace.LookupType): Move here from RootContext.  Return a 
2094         FullNamedExpression.
2095         * namespace.cs (Namespace): Derive from FullNamedExpression
2096         so that it can be part of expression resolution.
2097         (Namespace.Lookup): Return an FullNamedExpression.
2098         (NamespaceEntry.LookupAlias): Lookup aliases only in current
2099         namespace.
2100         * rootcontext.cs (NamespaceLookup): Remove.
2101         (LookupType): Move to DeclSpace.
2102         * attribute.cs (CheckAttributeType): Update.
2103         * doc.cs (FindDocumentedType): Remove allowAlias argument.
2104         (FindDocumentedTypeNonArray): Likewise.
2105
2106 2005-01-11  Raja R Harinath  <rharinath@novell.com>
2107
2108         Fix cs0509.cs, cs1632.cs.
2109         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
2110         is the same as IsInterface.
2111         (TypeContainer.GetClassBases): Likewise.
2112         * statement.cs (LabeledStatement.ig): New field.
2113         (LabeledStatement.LabelTarget): Save ILGenerator which created the
2114         label.
2115         (LabeledStatement.DoEmit): Check that the label was created with
2116         the same ILGenerator.
2117
2118 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2119
2120         Fix #71058
2121         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
2122         accessors to its properties.
2123
2124         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
2125         from accessors to property.
2126         
2127 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
2128
2129         Fix #70722
2130         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
2131         only for overrides.
2132         
2133 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
2134
2135         * attribute.cs: Check for null and empty strings.  
2136
2137         I have lost another battle to Paolo.
2138
2139 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
2140
2141         Fix #70942
2142         * class.cs (PropertyMethod): Set Parent field in ctors.
2143         (SetMethod.InternalParameters): Add unsafe switch hack.
2144         Override MarkForDuplicationCheck where it is appropriate.
2145
2146         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
2147         It says whether container allows members with the same name.
2148         Base default is no.
2149         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
2150         Removed is_method parameter.
2151
2152 2005-01-06  Duncan Mak  <duncan@ximian.com>
2153
2154         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
2155         because the previous change led to incorrect reporting of CS1032
2156         ("Cannot define/undefine preprocessor symbols after first token in
2157         file"). Instead of using `tokens_seen' as the only flag that
2158         triggers CS1040, introduce `comments_seen'. This new flag is used
2159         to signify having seen comments on the current line, so it is
2160         unset after a newline.
2161
2162 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2163
2164         * doc.cs : When searching for a type, find nested type too.
2165           This fixes bug #71040.
2166
2167 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
2168
2169         * doc.cs :
2170           - Warn missing member comment on those classes which also does not
2171             have doc comments. Fixed bug #71041.
2172           - Don't warn missing doc comment on default constructor.
2173             Fixed bug #71042.
2174
2175 2005-01-06  Duncan Mak  <duncan@ximian.com>
2176
2177         * cs-tokenizer.cs (xtoken): After handling traditional C-style
2178         comments, set `tokens_seen' to true. This allows us to detect
2179         misplaced preprocessor directives (i.e. not at the beginning of
2180         the a line, nor after whitespaces). In that case, report error
2181         CS1040. This fixes bug #56460.
2182
2183         * cs-parser.jay (interface_member_declaration): Add checks for
2184         IsExplicitImpl, and report CS0541 error if an interface member is
2185         defined as an explicit interface declaration.
2186
2187 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
2188
2189         Fix #70817
2190         * class.cs (PropertyMethod): Set Parent field in ctors.
2191         (SetMethod.InternalParameters): Add unsafe switch hack.
2192         
2193         * decl.cs (MemberCore.Parent): Cannot be readonly.
2194
2195 2005-01-06  Raja R Harinath  <rharinath@novell.com>
2196
2197         * decl.cs (DeclSpace.ResolveType): Remove.
2198         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
2199         Merge in code from ...
2200         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
2201         * class.cs, enum.cs: Update to changes.
2202
2203 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
2204
2205         * anonymous.cs: Ensure that we init the scope of our parent if it
2206         has not been initialized yet.
2207
2208 2004-12-30  Duncan Mak  <duncan@ximian.com>
2209
2210         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
2211         if field.FieldBuilder is null. Fixes #70758.
2212
2213         * convert.cs: Fixed some typos and updated some of the comments.
2214         (ImplicitStandardConversionExists):
2215         (TryImplicitIntConversion): If `target_type' is an interface and
2216         the type of `ic' implements this interface, return true or a new
2217         BoxedCast instead of null. This fixes #70468.
2218
2219 2004-12-29  Duncan Mak  <duncan@ximian.com>
2220
2221         * expression.cs (Argument.Emit): Check that Expr is
2222         IMemoryLocation before casting to it, and report CS1510 otherwise.
2223
2224         This fixes #70402.
2225
2226 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
2227
2228         * statement.cs (Block.ThisVariable): remove the recursion here, to
2229         make the --profile more sane.
2230
2231 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
2232
2233         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
2234         assembly, by JB Evain.
2235
2236 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2237
2238         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
2239           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
2240         "parent" refers to enclosing type/class.  "base" refers to superclass.
2241
2242 2004-12-17  Raja R Harinath  <rharinath@novell.com>
2243
2244         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2245         Ensure that we only have GlobalAttributes.
2246         * attribute.cs (Attribute.Emit): Make non-virtual.
2247         (GlobalAttribute.Emit): Remove.
2248         (Attribute.Resolve): Make virtual.
2249         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
2250         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
2251         the argument. Don't create one.
2252         (Attribute.GetObsoleteAttribute): Likewise.
2253         (Attribute.GetClsCompliantAttributeValue): Likewise.
2254         * class.cs, decl.cs: Update to changes.
2255
2256 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
2257
2258         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
2259         
2260         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
2261         
2262         * statement.cs (Foreach.Resolve): Add error 186 report.
2263
2264 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
2265
2266         * expression.cs (Conditional.DoResolve): Add warning 429.
2267         
2268         * statement.cs (If.Resolve): Add warning 665.
2269
2270 2004-12-16  Raja R Harinath  <rharinath@novell.com>
2271
2272         New invariant: RootContext.Tree.Types.NamespaceEntry == null
2273         except when in the parser, and in GlobalAttribute.
2274         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
2275         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
2276         RootContext.Tree.Types.NamespaceEntry once work is done.
2277         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
2278         and resets RootContext.Tree.Types.NamespaceEntry.
2279
2280 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
2281
2282         * cs-parser.jay: Don't create a block for every variable.
2283
2284 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
2285
2286         * location.cs: Provide extra information.
2287
2288         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
2289         variables from the captured environment, it is the ldarg_0.
2290
2291 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2292
2293         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
2294         find a conclusion.
2295         
2296         * class.cs: Changed warning level for 169 to avoid developer
2297         displeasure from warning flooding. It will be changed back when they
2298         fix most of current BCL warnings.
2299         
2300         * RootContext.cs: Pushed default WarningLevel to 3.
2301         
2302         * statement.cs: Removed unused variable.
2303
2304 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
2305
2306         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
2307         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
2308         Add error 502 report.
2309         (StaticClass.DefineType): Add error 441 report.
2310         (Class.AllowedModifiersProp): New virtual property as temporary
2311         extension to AllowedModifiers.
2312         (Class.DefineType): Add error 418 report. Moved ModFlags check here
2313         to share implementation with StaticClass and don't call virtual
2314         methods from ctor.
2315         
2316         * driver.cs (MainDriver): Add error 1558 test.
2317
2318         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
2319         report. Moved error 36 test here.
2320
2321         * statement.cs (Throw.Resolve): Add error 724 report.
2322
2323         * typemanager.cs: Add out_attribute_type core type.
2324         
2325 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
2326
2327         * class.cs (TypeContainer.VerifyClsCompliance): Add error
2328         3018 report.
2329         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
2330
2331         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
2332         3017 report.
2333         
2334         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
2335
2336         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
2337         Add error 3023 report.
2338         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
2339
2340         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
2341         implementation.
2342
2343 2004-12-12  John Luke  <john.luke@gmail.com>
2344
2345         * driver.cs (AddArgs): take -- into account when
2346         adding arguments, fixes bug 65710 
2347
2348 2004-12-12  Martin Baulig  <martin@ximian.com>
2349
2350         * expression.cs (Unary.TryReduceNegative): Added support for
2351         SByteConstant and ByteConstant.
2352         (Unary.Reduce): Check error values from TryReduceNegative().
2353
2354 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
2355
2356         * attributes.cs (Attribute.Resolve): Avoid multiple error report
2357         and report exception as error 182.
2358
2359 2004-12-10  Raja R Harinath  <rharinath@novell.com>
2360
2361         * driver.cs (Main): Fix message when there are warnings.
2362
2363 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
2364
2365         * delegate.cs: Fixed my fix from yesterday, sorry about that.
2366
2367 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
2368
2369         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
2370         Reduced number of warnings.
2371         
2372         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
2373
2374 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
2375
2376         * driver.cs: Removed message.
2377
2378         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
2379
2380 2004-12-08    <vargaz@freemail.hu>
2381
2382         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
2383
2384 2004-12-08  Martin Baulig  <martin@ximian.com>
2385
2386         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2387         instead of a CS3002 for properties and indexer.
2388
2389 2004-12-08  Martin Baulig  <martin@ximian.com>
2390
2391         * decl.cs (MemberName.ToString): Make this work again.
2392
2393 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
2394
2395         * attribute.cs (Resolve): Add error 591 detection.
2396
2397         * class.cs (FieldMember.Define): Add error 1547 detection.
2398         (Indexer.Define): Add error 620 detection.
2399         (Operator.Define): Add error 590 detection.
2400
2401         * ecore.cs: Missing argument for error 79.
2402
2403         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
2404         detection.
2405
2406 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
2407
2408         Fix #70106
2409         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
2410         only.
2411
2412 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2413
2414         * cs-parser.jay : handle doc comments on implicit/explicit operators.
2415           Some operator comments were suppressed.
2416         * doc.cs : Implicit/explicit operator name in doc comments are like
2417           "op_Explicit(type)~returnType", so added suffix handling.
2418
2419 2005-01-21  Alp Toker  <alp@atoker.com>
2420
2421         * cs-parser.jay: destructor_declaration's container is PartialContainer
2422         not Class when partial types are used, so use Kind prop instead of 'is'.
2423
2424 2004-12-12  Martin Baulig  <martin@ximian.com>
2425
2426         * expression.cs (Unary.TryReduceNegative): Added support for
2427         SByteConstant and ByteConstant.
2428         (Unary.Reduce): Check error values from TryReduceNegative().
2429
2430 2004-12-11  Martin Baulig  <martin@ximian.com>
2431
2432         * support.cs (ReflectionParameters.ParameterName): If we have a
2433         `gpd', call `ParameterName' on it.
2434
2435         * parameter.cs (Parameter.GetParameterAttributes): New static method.
2436
2437         * pending.cs (PendingImplementation.DefineProxy): Call
2438         DefineParameter() for all of the MethodBuilder's arguments.
2439
2440 2004-12-09  Martin Baulig  <martin@ximian.com>
2441
2442         * doc.cs (DocUtil): Make this a static class.
2443
2444 2004-12-09  Martin Baulig  <martin@ximian.com>
2445
2446         * expression.cs (Invocation.InferType): Moved the type inference
2447         implementation into TypeManager.
2448
2449         * generics.cs (TypeManager): Moved the type inference
2450         implementation here.
2451
2452 2004-12-09  Martin Baulig  <martin@ximian.com>
2453
2454         * typemanager.cs (TypeManager): Make this a partial class.
2455
2456         * generics.cs
2457         (TypeManager): Move the generics part of `TypeManager' here.
2458
2459 2004-12-08  Martin Baulig  <martin@ximian.com>
2460
2461         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
2462         instead of a CS3002 for properties and indexer.  Added CS3024
2463         check for generic interfaces.
2464
2465         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
2466         instances are not CLS-compliant.
2467
2468 2004-12-08  Martin Baulig  <martin@ximian.com>
2469
2470         * cs-parser.jay
2471         (void_pointer_expression): New rule for `void*', `void**' etc.
2472         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
2473
2474 2004-12-08  Martin Baulig  <martin@ximian.com>
2475
2476         * expression.cs (Invocation.InferType): Removed the hack for
2477         MethodCore.MayUnify().  
2478
2479         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
2480         this actually work.
2481
2482         * class.cs (MethodCore.MayUnify): Use
2483         TypeManager.MayBecomeEqualGenericTypes().       
2484
2485 2004-12-08  Martin Baulig  <martin@ximian.com>
2486
2487         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
2488         parameter, box it.  Fixes #69233.
2489
2490 2004-12-08  Martin Baulig  <martin@ximian.com>
2491
2492         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
2493         have the ctor constraint.  Fixes #68326.
2494
2495 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
2496
2497         * cs-parser.jay : interface comment was not consumed because of
2498           extra opt_semicolon before doc handling.
2499
2500 2004-12-03  Raja R Harinath  <rharinath@novell.com>
2501
2502         Fix test-327.cs, test-328.cs, and put in early infrastructure
2503         for eventually fixing #52697.
2504         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
2505         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
2506         from other methods.
2507         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
2508         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
2509         (VerifyUsing, error246): Update.
2510         * rootcontext.cs (RootContext.NamespaceLookup): Just use
2511         'NamespaceEntry.LookupNamespaceOrType'.
2512
2513 2004-12-07  Martin Baulig  <martin@ximian.com>
2514
2515         * driver.cs: Call it "BETA SOFTWARE" :-)
2516
2517 2004-12-06  Raja R Harinath  <rharinath@novell.com>
2518
2519         Fix crash on cs0657-17.cs.
2520         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
2521         Use RootContext.Tree.Types, not 'new RootTypes ()'.
2522         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
2523         the case where the NamespaceEntry gets overwritten.
2524
2525 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
2526
2527         Fixed #69195, #56821
2528         * ecore.cs (ResolveBoolean): Tiny refactoring.
2529
2530         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
2531         of right expression resolving when left is false constant and
2532         operator is LogicalAnd OR true constant and operator is LogicalOr.
2533
2534         * statement.cs (ResolveUnreachable): Always reports warning.
2535
2536 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
2537
2538         * class.cs: Distinguish between 1721 and 1722 (just a little help
2539         for the programmer).
2540
2541 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
2542
2543         * delegate.cs: Only allow this on new versions of the language. 
2544
2545 2004-12-02  Duncan Mak  <duncan@ximian.com>
2546
2547         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
2548         Expression class.
2549         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
2550         here as a static method. Take an additional bool out parameter
2551         `must_do_cs1540_check' for signaling to InstanceResolve.
2552         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
2553         member field from PropertyExpr class and made it an argument of
2554         the method instead.
2555         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
2556         check for MarshalByRefObject, and report CS0122 instead of CS1540.
2557         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
2558         and `remove_accessor' as well as InstanceResolve: report CS0122
2559         where applicable.
2560
2561         Fixes #70129.
2562
2563 2004-12-07  Martin Baulig  <martin@ximian.com>
2564
2565         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
2566         and CS0692 where appropriate.
2567
2568 2004-12-06  Martin Baulig  <martin@ximian.com>
2569
2570         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
2571         IsDuplicateImplementation() and improved it.
2572
2573         * expression.cs (Invocation.InferTypeArguments): Added
2574         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
2575         and removed the "ref" modifier from `infered_types'.
2576
2577         * decl.cs (MemberName.ToString): Removed the exception.
2578
2579 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
2580
2581         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
2582           comments are allowed.
2583
2584 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2585
2586         * delegate.cs: Add checks for subtypes in paramaters and return values
2587         in VerifyMethod () to add support for Covariance/Contravariance
2588         in delegates.
2589         
2590 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
2591
2592         * report.cs: Remove extra closing parenthesis.
2593
2594         * convert.cs (Error_CannotImplicitConversion): If the name of the
2595         types are the same, provide some extra information.
2596
2597 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
2598
2599         Fix bug #70102
2600         * attribute.cs (Resolve): Improved implementation of params
2601         attribute arguments.
2602
2603         * support.cs (ParameterData): Add HasParams to be faster.
2604
2605 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
2606
2607         all things are for /doc support:
2608
2609         * doc.cs: new file that supports XML documentation generation.
2610         * mcs.exe.sources: added doc.cs.
2611         * driver.cs:
2612           Handle /doc command line option.
2613           Report error 2006 instead of 5 for missing file name for /doc.
2614           Generate XML documentation when required, after type resolution.
2615         * cs-tokenizer.cs:
2616           Added support for picking up documentation (/// and /** ... */),
2617           including a new XmlCommentState enumeration.
2618         * cs-parser.jay:
2619           Added lines to fill Documentation element for field, constant,
2620           property, indexer, method, constructor, destructor, operator, event
2621           and class, struct, interface, delegate, enum.
2622           Added lines to warn incorrect comment.
2623         * rootcontext.cs :
2624           Added Documentation field (passed only when /doc was specified).
2625         * decl.cs:
2626           Added DocComment, DocCommentHeader, GenerateDocComment() and
2627           OnGenerateDocComment() and some supporting private members for
2628           /doc feature to MemberCore.
2629         * class.cs:
2630           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
2631         * delegate.cs:
2632           Added overriden DocCommentHeader.
2633         * enum.cs:
2634           Added overriden DocCommentHeader and GenerateDocComment().
2635
2636 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
2637
2638         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
2639         unwrapping the enumeration values, chain to
2640         DoConstantNumericPromotions again, so we can promote things to the
2641         fundamental types (takes care of enums that are bytes, sbytes).
2642
2643         Fixes bug #62054.
2644
2645 2004-12-01  Raja R Harinath  <rharinath@novell.com>
2646
2647         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
2648         Fix long-standing bug in type-lookup.  Use FindType instead of
2649         LookupType when ec.ResolvingTypeTree.
2650         (Attribute.ResolveType, Attribute.Resolve)
2651         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
2652         Update to changes.
2653         (Attributes.Search): Remove internal version.  Update.
2654         (Attributes.SearchMulti): Update.
2655         (Attributes.GetClsCompliantAttribute): Remove.
2656         (Attributes.GetIndexerNameAttribute): Remove.
2657         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
2658         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
2659         * class.cs (Indexer.Define): Likewise.
2660
2661 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
2662
2663         Fix bug #68790
2664         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
2665         MarshallByReference members access.
2666
2667         * expression.cs: Use CheckMarshallByRefAccess;
2668         Better error CS0197 message.
2669
2670         * report.cs: Print whole related error message.
2671
2672 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2673
2674         * class (GetClassBases): Better error 60 report.
2675         (EventProperty): Disabled warning 67 detection.
2676
2677 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2678
2679         Fix bug #60324
2680         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
2681
2682         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
2683         precise values.
2684
2685 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
2686
2687         Fix bug #49488
2688         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
2689
2690         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
2691
2692 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
2693
2694         * attribute.cs (Attribute.Resolve): Refine error reporting and
2695         report a cs0117 if the identifier does not exist, to distinguish
2696         from 0617 which is a miss-use of the actual identifier.
2697
2698         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
2699         between cs0070 and cs0079.
2700
2701         * class.cs (MemberBase.DoDefine): When reporting a wrong
2702         accessibility level, we use MethodCore to compare instead of
2703         Method (this was a regression in some refactoring effort).
2704
2705         So now we correctly report cs0056 again.
2706
2707         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
2708         testing the target_type (which was known to be object_type) and
2709         not the source type (which is anonymous_method).
2710
2711         Fixed reporting of error cs1660.
2712
2713         * expression.cs (UserCast.Source): Expose the underlying cast.
2714
2715         * statement.cs (Switch.SwitchGoverningType): Sort the list of
2716         allowed types to find a match to int32 first (most common).
2717
2718         In addition, it ignores any ImplicitUserConversions that did an
2719         internal implicit conversion (as the switch statement allows only
2720         one integral conversion to exist).
2721
2722         * class.cs (PartialContainer.Create): rename `name' to
2723         `member_name' for clarity.  Then replace the string calls with a
2724         call to MemberName.GetPartialName, as now using
2725         MemberName.ToString is an error (this is due to the side effects
2726         it had, that were fixed in the past).
2727
2728         This will restore the error reporting on a number of partial class
2729         errors that were missusing this (and getting an exception as a
2730         results, which is now just a plain textual warning, because
2731         yyparse debug output would crash otherwise).
2732
2733 2004-11-26  Raja R Harinath  <rharinath@novell.com>
2734
2735         * Makefile (PROGRAM_INSTALL_DIR): Remove.
2736
2737 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2738
2739         * rootcontext.cs (LookupType): Make sure to cache lookups that
2740         don't give us a negative result. This saves about 5% of corlib
2741         compilation time.
2742
2743 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2744
2745         * report.cs (AbstractMessage.Print): messages are sent to stderr
2746
2747         * class.cs (TypeContainer.GetClassBases): It is an error to have a
2748         non-interface in the list of interfaces (at this point, either
2749         parent was properly set, or a base class is being listed in the
2750         interfaces section).
2751
2752         This flags error 1722, and resolves the crash from bug 69259.
2753
2754 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
2755
2756         * statement.cs (Using.EmitExpressionFinally): make this work right
2757         for valuetypes. Fixes 69926.
2758
2759 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2760
2761         * const.cs (Const.ChangeType): Cope with the "0 literal can be
2762         converted to an enum" here, before we try to change the underlying
2763         type.  This code exists, but it is a different code path than the
2764         one used while encoding constants.
2765
2766         (ImplicitReferenceConversionExists): In addition, resynchronized
2767         the code here, so it matches the same code in
2768         ImplicitReferenceConversionExists for the `from any class-type S
2769         to any interface-type T'.       
2770
2771 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
2772
2773         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
2774
2775 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
2776
2777         * cs-parser.jay: Use verbosity accordingly. 
2778
2779 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2780
2781         * expression.cs (Unary.ResolveOperator): Do not report warning;
2782         AddressOf reads from variable.
2783         
2784         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
2785
2786 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
2787
2788         Fix bug #69462
2789
2790         * attribute.cs (Attributable): Removed CheckTargets.
2791         (Attributes.Emit): Explicit attribute targets are tested here.
2792
2793         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
2794         not enabled for interfaces.
2795
2796         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
2797         (GetAssemblyName): Ouch next bug there.
2798
2799 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2800
2801         * expression.cs: Error 275 added.
2802         
2803 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
2804
2805         Fix bug #69177 (Implemented decimal constant support)
2806
2807         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
2808         (BinaryFold): Add DecimalConstant.
2809
2810         * const.cs (Define): Decimal constant 
2811         (is not constant.
2812         (ChangeType): Add decimal type handling.
2813         (LookupConstantValue): Don't set value for decimal type but
2814         emit DecimalConstantAttribute. Needed for constant optimization.
2815
2816         * constant.cs (ToDecimal): New method.
2817         (ConvertToDecimal): New method.
2818         (IntConstant): Implemented ConvertToDecimal.
2819         (DecimalConstant.Emit): Emit optimized version for decimals in
2820         int range.
2821
2822         * expression.cs (ResolveOperator): Changed order of constant
2823         reduction to work correctly with native types which have
2824         overloaded operators.
2825         (ResolveMemberAccess): Extract constant value from attribute
2826         for decimal type.
2827
2828         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
2829
2830         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
2831         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
2832         (ChangeType): Decimal is special.
2833         (TypeToCoreType): Add decimal type.
2834
2835 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2836
2837         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
2838         decimal types.
2839
2840 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
2841
2842         * class.cs (EventField.ApplyAttributeBuilder): Fix error
2843         test cs1667-5.cs.
2844
2845 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2846
2847         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
2848
2849         * pending.cs (PendingImplementation): Grab only interfaces.
2850
2851 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
2852
2853         * statement.cs (ForeachHelperMethods): Add location member and
2854         error 202 detection.
2855
2856 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
2857
2858         * expression.cs (DoResolveBase): Fixed wrong warning for out
2859         variables.
2860
2861 2004-12-04  Martin Baulig  <martin@ximian.com>
2862
2863         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
2864         to check whether the conversion is ok.
2865
2866         * typemanager.cs (TypeManager.GetTypeArguments): Just return
2867         `Type.EmptyTypes' if we're not a generic TypeContainer.
2868
2869 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
2870
2871         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
2872         old bug: when converting from the null literal to a pointer,
2873         return an EmptyCast, not the NullLiteral.
2874
2875         This fixes #69921, the recent null_type changes probably made this
2876         bug more prominent.
2877
2878 2004-12-03  Martin Baulig  <martin@ximian.com>
2879
2880         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
2881         method as our child, call AnonymousMethod.Compatible() on it.
2882
2883 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
2884
2885         * class.cs (FieldBase): Use an unused bit field from the field to
2886         encode the `has_offset' property from the FieldMember.  This saves
2887         a couple of Ks on bootstrap compilation.
2888
2889         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
2890         method as our child, return the AnonymousMethod resolved
2891         expression.
2892
2893         * expression.cs (New.DoResolve): Allow return values from
2894         NewDelegate to also include AnonymousMethods.
2895
2896         Fixes #70150.
2897
2898 2004-11-29  Raja R Harinath  <rharinath@novell.com>
2899
2900         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
2901         cs1648 report.
2902         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
2903         System.Runtime.InteropServices._Exception, since it's a base
2904         interface of the core type System.Exception in the net_2_0 profile.
2905
2906 2004-11-27  Martin Baulig  <martin@ximian.com>
2907
2908         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
2909
2910 2004-11-26  Raja R Harinath  <rharinath@novell.com>
2911
2912         * Makefile: Convert to use executable.make.
2913         * gmcs.exe.sources: New.
2914
2915 2004-11-25  Martin Baulig  <martin@ximian.com>
2916
2917         * expression.cs (Invocation.InferType): Added support for byref types.
2918
2919 2004-11-25  Martin Baulig  <martin@ximian.com>
2920
2921         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
2922         in TypeManager.TypeToCoreType().
2923
2924 2004-11-25  Martin Baulig  <martin@ximian.com>
2925
2926         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
2927         "Dispose" method from the `current_type'.
2928         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
2929         DoDefineMembers() instead of using the MethodBuilder; this is
2930         required for generic iterators.
2931
2932         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
2933
2934 2004-11-24  Martin Baulig  <martin@ximian.com>
2935
2936         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
2937
2938 2004-11-20  Martin Baulig  <martin@ximian.com>
2939
2940         * expression.cs (Invocation.InferType): Correctly infer generic
2941         instances; see gen-103.cs.
2942         (Invocation.InferTypeArguments): If a generic method doesn't have
2943         any unbound type parameters, we don't need to infer anything.
2944
2945 2004-11-19  Raja R Harinath  <rharinath@novell.com>
2946
2947         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
2948
2949 2004-11-17  Raja R Harinath  <rharinath@novell.com>
2950
2951         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
2952         (TypeHandle.GetMemberCache): New.
2953         (TypeHandle.TypeHandle): Update.
2954         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
2955         (TypeManager.LookupParentInterfacesCache):
2956         Rename from LookupInterfaceCache.  Optimize slightly.
2957         (TypeManager.MemberLookup_FindMembers): Update.
2958         * decl.cs (MemberCache.MemberCache): Set Container to null in the
2959         multi-type variant.
2960         (AddCacheContents): Rename from AddHashtable.
2961         * class.cs (TypeContainer.parent_container): Remove.
2962         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
2963         (TypeContainer.DoDefineMembers): Don't initialize it.
2964         Update to name changes.
2965         
2966 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
2967
2968         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
2969         that factors the code to check access modifiers on override.  
2970
2971         (PropertyBase): Use the code here.
2972
2973         Patch from Lluis S'anchez, fixes bug #69361.
2974
2975 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
2976
2977         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
2978         routine that is used to report the use of a captured variable
2979         whose address has been taken.
2980
2981         There are two checks: one when variables are being captured and
2982         the other check is when the address of a variable is taken. 
2983         
2984         (because an anonymous methods might be resolved before *or* after
2985         the address has been taken) and 
2986
2987         * expression.cs (Conditional.DoResolve): Remove the special
2988         casing that Martin added to trueExpr and falseExpr being both
2989         NullLiteral.  We get the right behavior now just by introducing
2990         the null_type into the compiler. 
2991
2992         * convert.cs (ExplicitConversion): Change the code to use
2993         null_type instead of testing `expr is NullLiteral'.
2994         (ImplicitConversionStandard): use null_type too.
2995         (ImplicitReferenceConversionExists): use null_type too.
2996         (ImplicitReferenceConversion): use null_type too.
2997
2998         * literal.cs: The type of `NullLiteral' is now null_type instead
2999         of object_type. 
3000         (Resolve): Set the type here.
3001
3002         * typemanager.cs: Introduce null_type.
3003
3004 2004-11-18  Martin Baulig  <martin@ximian.com>
3005
3006         * rootcontext.cs
3007         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
3008
3009 2004-11-18  Martin Baulig  <martin@ximian.com>
3010
3011         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
3012
3013 2004-11-18  Martin Baulig  <martin@ximian.com>
3014
3015         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
3016         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
3017         call ResolveConstructedType() on it to resolve it without checking
3018         constraints.
3019         (Constraints.ResolveTypes): Check them here.
3020         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
3021         but don't check constraints.
3022         (ConstructedType.ResolveAsTypeTerminal): Override this and also
3023         check constraints here.
3024         (ConstructedType.ResolveConstructedType): New public method.  This
3025         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
3026         resolve ourselves without checking constraints.
3027
3028         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
3029
3030 2004-11-18  Martin Baulig  <martin@ximian.com>
3031
3032         * decl.cs
3033         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
3034
3035         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
3036
3037 2004-11-18  Martin Baulig  <martin@ximian.com>
3038
3039         * ecore.cs (TypeExpr.ResolveType): Removed.
3040         (Expression.ResolveAsTypeTerminal): We always return a fully
3041         resolved `TypeExpr', so we can just access its `Type'.
3042
3043         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
3044
3045 2004-11-17  Martin Baulig  <martin@ximian.com>
3046
3047         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
3048         sure we don't return any unresolved TypeExpr's.
3049         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
3050         a `TypeExpr'.
3051         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
3052
3053         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
3054         unresolved `ConstructedType's.
3055
3056 2004-11-17  Martin Baulig  <martin@ximian.com>
3057
3058         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
3059
3060 2004-11-17  Martin Baulig  <martin@ximian.com>
3061
3062         * ecore.cs
3063         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
3064
3065         * decl.cs (DeclSpace.ResolveType): Removed.
3066         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
3067
3068 2004-11-17  Martin Baulig  <martin@ximian.com>
3069
3070         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
3071         direction, like FindMembers() does.  Fixes #69546, testcase is in
3072         test-315.cs.    
3073
3074 2004-11-16  Martin Baulig  <martin@ximian.com>
3075
3076         This is based on a patch from Marek Safar, see bug #69082.
3077         Fixes bugs #63705 and #67130.
3078
3079         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
3080         method; create a MemberCache for an interface type and cache the
3081         result.
3082
3083         * decl.cs (IMemberContainer.ParentContainer): Removed.
3084         (IMemberContainer.ParentCache): New property.
3085         (MemberCache.SetupCacheForInterface): Removed.
3086         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
3087         to create a cache for an interface's "parent".
3088
3089         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
3090         interfaces too.
3091
3092 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
3093
3094         * statement.cs: Avoid adding bools to a hashtable.
3095
3096 2004-11-15  Martin Baulig  <martin@ximian.com>
3097
3098         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
3099
3100 2004-11-11  Martin Baulig  <martin@ximian.com>
3101
3102         * typemanager.cs (TypeManager.GetMethodName): New method.
3103
3104         * class.cs (MethodData.Define): Include the generic arity in the
3105         name of an explicit interface; also add it to the method name.
3106
3107         * pending.cs (PendingImplementation.InterfaceMethod): The method
3108         name now includes the generic arity.
3109
3110 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
3111
3112         * expression.cs (Invocation.OverloadResolve): Flag error if we are
3113         calling an unsafe method from a safe location.
3114
3115 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
3116
3117         Fix #69167
3118         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
3119
3120 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
3121
3122         * namespace.cs (VerifyUsing): use GetPartialName instead of
3123         ToString. 
3124
3125 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
3126
3127         * statement.cs (Return.Resolve): Fix regression in typo: if
3128         `in_exc', we have to request a NeedReturnLabel, this was a typo
3129         introduced in the anonymous method check-in.  Fixes #69131.
3130
3131         * Indexers were using the ShortName when defining themselves,
3132         causing a regression in the compiler bootstrap when applying the
3133         patch from 2004-11-02 (first part), now they use their full name
3134         and the bug is gone.
3135
3136 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
3137
3138         * driver.cs: Strip the path from the names of embedded resources. Fixes
3139         #68519.
3140
3141 2004-11-04  Raja R Harinath  <rharinath@novell.com>
3142
3143         Fix error message regression: cs0104-2.cs.
3144         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
3145         (AliasEntry.Resolve): Update.
3146         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
3147         'silent' flag.
3148         (RootContext.LookupType): Update.
3149
3150 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
3151
3152         * cs-parser.jay: Add support for handling accessor modifiers
3153         * class: Add support port accessor modifiers and error checking,
3154         define PropertyMethod.Define as virtual (not abstract anymore)
3155         * ecore.cs: Add checking for proeprties access with access modifiers
3156         * iterators.cs: Modify Accessor constructor call based in the modified
3157         constructor
3158 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
3159
3160         * expression.cs (StringConcat): Handle being called twice,
3161         as when we have a concat in a field init with more than two
3162         ctors in the class
3163
3164 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
3165
3166         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
3167         special case explicit implementations, we should always produce
3168         the .property or .event declaration.
3169         
3170         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
3171         since it will not return correct data if people use this
3172         unresolved in the presence of using statements (see test-313).
3173
3174         * class.cs (MethodData.Define): If we are an explicit interface
3175         implementation, set the method name to the full name of the
3176         interface plus the name of the method.  
3177
3178         Notice that using the method.MethodName.GetFullName() does not
3179         work, as it will only contain the name as declared on the source
3180         file (it can be a shorthand in the presence of using statements)
3181         and not the fully qualifed type name, for example:
3182
3183         using System;
3184
3185         class D : ICloneable {
3186                 object ICloneable.Clone ()  {
3187                 }
3188         }
3189
3190         Would produce a method called `ICloneable.Clone' instead of
3191         `System.ICloneable.Clone'.
3192
3193         * namespace.cs (Alias.Resolve): Use GetPartialName.
3194         
3195 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3196
3197         * cs-parser.jay: Add error 1055 report.
3198
3199 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
3200
3201         * assign.cs (Assign.DoResolve): Only do the transform of
3202         assignment into a New if the types are compatible, if not, fall
3203         through and let the implicit code deal with the errors and with
3204         the necessary conversions. 
3205
3206 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
3207
3208         * cs-parser.jay: Add error 1031 report.
3209
3210         * cs-tokenizer.cs: Add location for error 1038.
3211
3212 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * cs-parser.jay: Add error 1016 report.
3215
3216 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3217
3218         * cs-parser.jay: Add errors 1575,1611 report.
3219
3220 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3221
3222         * cs-parser.jay: Add error 1001 report.
3223
3224 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3225
3226         Fix #68850
3227         * attribute.cs (GetMarshal): Add method argument for
3228         caller identification.
3229
3230         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
3231         agument for GetMarshal and RuntimeMissingSupport.
3232
3233 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
3234
3235         * attribute.cs (ExtractSecurityPermissionSet): Removed
3236         TypeManager.code_access_permission_type.
3237
3238         * typemanager.cs: Removed TypeManager.code_access_permission_type.
3239
3240 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
3241
3242         * expression.cs (LocalVariableReference.DoResolveLValue): Check
3243         for obsolete use of a variable here.   Fixes regression on errors
3244         cs0619-25 and cs0619-26.
3245
3246 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
3247
3248         Fix #62358, implemented security attribute encoding.
3249
3250         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
3251         Tests permitted SecurityAction for assembly or other types.
3252         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
3253         data from SecurityPermissionAttribute to PermisionSet class.
3254
3255         * class.cs (ApplyAttributeBuilder): Added special handling
3256         for System.Security.Permissions.SecurityAttribute based types.
3257
3258         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
3259         special handling for System.Security.Permissions.SecurityAttribute
3260         based types.
3261
3262         * enum.cs (ApplyAttributeBuilder): Added special handling
3263         for System.Security.Permissions.SecurityAttribute based types.
3264
3265         * parameter.cs (ApplyAttributeBuilder): Added special handling
3266         for System.Security.Permissions.SecurityAttribute based types.
3267
3268         * rootcontext.cs: Next 2 core types.
3269
3270         * typemanager.cs (TypeManager.security_permission_attr_type):
3271         Built in type for the SecurityPermission Attribute.
3272         (code_access_permission_type): Build in type.
3273
3274 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
3275
3276         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
3277         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
3278         all of this information into
3279         EmitContext.EmitCapturedVariableInstance.
3280         
3281         * codegen.cs (EmitCapturedVariableInstance): move here the
3282         funcionality of emitting an ldarg.0 in the presence of a
3283         remapping.   This centralizes the instance emit code.
3284
3285         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
3286         then emit a load of this: it means that we have reached the
3287         topmost ScopeInfo: the one that contains the pointer to the
3288         instance of the class hosting the anonymous method.
3289
3290         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
3291         captures to the topmost CaptureContext.
3292
3293 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
3294
3295         * expression.cs (LocalVariableReference): Move the knowledge about
3296         the iterators into codegen's EmitCapturedVariableInstance.
3297
3298 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
3299
3300         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
3301         all code paths return a value from an anonymous method (it is the
3302         same as the 161 error, but for anonymous methods).
3303
3304 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
3305
3306         The introduction of anonymous methods in the compiler changed
3307         various ways of doing things in the compiler.  The most
3308         significant one is the hard split between the resolution phase
3309         and the emission phases of the compiler.
3310
3311         For instance, routines that referenced local variables no
3312         longer can safely create temporary variables during the
3313         resolution phase: they must do so from the emission phase,
3314         since the variable might have been "captured", hence access to
3315         it can not be done with the local-variable operations from the runtime.
3316         
3317         * statement.cs 
3318
3319         (Block.Flags): New flag `IsTopLevel' to indicate that this block
3320         is a toplevel block.
3321
3322         (ToplevelBlock): A new kind of Block, these are the blocks that
3323         are created by the parser for all toplevel method bodies.  These
3324         include methods, accessors and anonymous methods.
3325
3326         These contain some extra information not found in regular blocks:
3327         A pointer to an optional CaptureContext (for tracking captured
3328         local variables and parameters).  A pointer to the parent
3329         ToplevelBlock.
3330         
3331         (Return.Resolve): Catch missmatches when returning a value from an
3332         anonymous method (error 1662).
3333         Invoke NeedReturnLabel from the Resolve phase instead of the emit
3334         phase.
3335
3336         (Break.Resolve): ditto.
3337
3338         (SwitchLabel): instead of defining the labels during the
3339         resolution phase, we now turned the public ILLabel and ILLabelCode
3340         labels into methods called GetILLabelCode() and GetILLabel() that
3341         only define the label during the Emit phase.
3342
3343         (GotoCase): Track the SwitchLabel instead of the computed label
3344         (its contained therein).  Emit the code by using
3345         SwitchLabel.GetILLabelCode ().
3346
3347         (LocalInfo.Flags.Captured): A new flag has been introduce to track
3348         whether the Local has been captured or not.
3349
3350         (LocalInfo.IsCaptured): New property, used to tell whether the
3351         local has been captured.
3352         
3353         * anonymous.cs: Vastly updated to contain the anonymous method
3354         support.
3355
3356         The main classes here are: CaptureContext which tracks any
3357         captured information for a toplevel block and ScopeInfo used to
3358         track the activation frames for various local variables.   
3359
3360         Each toplevel block has an optional capture context associated
3361         with it.  When a method contains an anonymous method both the
3362         toplevel method and the anonymous method will create a capture
3363         context.   When variables or parameters are captured, they are
3364         recorded on the CaptureContext that owns them, for example:
3365
3366         void Demo () {
3367              int a;
3368              MyDelegate d = delegate {
3369                  a = 1;
3370              }
3371         }
3372
3373         Here `a' will be recorded as captured on the toplevel
3374         CapturedContext, the inner captured context will not have anything
3375         (it will only have data if local variables or parameters from it
3376         are captured in a nested anonymous method.
3377
3378         The ScopeInfo is used to track the activation frames for local
3379         variables, for example:
3380
3381         for (int i = 0; i < 10; i++)
3382                 for (int j = 0; j < 10; j++){
3383                    MyDelegate d = delegate {
3384                         call (i, j);
3385                    }
3386                 }
3387
3388         At runtime this captures a single captured variable `i', but it
3389         captures 10 different versions of the variable `j'.  The variable
3390         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
3391         recorded on a child.  
3392
3393         The toplevel ScopeInfo will also track information like the `this'
3394         pointer if instance variables were referenced (this is necessary
3395         as the anonymous method lives inside a nested class in the host
3396         type of the method). 
3397
3398         (AnonymousMethod): Expanded to track the Toplevel, implement
3399         `AnonymousMethod.Compatible' to tell whether an anonymous method
3400         can be converted to a target delegate type. 
3401
3402         The routine now also produces the anonymous method content
3403
3404         (AnonymousDelegate): A helper class that derives from
3405         DelegateCreation, this is used to generate the code necessary to
3406         produce the delegate for the anonymous method that was created. 
3407
3408         * assign.cs: API adjustments for new changes in
3409         Convert.ImplicitStandardConversionExists.
3410
3411         * class.cs: Adjustments to cope with the fact that now toplevel
3412         blocks are of type `ToplevelBlock'. 
3413
3414         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
3415         insteda of standard blocks.
3416
3417         Flag errors if params arguments are passed to anonymous methods.
3418
3419         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
3420         `CurrentAnonymousMethod' which points to the current Anonymous
3421         Method.  The variable points to the AnonymousMethod class that
3422         holds the code being compiled.  It is set in the new EmitContext
3423         created for the anonymous method.
3424
3425         (EmitContext.Phase): Introduce a variable and an enumeration to
3426         assist in enforcing some rules about when and where we are allowed
3427         to invoke certain methods (EmitContext.NeedsReturnLabel is the
3428         only one that enfonces this right now).
3429
3430         (EmitContext.HaveCaptureInfo): new helper method that returns
3431         whether we have a CapturedContext initialized.
3432
3433         (EmitContext.CaptureVariable): New method used to register that a
3434         LocalInfo must be flagged for capturing. 
3435
3436         (EmitContext.CapturedParameter): New method used to register that a
3437         parameters must be flagged for capturing. 
3438         
3439         (EmitContext.CapturedField): New method used to register that a
3440         field must be flagged for capturing. 
3441
3442         (EmitContext.HaveCapturedVariables,
3443         EmitContext.HaveCapturedFields): Return whether there are captured
3444         variables or fields. 
3445
3446         (EmitContext.EmitMethodHostInstance): This is used to emit the
3447         instance for the anonymous method.  The instance might be null
3448         (static methods), this (for anonymous methods that capture nothing
3449         and happen to live side-by-side with the current method body) or a
3450         more complicated expression if the method has a CaptureContext.
3451
3452         (EmitContext.EmitTopBlock): Routine that drives the emission of
3453         code: it will first resolve the top block, then emit any metadata
3454         and then emit the code.  The split is done so that we can extract
3455         any anonymous methods and flag any captured variables/parameters.
3456         
3457         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
3458         during this phase, the ILGenerator should not be used as labels
3459         and local variables declared here might not be accessible to any
3460         code that is part of an anonymous method.  
3461
3462         Exceptions to this include the temporary variables that are
3463         created by some statements internally for holding temporary
3464         variables. 
3465         
3466         (EmitContext.EmitMeta): New routine, in charge of emitting all the
3467         metadata for a cb
3468
3469         (EmitContext.TemporaryReturn): This method is typically called
3470         from the Emit phase, and its the only place where we allow the
3471         ReturnLabel to be defined other than the EmitMeta.  The reason is
3472         that otherwise we would have to duplicate a lot of logic in the
3473         Resolve phases of various methods that today is on the Emit
3474         phase. 
3475
3476         (EmitContext.NeedReturnLabel): This no longer creates the label,
3477         as the ILGenerator is not valid during the resolve phase.
3478
3479         (EmitContext.EmitThis): Extended the knowledge in this class to
3480         work in anonymous methods in addition to iterators. 
3481
3482         (EmitContext.EmitCapturedVariableInstance): This emits whatever
3483         code is necessary on the stack to access the instance to a local
3484         variable (the variable will be accessed as a field).
3485
3486         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
3487         EmitContext.EmitAddressOfParameter): Routines to support
3488         parameters (not completed at this point). 
3489         
3490         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
3491         will also remove the parameters.
3492
3493         * convert.cs (Convert): Define a `ConstantEC' which points to a
3494         null.  This is just to prefity some code that uses
3495         ImplicitStandardConversion code and do not have an EmitContext
3496         handy.
3497
3498         The idea is to flag explicitly that at that point in time, it is
3499         known that the conversion will not trigger the delegate checking
3500         code in implicit conversions (which requires a valid
3501         EmitContext). 
3502
3503         Everywhere: pass new EmitContext parameter since
3504         ImplicitStandardConversionExists now requires it to check for
3505         anonymous method conversions. 
3506
3507         (Convert.ImplicitStandardConversionExists): If the type of an
3508         expression is the anonymous_method_type, and the type is a
3509         delegate, we invoke the AnonymousMethod.Compatible method to check
3510         whether an implicit conversion is possible. 
3511
3512         (Convert.ImplicitConversionStandard): Only do implicit method
3513         group conversions if the language level is not ISO_1.
3514
3515         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
3516         MethodInfo for the Invoke method.  used by Delegate and
3517         AnonymousDelegate.
3518
3519         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
3520         method conversions if the target type is a delegate.
3521
3522         Removed extra debugging nops.
3523
3524         (LocalVariableReference): Turn the `local_info' into a public
3525         field. 
3526
3527         Add `prepared' field, the same hack used for FieldExprs to cope
3528         with composed assignments, as Local variables do not necessarily
3529         operate purely on the stack as they used to: they can be captured
3530         fields. 
3531
3532         Add `temp' for a temporary result, like fields.
3533
3534         Refactor DoResolve and DoResolveLValue into DoResolveBase.
3535
3536         It now copes with Local variables that are captured and emits the
3537         proper instance variable to load it from a field in the captured
3538         case. 
3539
3540         (ParameterReference.DoResolveBase): During the resolve phase,
3541         capture parameters if we are in an anonymous method.
3542
3543         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
3544         anonymous method, use the EmitContext helper routines to emit the
3545         parameter reference.
3546
3547         * iterators.cs: Set RemapToProxy to true/false during the
3548         EmitDispose class.
3549
3550         * parameters.cs (GetParameterByName): New helper method. 
3551
3552         * typemanager.cs (anonymous_method_type) a new type that
3553         represents an anonyous method.  This is always an internal type,
3554         used as a fencepost to test against the anonymous-methodness of an
3555         expression. 
3556         
3557 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
3558
3559         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
3560         561 report.
3561         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
3562
3563 2004-11-10  Martin Baulig  <martin@ximian.com>
3564
3565         * expression.cs (Invocation.BetterFunction): If two methods have
3566         equal parameter types, but only one of them is generic, the
3567         non-generic one wins.
3568         (New.DoResolve): Don't set `is_struct' to false if we're a generic
3569         instance; just use `Type.IsValueType' to determine whether
3570         something is a struct or not.
3571         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
3572         so we can be called multiple times.
3573
3574 2004-11-10  Martin Baulig  <martin@ximian.com>
3575
3576         * generic.cs (TypeParameter.DefineConstraints): New public method.
3577         (TypeParameter.CheckAccessLevel): Override this and return true.
3578         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
3579         override ResolveType() anymore.
3580         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
3581
3582 2004-11-10  Martin Baulig  <martin@ximian.com>
3583
3584         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
3585         call DeclSpace.ResolveNestedType() on it.
3586
3587 2004-11-10  Martin Baulig  <martin@ximian.com>
3588
3589         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
3590         non-null, call ParameterModifier() on it.
3591
3592 2004-11-10  Martin Baulig  <martin@ximian.com>
3593
3594         * iterators.cs
3595         (Iterators): Added `current_type' and `this_type' fields.
3596         (Iterators.DefineIterator): Create a new EmitContext and store it
3597         in `ec'; compute `this_type'.
3598
3599 2004-11-10  Martin Baulig  <martin@ximian.com>
3600
3601         * typemanager.cs
3602         (TypeManager.IsPrivateAccessible): New public method.
3603         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
3604
3605 2004-11-10  Martin Baulig  <martin@ximian.com>
3606
3607         * class.cs (TypeContainer.DefineType): Call
3608         TypeBuilder.DefineGenericParameters() before resolving the type
3609         parameters.
3610         (MethodData.parent_method): New protected field.
3611         (MethodData..ctor): Added `MethodInfo parent_method' argument.
3612         (MethodData.Define): Compute `parent_method'.
3613
3614         * decl.cs
3615         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
3616         (MemberCore.GetClsCompliantAttributeValue): Likewise.
3617         (DeclSpace.ec): New protected field; store the EmitContext here.
3618         (DeclSpace.EmitContext): New public property.
3619         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
3620         (DeclSpace.ResolveNestedType): New public method.
3621         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
3622         (DeclSpace.NestedAccessible): Added `Type tb' argument.
3623         (DeclSpace.FamilyAccessible): Likewise.
3624         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
3625         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
3626         EmitContext.
3627
3628         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
3629         field.
3630
3631         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
3632         (Enum.Emit): Don't create a new EmitContext.
3633
3634 2004-10-18  Martin Baulig  <martin@ximian.com>
3635
3636         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
3637         `Type' directly, but call ResolveType() on it.
3638         (Catch.Resolve): Likewise.
3639         (Foreach.Resolve): Likewise.
3640
3641 2004-10-18  Martin Baulig  <martin@ximian.com>
3642
3643         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
3644         `Type' directly, but call ResolveType() on it.
3645         (Probe.DoResolve): Likewise.
3646         (ArrayCreation.LookupType): Likewise.
3647         (TypeOf.DoResolve): Likewise.
3648         (SizeOf.DoResolve): Likewise.
3649
3650 2004-10-18  Raja R Harinath  <rharinath@novell.com>
3651
3652         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
3653         the ResolveType.
3654
3655 2004-10-17  John Luke  <john.luke@gmail.com>
3656
3657         * class.cs (Operator.GetSignatureForError): use CSharpName
3658
3659         * parameter.cs (Parameter.GetSignatureForError): Returns
3660         correct name even if was not defined.
3661
3662 2004-10-13  Raja R Harinath  <rharinath@novell.com>
3663
3664         Fix #65816.
3665         * class.cs (TypeContainer.EmitContext): New property.
3666         (DefineNestedTypes): Create an emitcontext for each part.
3667         (MethodCore.DoDefineParameters): Use container's emitcontext.
3668         Pass type array to InternalParameters.
3669         (MemberBase.DoDefine): Use container's emitcontext.
3670         (FieldMember.Define): Likewise.
3671         (Event.Define): Likewise.
3672         (SetMethod.GetParameterInfo): Change argument to EmitContext.
3673         Pass type array to InternalParameters.
3674         (SetIndexerMethod.GetParameterInfo): Likewise.
3675         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
3676         * delegate.cs (Define): Pass emitcontext to
3677         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
3678         array to InternalParameters.
3679         * expression.cs (ParameterReference.DoResolveBase): Pass
3680         emitcontext to GetParameterInfo.
3681         (ComposedCast.DoResolveAsTypeStep): Remove check on
3682         ec.ResolvingTypeTree.
3683         * parameter.cs (Parameter.Resolve): Change argument to
3684         EmitContext.  Use ResolveAsTypeTerminal.
3685         (Parameter.GetSignature): Change argument to EmitContext.
3686         (Parameters.ComputeSignature): Likewise.
3687         (Parameters.ComputeParameterTypes): Likewise.
3688         (Parameters.GetParameterInfo): Likewise.
3689         (Parameters.ComputeAndDefineParameterTypes): Likewise.
3690         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
3691         * support.cs (InternalParameters..ctor): Remove variant that takes
3692         a DeclSpace.
3693         * typemanager.cs (system_intptr_expr): New.
3694         (InitExpressionTypes): Initialize it.
3695
3696 2004-10-12  Chris Toshok  <toshok@ximian.com>
3697
3698         * cs-parser.jay: fix location for try_statement and catch_clause.
3699
3700 2004-10-18  Martin Baulig  <martin@ximian.com>
3701
3702         * class.cs (FieldMember.Define): Don't access the TypeExpr's
3703         `Type' directly, but call ResolveType() on it.
3704         (MemberBase.DoDefine): Likewise.
3705
3706         * expression.cs (New.DoResolve): Don't access the TypeExpr's
3707         `Type' directly, but call ResolveType() on it.
3708         (ComposedCast.DoResolveAsTypeStep): Likewise.
3709
3710         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
3711         `Type' directly, but call ResolveType() on it.
3712
3713 2004-10-17  John Luke  <john.luke@gmail.com>
3714
3715         * class.cs (Operator.GetSignatureForError): use CSharpName
3716
3717         * parameter.cs (Parameter.GetSignatureForError): Returns
3718         correct name even if was not defined.
3719
3720 2004-10-13  Raja R Harinath  <rharinath@novell.com>
3721
3722         Fix #65816.
3723         * class.cs (TypeContainer.EmitContext): New property.
3724         (DefineNestedTypes): Create an emitcontext for each part.
3725         (MethodCore.DoDefineParameters): Use container's emitcontext.
3726         Pass type array to InternalParameters.
3727         (MemberBase.DoDefine): Use container's emitcontext.
3728         (FieldMember.Define): Likewise.
3729         (Event.Define): Likewise.
3730         (SetMethod.GetParameterInfo): Change argument to EmitContext.
3731         Pass type array to InternalParameters.
3732         (SetIndexerMethod.GetParameterInfo): Likewise.
3733         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
3734         * delegate.cs (Define): Pass emitcontext to
3735         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
3736         array to InternalParameters.
3737         * expression.cs (ParameterReference.DoResolveBase): Pass
3738         emitcontext to GetParameterInfo.
3739         (ComposedCast.DoResolveAsTypeStep): Remove check on
3740         ec.ResolvingTypeTree.
3741         * parameter.cs (Parameter.Resolve): Change argument to
3742         EmitContext.  Use ResolveAsTypeTerminal.
3743         (Parameter.GetSignature): Change argument to EmitContext.
3744         (Parameters.ComputeSignature): Likewise.
3745         (Parameters.ComputeParameterTypes): Likewise.
3746         (Parameters.GetParameterInfo): Likewise.
3747         (Parameters.ComputeAndDefineParameterTypes): Likewise.
3748         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
3749         * support.cs (InternalParameters..ctor): Remove variant that takes
3750         a DeclSpace.
3751         * typemanager.cs (system_intptr_expr): New.
3752         (InitExpressionTypes): Initialize it.
3753
3754 2004-10-12  Chris Toshok  <toshok@ximian.com>
3755
3756         * cs-parser.jay: fix location for try_statement and catch_clause.
3757
3758 2004-10-07  Raja R Harinath  <rharinath@novell.com>
3759
3760         More DeclSpace.ResolveType avoidance.
3761         * decl.cs (MemberCore.InUnsafe): New property.
3762         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
3763         with newly created EmitContext.
3764         (FieldMember.Define): Likewise.
3765         * delegate.cs (Delegate.Define): Likewise.
3766         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
3767         only if normal name-lookup fails.
3768         (TypeExpr.DoResolve): Enable error-checking.
3769         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
3770         (SizeOf.DoResolve): Likewise.
3771         (ComposedCast.DoResolveAsTypeStep): Likewise.
3772         (StackAlloc.DoResolve): Likewise.
3773         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
3774         (Block.Unsafe): New property.
3775         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
3776         (Unsafe): Set 'unsafe' flag of contained block.
3777         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
3778         (Fixed.Resolve): Likewise.
3779         (Catch.Resolve): Likewise.
3780         (Using.ResolveLocalVariableDecls): Likewise.
3781         (Foreach.Resolve): Likewise.
3782
3783 2004-10-05  John Luke <john.luke@gmail.com>
3784
3785         * cs-parser.jay: add location to error CS0175
3786
3787 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
3788
3789         * ecore.cs (Expression.Constantity): Add support for turning null
3790         into a constant.
3791
3792         * const.cs (Const.Define): Allow constants to be reference types
3793         as long as the value is Null.
3794
3795 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
3796
3797         * namespace.cs (NamespaceEntry.Using): No matter which warning
3798         level is set, check if this namespace name has already been added.
3799
3800 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
3801
3802         * expression.cs: reftype [!=]= null should always use br[true,false].
3803         # 67410
3804
3805 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
3806
3807         Fix #67108
3808         * attribute.cs: Enum conversion moved to 
3809         GetAttributeArgumentExpression to be applied to the all
3810         expressions.
3811
3812 2004-10-01  Raja R Harinath  <rharinath@novell.com>
3813
3814         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
3815         * class.c (TypeContainer.DefineType): Flag error if
3816         base types aren't accessible due to access permissions.
3817         * decl.cs (DeclSpace.ResolveType): Move logic to
3818         Expression.ResolveAsTypeTerminal.
3819         (DeclSpace.ResolveTypeExpr): Thin layer over
3820         Expression.ResolveAsTypeTerminal.
3821         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
3822         Refactor code into NestedAccess.  Use it.
3823         (DeclSpace.NestedAccess): New.
3824         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
3825         argument to silence errors.  Check access permissions.
3826         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
3827         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
3828         (Cast.DoResolve): Likewise.
3829         (New.DoResolve): Likewise.
3830         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
3831         (TypeOf.DoResolve): Likewise.
3832
3833         * expression.cs (Invocation.BetterConversion): Return the Type of
3834         the better conversion.  Implement section 14.4.2.3 more faithfully.
3835         (Invocation.BetterFunction): Make boolean.  Make correspondence to
3836         section 14.4.2.2 explicit.
3837         (Invocation.OverloadResolve): Update.
3838         (Invocation): Remove is_base field.
3839         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
3840         (Invocation.Emit): Likewise.
3841
3842 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
3843
3844         * cs-parser.jay: Reverted 642 warning fix.
3845
3846 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3847
3848         Fix bug #66615
3849         * decl.cs (FindMemberWithSameName): Indexer can have more than
3850         1 argument.
3851
3852 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3853
3854         * expression.cs (LocalVariableReference.DoResolveLValue):
3855         Do not report warning 219 for out values.
3856         (EmptyExpression.Null): New member to avoid extra allocations.
3857
3858 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3859
3860         * cs-parser.jay: Fix wrong warning 642 report.
3861
3862         * cs-tokenizer.cs (CheckNextToken): New helper;
3863         Inspect next character if is same as expected.
3864
3865 2004-09-23  Martin Baulig  <martin@ximian.com>
3866
3867         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
3868         (Convert.ImplicitReferenceConversionExists): Likewise.
3869
3870 2004-11-09  Raja R Harinath  <rharinath@novell.com>
3871
3872         * Makefile (DISTFILES): Comment out a few missing files.
3873
3874 2004-10-29  Raja R Harinath  <rharinath@novell.com>
3875
3876         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
3877         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
3878         (gmcs.exe): Invoke bootstrap-libs.
3879         (clean-local): Clean the net_2_0_bootstrap profile too.
3880         (PROGRAM_INSTALL_DIR): New.
3881         (install-local): Use it.
3882
3883 2004-10-13  Martin Baulig  <martin@ximian.com>
3884
3885         * generic.cs (TypeManager.InflatedConstraints): New nested class.
3886         (TypeParameter.DefineType): If we're a method type parameter and
3887         that method is overriding something, "inflate" its constraints.
3888
3889 2004-10-12  Martin Baulig  <martin@ximian.com>
3890
3891         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
3892         and have type arguments, create and resolve a ConstructedType.
3893
3894 2004-10-12  Martin Baulig  <martin@ximian.com>
3895
3896         * decl.cs (MemberCache.FindMemberToOverride): Use
3897         TypeManager.IsEqual() to compare the parameters and Type.Equals()
3898         to compare the invocationType.
3899
3900         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
3901         When comparing two type parameters, only do the signature-only
3902         comparision for method type parameters.
3903
3904 2004-10-11  Martin Baulig  <martin@ximian.com>
3905
3906         * report.cs: Don't make --fatal abort on warnings, we have
3907         -warnaserror for that.
3908
3909 2004-10-11  Martin Baulig  <martin@ximian.com>
3910
3911         * typemanager.cs
3912         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
3913         (TypeManager.IsEqual): Call ourself recursively instead of using
3914         Type.IsEqual(). 
3915
3916 2004-10-11  Martin Baulig  <martin@ximian.com>
3917
3918         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
3919         on our own type parameters, not on the ones we inherit from a containing
3920         class.
3921
3922         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
3923         the comparision.
3924
3925         * generic.cs (TypeParameter.Define): We may only be called once.
3926
3927         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
3928         instead of TypeManager.IsEqual().
3929
3930 2004-09-28  Martin Baulig  <martin@ximian.com>
3931
3932         * generic.cs
3933         (GenericConstraints.EffectiveBaseClass): New public property.
3934         (TypeParameter.GenericConstraints): New public property.
3935         (ConstructedType.CheckConstraints): Improved.
3936
3937         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
3938         (Convert.TypeParameterConversion): New private method; use this in
3939         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
3940         for all conversions related to type parameters.
3941
3942 2004-09-24  Martin Baulig  <martin@ximian.com>
3943
3944         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
3945         type parameter conversions for type parameters which are known to
3946         be reference types.
3947
3948 2004-09-24  Martin Baulig  <martin@ximian.com>
3949
3950         * generic.cs (GenericConstraints): Added `IsReferenceType' and
3951         `IsValueType' properties.
3952
3953         * support.cs (ReflectionConstraints): Use
3954         Type.GetGenericParameterConstraints() instead of the old hack.
3955
3956 2004-09-24  Martin Baulig  <martin@ximian.com>
3957
3958         * generic.cs (GenericConstraints): Moved here and made it an
3959         abstract class.
3960
3961         * support.cs (GenericConstraints): Moved to generic.cs.
3962
3963 2004-09-24  Martin Baulig  <martin@ximian.com>
3964
3965         * support.cs
3966         (ReflectionConstraints): Un-nested this class and made it public.
3967
3968         * typemanager.cs
3969         (TypeManager.GetTypeParameterConstraints): New public method.
3970         (TypeManager.HasConstructorConstraint): Use the attributes.
3971
3972 2004-09-24  Martin Baulig  <martin@ximian.com>
3973
3974         * support.cs (GenericConstraints): Replaced `HasConstructor',
3975         `IsReferenceType' and `IsValueType' with `Attributes'.
3976         (ReflectionParameters.ReflectionConstraints): Removed the Create()
3977         method and made the .ctor public.
3978
3979         * generic.cs (Constraints.Attributes): New public property.
3980         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
3981         `IsReferenceType' -> `HasReferenceTypeConstraint' and
3982         `IsValueType' -> `HasValueTypeConstraint'.
3983
3984 2004-09-23  Martin Baulig  <martin@ximian.com>
3985
3986         * generic.cs (Constraints): Reflect latest runtime changes.
3987
3988 2004-09-23  Martin Baulig  <martin@ximian.com>
3989
3990         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
3991         (Convert.ImplicitReferenceConversionExists): Likewise.
3992
3993 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
3994
3995         * class.cs (Operator.Define): Add error 448 and 559 report.
3996         
3997 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
3998
3999         * class.cs (MemberBase.IsTypePermitted): New protected
4000         method for checking error CS0610.
4001
4002 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4003
4004         * class.cs (TypeContainer.HasExplicitLayout): New property
4005         Returns whether container has StructLayout attribute set Explicit.
4006         (FieldMember): New abstract class for consts and fields.
4007         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
4008         (Field): Reuse FieldMember.
4009
4010         * const.cs (Const): Reuse FieldMember.
4011
4012         * rootcontext.cs: EmitConstants call moved to class.
4013
4014 2004-09-22  Martin Baulig  <martin@ximian.com>
4015
4016         Marek and me just fixed one of our oldest bugs: #28562 :-)
4017
4018         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
4019
4020         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
4021         we're an EnumConstant, just return that.
4022         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
4023         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
4024         to get the value which'll actually be written into the attribute.
4025         However, we have to use GetValue() to access the attribute's value
4026         in the compiler.        
4027
4028 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
4029
4030         * constant.cs (Constant.IsNegative): New abstract property
4031         IsNegative.
4032
4033         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
4034         (StackAlloc.DoResolve): Reused IsNegative.
4035
4036 2004-09-22  Martin Baulig  <martin@ximian.com>
4037
4038         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
4039         public method; like LookupTypeContainer, but also works for
4040         generic instances.
4041
4042         * report.cs (Report.SymbolRelatedToPreviousError): Use
4043         TypeManager.LookupGenericTypeContainer().       
4044
4045 2004-09-22  Martin Baulig  <martin@ximian.com>
4046
4047         Thanks to Peter Sestoft for this bug report.
4048
4049         * expression.cs (Conditional): If both the `trueExpr' and the
4050         `falseExpr' is a NullLiteral, return a NullLiteral.
4051
4052 2004-09-22  Martin Baulig  <martin@ximian.com>
4053
4054         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
4055         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
4056         for the "get_Current" call.
4057
4058 2004-09-21  Martin Baulig  <martin@ximian.com>
4059
4060         * convert.cs (Convert.ImplicitReferenceConversion): When
4061         converting to an interface type, first check whether we're
4062         converting from a reference type.
4063
4064 2004-09-14  Martin Baulig  <martin@ximian.com>
4065
4066         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
4067
4068 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
4069
4070         Fixed bug #61902
4071         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
4072         called and is obsolete then this member suppress message
4073         when call is inside next [Obsolete] method or type.
4074
4075         * expression.cs: Use TestObsoleteMethodUsage member.
4076
4077 2004-09-14  Martin Baulig  <martin@ximian.com>
4078
4079         * genericparser.cs: Removed.
4080
4081 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
4082
4083         * class.cs (MethodCore.CheckBase): Fix bug #65757.
4084
4085 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
4086
4087         * attribute.cs (Attribute.Resolve): Add error 653 report.
4088
4089         * class.cs (Class.ApplyAttributeBuilder): Add error 641
4090         report.
4091         (Method.ApplyAttributeBuilder): Add error 685 report.
4092         (Operator.Define): Add error 564 report.
4093
4094         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
4095
4096         * expression.cs (Invocation.DoResolve): Add error
4097         245 and 250 report.
4098
4099         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
4100         error 674 report.
4101
4102 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4103
4104         * class.cs (ConstructorInitializer.Resolve):
4105         Wrong error number (515->516).
4106
4107 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4108
4109         * class.cs (Indexer.Define): Add error 631 report.
4110
4111 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4112
4113         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
4114
4115 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
4116
4117         * expression.cs (Probe.DoResolve): Add error CS0241 report.
4118
4119 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
4120
4121         * cs-parser.jay: Added error CS0241 report.
4122
4123 2004-09-10  Raja R Harinath  <rharinath@novell.com>
4124
4125         * cs-parser.jay (fixed_statement): Introduce a scope for the
4126         declaration in the 'fixed' statement.
4127
4128 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4129
4130         * cs-parser.jay: Added CS0230 error report.
4131
4132 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4133
4134         * cs-parser.jay: Added errors CS0231 and CS0257 report.
4135
4136 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4137
4138         * expression.cs (Argument.Resolve): Added error CS0192 and
4139         CS0199 report.
4140
4141 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
4142
4143         C# 2.0 #pragma warning feature
4144
4145         * cs-tokenizer.cs (PreProcessPragma): New method; 
4146         Handles #pragma directive.
4147
4148         * report.cs (WarningRegions): New class; Support
4149         class for #pragma warning directive. It tests whether
4150         warning is enabled for a given line.
4151
4152 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
4153
4154         * const.cs: Add more descriptive error report, tahnks to
4155         Sebastien. 
4156
4157 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
4158
4159         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
4160
4161 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
4162
4163         * expression.cs: Apply patch from Ben: Remove dead code from
4164         ArrayCreation, and remove the TurnintoConstant call in const.cs,
4165         as that code just threw an exception anwyays.
4166
4167         * const.cs: Remove the call to the turnintoconstant, for details
4168         see bug: #63144
4169         
4170         * literal.cs: The type of the null-literal is the null type;  So
4171         we use a placeholder type (literal.cs:System.Null, defined here)
4172         for it.
4173
4174         * expression.cs (Conditional.DoResolve): Remove some old code that
4175         is no longer needed, conversions have been fixed.
4176
4177         (ArrayCreationExpression.DoResolve): Return false if we fail to
4178         resolve the inner expression.
4179
4180 2004-09-07  Raja R Harinath  <rharinath@novell.com>
4181
4182         Fix test-290.cs.
4183         * cs-parser.jay (delegate_declaration): Record a delegate
4184         declaration as a type declaration.
4185         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
4186
4187 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
4188
4189         * parameter.cs: Do not crash if the type can not be resolved. 
4190
4191         * expression.cs: Report errors with unsafe pointers, fixes #64896
4192
4193 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
4194
4195         * expression.cs: Pointer arith always needs to do a conv.i
4196         if the operand is a long. fix 65320
4197
4198 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4199
4200         Fixed cs0619-37.cs, cs0619-38.cs
4201
4202         * enum.cs (GetObsoleteAttribute): Removed.
4203
4204         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
4205         on Enum member is double staged. The first is tested member
4206         and then enum.
4207
4208 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
4209
4210         Fixed #56986, #63631, #65231
4211
4212         * class.cs: (TypeContainer.AddToMemberContainer): New method,
4213         adds member to name container.
4214         (TypeContainer.AddToTypeContainer): New method, adds type to
4215         name container.
4216         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
4217         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
4218         AddOperator): Simplified by reusing AddToMemberContainer.
4219         (TypeContainer.UserDefinedStaticConstructor): Changed to property
4220         instead of field.
4221         (Method.CheckForDuplications): Fixed implementation to test all
4222         possibilities.
4223         (MemberBase): Detection whether member is explicit interface
4224         implementation is now in constructor.
4225         (MemberBase.UpdateMemberName): Handles IndexerName.
4226         (Accessor): Changed to keep also location information.
4227         (AbstractPropertyEventMethod): Is derived from MemberCore.
4228         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
4229         will be emited or not.
4230         (PropertyBase.AreAccessorsDuplicateImplementation):
4231         Tests whether accessors are not in collision with some method.
4232         (Operator): Is derived from MethodCore to simplify common
4233         operations.
4234
4235         * decl.cs (Flags.TestMethodDuplication): Test for duplication
4236         must be performed.
4237         (DeclSpace.AddToContainer): Adds the member to defined_names
4238         table. It tests for duplications and enclosing name conflicts.
4239
4240         * enum.cs (EnumMember): Clean up to reuse the base structures
4241
4242 2004-09-03  Martin Baulig  <martin@ximian.com>
4243
4244         Merged latest changes into gmcs.  Please keep this comment in
4245         here, it makes it easier for me to see what changed in MCS since
4246         the last time I merged.
4247
4248 2004-09-03  Martin Baulig  <martin@ximian.com>
4249
4250         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4251         into TypeContainer, to make partial classes work again.
4252
4253 2004-09-03  Martin Baulig  <martin@ximian.com>
4254
4255         * rootcontext.cs (RootContext.V2): Removed.
4256
4257 2004-03-23  Martin Baulig  <martin@ximian.com>
4258
4259         * expression.cs (Invocation.OverloadResolve): Added `bool
4260         may_fail' argument and use it instead of the Location.IsNull() hack.
4261
4262 2004-09-09  Martin Baulig  <martin@ximian.com>
4263
4264         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
4265
4266 2004-09-09  Martin Baulig  <martin@ximian.com>
4267
4268         * generic.cs (TypeParameter.DefineType): Added support for
4269         explicit interface methods.
4270
4271 2004-09-09  Martin Baulig  <martin@ximian.com>
4272
4273         * README.Changes: New document.  Started to list important changes
4274         between MCS and GMCS here.
4275
4276 2004-09-08  Martin Baulig  <martin@ximian.com>
4277
4278         * class.cs
4279         (TypeContainer.CheckRecursiveDefinition): New protected method.
4280         (TypeContainer.DefineType): Move the CS0146 check into
4281         CheckRecursiveDefinition().     
4282
4283 2004-09-06  Martin Baulig  <martin@ximian.com>
4284
4285         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
4286         types for the constructor constraint.
4287
4288 2004-09-03  Martin Baulig  <martin@ximian.com>
4289
4290         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
4291         into TypeContainer, to make partial classes work again.
4292
4293 2004-09-03  Martin Baulig  <martin@ximian.com>
4294
4295         * rootcontext.cs (RootContext.V2): Removed.
4296
4297 2004-03-23  Martin Baulig  <martin@ximian.com>
4298
4299         * expression.cs (Invocation.OverloadResolve): Added `bool
4300         may_fail' argument and use it instead of the Location.IsNull() hack.
4301
4302 2004-09-03  Martin Baulig  <martin@ximian.com>
4303
4304         Merged latest changes into gmcs.  Please keep this comment in
4305         here, it makes it easier for me to see what changed in MCS since
4306         the last time I merged.
4307
4308 2004-09-03  Raja R Harinath  <rharinath@novell.com>
4309
4310         Fix #61128.
4311         * expression.cs (BetterConversion): Don't allow either conversion 
4312         to be null.  Remove redundant implicit conversion test when 'q ==
4313         null' -- when this function is invoked, we already know that the
4314         implicit conversion exists.
4315         (BetterFunction): Assume that 'best' is non-null.  Remove
4316         redundant reimplementation of IsApplicable when 'best' is null.
4317         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
4318         number of arguments.
4319         (IsAncestralType): Extract from OverloadResolve.
4320         (OverloadResolve): Make robust to the MethodGroupExpr being
4321         unsorted.  Implement all the logic of Section 14.5.5.1, and
4322         support overloading of methods from multiple applicable types.
4323         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
4324
4325         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
4326         (RealError, Warning): Append type of report to related symbol.
4327
4328 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
4329
4330         * enum.cs: Fixed CLS-Compliance checks for enum members.
4331         Error tests cs3008-8.cs, cs3014-8.cs
4332
4333 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4334
4335         Fixed bug #62342, #63102
4336         * class.cs: ImplementIndexer uses member.IsExplicitImpl
4337         like ImplementMethod.
4338
4339 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
4340
4341         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4342         Fixed bug #65170.
4343
4344 2004-09-02  Martin Baulig  <martin@ximian.com>
4345
4346         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4347         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4348         on the MethodBase.
4349
4350 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
4351
4352         C# 2.0 Static classes implemented
4353
4354         * class.cs (TypeContainer): instance_constructors,
4355         initialized_fields, initialized_static_fields,
4356         default_constructor, base_inteface_types are protected to be
4357         accessible from StaticClass.
4358         (TypeContainer.DefineDefaultConstructor): New virtual method
4359         for custom default constructor generating
4360         (StaticClass): New class to handle "Static classes" feature.
4361
4362         * cs-parser.jay: Handle static keyword on class like instance
4363         of StaticClass.
4364
4365         * driver.cs: Added "/langversion" command line switch with two
4366         options (iso-1, default).
4367
4368 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
4369
4370         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
4371
4372 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
4373
4374         * delegate.cs: Style.
4375
4376 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
4377
4378         * delegate.cs: Add seperate instance expr field for miguel.
4379
4380 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4381
4382         * PointerArithmetic (Resolve): make sure we are not doing
4383         pointer arith on void*. Also, make sure we are resolved
4384         by not setting eclass until resolve.
4385
4386         All callers: Make sure that PointerArithmetic gets resolved.
4387
4388 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4389
4390         * ArrayCreation (LookupType): If the type does not resolve 
4391         to an array, give an error.
4392
4393 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
4394
4395         * statement.cs (Try.Resolve): Fixed bug #64222
4396
4397 2004-08-27  Martin Baulig  <martin@ximian.com>
4398
4399         * class.cs
4400         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4401         crash here.     
4402
4403 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4404
4405         * ecore.cs (Constantify): Get underlying type via
4406         System.Enum.GetUnderlyingType to avoid StackOverflow on the
4407         Windows in special cases.
4408
4409 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
4410
4411         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
4412         for obtaining also private methods.
4413         (GetRemoveMethod): Used GetRemoveMethod (true)
4414         for obtaining also private methods.
4415
4416 2004-09-02  Martin Baulig  <martin@ximian.com>
4417
4418         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
4419         TypeManager.GetArgumentTypes() rather than calling GetParameters()
4420         on the MethodBase.
4421
4422 2004-08-27  Martin Baulig  <martin@ximian.com>
4423
4424         * class.cs
4425         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
4426         crash here.     
4427
4428 2004-08-25  Martin Baulig  <martin@ximian.com>
4429
4430         * support.cs (ReflectionParameters..ctor): If this is a generic
4431         method, retrieve and store its type parameters.
4432         (InternalParameters..ctor): Added `TypeParameter[]' argument.
4433         (ReflectionParameters.GenericConstraints): The argument specifies
4434         the type parameter, not the method parameter.
4435         (InternalParameters.GenericConstraints): Likewise.
4436
4437         * generic.cs (TypeParameter.DefineType): Correctly handle
4438         constraints wrt. generic methods in interfaces and their
4439         implementations.        
4440
4441 2004-08-24  Martin Baulig  <martin@ximian.com>
4442
4443         * generic.cs (TypeParameter.IsSubclassOf): New public method.
4444         (Constraints.IsSubclassOf): New internal method.
4445
4446         * typemanager.cs (TypeManager.FindMembers): Added special support
4447         for GenericTypeParameterBuilder's.      
4448         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
4449         type parameters.
4450
4451 2004-08-24  Martin Baulig  <martin@ximian.com>
4452
4453         * typemanager.cs
4454         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
4455         this for accessibility checks.
4456         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
4457         IsNestedFamilyAccessible.
4458         (TypeManager.IsSubclassOf): New method, do what the name actually
4459         says.   
4460
4461 2004-08-24  Martin Baulig  <martin@ximian.com>
4462
4463         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
4464         as a SimpleName, include the generic arity.
4465
4466 2004-08-24  Martin Baulig  <martin@ximian.com>
4467
4468         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
4469         MethodAttributes.HideBySig for operators.
4470
4471 2004-08-23  Martin Baulig  <martin@ximian.com>
4472
4473         Back to the old error reporting system :-)
4474
4475         * report.cs (Message): Removed.
4476         (Report.MessageData, ErrorData, WarningData): Removed.
4477         (Report.Error, Warning): Back to the old system.
4478
4479 2004-08-23  Martin Baulig  <martin@ximian.com>
4480
4481         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
4482
4483         * class.cs (TypeContainer.ParentContainer): New public virtual
4484         method; replaces the explicit interface implementation.
4485         (ClassPart.ParentContainer): Override.
4486
4487 2004-08-23  Martin Baulig  <martin@ximian.com>
4488
4489         * statement.cs (Switch): Added support for constant switches; see
4490         #59428 or test-285.cs.
4491
4492 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4493
4494         Fixed bug #62740.
4495         * statement.cs (GetEnumeratorFilter): Removed useless
4496         logic because C# specs is strict. GetEnumerator must be
4497         public.
4498
4499 2004-08-22  Martin Baulig  <martin@ximian.com>
4500
4501         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4502         a switch and may break, reset the barrier.  Fixes #59867.
4503
4504 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
4505
4506         CLS-Compliance speed up (~5% for corlib)
4507
4508         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
4509         New method. Tests container for CLS-Compliant names
4510
4511         * class.cs (TypeContainer.VerifyClsName): New method.
4512         Checks whether container name is CLS Compliant.
4513         (Constructor): Implements IMethodData.
4514
4515         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
4516         low-case table for CLS Compliance test.
4517         (MemberCache.VerifyClsParameterConflict): New method.
4518         Checks method parameters for CS3006 error.
4519
4520         * enum.cs (EnumMember): Is derived from MemberCore.
4521         (Enum.VerifyClsName): Optimized for better performance.
4522
4523 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4524
4525         * report.cs: Renamed Error_T to Error and changed all
4526         references.
4527
4528 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
4529
4530         * class.cs (TypeContainer.IndexerArrayList): New inner class
4531         container for indexers.
4532         (TypeContainer.DefaultIndexerName): New constant for default
4533         indexer name. Replaced all "Item" with this constant.
4534         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
4535
4536         * typemanager.cs (TypeManager.default_member_ctor): Cache here
4537         DefaultMemberAttribute constructor.
4538
4539 2004-08-05  Martin Baulig  <martin@ximian.com>
4540
4541         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4542         Fix bug #59429.
4543
4544 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
4545
4546         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
4547         multi platforms problem.
4548
4549         * compiler.csproj: Included shared files.
4550
4551 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4552
4553         Fix bug 60333, 55971 in the more general way
4554         * attribute.cs (Attribute.GetAttributeArgumentExpression):
4555         Added arg_type argument for constant conversion.
4556         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
4557
4558 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4559
4560         Fix bug #59760
4561         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
4562         OperatorArrayList, MethodCoreArrayList for typecontainer
4563         containers. Changed class member types to these new types.
4564         (MethodArrayList.DefineMembers): Added test for CS0659.
4565
4566 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
4567
4568         * cfold.cs: Synchronize the folding with the code in expression.cs
4569         Binary.DoNumericPromotions for uint operands.
4570
4571         * attribute.cs: Revert patch from Raja, it introduced a regression
4572         while building Blam-1.2.1 (hard to isolate a test case).
4573
4574 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
4575
4576         Fix for #55382
4577         * class.cs:
4578         (TypeContainer.Define): Renamed to DefineContainerMembers because of
4579         name collision.
4580         (MethodCore.parent_method): New member. The method we're overriding
4581         if this is an override method.
4582         (MethodCore.CheckBase): Moved from Method class and made common.
4583         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
4584         private.
4585         (MethodCore.CheckForDuplications): New abstract method. For custom
4586         member duplication search in a container
4587         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
4588         method and its return type.
4589         (Event.conflict_symbol): New member. Symbol with same name in the
4590         parent class.
4591
4592         * decl.cs:
4593         (MemberCache.FindMemberWithSameName): New method. The method
4594         is looking for conflict with inherited symbols.
4595
4596 2004-08-04  Martin Baulig  <martin@ximian.com>
4597
4598         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
4599
4600         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
4601
4602 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4603
4604         * report.cs (Message): New enum for better error, warning reference in
4605         the code.
4606         (MessageData): New inner abstract class. It generally handles printing of
4607         error and warning messages.
4608         Removed unused Error, Warning, Message methods.
4609
4610 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4611
4612         Fix for cs0592-8.cs test
4613         * attribute.cs
4614         (Attributable.ValidAttributeTargets): Made public.
4615         (Attribute.ExplicitTarget): New member for explicit target value.
4616         (Attribute.CheckTargets): Now we translate explicit attribute
4617         target to Target here.
4618
4619 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
4620
4621         * ecore.cs (MethodGroupExpr): new IsBase property.
4622
4623         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
4624
4625         * delegate.cs (DelegateCreation): store a MethodGroupExpr
4626         rather than an instance expr.
4627
4628         (DelegateCreation.Emit): Use the method group rather than
4629         the instance expression. Also, if you have base.Foo as the
4630         method for a delegate, make sure to emit ldftn, not ldftnvirt.
4631
4632         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
4633
4634         (NewDelegate.DoResolve): Only check for the existance of Invoke
4635         if the method is going to be needed. Use MethodGroupExpr.
4636
4637         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
4638
4639         * expression.cs: For pointer arith., make sure to use
4640         the size of the type, not the size of the pointer to
4641         the type.
4642
4643 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
4644
4645         Fix for #60722
4646         * class.cs (Class): Added error CS0502 test.
4647
4648 2004-08-03  John Luke  <jluke@cfl.rr.com>
4649             Raja R Harinath  <rharinath@novell.com>
4650
4651         Fix for #60997.
4652         * attribute.cs (Attribute.complained_before): New flag.
4653         (Attribute.ResolveType, Attribute.Resolve),
4654         (Attribute.DefinePInvokeMethod): Set it.
4655         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
4656         
4657 2004-08-03  Martin Baulig  <martin@ximian.com>
4658
4659         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
4660         use a user-defined operator; we still need to do numeric
4661         promotions in case one argument is a builtin type and the other
4662         one has an implicit conversion to that type.  Fixes #62322.
4663
4664 2004-08-18  Martin Baulig  <martin@ximian.com>
4665
4666         * class.cs (Method.Define): Use the correct method name when
4667         creating the MethodBuilder for a generic method.
4668
4669 2004-08-17  Martin Baulig  <martin@ximian.com>
4670
4671         * generic.cs (Constraints): Support type parameter constraints.
4672
4673 2004-08-16  Martin Baulig  <martin@ximian.com>
4674
4675         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
4676         (Token.GENERIC_DIMENSION): New token; this is returned if we
4677         encounter an unbound generic type in a typeof() expression.
4678
4679         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
4680         this token is only generated while parsing a typeof() expression.
4681         (typeof_expression): Removed the old unbound_type hack.
4682
4683         * generic.cs (TypeArguments.IsUnbound): New public property.
4684
4685         * decl.cs (MemberName): Added support for unbound types.
4686
4687 2004-08-14  Martin Baulig  <martin@ximian.com>
4688
4689         * typemanager.cs
4690         (TypeManager.IsEqualGenericInstance): New static method.
4691         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
4692         just used to check accessibility, so follow the rules of 26.1.6.        
4693
4694         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
4695         ConstructedType instead of a TypeExpression if we have type arguments.
4696
4697         * cs-parser.jay (typeof_expression): Support unbound generic types.
4698
4699         * ecore.cs (UnboundTypeExpression): New public class.
4700
4701 2004-08-12  Martin Baulig  <martin@ximian.com>
4702
4703         * typemanager.cs (TypeManager.IsNestedChildOf): Use
4704         TypeManager.IsEqual() rather than `=='.
4705
4706         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
4707         generic instances as well.
4708
4709 2004-08-12  Martin Baulig  <martin@ximian.com>
4710
4711         * expression.cs (Invocation.InferType): We can only infer method
4712         type parameters.  Fixes #62647.
4713
4714 2004-08-11  Martin Baulig  <martin@ximian.com>
4715
4716         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
4717         before resolving the base classes.
4718
4719 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
4720
4721         * Makefile: install .mdb file too.
4722
4723 2004-08-05  Martin Baulig  <martin@ximian.com>
4724
4725         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
4726         initializer, the current type is just the TypeBuilder, not the
4727         instantiated generic type.
4728         (FieldExpr.IsFieldInitializer): New public property.
4729
4730 2004-08-04  Martin Baulig  <martin@ximian.com>
4731
4732         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
4733
4734         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
4735
4736 2004-08-03  Martin Baulig  <martin@ximian.com>
4737
4738         * class.cs (MethodData.Define): If we're an explicit
4739         implementation, remove the generic arity from the type name.
4740
4741 2004-08-03  Martin Baulig  <martin@ximian.com>
4742
4743         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
4744         use a user-defined operator; we still need to do numeric
4745         promotions in case one argument is a builtin type and the other
4746         one has an implicit conversion to that type.  Fixes #62322.
4747
4748 2004-08-02  Martin Baulig  <martin@ximian.com>
4749
4750         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
4751         `TypeExpr[]' array.
4752         (TypeContainer.GetClassBases): Return the unexpanded list of
4753         interfaces; we expand them later.
4754         (TypeContainer.DefineType): After creating the TypeBuilder, call
4755         TypeManager.ExpandInterfaces() to get an expanded and resolved
4756         list of interfaces.
4757
4758         * ecore.cs (TypeExpr.GetInterfaces): Removed
4759
4760         * generics.cs (Constraints.InterfaceConstraints): Remove.
4761         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
4762         register the interface constraints.
4763
4764         * typemanager.cs
4765         (TypeManager.AddUserType): Removed the `ifaces' argument.
4766         (TypeManager.AddTypeParameter): Likewise.
4767         (TypeManager.AddUserInterface): Removed, was unused.
4768         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
4769         `TypeExpr[]' array for the interfaces.
4770         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
4771         has been defined, returns a list of the resolved interfaces types.
4772         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
4773         (TypeManager.GetExplicitInterfaces): Likewise.  
4774
4775 2004-08-02  Martin Baulig  <martin@ximian.com>
4776
4777         * expression.cs (Invocation.EmitCall): If we're invoking a method
4778         on a type parameter, use the new `Constrained' prefix opcode.
4779
4780 2004-08-02  Martin Baulig  <martin@ximian.com>
4781
4782         * statement.cs (LocalInfo.Flags): Added `IsThis'.
4783         (LocalInfo.IsThis): New public property.
4784         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
4785
4786 2004-08-01  Martin Baulig  <martin@ximian.com>
4787
4788         * class.cs (TypeContainer.GetClassBases): Don't set the default
4789         here since we may get called from GetPartialBases().
4790         (TypeContainer.DefineType): If GetClassBases() didn't return a
4791         parent, use the default one.
4792
4793 2004-07-30  Martin Baulig  <martin@ximian.com>
4794
4795         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
4796
4797         * class.cs (SourceMethod): New public class, derive from the
4798         symbol writer's ISourceMethod.
4799         (Method): Use the new symbol writer API.
4800
4801         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
4802         as argument and use the new symbol writer.
4803
4804         * location.cs
4805         (SourceFile): Implement the symbol writer's ISourceFile.
4806         (Location.SymbolDocument): Removed.
4807         (Location.SourceFile): New public property.
4808
4809         * symbolwriter.cs: Use the new symbol writer API.
4810
4811 2004-07-30  Raja R Harinath  <rharinath@novell.com>
4812
4813         * Makefile (install-local): Remove.  Functionality moved to
4814         executable.make.
4815
4816 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
4817
4818         * Makefile: Install mcs.exe.config file together with mcs.exe.
4819         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
4820         correct runtime version.
4821         
4822 2004-07-25  Martin Baulig  <martin@ximian.com>
4823
4824         * class.cs
4825         (TypeContainer.RegisterOrder): Removed, this was unused.
4826         (TypeContainer, interface_order): Removed.
4827         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
4828         TypeContainer as argument since we can also be called with a
4829         `PartialContainer' for a partial class/struct/interface.
4830         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
4831         of checking whether we're an `Interface' - we could be a
4832         `PartialContainer'.
4833         (PartialContainer.Register): Override; call
4834         AddClass()/AddStruct()/AddInterface() on our parent.
4835
4836         * cs-parser.jay (interface_member_declaration): Add things to the
4837         `current_container', not the `current_class'.
4838
4839         * rootcontext.cs (RegisterOrder): The overloaded version which
4840         takes an `Interface' was unused, removed.
4841
4842         * typemanager.cs (TypeManager.LookupInterface): Return a
4843         `TypeContainer', not an `Interface'.
4844         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
4845         contain a `PartialContainer' for an interface, so check it's
4846         `Kind' to figure out what it is.
4847
4848 2004-07-25  Martin Baulig  <martin@ximian.com>
4849
4850         * class.cs (Class.DefaultTypeAttributes): New public constant.
4851         (Struct.DefaultTypeAttributes): Likewise.
4852         (Interface.DefaultTypeAttributes): Likewise.
4853         (PartialContainer.TypeAttr): Override this and add the
4854         DefaultTypeAttributes.
4855
4856 2004-07-25  Martin Baulig  <martin@ximian.com>
4857
4858         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
4859         we can just use the `Parent' field instead.
4860
4861 2004-07-25  Martin Baulig  <martin@ximian.com>
4862
4863         * class.cs (TypeContainer.Emit): Renamed to EmitType().
4864
4865 2004-07-25  Martin Baulig  <martin@ximian.com>
4866
4867         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
4868         our parts before defining any methods.
4869         (TypeContainer.VerifyImplements): Make this virtual.
4870         (ClassPart.VerifyImplements): Override and call VerifyImplements()
4871         on our PartialContainer.
4872
4873 2004-07-25  Martin Baulig  <martin@ximian.com>
4874
4875         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
4876
4877         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
4878         argument, we can just use the `Parent' field instead.
4879
4880         * class.cs
4881         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
4882         (MemberBase.DoDefine): Likewise.
4883
4884 2004-07-24  Martin Baulig  <martin@ximian.com>
4885
4886         * decl.cs (MemberCore.Parent): New public field.
4887         (DeclSpace.Parent): Moved to MemberCore.
4888
4889         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
4890         (MemberBase.ctor): Added TypeContainer argument, pass it to our
4891         parent's .ctor.
4892         (FieldBase, Field, Operator): Likewise.
4893         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
4894         (EventField, Event): Likewise.
4895
4896 2004-07-23  Martin Baulig  <martin@ximian.com>
4897
4898         * class.cs (PartialContainer): New public class.
4899         (ClassPart): New public class.
4900         (TypeContainer): Added support for partial classes.
4901         (TypeContainer.GetClassBases): Splitted some of the functionality
4902         out into GetNormalBases() and GetPartialBases().
4903
4904         * cs-tokenizer.cs (Token.PARTIAL): New token.
4905         (Tokenizer.consume_identifier): Added some hacks to recognize
4906         `partial', but only if it's immediately followed by `class',
4907         `struct' or `interface'.
4908
4909         * cs-parser.jay: Added support for partial clases.
4910
4911 2004-07-23  Martin Baulig  <martin@ximian.com>
4912
4913         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
4914         a `DeclSpace' and also made it readonly.
4915         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
4916         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
4917         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
4918
4919         * cs-parser.jay: Pass the `current_class', not the
4920         `current_container' (at the moment, this is still the same thing)
4921         to a new Method, Property, Event, Indexer or Constructor.
4922
4923 2004-07-23  Martin Baulig  <martin@ximian.com>
4924
4925         * cs-parser.jay (CSharpParser): Added a new `current_class' field
4926         and removed the `current_interface' one.
4927         (struct_declaration, class_declaration, interface_declaration):
4928         Set `current_class' to the newly created class/struct/interface;
4929         set their `Bases' and call Register() before parsing their body.
4930
4931 2004-07-23  Martin Baulig  <martin@ximian.com>
4932
4933         * class.cs (Kind): New public enum.
4934         (TypeContainer): Made this class abstract.
4935         (TypeContainer.Kind): New public readonly field.
4936         (TypeContainer.CheckDef): New public method; moved here from
4937         cs-parser.jay.
4938         (TypeContainer.Register): New public abstract method.
4939         (TypeContainer.GetPendingImplementations): New public abstract
4940         method.
4941         (TypeContainer.GetClassBases): Removed the `is_class' and
4942         `is_iface' parameters.
4943         (TypeContainer.DefineNestedTypes): Formerly known as
4944         DoDefineType().
4945         (ClassOrStruct): Made this class abstract.
4946
4947         * tree.cs (RootTypes): New public type. 
4948
4949 2004-07-20  Martin Baulig  <martin@ximian.com>
4950
4951         * tree.cs (Tree.RecordNamespace): Removed.
4952         (Tree.Namespaces): Removed.
4953
4954         * rootcontext.cs (RootContext.IsNamespace): Removed.
4955
4956         * cs-parser.jay (namespace_declaration): Just create a new
4957         NamespaceEntry here.
4958
4959 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
4960
4961         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
4962         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
4963         entry to make sure it runs in the correct runtime version.
4964         
4965 2004-07-18  Martin Baulig  <martin@ximian.com>
4966
4967         * generic.cs (ConstructedType.CheckConstraints): Improved
4968         constraints checking.
4969
4970 2004-07-18  Martin Baulig  <martin@ximian.com>
4971
4972         * expression.cs (Invocation.BetterMethod): Call
4973         TypeManager.TypeToCoreType() on all types and removed my previous
4974         hack; we're already doig the right thing here.
4975
4976 2004-07-17  Martin Baulig  <martin@ximian.com>
4977
4978         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
4979
4980 2004-07-16  Martin Baulig  <martin@ximian.com>
4981
4982         * iterators.cs: Added generics support.
4983
4984 2004-07-16  Martin Baulig  <martin@ximian.com>
4985
4986         * iterators.cs: Rewrote this.  We're now using one single Proxy
4987         class for both the IEnumerable and the IEnumerator interface and
4988         `Iterator' derives from Class so we can use the high-level API.
4989
4990         * class.cs (TypeContainer.AddIterator): New method.
4991         (TypeContainer.DoDefineType): New protected virtual method, which
4992         is called from DefineType().
4993         (TypeContainer.DoDefineMembers): Call DefineType() and
4994         DefineMembers() on all our iterators.
4995         (TypeContainer.Emit): Call Emit() on all our iterators.
4996         (TypeContainer.CloseType): Call CloseType() on all our iterators.
4997
4998         * codegen.cs (EmitContext.CurrentIterator): New public field.
4999
5000 2004-07-15  Martin Baulig  <martin@ximian.com>
5001
5002         * typemanager.cs
5003         (TypeManager.not_supported_exception_type): New type.   
5004
5005 2004-07-14  Martin Baulig  <martin@ximian.com>
5006
5007         * typemanager.cs
5008         (TypeManager.generic_ienumerable_type): New type.
5009         (TypeManager.generic_ienumerator_type): New type.
5010
5011         * rootcontext.cs
5012         (RootContext.interfaces_first_stage): Added
5013         "System.Collections.Generic.IEnumerator`1" and
5014         "System.Collections.Generic.IEnumerable`1".     
5015
5016 2004-07-14  Martin Baulig  <martin@ximian.com>
5017
5018         * iterators.cs: Use real error numbers.
5019
5020 2004-07-14  Martin Baulig  <martin@ximian.com>
5021
5022         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
5023         requires this to be a System.Collection.IEnumerable and not a
5024         class implementing that interface.
5025         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
5026
5027 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
5028
5029         * class.cs: Fixed previous fix, it broke some error tests.
5030
5031 2004-07-12  Martin Baulig  <martin@ximian.com>
5032
5033         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
5034         Fixes #61293.
5035
5036 2004-07-14  Martin Baulig  <martin@ximian.com>
5037
5038         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
5039         an exclamation mark (!) for the generic arity to reflect the
5040         latest spec changes; ie. use "System.Collections.Generic.IList`1".
5041
5042 2004-07-13  Martin Baulig  <martin@ximian.com>
5043
5044         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
5045         specifiers being part of a type argument.
5046
5047 2004-07-13  Martin Baulig  <martin@ximian.com>
5048
5049         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
5050         name for generic types.
5051
5052 2004-07-13  Martin Baulig  <martin@ximian.com>
5053
5054         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
5055         bit to fix #60119.
5056
5057 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
5058
5059         * assign.cs (LocalTemporary): Add new argument: is_address,If
5060         `is_address' is true, then the value that we store is the address
5061         to the real value, and not the value itself.
5062         
5063         * ecore.cs (PropertyExpr): use the new local temporary
5064         stuff to allow us to handle X.Y += z (where X is a struct)
5065
5066 2004-07-08  Martin Baulig  <martin@ximian.com>
5067
5068         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
5069         not always return, just like we're doing in Using.Resolve().
5070
5071 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
5072
5073         * cs-parser.jay (fixed_statement): flag this as Pinned.
5074
5075 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
5076
5077         * typemanager.cs (TypeManager): Removed MakePinned method, this
5078         mechanism is replaced with the .NET 2.x compatible mechanism of
5079         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
5080
5081         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
5082         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
5083         `IsFixed' property which has a different meaning.
5084
5085 2004-07-02  Raja R Harinath  <rharinath@novell.com>
5086
5087         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
5088         visible from inside a nested class, not just the names of the
5089         immediately enclosing class.
5090         Fix for bug #60730.
5091
5092 2004-06-24  Raja R Harinath  <rharinath@novell.com>
5093
5094         * expression.cs (BetterConversion): Remove buggy special-case
5095         handling of "implicit constant expression conversions".  At this
5096         point, we already know that the conversion is possible -- we're
5097         only checking to see which is better.
5098
5099 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5100
5101         * cs-parser.jay: Added error CS0210 test.
5102
5103 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5104
5105         * cs-parser.jay: Added error CS0134 test.
5106
5107 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5108
5109         Fix bug #52507
5110         * cs-parser.jay: Added error CS0145 test.
5111
5112 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
5113
5114         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
5115
5116 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
5117         
5118         * expression.cs (StackAlloc.Resolve): The argument may not
5119         be a constant; deal with this case.
5120         
5121 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
5122
5123         * attribute.cs (IndexerName_GetIndexerName): Renamed to
5124         GetIndexerAttributeValue.
5125         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
5126
5127         * class.cs (Indexer.Define): Added error tests for CS0415,
5128         CS0609.
5129
5130 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
5131
5132         * attribute.cs (Attribute.Resolve): Keep field code in sync with
5133         property code.
5134
5135 2004-06-23  Martin Baulig  <martin@ximian.com>
5136
5137         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
5138         neither return nor throw, reset the barrier as well.  Fixes #60457.
5139
5140 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
5141
5142         * class.cs : EventAttributes is now set to None by default.
5143           This fixes bug #60459.
5144
5145 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5146
5147         Fix bug #60219
5148         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5149         Don't throw exception but return null (it's sufficient now).
5150
5151 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
5152
5153         * typemanager.cs (GetArgumentTypes): Faster implementation.
5154
5155 2004-06-18  Martin Baulig  <martin@ximian.com>
5156
5157         * attribute.cs (Attribute.Resolve): Check whether we're an
5158         EmptyCast which a Constant child.  Fixes #60333.
5159
5160 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
5161
5162         * statement.cs (EmitCollectionForeach): Account for the fact that
5163         not all valuetypes are in areas which we can take the address of.
5164         For these variables, we store to a temporary variable. Also, make
5165         sure that we dont emit a `callvirt' on a valuetype method.
5166
5167 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5168
5169         * expression.cs (StackAlloc.DoReSolve): Added test for
5170         negative parameter (CS0247).
5171
5172 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5173
5174         Fix bug #59792
5175         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
5176
5177 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
5178
5179         Fix bug #59781
5180         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
5181         ulong.
5182
5183 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5184
5185         Fix bug #58254 & cs1555.cs, cs1556.cs
5186         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
5187
5188 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
5189
5190         * cs-parser.jay: Added error CS1669 test for indexers.
5191
5192 2004-06-18  Martin Baulig  <martin@ximian.com>
5193
5194         * generics.cs (GenericMethod.ctor): Don't take an Attributes
5195         argument.  Fixes #60441.
5196
5197 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
5198         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
5199         The name needs to have the actual name of the method in order
5200         for other tests (such as the one in OverloadResolve for Invoke
5201         on a delegate) to work. As well, it does not really help
5202         error reporting because the method group had multiple methods.
5203         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
5204         Make profiling work.
5205         
5206 2004-06-13  Martin Baulig  <martin@ximian.com>
5207
5208         * cs-parser.jay: Don't allow generic attributes.
5209
5210 2004-06-13  Martin Baulig  <martin@ximian.com>
5211
5212         * class.cs (MemberBase.DoDefineBase): New protected method.
5213         (MemberBase.DoDefine): Compute the `flags' in the new
5214         DoDefineBase() which must be called first.
5215         (Method.Define): Call DoDefineBase() first so we have the flags
5216         when defining the generic method.
5217
5218         * cs-parser.jay (interface_method_declaration): Support generic methods.
5219
5220 2004-06-13  Martin Baulig  <martin@ximian.com>
5221
5222         * decl.cs (TypeName): Removed.
5223         (MemberName): Removed TypeName and MemberNow; now we just have
5224         MemberName.
5225
5226         * cs-parser.jay: Don't distinguish between type arguments and type
5227         parameters in the grammar and simplified the rules a bit.  The
5228         reduce/reduce conflicts are now gone (except the one we inherited
5229         from mcs).
5230
5231 2004-06-11  Martin Baulig  <martin@ximian.com>
5232
5233         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
5234         call this twice: for params and varargs methods.
5235
5236 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5237
5238         * class.cs:
5239         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
5240
5241 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
5242
5243         * attribute.cs (Attribute.GetValidTargets): Made public.
5244
5245         * class.cs: 
5246         (AbstractPropertyEventMethod): New class for better code sharing.
5247         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
5248         CS1667 report.
5249         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
5250
5251 2004-06-09  Martin Baulig  <martin@ximian.com>
5252
5253         * cs-parser.jay: Removed a reduce/reduce conflict.
5254
5255 2004-06-03  Martin Baulig  <martin@ximian.com>
5256
5257         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
5258         GetSimpleName() and return a SimpleName.
5259
5260         * ecore.cs (SimpleName.Arguments): New public field.
5261         (SimpleName): Added overloaded ctor which takes an additional
5262         TypeArguments argument.
5263         (SimpleName.SimpleNameResolve): Added support for generic methods.
5264         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
5265         formerly in MemberAccess.DoResolve(), but we also need it in
5266         SimpleNameResolve().
5267
5268         * expression.cs (MemberAccess.DoResolve): Use the new
5269         MethodGroupExpr.ResolveGeneric().       
5270
5271 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5272
5273         * decl.cs: If possible, use lookuptypedirect here. We can only do
5274         this if there is no `.' after the namespace. Avoids using
5275         LookupType, which does lots of slow processing.
5276         (FindNestedType) New method, does what it says :-).
5277         * namespace.cs: use LookupTypeDirect.
5278         * rootcontext.cs: use membercache, if possible.
5279         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5280
5281 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5282
5283         * expression.cs:
5284         According to the spec, 
5285
5286         In a member access of the form E.I, if E is a single identifier,
5287         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5288         field, property, localvariable, or parameter with the same type as
5289         the meaning of E as a type-name (§3.8), then both possible
5290         meanings of E are permitted.
5291
5292         We did not check that E as a simple-name had the same type as E as
5293         a type name.
5294
5295         This trivial check gives us 5-7% on bootstrap time.
5296
5297 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5298
5299         * expression.cs (Invocation.OverloadResolve): Avoid the
5300         use of hashtables and boxing here by allocating on demand.
5301
5302 2004-05-30  Martin Baulig  <martin@ximian.com>
5303
5304         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5305         we're doing a silent lookup.  Don't try to lookup nested types in
5306         TypeManager.object_type (thanks to Ben Maurer).
5307
5308 2004-05-30  Martin Baulig  <martin@ximian.com>
5309
5310         Committing a patch from Ben Maurer.
5311
5312         * rootcontext.cs (RootContext.LookupType): Cache negative results.
5313
5314 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5315
5316         * convert.cs: add a trivial cache for overload operator resolution.
5317
5318 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
5319
5320         * attribute.cs
5321         (AttributeTester.GetObsoleteAttribute): Returns instance of
5322         ObsoleteAttribute when type is obsolete.
5323
5324         * class.cs
5325         (TypeContainer.VerifyObsoleteAttribute): Override.
5326         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
5327         (MethodCode.VerifyObsoleteAttribute): Override.
5328         (MemberBase.VerifyObsoleteAttribute): Override.
5329
5330         * decl.cs
5331         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
5332         and report proper error.
5333
5334         *delegate.cs
5335         (Delegate.VerifyObsoleteAttribute): Override.
5336
5337         * ecore.cs
5338         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
5339         and report proper error.
5340         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
5341
5342         * enum.cs
5343         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
5344         and enum member.
5345
5346         * expression.cs
5347         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
5348         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
5349         Added test for ObsoleteAttribute.
5350
5351         * statement.cs
5352         (Catch): Derived from Statement.
5353
5354 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5355
5356         * decl.cs: If possible, use lookuptypedirect here. We can only do
5357         this if there is no `.' after the namespace. Avoids using
5358         LookupType, which does lots of slow processing.
5359         (FindNestedType) New method, does what it says :-).
5360         * namespace.cs: use LookupTypeDirect.
5361         * rootcontext.cs: use membercache, if possible.
5362         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
5363
5364 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5365
5366         * expression.cs:
5367         According to the spec, 
5368
5369         In a member access of the form E.I, if E is a single identifier,
5370         and if the meaning of E as a simple-name (§7.5.2) is a constant,
5371         field, property, localvariable, or parameter with the same type as
5372         the meaning of E as a type-name (§3.8), then both possible
5373         meanings of E are permitted.
5374
5375         We did not check that E as a simple-name had the same type as E as
5376         a type name.
5377
5378         This trivial check gives us 5-7% on bootstrap time.
5379
5380 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
5381
5382         Fixed bug #59071 & cs0160.cs
5383         * statement.cs (Try.Resolve): Check here whether order of catch
5384         clauses matches their dependencies.
5385
5386 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
5387
5388         Fixed bug #58624
5389         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
5390         unsafe type.
5391
5392 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
5393
5394         * expression.cs (Invocation.OverloadResolve): Avoid the
5395         use of hashtables and boxing here by allocating on demand.
5396
5397 2004-05-30  Martin Baulig  <martin@ximian.com>
5398
5399         * rootcontext.cs (RootContext.LookupType): Don't cache things if
5400         we're doing a silent lookup.  Don't try to lookup nested types in
5401         TypeManager.object_type (thanks to Ben Maurer).
5402
5403 2004-05-30  Martin Baulig  <martin@ximian.com>
5404
5405         Committing a patch from Ben Maurer.
5406
5407         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
5408
5409 2004-05-29  Martin Baulig  <martin@ximian.com>
5410
5411         * class.cs (IMethodData.ShouldIgnore): New method.
5412
5413         * typemanager.cs (TypeManager.MethodFlags): Don't take a
5414         `Location' argument, we don't need it anywhere.  Use
5415         `IMethodData.ShouldIgnore ()' instead of
5416         `MethodData.GetMethodFlags ()'.
5417         (TypeManager.AddMethod): Removed.
5418         (TypeManager.AddMethod2): Renamed to AddMethod.
5419
5420 2004-05-29  Martin Baulig  <martin@ximian.com>
5421
5422         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
5423
5424         * convert.cs (Convert.ImplicitReferenceConversion): If we're
5425         converting from a class type S to an interface type and we already
5426         have an object on the stack, don't box it again.  Fixes #52578.
5427
5428 2004-05-29  Martin Baulig  <martin@ximian.com>
5429
5430         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
5431         Added support for `params' parameters.  Fixes #59267.
5432
5433 2004-05-29  Martin Baulig  <martin@ximian.com>
5434
5435         * literal.cs (NullPointer): Provide a private .ctor which sets
5436         `type' to TypeManager.object_type.  Fixes #59048.
5437
5438 2004-05-29  Martin Baulig  <martin@ximian.com>
5439
5440         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
5441         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
5442
5443         * ecore.cs (EventExpr.instance_expr): Make the field private.
5444
5445 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
5446
5447         Fixed bug #50080 & cs0214-2.cs
5448         * expression.cs (Cast.DoResolve): Check unsafe context here.
5449         
5450         * statement.cs (Resolve.DoResolve): Likewise.
5451
5452 2004-05-26  Martin Baulig  <martin@ximian.com>
5453
5454         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
5455
5456         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
5457         (RootContext.LookupType): Pass down the `silent' flag.
5458
5459 2004-05-25  Martin Baulig  <martin@ximian.com>
5460
5461         * expression.cs
5462         (MethodGroupExpr.IdenticalTypeName): New public property.
5463         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
5464         expression actually refers to a type.
5465
5466 2004-05-25  Martin Baulig  <martin@ximian.com>
5467
5468         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
5469         for #56176 and made it actually work.
5470
5471 2004-05-25  Martin Baulig  <martin@ximian.com>
5472
5473         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
5474         (FieldExpr, PropertyExpr): Override and implement
5475         CacheTemporaries.  Fixes #52279.
5476
5477 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
5478
5479         * location.cs: In the new compiler listing a file twice is a
5480         warning, not an error.
5481
5482 2004-05-24  Martin Baulig  <martin@ximian.com>
5483
5484         * enum.cs (Enum.DefineType): For the `BaseType' to be a
5485         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
5486
5487 2004-05-24  Martin Baulig  <martin@ximian.com>
5488
5489         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
5490         walking the `using' list.  Fixes #53921.
5491
5492 2004-05-24  Martin Baulig  <martin@ximian.com>
5493
5494         * const.cs (Const.LookupConstantValue): Added support for
5495         EmptyCast's; fixes #55251.
5496
5497 2004-05-24  Martin Baulig  <martin@ximian.com>
5498
5499         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
5500         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
5501         which does the CS0135 check.  The reason is that we first need to
5502         check whether the variable actually exists.
5503
5504 2004-05-24  Martin Baulig  <martin@ximian.com>
5505
5506         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
5507         than RootContext.LookupType() to find the explicit interface
5508         type.  Fixes #58584.
5509
5510 2004-05-24  Raja R Harinath  <rharinath@novell.com>
5511
5512         * Makefile: Simplify.  Use executable.make.
5513         * mcs.exe.sources: New file.  List of sources of mcs.exe.
5514
5515 2004-05-24  Anders Carlsson  <andersca@gnome.org>
5516
5517         * decl.cs:
5518         * enum.cs:
5519         Use the invariant culture when doing String.Compare for CLS case
5520         sensitivity.
5521         
5522 2004-05-23  Martin Baulig  <martin@ximian.com>
5523
5524         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
5525         don't have any dots.  Fixes #52622, added cs0246-8.cs.
5526
5527         * namespace.cs (NamespaceEntry.Lookup): Likewise.
5528
5529 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5530
5531         * class.cs (MemberBase.Define): Reuse MemberType member for 
5532         resolved type. Other methods can use it too.
5533
5534 2004-05-23  Martin Baulig  <martin@ximian.com>
5535
5536         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
5537         the variable also exists in the current block (otherwise, we need
5538         to report a CS0103).  Fixes #58670.
5539
5540 2004-05-23  Martin Baulig  <martin@ximian.com>
5541
5542         * flowanalysis.cs (Reachability.Reachable): Compute this
5543         on-the-fly rather than storing it as a field.
5544
5545 2004-05-23  Martin Baulig  <martin@ximian.com>
5546
5547         * flowanalysis.cs (Reachability.And): Manually compute the
5548         resulting `barrier' from the reachability.      
5549        
5550 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
5551
5552         Fix bug #57835
5553         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
5554         instance of ObsoleteAttribute when symbol is obsolete.
5555
5556         * class.cs
5557         (IMethodData): Extended interface for ObsoleteAttribute support.
5558
5559 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5560
5561         * attribute.cs: Fix bug #55970
5562
5563 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
5564
5565         Fix bug #52705
5566         * attribute.cs
5567         (GetObsoleteAttribute): New method. Creates the instance of
5568         ObsoleteAttribute.
5569         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
5570         ObsoleteAttribute when member is obsolete.
5571         (AttributeTester.Report_ObsoleteMessage): Common method for
5572         Obsolete error/warning reporting.
5573
5574         * class.cs
5575         (TypeContainer.base_classs_type): New member for storing parent type.
5576
5577         * decl.cs
5578         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
5579         for this MemberCore.
5580
5581 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5582
5583         * attribute.cs, const.cs: Fix bug #58590
5584
5585 2004-05-21  Martin Baulig  <martin@ximian.com>
5586
5587         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
5588         out parameters if the end of the method is unreachable.  Fixes
5589         #58098. 
5590
5591 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5592
5593         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
5594         Hari was right, why extra method.
5595
5596 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
5597
5598         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
5599
5600 2004-05-20  Martin Baulig  <martin@ximian.com>
5601
5602         * delegate.cs: Convert this file to Unix mode - like the original
5603         version in mcs is.
5604
5605 2004-05-20  Martin Baulig  <martin@ximian.com>
5606
5607         * attribute.cs: Convert this file to Unix mode - like the original
5608         version in mcs is.
5609
5610 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
5611
5612        Fix bug #58688 (MCS does not report error when the same attribute
5613        is assigned twice)
5614
5615        * attribute.cs (Attribute.Emit): Distinction between null and default.
5616
5617 2004-05-19  Raja R Harinath  <rharinath@novell.com>
5618
5619        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
5620        of a top-level attribute without an attribute target.
5621        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
5622        Make non-static.
5623        (Attribute.Conditional_GetConditionName), 
5624        (Attribute.Obsolete_GetObsoleteMessage): Update.
5625        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
5626        part of ScanForIndexerName.
5627        (Attribute.CanIgnoreInvalidAttribute): New function.
5628        (Attribute.ScanForIndexerName): Move to ...
5629        (Attributes.ScanForIndexerName): ... here.
5630        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
5631        (Attributes.Search): New internal variant that can choose not to
5632        complain if types aren't resolved.  The original signature now
5633        complains.
5634        (Attributes.GetClsCompliantAttribute): Use internal variant, with
5635        complaints suppressed.
5636        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
5637        only if it not useful.
5638        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
5639        top-level for attributes that are shared between the assembly
5640        and a top-level class.
5641        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
5642        * class.cs: Update to reflect changes.
5643        (DefineIndexers): Fuse loops.
5644        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
5645        a couple more variants of attribute names.
5646
5647 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
5648
5649         Fix bug #52585 (Implemented explicit attribute declaration)
5650
5651         * attribute.cs:
5652         (Attributable.ValidAttributeTargets): New abstract method. It gets
5653         list of valid attribute targets for explicit target declaration.
5654         (Attribute.Target): It holds target itself.
5655         (AttributeSection): Removed.
5656         (Attribute.CheckTargets): New method. It checks whether attribute
5657         target is valid for the current element.
5658
5659         * class.cs:
5660         (EventProperty): New class. For events that are declared like
5661         property (with add and remove accessors).
5662         (EventField): New class. For events that are declared like field.
5663         class.cs
5664
5665         * cs-parser.jay: Implemented explicit attribute target declaration.
5666
5667         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
5668         Override ValidAttributeTargets.
5669
5670         * parameter.cs:
5671         (ReturnParameter): Class for applying custom attributes on 
5672         the return type.
5673         (ParameterAtribute): New class. Class for applying custom
5674         attributes on the parameter type.
5675
5676 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
5677
5678         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
5679         definitions. 
5680
5681         (Method): Allow UNSAFE here.
5682
5683         * modifiers.cs: Support unsafe reporting.
5684
5685 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
5686
5687         * decl.cs: Fix bug #58478.
5688
5689 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5690
5691         * statement.cs: When checking for unreachable code on an EmptyStatement,
5692         set the location. Fixes bug #58488.
5693
5694 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
5695
5696         * driver.cs: Add -pkg handling.
5697
5698         From Gonzalo: UseShelLExecute=false
5699
5700 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
5701
5702         * attribute.cs:
5703         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
5704         for attribute.
5705         (Attribute.IsClsCompliaceRequired): Moved to base for better
5706         accesibility.
5707         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
5708         when attribute is AttributeUsageAttribute.
5709         (Attribute.GetValidTargets): Simplified.
5710         (Attribute.GetAttributeUsage): New method returns AttributeUsage
5711         attribute for this type.
5712         (Attribute.ApplyAttributes): Method renamed to Emit and make
5713         non-static.
5714         (GlobalAttributeSection): New class for special handling of global
5715         attributes (assembly, module).
5716         (AttributeSection.Emit): New method.
5717
5718         * class.cs: Implemented Attributable abstract methods.
5719         (MethodCore.LabelParameters): Moved to Parameter class.
5720         (Accessor): Is back simple class.
5721         (PropertyMethod): Implemented Attributable abstract class.
5722         (DelegateMethod): Implemented Attributable abstract class.
5723         (Event): New constructor for disctintion between normal Event
5724         and Event with accessors.
5725
5726         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
5727
5728         * codegen.cs, const.cs, decl.cs, delegate.cs:
5729         (CommonAssemblyModulClass): Implemented Attributable abstract class
5730         and simplified.
5731
5732         * enum.cs: Implement IAttributeSupport interface.
5733         (EnumMember): New class for emum members. Implemented Attributable
5734         abstract class
5735
5736         * parameter.cs:
5737         (ParameterBase): Is abstract.
5738         (ReturnParameter): New class for easier [return:] attribute handling.
5739
5740         * typemanager.cs: Removed builder_to_attr.
5741
5742 2004-05-11  Raja R Harinath  <rharinath@novell.com>
5743
5744         Fix bug #57151.
5745         * attribute.cs (Attribute.GetPositionalValue): New function.
5746         * class.cs (TypeContainer.VerifyMembers): New function.
5747         (TypeContainer.Emit): Use it.
5748         (ClassOrStruct): New base class for Class and Struct.
5749         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
5750         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
5751         class.
5752         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
5753         then each non-static field should have a FieldOffset attribute.
5754         Otherwise, none of the fields should have a FieldOffset attribute.
5755         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
5756         and FieldOffset attributes.
5757         * typemanager.cs (TypeManager.struct_layout_attribute_type)
5758         (TypeManager.field_offset_attribute_type): New core types.
5759         (TypeManager.InitCoreTypes): Initialize them.
5760
5761 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
5762
5763         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
5764         Return correct type.
5765         From bug #58270.
5766
5767 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
5768
5769         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
5770         be implicitly converted to ulong.
5771         
5772         * expression.cs: The logic for allowing operator &, | and ^ worked
5773         was wrong, it worked before because we did not report an error in
5774         an else branch.  Fixes 57895.
5775
5776         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
5777         allow volatile fields to be reference types.
5778
5779 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
5780
5781         * driver.cs: Add support for /debug-
5782
5783 2004-05-07  Raja R Harinath  <rharinath@novell.com>
5784
5785         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
5786         Add a 'complain' parameter to silence errors.
5787         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
5788         silently overlooked type-resolutions.
5789         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
5790         to reflect changes.
5791         (Attributes.Search): New function.
5792         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
5793         (Attributes.GetAttributeFullName): Remove hack.
5794         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
5795         Update to reflect changes.
5796         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5797         Use Attributes.Search instead of nested loops.
5798
5799 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
5800
5801         * decl.cs:
5802         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
5803         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
5804         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
5805
5806         * report.cs: (Report.Warning): Renamed to Warning_T because of
5807         parameter collision.
5808
5809 2004-05-05  Raja R Harinath  <rharinath@novell.com>
5810
5811         * expression.cs (MemberAccess.ResolveMemberAccess):
5812         Exit with non-zero status after Report.Error.
5813         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
5814         Likewise.
5815         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
5816
5817 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
5818
5819         * support.cs: Don't hang when the file is empty.
5820
5821 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
5822
5823         * support.cs: In SeekableStreamReader, compute the preamble size of the
5824           underlying stream. Position changes should take into account that initial
5825           count of bytes.
5826
5827 2004-05-03  Todd Berman  <tberman@sevenl.net>
5828
5829         * driver.cs: remove unused GetSysVersion function.
5830
5831 2004-05-03  Todd Berman  <tberman@sevenl.net>
5832
5833         * driver.cs: Remove the hack from saturday, as well as the hack
5834         from jackson (LoadAssemblyFromGac), also adds the CWD to the
5835         link_paths to get that bit proper.
5836
5837 2004-05-01  Todd Berman  <tberman@sevenl.net>
5838
5839         * driver.cs: Try a LoadFrom before a Load, this checks the current
5840         path. This is currently a bug in mono that is be fixed, however, this
5841         provides a workaround for now. This will be removed when the bug
5842         is fixed.
5843
5844 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
5845
5846         * CryptoConvert.cs: Updated to latest version. Fix issue with 
5847         incomplete key pairs (#57941).
5848
5849 2004-05-01  Todd Berman  <tberman@sevenl.net>
5850
5851         * driver.cs: Remove '.' from path_chars, now System.* loads properly
5852         from the GAC
5853
5854 2004-04-30  Jackson Harper  <jackson@ximian.com>
5855
5856         * codegen.cs: Open keys readonly.
5857         
5858 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5859
5860         * typemanager.cs: don't report cyclic struct layout when a struct
5861         contains 2 or more fields of the same type. Failed for Pango.AttrShape
5862         which has 2 Pango.Rectangle fields.
5863
5864 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5865
5866         * expression.cs: Handle IntPtr comparisons with IL code
5867         rather than a method call.
5868
5869 2004-04-29  Martin Baulig  <martin@ximian.com>
5870
5871         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
5872         the list of PropertyInfo's in class hierarchy and find the
5873         accessor.  Fixes #56013.
5874
5875 2004-04-29  Martin Baulig  <martin@ximian.com>
5876
5877         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
5878
5879 2004-04-29  Martin Baulig  <martin@ximian.com>
5880
5881         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
5882
5883         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
5884
5885 2004-04-29  Martin Baulig  <martin@ximian.com>
5886
5887         * class.cs (ConstructorInitializer.Resolve): Check whether the
5888         parent .ctor is accessible.  Fixes #52146.
5889
5890 2004-04-29  Martin Baulig  <martin@ximian.com>
5891
5892         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
5893
5894         * statement.cs (Using.EmitLocalVariableDecls): Use
5895         TypeManager.idisposable_type, not typeof (IDisposable).
5896         (Foreach.EmitCollectionForeach): Added support for valuetypes.
5897
5898 2004-04-29  Martin Baulig  <martin@ximian.com>
5899
5900         * class.cs (Event.Define): Don't emit the field and don't set
5901         RTSpecialName and SpecialName for events on interfaces.  Fixes
5902         #57703. 
5903
5904 2004-04-29  Raja R Harinath  <rharinath@novell.com>
5905
5906         Refactor Attribute.ApplyAttributes.
5907         * attribute.cs (Attributable): New base class for objects that can
5908         have Attributes applied on them.
5909         (Attribute): Make AttributeUsage fields public.
5910         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
5911         (Attribute.IsInternalCall): New property.
5912         (Attribute.UsageAttr): Convert to a public read-only property.
5913         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
5914         (Attribute.ResolveType, Attribute.Resolve)
5915         (Attribute.ScanForIndexerName): Update to reflect changes.
5916         (Attribute.CheckAttributeTarget): Re-format.
5917         (Attribute.ApplyAttributes): Refactor, to various
5918         Attributable.ApplyAttributeBuilder methods.
5919         * decl.cs (MemberCore): Make Attributable.
5920         * class.cs (Accessor): Make Attributable.
5921         (MethodData.ApplyAttributes): Use proper attribute types, not
5922         attribute names.
5923         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
5924         (TypeContainer.ApplyAttributeBuilder)
5925         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
5926         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
5927         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
5928         (Operator.ApplyAttributeBuilder): New factored-out methods.
5929         * const.cs (Const.ApplyAttributeBuilder): Likewise.
5930         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
5931         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
5932         * parameter.cs (ParameterBase): New Attributable base class
5933         that can also represent Return types.
5934         (Parameter): Update to the changes.
5935
5936 2004-04-29  Jackson Harper  <jackson@ximian.com>
5937
5938         * driver.cs: Prefer the corlib system version when looking for
5939         assemblies in the GAC. This is still a hack, but its a better hack
5940         now.
5941         
5942 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
5943
5944         * decl.cs, enum.cs: Improved error 3005 reporting.
5945   
5946         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
5947         (related_symbols): New private member for list of symbols
5948         related to reported error/warning.
5949         
5950         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
5951
5952 2004-04-29  Martin Baulig  <martin@ximian.com>
5953
5954         * ecore.cs (Expression.Constantify): If we're an enum and
5955         TypeManager.TypeToCoreType() doesn't give us another type, use
5956         t.UnderlyingSystemType.  Fixes #56178.  
5957
5958 2004-04-29  Martin Baulig  <martin@ximian.com>
5959
5960         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
5961         interfaces and for each interface, only add members directly
5962         declared in that interface.  Fixes #53255.
5963
5964 2004-04-28  Martin Baulig  <martin@ximian.com>
5965
5966         * expression.cs (ConditionalLogicalOperator): Use a temporary
5967         variable for `left' to avoid that we evaluate it more than once;
5968         bug #52588.
5969
5970 2004-04-28  Martin Baulig  <martin@ximian.com>
5971
5972         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
5973         `void[]' (CS1547).
5974
5975 2004-04-28  Martin Baulig  <martin@ximian.com>
5976
5977         * statement.cs (LocalInfo.Resolve): Check whether the type is not
5978         void (CS1547).
5979
5980         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
5981         whether the type is not void (CS1547).
5982
5983 2004-04-28  Martin Baulig  <martin@ximian.com>
5984
5985         * expression.cs (Unary.DoResolveLValue): Override this and report
5986         CS0131 for anything but Operator.Indirection.
5987
5988 2004-04-28  Martin Baulig  <martin@ximian.com>
5989
5990         Committing a patch from Ben Maurer; see bug #50820.
5991
5992         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
5993         check for classes.
5994
5995         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
5996         classes.        
5997
5998 2004-04-28  Martin Baulig  <martin@ximian.com>
5999
6000         Committing a patch from Ben Maurer; see bug #50820.
6001
6002         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
6003         check for classes.
6004
6005         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
6006         classes.        
6007
6008 2004-04-28  Martin Baulig  <martin@ximian.com>
6009
6010         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
6011         (Block.AddLabel): Call DoLookupLabel() to only search in the
6012         current block.
6013
6014 2004-04-28  Martin Baulig  <martin@ximian.com>
6015
6016         * cfold.cs (ConstantFold.BinaryFold): Added special support for
6017         comparing StringConstants and NullLiterals in Equality and Inequality.
6018
6019 2004-04-28  Jackson Harper  <jackson@ximian.com>
6020
6021         * driver.cs: Attempt to load referenced assemblies from the
6022         GAC. This is the quick and dirty version of this method that
6023         doesnt take into account versions and just takes the first
6024         canidate found. Will be good enough for now as we will not have more
6025         then one version installed into the GAC until I update this method.
6026
6027 2004-04-28  Martin Baulig  <martin@ximian.com>
6028
6029         * typemanager.cs (TypeManager.CheckStructCycles): New public
6030         static method to check for cycles in the struct layout.
6031
6032         * rootcontext.cs (RootContext.PopulateTypes): Call
6033         TypeManager.CheckStructCycles() for each TypeContainer.
6034         [Note: We only need to visit each type once.]
6035
6036 2004-04-28  Martin Baulig  <martin@ximian.com>
6037
6038         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
6039
6040         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
6041         success and added `out object value'.  Use a `bool resolved' field
6042         to check whether we've already been called rather than
6043         `ConstantValue != null' since this breaks for NullLiterals.
6044
6045 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6046
6047         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
6048         setting of this flag, since the 'set' method may be non-public.
6049
6050 2004-04-28  Raja R Harinath  <rharinath@novell.com>
6051
6052         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
6053         check on current_vector.Block.
6054
6055 2004-04-27  Martin Baulig  <martin@ximian.com>
6056
6057         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
6058         a field initializer.  Fixes #56459.
6059
6060 2004-04-27  Martin Baulig  <martin@ximian.com>
6061
6062         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
6063         we're not attempting to use an indexer.  Fixes #52154.
6064
6065 2004-04-27  Martin Baulig  <martin@ximian.com>
6066
6067         * statement.cs (Return): Don't create a return label if we don't
6068         need it; reverts my change from January 20th.  Thanks to Ben
6069         Maurer for this.
6070
6071 2004-04-27  Martin Baulig  <martin@ximian.com>
6072
6073         According to the spec, `goto' can only leave a nested scope, but
6074         never enter it.
6075
6076         * statement.cs (Block.LookupLabel): Only lookup in the current
6077         block, don't recurse into parent or child blocks.
6078         (Block.AddLabel): Check in parent and child blocks, report
6079         CS0140/CS0158 if we find a duplicate.
6080         (Block): Removed this indexer for label lookups.
6081         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
6082         this already does the error reporting for us.
6083
6084         * flowanalysis.cs
6085         (FlowBranching.UsageVector.Block): New public variable; may be null.
6086         (FlowBranching.CreateSibling): Added `Block' argument.
6087         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
6088         label for the target of a `goto' and check whether we're not
6089         leaving a `finally'.
6090
6091 2004-04-27  Martin Baulig  <martin@ximian.com>
6092
6093         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6094         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
6095         just for returns).
6096
6097 2004-04-27  Martin Baulig  <martin@ximian.com>
6098
6099         * statement.cs (Block.AddLabel): Also check for implicit blocks
6100         and added a CS0158 check.
6101
6102 2004-04-27  Martin Baulig  <martin@ximian.com>
6103
6104         * flowanalysis.cs (FlowBranchingLoop): New class.
6105         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
6106         UsageVector's instead of an ArrayList.
6107         (FlowBranching.Label): Likewise.
6108         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
6109         (FlowBranching.AddBreakVector): New method.
6110
6111 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
6112
6113         * attribute.cs: Small regression fix: only convert the type if we
6114         the type is different, fixes System.Drawing build.
6115
6116 2004-04-27  Martin Baulig  <martin@ximian.com>
6117
6118         * attribute.cs (Attribute.Resolve): If we have a constant value
6119         for a named field or property, implicity convert it to the correct
6120         type.
6121
6122 2004-04-27  Raja R Harinath  <rharinath@novell.com>
6123
6124         * statement.cs (Block.Block): Implicit blocks share
6125         'child_variable_names' fields with parent blocks.
6126         (Block.AddChildVariableNames): Remove.
6127         (Block.AddVariable): Mark variable as "used by a child block" in
6128         every surrounding block.
6129         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
6130         been used in a child block, complain about violation of "Invariant
6131         meaning in blocks" rule.
6132         * cs-parser.jay (declare_local_variables): Don't use
6133         AddChildVariableNames.
6134         (foreach_statement): Don't create an implicit block: 'foreach'
6135         introduces a scope.
6136
6137 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
6138
6139         * convert.cs (ImplicitNumericConversion): 0 is also positive when
6140         converting from 0L to ulong.  Fixes 57522.
6141
6142 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6143
6144         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
6145         derived class hides via 'new' keyword field from base class (test-242.cs).
6146         TODO: Handle this in the more general way.
6147         
6148         * class.cs (CheckBase): Ditto.
6149
6150 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
6151
6152         * decl.cs (caching_flags): New member for storing cached values
6153         as bit flags.
6154         (MemberCore.Flags): New enum where bit flags for caching_flags
6155         are defined.
6156         (MemberCore.cls_compliance): Moved to caching_flags.
6157         (DeclSpace.Created): Moved to caching_flags.
6158
6159         * class.cs: Use caching_flags instead of DeclSpace.Created
6160         
6161 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
6162
6163         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
6164         if we are only a derived class, not a nested class.
6165
6166         * typemanager.cs: Same as above, but do this at the MemberLookup
6167         level (used by field and methods, properties are handled in
6168         PropertyExpr).   Allow for the qualified access if we are a nested
6169         method. 
6170
6171 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
6172
6173         * class.cs: Refactoring.
6174         (IMethodData): New inteface; Holds links to parent members
6175         to avoid member duplication (reduced memory allocation).
6176         (Method): Implemented IMethodData interface.
6177         (PropertyBase): New inner classes for get/set methods.
6178         (PropertyBase.PropertyMethod): Implemented IMethodData interface
6179         (Event): New inner classes for add/remove methods.
6180         (Event.DelegateMethod): Implemented IMethodData interface.
6181
6182         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
6183         EmitContext (related to class.cs refactoring).
6184
6185 2004-04-21  Raja R Harinath  <rharinath@novell.com>
6186
6187         * delegate.cs (Delegate.VerifyApplicability): If the number of
6188         arguments are the same as the number of parameters, first try to
6189         verify applicability ignoring  any 'params' modifier on the last
6190         parameter.
6191         Fixes #56442.
6192
6193 2004-04-08  Martin Baulig  <martin@ximian.com>
6194
6195         Merged latest changes into gmcs.  Please keep this comment in
6196         here, it makes it easier for me to see what changed in MCS since
6197         the last time I merged.
6198
6199 2004-04-16  Raja R Harinath  <rharinath@novell.com>
6200
6201         * class.cs (TypeContainer.AddIndexer): Use
6202         'ExplicitInterfaceName' to determine if interface name was
6203         explicitly specified.  'InterfaceType' is not initialized at this time.
6204         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
6205         Indexers array is already in the required order.  Initialize
6206         'IndexerName' only if there are normal indexers.
6207         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
6208         (TypeContainer.Emit): Emit DefaultMember attribute only if
6209         IndexerName is initialized.
6210         Fixes #56300.
6211
6212 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
6213
6214         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
6215         Fixes #57007
6216
6217 2004-04-15  Raja R Harinath  <rharinath@novell.com>
6218
6219         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
6220         attributes.
6221         Fix for #56456.
6222
6223         * attribute.cs (Attribute.Resolve): Check for duplicate named
6224         attributes.
6225         Fix for #56463.
6226
6227 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
6228
6229         * iterators.cs (MarkYield): track whether we are in an exception,
6230         and generate code accordingly.  Use a temporary value to store the
6231         result for our state.
6232
6233         I had ignored a bit the interaction of try/catch with iterators
6234         since their behavior was not entirely obvious, but now it is
6235         possible to verify that our behavior is the same as MS .NET 2.0
6236
6237         Fixes 54814
6238
6239 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
6240
6241         * iterators.cs: Avoid creating temporaries if there is no work to
6242         do. 
6243
6244         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
6245         Enumerations, use TypeManager.EnumToUnderlying and call
6246         recursively. 
6247
6248         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
6249         bug #57013
6250
6251         (This.Emit): Use EmitContext.EmitThis to emit our
6252         instance variable.
6253
6254         (This.EmitAssign): Ditto.
6255
6256         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
6257         codepaths, we will move all the functionality into
6258         Mono.CSharp.This 
6259
6260         (FieldExpr.EmitAssign): Ditto.
6261
6262         This fixes several hidden bugs that I uncovered while doing a code
6263         review of this today.
6264
6265         * codegen.cs (EmitThis): reworked so the semantics are more clear
6266         and also support value types "this" instances.
6267
6268         * iterators.cs: Changed so that for iterators in value types, we
6269         do not pass the value type as a parameter.  
6270
6271         Initialization of the enumerator helpers is now done in the caller
6272         instead of passing the parameters to the constructors and having
6273         the constructor set the fields.
6274
6275         The fields have now `assembly' visibility instead of private.
6276
6277 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
6278
6279         * expression.cs (Argument.Resolve): Check if fields passed as ref
6280         or out are contained in a MarshalByRefObject.
6281
6282         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
6283         another compiler type.
6284
6285 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6286
6287         * class.cs (Indexer.Define): use the new name checking method.
6288         Also, return false on an error.
6289         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
6290         (is_identifier_[start/part]_character): make static.
6291
6292 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
6293
6294         * expression.cs (Binary.ResolveOperator): Do no append strings
6295         twice: since we can be invoked more than once (array evaluation)
6296         on the same concatenation, take care of this here.  Based on a fix
6297         from Ben (bug #56454)
6298
6299 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6300
6301         * codegen.cs: Fix another case where CS1548 must be reported (when 
6302         delay-sign isn't specified and no private is available #56564). Fix
6303         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6304         error when MCS is used on the MS runtime and we need to delay-sign 
6305         (which seems unsupported by AssemblyBuilder - see #56621).
6306
6307 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
6308
6309         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
6310         (TypeManager.ComputeNamespaces): Faster implementation for
6311         Microsoft runtime.
6312
6313         * compiler.csproj: Updated AssemblyName to mcs.
6314
6315 2004-05-11  Jackson Harper  <jackson@ximian.com>
6316
6317         * Makefile: Preserve MONO_PATH
6318         
6319 2004-05-11  Jackson Harper  <jackson@ximian.com>
6320
6321         * Makefile: Use mono and mcs to build gmcs
6322         
6323 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
6324
6325         * codegen.cs: Add patch from Robert Shade
6326         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
6327         sync with mcs.
6328
6329 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
6330
6331         * CryptoConvert.cs: Updated to latest version. Fix issue with 
6332         incomplete key pairs (#57941).
6333
6334 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
6335
6336         * codegen.cs: Fix another case where CS1548 must be reported (when 
6337         delay-sign isn't specified and no private is available #56564). Fix
6338         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
6339         error when MCS is used on the MS runtime and we need to delay-sign 
6340         (which seems unsupported by AssemblyBuilder - see #56621).
6341
6342 2004-04-29  Jackson Harper  <jackson@ximian.com>
6343
6344         * Makefile: Set MONO_PATH to use the bootstrap corlib
6345         * driver.cs: Check the GAC for referenced assemblies.
6346                 
6347 2004-04-29  Martin Baulig  <martin@ximian.com>
6348
6349         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
6350
6351 2004-04-07  Martin Baulig  <martin@ximian.com>
6352
6353         * expression.cs (Binary.ResolveOperator): Added special case for
6354         Equality/Inequality between a type parameter and a null literal.
6355
6356 2004-04-07  Martin Baulig  <martin@ximian.com>
6357
6358         * convert.cs: Check null literal -> type parameter conversions.
6359
6360 2004-04-07  Martin Baulig  <martin@ximian.com>
6361
6362         * generic.cs (ConstructedType.CheckConstraints): Enforce the
6363         `class' and `struct' constraints.
6364
6365 2004-04-07  Martin Baulig  <martin@ximian.com>
6366
6367         * generic.cs (SpecialConstraint): New public enum.
6368         (Constraints.Resolve): Added support for the `class' and `struct'
6369         constraints.
6370
6371         * cs-parser.jay (type_parameter_constraint): Added support for the
6372         `class' and `struct' constraints.
6373
6374 2004-04-07  Martin Baulig  <martin@ximian.com>
6375
6376         * support.cs (GenericConstraints): Replaced `Types' by
6377         `ClassConstraint' and `InterfaceConstraints'; added
6378         `HasClassConstraint'.   
6379
6380 2004-04-07  Martin Baulig  <martin@ximian.com>
6381
6382         * generic.cs
6383         (Constraints.InterfaceConstraints): New public property.
6384         (Constraints.Types): Make this property public
6385         (TypeParameter): Implement IMemberContainer.
6386         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
6387         instead of a TypeBuilder/MethodBuilder; pass the interface
6388         constraints to TypeManager.AddTypeParameter().
6389         (TypeParameter.DefineType): Just take an EmitContext and no
6390         TypeBuilder/MethodBuilder.  Use the new public API.
6391
6392         * typemanager.cs (TypeManager.AddTypeParameter): Added
6393         `TypeExpr[]' argument; add the interfaces to the
6394         `builder_to_ifaces' hash.
6395         (TypeManager.LookupMemberContainer): For
6396         GenericTypeParameterBuilders, get the TypeParameter from the
6397         `builder_to_type_param'.
6398         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
6399         the TypeParameter and call FindMembers on it.
6400
6401 2004-04-07  Martin Baulig  <martin@ximian.com>
6402
6403         * class.cs
6404         (MethodCore.GenericMethod): Moved this field here from Method.
6405         (MethodCore.IsDuplicateImplementation): Take the number of type
6406         parameters into account if we're a generic method.
6407
6408         * expression.cs (Invocation.InferTypeArguments): Don't return true
6409         if `arguments' is null; we still need to check whether we actually
6410         don't need to infer anything in this case.
6411         (MemberAccess): Merged the functionality from GenericMemberAccess
6412         into this class.
6413
6414         * generic.cs (GenericMemberAccess): Removed.
6415
6416 2004-04-05  Martin Baulig  <martin@ximian.com>
6417
6418         * decl.cs (MemberCore): For generic classes, interfaces and
6419         structs, `Name' now includes the number of type parameters
6420         ("Stack!1.Node!1").
6421         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
6422         encode the number of type arguments in the type name.
6423
6424         * expression.cs (Expression.MemberLookup): Removed the
6425         `num_type_args' argument; we now encode the number of type
6426         arguments in the type name.
6427
6428         * ecore.cs (SimpleName): Encode the number of type arguments in
6429         the type name itself.
6430
6431         * generic.cs (ConstructedType): Likewise.
6432
6433         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
6434         `MemberName'; we now include the number of type parameters in the
6435         type name.
6436
6437         * typemanager.cs (TypeManager.CheckGeneric): Removed.
6438         (TypeManager.MemberLookup): Removed the
6439         `num_type_args' argument; we now encode the number of type
6440         arguments in the type name.     
6441
6442 2004-04-03  Martin Baulig  <martin@ximian.com>
6443
6444         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
6445         (MemberCore.MemberName): Moved here from MemberBase.
6446         (DeclSpace.SetParameterInfo): Just take the constraints as an
6447         ArrayList; we already have the type parameters in our
6448         `MemberName'; also do the CS0080 reporting here.
6449
6450         * cs-parser.jay (struct_declaration): Use `member_name' instead of
6451         `IDENTIFIER opt_type_parameter_list'; when constructing our
6452         `MemberName', it'll already include our type parameters.
6453         (class_declaration, interface_declaration): Likewise.
6454         (delegate_declaration): Likewise.
6455         (MakeName): Take a MemberName and return a MemberName.
6456         The following two changes are required to avoid shift/reduce conflicts:
6457         (member_name): Don't include a TypeName anymore; ie. this is now
6458         just 'IDENTIFIER opt_type_parameter_list'.
6459         (property_declaration, event_declaration): Use a
6460         `namespace_or_type_name' instead of a `member_name'.            
6461
6462 2004-04-03  Martin Baulig  <martin@ximian.com>
6463
6464         * decl.cs (MemberName): Renamed to `TypeName' and created a new
6465         `MemberName' class.
6466         (TypeName): Formerly known as MemberName.
6467
6468         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
6469         instead of a `MemberName'.
6470
6471         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
6472         (member_name): New rule; create a MemberName.
6473
6474 2004-04-02  Martin Baulig  <martin@ximian.com>
6475
6476         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
6477         (CS0305 and CS0308).
6478
6479 2004-04-02  Martin Baulig  <martin@ximian.com>
6480
6481         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
6482         support for nested types.
6483
6484 2004-04-02  Martin Baulig  <martin@ximian.com>
6485
6486         * ecore.cs (IAlias): New public interface.
6487         (TypeExpr, TypeExpression): Implement IAlias.
6488         (TypeAliasExpression): New public class.
6489
6490         * namespace.cs (Namespace): Implement IAlias.
6491         (Namespace.Lookup): Return an IAlias instead on an object.
6492         (Namespace.DefineName): Take an IAlias instead of an object.
6493         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
6494         an object.
6495         (NamespaceEntry.UsingAlias): Take a Membername instead of an
6496         Expression.
6497         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
6498         object.
6499         (NamespaceEntry.Lookup): Likewise.
6500
6501         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
6502         instead of a Type.      
6503
6504         * decl.cs (DeclSpace): Implement IAlias.
6505         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
6506
6507         * generic.cs (ConstructedType): Improved error checking.
6508
6509 2004-04-02  Martin Baulig  <martin@ximian.com>
6510
6511         * convert.cs: Added type parameter conversions.
6512
6513         * ecore.cs
6514         (UnboxCast.Emit): Emit an `unbox.any' for type params.
6515         (ClassCast.Emit): If the source type is a type parameter, box it.
6516         If the target type is a type parameter, emit an `unbox.any'
6517         instead of a `classcast'.1      
6518
6519 2004-04-01  Martin Baulig  <martin@ximian.com>
6520
6521         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
6522
6523 2004-04-01  Martin Baulig  <martin@ximian.com>
6524
6525         * generic.cs (ConstructedType.CheckConstraints): Use
6526         Convert.ImplicitStandardConversionExists(); user-defined implicit
6527         conversions are not allowed according to the spec.
6528
6529 2004-03-30  Martin Baulig  <martin@ximian.com>
6530
6531         * expression.cs (New): Added support for type parameters.
6532
6533         * typemanager.cs
6534         (TypeManager.activator_type): New public static field.
6535         (TypeManager.activator_create_instance): Likewise.
6536
6537 2004-03-30  Martin Baulig  <martin@ximian.com>
6538
6539         * typemanager.cs (TypeManager.HasConstructorConstraint): New
6540         public method.
6541
6542 2004-03-30  Martin Baulig  <martin@ximian.com>
6543
6544         * generic.cs (ConstructedType.CheckConstraints): Actually follow
6545         the spec here: the argument type must be convertible to the
6546         constraints.
6547
6548 2004-03-30  Martin Baulig  <martin@ximian.com>
6549
6550         * generic.cs
6551         (TypeParameter.Define, TypeParameter.DefineMethod): Call
6552         TypeManager.AddTypeParameter().
6553         (ConstructedType.CheckConstraints): Re-enable this and actually
6554         check whether we have a constructor constraint.
6555
6556         * typemanager.cs
6557         (TypeManager.builder_to_type_param): New static field.
6558         (TypeManager.AddTypeParameter): New static method.
6559         (TypeManager.LookupTypeParameter): New public method.
6560
6561 2004-03-30  Martin Baulig  <martin@ximian.com>
6562
6563         * generic.cs (TypeParameter.DefineType): Return a boolean and use
6564         the new API to actually define the constructor constraint.
6565
6566         * typemanager.cs
6567         (TypeManager.new_constraint_attr_type): New static field.
6568         (TypeManager.InitCoreTypes): Initialize it.
6569
6570 2004-03-30  Martin Baulig  <martin@ximian.com>
6571
6572         * generic.cs (Constraints): Completed error checking, use correct
6573         error numbers.
6574
6575 2004-03-29  Martin Baulig  <martin@ximian.com>
6576
6577         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
6578
6579         * expression.cs (Invocation.InferTypeArguments): Added overloaded
6580         public version which takes a `ParameterData pd' instead of an
6581         `ArrayList args'.
6582
6583 2004-03-29  Martin Baulig  <martin@ximian.com>
6584
6585         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
6586         not a MethodInfo.       
6587
6588 2004-03-29  Martin Baulig  <martin@ximian.com>
6589
6590         * expression.cs (Argument.ResolveMethodGroup): If we're a
6591         ConstructedType, call GetMemberAccess() on it.  
6592
6593 2004-03-29  Martin Baulig  <martin@ximian.com>
6594
6595         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
6596         (MethodCore.CheckGenericOverride): When overriding a generic
6597         method, check whether the constraints match.
6598
6599         * support.cs (GenericConstraints): New public interface.
6600         (ParameterData.GenericConstraints): New public method.
6601
6602         * parameter.cs (Parameter.Resolve): Check whether we're a generic
6603         method parameter and compute our constraints if appropriate.
6604         (Parameter.GenericConstraints): New public property.
6605
6606         * generic.cs (Constraints): Implement GenericConstraints.
6607
6608 2004-03-29  Martin Baulig  <martin@ximian.com>
6609
6610         * decl.cs (MemberCache.FindMemberToOverride): Use
6611         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
6612
6613 2004-03-29  Martin Baulig  <martin@ximian.com>
6614
6615         * generic.cs (GenericMethod.Define): Resolve our type parameters.
6616
6617 2004-03-29  Martin Baulig  <martin@ximian.com>
6618
6619         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
6620         not allowed on non-generic declarations").
6621
6622 2004-03-29  Martin Baulig  <martin@ximian.com>
6623
6624         * expression.cs (Invocation.InferTypeArguments): Added overloaded
6625         public version of this method.
6626
6627         * class.cs (MethodCore.IsDuplicateImplementation): Use
6628         Invocation.InferTypeArguments() to check this.
6629
6630 2004-03-29  Martin Baulig  <martin@ximian.com>
6631
6632         * convert.cs: Use TypeManager.IsDelegateType() instead of
6633         comparing types correctly.
6634
6635 2004-03-29  Martin Baulig  <martin@ximian.com>
6636
6637         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
6638         types directly to make it work for generic instances.
6639
6640         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
6641
6642 2004-03-29  Martin Baulig  <martin@ximian.com>
6643
6644         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
6645         support for arrays.     
6646
6647 2004-03-24  Martin Baulig  <martin@ximian.com>
6648
6649         * decl.cs (DeclSpace.FindType): Also use
6650         TypeManager.CheckGeneric() for types from the using clauses.
6651
6652 2004-03-23  Martin Baulig  <martin@ximian.com>
6653
6654         * expression.cs (Invocation.OverloadResolve): Added `bool
6655         may_fail' argument and use it instead of the Location.IsNull() hack.
6656
6657 2004-03-23  Martin Baulig  <martin@ximian.com>
6658
6659         * expression.cs (Invocation.InferType): Use correct type inference
6660         rules here.     
6661
6662 2004-03-23  Martin Baulig  <martin@ximian.com>
6663
6664         * ecore.cs (MethodGroupExpr.Name): Use
6665         TypeManager.CSharpSignature() instead of just the name.
6666
6667         * expression.cs (Invocation.OverloadResolve): Provide better error
6668         reporting.
6669         (Invocation.DoResolve): OverloadResolve() never returns null
6670         without reporting an error, so removed the error -6 reporting here.
6671
6672 2004-03-23  Martin Baulig  <martin@ximian.com>
6673
6674         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
6675         generic methods.
6676
6677         * cs-parser.jay (delegate_declaration): Support generic delegates.
6678
6679         * delegate.cs: Support generic delegates.
6680
6681 2004-03-22  Martin Baulig  <martin@ximian.com>
6682
6683         * expression.cs (Invocation.InferParamsTypeArguments): New static
6684         method; does type inference for params arguments.
6685
6686 2004-03-21  Martin Baulig  <martin@ximian.com>
6687
6688         * typemanager.cs (TypeManager.IsGenericMethod): New public static
6689         method; checks whether a method is a generic method.    
6690
6691         * expression.cs (Invocation.InferTypeArguments): New static method;
6692         infer type arguments for generic method invocation.
6693
6694         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
6695         property; we set this to true if we're resolving a generic method
6696         invocation and the user specified type arguments, ie. we're not
6697         doing type inference.
6698
6699 2004-03-20  Martin Baulig  <martin@ximian.com>
6700
6701         * class.cs (MethodData.DeclaringType): New public property.
6702         (MethodData.Define): Set DeclaringType here.
6703         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
6704         instead of OperatorMethodBuilder.DeclaringType.
6705
6706 2004-03-20  Martin Baulig  <martin@ximian.com>
6707
6708         * cs-tokenizer.cs (xtoken): Return a special
6709         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
6710
6711         * cs-parser.jay (default_value_expression): Switch to the new
6712         syntax (14.5.13).
6713
6714 2004-03-19  Martin Baulig  <martin@ximian.com>
6715
6716         * decl.cs (MemberName): New class.  We use this to "construct"
6717         namespace_or_type_name's.
6718
6719         * generics.cs (TypeArguments.GetDeclarations): New public method;
6720         returns the type arguments as a string[] and reports a CS0081 if
6721         one of them is not an identifier.
6722
6723         * class.cs (MemberBase): The .ctor now takes the name as a
6724         MemberName instead of a string.
6725         (MemberBase.ExplicitInterfaceName): Changed type from string to
6726         Expression.
6727         (MemberBase.DoDefine): If we're an explicit implementation, the
6728         InterfaceType may be a generic instance.
6729
6730         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
6731         (namespace_name): Call MemberName.GetName () to transform the
6732         MemberName into a string and ensure we don't have any type
6733         arguments.
6734         (type_name): Call MemberName.GetTypeExpression() to transfrom the
6735         MemberName into an expression.
6736         (method_header): Use namespace_or_type_name instead of member_name.     
6737
6738 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
6739
6740         * rootcontext.cs: Add new types to the boot resolution.
6741
6742         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
6743         MulticastDelegate is not allowed.
6744
6745         * typemanager.cs: Add new types to lookup: System.TypedReference
6746         and ArgIterator.
6747
6748         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
6749         check for TypedReference or ArgIterator, they are not allowed. 
6750
6751         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
6752         makes us properly catch 1510 in some conditions (see bug 56016 for
6753         details). 
6754
6755 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
6756
6757         * CryptoConvert.cs: update from corlib version
6758         with endian fixes.
6759
6760 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
6761
6762         * class.cs (Indexer.Define): Check indexername declaration
6763
6764 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
6765
6766         * attribute.cs (IsClsCompliant): Fixed problem with handling
6767         all three states (compliant, not-compliant, undetected).
6768
6769 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
6770
6771         * attribute.cs (Attribute): Location is now public.
6772         (Resolve): Store resolved arguments (pos_values) in attribute class.
6773         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
6774         (GetClsCompliantAttributeValue): New method that gets
6775         CLSCompliantAttribute value.
6776         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
6777         if exists else null.
6778         (AttributeTester): New class for CLS-Compliant verification routines.
6779
6780         * class.cs (Emit): Add CLS-Compliant verification.
6781         (Method.GetSignatureForError): Implemented.
6782         (Constructor.GetSignatureForError): Implemented
6783         (Constructor.HasCompliantArgs): Returns if constructor has
6784         CLS-Compliant arguments.
6785         (Constructor.Emit): Override.
6786         (Construcor.IsIdentifierClsCompliant): New method; For constructors
6787         is needed to test only parameters.
6788         (FieldBase.GetSignatureForError): Implemented.
6789         (TypeContainer): New member for storing base interfaces.
6790         (TypeContainer.FindMembers): Search in base interfaces too.
6791
6792         * codegen.cs (GetClsComplianceAttribute): New method that gets
6793         assembly or module CLSCompliantAttribute value.
6794         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
6795         for assembly.
6796         (ModuleClass.Emit): Add error 3012 test.
6797
6798         * const.cs (Emit): Override and call base for CLS-Compliant tests.
6799
6800         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
6801         state for all decl types.
6802         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
6803         if CLS-Compliant tests are required.
6804         (IsClsCompliaceRequired): New method. Analyze whether code
6805         must be CLS-Compliant.
6806         (IsExposedFromAssembly): New method. Returns true when MemberCore
6807         is exposed from assembly.
6808         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
6809         value or gets cached value.
6810         (HasClsCompliantAttribute): New method. Returns true if MemberCore
6811         is explicitly marked with CLSCompliantAttribute.
6812         (IsIdentifierClsCompliant): New abstract method. This method is
6813         used to testing error 3005.
6814         (IsIdentifierAndParamClsCompliant): New method. Common helper method
6815         for identifier and parameters CLS-Compliant testing.
6816         (VerifyClsCompliance): New method. The main virtual method for
6817         CLS-Compliant verifications.
6818         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
6819         null. I don't know why is null (too many public members !).
6820         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
6821         and get value of first CLSCompliantAttribute that found.
6822
6823         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
6824         (VerifyClsCompliance): Override and add extra tests.
6825
6826         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
6827         clscheck- disable CLS-Compliant verification event if assembly is has
6828         CLSCompliantAttribute(true).
6829
6830         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
6831         ApllyAttribute is now called in emit section as in the other cases.
6832         Possible future Emit integration.
6833         (IsIdentifierClsCompliant): New override.
6834         (VerifyClsCompliance): New override.
6835         (GetEnumeratorName): Returns full enum name.
6836
6837         * parameter.cs (GetSignatureForError): Implemented.
6838
6839         * report.cs (WarningData): New struct for Warning message information.
6840         (LocationOfPreviousError): New method.
6841         (Warning): New method. Reports warning based on the warning table.
6842         (Error_T): New method. Reports error based on the error table.
6843
6844         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
6845         verifications are done here.
6846
6847         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
6848
6849         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
6850         CLSCompliantAttribute.
6851         (all_imported_types): New member holds all imported types from other
6852         assemblies.
6853         (LoadAllImportedTypes): New method fills static table with exported types
6854         from all referenced assemblies.
6855         (Modules): New property returns all assembly modules.
6856
6857 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
6858
6859         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
6860         throwing a parser error.
6861
6862         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
6863         which removes the hardcoded get_/set_ prefixes for properties, as
6864         IL allows for the properties to be named something else.  
6865
6866         Bug #56013
6867
6868         * expression.cs: Do not override operand before we know if it is
6869         non-null.  Fix 56207
6870
6871 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6872
6873         * typemanager.cs: support for pinned variables.
6874
6875 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6876
6877         * decl.cs, typemanager.cs: Avoid using an arraylist
6878         as a buffer if there is only one result set.
6879
6880 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6881
6882         * expression.cs: Make sure you cant call a static method
6883         with an instance expression, bug #56174.
6884
6885 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
6886
6887         * class.cs (IsDuplicateImplementation): Improve error reporting to
6888         flag 663 (method only differs in parameter modifier).
6889
6890         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
6891         in preprocessor directives.
6892
6893         * location.cs (LookupFile): Allow for the empty path.
6894
6895         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
6896         better approach for some of that patch, but its failing with the
6897         CharSet enumeration.  For now try/catch will do.
6898
6899         * typemanager.cs: Do not crash if a struct does not have fields.
6900         Fixes 56150.
6901
6902 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6903
6904         * expression.cs: cs0213, cant fix a fixed expression.
6905         fixes 50231.
6906
6907 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6908
6909         * cs-parser.jay: detect invalid embeded statements gracefully.
6910         bug #51113.
6911
6912 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6913
6914         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
6915         As a regex:
6916         s/
6917         the invocation type may not be a subclass of the tye of the item/
6918         The type of the item must be a subclass of the invocation item.
6919         /g
6920
6921         Fixes bug #50820.
6922
6923 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
6924
6925         * attribute.cs: Added methods to get a string and a bool from an
6926         attribute. Required to information from AssemblyKeyFileAttribute,
6927         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
6928         * codegen.cs: Modified AssemblyName creation to include support for
6929         strongnames. Catch additional exceptions to report them as CS1548.
6930         * compiler.csproj: Updated include CryptoConvert.cs.
6931         * compiler.csproj.user: Removed file - user specific configuration.
6932         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
6933         Mono.Security assembly. The original class is maintained and tested in
6934         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
6935         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
6936         like CSC 8.0 (C# v2) supports.
6937         * Makefile: Added CryptoConvert.cs to mcs sources.
6938         * rootcontext.cs: Added new options for strongnames.
6939
6940 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
6941
6942         * driver.cs: For --expect-error, report error code `2'
6943         if the program compiled with no errors, error code `1' if
6944         it compiled with an error other than the one expected.
6945
6946 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
6947
6948         * compiler.csproj: Updated for Visual Studio .NET 2003.
6949         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
6950         * compiler.sln: Updated for Visual Studio .NET 2003.
6951
6952 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
6953
6954         * expression.cs: Fix bug #47234. We basically need to apply the
6955         rule that we prefer the conversion of null to a reference type
6956         when faced with a conversion to 'object' (csc behaviour).
6957
6958 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6959
6960         * statement.cs: Shorter form for foreach, eliminates
6961         a local variable. r=Martin.
6962
6963 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6964
6965         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
6966         checks if we can use brtrue/brfalse to test for 0.
6967         * expression.cs: use the above in the test for using brtrue/brfalse.
6968         cleanup code a bit.
6969
6970 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6971
6972         * expression.cs: Rewrite string concat stuff. Benefits:
6973
6974         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
6975         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
6976         rather than a concat chain.
6977
6978         * typemanager.cs: Add lookups for more concat overloads.
6979
6980 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
6981
6982         * expression.cs: Emit shorter il code for array init.
6983
6984         newarr
6985         dup
6986         // set 1
6987
6988         // set 2
6989
6990         newarr
6991         stloc.x
6992
6993         ldloc.x
6994         // set 1
6995
6996         ldloc.x
6997         // set 2
6998
6999 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
7000
7001         * statement.cs: Before, two switch blocks would be merged if the
7002         total size of the blocks (end_item - begin_item + 1) was less than
7003         two times the combined sizes of the blocks.
7004
7005         Now, it will only merge if after the merge at least half of the
7006         slots are filled.
7007
7008         fixes 55885.
7009
7010 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
7011
7012         * class.cs : csc build fix for GetMethods(). See bug #52503.
7013
7014 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
7015
7016         * expression.cs: Make sure fp comparisons work with NaN.
7017         This fixes bug #54303. Mig approved this patch a long
7018         time ago, but we were not able to test b/c the runtime
7019         had a related bug.
7020
7021 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
7022
7023         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
7024
7025 2004-03-19  Martin Baulig  <martin@ximian.com>
7026
7027         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
7028         two overloads may unify for some type parameter substitutions and
7029         report a CS0408 if appropriate.
7030
7031 2004-03-19  Martin Baulig  <martin@ximian.com>
7032
7033         * class.cs (MemberCore.IsDuplicateImplementation): Report the
7034         error here and not in our caller.
7035
7036 2004-03-19  Martin Baulig  <martin@ximian.com>
7037
7038         * interface.cs: Completely killed this file.
7039         (Interface): We're now a TypeContainer and live in class.cs.
7040
7041         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
7042         argument; we're now also called for interfaces.
7043         (TypeContainer.DefineMembers): Allow this method being called
7044         multiple times.
7045         (TypeContainer.GetMethods): New public method; formerly known as
7046         Interface.GetMethod().  This is used by PendingImplementation.
7047         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
7048         it's now private and non-static.
7049         (Interface): Moved this here; it's now implemented similar to
7050         Class and Struct.
7051         (Method, Property, Event, Indexer): Added `bool is_interface'
7052         argument to their .ctor's.
7053         (MemberBase.IsInterface): New public field.
7054
7055         * cs-parser.jay: Create normal Method, Property, Event, Indexer
7056         instances instead of InterfaceMethod, InterfaceProperty, etc.
7057         (opt_interface_base): Removed; we now use `opt_class_base' instead.
7058         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
7059
7060 2004-03-19  Martin Baulig  <martin@ximian.com>
7061
7062         * class.cs (MethodCore.IsDuplicateImplementation): New private
7063         method which does the CS0111 checking.
7064         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
7065         Use IsDuplicateImplementation().
7066
7067 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
7068
7069         * decl.cs (FindMemberToOverride): New method to find the correct
7070         method or property to override in the base class.
7071         * class.cs
7072             - Make Method/Property use the above method to find the
7073               version in the base class.
7074             - Remove the InheritableMemberSignatureCompare as it is now
7075               dead code.
7076
7077         This patch makes large code bases much faster to compile, as it is
7078         O(n) rather than O(n^2) to do this validation.
7079
7080         Also, it fixes bug 52458 which is that nested classes are not
7081         taken into account when finding the base class member.
7082
7083         Reviewed/Approved by Martin.
7084
7085 2004-03-17  Martin Baulig  <martin@ximian.com>
7086
7087         * expression.cs (MemberAccess.DoResolve): Take the parent's number
7088         of type arguments into account; use the `real_num_type_args'
7089         approach like in DoResolveAsTypeStep().
7090
7091         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
7092         nested types.
7093
7094 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
7095
7096         * interface.cs: In all interface classes removed redundant
7097         member initialization.
7098
7099 2004-03-16  Martin Baulig  <martin@ximian.com>
7100
7101         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7102
7103 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7104
7105         * decl.cs (DefineTypeAndParents): New helper method to define a
7106         type's containers before the type itself is defined;  This is a
7107         bug exposed by the recent changes to Windows.Forms when an
7108         implemented interface was defined inside a class that had not been
7109         built yet.   
7110
7111         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
7112
7113         (Check): Loop correctly to report errors modifiers
7114         (UNSAFE was not in the loop, since it was the same as TOP).
7115
7116         * interface.cs: Every interface member now takes a ModFlags,
7117         instead of a "is_new" bool, which we set on the base MemberCore. 
7118
7119         Every place where we called "UnsafeOk" in the interface, now we
7120         call the proper member (InterfaceMethod.UnsafeOK) instead to get
7121         the unsafe settings from the member declaration instead of the
7122         container interface. 
7123
7124         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
7125
7126         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7127         `set_indexer_name' to the pending bits (one per type).
7128
7129         We fixed a bug today that was picking the wrong method to
7130         override, since for properties the existing InterfaceMethod code
7131         basically ignored the method name.  Now we make sure that the
7132         method name is one of the valid indexer names.
7133
7134 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
7135  
7136         * support.cs (SeekableStreamReader): Keep track of stream byte
7137         positions and don't mix them with character offsets to the buffer.
7138
7139         Patch from Gustavo Giráldez
7140
7141 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
7142
7143         * interface.cs (InterfaceSetGetBase): Removed double member
7144         initialization, base class does it as well.
7145
7146 2004-03-13  Martin Baulig  <martin@ximian.com>
7147
7148         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
7149         when compiling corlib.
7150
7151 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
7152
7153         * convert.cs (ExplicitConversion): We were reporting an error on
7154         certain conversions (object_type source to a value type, when the
7155         expression was `null') before we had a chance to pass it through
7156         the user defined conversions.
7157
7158         * driver.cs: Replace / and \ in resource specifications to dots.
7159         Fixes 50752
7160
7161         * class.cs: Add check for duplicate operators.  Fixes 52477
7162
7163 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
7164
7165         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
7166         that are in the middle of the statements, not only at the end.
7167         Fixes #54987
7168
7169         * class.cs (TypeContainer.AddField): No longer set the
7170         `HaveStaticConstructor' flag, now we call it
7171         `UserDefineStaticConstructor' to diferentiate the slightly
7172         semantic difference.
7173
7174         The situation is that we were not adding BeforeFieldInit (from
7175         Modifiers.TypeAttr) to classes that could have it.
7176         BeforeFieldInit should be set to classes that have no static
7177         constructor. 
7178
7179         See:
7180
7181         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
7182
7183         And most importantly Zoltan's comment:
7184
7185         http://bugzilla.ximian.com/show_bug.cgi?id=44229
7186
7187         "I think beforefieldinit means 'it's ok to initialize the type sometime 
7188          before its static fields are used', i.e. initialization does not need
7189          to be triggered by the first access to the type. Setting this flag
7190          helps the JIT to compile better code, since it can run the static
7191          constructor at JIT time, and does not need to generate code to call it
7192          (possibly lots of times) at runtime. Unfortunately, mcs does not set
7193          this flag for lots of classes like String. 
7194          
7195          csc sets this flag if the type does not have an explicit static 
7196          constructor. The reasoning seems to be that if there are only static
7197          initalizers for a type, and no static constructor, then the programmer
7198          does not care when this initialization happens, so beforefieldinit
7199          can be used.
7200          
7201          This bug prevents the AOT compiler from being usable, since it 
7202          generates so many calls to mono_runtime_class_init that the AOT code
7203          is much slower than the JITted code. The JITted code is faster, 
7204          because it does not generate these calls if the vtable is type is
7205          already initialized, which is true in the majority of cases. But the
7206          AOT compiler can't do this."
7207
7208 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
7209
7210         * class.cs (MethodData.Emit): Refactor the code so symbolic
7211         information is generated for destructors;  For some reasons we
7212         were taking a code path that did not generate symbolic information
7213         before. 
7214
7215 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7216
7217         * class.cs: Create a Constructor.CheckBase method that
7218         takes care of all validation type code. The method
7219         contains some code that was moved from Define.
7220
7221         It also includes new code that checks for duplicate ctors.
7222         This fixes bug #55148.
7223
7224 2004-03-09  Joshua Tauberer <tauberer@for.net>
7225
7226         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
7227         a { ... }-style array creation invokes EmitStaticInitializers
7228         which is not good for reference-type arrays.  String, decimal
7229         and now null constants (NullCast) are not counted toward
7230         static initializers.
7231
7232 2004-03-05  Martin Baulig  <martin@ximian.com>
7233
7234         * location.cs (SourceFile.HasLineDirective): New public field;
7235         specifies whether the file contains or is referenced by a "#line"
7236         directive.
7237         (Location.DefineSymbolDocuments): Ignore source files which
7238         either contain or are referenced by a "#line" directive.        
7239
7240 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
7241
7242         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
7243         direct access to our parent, so check the method inline there.
7244
7245 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
7246
7247         * expression.cs (Invocation.EmitCall): Miguel's last commit
7248         caused a regression. If you had:
7249
7250             T t = null;
7251             t.Foo ();
7252
7253         In Foo the implict this would be null.
7254
7255 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
7256
7257         * expression.cs (Invocation.EmitCall): If the method is not
7258         virtual, do not emit a CallVirt to it, use Call.
7259
7260         * typemanager.cs (GetFullNameSignature): Improve the method to
7261         cope with ".ctor" and replace it with the type name.
7262
7263         * class.cs (ConstructorInitializer.Resolve): Now the method takes
7264         as an argument the ConstructorBuilder where it is being defined,
7265         to catch the recursive constructor invocations.
7266
7267 2004-03-16  Martin Baulig  <martin@ximian.com>
7268
7269         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
7270         ConstructedType, call ResolveType() on it to get the type rather
7271         than just using `expr.Type'.
7272
7273 2004-03-16  Martin Baulig  <martin@ximian.com>
7274
7275         * generics.cs (ConstructedType.GetMemberAccess): Take the
7276         EmitContext instead on the TypeExpr and use
7277         ec.TypeContainer.CurrentType/ec.ContainerType.
7278
7279 2004-03-16  Martin Baulig  <martin@ximian.com>
7280
7281         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
7282         parameters before aliases.
7283
7284 2004-03-16  Martin Baulig  <martin@ximian.com>
7285
7286         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
7287         New oublic function; checks whether two generic instances may become
7288         equal under some instantiations (26.3.1).
7289
7290         * class.cs (TypeContainer.Define): Call
7291         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
7292         error.
7293
7294 2004-03-16  Martin Baulig  <martin@ximian.com>
7295
7296         * class.cs (TypeContainer.GetClassBases): Moved
7297         Error_TypeParameterAsBase() here and also check whether the base
7298         class is not an attribute.
7299
7300 2004-03-16  Martin Baulig  <martin@ximian.com>
7301
7302         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
7303
7304 2004-03-16  Martin Baulig  <martin@ximian.com>
7305
7306         * class.cs (Error_TypeParameterAsBase): Use correct error number
7307         here (CS0689).  
7308
7309 2004-03-16  Martin Baulig  <martin@ximian.com>
7310
7311         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
7312         for generics.
7313
7314         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
7315         error reporting.
7316
7317 2004-03-15  Martin Baulig  <martin@ximian.com>
7318
7319         * typemanager.cs (TypeManager.GetFullName): New public method.
7320         (TypeManager.MemberLookup): Added `int_num_type_arguments'
7321         argument; only return members with the correct number of type
7322         arguments.
7323         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
7324         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
7325         whether the number of type arguments matches.
7326
7327         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
7328         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
7329
7330         * expression.cs (MemberAccess): Added public `NumTypeArguments'
7331         field; it's set by the protected .ctor when we're actually a
7332         GenericMemberAccess.
7333         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
7334         arguments and pass it to MemberLookupFinal ().
7335
7336         * ecore.cs (Expression.MemberLookup): Added `int
7337         num_type_arguments' argument; only return members with the correct
7338         number of type arguments.
7339         (Expression.MemberLookupFailed): Check whether the MemberLookup
7340         failed because we did not have the correct number of type
7341         arguments; report CS0305 in this case.
7342
7343         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
7344         `e.ResolveAsTypeTerminal()' already did so.
7345
7346 2004-03-15  Martin Baulig  <martin@ximian.com>
7347
7348         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
7349         we're a ConstructedType; in this case, the caller must report an
7350         error (for instance CS0131).
7351
7352         * generic.cs (TypeArguments): Added Location argument to the .ctor.
7353         (TypeArguments.Resolve): Actually report errors here.
7354
7355 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
7356
7357         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
7358         `set_indexer_name' to the pending bits (one per type).
7359
7360         We fixed a bug today that was picking the wrong method to
7361         override, since for properties the existing InterfaceMethod code
7362         basically ignored the method name.  Now we make sure that the
7363         method name is one of the valid indexer names.
7364
7365 2004-03-15  Martin Baulig  <martin@ximian.com>
7366
7367         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
7368         for generic instances.
7369
7370 2004-03-13  Martin Baulig  <martin@ximian.com>
7371
7372         * class.cs (TypeContainer.DefineType): Call
7373         TypeManager.AddUserType() immediately after creating the
7374         TypeBuilder; pass all type parameters when creating the
7375         CurrentType.
7376
7377         * decl.cs (DeclSpace.FindNestedType): New public method.
7378         (DeclSpace.FindType): Added `int num_type_args' argument; only
7379         return types with the correct number of type parameters.
7380         (DeclSpace.CountTypeParams): New public property.
7381
7382         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
7383         the number of type parameters; defaults to zero.
7384
7385         * generic.cs (TypeArguments.Count): New public property.
7386         (ConstructedType.DoResolveAsTypeStep): First call
7387         ds.FindNestedType() to find out whether we're nested in the
7388         current generic type; in this case, we inherit all type parameters
7389         from the current class.
7390
7391         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
7392         num_type_args' argument.
7393         (RootContext.LookupType): Added overloaded version which takes the
7394         number of type arguments; only return types with the correct
7395         number of type arguments.
7396
7397         * typemanager.cs (TypeManager.CheckGeneric): New public function;
7398         checks whether `Type t' has `int num_type_args'.
7399
7400 2004-03-13  Martin Baulig  <martin@ximian.com>
7401
7402         * generic.cs (GenericMethod.DefineType): New method; calls
7403         DefineType() on all the type parameters.
7404
7405         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
7406         (MethodData.Define): If we're a generic method, call
7407         GenericMethod.DefineType() to define the type parameters.       
7408
7409 2004-03-10  Martin Baulig  <martin@ximian.com>
7410
7411         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
7412         instead of IsAssignableFrom.    
7413
7414 2004-03-10  Martin Baulig  <martin@ximian.com>
7415
7416         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
7417
7418         * support.cs (ParameterData.HasArrayParameter): New property.
7419         (ReflectionParameters.ctor): Take a MethodBase instead of a
7420         ParameterInfo[].  If we have any type parameters, get the generic
7421         method definition and ask it whether we have variable arguments.
7422
7423 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
7424
7425         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
7426         routines to check if a type is an enumerable/enumerator allow
7427         classes that implement the IEnumerable or IEnumerator interfaces.
7428
7429         * class.cs (Property, Operator): Implement IIteratorContainer, and
7430         implement SetYields.
7431
7432         (Property.Define): Do the block swapping for get_methods in the
7433         context of iterators.   We need to check if Properties also
7434         include indexers or not.
7435
7436         (Operator): Assign the Block before invoking the
7437         OperatorMethod.Define, so we can trigger the Iterator code
7438         replacement. 
7439
7440         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
7441         Property and Operator classes are not created when we parse the
7442         declarator but until we have the block completed, so we use a
7443         singleton SimpleIteratorContainer.Simple to flag whether the
7444         SetYields has been invoked.
7445
7446         We propagate this setting then to the Property or the Operator to
7447         allow the `yield' to function.
7448
7449 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
7450
7451         * codegen.cs: Implemented attribute support for modules.
7452         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
7453         Assembly/Module functionality.
7454
7455         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
7456         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
7457         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
7458
7459 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
7460
7461         * interface.cs (FindMembers): The operation is performed on all base
7462         interfaces and not only on the first. It is required for future CLS Compliance patch.
7463
7464 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7465
7466         * statement.cs, codegen.cs:
7467         This patch deals with patterns such as:
7468
7469         public class List : IEnumerable {
7470
7471                 public MyEnumerator GetEnumerator () {
7472                         return new MyEnumerator(this);
7473                 }
7474
7475                 IEnumerator IEnumerable.GetEnumerator () {
7476                         ...
7477                 }
7478                 
7479                 public struct MyEnumerator : IEnumerator {
7480                         ...
7481                 }
7482         }
7483
7484         Before, there were a few things we did wrong:
7485         1) we would emit callvirt on a struct, which is illegal
7486         2) we emited ldarg when we needed to emit ldarga
7487         3) we would mistakenly call the interface methods on an enumerator
7488         type that derived from IEnumerator and was in another assembly. For example:
7489
7490         public class MyEnumerator : IEnumerator
7491
7492         Would have the interface methods called, even if there were public impls of the
7493         method. In a struct, this lead to invalid IL code.
7494
7495 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
7496
7497         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
7498           renamed to Emit.
7499
7500         * delegate.cs (Define): Fixed crash when delegate type is undefined.
7501
7502 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
7503
7504         * cs-parser.jay: Fix small regression: we were not testing V2
7505         compiler features correctly.
7506
7507         * interface.cs: If the emit context is null, then create one
7508
7509 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
7510
7511         * decl.cs (GetSignatureForError): New virtual method to get full name
7512           for error messages.
7513
7514         * attribute.cs (IAttributeSupport): New interface for attribute setting.
7515           Now it is possible to rewrite ApplyAttributes method to be less if/else.
7516
7517         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
7518           Duplicated members and code in these classes has been removed.
7519           Better encapsulation in these classes.
7520
7521 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
7522
7523         * assign.cs (Assign.DoResolve): When dealing with compound
7524         assignments, there is a new rule in ECMA C# 2.4 (might have been
7525         there before, but it is documented here) that states that in:
7526
7527         a op= b;
7528
7529         If b is of type int, and the `op' is a shift-operator, then the
7530         above is evaluated as:
7531
7532         a = (int) a op b 
7533
7534         * expression.cs (Binary.ResolveOperator): Instead of testing for
7535         int/uint/long/ulong, try to implicitly convert to any of those
7536         types and use that in pointer arithmetic.
7537
7538         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
7539         method to print information for from the type, not from the
7540         null-method we were given.
7541
7542 2004-02-01  Duncan Mak  <duncan@ximian.com>
7543
7544         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
7545         parsing for cmd, fixes bug #53694.
7546
7547 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
7548
7549         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
7550         in the member name duplication tests. Property and operator name duplication
7551         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
7552
7553 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
7554
7555         * interface.cs (PopulateMethod): Fixed crash when interface method
7556         returns not existing type (error test cs0246-3.cs).
7557
7558 2004-02-02  Ravi Pratap M <ravi@ximian.com>
7559
7560         * cs-parser.jay (interface_accessors): Re-write actions to also
7561         store attributes attached to get and set methods. Fix spelling
7562         while at it.
7563
7564         (inteface_property_declaration): Modify accordingly.
7565
7566         (InterfaceAccessorInfo): New helper class to store information to pass
7567         around between rules that use interface_accessors.
7568
7569         * interface.cs (Emit): Apply attributes on the get and set
7570         accessors of properties and indexers too.
7571
7572         * attribute.cs (ApplyAttributes): Modify accordingly to use the
7573         right MethodBuilder when applying attributes to the get and set accessors.
7574
7575 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
7576
7577         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
7578
7579 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
7580
7581         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
7582
7583 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
7584
7585         * cs-parser.jay: Remove YIELD token, instead use the new grammar
7586         changes that treat `yield' specially when present before `break'
7587         or `return' tokens.
7588
7589         * cs-tokenizer.cs: yield is no longer a keyword.
7590
7591 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
7594         setting for default constructors.
7595         For default constructors are almost every time set wrong Modifier. The
7596         generated IL code has been alright. But inside mcs this values was
7597         wrong and this was reason why several of my CLS Compliance tests
7598         failed.
7599
7600 2004-02-27  Martin Baulig  <martin@ximian.com>
7601
7602         * generics.cs (ConstructedType.ResolveType): Make the nested type
7603         stuff actually work.
7604
7605 2004-02-25  Martin Baulig  <martin@ximian.com>
7606
7607         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
7608         property; returns the type parameters just from the current type,
7609         ie. with the ones from outer classes.
7610         (DeclSpace.LookupGeneric): First search in the current class, then
7611         in outer classes.
7612         (DeclSpace.initialize_type_params): When hiding a type parameter
7613         from an outer class, put it into the `type_param_list' anyways.
7614
7615         * expression.cs (MemberAccess.expr): Made this field protected.
7616
7617         * class.cs (TypeContainer.Define): The `CurrentType' just contains
7618         the type parameters from the current class.
7619
7620         * generic.cs (ConstructedType.ResolveType): Support nested generic
7621         types by taking the type parameters which we inherit from outer
7622         classes into account.
7623         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
7624         support for nested generic types.
7625
7626 2004-02-23  Martin Baulig  <martin@ximian.com>
7627
7628         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
7629         field and check whether we're nested inside a generic type.
7630         (DeclSpace.ResolveType): If we're resolving to a generic type
7631         definition, create a ConstructedType and return its resolved type.
7632         (DeclSpace.initialize_type_params): New private method;
7633         initializes the `type_param_list' field from the type parameters
7634         from this and all enclosing classes.
7635         (DeclSpace.TypeParameters): Call initialize_type_params() unless
7636         we're already initialized.
7637
7638 2004-02-23  Martin Baulig  <martin@ximian.com>
7639
7640         * class.cs (Method.Define): Create the generic method before
7641         calling DoDefine().
7642         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
7643         the TypeContainer one); we use this for generic methods.
7644
7645         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
7646         parent's TypeBuilder.
7647
7648 2004-02-18  Martin Baulig  <martin@ximian.com>
7649
7650         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
7651         to check for equality.
7652
7653 2004-02-05  Martin Baulig  <martin@ximian.com>
7654
7655         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
7656         `ec.TypeContainer.CurrentType', use it instead of
7657         `ec.ContainerType' to check whether we're in the type's ctor.
7658
7659 2004-01-29  Martin Baulig  <martin@ximian.com>
7660
7661         * expression.cs (Invocation.DoResolve): If we're a
7662         `ConstructedType', then we're actually a generic method, so
7663         rewrite the expr as a GenericMemberAccess.
7664
7665         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
7666         here; manually parse it into a string.
7667
7668 2004-01-28  Martin Baulig  <martin@ximian.com>
7669
7670         * typemanager.cs (TypeManager.IsEqual): New static method.
7671         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
7672         check for equality instead of using `=='.
7673
7674 2004-01-26  Martin Baulig  <martin@ximian.com>
7675
7676         * decl.cs (DeclSpace.CurrentType): New public field.
7677
7678         * expression.cs (This.ResolveBase): If we have an
7679         `ec.TypeContainer.CurrentType', use it instead of
7680         `ec.ContainerType'.
7681
7682         * class.cs (TypeContainer.DefineType): If we're a generic type,
7683         create the `CurrentType' (unresolved).
7684         (TypeContainer.GenericType): New private field.
7685         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
7686         it and store it in `GenericType' before creating the MemberCache.
7687         (TypeContainer.GetMembers): If we have a `GenericType', call
7688         TypeManager.FindMembers() on it.
7689
7690         * interface.cs (Interface.GenericType): New private field.
7691         (Interface.DefineType): If we're a generic type, create the
7692         `CurrentType' (unresolved).
7693         (Interface.DefineMembers): If we have a `CurrentType', resolve it
7694         and store it in `GenericType' before creating the MemberCache.
7695         (Interface.GetMembers): If we have a `GenericType', call
7696         TypeManager.FindMembers() on it.
7697
7698 2004-01-22  Martin Baulig  <martin@ximian.com>
7699
7700         * cs-parser.jay (namespace_or_type_name): Return an Expression,
7701         not a QualifiedIdentifier.  This is what `type_name_expression'
7702         was previously doing.
7703         (type_name_expression): Removed; the code is now in
7704         `namespace_or_type_name'.
7705         (qualified_identifier): Removed, use `namespace_or_type_name'
7706         instead.
7707         (QualifiedIdentifier): Removed this class.      
7708
7709 2004-01-22  Martin Baulig  <martin@ximian.com>
7710
7711         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
7712         not a string as alias name.
7713
7714 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
7715
7716         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
7717         #52730 bug, and instead compute correctly the need to use a
7718         temporary variable when requesting an address based on the
7719         static/instace modified of the field and the constructor.
7720  
7721 2004-01-21  Martin Baulig  <martin@ximian.com>
7722
7723         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
7724         class and namespace before looking up aliases.  Fixes #52517.
7725
7726 2004-01-21  Martin Baulig  <martin@ximian.com>
7727
7728         * flowanalysis.cs (UsageVector.Merge): Allow variables being
7729         assinged in a 'try'; fixes exception4.cs.
7730
7731 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7732         * class.cs : Implemented parameter-less constructor for TypeContainer
7733
7734         * decl.cs: Attributes are now stored here. New property OptAttributes
7735
7736         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
7737
7738         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
7739
7740 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7741
7742         * typemanager.cs (CSharpSignature): Now reports also inner class name.
7743           (CSharpSignature): New method for indexer and property signature.
7744
7745 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7746
7747         * pending.cs (IsVirtualFilter): Faster implementation.
7748
7749 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7750
7751         * typemanager.cs: Avoid inclusion of same assembly more than once.
7752
7753 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7754
7755         * cs-parser.jay: Fixed problem where the last assembly attribute
7756           has been applied also to following declaration (class, struct, etc.)
7757           
7758 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
7759
7760         * class.cs: Added error CS0538, CS0539 reporting.
7761         Fixed crash on Microsoft runtime when field type is void.
7762
7763         * cs-parser.jay: Added error CS0537 reporting.
7764
7765         * pending.cs: Added error CS0535 reporting.
7766         Improved error report for errors CS0536, CS0534.
7767
7768 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
7769
7770         Merge a few bits from the Anonymous Method MCS tree.
7771
7772         * statement.cs (ToplevelBlock): New class for toplevel methods,
7773         will hold anonymous methods, lifted variables.
7774
7775         * cs-parser.jay: Create toplevel blocks for delegates and for
7776         regular blocks of code. 
7777
7778 2004-01-20  Martin Baulig  <martin@ximian.com>
7779
7780         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
7781         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
7782         and `NeedExplicitReturn'; added `IsLastStatement'.
7783         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
7784         have a `ReturnLabel' or we're not unreachable.
7785
7786         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
7787         child's reachability; don't just override ours with it.  Fixes
7788         #58058 (lluis's example).
7789         (FlowBranching): Added public InTryOrCatch(), InCatch(),
7790         InFinally(), InLoop(), InSwitch() and
7791         BreakCrossesTryCatchBoundary() methods.
7792
7793         * statement.cs (Return): Do all error checking in Resolve().
7794         Unless we are the last statement in a top-level block, always
7795         create a return label and jump to it.
7796         (Break, Continue): Do all error checking in Resolve(); also make
7797         sure we aren't leaving a `finally'.
7798         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
7799         statement in a top-level block.
7800         (Block.Flags): Added `IsDestructor'.
7801         (Block.IsDestructor): New public property.
7802
7803 2004-01-20  Martin Baulig  <martin@ximian.com>
7804
7805         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
7806
7807 2004-01-20  Martin Baulig  <martin@ximian.com>
7808
7809         * statement.cs (Statement.ResolveUnreachable): New public method.
7810         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
7811         (Block.Resolve): Resolve unreachable statements.
7812
7813 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7814
7815         * expression.cs: We need to fix the case where we do
7816         not have a temp variable here.
7817
7818         * assign.cs: Only expression compound assignments need
7819         temporary variables.
7820
7821 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
7822
7823         * flowanalysis.cs: Reduce memory allocation in a few ways:
7824           - A block with no variables should not allocate a bit
7825             vector for itself.
7826           - A method with no out parameters does not need any tracking
7827             for assignment of the parameters, so we need not allocate
7828             any data for it.
7829           - The arrays:
7830                 public readonly Type[] VariableTypes;
7831                 public readonly string[] VariableNames;
7832             Are redundant. The data is already stored in the variable
7833             map, so we need not allocate another array for it.
7834           - We need to add alot of checks for if (params | locals) == null
7835             due to the first two changes.
7836
7837 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
7838
7839         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
7840         implement IMemoryLocation, we store a copy on a local variable and
7841         take the address of it.  Patch from Benjamin Jemlich
7842
7843         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
7844         to use a special "type_name_expression" rule which reduces the
7845         number of "QualifiedIdentifier" classes created, and instead
7846         directly creates MemberAccess expressions.
7847
7848 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
7849
7850         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
7851         that fixes #52853.  Null literal assignment to ValueType
7852
7853         * class.cs (MethodData.Emit): Instead of checking the name of the
7854         method to determine if its a destructor, create a new derived
7855         class from Method called Destructor, and test for that.  
7856
7857         * cs-parser.jay: Create a Destructor object instead of a Method.  
7858
7859         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
7860
7861         Fixes: 52933
7862
7863 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
7864
7865         * expression.cs (Binary.ResolveOperator): Perform an implicit
7866         conversion from MethodGroups to their delegate types on the
7867         Addition operation.
7868
7869         * delegate.cs: Introduce a new class DelegateCreation that is the
7870         base class for `NewDelegate' and `ImplicitDelegateCreation',
7871         factor some code in here.
7872
7873         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
7874         conversion from MethodGroups to compatible delegate types. 
7875
7876         * ecore.cs (Expression.Resolve): Do not flag error 654
7877         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
7878         we allow conversions from MethodGroups to delegate types now.
7879
7880         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
7881         assignments in v2 either.
7882
7883 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
7884
7885         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
7886         static read-only fields in ctors.
7887
7888         Applied patch from Benjamin Jemlich 
7889
7890         * expression.cs (UnaryMutator): Avoid leaking local variables. 
7891
7892 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
7893
7894         * cs-tokenizer.cs (IsCastToken): Allow the various native types
7895         here to return true, as they can be used like this:
7896
7897                 (XXX) int.MEMBER ()
7898
7899         Fixed 49836 and all the other dups
7900
7901 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
7902
7903         * driver.cs: Implement /win32res and /win32icon.
7904
7905 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
7906
7907         * cs-parser.jay: Add a rule to improve error handling for the
7908         common mistake of placing modifiers after the type.
7909
7910 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
7911
7912         * cs-parser.jay (interface_event_declaration): Catch
7913         initialization of events on interfaces, and report cs0068
7914
7915         * cs-parser.jay (interface_event_declaration): Catch
7916         initialization of events. 
7917
7918         * ecore.cs: Better report missing constructors.
7919
7920         * expression.cs (Binary.ResolveOperator): My previous bug fix had
7921         the error reporting done in the wrong place.  Fix.
7922
7923         * expression.cs (Binary.ResolveOperator): Catch the 
7924         operator + (E x, E y) error earlier, and later allow for implicit
7925         conversions in operator +/- (E e, U x) from U to the underlying
7926         type of E.
7927
7928         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
7929         52596, if the container class is abstract, the default constructor
7930         is protected otherwise its public (before, we were always public).
7931
7932         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
7933         fixed statement.
7934
7935         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
7936         Jemlich that fixes bug #52597, MCS was generating invalid code for
7937         idisposable structs.   Thanks to Ben for following up with this
7938         bug as well.
7939
7940 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
7941
7942         * driver.cs: Allow assemblies without code to be generated, fixes
7943         52230.
7944
7945 2004-01-07  Nick Drochak <ndrochak@gol.com>
7946
7947         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
7948
7949 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
7950
7951         * cs-parser.jay: Add rules to improve error reporting if fields or
7952         methods are declared at the namespace level (error 116)
7953
7954         * Add rules to catch event add/remove
7955
7956 2004-01-04  David Sheldon <dave-mono@earth.li>
7957
7958   * expression.cs: Added matching ")" to error message for 
7959   CS0077
7960
7961 2004-01-03 Todd Berman <tberman@gentoo.org>
7962
7963         * ecore.cs, attribute.cs:
7964         Applying fix from #52429.
7965
7966 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7967
7968         * ecore.cs, expression.cs, statement.cs:
7969         Total rewrite of how we handle branching. We
7970         now handle complex boolean expressions with fewer
7971         jumps. As well if (x == 0) no longer emits a ceq.
7972
7973         if (x is Foo) is much faster now, because we generate
7974         better code.
7975
7976         Overall, we get a pretty big improvement on our benchmark
7977         tests. The code we generate is smaller and more readable.
7978
7979         I did a full two-stage bootstrap. The patch was reviewed
7980         by Martin and Miguel.
7981
7982 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7983
7984         * cs-parser.jay: Make primary_expression not take a QI.
7985         we dont need this because the member_access rule covers
7986         us here. So we replace the rule with just IDENTIFIER.
7987
7988         This has two good effects. First, we remove a s/r conflict.
7989         Second, we allocate many fewer QualifiedIdentifier objects.
7990
7991 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7992
7993         * attribute.cs: Handle MarshalAs attributes as pseudo, and
7994         set the correct information via SRE. This prevents
7995         hanging on the MS runtime. Fixes #29374.
7996
7997 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
7998
7999         * convert.cs: correctly handle conversions to value types
8000         from Enum and ValueType as unboxing conversions.
8001
8002         Fixes bug #52569. Patch by Benjamin Jemlich.
8003
8004 2004-01-02  Ravi Pratap  <ravi@ximian.com>
8005
8006         * expression.cs (BetterConversion): Prefer int -> uint
8007         over int -> ulong (csc's behaviour). This fixed bug #52046.
8008
8009 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8010
8011         * decl.cs (MemberCache.FindMembers): now returns a
8012         MemberInfo [].
8013
8014         * typemanager.cs: In general, go with with ^^.
8015         (CopyNewMethods): take an IList.
8016         (RealMemberLookup): Only allocate an arraylist
8017         if we copy from two sets of methods.
8018
8019         This change basically does two things:
8020         1) Fewer array lists allocated due to CopyNewMethods.
8021         2) the explicit cast in MemberList costed ALOT.
8022
8023 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
8024
8025         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
8026         a hashtable to avoid needless string allocations when an identifier is
8027         used more than once (the common case).
8028
8029 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8030
8031         * pending.cs: MS's TypeBuilder.GetInterfaces ()
8032         is broken, it will not return anything. So, we
8033         have to use the information we have in mcs to
8034         do the task.
8035
8036         * typemanager.cs: Add a cache for GetInterfaces,
8037         since this will now be used more often (due to ^^)
8038
8039         (GetExplicitInterfaces) New method that gets the
8040         declared, not effective, interfaces on a type
8041         builder (eg, if you have interface IFoo, interface
8042         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
8043         { IBar }.
8044
8045         This patch makes MCS able to bootstrap itself on
8046         Windows again.
8047
8048 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
8049
8050         * expression.cs: Remove the Nop's that Miguel put
8051         in by mistake.
8052
8053 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8054
8055         * report.cs, codegen.cs: Give the real stack trace to
8056         the error when an exception is thrown.
8057
8058 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8059
8060         * decl.cs: only allocate hashtables for ifaces if 
8061         it is an iface!
8062
8063 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8064
8065         * expression.cs: fix the error from cs0121-2.cs
8066         (a parent interface has two child interfaces that
8067         have a function with the same name and 0 params
8068         and the function is called through the parent).
8069
8070 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8071
8072         * class.cs, rootcontext.cs, typmanager.cs: do not
8073         leak pointers.
8074
8075 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8076
8077         * codegen.cs: remove stack for the ec flow branching.
8078         It is already a linked list, so no need.
8079
8080 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
8081
8082         * Makefile: Allow custom profiler here.
8083
8084 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8085
8086         * typemanager.cs (LookupType):
8087           - Use a static char [], because split takes
8088             a param array for args, so it was allocating
8089             every time.
8090           - Do not store true in a hashtable, it boxes.
8091
8092 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
8093
8094         * flowanalysis.cs: bytify common enums.
8095
8096 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8097
8098         * modifiers.cs: Add a new set of flags for the
8099         flags allowed on explicit interface impls.
8100         * cs-parser.jay: catch the use of modifiers in
8101         interfaces correctly.
8102         * class.cs: catch private void IFoo.Blah ().
8103
8104         All related to bug #50572.
8105
8106 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8107
8108         * decl.cs: Rewrite the consistant accessability checking.
8109         Accessability is not linear, it must be implemented in
8110         a tableish way. Fixes #49704.
8111
8112 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
8113
8114         * expression.cs: Handle negation in a checked context.
8115         We must use subtraction from zero. Fixes #38674.
8116
8117 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8118
8119         * class.cs: Ignore static void main in DLLs.
8120         * rootcontext.cs: Handle the target type here,
8121         since we are have to access it from class.cs
8122         * driver.cs: account for the above.
8123
8124 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
8125
8126         * report.cs: Give line numbers and files if available.
8127
8128 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
8129
8130         * driver.cs: Implement /addmodule.
8131
8132         * typemanager.cs:  Change 'modules' field so it now contains Modules not
8133         ModuleBuilders.
8134
8135 2003-12-20  Martin Baulig  <martin@ximian.com>
8136
8137         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
8138         (FieldBase.IsAssigned): Removed this field.
8139         (FieldBase.SetAssigned): New public method.
8140         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
8141
8142 2003-12-20  Martin Baulig  <martin@ximian.com>
8143
8144         * expression.cs (LocalVariableReference.DoResolve): Don't set
8145         `vi.Used' if we're called from DoResolveLValue().
8146
8147         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
8148         returns the usage vector it just merged into the current one -
8149         pass this one to UsageWarning().
8150         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
8151         of the `EmitContext', don't call this recursively on our children.
8152
8153 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
8154
8155         * driver.cs: Implement /target:module.
8156
8157 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
8158
8159         * support.cs (CharArrayHashtable): New helper class.
8160
8161         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
8162         char arrays, not strings, so we can avoid creating a string in
8163         consume_identifier if the identifier is a keyword.
8164
8165 2003-12-16  Martin Baulig  <martin@ximian.com>
8166
8167         * statement.cs (LocalInfo.Assigned): Removed this property.
8168         (LocalInfo.Flags): Removed `Assigned'.
8169         (LocalInfo.IsAssigned): New public method; takes the EmitContext
8170         and uses flow analysis.
8171         (Block.UsageWarning): Made this method private.
8172         (Block.Resolve): Call UsageWarning() if appropriate.
8173
8174         * expression.cs (LocalVariableReference.DoResolve): Always set
8175         LocalInfo.Used here.
8176
8177 2003-12-13  Martin Baulig  <martin@ximian.com>
8178
8179         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
8180         any value here; we're now using flow analysis to figure out
8181         whether a statement/block returns a value.
8182
8183 2003-12-13  Martin Baulig  <martin@ximian.com>
8184
8185         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
8186         working again.
8187         (FlowBranching.MergeFinally): Don't call
8188         `branching.CheckOutParameters()' here, this is called in
8189         MergeTopBlock().
8190         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
8191         when adding the `finally' vector.       
8192
8193 2003-12-13  Martin Baulig  <martin@ximian.com>
8194
8195         * flowanalysis.cs
8196         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
8197         actually work and also fix #48962.
8198
8199 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
8200
8201         * decl.cs: Do not check System.Object for nested types,
8202         since we know it does not have any. Big bang for buck:
8203
8204         BEFORE:
8205            Run 1:   8.35 seconds
8206            Run 2:   8.32 seconds
8207            corlib:  17.99 seconds
8208         AFTER:
8209            Run 1:   8.17 seconds
8210            Run 2:   8.17 seconds
8211            corlib:  17.39 seconds
8212
8213 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
8214
8215         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
8216         time we are returning 0 members, so we save alot here.
8217
8218 2003-12-11  Martin Baulig  <martin@ximian.com>
8219
8220         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
8221         `MergeChild()', also just take the `FlowBranching' as argument;
8222         call Merge() on it and return the result.
8223         (FlowBranching.Merge): We don't need to do anything if we just
8224         have one sibling.
8225
8226 2003-12-11  Martin Baulig  <martin@ximian.com>
8227
8228         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
8229         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
8230         Maurer for this idea.
8231
8232 2003-12-11  Martin Baulig  <martin@ximian.com>
8233
8234         * flowanalysis.cs (MergeResult): This class is now gone; we now
8235         use the `UsageVector' for this.  The reason for this is that if a
8236         branching just has one sibling, we don't need to "merge" them at
8237         all - that's the next step to do.
8238         (FlowBranching.Merge): We now return a `UsageVector' instead of a
8239         `MergeResult'.
8240
8241 2003-12-11  Martin Baulig  <martin@ximian.com>
8242
8243         Reworked flow analyis and made it more precise and bug-free.  The
8244         most important change is that we're now using a special `Reachability'
8245         class instead of having "magic" meanings of `FlowReturns'.  I'll
8246         do some more cleanups and optimizations and also add some more
8247         documentation this week.
8248
8249         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
8250         largely reworked this class.
8251         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
8252         the new `Reachability' class instead of having "magic" values here.
8253         (FlowBranching): We're now using an instance of `Reachability'
8254         instead of having separate `Returns', `Breaks' etc. fields.
8255
8256         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
8257         based on flow analysis; ignore the return value of block.Emit ().
8258
8259 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
8260
8261         * driver.cs typemanager.cs: Find the mono extensions to corlib even
8262         if they are private.
8263
8264 2003-12-09  Martin Baulig  <martin@ximian.com>
8265
8266         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
8267         call them directly on the UsageVector.
8268
8269 2003-12-09  Martin Baulig  <martin@ximian.com>
8270
8271         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
8272         Changed return type from `FlowReturns' to `Reachability'.
8273
8274 2003-12-09  Martin Baulig  <martin@ximian.com>
8275
8276         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
8277         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
8278         `Reachable' fields with a single `Reachability' one.
8279
8280 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8281
8282         * class.cs (FindMembers): Remove foreach's.
8283
8284         Bootstrap times:
8285
8286         BEFORE
8287                 Run 1:   8.74 seconds
8288                 Run 2:   8.71 seconds
8289
8290         AFTER
8291                 Run 1:   8.64 seconds
8292                 Run 2:   8.58 seconds
8293
8294
8295 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8296
8297         * cs-parser.jay:
8298         * gen-treedump.cs:
8299         * statement.cs:
8300         This patch does a few things:
8301                 1. EmptyStatement is now a singleton, so it is never reallocated.
8302                 2. All blah is EmptyStatement constructs have been changed to
8303                    blah == EmptyStatement.Value, which is much faster and valid
8304                    now that EmptyStatement is a singleton.
8305                 3. When resolving a block, rather than allocating a new array for
8306                    the non-empty statements, empty statements are replaced with
8307                    EmptyStatement.Value
8308                 4. Some recursive functions have been made non-recursive.
8309         Mainly the performance impact is from (3), however (1) and (2) are needed for
8310         this to work. (4) does not make a big difference in normal situations, however
8311         it makes the profile look saner.
8312
8313         Bootstrap times:
8314
8315         BEFORE
8316         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8317         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
8318         Total memory allocated: 56397 KB
8319
8320         AFTER
8321         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
8322         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
8323         Total memory allocated: 55666 KB
8324
8325 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8326
8327         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
8328         than the hashtable in a hashtable version
8329
8330         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
8331         we always end up concating a string. This results in a huge perf
8332         loss, because many strings have to be tracked by the GC. In this
8333         patch, we first use a hashtable that works with two keys, so that
8334         the strings do not need to be concat'ed.
8335
8336         Bootstrap times:
8337         BEFORE
8338                 Run 1:   8.74 seconds
8339                 Run 2:   8.71 seconds
8340
8341         AFTER
8342                 Run 1:   8.65 seconds
8343                 Run 2:   8.56 seconds
8344
8345 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
8346
8347         * Makefile: Add a new target `do-time' that does a quick and simple
8348         profile, leaving easy to parse output.
8349
8350 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
8351
8352         * codegen.cs (Init): Create the dynamic assembly with 
8353         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
8354
8355 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8356
8357         * support.cs: Make the PtrHashtable use only one
8358         instance of its comparer.
8359
8360 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
8361
8362         * typemanager.cs: Fix lookup of GetNamespaces.
8363
8364 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
8365
8366         * expression.cs: Removed redundant line.
8367
8368         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
8369         ArrayLists, use for loops with bounds.  
8370
8371         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
8372         arraylist.
8373
8374         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
8375         arraylists, use for loop with bounds.
8376
8377         The above three changes give us a 0.071 second performance
8378         improvement out of 3.294 seconds down to 3.223.  On my machine
8379         the above changes reduced the memory usage by 1,387 KB during
8380         compiler bootstrap.
8381
8382         * cs-parser.jay (QualifiedIdentifier): New class used to represent
8383         QualifiedIdentifiers.  Before we created a new string through
8384         concatenation, and mostly later on, the result would be
8385         manipulated by DecomposeQI through string manipulation.
8386
8387         This reduced the compiler memory usage for bootstrapping from
8388         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
8389         compile times in 0.05 seconds.
8390
8391 2003-11-28  Dick Porter  <dick@ximian.com>
8392
8393         * support.cs: Do string compares with the Invariant culture.
8394
8395         * rootcontext.cs: 
8396         * gen-treedump.cs: 
8397         * expression.cs: 
8398         * driver.cs: 
8399         * decl.cs: 
8400         * codegen.cs: 
8401         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
8402         the comparison is done with the Invariant culture.
8403
8404 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
8405
8406         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
8407         GetEnumerator method.
8408
8409         (ProbeCollectionType): Iterate starting at the most specific type
8410         upwards looking for a GetEnumerator
8411
8412         * expression.cs: Shift count can be up to 31 for int/uint and 63
8413         for long/ulong.
8414
8415 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
8416
8417         * statement.cs (Block.LookupLabel): Also look for the label on the
8418         children blocks.  Use a hash table to keep track of visited
8419         nodes. 
8420
8421         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
8422         we actually did transform the other operand, otherwise fall back
8423         to the common codepath that casts to long.
8424
8425         * cs-tokenizer.cs: Use the same code pattern as the int case.
8426         Maybe I should do the parsing myself, and avoid depending on the
8427         Parse routines to get this done.
8428
8429 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
8430
8431         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8432         which fixes bug 51347.  This time test it.
8433
8434         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
8435         attributes for example can not tell the difference between these.
8436         The difference was only a syntax feature of the language. 
8437
8438         * attribute.cs: Apply attributes to delegates.
8439
8440         * delegate.cs: Call the apply attributes method.
8441
8442 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
8443
8444         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
8445         comparing 0 vs Byte.MinValue, not the value
8446
8447         (ImplicitConversionRequired): When reporting a conversion error,
8448         use error 31 to print out the constant error instead of the
8449         simpler 29.
8450
8451         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
8452         which fixes bug 51347.
8453
8454 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
8455
8456         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
8457         which fixes the -warnaserror command line option.
8458
8459 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
8460
8461         * cfold.cs (DoNumericPromotions): During constant folding of
8462         additions on UIntConstant, special case intconstants with
8463         IntConstants like we do on the expression binary operator. 
8464
8465 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
8466
8467         * convert.cs (ImplicitReferenceConversion): We were missing a case
8468         (System.Enum are not value types or class types, so we need to
8469         classify them separatedly).
8470
8471         * driver.cs: We do not support error 2007.
8472
8473 2003-11-12 Jackson Harper <jackson@ximian.com>
8474
8475         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
8476         system directory. Also use the full file name so users can
8477         libraries names mscorlib-o-tron.dll in a non system dir.
8478         
8479 2004-01-04  David Sheldon <dave-mono@earth.li>
8480
8481         * expression.cs: Added matching ")" to error message for CS0077.
8482
8483 2003-12-19  Martin Baulig  <martin@ximian.com>
8484
8485         * typemanager.cs (TypeManager.IsEqualGenericType): New public
8486         static method; see documentation in the method.
8487         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
8488
8489         * convert.cs (Convert.ImplicitReferenceConversion,
8490         Convert.ImplicitReferenceConversionExists): Add support for
8491         generic type declarations; see gen-36.cs.
8492
8493 2003-12-19  Martin Baulig  <martin@ximian.com>
8494
8495         * pending.cs (Pending.InterfaceMethod): Use
8496         `Type.IsAssignableFrom()' instead of `=='.
8497
8498 2003-12-18  Martin Baulig  <martin@ximian.com>
8499
8500         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
8501         byref types first.
8502
8503         * convert.cs (Convert.ImplicitStandardConversionExists): Use
8504         `expr_type.Equals (target_type)' instead of `=='.
8505
8506 2003-12-08  Martin Baulig  <martin@ximian.com>
8507
8508         * generics.cs (Constraints.Types): Removed.
8509         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
8510         to Type's.
8511         (Constraints.ResolveTypes): New public method; resolves the
8512         TypeExpr's to Type's.
8513         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
8514         longer takes the constraints.
8515         (TypeParameter.DefineMethod): Likewise.
8516         (TypeParameter.DefineType): New public method.  Calls
8517         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
8518         the constraints.
8519
8520 2003-12-08  Martin Baulig  <martin@ximian.com>
8521
8522         * convert.cs (Convert.ImplicitConversionStandard): Use
8523         `expr_type.Equals (target_type)' instead of `=='.
8524
8525 2003-12-08  Martin Baulig  <martin@ximian.com>
8526
8527         * typemanager.cs (TypeManager.GetReferenceType): Call
8528         `Type.MakeByRefType ()'.
8529
8530 2003-12-08  Martin Baulig  <martin@ximian.com>
8531
8532         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
8533         just has some special meaning in some situations.  For instance,
8534         it is allowed to use `where' as the name of a variable etc.
8535
8536 2003-12-04  Martin Baulig  <martin@ximian.com>
8537
8538         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
8539         `Type.MakeArrayType()' for array types.
8540
8541 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
8542
8543         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
8544         debugging message.
8545
8546         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
8547         corlib to compile.
8548
8549 2003-11-16  Martin Baulig  <martin@ximian.com>
8550
8551         * codegen.cs (EmitContext.IsGeneric): Removed.
8552
8553         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
8554         ResolveGeneric() on the DeclSpace.
8555
8556 2003-11-16  Martin Baulig  <martin@ximian.com>
8557
8558         * generic.cs (TypeArguments.Resolve):
8559         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
8560         `ResolveType()' on it to get the Type.
8561
8562 2003-11-15  Martin Baulig  <martin@ximian.com>
8563
8564         * generic.cs (ConstructedType.GetInterfaces): Override this.
8565
8566 2003-11-14  Martin Baulig  <martin@ximian.com>
8567
8568         * interface.cs (Interface.DefineType): Define all type parameters
8569         before adding the interfaces we inherit.
8570
8571 2003-11-11  Martin Baulig  <martin@ximian.com>
8572
8573         * generic.cs (ConstructedType.ResolveType): Always call
8574         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
8575
8576 2003-11-10  Martin Baulig  <martin@ximian.com>
8577
8578         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
8579         (TypeManager.InitCoreTypes): Initialize them here, but instead of
8580         calling `ResolveType()' on them, directly assign their `Type'.
8581
8582 2003-11-08  Martin Baulig  <martin@ximian.com>
8583
8584         * generic.cs (ConstructedType): Override `IsClass' etc.
8585
8586 2003-11-08  Martin Baulig  <martin@ximian.com>
8587
8588         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
8589         return value and the `out parent' parameter.
8590         (TypeContainer.DefineType): Moved the CS0644 check into
8591         GetClassBases().  Don't pass the interface types to the
8592         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
8593         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
8594
8595         * ecore.cs (TypeExpr.IsAttribute): New property.
8596         (TypeExpr.GetInterfaces): New method.
8597
8598         * interface.cs (Interface.GetInterfaceTypeByName): Return a
8599         TypeExpr instead of a Type.
8600         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
8601         (Interface.DefineType): Don't pass the interface types to the
8602         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
8603         them later and then call `TypeBulider.AddInterfaceImplementation()'.
8604
8605         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
8606         instead of a `Type[]'.
8607         (TypeManager.RegisterBuilder): Likewise.
8608         (TypeManager.AddUserInterface): Likewise.
8609         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
8610         `Type[]' and also return a `TypeExpr[]'.
8611         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
8612
8613 2003-11-08  Martin Baulig  <martin@ximian.com>
8614
8615         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
8616         Expression.     
8617
8618 2003-11-08  Martin Baulig  <martin@ximian.com>
8619
8620         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
8621         TypeManager.ResolveExpressionTypes().
8622
8623         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
8624         instead of an Expression.
8625         (TypeExpr): This is now an abstract base class for `TypeExpression'.
8626         (TypeExpression): New public class; formerly known as `TypeExpr'.
8627
8628         * expression.cs (ComposedCast): Derive from TypeExpr.
8629
8630         * typemanager.cs (TypeManager.system_*_expr): These are now
8631         TypExpr's instead of Expression's.
8632         (TypeManager.ResolveExpressionTypes): New public static function;
8633         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
8634         of them.        
8635
8636 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
8637
8638         * expression.cs (New.DoResolve): Do not dereference value that
8639         might be a null return.
8640
8641         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
8642         sure that the constant value has the right type.  Fixes an
8643         unreported bug, similar to 50425.
8644
8645         * const.cs (Const.LookupConstantValue): Call
8646         ImplicitStandardConversionExists before doing a conversion to
8647         avoid havng the TypeManager.ChangeType do conversions.
8648
8649         Reduced the number of casts used
8650
8651         (Const.ChangeType): New routine to enable reuse of the constant
8652         type changing code from statement.
8653
8654         * typemanager.cs (ChangeType): Move common initialization to
8655         static global variables.
8656
8657         Fixes #50425.
8658
8659         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
8660         every value type to go through, even if it was void.  Fix that. 
8661
8662         * cs-tokenizer.cs: Use is_identifier_start_character on the start
8663         character of the define, and the is_identifier_part_character for
8664         the rest of the string.
8665
8666 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
8667
8668         * expression.cs (UnaryMutator.EmitCode): When I updated
8669         LocalVariableReference.DoResolve, I overdid it, and dropped an
8670         optimization done on local variable references.
8671
8672 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
8673
8674         * ecore.cs: Convert the return from Ldlen into an int.
8675
8676 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
8677
8678         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
8679         the accessibility, this is a special case for toplevel non-public
8680         classes (internal for instance).
8681
8682 2003-10-20  Nick Drochak <ndrochak@gol.com>
8683
8684         * ecore.cs: Fix typo and build.  Needed another right paren.
8685
8686 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
8687
8688         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
8689         `internal' case regular and protected, but not allowing protected
8690         to be evaluated later.  Bug 49840
8691
8692 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
8693
8694         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
8695         to kb.Nlast, and not the kb.nFirst to isolate the switch
8696         statement.
8697
8698         Extract the underlying type, so enumerations of long/ulong are
8699         treated like long/ulong.
8700
8701 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
8702
8703         * expression.cs (New): Overload the meaning of RequestedType to
8704         track the possible creation of the NewDelegate type, since
8705         DoResolve is invoked more than once for new constructors on field
8706         initialization.
8707
8708         See bugs: #48800 and #37014
8709
8710         * cs-parser.jay (declare_local_constants): Take an arraylist
8711         instead of a single constant.
8712
8713         (local_constant_declaration): It should take a
8714         constant_declarators, not a constant_declarator.  Fixes 49487
8715
8716         * convert.cs: Fix error report.
8717
8718 2003-10-13 Jackson Harper <jackson@ximian.com>
8719
8720         * typemanager.cs (TypeToCoreType): Add float and double this fixes
8721         bug #49611
8722         
8723 2003-11-03  Martin Baulig  <martin@ximian.com>
8724
8725         * expression.cs (ArrayAccess.GetStoreOpcode): Added
8726         `out bool has_type_arg'; if set, we need to pass the type to
8727         ig.Emit().
8728         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
8729         Stelem_Any/Ldelem_Any for generic parameters.   
8730
8731 2003-11-02  Martin Baulig  <martin@ximian.com>
8732
8733         * expression.cs (Invocation.EmitCall): Use
8734         `TypeManager.IsValueType()' to check whether it's a value type.
8735         Don't set `struct_call' when calling a method on a type parameter.
8736
8737 2003-11-02  Martin Baulig  <martin@ximian.com>
8738
8739         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
8740         and removed the TypeBuilder argument.
8741
8742         * typemanager.cs (TypeManager.IsValueType): Return
8743         `t.IsGenericParameter || t.IsValueType'.
8744
8745 2003-10-25  Martin Baulig  <martin@ximian.com>
8746
8747         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
8748         call ConstructedType.Resolve() on it.
8749
8750         * generic.cs (ConstructedType.Resolve): Set `type' on success.
8751
8752 2003-10-25  Martin Baulig  <martin@ximian.com>
8753
8754         * class.cs (TypeContainer.GetClassBases): Changed
8755         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
8756         CS8214 reporting here.
8757         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
8758         instead of a `Type' for our parent.  In case of a recursive
8759         declaration (see tests/gen-23.cs for an example), our parent is a
8760         ConstructedType and it doesn't have its type set.  So, first
8761         create our own TypeBuilder, then call constructed.Resolve() to get
8762         the parent's type and finally TypeBuilder.SetParent() it.
8763
8764         * ecore.cs (TypeExpr.Name): New public virtual property.
8765
8766         * generic.cs
8767         (ConstructedType): We're now a TypeExpr and not just an Expression.
8768         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
8769         arguments here; this is done later.
8770         (ConstructedType.Resolve): New public method to resolve the type
8771         arguments and bind them.
8772
8773 2003-10-21  Martin Baulig  <martin@ximian.com>
8774
8775         * convert.cs: Use `TypeManager.IsValueType' instead of
8776         'type.IsValueType' everywhere.
8777
8778         * typemanager.cs (TypeManager.IsValueType): Return true for type
8779         parameters.  The reason for this is that we need to box a type
8780         parameter when converting it to a reference type.
8781
8782         * cs-parser.jay: Added support for default value expressions.
8783
8784         * generics.cs (DefaultValueExpression): New public class.       
8785
8786 2003-10-17  Martin Baulig  <martin@ximian.com>
8787
8788         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
8789         TypeContainer so we can also use this for Interfaces.
8790         (TypeParameter.Resolve): Likewise.
8791
8792         * interface.cs (Interface.DefineType): Added support for generic
8793         interfaces.
8794
8795         * cs-parser.jay: Added support for generic structs and interfaces.
8796
8797 2003-10-17  Martin Baulig  <martin@ximian.com>
8798
8799         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
8800         call generic methods :-)
8801
8802 2003-10-16  Martin Baulig  <martin@ximian.com>
8803
8804         * cs-parser.jay (namespace_or_type_name): Only create a
8805         GenericMemberAccess if we actually have type arguments.
8806
8807 2003-10-13  Martin Baulig  <martin@ximian.com>
8808
8809         * class.cs (Method.Define): If we're a generic method, call
8810         TypeBuilder.DefineGenericMethod () before resolving
8811         the parameters.
8812         (MethodData): Added .ctor which takes an additional MethodBuilder
8813         argument; this is used for generic methods.
8814         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
8815         we already have a MethodBuilder.
8816
8817 2003-10-10  Martin Baulig  <martin@ximian.com>
8818
8819         * class.cs (Method): Added .ctor which takes a `GenericMethod'
8820         instead of a `DeclSpace'.  This is used for generic methods.
8821
8822         * cs-parser.jay (method_header): Added support for generic
8823         methods; create a `GenericMethod' instance and pass it to the
8824         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
8825         parameters and locals.
8826
8827         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
8828         since we already have the location.  Check whether we're a generic
8829         type declaration or a generic method and create the correct type
8830         parameter.
8831
8832         * generic.cs (TypeParameter.DefineMethod): New public method.
8833         (GenericMethod): New public class; derives from DeclSpace and is
8834         used for generic methods.       
8835
8836 2003-10-09  Martin Baulig  <martin@ximian.com>
8837
8838         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
8839         to the .ctor.
8840         (MethodCore.DoDefineParameters): Removed the TypeContainer
8841         argument; use the DeclSpace which was passed to the .ctor instead.
8842         (MethodCore.CheckParameter): Take a DeclSpace instead of a
8843         TypeContainer; we only need a DeclSpace here.
8844
8845 2003-10-09  Martin Baulig  <martin@ximian.com>
8846
8847         * class.cs (MethodData): Added additional `DeclSpace ds' argument
8848         to the .ctor.
8849         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
8850         EmitContext's .ctor.    
8851
8852 2003-10-09  Martin Baulig  <martin@ximian.com>
8853
8854         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
8855         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
8856         AsAccessible(), moved them as well.
8857
8858         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
8859
8860 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
8861
8862         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
8863         generation for >=, as spotted by Paolo, bug 48679.  
8864         Patch from David Waite.
8865
8866         * cs-tokenizer.cs: Add handling for #pragma.
8867
8868         * cs-parser.jay: Allow for both yield and yield return in the
8869         syntax.  The anti-cobolization of C# fight will go on!
8870
8871         * class.cs (TypeBuilder.DefineType): Catch error condition here
8872         (Parent.DefineType erroring out and returning null).
8873
8874         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8875         coping with enumerations variables, we were mistakenly processing
8876         them as a regular value type instead of built-in types.  Fixes the
8877         bug #48063
8878
8879         * typemanager.cs (IsBuiltinOrEnum): New method.
8880
8881 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
8882
8883         * cs-parser.jay: Upgrade: yield now needs the return clause.
8884
8885 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
8886
8887         * cs-parser.jay : Renamed yyName to yyNames related to jay.
8888
8889 2003-09-29  Martin Baulig  <martin@ximian.com>
8890
8891         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
8892         inflated generic methods.
8893
8894         * generics.cs (ConstructedType): Distinguish between open and
8895         closed constructed types; correctly resolve the arguments.
8896
8897 2003-09-22  Martin Baulig  <martin@ximian.com>
8898
8899         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
8900         all type arguments meet their constraints.
8901
8902 2003-09-19  Martin Baulig  <martin@ximian.com>
8903
8904         * decl.cs (MemberCache.SetupCacheForInterface): Take a
8905         `MemberCache parent' argument.  Normally, an interface doesn't
8906         have a parent type except System.Object, but we use this in gmcs
8907         for generic type parameters.
8908
8909 2003-09-18  Martin Baulig  <martin@ximian.com>
8910
8911         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
8912         on `type.IsInterface'; don't check whether the type has a parent
8913         to determine whether it's an interface.
8914
8915 2003-09-17  Martin Baulig  <martin@ximian.com>
8916
8917         * generic.cs (ConstructedType.ToString): Always use `name' as the
8918         type name.
8919
8920 2003-09-15  Martin Baulig  <martin@ximian.com>
8921
8922         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
8923
8924         * generic.cs (Constraints.Resolve): New public method; this is
8925         called to resolve the constraint types and to check whether all
8926         the constraints are correct.
8927         (Constraints.Types): New public property.
8928         (TypeParameter.Resolve): New public method; resolves all the
8929         type's constraints.
8930
8931         * class.cs (TypeContainer.DefineType): Call
8932         TypeParameter.Resolve() before actually defining the type.
8933
8934 2003-09-15  Martin Baulig  <martin@ximian.com>
8935
8936         * class.cs (TypeContainer.DefineType): Added an error flag to
8937         avoid reporting duplicate CS0146's ("class definition is
8938         circular.").
8939
8940         * driver.cs (Driver.MainDriver): Abort if
8941         RootContext.ResolveTree() reported any errors.
8942
8943 2003-09-07  Martin Baulig  <martin@ximian.com>
8944
8945         * report.cs (Error, Warning): Added overloaded versions which take
8946         a `params object[] args' and call String.Format().
8947
8948 2003-09-07  Martin Baulig  <martin@ximian.com>
8949
8950         * decl.cs (DeclSpace..ctor): Don't call
8951         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
8952         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
8953         (DeclSpace.RecordDecl): New method.
8954
8955         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
8956
8957 2003-09-02  Ravi Pratap  <ravi@ximian.com>
8958
8959         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
8960         value attributes to be applied to ParameterBuilders.
8961
8962         * class.cs (MethodCore.LabelParameters): Make static and more
8963         generic so that it can be used from other places - like interface
8964         methods, for instance.
8965
8966         * interface.cs (Interface.Emit): Call LabelParameters before
8967         emitting attributes on the InterfaceMethod.
8968
8969 2003-09-07  Martin Baulig  <martin@ximian.com>
8970
8971         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
8972         if the number of type parameters doesn't match.
8973
8974 2003-09-04  Martin Baulig  <martin@ximian.com>
8975
8976         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
8977         for arrays of generic type params (ie. `!0[]').
8978
8979 2003-09-04  Martin Baulig  <martin@ximian.com>
8980
8981         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
8982         for the moment.
8983
8984 2003-09-04  Martin Baulig  <martin@ximian.com>
8985
8986         * decl.cs (DeclSpace.LookupGeneric): New method.
8987         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
8988         moment.
8989
8990         * generic.cs (TypeParameterExpr): Take a TypeParameter as
8991         argument, not just a string.
8992         (TypeParameter.Define): New public method; this is called to
8993         actually define the generic parameter; after this, you can use the
8994         new `Type' property to get the type.
8995
8996 2003-09-04  Martin Baulig  <martin@ximian.com>
8997
8998         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
8999         is now an ArrayList; initialize the result of the `TypeParameters'
9000         property here.
9001         (DeclSpace.GetGenericData): Removed.
9002         (DeclSpace.LookupGeneric): Temporarily removed; we need to
9003         implement this in a different way.
9004         (DeclSpace.GetTypeParameters): Removed; there's now a
9005         `TypeParameters' property.
9006         (DeclSpace.TypeParameters): New public property.
9007
9008         * generic.cs (Constraints): Make this class public.
9009         (TypeParameter): New public class.
9010
9011 2003-09-04  Martin Baulig  <martin@ximian.com>
9012
9013         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
9014         generic parameters.
9015
9016         * class.cs (TypeContainer.DefineType): Call
9017         TypeBuilder.DefineGenericParameter () on all generic parameters if
9018         this is a generic type.
9019
9020 2003-08-28  Martin Baulig  <martin@ximian.com>
9021
9022         * sample-stack.il: Compile this with ilasm: "ilasm /dll
9023         sample-stack.il".
9024
9025         * sample-hello.cs: Compile this with gmcs: "gmcs
9026         /r:sample-stack.dll sample-hello.cs".
9027
9028 2003-08-28  Martin Baulig  <martin@ximian.com>
9029
9030         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
9031         the parameters to the generic type.
9032
9033 2003-08-28  Martin Baulig  <martin@ximian.com>
9034
9035         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
9036
9037 2003-08-28  Martin Baulig  <martin@ximian.com>
9038
9039         * cs-parser.jay (opt_type_argument_list): Use
9040         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
9041         (primary_expression): Replace `qualified_identifier' with `type_name'.
9042         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
9043
9044         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
9045         parser to check whether it is syntactically a type parameter list;
9046         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
9047         this case.
9048
9049 2003-08-26  Martin Baulig  <martin@ximian.com>
9050
9051         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
9052         resolving aliases; fixes #47927.
9053
9054 2003-08-26  Martin Baulig  <martin@ximian.com>
9055
9056         * statement.cs (Using.DoResolve): This is internally emitting a
9057         try/finally clause, so we need to set ec.NeedExplicitReturn if we
9058         do not always return.  Fixes #47681.
9059
9060 2003-08-26  Martin Baulig  <martin@ximian.com>
9061
9062         * decl.cs (MemberCore): Moved WarningNotHiding(),
9063         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
9064         into MemberBase.
9065         (AdditionResult): Make this nested in DeclSpace.
9066         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
9067         argument; call NamespaceEntry.Define() unless we're nested in a
9068         class or struct.
9069
9070         * namespace.cs (Namespace.DefineName): New public function.  This
9071         is called from DeclSpace's .ctor to add 
9072         (Namespace.Lookup): Include DeclSpaces in the lookup.
9073
9074         * class.cs (Operator): Derive from MemberBase, not MemberCore.
9075
9076         * const.cs (Const): Derive from MemberBase, not MemberCore.     
9077
9078 2003-08-25  Martin Baulig  <martin@ximian.com>
9079
9080         * convert.cs (Convert.ExplicitReferenceConversion): When
9081         converting from an interface type to a class, unbox if the target
9082         type is a struct type.  Fixes #47822.
9083
9084 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9085
9086         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
9087         #47854.
9088
9089 2003-08-22  Martin Baulig  <martin@ximian.com>
9090
9091         * class.cs (TypeManager.DefineType): When defining a nested type,
9092         call DefineType() on our parent; fixes #47801.
9093
9094 2003-08-22  Martin Baulig  <martin@ximian.com>
9095
9096         * class.cs (MethodData.Define): While checking if a method is an
9097         interface implementation, improve the test a bit more to fix #47654.
9098
9099 2003-08-22  Martin Baulig  <martin@ximian.com>
9100
9101         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
9102         correctly; fixes #47722.
9103
9104 2003-08-22  Martin Baulig  <martin@ximian.com>
9105
9106         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
9107         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
9108
9109         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
9110
9111 2003-08-22  Martin Baulig  <martin@ximian.com>
9112
9113         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
9114         can only be assigned in static constructors.  Fixes #47161.
9115
9116 2003-08-22  Martin Baulig  <martin@ximian.com>
9117
9118         Rewrote and improved the flow analysis code.
9119
9120         * flowbranching.cs (FlowBranching): Make this class abstract.
9121         (FlowBranching.CreateBranching): New static function to create a
9122         new flow branching.
9123         (FlowBranchingBlock, FlowBranchingException): New classes.
9124         (FlowBranching.UsageVector.Type): New public readonly field.
9125         (FlowBranching.UsageVector.Breaks): Removed the setter.
9126         (FlowBranching.UsageVector.Returns): Removed the setter.
9127         (FlowBranching.UsageVector): Added Break(), Return(),
9128         NeverReachable() and Throw() methods to modify the reachability.
9129         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
9130         done by FlowBranching.Merge().
9131         (FlowBranching.UsageVector.MergeChild): New method; merges the
9132         merge result into the current vector.
9133         (FlowBranching.Merge): New abstract method to merge a branching.
9134
9135 2003-08-12  Martin Baulig  <martin@ximian.com>
9136
9137         * expression.cs (Indirection.CacheTemporaries): Create the
9138         LocalTemporary with the pointer type, not its element type.
9139
9140 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
9141
9142         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
9143         token was a keyword or not.
9144
9145         Add `error' options where an IDENTIFIER was expected;  Provide
9146         CheckToken and CheckIdentifierToken convenience error reporting
9147         functions. 
9148
9149         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
9150
9151         * decl.cs: Rename `NamespaceEntry Namespace' public field into
9152         NameSpaceEntry NameSpaceEntry.
9153
9154         (LookupInterfaceOrClass): Avoid creating a full qualified name
9155         from namespace and name: avoid doing lookups when we know the
9156         namespace is non-existant.   Use new Tree.LookupByNamespace which
9157         looks up DeclSpaces based on their namespace, name pair.
9158
9159         * driver.cs: Provide a new `parser verbose' to display the
9160         exception thrown during parsing.  This is turned off by default
9161         now, so the output of a failure from mcs is more graceful.
9162
9163         * namespace.cs: Track all the namespaces defined in a hashtable
9164         for quick lookup.
9165
9166         (IsNamespace): New method
9167
9168 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
9169
9170         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
9171         we know that we need to concatenate (full typename can never be
9172         null). 
9173
9174         * class.cs: ditto.
9175
9176         * statement.cs: Use a bitfield;  Do not initialize to null things
9177         which are done by the constructor by default.
9178
9179         * cs-parser.jay: bug fix, parameter was 4, not 3.
9180
9181         * expression.cs: Just use the property;
9182
9183         * statement.cs: No need for GetVariableInfo method.
9184
9185 2003-08-08  Martin Baulig  <martin@ximian.com>
9186
9187         * flowanalysis.cs (FlowReturns): This is now nested in the
9188         `FlowBranching' class.
9189         (MyBitVector): Moved this here from statement.cs.
9190         (FlowBranching.SiblingType): New enum type.
9191         (FlowBranching.CreateSibling): Added `SiblingType' argument.
9192
9193 2003-08-07  Martin Baulig  <martin@ximian.com>
9194
9195         * flowanalysis.cs (FlowBranchingType): This is now nested in the
9196         `FlowBranching' class and called `BranchingType'.
9197
9198 2003-08-07  Martin Baulig  <martin@ximian.com>
9199
9200         * flowanalysis.cs: Moved all the control flow analysis code into
9201         its own file.
9202
9203 2003-08-07  Martin Baulig  <martin@ximian.com>
9204
9205         * assign.cs (Assign.DoResolve): `target' must either be an
9206         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
9207         #37319.
9208
9209 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
9210
9211         * expression.cs (BinaryMethod): This kind of expression is created by the
9212         Binary class if it determines that the operator has to be handled
9213         by a method.
9214
9215         (BinaryDelegate): This kind of expression is created if we are
9216         dealing with a + or - operator on delegates.
9217
9218         (Binary): remove method, argumetns, and DelegateOperator: when
9219         dealing with methods, 
9220
9221         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
9222
9223         * statement.cs (Block): use bitfields for the three extra booleans
9224         we had in use.   Remove unused topblock parameter.
9225
9226         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
9227
9228         * assign.cs: Drop extra unneeded tests.
9229
9230 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
9231
9232         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
9233
9234         * statement.cs (Foreach): Use VariableStorage instead of
9235         LocalBuilders.   
9236
9237         * codegen.cs (VariableStorage): New class used by clients that
9238         require a variable stored: locals or fields for variables that
9239         need to live across yield.
9240
9241         Maybe provide a convenience api for EmitThis+EmitLoad?
9242
9243         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
9244         these bad boys.
9245
9246 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
9247
9248         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
9249         RemapParameterLValue): New methods that are used to turn a
9250         precomputed FieldInfo into an expression like this:
9251
9252                 instance.FieldInfo
9253
9254         The idea is to use this instead of making LocalVariableReference
9255         have more than one meaning.
9256
9257         * cs-parser.jay: Add error production to BASE.
9258
9259         * ecore.cs: Deal with TypeManager.GetField returning null, which
9260         is now a valid return value.
9261
9262         (FieldExprNoAddress): New expression for Fields whose address can
9263         not be taken.
9264
9265         * expression.cs (LocalVariableReference): During the resolve
9266         phases, create new expressions if we are in a remapping context.
9267         Remove code that dealt with remapping here.
9268
9269         (ParameterReference): same.
9270
9271         (ProxyInstance): New expression, like the `This' expression, but
9272         it is born fully resolved.  We know what we are doing, so remove
9273         the errors that are targeted to user-provided uses of `this'.
9274
9275         * statement.cs (Foreach): our variable is now stored as an
9276         Expression;  During resolution, follow the protocol, dont just
9277         assume it will return this.
9278
9279 2003-08-06  Martin Baulig  <martin@ximian.com>
9280
9281         * support.cs (SeekableStreamReader.cs): New public class.
9282
9283         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
9284         SeekableStreamReader instead of the normal StreamReader.
9285
9286 2003-08-04  Martin Baulig  <martin@ximian.com>
9287
9288         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
9289         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
9290         deambiguate casts and delegate invocations.
9291         (parenthesized_expression): Use the new tokens to ensure this is
9292         not a cast of method invocation.
9293
9294         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
9295         when reading a `)' and Deambiguate_CloseParens () was previously
9296         called.
9297
9298         * expression.cs (ParenthesizedExpression): New class.  This is
9299         just used for the CS0075 test.
9300         (Binary.DoResolve): Check for CS0075.   
9301
9302 2003-07-29  Ravi Pratap  <ravi@ximian.com>
9303
9304         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
9305         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
9306         reference comparison.
9307
9308         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
9309         examine the ReturnType for equality - this is necessary in the
9310         cases of implicit and explicit operators whose signature also
9311         includes the return type.
9312
9313 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
9314
9315         * namespace.cs: Cache the result of the namespace computation,
9316         instead of computing it every time.
9317
9318 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9319
9320         * decl.cs: Use a global arraylist that we reuse over invocations
9321         to avoid excesive memory consumption.  Reduces memory usage on an
9322         mcs compile by one meg (45 average).
9323
9324         * typemanager.cs (LookupTypeReflection): In .NET pointers are
9325         private, work around that.
9326
9327 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
9328
9329         * literal.cs (IntLiteral): Define Zero and One static literals. 
9330
9331         * cs-parser.jay (integer_literal): use static literals to reduce
9332         memory usage for the most used literals (0, 1 and -1).  211kb
9333         reduced in memory usage.
9334
9335         Replace all calls to `new ArrayList' with `new
9336         ArrayList(4)' which is a good average number for most allocations,
9337         and also requires only 16 bytes of memory for its buffer by
9338         default. 
9339
9340         This reduced MCS memory usage in seven megabytes for the RSS after
9341         bootstrapping.
9342
9343 2003-07-28  Ravi Pratap  <ravi@ximian.com>
9344
9345         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
9346         handle params methods the correct way by forming only one
9347         applicable set with params and normal methods in them. Earlier we
9348         were looking at params methods only if we found no normal methods
9349         which was not the correct thing to do.
9350
9351         (Invocation.BetterFunction): Take separate arguments indicating
9352         when candidate and the best method are params methods in their
9353         expanded form.
9354
9355         This fixes bugs #43367 and #46199.
9356
9357         * attribute.cs: Documentation updates.
9358
9359         (CheckAttribute): Rename to CheckAttributeTarget.
9360         (GetValidPlaces): Rename to GetValidTargets.
9361
9362         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
9363         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
9364
9365         Fixes bug #44468.
9366
9367 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
9368
9369         * codegen.cs: Compute IsGeneric correctly.
9370
9371         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
9372         resolution. 
9373
9374         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
9375         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
9376         regressions, and I was chasing more bugs than I required.
9377
9378         * interface.cs: Use expressions for base type names (like classes
9379         and structs have been doing for a while now), and resolve that.
9380         This patch should probably go into head as well.
9381
9382         This makes it one less user of FindType.
9383
9384 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
9385
9386         This compiler can not self host currently.  Need to fix that.
9387         
9388         * Makefile: compile to `gmcs.exe'
9389
9390         * driver.cs: Turn on v2 by default on gmcs.
9391
9392         * generic.cs (ConstructedType): Does no longer take a container
9393         type argument;  That will be taken care of later.
9394
9395         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
9396         Use SimpleName to resolve for now, so we can continue the work on
9397         the parser, until we get Type.GetType that understands generics.
9398
9399         (ConstructedType.ToString): Implement
9400
9401         (TypeArguments.Resolve): Resolve the child expressions as types. 
9402         
9403         * cs-parser.jay: Rename interface_constraints to
9404         type_parameter_constraints
9405
9406         (namespace_or_type_name): Only use constructed types for the basic
9407         construction, we will deal with identifier<...> later.
9408
9409         (type/type_name): No longer call DecomposeQI, as
9410         namespace_or_type_name is always decoded now.
9411         
9412 2003-07-22  Ravi Pratap  <ravi@ximian.com>
9413
9414         * expression.cs (Invocation.OverloadResolve): Follow the spec more
9415         closely: we eliminate methods in base types when we have an
9416         applicable method in a top-level type.
9417
9418         Please see section 14.5.5.1 for an exact description of what goes
9419         on. 
9420
9421         This fixes bug #45127 and a host of other related to corlib compilation.
9422
9423         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
9424         array is the method corresponding to the top-level type (this is
9425         because of the changes made to icall.c) so we change this
9426         accordingly.
9427
9428         (MethodGroupExpr.Name): This too.
9429
9430         * typemanager.cs (GetElementType): New method which does the right
9431         thing when compiling corlib. 
9432
9433         * everywhere: Make use of the above in the relevant places.
9434
9435 2003-07-22  Martin Baulig  <martin@ximian.com>
9436
9437         * cs-parser.jay (invocation_expression): Moved
9438         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
9439         `cast_expression', but create a InvocationOrCast which later
9440         resolves to either an Invocation or a Cast.
9441
9442         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
9443         method; call this before EmitStatement() to make sure that this
9444         expression can be used as a statement.
9445
9446         * expression.cs (InvocationOrCast): New class; resolves to either
9447         an Invocation or a Cast.
9448
9449         * statement.cs (StatementExpression): Call ResolveStatement() on
9450         the ExpressionStatement before emitting it.
9451
9452 2003-07-21  Martin Baulig  <martin@ximian.com>
9453
9454         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
9455         `ref' and `out' attributes match; fixes #46220.
9456         (MemberAccess.ResolveMemberAccess): You can't reference a type
9457         through an expression; fixes #33180.
9458         (Indexers.GetIndexersForType): Don't return the indexers from
9459         interfaces the class implements; fixes #46502.
9460
9461 2003-07-21  Martin Baulig  <martin@ximian.com>
9462
9463         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
9464         CS0661 checks; fixes bug #30442.
9465
9466 2003-07-21  Martin Baulig  <martin@ximian.com>
9467
9468         * decl.cs (AdditionResult): Added `Error'.
9469
9470         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
9471
9472         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
9473         cs0031.cs actually work.
9474
9475  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9476  
9477         * cs-parser.jay (namespace_name): do not use
9478         namespace_or_type_name, use qualified_identifier, because
9479         namespace_or_type_name will soon return a composed expression
9480         instead of a string.
9481  
9482         (namespace_or_type_name): Instead of returning a string, now this
9483         production returns an expression.
9484  
9485         * codegen.cs (EmitContext): Setup IsGeneric property based on
9486         whether our DeclSpace is generic, our the method is generic.
9487  
9488         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
9489         the method is generic.
9490  
9491         * cs-parser.jay (type_arguments, opt_type_argument_list,
9492         type_parameters, type_parameter_list, opt_type_parameter_list,
9493         type_parameter,, opt_type_parameter_constraints_clauses,
9494         type_parameter_constraints_clauses,
9495         type_parameter_constraint_clause, type_parameter_constraint,
9496         interface_constraints): Add new production
9497  
9498         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
9499         DeclSpace is generic or not.
9500  
9501         (DeclSpace.SetParameterInfo): New routine, used to set the
9502         parameter info for a type.
9503  
9504         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
9505         returns a GenericTypeExpr
9506  
9507         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
9508         generic, lookup the generic argument.
9509  
9510         * attribute.cs: Do not allow TypeParameterExpressions in
9511         Attributes.
9512  
9513         * class.cs: Do not allow the Main method to be defined in a
9514         Generic container.
9515  
9516         * expression.cs (SizeOf): Do not allow generic types to be used as
9517         arguments to sizeof.
9518  
9519         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
9520         it: whether a type is generic or not.  Only works for types we are
9521         currently building for now.
9522         
9523 2003-07-20  Martin Baulig  <martin@ximian.com>
9524
9525         * namespace.cs: Fixed that bug which caused a crash when compiling
9526         the debugger's GUI.
9527
9528 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
9529
9530         * typemanager.cs (LookupTypeReflection): Never expose types which
9531         are NotPublic, NestedPrivate, NestedAssembly, or
9532         NestedFamANDAssem.  We used to return these, and later do a check
9533         that would report a meaningful error, but the problem is that we
9534         would not get the real match, if there was a name override.
9535
9536 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
9537
9538         * namespace.cs (Namespace, Name): Do not compute the namespace
9539         name dynamically, compute it in the constructor.  This reduced
9540         memory usage by 1697 KB.
9541
9542         * driver.cs: Use --pause to pause at the end.
9543
9544 2003-07-17  Peter Williams  <peter@newton.cx>
9545
9546         * Makefile: Change the name of the test target so that it doesn't
9547         conflict with the recursive test target.
9548
9549 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
9550
9551         * expression.cs (LocalVariableReference.Emit, EmitAssign,
9552         AddressOf): Do not use EmitThis, that was wrong, use the actual
9553         this pointer.
9554
9555 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
9556
9557         * class.cs (MethodData.Define): While checking if a method is an
9558         interface implementation, improve the test: If we are not public
9559         (use new test here: use the computed MethodAttributes directly,
9560         instead of the parsed modifier flags) check if the `implementing'
9561         method comes from an interface or not.
9562
9563         * pending.cs (VerifyPendingMethods): Slightly better error
9564         message.
9565
9566         * makefile: add test target that does the mcs bootstrap.
9567
9568 2003-07-16  Ravi Pratap  <ravi@ximian.com>
9569
9570         * interface.cs (Define): Do nothing here since there are no
9571         members to populate etc. Move the attribute emission out of here
9572         since this was just totally the wrong place to put it. Attribute
9573         application happens during the 'Emit' phase, not in the 'Define'
9574         phase.
9575
9576         (Emit): Add this method and move the attribute emission here
9577
9578         * rootcontext.cs (EmitCode): Call the Emit method on interface
9579         types too.
9580
9581 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9582
9583         * expression.cs (OverloadResolve): Report error only if Location
9584         is not 'Null' which means that there was a probe going on.
9585
9586 2003-07-14  Martin Baulig  <martin@ximian.com>
9587
9588         * expression.cs (ConditionalLogicalOperator): New public class to
9589         implement user defined conditional logical operators.
9590         This is section 14.11.2 in the spec and bug #40505.
9591
9592 2003-07-14  Martin Baulig  <martin@ximian.com>
9593
9594         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
9595
9596 2003-07-14  Martin Baulig  <martin@ximian.com>
9597
9598         * codegen.cs (EmitContext.InFixedInitializer): New public field.
9599
9600         * ecore.cs (IVariable.VerifyFixed): New interface method.
9601
9602         * expression.cs (Unary.ResolveOperator): When resolving the `&'
9603         operator, check whether the variable is actually fixed.  Fixes bug
9604         #36055.  Set a variable definitely assigned when taking its
9605         address as required by the spec.
9606
9607         * statement.cs (LocalInfo.IsFixed): New field.
9608         (LocalInfo.MakePinned): Set `IsFixed' to true.
9609
9610 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
9611
9612         * attribute.cs (Attribute.Resolve): While doing a Member lookup
9613         for .ctors, ensure that we only ask for members declared in the
9614         attribute type (BindingFlags.DeclaredOnly).
9615
9616         Fixes bug #43632.
9617
9618         * expression.cs (Error_WrongNumArguments): Report error 1501
9619         correctly the way CSC does.
9620
9621 2003-07-13  Martin Baulig  <martin@ximian.com>
9622
9623         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
9624         lookup on the fully qualified name, to make things like "X.X" work
9625         where "X.X" is a fully qualified type name, but we also have a
9626         namespace "X" in the using list.  Fixes #41975.
9627
9628 2003-07-13  Martin Baulig  <martin@ximian.com>
9629
9630         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
9631         function. If we're a CompoundAssign, we need to create an embedded
9632         CompoundAssign, not an embedded Assign.
9633         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
9634         Fixes #45854.
9635
9636 2003-07-13  Martin Baulig  <martin@ximian.com>
9637
9638         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
9639         work to fix bug #46088.
9640
9641 2003-07-13  Ravi Pratap <ravi@ximian.com>
9642
9643         * class.cs (Operator.Emit): Do not emit attributes here - it is
9644         taken care of by the Method class that we delegate too. This takes
9645         care of bug #45876.
9646
9647 2003-07-10  Martin Baulig  <martin@ximian.com>
9648
9649         * expression.cs (TypeOfVoid): New class.
9650         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
9651
9652 2003-07-10  Martin Baulig  <martin@ximian.com>
9653
9654         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
9655         bug #35957.
9656
9657 2003-07-10  Martin Baulig  <martin@ximian.com>
9658
9659         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
9660         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
9661
9662         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
9663
9664         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
9665
9666 2003-07-10  Martin Baulig  <martin@ximian.com>
9667
9668         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
9669         of decimal.  Fixes #42850.
9670
9671         NOTE: I also fixed the created byte blob, but this doesn't work on
9672         the MS runtime and csc never produces any byte blobs for decimal
9673         arrays.
9674
9675 2003-07-10  Martin Baulig  <martin@ximian.com>
9676
9677         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
9678         structs; fixes #32068.
9679         (Block.AddChildVariableNames): Fixed #44302.
9680
9681 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9682
9683         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
9684
9685 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9686
9687         * attribute.cs: And this test is onger needed.
9688
9689 2003-07-08  Martin Baulig  <martin@ximian.com>
9690
9691         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
9692         inaccessible types.  Fixes #36313.
9693
9694         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
9695
9696         * namespace.cs (NamespaceEntry): Create implicit entries for all
9697         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
9698         implicit entries for N1.N2 and N1.
9699
9700 2003-07-08  Martin Baulig  <martin@ximian.com>
9701
9702         Rewrote the handling of namespaces to fix a lot of the issues
9703         wrt. `using' aliases etc.
9704
9705         * namespace.cs (Namespace): Splitted this class into a
9706         per-assembly `Namespace' and a per-file `NamespaceEntry'.
9707
9708         * typemanager.cs (TypeManager.IsNamespace): Removed.
9709         (TypeManager.ComputeNamespaces): Only compute namespaces from
9710         loaded assemblies here, not the namespaces from the assembly we're
9711         currently compiling.
9712
9713 2003-07-08  Martin Baulig  <martin@ximian.com>
9714
9715         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
9716
9717 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
9720         already fixed it.  
9721
9722         I thought about the memory savings here, but LookupTypeReflection
9723         is used under already very constrained scenarios.  Compiling
9724         corlib or mcs only exposes one hit, so it would not really reduce
9725         any memory consumption.
9726
9727 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9728
9729         * typemanager.cs: fixes bug #45889 by only adding public types from
9730         other assemblies to the list of known types.
9731
9732 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
9733
9734         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
9735         on the type we resolved.
9736
9737 2003-07-05  Martin Baulig  <martin@ximian.com>
9738
9739         * pending.cs (PendingImplementation.ParentImplements): Don't
9740         create the proxy if the parent is abstract.
9741
9742         * class.cs (TypeContainer.DefineIndexers): Process explicit
9743         interface implementations first.  Fixes #37714.
9744
9745 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
9746
9747         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
9748         defined recursively;  but since we modify the input parameters
9749         (left is set to `this' temporarily), we reset this value if the
9750         left_is_explicit is false, which gives the original semantics to
9751         the code.  
9752
9753         * literal.cs (NullPointer): new class used to represent a null
9754         literal in a pointer context.
9755
9756         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
9757         type is a pointer, use a NullPointer object instead of a
9758         NullLiteral.   Closes 43687
9759
9760         (ExplicitConversion): Convert pointer values using
9761         the conv opcode to the proper type.
9762
9763         * ecore.cs (New): change ValueTypeVariable property into a method,
9764         that returns whether the valuetype is suitable for being used.
9765
9766         * expression.cs (Binary.DoNumericPromotions): Only return if we
9767         the int constant was a valid uint, and we can return both left and
9768         right as uints.  If not, we continue processing, to trigger the
9769         type conversion.  This fixes 39018.
9770
9771         * statement.cs (Block.EmitMeta): During constant resolution, set
9772         the CurrentBlock property on the emitcontext, so that we resolve
9773         constants propertly.
9774
9775 2003-07-02  Martin Baulig  <martin@ximian.com>
9776
9777         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
9778         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
9779
9780         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
9781         than emitting it here.
9782
9783         * statement.cs: Fixed some more flow analysis bugs.
9784
9785 2003-07-02  Martin Baulig  <martin@ximian.com>
9786
9787         * class.cs (MethodData.Define): When implementing interface
9788         methods, set Final unless we're Virtual.
9789
9790         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
9791         check work for interface methods.
9792
9793 2003-07-01  Martin Baulig  <martin@ximian.com>
9794
9795         * ecore.cs (EmitContext.This): Replaced this property with a
9796         GetThis() method which takes a Location argument.  This ensures
9797         that we get the correct error location for a CS0188.
9798
9799 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
9800
9801         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
9802         ImplicitStandardConversion.
9803
9804         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
9805
9806 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
9807
9808         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
9809         optimization.
9810
9811 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
9812
9813         * class.cs (Constructor.Define): Turn off initlocals for unsafe
9814         constructors.
9815
9816         (MethodData.Define): Turn off initlocals for unsafe methods.
9817
9818 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
9819
9820         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
9821         complete;  Fixes #37521.
9822
9823         * delegate.cs: Use Modifiers.TypeAttr to compute the
9824         TypeAttributes, instead of rolling our own.  This makes the flags
9825         correct for the delegates.
9826
9827 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
9828
9829         * class.cs (Constructor.Define): Set the private flag for static
9830         constructors as well.
9831
9832         * cs-parser.jay (statement_expression): Set the return value to
9833         null, to avoid a crash when we catch an error.
9834
9835 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
9836
9837         * cs-parser.jay: Applied patch from Jackson that adds support for
9838         extern and unsafe modifiers to destructor declarations.
9839
9840         * expression.cs: Report error 21 if the user is trying to index a
9841         System.Array.
9842
9843         * driver.cs: Add an error message, suggested by the bug report.
9844
9845         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
9846         if we do not have a ": this ()" constructor initializer.  Fixes 45149
9847
9848 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
9849
9850         * namespace.cs: Add some information to reduce FAQs.
9851
9852 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
9853
9854         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
9855         underlying enumeration types.  Fixes #43915.
9856
9857         * expression.cs: Treat ushort/short as legal values to be used in
9858         bitwise operations.
9859
9860 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
9861
9862         * delegate.cs: transfer custom attributes for paramenters from
9863         the delegate declaration to Invoke and BeginInvoke.
9864
9865 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
9866
9867         * attribute.cs: handle custom marshalers and emit marshal info
9868         for fields, too.
9869
9870 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
9871
9872         * makefile.gnu: Added anonymous.cs to the compiler sources.
9873
9874 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
9875
9876         * iterators.cs: Change the name of the proxy class to include two
9877         underscores.
9878
9879         * cs-parser.jay: Update grammar to include anonymous methods.
9880
9881         * anonymous.cs: new file.
9882
9883 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
9884
9885         * class.cs (Field.Define): Add missing test for pointers and
9886         safety. 
9887
9888 2003-05-27  Ravi Pratap  <ravi@ximian.com>
9889
9890         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
9891         we use the stobj opcode.
9892
9893         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
9894         since it wasn't the correct fix. 
9895
9896         It still is puzzling that we are required to use stobj for IntPtr
9897         which seems to be a ValueType.
9898
9899 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
9900
9901         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
9902         during regular simple name resolution.   Now, the trick is that
9903         instead of returning for processing the simplename, we do a
9904         TypeManager.LookupType (ie, a rooted lookup as opposed to a
9905         contextual lookup type).   If a match is found, return that, if
9906         not, return for further composition.
9907
9908         This fixes long-standing 30485.
9909
9910         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
9911         using the address to initialize an object, do an Stobj instead of
9912         using the regular Stelem.
9913
9914         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
9915         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
9916         Because if we are a BaseIndexerAccess that value will be true.
9917         Fixes 43643.
9918
9919         * statement.cs (GotoCase.Resolve): Return after reporting an
9920         error, do not attempt to continue. 
9921
9922         * expression.cs (PointerArithmetic.Emit): If our operand is a
9923         long, convert our constants to match the operand before
9924         multiplying.  Convert to I type before adding.   Fixes 43670.
9925
9926 2003-05-14  Ravi Pratap  <ravi@ximian.com>
9927
9928         * enum.cs (ImplicitConversionExists) : Rename to
9929         ImplicitEnumConversionExists to remove ambiguity. 
9930
9931         * ecore.cs (NullCast): New type of cast expression class which
9932         basically is very similar to EmptyCast with the difference being
9933         it still is a constant since it is used only to cast a null to
9934         something else
9935         (eg. (string) null)
9936
9937         * convert.cs (ImplicitReferenceConversion): When casting a null
9938         literal, we return a NullCast.
9939
9940         * literal.cs (NullLiteralTyped): Remove - I don't see why this
9941         should be around anymore.
9942
9943         The renaming (reported was slightly wrong). Corrections:
9944
9945         ConvertImplicitStandard -> ImplicitConversionStandard
9946         ConvertExplicitStandard -> ExplicitConversionStandard
9947
9948         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
9949         before passing them in !
9950
9951         * convert.cs (ImplicitConversionStandard): When comparing for
9952         equal expr and target types, ensure that expr is not a
9953         NullLiteral.
9954
9955         In general, we must not be checking (expr_type ==
9956         target_type) in the top level conversion methods
9957         (ImplicitConversion, ExplicitConversion etc). This checking is
9958         done in the methods that they delegate to.
9959
9960 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
9961
9962         * convert.cs: Move Error_CannotConvertType,
9963         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
9964         ImplicitNumericConversion, ImplicitConversionExists,
9965         ImplicitUserConversionExists, StandardConversionExists,
9966         FindMostEncompassedType, FindMostSpecificSource,
9967         FindMostSpecificTarget, ImplicitUserConversion,
9968         ExplicitUserConversion, GetConversionOperators,
9969         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
9970         TryImplicitIntConversion, Error_CannotConvertImplicit,
9971         ConvertImplicitRequired, ConvertNumericExplicit,
9972         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
9973         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
9974         its own file.
9975
9976         Perform the following renames:
9977
9978         StandardConversionExists -> ImplicitStandardConversionExists
9979         ConvertImplicit -> ImplicitConversion
9980         ConvertImplicitStandard -> ImplicitStandardConversion
9981         TryImplicitIntConversion -> ImplicitIntConversion
9982         ConvertImplicitRequired -> ImplicitConversionRequired
9983         ConvertNumericExplicit -> ExplicitNumericConversion
9984         ConvertReferenceExplicit -> ExplicitReferenceConversion
9985         ConvertExplicit -> ExplicitConversion
9986         ConvertExplicitStandard -> ExplicitStandardConversion
9987
9988 2003-05-19  Martin Baulig  <martin@ximian.com>
9989
9990         * statement.cs (TypeInfo.StructInfo): Made this type protected.
9991         (TypeInfo): Added support for structs having structs as fields.
9992
9993         * ecore.cs (FieldExpr): Implement IVariable.
9994         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
9995         VariableInfo for the field.
9996
9997 2003-05-18  Martin Baulig  <martin@ximian.com>
9998
9999         * expression.cs (This.DoResolve): Report a CS0027 if we're
10000         emitting a field initializer.
10001
10002 2003-05-18  Martin Baulig  <martin@ximian.com>
10003
10004         * expression.cs (This.ResolveBase): New public function.
10005         (This.DoResolve): Check for CS0188.
10006
10007         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
10008         This.Resolve().
10009
10010         * ecore.cs (MethodGroupExpr.DoResolve): Set the
10011         `instance_expression' to null if we don't have any non-static
10012         methods.
10013
10014 2003-05-18  Martin Baulig  <martin@ximian.com>
10015
10016         Reworked the way how local variables and parameters are handled by
10017         the flow analysis code.
10018
10019         * statement.cs (TypeInfo, VariableMap): New public classes.
10020         (VariableInfo): New public class.  This is now responsible for
10021         checking whether a variable has been assigned.  It is used for
10022         parameters and local variables.
10023         (Block.EmitMeta): Take the InternalParameters as argument; compute
10024         the layout of the flow vectors here.
10025         (Block.LocalMap, Block.ParameterMap): New public properties.
10026         (FlowBranching): The .ctor doesn't get the InternalParameters
10027         anymore since Block.EmitMeta() now computes the layout of the flow
10028         vector.
10029         (MyStructInfo): This class is now known as `StructInfo' and nested
10030         in `TypeInfo'; we don't access this directly anymore.
10031
10032         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
10033         property and removed IsAssigned(), IsFieldAssigned(),
10034         SetAssigned() and SetFieldAssigned(); we now call them on the
10035         VariableInfo so we don't need to duplicate this code everywhere.
10036
10037         * expression.cs (ParameterReference): Added `Block block' argument
10038         to the .ctor.
10039         (LocalVariableReference, ParameterReference, This): The new
10040         VariableInfo class is now responsible for all the definite
10041         assignment stuff.
10042
10043         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
10044         IsParameterAssigned, SetParameterAssigned): Removed.
10045
10046 2003-05-18  Martin Baulig  <martin@ximian.com>
10047
10048         * typemanager.cs (InitCoreTypes): Try calling
10049         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
10050         the 3-args-version.  Corlib now also needs our `void_type'.
10051         (GetMethod): Added overloaded version which takes an optional
10052         `bool report_errors' to allow lookups of optional methods.
10053
10054 2003-05-12  Martin Baulig  <martin@ximian.com>
10055
10056         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
10057         only used for locals and not for parameters.
10058
10059 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
10060
10061         * support.cs (InternalParameters.ParameterType): Return the
10062         ExternalType of the parameter.
10063
10064         * parameter.cs (Parameter.ExternalType): drop the two arguments,
10065         they were unused.
10066
10067 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
10068
10069         * class.cs (MethodData.Define): Do not set the `newslot' on
10070         interface members, if they are also flagged as "override".
10071
10072         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
10073         better code for ++i and i++.  This only works for static fields
10074         and local variables.
10075
10076         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
10077         want to pull the DeclSpace out of the builder_to_declspace instead
10078         of the TypeBuilder (like in TypeContainer.FindMembers).
10079
10080         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
10081         instead of LookupTypeContainer.  Fixes the crash on .NET for
10082         looking up interface members.
10083
10084         * const.cs: Create our own emit context during the Definition
10085         stage, so that constants are evaluated in the proper context, when
10086         a recursive definition happens.
10087
10088 2003-05-11  Martin Baulig  <martin@ximian.com>
10089
10090         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
10091         new block for a switch section.
10092         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
10093         the adding/lookup in the switch block.  Fixes #39828.
10094
10095 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
10096
10097         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
10098         functionality: I needed to convert the data after I had performed
10099         the add/sub operation into the operands type size.
10100
10101         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
10102         pass the type for the box operation, otherwise the resulting
10103         object would have been of type object.
10104
10105         (BoxedCast): Add constructor to specify the type to box as.
10106
10107 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * iterators.cs: I was reusing the `count' variable inadvertently,
10110         take steps to not allow this to happen.
10111
10112 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
10113
10114         * attribute.cs (Attribute.Resolve): Params attributes are encoded
10115         by creating an array at the point where the params starts and
10116         putting all those arguments there, then adjusting the size of the
10117         array.
10118
10119 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
10120
10121         * expression.cs (New.AddressOf): Implement interface
10122         IMemoryLocation.  This is used when the `new' operator is used in
10123         the context of an invocation to a method on a value type.
10124
10125         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
10126         example. 
10127
10128         * namespace.cs: Also check the using aliases here.
10129
10130         * driver.cs: Move the test for using validity after the types have
10131         been entered, so we do a single pass that also includes the using
10132         aliases. 
10133
10134         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
10135         in the regular case.   CreateSiblingForFinally is doing extra
10136         error checking.
10137
10138         * attribute.cs (GetAttributeArgumentExpression): Store the result
10139         on an out value, and use the return value to indicate failure
10140         instead of using null (which is a valid return for Constant.GetValue).
10141
10142         * statement.cs: Perform the analysis flow for the increment
10143         portion after the statement, because this will be the real flow of
10144         execution.  Fixes #42385
10145
10146         * codegen.cs (EmitContext.EmitArgument,
10147         EmitContext.EmitStoreArgument): New helper functions when the
10148         RemapToProxy flag is set.
10149
10150         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
10151         function.
10152
10153         Add support for remapping parameters. 
10154
10155         * iterators.cs: Propagate parameter values;  Store parameter
10156         values in the proxy classes.
10157
10158 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
10159
10160         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
10161         need a proxy reference;  I do not know what I was thinking
10162
10163         * cs-parser.jay (constructor_initializer): catch another error,
10164         and display nice message.
10165
10166         (field_declaration): catch void field declaration
10167         to flag a better error. 
10168
10169         * class.cs (MemberBase.CheckBase): Report an error instead of a
10170         warning if a new protected member is declared in a struct. 
10171         (Field.Define): catch the error of readonly/volatile.
10172
10173         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
10174
10175         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
10176         volatile variable is taken
10177
10178 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
10179
10180         * statement.cs (Fixed.Resolve): Report an error if we are not in
10181         an unsafe context.
10182
10183 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
10184
10185         * typemanager.cs: reuse the code that handles type clashes for
10186         delegates and enumerations.
10187
10188         * class.cs (Report28): Always report.
10189
10190         * expression.cs (EncodeAsAttribute): Allow nulls here.
10191
10192 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
10193
10194         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
10195         the functionality for testing whether an expression is valid for
10196         an attribute here.  Also handle the case of arrays of elements
10197         being stored. 
10198
10199         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
10200         encoding a linear array into an array of objects that are suitable
10201         to be passed to an CustomAttributeBuilder.
10202
10203         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
10204
10205         * ecore.cs: (FieldExpr): Handle field remapping here.
10206
10207         * iteratators.cs: Pass the instance variable (if the method is an
10208         instance method) to the constructors, so we can access the field
10209         variables on the class.
10210
10211         TODO: Test this with structs.  I think the THIS variable on
10212         structs might have to be a pointer, and not a refenrece
10213
10214 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
10215
10216         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
10217         local variables to fields in a proxy class.
10218
10219         * iterators.cs (PopulateProxy): Rename our internal fields to
10220         <XXX>.  
10221         Create a <THIS> field if we are an instance method, so we can
10222         reference our parent container variables.
10223         (MapVariable): Called back from the EmitContext code to enter a
10224         new variable to field mapping into the proxy class (we just create
10225         a FieldBuilder).
10226
10227         * expression.cs
10228         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
10229         for using the remapped locals to fields.
10230
10231         I placed the code here, because that gives the same semantics to
10232         local variables, and only changes the Emit code.
10233
10234         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
10235         statements inside iterators.
10236         (VariableInfo): Add a FieldBuilder for the cases when we are
10237         remapping local variables to fields in a proxy class
10238
10239         * ecore.cs (SimpleNameResolve): Avoid testing two times for
10240         current_block != null.
10241
10242         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
10243         not cope with strings, as it has been moved to the
10244         TableSwitchEmit.  Fixed bug in switch generation.
10245
10246         * expression.cs (New.DoResolve): Provide more context for the user
10247         when reporting an error.
10248
10249         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
10250         pointers. 
10251
10252         * expression.cs (MemberAccess.DoResolve): When we get a type back,
10253         check the permissions for it.  Note than in a type-resolution
10254         context the check was already present in DeclSpace.ResolveType,
10255         but was missing from the MemberAccess.
10256
10257         (ArrayCreation.CheckIndices): warn if the user has
10258         more nested levels of expressions, but there are no more
10259         dimensions specified.  Avoids crash on bug 41906.
10260
10261 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
10262
10263         * statement.cs (Block): replace Implicit bool, for a generic
10264         flags.   
10265         New flag: `Unchecked'.  This is used during the EmitMeta phase
10266         (which is out-of-line with the regular Resolve/Emit process for a
10267         statement, as this is done ahead of time, but still gets a chance
10268         to call constant resolve).
10269
10270         (Block.Flags): new enum for adding a new flag.
10271
10272         (Block.EmitMeta): track the state of unchecked.
10273
10274         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
10275         to enable constant resolution to work there as well.
10276
10277 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
10278
10279         * typemanager.cs (ienumerable_type): Also look up
10280         System.Collections.IEnumerable. 
10281
10282 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
10283
10284         TODO: Test more than one conditional per method.
10285
10286         * class.cs (Indexer.Define): Report the location where the user is
10287         referencing the unsupported feature.
10288
10289         (MethodData): Overload the use of `conditionals' to
10290         minimize the creation of needless ArrayLists.   This saves roughly
10291         212kb on my machine.
10292
10293         (Method): Implement the new IIteratorContainer interface.
10294         (Method.SetYields): Implement the method by setting the ModFlags
10295         to contain METHOD_YIELDS.
10296
10297         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
10298         which just got set to null.
10299
10300         * iterators.cs: New file.
10301
10302         (Yield, YieldBreak): New statements.
10303
10304         * statement.cs (Return.Resolve): Flag an error if we are used in
10305         an iterator method.
10306
10307         * codegen.cs (InIterator): New flag set if the code is being
10308         compiled in an iterator method.
10309
10310         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
10311         internal modifier, and we just use it to avoid adding extra
10312         fields, as this is seldom used.  
10313
10314         * cs-parser.jay: Add yield_statement (yield and yield break).
10315
10316         * driver.cs: New flag -v2 to turn on version 2 features. 
10317
10318         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
10319         hashtable when v2 is enabled.
10320
10321 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
10322
10323         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
10324         there is already a namespace defined with this name.
10325
10326         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
10327         people upgraded their corlibs.
10328
10329         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
10330         always use fully qualified types, no need to use the compiler
10331         front end.
10332
10333         (TypeManager.IsNamespace): Use binarysearch.
10334
10335         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
10336         AddDelegate): I did not quite use the new IsValid API properly: I
10337         have to pass the short-name and the fullname.  I was passing only
10338         the basename instead of the fullname sometimes. 
10339
10340         (TypeContainer.DefineType): call NamespaceClash.
10341
10342         * interface.cs (Interface.DefineType): use NamespaceClash before
10343         defining the type.
10344
10345         * delegate.cs (Delegate.DefineType): use NamespaceClash before
10346         defining the type.
10347
10348         * enum.cs: (Enum.DefineType): use NamespaceClash before
10349         defining the type.
10350
10351         * typemanager.cs (: 3-line patch that gives us some tasty 11%
10352         speed increase.  First, use the negative_hits cache when we get a
10353         negative.  Second, add the type with its full original name
10354         instead of the new . and + encoded name (reflection uses + to
10355         separate type from a nested type).  Use LookupTypeReflection
10356         directly which bypasses the type->name hashtable (that we already
10357         know does not contain the type.
10358
10359         * decl.cs (DeclSpace.ResolveTypeExpr): track the
10360         location/container type. 
10361
10362         * driver.cs: When passing utf8, use directly the UTF8Encoding.
10363
10364 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
10365
10366         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
10367
10368         * delegate.cs (NewDelegate.Resolve): Test whether an instance
10369         method is being referenced in the method group from a static
10370         context, and report error 120 if so.
10371
10372         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
10373         Error118. 
10374
10375         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
10376         is created, we create the A namespace).
10377
10378         * cs-parser.jay: A namespace also introduces a DeclarationFound.
10379         Fixes #41591
10380
10381 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
10382
10383         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
10384         invocation to ModuleBuilder.GetType with the same values will
10385         return a new type instance, so we need to cache its return
10386         values. 
10387
10388         * expression.cs (Binary.ResolveOperator): Only allow the compare
10389         operators on enums if they are of the same type.
10390
10391         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
10392         types of ValueType on their own case.  Before we were giving them
10393         the same treatment as objects.
10394
10395         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
10396         fullname.  Short name is used to compare against container name.
10397         Fullname is used to check against defined namespace names.
10398
10399         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
10400         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
10401
10402         (Method.CheckBase): Call parent.
10403         (MemberBase.CheckBase): Check for protected members on sealed
10404         classes.
10405         (PropertyBase.CheckBase): Call parent.
10406         (Field.Define): Call parent.
10407
10408         * report.cs: Negative error codes are now mapped to 8000 - code,
10409         so that the display is render more nicely.
10410
10411         * typemanager.cs: Do not use try/catch, instead report a regular
10412         error. 
10413
10414         (GetPointerType, GetReferenceType): These methods provide
10415         mechanisms to obtain the T* and T& from a T.  We had the code
10416         previously scattered around the code base, and it also used
10417         TypeManager.LookupType that would go through plenty of caches.
10418         This one goes directly to the type source.
10419
10420         In some places we did the Type.GetType followed by
10421         ModuleBuilder.GetType, but not in others, so this unifies the
10422         processing as well.
10423
10424         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
10425         statements now that we have namespace information.
10426
10427         * typemanager.cs (IsNamespace): New method, returns whether the
10428         string presented is a namespace or not.
10429
10430         (ComputeNamespaces): New public entry point, computes the list of
10431         available namespaces, using the GetNamespaces API call in Mono, or
10432         the slower version in MS.NET.   
10433
10434         Now before we start the semantic analysis phase, we have a
10435         complete list of namespaces including everything that the user has
10436         provided.
10437
10438         Deleted old code to cache namespaces in .nsc files.
10439
10440 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
10441
10442         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
10443         class/struct location definition Location for the implicit
10444         constructor location.
10445
10446         (Operator.Define): Use the location of the operator for the
10447         implicit Method definition.
10448
10449         (Constructor.Emit): use the constructor location for the implicit
10450         base initializer constructor.
10451
10452         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
10453         and the Expression class now contains two new methods:
10454
10455         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
10456         isolate type lookup from the rest of the resolution process.
10457
10458         Since we use Expressions to hold type definitions due to the way
10459         we parse the input we have historically overloaded Resolve to
10460         perform the Type lookups if a special flag is passed.  Now this is
10461         eliminated and two methods take their place. 
10462
10463         The differences in the two methods between xStep and xTerminal is
10464         that xStep is involved in our current lookup system that uses
10465         SimpleNames to compose a name, while xTerminal is used just to
10466         catch the case where the simplename lookup failed.
10467
10468 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
10469
10470         * expression.cs (ResolveMemberAccess): Remove redundant code.
10471         TypeExpr expressions are always born fully resolved.
10472
10473         * interface.cs (PopulateMethod): Do not lookup the types twice.
10474         We were doing it once during SemanticAnalysis and once during
10475         PopulateMethod.
10476
10477         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
10478         in local variable type definitions, were being returned as a
10479         SimpleName (we decomposed everything into a string), that is
10480         because primary_expression was being used instead of a type in the
10481         grammar (reduce/reduce conflicts).
10482
10483         The part that was wrong is that we converted the expression into a
10484         string (an oversimplification in one hand, compounded with primary
10485         expressions doing string concatenation).
10486
10487         So things like:
10488
10489         A.B.C [] x;
10490
10491         Would return "A.B.C[]" as a SimpleName.  This stopped things like
10492         using clauses from working on this particular context.  And a type
10493         was being matched directly against "A.B.C[]".
10494
10495         We now use the correct approach, and allow for ComposedCast to be
10496         part of the unary expression.  So the "A.B.C []" become a composed
10497         cast of "A.B.C" (as a nested group of MemberAccess with a
10498         SimpleName at the end) plus the rank composition "[]". 
10499
10500         Also fixes 35567
10501
10502 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
10503
10504         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
10505         for the access level checking.
10506
10507         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
10508         `TypeContainer container', because I kept getting confused when I
10509         was debugging this code.
10510
10511         * expression.cs (Indexers): Instead of tracking getters/setters,
10512         we now track them in parallel.  We create one arraylist less, but
10513         most importantly it is possible now for the LValue code to find a
10514         matching get for a set.
10515
10516         (IndexerAccess.DoResolveLValue): Update the code.
10517         GetIndexersForType has been modified already to extract all the
10518         indexers from a type.  The code assumed it did not.
10519
10520         Also make the code set the correct return type for the indexer.
10521         This was fixed a long time ago for properties, but was missing for
10522         indexers.  It used to be void_type.
10523
10524         (Binary.Emit): Test first for doubles instead of
10525         floats, as they are more common.
10526
10527         (Binary.EmitBranchable): Use the .un version of the branch opcodes
10528         when dealing with floats and the <=, >= operators.  This fixes bug
10529         #39314 
10530
10531         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
10532         to load the array value by emitting a load on the foreach variable
10533         type.  This was incorrect.  
10534
10535         We now emit the code to load an element using the the array
10536         variable type, and then we emit the conversion operator.
10537
10538         Fixed #40176
10539
10540 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
10541
10542         * attribute.cs: Avoid allocation of ArrayLists in the common case.
10543
10544 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
10545
10546         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
10547         test for protection before we test for signatures. 
10548
10549         (MethodSignature.ToString): implement.
10550
10551         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
10552         to the case where we reduced into a LongConstant.
10553
10554         * decl.cs (CheckAccessLevel): If the type is an array, we can not
10555         depend on whether the information is acurrate, because the
10556         Microsoft runtime will always claim that the array type is public,
10557         regardless of the real state.
10558
10559         If the type is a pointer, another problem happens: the type is
10560         reported as non-public in Microsoft.  
10561
10562         In both cases we have to call CheckAccessLevel recursively with
10563         the underlying type as the argument to be tested.
10564
10565 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
10566
10567         * assign.cs (Assign.Emit): If we are dealing with a compound
10568         assignment expression, we should use the code path that stores the
10569         intermediate result in a temporary value.  This fixes #40903.
10570
10571         *expression.cs (Indirection.ToString): Provide ToString method for
10572         debugging. 
10573
10574 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
10575
10576         * class.cs: Null out fields holding references to Block objects so
10577         they can be garbage collected.
10578
10579         * expression.cs (OverloadResolve): Remove unused local.
10580
10581 2003-04-07  Martin Baulig  <martin@ximian.com>
10582
10583         * codegen.cs (EmitContext.CurrentFile): New public field.
10584         (EmitContext.Mark): Use the CurrentFile to check whether the
10585         location is in the correct file.
10586         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
10587
10588 2003-04-07  Martin Baulig  <martin@ximian.com>
10589
10590         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
10591
10592         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
10593         location.  [FIXME: The location argument which gets passed to this
10594         method is sometimes wrong!]
10595
10596 2003-04-07  Nick Drochak <ndrochak@gol.com>
10597
10598         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
10599
10600 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
10601
10602         * expression.cs (Indirection.EmitAssign): We were using the
10603         temporary, but returning immediately instead of continuing the
10604         EmitAssing flow.
10605
10606 2003-04-06  Martin Baulig  <martin@ximian.com>
10607
10608         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
10609         if it's a nested child, but also deriving from the outer class.
10610         See test 190.cs.
10611
10612         * typemanager.cs (IsNestedChildOf): Make this work if it's a
10613         nested child, but also deriving from the outer class.  See
10614         test-190.cs.
10615         (FilterWithClosure): We may access private members of the outer
10616         class if we're a nested child and deriving from the outer class.
10617         (RealMemberLookup): Only set `closure_private_ok' if the
10618         `original_bf' contained BindingFlags.NonPublic.
10619
10620 2003-04-05  Martin Baulig  <martin@ximian.com>
10621
10622         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
10623         probe if its a type parameter, and if so, flag an error.
10624
10625         * decl.cs: Move here the SetParameterInfo code from class.cs.
10626         Handle IsGeneric here.
10627
10628         Handle a variety of errors in the parameter info definition.
10629
10630         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
10631         type parameters here.
10632
10633         * cs-parser.jay (class_declaration): report errors for parameters
10634         here as well.
10635
10636 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
10637
10638         * generic.cs: New file, contains support code for generics.
10639
10640         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
10641         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
10642
10643         Update parser for the above removals.
10644
10645         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
10646         now taken care of in the parser.
10647
10648 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
10649
10650         * class.cs (Event.Define): Do not allow abstract events to have
10651         initializers. 
10652
10653 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
10654
10655         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
10656         block in event declarations.
10657
10658         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
10659         value type, get its address.
10660
10661         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
10662         leaving a class on the stack instead of a boolean value (int
10663         0/1).  Change the code so we compare against null, and then the
10664         result against zero.
10665
10666         * class.cs (TypeContainer.GetClassBases): We were checking for the
10667         parent class being sealed too late.
10668
10669         * expression.cs (Binary.Emit): For <= and >= when dealing with
10670         floating point values, use cgt.un and clt.un instead of cgt and
10671         clt alone.
10672
10673 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
10674
10675         * statement.cs: Apply the same optimization as MS: skip the 
10676         GetEnumerator returning an IEnumerator, and use the one returning a 
10677         CharEnumerator instead. This allows us to avoid the try-finally block 
10678         and the boxing.
10679
10680 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
10681
10682         * cs-parser.jay: Attributes cannot be applied to
10683                          namespaces. Fixes #40473
10684
10685 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10686
10687         * class.cs:
10688         (Add*): check if the name is valid using the full name for constants,
10689         fields, properties and events.
10690
10691 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
10692
10693         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
10694         char constants to be part of the enumeration.
10695
10696         * expression.cs (Conditional.DoResolve): Add support for operator
10697         true. Implements the missing functionality from 14.12
10698
10699         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
10700         operator true/false as required by the spec.
10701
10702         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
10703         implicit conversion to boolean.
10704
10705         * statement.cs (Statement.ResolveBoolean): A boolean expression is
10706         also one where the type implements `operator true'. 
10707
10708         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
10709         get an expression that will invoke operator true based on an
10710         expression.  
10711
10712         (GetConversionOperators): Removed the hack that called op_True
10713         here.  
10714
10715         (Expression.ResolveBoolean): Move this from Statement.
10716
10717 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
10718
10719         * ecore.cs (FieldExpr): do not allow initialization of initonly
10720         fields on derived classes
10721
10722 2003-03-13  Martin Baulig  <martin@ximian.com>
10723
10724         * statement.cs (Block.Emit): Call ig.BeginScope() and
10725         ig.EndScope() when compiling with debugging info; call
10726         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
10727
10728 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
10729
10730         * expression.cs (Indexers): Do not construct immediately, allow
10731         for new members to be appended as we go.  Fixes 38143
10732
10733 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10734
10735         * expression.cs: save/restore context when resolving an unchecked
10736         expression.
10737
10738 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
10739
10740         * cfold.cs: Catch division by zero in modulus operator during
10741         constant folding.
10742
10743 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
10744
10745         * interface.cs (Interface.DefineMembers): Avoid defining members
10746         twice. 
10747
10748 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * driver.cs: handle the +/- options for -noconfig
10751
10752         * statement.cs (Unckeched.Resolve): Also track the state of
10753         unchecked in the Resolve phase.
10754
10755 2003-02-27  Martin Baulig  <martin@ximian.com>
10756
10757         * ecore.cs (Expression.MemberLookup): Don't create a
10758         MethodGroupExpr for something which is not a method.  Fixes #38291.
10759
10760 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
10761
10762         * class.cs (MemberBase.CheckParameters): Also check that the type
10763         is unmanaged if it is a pointer.
10764
10765         * expression.cs (SizeOf.Resolve): Add location information.
10766
10767         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
10768         a managed type is declared.
10769
10770         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
10771         parameter modifiers as well.  Fixes bug 38606
10772
10773         * class.cs: Very sad.  Am backing out the speed up changes
10774         introduced by the ArrayList -> Array in the TypeContainer, as they
10775         were not actually that much faster, and introduced a bug (no error
10776         reports on duplicated methods).
10777
10778         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
10779         source first, this will guarantee that we have a valid expression
10780         before calling in lower levels functions that will require a
10781         resolved object.  Then use this original_source in the
10782         target.ResolveLValue instead of the original source that was
10783         passed to us.
10784
10785         Another change.  Use target.Resolve instead of LValueResolve.
10786         Although we are resolving for LValues, we will let the Assign code
10787         take care of that (it will be called again from Resolve).  This
10788         basically allows code like this:
10789
10790         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
10791         class Y { void A (X x) { x [0] += o; }
10792
10793         The problem was that the indexer was trying to resolve for
10794         set_Item (idx, object o) and never finding one.  The real set_Item
10795         was set_Item (idx, X).  By delaying the process we get the right
10796         semantics. 
10797
10798         Fixes bug 36505
10799
10800 2003-02-23  Martin Baulig  <martin@ximian.com>
10801
10802         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
10803         while calling DoEmit ().
10804
10805         * codegen.cs (EmitContext.Mark): Don't mark locations in other
10806         source files; if you use the #line directive inside a method, the
10807         compiler stops emitting line numbers for the debugger until it
10808         reaches the end of the method or another #line directive which
10809         restores the original file.
10810
10811 2003-02-23  Martin Baulig  <martin@ximian.com>
10812
10813         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
10814
10815 2003-02-23  Martin Baulig  <martin@ximian.com>
10816
10817         * statement.cs (Block.AddChildVariableNames): We need to call this
10818         recursively, not just for our immediate children.
10819
10820 2003-02-23  Martin Baulig  <martin@ximian.com>
10821
10822         * class.cs (Event.Define): Always make the field private, like csc does.
10823
10824         * typemanager.cs (TypeManager.RealMemberLookup): Make events
10825         actually work, fixes bug #37521.
10826
10827 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
10828
10829         * delegate.cs: When creating the various temporary "Parameters"
10830         classes, make sure that we call the ComputeAndDefineParameterTypes
10831         on those new parameters (just like we do with the formal ones), to
10832         allow them to be resolved in the context of the DeclSpace.
10833
10834         This fixes the bug that Dick observed in Bugzilla #38530.
10835
10836 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
10837
10838         * expression.cs (ResolveMemberAccess): When resolving a constant,
10839         do not attempt to pull a constant if the value was not able to
10840         generate a valid constant.
10841
10842         * const.cs (LookupConstantValue): Do not report more errors than required.
10843
10844 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10845
10846         * expression.cs: fixes bug #38328.
10847
10848 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10849
10850         * class.cs: Changed all the various members that can be part of a
10851         class from being an ArrayList to be an Array of the right type.
10852         During the DefineType type_list, interface_list, delegate_list and
10853         enum_list are turned into types, interfaces, delegates and enums
10854         arrays.  
10855
10856         And during the member population, indexer_list, event_list,
10857         constant_list, field_list, instance_constructor_list, method_list,
10858         operator_list and property_list are turned into their real arrays.
10859
10860         Although we could probably perform this operation earlier, for
10861         good error reporting we need to keep the lists and remove the
10862         lists for longer than required.
10863
10864         This optimization was triggered by Paolo profiling the compiler
10865         speed on the output of `gen-sample-program.pl' perl script. 
10866
10867         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
10868         not crash in methods like MemberLookupFailed that use this field.  
10869
10870         This problem arises when the compiler fails to resolve a type
10871         during interface type definition for example.
10872
10873 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
10874
10875         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
10876         inherit from System.Object, so we have to stop at null, not only
10877         when reaching System.Object.
10878
10879 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
10880
10881         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
10882         DeclaredOnly because the parent indexer might have had a different
10883         name, but did not loop until the top of the hierarchy was reached.
10884
10885         The problem this one fixes is 35492: when a class implemented an
10886         indexer from an interface, we were getting the interface method
10887         (which was abstract) and we were flagging an error (can not invoke
10888         abstract method).
10889
10890         This also keeps bug 33089 functioning, and test-148 functioning.
10891
10892         * typemanager.cs (IsSpecialMethod): The correct way of figuring
10893         out if a method is special is to see if it is declared in a
10894         property or event, or whether it is one of the predefined operator
10895         names.   This should fix correctly #36804.
10896
10897 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
10898
10899         The goal here is to remove the dependency on EmptyCast.Peel ().
10900         Killing it completely.
10901
10902         The problem is that currently in a number of places where
10903         constants are expected, we have to "probe" for an EmptyCast, and
10904         Peel, which is not the correct thing to do, as this will be
10905         repetitive and will likely lead to errors. 
10906
10907         The idea is to remove any EmptyCasts that are used in casts that
10908         can be reduced to constants, so we only have to cope with
10909         constants. 
10910
10911         This bug hunt was triggered by Bug 37363 and the desire to remove
10912         the duplicate pattern where we were "peeling" emptycasts to check
10913         whether they were constants.  Now constants will always be
10914         constants.
10915
10916         * ecore.cs: Use an enumconstant here instead of wrapping with
10917         EmptyCast.  
10918
10919         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
10920         throwing me off.  By handling this we can get rid of a few hacks.
10921
10922         * statement.cs (Switch): Removed Peel() code.
10923
10924 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
10925
10926         * class.cs: Location information for error 508
10927
10928         * expression.cs (New.DoResolve): Add a guard against double
10929         resolution of an expression.  
10930
10931         The New DoResolve might be called twice when initializing field
10932         expressions (see EmitFieldInitializers, the call to
10933         GetInitializerExpression will perform a resolve on the expression,
10934         and later the assign will trigger another resolution
10935
10936         This leads to bugs (#37014)
10937
10938         * delegate.cs: The signature for EndInvoke should contain any ref
10939         or out parameters as well.  We were not doing this in the past. 
10940
10941         * class.cs (Field.Define): Do not overwrite the type definition
10942         inside the `volatile' group.  Turns out that volatile enumerations
10943         were changing the type here to perform a validity test, which
10944         broke conversions. 
10945
10946 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
10947
10948         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
10949         and structs, we do not want to load the instance variable
10950
10951         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
10952         enum_type has to be handled like an object reference (implicit
10953         conversions exists from this to object), but the regular IsClass
10954         and IsValueType tests will never return true for this one.
10955
10956         Also we use TypeManager.IsValueType instead of type.IsValueType,
10957         just for consistency with the rest of the code (this is only
10958         needed if we ever use the construct exposed by test-180.cs inside
10959         corlib, which we dont today).
10960
10961 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
10962
10963         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
10964         just InternalCall.
10965
10966 2003-02-09  Martin Baulig  <martin@ximian.com>
10967
10968         * namespace.cs (Namespace..ctor): Added SourceFile argument.
10969         (Namespace.DefineNamespaces): New static public method; this is
10970         called when we're compiling with debugging to add all namespaces
10971         to the symbol file.
10972
10973         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
10974         pass it to the Namespace's .ctor.
10975
10976         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
10977         and MethodBase arguments; pass the namespace ID to the symwriter;
10978         pass the MethodBase instead of the token to the symwriter.
10979         (SymbolWriter.DefineNamespace): New method to add a namespace to
10980         the symbol file.
10981
10982 2003-02-09  Martin Baulig  <martin@ximian.com>
10983
10984         * symbolwriter.cs: New file.  This is a wrapper around
10985         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
10986         methods here in near future.
10987
10988 2003-02-09  Martin Baulig  <martin@ximian.com>
10989
10990         * codegen.cs (EmitContext.Mark): Just pass the arguments to
10991         ILGenerator.MarkSequencePoint() which are actually used by the
10992         symbol writer.
10993
10994 2003-02-09  Martin Baulig  <martin@ximian.com>
10995
10996         * location.cs (SourceFile): New public sealed class.  This
10997         contains the name and an index which is used in the location's token.
10998         (Location): Reserve an appropriate number of bits in the token for
10999         the source file instead of walking over that list, this gives us a
11000         really huge performance improvement when compiling with debugging.
11001
11002         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
11003         `SourceFile' argument instead of a string.
11004         (Driver.ProcessFile): Add all the files via Location.AddFile(),
11005         but don't parse/tokenize here, we need to generate the list of all
11006         source files before we do that.
11007         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
11008         the files.
11009
11010         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
11011         instead of a string.
11012
11013         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
11014         of a string.
11015
11016 2003-02-09  Martin Baulig  <martin@ximian.com>
11017
11018         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
11019         filename on `#line default'.
11020
11021 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
11022
11023         * statement.cs: don't clear the pinned var when the fixed statement
11024         returns from the method (fixes bug#37752).
11025
11026 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
11027
11028         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
11029         to IsValueType.
11030
11031 2003-02-07  Martin Baulig  <martin@ximian.com>
11032
11033         * driver.cs: Removed the `--debug-args' command line argument.
11034
11035         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
11036         automatically by the AsssemblyBuilder.
11037         (CodeGen.InitializeSymbolWriter): We don't need to call any
11038         initialization function on the symbol writer anymore.  This method
11039         doesn't take any arguments.
11040
11041 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
11042
11043         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
11044         from referenced assemblies as well.
11045
11046 2003-02-02  Martin Baulig  <martin@ximian.com>
11047
11048         * class.cs (MethodData.Emit): Generate debugging info for external methods.
11049
11050 2003-02-02  Martin Baulig  <martin@ximian.com>
11051
11052         * class.cs (Constructor.Emit): Open the symbol writer before
11053         emitting the constructor initializer.
11054         (ConstructorInitializer.Emit): Call ec.Mark() to allow
11055         single-stepping through constructor initializers.
11056
11057 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
11058
11059         * class.cs: Handle error 549: do not allow virtual methods in
11060         sealed classes. 
11061
11062 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
11063
11064         * decl.cs: Check access levels when resolving types
11065
11066 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
11067
11068         * statement.cs: Add parameters and locals set in catch blocks that might 
11069         return to set vector
11070
11071 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
11072
11073         * class.cs (Operator): Set the SpecialName flags for operators.
11074
11075         * expression.cs (Invocation.DoResolve): Only block calls to
11076         accessors and operators on SpecialName methods.
11077
11078         (Cast.TryReduce): Handle conversions from char constants.
11079
11080
11081 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
11082
11083         * statement.cs: small memory and time optimization in FlowBranching.
11084
11085 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
11086
11087         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
11088         problem that the last fix but in the other sid (Set).
11089
11090         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
11091         access when there is no indexer in the hierarchy.
11092
11093 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
11094
11095         * class.cs: Combine some if statements.
11096
11097 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11098
11099         * driver.cs: fixed bug #37187.
11100
11101 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
11102
11103         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
11104         any indexer, it's needed to build a list with all the indexers in the
11105         hierarchy (AllGetters), else we have problems. Fixes #35653.
11106
11107 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
11108
11109         * class.cs (MethodData.Define): It is wrong for an interface
11110         implementation to be static in both cases: explicit and implicit.
11111         We were only handling this in one case.
11112
11113         Improve the if situation there to not have negations.
11114
11115         * class.cs (Field.Define): Turns out that we do not need to check
11116         the unsafe bit on field definition, only on usage.  Remove the test.
11117
11118 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11119
11120         * driver.cs: use assembly.Location instead of Codebase (the latest
11121         patch made mcs fail when using MS assemblies).
11122
11123 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
11124
11125         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
11126         get the path to *corlib.dll.
11127
11128 2003-01-21  Nick Drochak <ndrochak@gol.com>
11129
11130         * cs-tokenizer.cs:
11131         * pending.cs:
11132         * typemanager.cs: Remove compiler warnings
11133
11134 2003-01-20  Duncan Mak  <duncan@ximian.com>
11135
11136         * AssemblyInfo.cs: Bump the version number to 0.19.
11137
11138 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11139
11140         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
11141
11142 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
11143
11144         * class.cs (Constructor::Emit): Emit debugging info for constructors.
11145
11146 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
11147
11148         * cs-parser.jay: Small fix: we were not comparing the constructor
11149         name correctly.   Thanks to Zoltan for the initial pointer.
11150
11151 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
11152
11153         * cs-tokenizer.cs: Set file name when specified with #line
11154
11155 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
11156
11157         * cs-parser.jay: Only perform the constructor checks here if we
11158         are named like the class;  This will help provider a better
11159         error.  The constructor path is taken when a type definition is
11160         not found, but most likely the user forgot to add the type, so
11161         report that rather than the constructor error.
11162
11163 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
11164
11165         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
11166         allocations.
11167
11168 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11169
11170         * cs-parser.jay: Add cleanup call.
11171
11172 2003-01-13  Duncan Mak  <duncan@ximian.com>
11173
11174         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
11175         consistent with other methods.
11176
11177 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
11178
11179         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
11180
11181 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
11182
11183         * attribute.cs: only set GuidAttr to true when we have a
11184         GuidAttribute.
11185
11186 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11187
11188         * ecore.cs:
11189         * expression.cs:
11190         * typemanager.cs: fixes to allow mcs compile corlib with the new
11191         Type.IsSubclassOf fix.
11192
11193 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
11194
11195         * expression.cs (LocalVariableReference.DoResolve): Classify a
11196         constant as a value, not as a variable.   Also, set the type for
11197         the variable.
11198
11199         * cs-parser.jay (fixed_statement): take a type instead of a
11200         pointer_type, so we can produce a better error message later.
11201
11202         * statement.cs (Fixed.Resolve): Flag types that are not pointers
11203         as an error.  
11204
11205         (For.DoEmit): Make inifinite loops have a
11206         non-conditional branch back.
11207
11208         (Fixed.DoEmit): First populate the pinned variables, then emit the
11209         statement, then clear the variables.  Before I was emitting the
11210         code once for each fixed piece.
11211
11212
11213 2003-01-08  Martin Baulig  <martin@ximian.com>
11214
11215         * statement.cs (FlowBranching.MergeChild): A break in a
11216         SWITCH_SECTION does not leave a loop.  Fixes #36155.
11217
11218 2003-01-08  Martin Baulig  <martin@ximian.com>
11219
11220         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
11221         lives in the same number space than `param_map'.  Fixes #36154.
11222
11223 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
11224
11225         * cs-parser.jay (constructor_declaration): Set the
11226         Constructor.ModFlags before probing for it.  This makes the
11227         compiler report 514, 515 and 132 (the code was there, but got
11228         broken). 
11229
11230         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
11231         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
11232         (GotoCase.Resolve): Set `Returns' to ALWAYS.
11233
11234 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
11235
11236         * enum.cs: create the enum static fields using the enum type.
11237
11238 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
11239
11240         * class.cs: don't try to create the ParamBuilder for the return
11241         type if it's not needed (and handle it breaking for the ms runtime
11242         anyway).
11243
11244 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
11245
11246         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
11247
11248 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
11249
11250         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
11251         the command.   This showed up while compiling the JANET source
11252         code, which used \r as its only newline separator.
11253
11254 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
11255
11256         * class.cs (Method.Define): If we are an operator (because it
11257         reuses our code), then set the SpecialName and HideBySig.  #36128
11258
11259 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
11260
11261         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
11262         exception, report error 120 `object reference required'.
11263
11264         * driver.cs: Add --pause option, used during to measure the size
11265         of the process as it goes with --timestamp.
11266
11267         * expression.cs (Invocation.DoResolve): Do not allow methods with
11268         SpecialName to be invoked.
11269
11270 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
11271
11272         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
11273         number before adding it.
11274
11275 2002-12-21  Ravi Pratap  <ravi@ximian.com>
11276
11277         * ecore.cs (StandardImplicitConversion): When in an unsafe
11278         context, we allow conversion between void * to any other pointer
11279         type. This fixes bug #35973.
11280
11281 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
11282
11283         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
11284         is not thrown when extensionless outputs are used 
11285
11286 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11287
11288         * rootcontext.cs: fixed compilation of corlib.
11289
11290 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
11291
11292         * attribute.cs (Attributes.Contains): Add new method.
11293
11294         * class.cs (MethodCore.LabelParameters): if the parameter is an
11295         `out' parameter, check that no attribute `[In]' has been passed.
11296
11297         * enum.cs: Handle the `value__' name in an enumeration.
11298
11299 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
11300
11301         * decl.cs: Added special case to allow overrides on "protected
11302         internal" methods
11303
11304 2002-12-18  Ravi Pratap  <ravi@ximian.com>
11305
11306         * attribute.cs (Attributes.AddAttributeSection): Rename to this
11307         since it makes much more sense.
11308
11309         (Attributes.ctor): Don't require a Location parameter.
11310
11311         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
11312
11313         * attribute.cs (ApplyAttributes): Remove extra Location parameters
11314         since we already have that information per attribute.
11315
11316         * everywhere : make appropriate changes.
11317
11318         * class.cs (LabelParameters): Write the code which actually
11319         applies attributes to the return type. We can't do this on the MS
11320         .NET runtime so we flag a warning in the case an exception is
11321         thrown.
11322
11323 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
11324
11325         * const.cs: Handle implicit null conversions here too.
11326
11327 2002-12-17  Ravi Pratap  <ravi@ximian.com>
11328
11329         * class.cs (MethodCore.LabelParameters): Remove the extra
11330         Type [] parameter since it is completely unnecessary. Instead
11331         pass in the method's attributes so that we can extract
11332         the "return" attribute.
11333
11334 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
11335
11336         * cs-parser.jay (parse): Use Report.Error to flag errors instead
11337         of ignoring it and letting the compile continue.
11338
11339         * typemanager.cs (ChangeType): use an extra argument to return an
11340         error condition instead of throwing an exception.
11341
11342 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
11343
11344         * expression.cs (Unary.TryReduce): mimic the code for the regular
11345         code path.  Perform an implicit cast in the cases where we can
11346         implicitly convert to one of the integral types, and then reduce
11347         based on that constant.   This fixes bug #35483.
11348
11349 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11350
11351         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
11352
11353 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11354
11355         * namespace.cs: fixed bug #35489.
11356
11357 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
11358
11359         * class.cs: Remove some dead code.
11360
11361         * cs-parser.jay: Estimate the number of methods needed
11362         (RootContext.MethodCount);
11363
11364         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
11365         numbers instead of StringBuilders.
11366
11367         * support.cs (PtrHashtable): Add constructor with initial size;
11368         We can now reduce reallocations of the method table.
11369
11370 2002-12-10  Ravi Pratap  <ravi@ximian.com>
11371
11372         * attribute.cs (ApplyAttributes): Keep track of the emitted
11373         attributes on a per-target basis. This fixes bug #35413.
11374
11375 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
11376
11377         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
11378         default to the Windows 1252 encoding.
11379
11380         (UnixParseOption): Support version, thanks to Alp for the missing
11381         pointer. 
11382
11383         * AssemblyInfo.cs: Add nice assembly information.
11384
11385         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
11386         (bug 35169).
11387
11388         * cs-parser.jay: Allow a trailing comma before the close bracked
11389         in the attribute_section production.
11390
11391         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
11392         address of the instance was being taken, I will take this out,
11393         because we take the address of the object immediately here.
11394
11395 2002-12-09  Ravi Pratap  <ravi@ximian.com>
11396
11397         * typemanager.cs (AreMultipleAllowed): Take care of the most
11398         obvious case where attribute type is not in the current assembly -
11399         stupid me ;-)
11400
11401 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
11402
11403         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
11404         definitions, instead of doing that afterwards.  
11405
11406         Also we use a nice little hack, depending on the constructor, we
11407         know if we are a "composed" name or a simple name.  Hence, we
11408         avoid the IndexOf test, and we avoid 
11409
11410         * codegen.cs: Add code to assist in a bug reporter to track down
11411         the source of a compiler crash. 
11412
11413 2002-12-07  Ravi Pratap  <ravi@ximian.com>
11414
11415         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
11416         types have been emitted for a given element and flag an error
11417         if something which does not have AllowMultiple set is used more
11418         than once.
11419
11420         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
11421         attribute types and their corresponding AllowMultiple properties
11422
11423         (AreMultipleAllowed): Check the property for a given type.
11424
11425         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
11426         property in the case we have a TypeContainer.
11427
11428         (Attributes.AddAttribute): Detect duplicates and just skip on
11429         adding them. This trivial fix catches a pretty gross error in our
11430         attribute emission - global attributes were being emitted twice!
11431
11432         Bugzilla bug #33187 is now fixed.
11433
11434 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
11435
11436         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
11437         instead of pp_and).
11438
11439         * expression.cs (Binary.ResolveOperator): I can only use the
11440         Concat (string, string, string) and Concat (string, string,
11441         string, string) if the child is actually a concatenation of
11442         strings. 
11443
11444 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
11445
11446         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
11447         context where we need a 2-character lookahead.
11448
11449         * pending.cs (PendingImplementation): Rework so we can keep track
11450         of interface types all the time, and flag those which were
11451         implemented by parents as optional.
11452
11453 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
11454
11455         * expression.cs (Binary.ResolveOperator): Use
11456         String.Concat(string,string,string) or
11457         String.Concat(string,string,string,string) when possible. 
11458
11459         * typemanager: More helper methods.
11460
11461
11462 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
11463
11464         * pending.cs: remove the bogus return from GetMissingInterfaces()
11465         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
11466
11467 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11468
11469         * namespace.cs: avoid duplicated 'using xxx' being added to
11470         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
11471         when we get more than one 'using' statement for the same namespace.
11472         Report a CS0105 warning for it.
11473
11474 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
11475
11476         * cs-tokenizer.cs (consume_identifier): use read directly, instead
11477         of calling getChar/putback, uses internal knowledge of it.    
11478
11479         (xtoken): Reorder tokenizer so most common patterns are checked
11480         first.  This reduces the compilation time in another 5% (from 8.11s
11481         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
11482
11483         The parsing time is 22% of the compilation in mcs, and from that
11484         64% is spent on the tokenization process.  
11485
11486         I tried using a binary search for keywords, but this is slower
11487         than the hashtable.  Another option would be to do a couple of
11488         things:
11489
11490                 * Not use a StringBuilder, instead use an array of chars,
11491                   with a set value.  Notice that this way we could catch
11492                   the 645 error without having to do it *afterwards*.
11493
11494                 * We could write a hand-parser to avoid the hashtable
11495                   compares altogether.
11496
11497         The identifier consumption process takes 37% of the tokenization
11498         time.  Another 15% is spent on is_number.  56% of the time spent
11499         on is_number is spent on Int64.Parse:
11500
11501                 * We could probably choose based on the string length to
11502                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
11503                   computations. 
11504
11505         Another 3% is spend on wrapping `xtoken' in the `token' function.
11506
11507         Handle 0xa0 as whitespace (#34752)
11508
11509 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
11510
11511         * typemanager.cs (IsCLRType): New routine to tell whether a type
11512         is one of the builtin types.  
11513
11514         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
11515         typecode in more places instead of doing pointer comparissions.
11516         We could leverage some knowledge about the way the typecodes are
11517         laid out.
11518
11519         New code to cache namespaces in assemblies, it is currently not
11520         invoked, to be used soon.
11521
11522         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
11523
11524         * expression.cs (Binary.ResolveOperator): specially handle
11525         strings, and do not perform user-defined operator overloading for
11526         built-in types.
11527
11528 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
11529
11530         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
11531         internalcall as it is a pretty simple operation;  Avoid whenever
11532         possible to call Char.IsLetter.
11533
11534         (consume_identifier): Cut by half the number of
11535         hashtable calls by merging the is_keyword and GetKeyword behavior.
11536
11537         Do not short-circuit, because if we do, we
11538         report errors (ie, #if false && true would produce an invalid
11539         directive error);
11540
11541
11542 2002-11-24  Martin Baulig  <martin@ximian.com>
11543
11544         * expression.cs (Cast.TryReduce): If we're in checked syntax,
11545         check constant ranges and report a CS0221.  Fixes #33186.
11546
11547 2002-11-24  Martin Baulig  <martin@ximian.com>
11548
11549         * cs-parser.jay: Make this work for uninitialized variable
11550         declarations in the `for' initializer.  Fixes #32416.
11551
11552 2002-11-24  Martin Baulig  <martin@ximian.com>
11553
11554         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
11555         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
11556
11557 2002-11-24  Martin Baulig  <martin@ximian.com>
11558
11559         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
11560         argument; if true, we also check for user-defined conversions.
11561         This is only needed if both arguments are of a user-defined type.
11562         Fixes #30443, added test-175.cs.
11563         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
11564
11565         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
11566
11567 2002-11-24  Martin Baulig  <martin@ximian.com>
11568
11569         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
11570         function to get the store opcode.
11571         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
11572         only emit the Ldelema if the store opcode is Stobj.  You must run
11573         both test-34 and test-167 to test this.  Fixes #34529.
11574
11575 2002-11-23  Martin Baulig  <martin@ximian.com>
11576
11577         * ecore.cs (Expression.MemberLookup): Added additional
11578         `qualifier_type' argument which is used when we're being called
11579         from MemberAccess.DoResolve() and null if we're called from a
11580         SimpleName lookup.
11581         (Expression.MemberLookupFailed): New method to report errors; this
11582         does the CS1540 check and reports the correct error message.
11583
11584         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
11585         argument for the CS1540 check and redone the way how we're dealing
11586         with private members.  See the comment in the source code for details.
11587         (FilterWithClosure): Reverted this back to revision 1.197; renamed
11588         `closure_start_type' to `closure_qualifier_type' and check whether
11589         it's not null.  It was not this filter being broken, it was just
11590         being called with the wrong arguments.
11591
11592         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
11593         and pass it the correct `qualifier_type'; this also does the error
11594         handling for us.
11595
11596 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
11597
11598         * expression.cs (Invocation.EmitParams): If the we are dealing
11599         with a non-built-in value type, load its address as well.
11600
11601         (ArrayCreation): Use a a pretty constant instead
11602         of the hardcoded value 2.   Use 6 instead of 2 for the number of
11603         static initializers.  
11604
11605         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
11606         because they are not really value types, just glorified integers. 
11607
11608         * driver.cs: Do not append .exe, the CSC compiler does not do it.
11609
11610         * ecore.cs: Remove redundant code for enumerations, make them use
11611         the same code path as everything else, fixes the casting issue
11612         with enumerations in Windows.Forms.
11613
11614         * attribute.cs: Do only cast to string if it is a string, the
11615         validation happens later.
11616
11617         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
11618         people upgrade their corlibs.
11619
11620         * ecore.cs: Oops, enumerations were not following the entire code path
11621
11622 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
11623
11624         * typemanager.cs (FilterWithClosure): Commented out the test for
11625         1540 in typemanager.cs, as it has problems when accessing
11626         protected methods from a parent class (see test-174.cs). 
11627
11628         * attribute.cs (Attribute.ValidateGuid): new method.
11629         (Attribute.Resolve): Use above.
11630
11631 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
11632
11633         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
11634
11635         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
11636         handling for enumerations, as we only needed the TypeContainer
11637         functionality to begin with (this is required for the fix below to
11638         work for enums that reference constants in a container class for
11639         example). 
11640
11641         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
11642
11643         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
11644         a valid TypeBuilder to perform lookups on.o
11645
11646         * class.cs (InheritableMemberSignatureCompare): Use true in the
11647         call to GetGetMethod and GetSetMethod, because we are comparing
11648         the signature, and we need to get the methods *even* if they are
11649         private. 
11650
11651         (PropertyBase.CheckBase): ditto.
11652
11653         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
11654         GotoCase.Resolve): Use Peel on EmpytCasts.
11655
11656         * ecore.cs (EmptyCast): drop child, add Peel method.
11657
11658 2002-11-17  Martin Baulig  <martin@ximian.com>
11659
11660         * ecore.cs (EmptyCast.Child): New public property.
11661
11662         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
11663         label resolved to an EmptyCast.  Fixes #34162.
11664         (GotoCase.Resolve): Likewise.
11665         (Block.EmitMeta): Likewise.
11666
11667 2002-11-17  Martin Baulig  <martin@ximian.com>
11668
11669         * expression.cs (Invocation.BetterConversion): Prefer int over
11670         uint; short over ushort; long over ulong for integer literals.
11671         Use ImplicitConversionExists instead of StandardConversionExists
11672         since we also need to check for user-defined implicit conversions.
11673         Fixes #34165.  Added test-173.cs.
11674
11675 2002-11-16  Martin Baulig  <martin@ximian.com>
11676
11677         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
11678         with the `true' and `false' literals.  Fixes #33151.
11679
11680 2002-11-16  Martin Baulig  <martin@ximian.com>
11681
11682         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
11683         October 22nd; don't do the cs1540 check for static members.
11684
11685         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
11686         now using our own filter here and doing the cs1540 check again.
11687
11688 2002-11-16  Martin Baulig  <martin@ximian.com>
11689
11690         * support.cs (InternalParameters): Don't crash if we don't have
11691         any fixed parameters.  Fixes #33532.
11692
11693 2002-11-16  Martin Baulig  <martin@ximian.com>
11694
11695         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
11696         when looking up static methods to make this work on Windows.
11697         Fixes #33773.
11698
11699 2002-11-16  Martin Baulig  <martin@ximian.com>
11700
11701         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
11702         a setter rather than using PropertyInfo.CanWrite.
11703
11704 2002-11-15  Nick Drochak  <ndrochak@gol.com>
11705
11706         * class.cs: Allow acces to block member by subclasses. Fixes build
11707         breaker.
11708
11709 2002-11-14  Martin Baulig  <martin@ximian.com>
11710
11711         * class.cs (Constructor.Emit): Added the extern/block check.
11712         Fixes bug #33678.
11713
11714 2002-11-14  Martin Baulig  <martin@ximian.com>
11715
11716         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
11717         iteration while looking for indexers, this is needed because the
11718         indexer may have a different name in our base classes.  Fixed the
11719         error reporting (no indexers at all, not get accessor, no
11720         overloaded match).  Fixes bug #33089.
11721         (IndexerAccess.DoResolveLValue): Likewise.
11722
11723 2002-11-14  Martin Baulig  <martin@ximian.com>
11724
11725         * class.cs (PropertyBase.CheckBase): Make this work for multiple
11726         indexers.  Fixes the first part of bug #33089.
11727         (MethodSignature.InheritableMemberSignatureCompare): Added support
11728         for properties.
11729
11730 2002-11-13  Ravi Pratap  <ravi@ximian.com>
11731
11732         * attribute.cs (Attribute.Resolve): Catch the
11733         NullReferenceException and report it since it isn't supposed to
11734         happen. 
11735
11736 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
11737
11738         * expression.cs (Binary.EmitBranchable): Also handle the cases for
11739         LogicalOr and LogicalAnd that can benefit from recursively
11740         handling EmitBranchable.  The code now should be nice for Paolo.
11741
11742 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
11743
11744         * typemanager.cs (LookupType): Added a negative-hit hashtable for
11745         the Type lookups, as we perform quite a number of lookups on
11746         non-Types.  This can be removed once we can deterministically tell
11747         whether we have a type or a namespace in advance.
11748
11749         But this might require special hacks from our corlib.
11750
11751         * TODO: updated.
11752
11753         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
11754         and double which avoids a conversion from an integer to a double.
11755
11756         * expression.cs: tiny optimization, avoid calling IsConstant,
11757         because it effectively performs the lookup twice.
11758
11759 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
11760
11761         But a bogus return here to keep the semantics of the old code
11762         until the Mono runtime is fixed.
11763
11764         * pending.cs (GetMissingInterfaces): New method used to remove all
11765         the interfaces that are already implemented by our parent
11766         classes from the list of pending methods. 
11767
11768         * interface.cs: Add checks for calls after ResolveTypeExpr.
11769
11770 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
11771
11772         * class.cs (Class.Emit): Report warning 67: event not used if the
11773         warning level is beyond 3.
11774
11775         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
11776         being a NullLiteral.
11777
11778         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
11779         specifiers. 
11780
11781         * class.cs (TypeContainer.GetClassBases): Cover a missing code
11782         path that might fail if a type can not be resolved.
11783
11784         * expression.cs (Binary.Emit): Emit unsigned versions of the
11785         operators. 
11786
11787         * driver.cs: use error 5.
11788
11789 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
11790
11791         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
11792
11793 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
11794
11795         * cs-parser.jay (switch_section): A beautiful patch from Martin
11796         Baulig that fixed 33094.
11797
11798 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
11799
11800         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
11801         Check whether the base is abstract and report an error if so.
11802
11803         * expression.cs (IndexerAccess.DoResolveLValue,
11804         IndexerAccess.DoResolve): ditto. 
11805
11806         (Invocation.DoResolve): ditto.
11807
11808         (Invocation.FullMethodDesc): Improve the report string.
11809
11810         * statement.cs (Block): Eliminate IsVariableDefined as it is
11811         basically just a wrapper for GetVariableInfo.
11812
11813         * ecore.cs (SimpleName): Use new 
11814
11815         * support.cs (ReflectionParamter.ParameterType): We unwrap the
11816         type, as we return the actual parameter ref/unref state on a
11817         different call.
11818
11819 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
11820
11821         * support.cs: Return proper flags REF/OUT fixing the previous
11822         commit.  
11823
11824         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
11825         not used to mean `ref' but `ref or out' in ParameterReference
11826
11827         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
11828         full type signature instead of calling TypeManger.CSharpName
11829         ourselves. 
11830
11831         * support.cs (InternalParameters.ParameterDesc): Do not compare
11832         directly to the modflags, because REF/OUT will actually be bitsets
11833         if set. 
11834
11835         * delegate.cs (VerifyMethod): Check also the modifiers.
11836
11837         * cs-tokenizer.cs: Fix bug where floating point values with an
11838         exponent where a sign was missing was ignored.
11839
11840         * driver.cs: Allow multiple assemblies to be specified in a single
11841         /r: argument
11842
11843 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
11844
11845         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
11846         because identifiers after a parenthesis would end up in this kind
11847         of production, and we needed to desamiguate it for having casts
11848         like:
11849
11850                 (UserDefinedType *) xxx
11851
11852 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
11853
11854         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
11855         we should set on the Bindingflags.NonPublic, but not turn on
11856         private_ok.  private_ok controls whether a Private member is
11857         returned (this is chekced on the filter routine), while the
11858         BindingFlags.NonPublic just controls whether private/protected
11859         will be allowed.   This fixes the problem part of the problem of
11860         private properties being allowed to be used in derived classes.
11861
11862         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
11863         so we can call the children DoResolveLValue method (this will
11864         properly signal errors on lvalue assignments to base properties)
11865
11866         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
11867         getter are null, and we have a property info, we know that this
11868         happened because the lookup failed, so we report an error 122 for
11869         protection level violation.
11870
11871         We also silently return if setter and getter are null in the
11872         resolve functions, this condition only happens if we have flagged
11873         the error before.  This is the other half of the problem. 
11874
11875         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
11876         not have accessibility information, that is why we were returning
11877         true in the filter function in typemanager.cs.
11878
11879         To properly report 122 (property is inaccessible because of its
11880         protection level) correctly, we report this error in ResolveAccess
11881         by failing if both the setter and the getter are lacking (ie, the
11882         lookup failed). 
11883
11884         DoResolve and DoLResolve have been modified to check for both
11885         setter/getter being null and returning silently, the reason being
11886         that I did not want to put the knowledge about this error in upper
11887         layers, like:
11888
11889         int old = Report.Errors;
11890         x = new PropertyExpr (...);
11891         if (old != Report.Errors)
11892                 return null;
11893         else
11894                 return x;
11895
11896         So the property expr is returned, but it is invalid, so the error
11897         will be flagged during the resolve process. 
11898
11899         * class.cs: Remove InheritablePropertySignatureCompare from the
11900         class, as we no longer depend on the property signature to compute
11901         whether it is possible to implement a method or not.
11902
11903         The reason is that calling PropertyInfo.GetGetMethod will return
11904         null (in .NET, in Mono it works, and we should change this), in
11905         cases where the Get Method does not exist in that particular
11906         class.
11907
11908         So this code:
11909
11910         class X { public virtual int A { get { return 1; } } }
11911         class Y : X { }
11912         class Z : Y { public override int A { get { return 2; } } }
11913
11914         Would fail in Z because the parent (Y) would not have the property
11915         defined.  So we avoid this completely now (because the alternative
11916         fix was ugly and slow), and we now depend exclusively on the
11917         method names.
11918
11919         (PropertyBase.CheckBase): Use a method-base mechanism to find our
11920         reference method, instead of using the property.
11921
11922         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
11923         routines are gone now.
11924
11925         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
11926         names, they were incorrectly named.
11927
11928         * cs-tokenizer.cs: Return are more gentle token on failure. 
11929
11930         * pending.cs (PendingImplementation.InterfaceMethod): This routine
11931         had an out-of-sync index variable, which caused it to remove from
11932         the list of pending methods the wrong method sometimes.
11933
11934 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
11935
11936         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
11937         CanWrite, because those refer to this particular instance of the
11938         property, and do not take into account the fact that we can
11939         override single members of a property.
11940
11941         Constructor requires an EmitContext.  The resolution process does
11942         not happen here, but we need to compute the accessors before,
11943         because the resolution does not always happen for properties.
11944
11945         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
11946         subclass, before we did not update this flag, but we did update
11947         bindingflags. 
11948
11949         (GetAccessors): Drop this routine, as it did not work in the
11950         presence of partially overwritten set/get methods. 
11951
11952         Notice that this broke the cs1540 detection, but that will require
11953         more thinking. 
11954
11955 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11956
11957         * class.cs:
11958         * codegen.cs:
11959         * driver.cs: issue a warning instead of an error if we don't support
11960         debugging for the platform. Also ignore a couple of errors that may
11961         arise when trying to write the symbols. Undo my previous patch.
11962
11963 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11964
11965         * driver.cs: ignore /debug switch except for Unix platforms.
11966
11967 2002-10-23  Nick Drochak  <ndrochak@gol.com>
11968
11969         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
11970
11971 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
11972
11973         * driver.cs: Do not make mcs-debug conditional, so we do not break
11974         builds that use it.
11975
11976         * statement.cs (UsageVector.MergeChildren): I would like Martin to
11977         review this patch.  But basically after all the children variables
11978         have been merged, the value of "Breaks" was not being set to
11979         new_breaks for Switch blocks.  I think that it should be set after
11980         it has executed.  Currently I set this to the value of new_breaks,
11981         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
11982         conservative, but I do not understand this code very well.
11983
11984         I did not break anything in the build, so that is good ;-)
11985
11986         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
11987
11988 2002-10-20  Mark Crichton  <crichton@gimp.org>
11989
11990         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
11991
11992 2002-10-20  Nick Drochak  <ndrochak@gol.com>
11993
11994         * cfold.cs: Fixed compile blocker.
11995
11996 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
11997
11998         * driver.cs: I was chekcing the key, not the file.
11999
12000 2002-10-19  Ravi Pratap  <ravi@ximian.com>
12001
12002         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
12003         message that we were generating - we just need to silently return
12004         a null.
12005
12006 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
12007
12008         * class.cs (Event.Define): Change my previous commit, as this
12009         breaks the debugger.  This is a temporary hack, as it seems like
12010         the compiler is generating events incorrectly to begin with.
12011
12012         * expression.cs (Binary.ResolveOperator): Added support for 
12013         "U operator - (E x, E y)"
12014
12015         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
12016         y)".
12017
12018         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
12019         init-only variables, but this path did not take into account that
12020         there might be also instance readonly variables.  Correct this
12021         problem. 
12022
12023         This fixes bug 32253
12024
12025         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
12026         delegates as well.
12027
12028         * driver.cs: Change the extension for modules to `netmodule'
12029
12030         * cs-parser.jay: Improved slightly the location tracking for
12031         the debugger symbols.
12032
12033         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
12034         modifiers that were specified instead of the hardcoded value
12035         (FamAndAssem).  This was basically ignoring the static modifier,
12036         and others.  Fixes 32429.
12037
12038         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
12039         fixed a bug in the process (32476)
12040
12041         * expression.cs (ArrayAccess.EmitAssign): Patch from
12042         hwang_rob@yahoo.ca that fixes bug 31834.3
12043
12044 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
12045
12046         * driver.cs: Make the module extension .netmodule.
12047
12048 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
12049
12050         * driver.cs: Report an error if the resource file is not found
12051         instead of crashing.
12052
12053         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
12054         false, like Emit does.
12055
12056 2002-10-16  Nick Drochak  <ndrochak@gol.com>
12057
12058         * typemanager.cs: Remove unused private member.  Also reported mcs
12059         bug to report this as a warning like csc.
12060
12061 2002-10-15  Martin Baulig  <martin@gnome.org>
12062
12063         * statement.cs (Statement.Emit): Made this a virtual method; emits
12064         the line number info and calls DoEmit().
12065         (Statement.DoEmit): New protected abstract method, formerly knows
12066         as Statement.Emit().
12067
12068         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
12069
12070 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
12071
12072         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
12073         have fixed a remaining problem: not every AddXXXX was adding a
12074         fully qualified name.  
12075
12076         Now everyone registers a fully qualified name in the DeclSpace as
12077         being defined instead of the partial name.  
12078
12079         Downsides: we are slower than we need to be due to the excess
12080         copies and the names being registered this way.  
12081
12082         The reason for this is that we currently depend (on the corlib
12083         bootstrap for instance) that types are fully qualified, because
12084         we dump all the types in the namespace, and we should really have
12085         types inserted into the proper namespace, so we can only store the
12086         basenames in the defined_names array.
12087
12088 2002-10-10  Martin Baulig  <martin@gnome.org>
12089
12090         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
12091         from bug #31834, see the bug report for a testcase which is
12092         miscompiled.
12093
12094 2002-10-10  Martin Baulig  <martin@gnome.org>
12095
12096         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
12097         flow analysis code for this.
12098
12099         * statement.cs (Do, While, For): Tell the flow analysis code about
12100         infinite loops.
12101         (FlowBranching.UsageVector): Added support for infinite loops.
12102         (Block.Resolve): Moved the dead code elimination here and use flow
12103         analysis to do it.
12104
12105 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
12106
12107         * class.cs (Field.Define): Catch cycles on struct type
12108         definitions. 
12109
12110         * typemanager.cs (IsUnmanagedtype): Do not recursively check
12111         fields if the fields are static.  We only need to check instance
12112         fields. 
12113
12114         * expression.cs (As.DoResolve): Test for reference type.
12115
12116         * statement.cs (Using.ResolveExpression): Use
12117         ConvertImplicitRequired, not ConvertImplicit which reports an
12118         error on failture
12119         (Using.ResolveLocalVariableDecls): ditto.
12120
12121         * expression.cs (Binary.ResolveOperator): Report errors in a few
12122         places where we had to.
12123
12124         * typemanager.cs (IsUnmanagedtype): Finish implementation.
12125
12126 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
12127
12128         * expression.cs: Use StoreFromPtr instead of extracting the type
12129         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
12130
12131         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
12132         an enumeration value to a System.Enum, but System.Enum is not a
12133         value type, but an class type, so we need to box.
12134
12135         (Expression.ConvertExplicit): One codepath could return
12136         errors but not flag them.  Fix this.  Fixes #31853
12137
12138         * parameter.cs (Resolve): Do not allow void as a parameter type.
12139
12140 2002-10-06  Martin Baulig  <martin@gnome.org>
12141
12142         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
12143         if it's a class type and not a struct.  Fixes #31815.
12144
12145 2002-10-06  Martin Baulig  <martin@gnome.org>
12146
12147         * statement.cs: Reworked the flow analysis code a bit to make it
12148         usable for dead code elimination.
12149
12150 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12151
12152         * cs-parser.jay: allow empty source files. Fixes bug #31781.
12153
12154 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12155
12156         * expression.cs (ComposedCast.DoResolveType): A quick workaround
12157         to fix the test 165, will investigate deeper.
12158
12159 2002-10-04  Martin Baulig  <martin@gnome.org>
12160
12161         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
12162         finally blocks actually work.
12163         (Try.Resolve): We don't need to create a sibling for `finally' if
12164         there is no finally block.
12165
12166 2002-10-04  Martin Baulig  <martin@gnome.org>
12167
12168         * class.cs (Constructor.Define): The default accessibility for a
12169         non-default constructor is private, not public.
12170
12171 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
12172
12173         * class.cs (Constructor): Make AllowedModifiers public, add
12174         EXTERN.
12175
12176         * cs-parser.jay: Perform the modifiers test here, as the
12177         constructor for the Constructor class usually receives a zero
12178         because of the way we create it (first we create, later we
12179         customize, and we were never checking the modifiers).
12180
12181         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
12182         is a version of LookupTypeReflection that includes the type-name
12183         cache.  This can be used as a fast path for functions that know
12184         the fully qualified name and are only calling into *.GetType() to
12185         obtain a composed type.
12186
12187         This is also used by TypeManager.LookupType during its type
12188         composition.
12189
12190         (LookupType): We now also track the real type name, as sometimes
12191         we can get a quey for the real type name from things like
12192         ComposedCast.  This fixes bug 31422.
12193
12194         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
12195         complete type fullname, it does not have to go through the type
12196         resolution system to obtain the composed version of the type (for
12197         obtaining arrays or pointers).
12198
12199         (Conditional.Emit): Use the EmitBoolExpression to
12200         generate nicer code, as requested by Paolo.
12201
12202         (ArrayCreation.CheckIndices): Use the patch from
12203         hwang_rob@yahoo.ca to validate the array initializers. 
12204
12205 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
12206
12207         * class.cs (ConstructorInitializer.Emit): simplify code by using
12208         Invocation.EmitCall, and at the same time, fix the bugs in calling
12209         parent constructors that took variable arguments. 
12210
12211         * ecore.cs (Expression.ConvertNumericExplicit,
12212         Expression.ImplicitNumericConversion): Remove the code that
12213         manually wrapped decimal (InternalTypeConstructor call is now gone
12214         as well).
12215
12216         * expression.cs (Cast.TryReduce): Also handle decimal types when
12217         trying to perform a constant fold on the type.
12218
12219         * typemanager.cs (IsUnmanagedtype): Partially implemented.
12220
12221         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
12222         that only turned off an error report, and did nothing else. 
12223
12224 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
12225
12226         * driver.cs: Handle and ignore /fullpaths
12227
12228 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
12229
12230         * expression.cs (Binary.ResolveOperator): Catch the case where
12231         DoNumericPromotions returns true, 
12232
12233         (Binary.DoNumericPromotions): Simplify the code, and the tests.
12234
12235 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
12236
12237         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
12238         report error 70.
12239
12240 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
12241
12242         * ecore.cs (ConvertNumericExplicit): It is not enough that the
12243         conversion exists, but it is also required that the conversion be
12244         performed.  This manifested in "(Type64Enum) 2".  
12245
12246         * class.cs (TypeManager.AddMethod): The fix is not to change
12247         AddEnum, because that one was using a fully qualified name (every
12248         DeclSpace derivative does), but to change the AddMethod routine
12249         that was using an un-namespaced name.  This now correctly reports
12250         the duplicated name.
12251
12252         Revert patch until I can properly fix it.  The issue
12253         is that we have a shared Type space across all namespaces
12254         currently, which is wrong.
12255
12256         Options include making the Namespace a DeclSpace, and merge
12257         current_namespace/current_container in the parser.
12258
12259 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
12260
12261         * cs-parser.jay: Improve error reporting when we get a different
12262         kind of expression in local_variable_type and
12263         local_variable_pointer_type. 
12264
12265         Propagate this to avoid missleading errors being reported.
12266
12267         * ecore.cs (ImplicitReferenceConversion): treat
12268         TypeManager.value_type as a target just like object_type.   As
12269         code like this:
12270
12271         ValueType v = 1;
12272
12273         Is valid, and needs to result in the int 1 being boxed before it
12274         is assigned to the value type v.
12275
12276         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
12277         to validate the enumeration name.
12278
12279         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
12280         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
12281         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
12282
12283         * ecore.cs (TryImplicitIntConversion): When doing an
12284         implicit-enumeration-conversion, check if the type is 64-bits and
12285         perform a conversion before passing to EnumConstant.
12286
12287 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
12288
12289         * decl.cs (Error_AmbiguousTypeReference); New routine used to
12290         report ambiguous type references.  Unlike the MS version, we
12291         report what the ambiguity is.   Innovation at work ;-)
12292
12293         (DeclSpace.FindType): Require a location argument to
12294         display when we display an ambiguous error.
12295
12296         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
12297
12298         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
12299
12300         * expression.cs (EmitDynamicInitializers): Apply patch from
12301         hwang_rob@yahoo.ca that fixes the order in which we emit our
12302         initializers. 
12303
12304 2002-09-21  Martin Baulig  <martin@gnome.org>
12305
12306         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
12307         delegate takes no arguments.
12308
12309 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
12310
12311         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
12312         from integers.
12313
12314         * expression.cs: Extract the underlying type.
12315
12316         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
12317
12318         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
12319
12320 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
12321
12322         * class.cs (TypeContainer.DefineType): We can not use the nice
12323         PackingSize with the size set to 1 DefineType method, because it
12324         will not allow us to define the interfaces that the struct
12325         implements.
12326
12327         This completes the fixing of bug 27287
12328
12329         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
12330         means also structs.  This fixes part of the problem. 
12331         (Expresion.ImplicitReferenceConversionExists): ditto.
12332
12333         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
12334         error if there were no errors reported during the type lookup
12335         process, to avoid duplicates or redundant errors.  Without this
12336         you would get an ambiguous errors plus a type not found.  We have
12337         beaten the user enough with the first error.  
12338
12339         (DeclSparce.FindType): Emit a warning if we have an ambiguous
12340         reference. 
12341
12342         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
12343         during the resolution process, stop the lookup, this avoids
12344         repeated error reports (same error twice).
12345
12346         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
12347
12348         * typemanager.cs (LookupType): Redo the type lookup code to match
12349         the needs of System.Reflection.  
12350
12351         The issue is that System.Reflection requires references to nested
12352         types to begin with a "+" sign instead of a dot.  So toplevel
12353         types look like: "NameSpace.TopLevelClass", and nested ones look
12354         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
12355         levels. 
12356
12357 2002-09-19  Martin Baulig  <martin@gnome.org>
12358
12359         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
12360         says that a method always returns or always throws an exception,
12361         don't report the CS0161.
12362
12363         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
12364         set `Returns = new_returns'.
12365
12366 2002-09-19  Martin Baulig  <martin@gnome.org>
12367
12368         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
12369         to an enum constant, check for a CS0176.
12370
12371 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * class.cs (TypeContainer.CheckPairedOperators): Now we check
12374         for operators that must be in pairs and report errors.
12375
12376         * ecore.cs (SimpleName.DoResolveType): During the initial type
12377         resolution process, when we define types recursively, we must
12378         check first for types in our current scope before we perform
12379         lookups in the enclosing scopes.
12380
12381         * expression.cs (MakeByteBlob): Handle Decimal blobs.
12382
12383         (Invocation.VerifyArgumentsCompat): Call
12384         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
12385         I thought we were supposed to always call this, but there are a
12386         few places in the code where we dont do it.
12387
12388 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
12389
12390         * driver.cs: Add support in -linkres and -resource to specify the
12391         name of the identifier.
12392
12393 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12394
12395         * ecore.cs (StandardConversionExists): Sync with the conversion
12396         code: allow anything-* to void* conversions.
12397
12398         (FindMostSpecificSource): Use an Expression argument
12399         instead of a Type, because we might be handed over a Literal which
12400         gets a few more implicit conversions that plain types do not.  So
12401         this information was being lost.
12402
12403         Also, we drop the temporary type-holder expression when not
12404         required.
12405
12406 2002-09-17  Martin Baulig  <martin@gnome.org>
12407
12408         * class.cs (PropertyBase.CheckBase): Don't check the base class if
12409         this is an explicit interface implementation.
12410
12411 2002-09-17  Martin Baulig  <martin@gnome.org>
12412
12413         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
12414         different `IndexerName' attributes.
12415
12416         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
12417         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
12418         virtual CommonResolve().
12419
12420 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
12421
12422         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
12423         and convert that to the UnderlyingType.
12424
12425         * statement.cs (Foreach.Resolve): Indexers are just like variables
12426         or PropertyAccesses.
12427
12428         * cs-tokenizer.cs (consume_string): Track line numbers and columns
12429         inside quoted strings, we were not doing this before.
12430
12431 2002-09-16  Martin Baulig  <martin@gnome.org>
12432
12433         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
12434         resolve it.  This is needed for the definite assignment check of the
12435         instance expression, fixes bug #29846.
12436         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
12437
12438 2002-09-16  Nick Drochak  <ndrochak@gol.com>
12439
12440         * parameter.cs: Fix compile error.  Cannot reference static member
12441         from an instance object.  Is this an mcs bug?
12442
12443 2002-09-14  Martin Baulig  <martin@gnome.org>
12444
12445         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
12446         multiple times.  Fixes bug #30295, added test-166.cs.
12447
12448 2002-09-14  Martin Baulig  <martin@gnome.org>
12449
12450         * statement.cs (Block.Emit): Don't emit unreachable code.
12451         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
12452         `break' statements.
12453         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
12454
12455 2002-09-14  Martin Baulig  <martin@gnome.org>
12456
12457         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
12458         is set.
12459
12460 2002-09-14  Martin Baulig  <martin@gnome.org>
12461
12462         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
12463         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
12464         be false on the ms runtime.
12465
12466 2002-09-13  Martin Baulig  <martin@gnome.org>
12467
12468         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
12469         the CS0038 error message.
12470
12471 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
12474         constant inside, return it.
12475
12476 2002-09-12  Martin Baulig  <martin@gnome.org>
12477
12478         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
12479         implicit conversion can be done between enum types.
12480
12481         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
12482         check whether an implicit conversion to the current enum's UnderlyingType
12483         exists and report an error if not.
12484
12485         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
12486         without debugging support.
12487
12488         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
12489         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
12490
12491 2002-09-12  Martin Baulig  <martin@gnome.org>
12492
12493         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
12494
12495         * ecore.cs (IMemberExpr.DeclaringType): New property.
12496         (SimpleName.SimpleNameResolve): Check whether we're accessing a
12497         nonstatic member of an outer type (CS0038).
12498
12499 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
12500
12501         * driver.cs: Activate the using-error detector at warning level
12502         4 (at least for MS-compatible APIs).
12503
12504         * namespace.cs (VerifyUsing): Small buglett fix.
12505
12506         * pending.cs (PendingImplementation): pass the container pointer. 
12507
12508         * interface.cs (GetMethods): Allow for recursive definition.  Long
12509         term, I would like to move every type to support recursive
12510         definitions, not the current ordering mechanism that we have right
12511         now.
12512
12513         The situation is this: Attributes are handled before interfaces,
12514         so we can apply attributes to interfaces.  But some attributes
12515         implement interfaces, we will now handle the simple cases
12516         (recursive definitions will just get an error).  
12517
12518         * parameter.cs: Only invalidate types at the end if we fail to
12519         lookup all types.  
12520
12521 2002-09-09  Martin Baulig  <martin@gnome.org>
12522
12523         * ecore.cs (PropertyExpr.Emit): Also check for
12524         TypeManager.system_int_array_get_length so this'll also work when
12525         compiling corlib.  Fixes #30003.
12526
12527 2002-09-09  Martin Baulig  <martin@gnome.org>
12528
12529         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
12530         and throw an exception if we can't get the type's size.  Fixed #30040,
12531         added test-165.cs.
12532
12533 2002-09-09  Martin Baulig  <martin@gnome.org>
12534
12535         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
12536
12537         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
12538         context.  Fixes bug #30027.
12539
12540         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
12541         virtual functions.  Fixes bug #30043, added test-164.cs.
12542
12543 2002-09-08  Ravi Pratap  <ravi@ximian.com>
12544
12545         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
12546
12547 2002-09-08  Nick Drochak  <ndrochak@gol.com>
12548
12549         * driver.cs: Use an object to get the windows codepage since it's not a
12550         static property.
12551
12552 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
12553
12554         * statement.cs (For.Emit): for infinite loops (test == null)
12555         return whether there is a break inside, not always "true".
12556
12557         * namespace.cs (UsingEntry): New struct to hold the name of the
12558         using definition, the location where it is defined, and whether it
12559         has been used in a successful type lookup.
12560
12561         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
12562         strings.
12563
12564         * decl.cs: ditto.
12565
12566 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12567
12568         * attribute.cs : Fix incorrect code which relied on catching
12569         a NullReferenceException to detect a null being passed in
12570         where an object was expected.
12571
12572 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
12573
12574         * statement.cs (Try): flag the catch variable as assigned
12575
12576         * expression.cs (Cast): Simplified by using ResolveType instead of
12577         manually resolving.
12578
12579         * statement.cs (Catch): Fix bug by using ResolveType.
12580
12581 2002-09-06  Ravi Pratap  <ravi@ximian.com>
12582
12583         * expression.cs (BetterConversion): Special case for when we have
12584         a NullLiteral as the argument and we have to choose between string
12585         and object types - we choose string the way csc does.
12586
12587         * attribute.cs (Attribute.Resolve): Catch the
12588         NullReferenceException and report error #182 since the Mono
12589         runtime no more has the bug and having this exception raised means
12590         we tried to select a constructor which takes an object and is
12591         passed a null.
12592
12593 2002-09-05  Ravi Pratap  <ravi@ximian.com>
12594
12595         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
12596         message (1502, 1503) when we can't locate a method after overload
12597         resolution. This is much more informative and closes the bug
12598         Miguel reported.
12599
12600         * interface.cs (PopulateMethod): Return if there are no argument
12601         types. Fixes a NullReferenceException bug.
12602
12603         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
12604         expressions too. Previously we were checking only in one place for
12605         positional arguments leaving out named arguments.
12606
12607         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
12608         type to the enum type is not allowed. Remove code corresponding to
12609         that.
12610
12611         (ConvertNumericExplicit): Allow explicit conversions from
12612         the underlying type to enum type. This precisely follows the spec
12613         and closes a bug filed by Gonzalo.
12614
12615 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12616
12617         * compiler.csproj:
12618         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
12619
12620 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
12623         it was important that we stored the right value after the
12624         reduction in `converted'.
12625
12626 2002-09-04  Martin Baulig  <martin@gnome.org>
12627
12628         * location.cs (Location.SymbolDocument): Use full pathnames for the
12629         source files.
12630
12631 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
12632
12633         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
12634         of the expression resolve mechanism, because that will catch the
12635         SimpleName error failures.
12636
12637         (Conditional): If we can not resolve the
12638         expression, return, do not crash.
12639
12640 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12641
12642         * cs-tokenizer.cs:
12643         (location): display token name instead of its number.
12644
12645 2002-08-28  Martin Baulig  <martin@gnome.org>
12646
12647         * expression.cs (Binary.ResolveOperator): Don't silently return
12648         but return an error if an operator cannot be applied between two
12649         enum types.
12650
12651 2002-08-28  Martin Baulig  <martin@gnome.org>
12652
12653         * class.cs (Constructor.Define): Set the permission attributes
12654         correctly instead of making all constructors public.
12655
12656 2002-08-28  Martin Baulig  <martin@gnome.org>
12657
12658         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
12659         for private members before reporting a CS0103; if we find anything,
12660         it's a CS0122.
12661
12662 2002-08-28  Martin Baulig  <martin@gnome.org>
12663
12664         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
12665         to check whether `closure_start_type == closure_invocation_type',
12666         we also need to check whether `m.DeclaringType == closure_invocation_type'
12667         before bypassing the permission checks.  We might be accessing
12668         protected/private members from the base class.
12669         (TypeManager.RealMemberLookup): Only set private_ok if private
12670         members were requested via BindingFlags.NonPublic.
12671
12672         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
12673
12674         * expression.cs (MemberAccess.ResolveMemberAccess): Set
12675         MethodGroupExpr.IsExplicitImpl if appropriate.
12676         (Invocation.DoResolve): Don't report the CS0120 for explicit
12677         interface implementations.
12678
12679 2002-08-27  Martin Baulig  <martin@gnome.org>
12680
12681         * expression.cs (Invocation.DoResolve): If this is a static
12682         method and we don't have an InstanceExpression, we must report
12683         a CS0120.
12684
12685 2002-08-25  Martin Baulig  <martin@gnome.org>
12686
12687         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
12688         `==' between a valuetype and an object.
12689
12690 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
12691
12692         * ecore.cs (TypeExpr): Provide a ToString method.
12693
12694 2002-08-24  Martin Baulig  <martin@gnome.org>
12695
12696         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
12697         now called proggie.dbg and it's a binary file.
12698
12699 2002-08-23  Martin Baulig  <martin@gnome.org>
12700
12701         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
12702
12703 2002-08-23  Martin Baulig  <martin@gnome.org>
12704
12705         * struct.cs (MyStructInfo.ctor): Make this work with empty
12706         structs; it's not allowed to use foreach() on null.
12707
12708 2002-08-23  Martin Baulig  <martin@gnome.org>
12709
12710         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
12711         writer the full pathname of the generated assembly.
12712
12713 2002-08-23  Martin Baulig  <martin@gnome.org>
12714
12715         * statements.cs (FlowBranching.UsageVector.MergeChildren):
12716         A `finally' block never returns or breaks; improved handling of
12717         unreachable code.
12718
12719 2002-08-23  Martin Baulig  <martin@gnome.org>
12720
12721         * statement.cs (Throw.Resolve): Allow `throw null'.
12722
12723 2002-08-23  Martin Baulig  <martin@gnome.org>
12724
12725         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
12726         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
12727         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
12728         MemberLookup would return a wrong event if this is an explicit
12729         interface implementation and the class has an event with the same
12730         name.
12731
12732 2002-08-23  Martin Baulig  <martin@gnome.org>
12733
12734         * statement.cs (Block.AddChildVariableNames): New public method.
12735         (Block.AddChildVariableName): Likewise.
12736         (Block.IsVariableNameUsedInChildBlock): Likewise.
12737         (Block.AddVariable): Check whether a variable name has already
12738         been used in a child block.
12739
12740         * cs-parser.jay (declare_local_variables): Mark all variable names
12741         from the current block as being used in a child block in the
12742         implicit block.
12743
12744 2002-08-23  Martin Baulig  <martin@gnome.org>
12745
12746         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
12747         find the symbol writer.
12748
12749         * driver.cs: csc also allows the arguments to /define being
12750         separated by commas, not only by semicolons.
12751
12752 2002-08-23  Martin Baulig  <martin@gnome.org>
12753
12754         * interface.cs (Interface.GetMembers): Added static check for events.
12755
12756 2002-08-15  Martin Baulig  <martin@gnome.org>
12757
12758         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
12759         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
12760
12761         * ecore.cs (Expression.MemberLookup): Added documentation and explained
12762         why the MethodData.EmitDestructor() change was necessary.
12763
12764 2002-08-20  Martin Baulig  <martin@gnome.org>
12765
12766         * class.cs (TypeContainer.FindMembers): Added static check for events.
12767
12768         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
12769
12770         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
12771         use Type.GetEvents(), not Type.FindMembers().
12772
12773 2002-08-20  Martin Baulig  <martin@gnome.org>
12774
12775         * decl.cs (MemberCache): Added a special method cache which will
12776         be used for method-only searched.  This ensures that a method
12777         search will return a MethodInfo with the correct ReflectedType for
12778         inherited methods.      
12779
12780 2002-08-20  Martin Baulig  <martin@gnome.org>
12781
12782         * decl.cs (DeclSpace.FindMembers): Made this public.
12783
12784 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12785
12786         * delegate.cs: fixed build on windows.
12787         [FIXME:  Filed as bug #29150: MCS must report these errors.]
12788
12789 2002-08-19  Ravi Pratap  <ravi@ximian.com>
12790
12791         * ecore.cs (StandardConversionExists): Return a false
12792         if we are trying to convert the void type to anything else
12793         since that is not allowed.
12794
12795         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
12796         we flag error 70 in the event an event is trying to be accessed
12797         directly from outside the declaring type.
12798
12799 2002-08-20  Martin Baulig  <martin@gnome.org>
12800
12801         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
12802         MemberCache from typemanager.cs to decl.cs.
12803
12804 2002-08-19  Martin Baulig  <martin@gnome.org>
12805
12806         * class.cs (TypeContainer): Implement IMemberContainer.
12807         (TypeContainer.DefineMembers): Create the MemberCache.
12808         (TypeContainer.FindMembers): Do better BindingFlags checking; only
12809         return public members if BindingFlags.Public was given, check
12810         whether members are static.
12811
12812 2002-08-16  Martin Baulig  <martin@gnome.org>
12813
12814         * decl.cs (DeclSpace.Define): Splitted this in Define and
12815         DefineMembers.  DefineMembers is called first and initializes the
12816         MemberCache.
12817
12818         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
12819         DefineMembers() on all our DeclSpaces.
12820
12821         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
12822         but call DefineMembers() on all nested interfaces.  We call their
12823         Define() in our new Define() function.
12824
12825         * interface.cs (Interface): Implement IMemberContainer.
12826         (Interface.Define): Moved all code except the attribute stuf to
12827         DefineMembers().
12828         (Interface.DefineMembers): Initialize the member cache.
12829
12830         * typemanager.cs (IMemberFinder): Removed this interface, we don't
12831         need this anymore since we can use MemberCache.FindMembers directly.
12832
12833 2002-08-19  Martin Baulig  <martin@gnome.org>
12834
12835         * typemanager.cs (MemberCache): When creating the cache for an
12836         interface type, add all inherited members.
12837         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
12838         to `out bool used_cache' and documented it.
12839         (TypeManager.MemberLookup): If we already used the cache in the first
12840         iteration, we don't need to do the interfaces check.
12841
12842 2002-08-19  Martin Baulig  <martin@gnome.org>
12843
12844         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
12845         here from IMemberFinder and don't implement this interface anymore.
12846         (DeclSpace.MemberCache): Moved here from IMemberFinder.
12847
12848         * typemanager.cs (IMemberFinder): This interface is now only used by
12849         classes which actually support the member cache.
12850         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
12851         since we only put DeclSpaces into this Hashtable.
12852         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
12853         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
12854
12855 2002-08-16  Martin Baulig  <martin@gnome.org>
12856
12857         * typemanager.cs (ICachingMemberFinder): Removed.
12858         (IMemberFinder.MemberCache): New property.
12859         (TypeManager.FindMembers): Merged this with RealFindMembers().
12860         This function will never be called from TypeManager.MemberLookup()
12861         so we can't use the cache here, just the IMemberFinder.
12862         (TypeManager.MemberLookup_FindMembers): Check whether the
12863         IMemberFinder has a MemberCache and call the cache's FindMembers
12864         function.
12865         (MemberCache): Rewrote larger parts of this yet another time and
12866         cleaned it up a bit.
12867
12868 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
12869
12870         * driver.cs (LoadArgs): Support quoting.
12871
12872         (Usage): Show the CSC-like command line arguments.
12873
12874         Improved a few error messages.
12875
12876 2002-08-15  Martin Baulig  <martin@gnome.org>
12877
12878         * typemanager.cs (IMemberContainer.Type): New property.
12879         (IMemberContainer.IsInterface): New property.
12880
12881         The following changes are conditional to BROKEN_RUNTIME, which is
12882         defined at the top of the file.
12883
12884         * typemanager.cs (MemberCache.MemberCache): Don't add the base
12885         class'es members, but add all members from TypeHandle.ObjectType
12886         if we're an interface.
12887         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
12888         is the current type.
12889         (MemberCache.CacheEntry.Container): Removed this field.
12890         (TypeHandle.GetMembers): Include inherited members.
12891
12892 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12893
12894         * typemanager.cs: fixed compilation and added a comment on a field that
12895         is never used.
12896
12897 2002-08-15  Martin Baulig  <martin@gnome.org>
12898
12899         * class.cs (ConstructorInitializer.Resolve): In the
12900         Expression.MemberLookup call, use the queried_type as
12901         invocation_type.
12902
12903         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
12904         declared' attribute, it's always true.
12905         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
12906         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
12907         temporary wrapper for FindMembers which tells MemberLookup whether
12908         members from the base classes are included in the return value.
12909         This will go away soon.
12910         (TypeManager.MemberLookup): Use this temporary hack here; once the
12911         new MemberCache is completed, we don't need to do the DeclaredOnly
12912         looping here anymore since the MemberCache will take care of this.
12913         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
12914         (MemberCache): When creating the MemberCache for a class, get
12915         members from the current class and all its base classes.
12916         (MemberCache.CacheEntry.Container): New field.  This is a
12917         temporary hack until the Mono runtime is fixed to distinguish
12918         between ReflectedType and DeclaringType.  It allows us to use MCS
12919         with both the MS runtime and the unfixed Mono runtime without
12920         problems and without accecting performance.
12921         (MemberCache.SearchMembers): The DeclaredOnly looping from
12922         TypeManager.MemberLookup is now done here.      
12923
12924 2002-08-14  Martin Baulig  <martin@gnome.org>
12925
12926         * statement.cs (MyStructInfo.MyStructInfo): Don't call
12927         Type.GetFields on dynamic types but get the fields from the
12928         corresponding TypeContainer.
12929         (MyStructInfo.GetStructInfo): Added check for enum types.
12930
12931         * typemanager.cs (MemberList.IsSynchronized): Implemented.
12932         (MemberList.SyncRoot): Implemented.
12933         (TypeManager.FilterWithClosure): No need to check permissions if
12934         closure_start_type == closure_invocation_type, don't crash if
12935         closure_invocation_type is null.
12936
12937 2002-08-13  Martin Baulig  <martin@gnome.org>
12938
12939         Rewrote TypeContainer.FindMembers to use a member cache.  This
12940         gives us a speed increase of about 35% for the self-hosting MCS
12941         build and of about 15-20% for the class libs (both on GNU/Linux).
12942
12943         * report.cs (Timer): New class to get enhanced profiling.  This
12944         whole class is "TIMER" conditional since it remarkably slows down
12945         compilation speed.
12946
12947         * class.cs (MemberList): New class.  This is an IList wrapper
12948         which we're now using instead of passing MemberInfo[]'s around to
12949         avoid copying this array unnecessarily.
12950         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
12951         (ICachingMemberFinder, IMemberContainer): New interface.
12952         (TypeManager.FilterWithClosure): If `criteria' is null, the name
12953         has already been checked, otherwise use it for the name comparision.
12954         (TypeManager.FindMembers): Renamed to RealMemberFinder and
12955         provided wrapper which tries to use ICachingMemberFinder.FindMembers
12956         if possible.  Returns a MemberList, not a MemberInfo [].
12957         (TypeHandle): New class, implements IMemberContainer.  We create
12958         one instance of this class per type, it contains a MemberCache
12959         which is used to do the member lookups.
12960         (MemberCache): New class.  Each instance of this class contains
12961         all members of a type and a name-based hash table.
12962         (MemberCache.FindMembers): This is our new member lookup
12963         function.  First, it looks up all members of the requested name in
12964         the hash table.  Then, it walks this list and sorts out all
12965         applicable members and returns them.
12966
12967 2002-08-13  Martin Baulig  <martin@gnome.org>
12968
12969         In addition to a nice code cleanup, this gives us a performance
12970         increase of about 1.4% on GNU/Linux - not much, but it's already
12971         half a second for the self-hosting MCS compilation.
12972
12973         * typemanager.cs (IMemberFinder): New interface.  It is used by
12974         TypeManager.FindMembers to call FindMembers on a TypeContainer,
12975         Enum, Delegate or Interface.
12976         (TypeManager.finder_to_member_finder): New PtrHashtable.
12977         (TypeManager.finder_to_container): Removed.
12978         (TypeManager.finder_to_delegate): Removed.
12979         (TypeManager.finder_to_interface): Removed.
12980         (TypeManager.finder_to_enum): Removed.
12981
12982         * interface.cs (Interface): Implement IMemberFinder.
12983
12984         * delegate.cs (Delegate): Implement IMemberFinder.
12985
12986         * enum.cs (Enum): Implement IMemberFinder.
12987
12988         * class.cs (TypeContainer): Implement IMemberFinder.
12989
12990 2002-08-12  Martin Baulig  <martin@gnome.org>
12991
12992         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
12993
12994 2002-08-12  Martin Baulig  <martin@gnome.org>
12995
12996         * ecore.cs (ITypeExpression): New interface for expressions which
12997         resolve to a type.
12998         (TypeExpression): Renamed to TypeLookupExpression.
12999         (Expression.DoResolve): If we're doing a types-only lookup, the
13000         expression must implement the ITypeExpression interface and we
13001         call DoResolveType() on it.
13002         (SimpleName): Implement the new ITypeExpression interface.
13003         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
13004         hack, the situation that we're only looking up types can't happen
13005         anymore when this method is called.  Moved the type lookup code to
13006         DoResolveType() and call it.
13007         (SimpleName.DoResolveType): This ITypeExpression interface method
13008         is now doing the types-only lookup.
13009         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
13010         (ResolveFlags): Added MaskExprClass.
13011
13012         * expression.cs (MemberAccess): Implement the ITypeExpression
13013         interface.
13014         (MemberAccess.DoResolve): Added support for a types-only lookup
13015         when we're called via ITypeExpression.DoResolveType().
13016         (ComposedCast): Implement the ITypeExpression interface.
13017
13018         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
13019         Expression.Resolve() with ResolveFlags.Type instead.
13020
13021 2002-08-12  Martin Baulig  <martin@gnome.org>
13022
13023         * interface.cs (Interface.Define): Apply attributes.
13024
13025         * attribute.cs (Attribute.ApplyAttributes): Added support for
13026         interface attributes.
13027
13028 2002-08-11  Martin Baulig  <martin@gnome.org>
13029
13030         * statement.cs (Block.Emit): Only check the "this" variable if we
13031         do not always throw an exception.
13032
13033         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
13034         whether the property has a set accessor.
13035
13036 2002-08-11  Martin Baulig  <martin@gnome.org>
13037
13038         Added control flow analysis support for structs.
13039
13040         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
13041         with control flow analysis turned off.
13042         (IVariable): New interface.
13043         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
13044         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
13045         (FieldExpr.DoResolve): Resolve the instance expression with flow
13046         analysis turned off and do the definite assignment check after the
13047         resolving when we know what the expression will resolve to.
13048
13049         * expression.cs (LocalVariableReference, ParameterReference):
13050         Implement the new IVariable interface, only call the flow analysis
13051         code if ec.DoFlowAnalysis is true.
13052         (This): Added constructor which takes a Block argument.  Implement
13053         the new IVariable interface.
13054         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
13055         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
13056         This does the definite assignment checks for struct members.
13057
13058         * class.cs (Constructor.Emit): If this is a non-static `struct'
13059         constructor which doesn't have any initializer, call
13060         Block.AddThisVariable() to tell the flow analysis code that all
13061         struct elements must be initialized before control returns from
13062         the constructor.
13063
13064         * statement.cs (MyStructInfo): New public class.
13065         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
13066         argument to this indexer.  If non-zero, check an individual struct
13067         member, not the whole struct.
13068         (FlowBranching.CheckOutParameters): Check struct members.
13069         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
13070         overloaded versions of these methods which take an additional
13071         `int field_idx' argument to check struct members.
13072         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
13073         overloaded versions of these methods which take an additional
13074         `string field_name' argument to check struct member.s
13075         (VariableInfo): Implement the IVariable interface.
13076         (VariableInfo.StructInfo): New public property.  Returns the
13077         MyStructInfo instance of the variable if it's a struct or null.
13078         (Block.AddThisVariable): New public method.  This is called from
13079         Constructor.Emit() for non-static `struct' constructor which do
13080         not have any initializer.  It creates a special variable for the
13081         "this" instance variable which will be checked by the flow
13082         analysis code to ensure that all of the struct's fields are
13083         initialized before control returns from the constructor.
13084         (UsageVector): Added support for struct members.  If a
13085         variable/parameter is a struct with N members, we reserve a slot
13086         in the usage vector for each member.  A struct is considered fully
13087         initialized if either the struct itself (slot 0) or all its
13088         members are initialized.
13089
13090 2002-08-08  Martin Baulig  <martin@gnome.org>
13091
13092         * driver.cs (Driver.MainDriver): Only report an error CS5001
13093         if there were no compilation errors.
13094
13095         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
13096         `UnsafeContext' property to determine whether the parent is in
13097         unsafe context rather than checking the parent's ModFlags:
13098         classes nested in an unsafe class are unsafe as well.
13099
13100 2002-08-08  Martin Baulig  <martin@gnome.org>
13101
13102         * statement.cs (UsageVector.MergeChildren): Distinguish between
13103         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
13104         we return.  Added test17() and test18() to test-154.cs.
13105
13106 2002-08-08  Martin Baulig  <martin@gnome.org>
13107
13108         * typemanager.cs (TypeManager.FilterWithClosure): If we have
13109         Family access, make sure the invoking type isn't a subclass of the
13110         queried type (that'd be a CS1540).
13111
13112         * ecore.cs (Expression.MemberLookup): Added overloaded version of
13113         this method which takes an additional `Type invocation_type'.
13114
13115         * expression.cs (BaseAccess.DoResolve): Use the base type as
13116         invocation and query type.
13117         (MemberAccess.DoResolve): If the lookup failed and we're about to
13118         report a CS0122, try a lookup with the ec.ContainerType - if this
13119         succeeds, we must report a CS1540.
13120
13121 2002-08-08  Martin Baulig  <martin@gnome.org>
13122
13123         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
13124         (MethodGroupExpr): Implement the IMemberExpr interface.
13125
13126         * expression (MemberAccess.ResolveMemberAccess): No need to have
13127         any special code for MethodGroupExprs anymore, they're now
13128         IMemberExprs.   
13129
13130 2002-08-08  Martin Baulig  <martin@gnome.org>
13131
13132         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
13133         Family, FamANDAssem and FamORAssem permissions.
13134         (TypeManager.IsSubclassOrNestedChildOf): New public method.
13135
13136 2002-08-08  Martin Baulig  <martin@gnome.org>
13137
13138         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
13139         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
13140         or loop block.
13141
13142 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
13143
13144         * driver.cs: implemented /resource option to embed managed resources.
13145
13146 2002-08-07  Martin Baulig  <martin@gnome.org>
13147
13148         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
13149         (FieldBase.HasFieldInitializer): New public property.
13150         (FieldBase.GetInitializerExpression): New public method.  Resolves and
13151         returns the field initializer and makes sure it is only resolved once.
13152         (TypeContainer.EmitFieldInitializers): Call
13153         FieldBase.GetInitializerExpression to get the initializer, this ensures
13154         that it isn't resolved multiple times.
13155
13156         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
13157         the resolving process (SimpleName/MemberLookup) that we're currently
13158         emitting a field initializer (which must not access any instance members,
13159         this is an error CS0236).
13160
13161         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
13162         argument, if the `IsFieldInitializer' flag is set, we must report and
13163         error CS0236 and not an error CS0120.   
13164
13165 2002-08-07  Martin Baulig  <martin@gnome.org>
13166
13167         * ecore.cs (IMemberExpr): New public interface.
13168         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
13169         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
13170         if the expression is an IMemberExpr.
13171
13172         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
13173         to be null, implicitly default to `this' if we're non-static in
13174         this case.  Simplified the code a lot by using the new IMemberExpr
13175         interface.  Also fixed bug #28176 here.
13176
13177 2002-08-06  Martin Baulig  <martin@gnome.org>
13178
13179         * cs-parser.jay (SimpleLookup): Removed.  We need to create
13180         ParameterReferences during semantic analysis so that we can do a
13181         type-only search when resolving Cast, TypeOf and SizeOf.
13182         (block): Pass the `current_local_parameters' to the Block's
13183         constructor.
13184
13185         * class.cs (ConstructorInitializer): Added `Parameters parameters'
13186         argument to the constructor.
13187         (ConstructorInitializer.Resolve): Create a temporary implicit
13188         block with the parameters.
13189
13190         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
13191         references here if we aren't doing a type-only search.
13192
13193         * statement.cs (Block): Added constructor which takes a
13194         `Parameters parameters' argument.
13195         (Block.Parameters): New public property.
13196
13197         * support.cs (InternalParameters.Parameters): Renamed `parameters'
13198         to `Parameters' and made it public readonly.
13199
13200 2002-08-06  Martin Baulig  <martin@gnome.org>
13201
13202         * ecore.cs (Expression.Warning): Made this public as well.
13203
13204         * report.cs (Report.Debug): Print the contents of collections.
13205
13206 2002-08-06  Martin Baulig  <martin@gnome.org>
13207
13208         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
13209         used to tell Resolve() which kinds of expressions it may return.
13210         (Expression.Resolve): Added overloaded version of this method which
13211         takes a `ResolveFlags flags' argument.  This can be used to tell
13212         Resolve() which kinds of expressions it may return.  Reports a
13213         CS0118 on error.
13214         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
13215         ResolveFlags.SimpleName.
13216         (Expression.Error118): Added overloaded version of this method which
13217         takes a `ResolveFlags flags' argument.  It uses the flags to determine
13218         which kinds of expressions are allowed.
13219
13220         * expression.cs (Argument.ResolveMethodGroup): New public method.
13221         Resolves an argument, but allows a MethodGroup to be returned.
13222         This is used when invoking a delegate.
13223
13224         * TODO: Updated a bit.
13225
13226 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13227
13228         Fixed compilation with csc.
13229
13230         * ecore.cs: Expression.Error made public. Is this correct? Should
13231         Warning be made public too?
13232
13233         * expression.cs: use ea.Location instead of ea.loc.
13234         [FIXME:  Filed as bug #28607: MCS must report these errors.]
13235
13236 2002-08-06  Martin Baulig  <martin@gnome.org>
13237
13238         * ecore.cs (Expression.loc): Moved the location here instead of
13239         duplicating it in all derived classes.
13240         (Expression.Location): New public property.
13241         (Expression.Error, Expression.Warning): Made them non-static and
13242         removed the location argument.
13243         (Expression.Warning): Added overloaded version which takes an
13244         `int level' argument.
13245         (Expression.Error118): Make this non-static and removed the
13246         expression and location arguments.
13247         (TypeExpr): Added location argument to the constructor.
13248
13249         * expression.cs (StaticCallExpr): Added location argument to
13250         the constructor.
13251         (Indirection, PointerArithmetic): Likewise.
13252         (CheckedExpr, UnCheckedExpr): Likewise.
13253         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
13254         (StringPtr): Likewise.
13255
13256
13257 2002-08-05  Martin Baulig  <martin@gnome.org>
13258
13259         * expression.cs (BaseAccess.DoResolve): Actually report errors.
13260
13261         * assign.cs (Assign.DoResolve): Check whether the source
13262         expression is a value or variable.
13263
13264         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
13265         while resolving the corresponding blocks.
13266
13267         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
13268         an error, don't silently return null.
13269
13270         * statement.cs (Block.AddVariable): Do the error reporting here
13271         and distinguish between CS0128 and CS0136.
13272         (Block.DoResolve): Report all unused labels (warning CS0164).
13273         (LabeledStatement): Pass the location to the constructor.
13274         (LabeledStatement.HasBeenReferenced): New property.
13275         (LabeledStatement.Resolve): Set it to true here.
13276
13277         * statement.cs (Return.Emit): Return success even after reporting
13278         a type mismatch error (CS0126 or CS0127), this is what csc does and
13279         it avoids confusing the users with any consecutive errors.
13280
13281 2002-08-05  Martin Baulig  <martin@gnome.org>
13282
13283         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
13284
13285         * const.cs (Const.LookupConstantValue): Catch circular definitions.
13286
13287         * expression.cs (MemberAccess.DoResolve): Silently return if an
13288         error has already been reported.
13289
13290         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
13291         error has already been reported.
13292
13293 2002-08-05  Martin Baulig  <martin@gnome.org>
13294
13295         * statement.cs (UsageVector): Only initialize the `parameters'
13296         vector if we actually have any "out" parameters.
13297
13298 2002-08-05  Martin Baulig  <martin@gnome.org>
13299
13300         * expression.cs (Binary.ResolveOperator): When combining delegates,
13301         they must have the same type.
13302
13303 2002-08-05  Martin Baulig  <martin@gnome.org>
13304
13305         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
13306         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
13307         work with the ms runtime and we also don't need it: if we're a
13308         PropertyBuilder and not in the `indexer_arguments' hash, then we
13309         are a property and not an indexer.
13310
13311         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
13312         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
13313         since the latter one doesn't work with the ms runtime.
13314
13315 2002-08-03  Martin Baulig  <martin@gnome.org>
13316
13317         Fixed bugs #27998 and #22735.
13318
13319         * class.cs (Method.IsOperator): New public field.
13320         (Method.CheckBase): Report CS0111 if there's already a method
13321         with the same parameters in the current class.  Report CS0508 when
13322         attempting to change the return type of an inherited method.
13323         (MethodData.Emit): Report CS0179 if a method doesn't have a body
13324         and it's not marked abstract or extern.
13325         (PropertyBase): New abstract base class for Property and Indexer.
13326         (PropertyBase.CheckBase): Moved here from Property and made it work
13327         for indexers.
13328         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
13329         the same so we can reuse it there.
13330         (Property, Indexer): Derive from PropertyBase.
13331         (MethodSignature.inheritable_property_signature_filter): New delegate
13332         to find properties and indexers.
13333
13334         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
13335         argument and improved error reporting.
13336
13337         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
13338         EmptyReadOnlyParameters and made it a property.
13339
13340         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
13341         version of this method which takes a `PropertyInfo indexer'.
13342         (TypeManager.RegisterIndexer): New method.
13343
13344         * class.cs: Added myself as author of this file :-)
13345
13346 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13347
13348         * class.cs: fixed compilation on windoze.
13349
13350 2002-08-03  Martin Baulig  <martin@gnome.org>
13351
13352         * interface.cs (Interface.GetInterfaceBases): Check whether all
13353         base interfaces are at least as accessible than the current one.
13354
13355         * class.cs (TypeContainer.GetClassBases): Check whether base types
13356         are at least as accessible than the current type.
13357         (TypeContainer.AsAccessible): Implemented and made non-static.
13358         (MemberBase.CheckParameters): Report errors if the accessibility
13359         checks fail.
13360
13361         * delegate.cs (Delegate.Delegate): The default visibility is
13362         internal for top-level types and private for nested types.
13363         (Delegate.Define): Report errors if the accessibility checks fail.
13364
13365         * enum.cs (Enum.Enum): The default visibility is internal for
13366         top-level types and private for nested types.
13367         (Enum.DefineType): Compute the correct visibility.
13368
13369         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
13370         function which takes a `bool is_toplevel' instead of a TypeContainer.
13371
13372         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
13373         builtin type.
13374
13375 2002-08-02  Martin Baulig  <martin@gnome.org>
13376
13377         * expression.cs (LocalVariableReferenc): Added constructor which
13378         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
13379         (LocalVariableReference.IsReadOnly): New property.
13380         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
13381         variable is readonly, use our own readonly flag to do this; you can
13382         use the new constructor to get a writable reference to a read-only
13383         variable.
13384
13385         * cs-parser.jay (foreach_statement, using_statement): Get a writable
13386         reference to the local variable.
13387
13388 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
13389
13390         * rootcontext.cs (ResolveCore): Also include System.Exception
13391
13392         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
13393         we reach an EmptyStatement.
13394
13395         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
13396         is also fine.
13397
13398         * expression.cs (Binary.ResolveOperator): Check error result in
13399         two places.
13400
13401         use brtrue/brfalse directly and avoid compares to null.
13402
13403 2002-08-02  Martin Baulig  <martin@gnome.org>
13404
13405         * class.cs (TypeContainer.Define): Define all nested interfaces here.
13406         Fixes bug #28407, added test-155.cs.
13407
13408 2002-08-01  Martin Baulig  <martin@gnome.org>
13409
13410         * class.cs (Event.EmitDefaultMethod): Make this work with static
13411         events.  Fixes #28311, added verify-3.cs.
13412
13413 2002-08-01  Martin Baulig  <martin@gnome.org>
13414
13415         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
13416         `is_disposable' fields.
13417         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
13418         `hm.is_disposable' if we're using the collection pattern.
13419         (Foreach.EmitCollectionForeach): Use the correct type for the
13420         enumerator's local variable, only emit the try/finally block if
13421         necessary (fixes #27713).
13422
13423 2002-08-01  Martin Baulig  <martin@gnome.org>
13424
13425         * ecore.cs (Expression.report118): Renamed to Error118 and made
13426         it public static.
13427
13428         * statement.cs (Throw.Resolve): Check whether the expression is of
13429         the correct type (CS0118) and whether the type derives from
13430         System.Exception (CS0155).
13431         (Catch.Resolve): New method.  Do the type lookup here and check
13432         whether it derives from System.Exception (CS0155).
13433         (Catch.CatchType, Catch.IsGeneral): New public properties.
13434
13435         * typemanager.cs (TypeManager.exception_type): Added.
13436
13437 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
13438
13439         * driver.cs: Updated About function.
13440
13441 2002-07-31  Martin Baulig  <martin@gnome.org>
13442
13443         Implemented Control Flow Analysis.
13444
13445         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
13446         (EmitContext.CurrentBranching): Added.
13447         (EmitContext.StartFlowBranching): Added.
13448         (EmitContext.EndFlowBranching): Added.
13449         (EmitContext.KillFlowBranching): Added.
13450         (EmitContext.IsVariableAssigned): Added.
13451         (EmitContext.SetVariableAssigned): Added.
13452         (EmitContext.IsParameterAssigned): Added.
13453         (EmitContext.SetParameterAssigned): Added.
13454         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
13455         Added control flow analysis stuff here.
13456
13457         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
13458         resolve the expression as lvalue.
13459         (LocalVariableReference.DoResolve): Check whether the variable has
13460         already been assigned.
13461         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
13462         the parameter as assigned here.
13463         (ParameterReference.DoResolve): Check whether the parameter has already
13464         been assigned.
13465         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
13466         expression as lvalue.
13467
13468         * statement.cs (FlowBranching): New class for the flow analysis code.
13469         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
13470         (LabeledStatement.IsDefined): New public property.
13471         (LabeledStatement.AddUsageVector): New public method to tell flow
13472         analyis that the label may be reached via a forward jump.
13473         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
13474         flow analysis.
13475         (VariableInfo.Number): New public field.  This is used by flow analysis
13476         to number all locals of a block.
13477         (Block.CountVariables): New public property.  This is the number of
13478         local variables in this block (including the locals from all parent
13479         blocks).
13480         (Block.EmitMeta): Number all the variables.
13481
13482         * statement.cs: Added flow analysis support to all classes.
13483
13484 2002-07-31  Martin Baulig  <martin@gnome.org>
13485
13486         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
13487         To get debugging messages, compile mcs with /define:MCS_DEBUG and
13488         then use this argument.
13489
13490         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
13491
13492         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
13493         use this to specify /define options.
13494
13495 2002-07-29  Martin Baulig  <martin@gnome.org>
13496
13497         * statement.cs (Fixed): Moved all code that does variable lookups
13498         and resolvings from Emit to Resolve.
13499
13500         * statement.cs (For): Moved all code that does variable lookups
13501         and resolvings from Emit to Resolve.
13502
13503         * statement.cs (Using): Moved all code that does variable lookups
13504         and resolvings from Emit to Resolve.
13505
13506 2002-07-29  Martin Baulig  <martin@gnome.org>
13507
13508         * attribute.cs (Attribute.Resolve): Explicitly catch a
13509         System.NullReferenceException when creating the
13510         CustromAttributeBuilder and report a different warning message.
13511
13512 2002-07-29  Martin Baulig  <martin@gnome.org>
13513
13514         * support.cs (ParameterData.ParameterName): Added method to
13515         get the name of a parameter.
13516
13517         * typemanager.cs (TypeManager.IsValueType): New public method.
13518
13519 2002-07-29  Martin Baulig  <martin@gnome.org>
13520
13521         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
13522         is a flag which specifies that it's either ref or out.
13523         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
13524         the out parameter to `out Parameter.Modifier mod', also set the
13525         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
13526
13527         * support.cs (InternalParameters.ParameterModifier): Distinguish
13528         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13529         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13530
13531         * expression.cs (Argument.GetParameterModifier): Distinguish
13532         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
13533         Parameter.Modifier.ISBYREF flag if it's either ref or out.
13534
13535 2002-07-29  Martin Baulig  <martin@gnome.org>
13536
13537         * expression.cs (ParameterReference.ParameterReference): Added
13538         `Location loc' argument to the constructor.
13539
13540         * cs-parser.jay: Pass location to ParameterReference.
13541
13542 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
13543
13544         * statement.cs (Try): Initialize the location.
13545
13546         * cs-parser.jay: pass location to Try.
13547
13548         * expression.cs (Unary.Reduce): Change the prototype to return
13549         whether a constant fold could be performed or not.  The result is
13550         returned in an out parameters.  In the case of Indirection and
13551         AddressOf, we want to perform the full tests.
13552
13553 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
13554
13555         * statement.cs (Statement.Emit): Flag dead code.
13556
13557 2002-07-27  Andrew Birkett  <andy@nobugs.org>
13558
13559         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
13560
13561 2002-07-27  Martin Baulig  <martin@gnome.org>
13562
13563         * class.cs (MethodData.Define): Put back call to
13564         TypeManager.AddMethod(), accidentally commented this out.
13565
13566         * report.cs (Debug): New public method to print debugging information,
13567         this is `[Conditional ("DEBUG")]'.
13568
13569 2002-07-26  Martin Baulig  <martin@gnome.org>
13570
13571         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
13572         (switch_statement): Push the current_block to the switch_stack and
13573         pop it again when we're done with the switch.
13574         (switch_section): The new block is a child of the current_block.
13575         Fixes bug #24007, added test-152.cs.
13576
13577 2002-07-27  Martin Baulig  <martin@gnome.org>
13578
13579         * expression.cs (Invocation.EmitArguments): When calling a varargs
13580         function with only its fixed arguments, we need to pass an empty
13581         array.
13582
13583 2002-07-27  Martin Baulig  <martin@gnome.org>
13584
13585         Mono 0.13 has been released.
13586
13587 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
13588
13589         * driver.cs: Rename --resource to --linkres, because that is what
13590         we do currently, we dont support --resource yet.
13591
13592         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
13593
13594 2002-07-25  Martin Baulig  <martin@gnome.org>
13595
13596         * class.cs (MethodData): New public class.  This is a `method builder'
13597         class for a method or one accessor of a Property/Indexer/Event.
13598         (MethodData.GetMethodFlags): Moved here from MemberBase.
13599         (MethodData.ApplyAttributes): Likewise.
13600         (MethodData.ApplyObsoleteAttribute): Likewise.
13601         (MethodData.ApplyConditionalAttribute): Likewise.
13602         (MethodData.ApplyDllImportAttribute): Likewise.
13603         (MethodData.CheckAbstractAndExternal): Likewise.
13604         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
13605         (MethodData.Emit): Formerly known as Method.Emit().
13606         (MemberBase): Moved everything which was specific to a single
13607         accessor/method to MethodData.
13608         (Method): Create a new MethodData and call Define() and Emit() on it.
13609         (Property, Indexer, Event): Create a new MethodData objects for each
13610         accessor and call Define() and Emit() on them.
13611
13612 2002-07-25  Martin Baulig  <martin@gnome.org>
13613
13614         Made MethodCore derive from MemberBase to reuse the code from there.
13615         MemberBase now also checks for attributes.
13616
13617         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
13618         (MemberBase.GetMethodFlags): Moved here from class Method and marked
13619         as virtual.
13620         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
13621         `CallingConventions cc' and `Attributes opt_attrs' arguments.
13622         (MemberBase.ApplyAttributes): New virtual method; applies the
13623         attributes to a method or accessor.
13624         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
13625         (MemberBase.ApplyConditionalAttribute): Likewise.
13626         (MemberBase.ApplyDllImportAttribute): Likewise.
13627         (MemberBase.CheckAbstractAndExternal): Likewise.
13628         (MethodCore.ParameterTypes): This is now a property instead of a
13629         method, it's initialized from DoDefineParameters().
13630         (MethodCore.ParameterInfo): Removed the set accessor.
13631         (MethodCore.DoDefineParameters): New protected virtual method to
13632         initialize ParameterTypes and ParameterInfo.
13633         (Method.GetReturnType): We can now simply return the MemberType.
13634         (Method.GetMethodFlags): Override the MemberBase version and add
13635         the conditional flags.
13636         (Method.CheckBase): Moved some code from Define() here, call
13637         DoDefineParameters() here.
13638         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
13639         here to avoid some larger code duplication.
13640         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
13641         ensure that abstract and external accessors don't declare a body.
13642
13643         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
13644         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
13645         lookup in the attribute's parent classes, so we need to abort as soon
13646         as we found the first match.
13647         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
13648         the attribute has no arguments.
13649
13650         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
13651         of a Method.
13652
13653 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13654
13655         * cs-parser.jay: reverted previous patch.
13656
13657 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13658
13659         * cs-parser.jay: fixed bug #22119.
13660
13661 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13662
13663         * attribute.cs: fixed compilation. The error was:
13664         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
13665         be assigned to before control leaves the current method."
13666         [FIXME:  Filed as bug #28186: MCS must report this error.]
13667
13668 2002-07-25  Martin Baulig  <martin@gnome.org>
13669
13670         * attribute.cs (Attribute.Conditional_GetConditionName): New static
13671         method to pull the condition name ouf of a Conditional attribute.
13672         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
13673         the obsolete message and error flag out of an Obsolete attribute.
13674
13675         * class.cs (Method.GetMethodFlags): New public method to get the
13676         TypeManager.MethodFlags for this method.
13677         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
13678         private methods.
13679         (Method.Define): Get and apply the Obsolete and Conditional attributes;
13680         if we're overriding a virtual function, set the new private variable
13681         `parent_method'; call the new TypeManager.AddMethod().
13682
13683         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
13684         the MethodBuilder and the Method in a PtrHashtable.
13685         (TypeManager.builder_to_method): Added for this purpose.
13686         (TypeManager.MethodFlags): Added IsObsoleteError.
13687         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
13688         Obsolete and Conditional arguments in MethodBuilders.  If we discover
13689         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
13690         the message from the attribute.
13691
13692 2002-07-24  Martin Baulig  <martin@gnome.org>
13693
13694         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
13695         preprocessor directives, ensure that the argument to #define/#undef is
13696         exactly one identifier and that it's actually an identifier.
13697
13698         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
13699         did not work ....
13700
13701 2002-07-24  Martin Baulig  <martin@gnome.org>
13702
13703         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
13704         initialize it to TypeManager.object_type in the constructor.
13705         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
13706         of the `hm.get_current' method if we're using the collection pattern.
13707         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
13708         for the explicit conversion to make it work when we're using the collection
13709         pattern and the `Current' property has a different return type than `object'.
13710         Fixes #27713.
13711
13712 2002-07-24  Martin Baulig  <martin@gnome.org>
13713
13714         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
13715         does not match, but don't report any errors.  This method is called in
13716         order for all methods in a MethodGroupExpr until a matching method is
13717         found, so we don't want to bail out if the first method doesn't match.
13718         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
13719         matches, report the 123.  Fixes #28070.
13720
13721 2002-07-24  Martin Baulig  <martin@gnome.org>
13722
13723         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
13724         TypeManager.TypeToCoreType() to the top of the method so the
13725         following equality checks will work.  Fixes #28107.
13726
13727 2002-07-24  Martin Baulig  <martin@gnome.org>
13728
13729         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
13730         operand is of type uint, and the other operand is of type sbyte,
13731         short or int, the operands are converted to type long." -
13732         Actually do what this comment already told us.  Fixes bug #28106,
13733         added test-150.cs.
13734
13735 2002-07-24  Martin Baulig  <martin@gnome.org>
13736
13737         * class.cs (MethodBase): New abstract class.  This is now a base
13738         class for Property, Indexer and Event to avoid some code duplication
13739         in their Define() and DefineMethods() methods.
13740         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
13741         generic methods for Define() and DefineMethods().
13742         (FieldBase): Derive from MemberBase, not MemberCore.
13743         (Property): Derive from MemberBase, not MemberCore.
13744         (Property.DefineMethod): Moved all the code from this method to the
13745         new MethodBase.DefineAccessor(), just call it with appropriate
13746         argumetnts.
13747         (Property.Define): Call the new Property.DoDefine(), this does some
13748         sanity checks and we don't need to duplicate the code everywhere.
13749         (Event): Derive from MemberBase, not MemberCore.
13750         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
13751         accessors, this will also make them work with interface events.
13752         (Indexer): Derive from MemberBase, not MemberCore.
13753         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
13754         (Indexer.Define): Use the new MethodBase functions.
13755
13756         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
13757         argument to the constructor.
13758         (Interface.FindMembers): Added support for interface events.
13759         (Interface.PopluateEvent): Implemented.
13760
13761         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
13762
13763 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
13764
13765         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
13766         but this is required to check for a method name being the same as
13767         the containing class.  
13768
13769         Handle this now.
13770
13771 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13772
13773         * interface.cs: initialize variable.
13774
13775 2002-07-23  Martin Baulig  <martin@gnome.org>
13776
13777         Implemented the IndexerName attribute in interfaces.
13778
13779         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
13780         name if this is an explicit interface implementation.
13781         (Indexer.InterfaceIndexerName): New public variable.  If we're
13782         implementing an interface indexer, this is the IndexerName in that
13783         interface.  Otherwise, it's the IndexerName.
13784         (Indexer.DefineMethod): If we're implementing interface indexer,
13785         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
13786         and Pending.ImplementIndexer methods.
13787         (Indexer.Define): Also define the PropertyBuilder if we're
13788         implementing an interface indexer and this is neither an explicit
13789         interface implementation nor do the IndexerName match the one in
13790         the interface.
13791
13792         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
13793         If a method is defined here, then we always need to create a proxy
13794         for it.  This is used when implementing interface indexers.
13795         (Pending.IsInterfaceIndexer): New public method.
13796         (Pending.ImplementIndexer): New public method.
13797         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
13798         This is used when implementing interface indexers to define a proxy
13799         if necessary.
13800         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
13801         define a proxy if necessary.
13802
13803         * interface.cs (Interface.IndexerName): New public variable.
13804         (Interface.PopulateIndexer): Set the IndexerName.
13805         (Interface.DefineIndexers): New private method.  Populate all the
13806         indexers and make sure their IndexerNames match.
13807
13808         * typemanager.cs (IndexerPropertyName): Added support for interface
13809         indexers.
13810
13811 2002-07-22  Martin Baulig  <martin@gnome.org>
13812
13813         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
13814         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
13815         ret if HasReturnLabel.
13816         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
13817         variables.
13818
13819         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
13820         and set the ec.LoopBeginTryCatchLevel.
13821         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
13822         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
13823         the current ec.TryCatchLevel, the branch goes out of an exception
13824         block.  In this case, we need to use Leave and not Br.
13825
13826 2002-07-22  Martin Baulig  <martin@gnome.org>
13827
13828         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
13829         block unless the block does not always return or it is contained in
13830         another try { ... } catch { ... } block.  Fixes bug #26506.
13831         Added verify-1.cs to the test suite.
13832
13833 2002-07-22  Martin Baulig  <martin@gnome.org>
13834
13835         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
13836         then we do not always return.  Fixes bug #24985.
13837
13838 2002-07-22  Martin Baulig  <martin@gnome.org>
13839
13840         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
13841         lookup on a per-class level; ie. walk up the class hierarchy until we
13842         found at least one applicable method, then choose the best among them.
13843         Fixes bug #24463 and test-29.cs.
13844
13845 2002-07-22  Martin Baulig  <martin@gnome.org>
13846
13847         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
13848         return types of the methods.  The return type is not part of the
13849         signature and we must not check it to make the `new' modifier work.
13850         Fixes bug #27999, also added test-147.cs.
13851         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
13852
13853         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
13854         on the method's return type.
13855
13856 2002-07-21  Martin Baulig  <martin@gnome.org>
13857
13858         * assign.cs: Make this work if the rightmost source is a constant and
13859         we need to do an implicit type conversion.  Also adding a few more tests
13860         to test-38.cs which should have caught this.
13861
13862         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
13863         target in the makefile for this.  The makefile.gnu is primarily intended
13864         for end-users who don't want to debug the compiler.
13865
13866 2002-07-21  Martin Baulig  <martin@gnome.org>
13867
13868         * assign.cs: Improved the Assign class so it can now handle embedded
13869         assignments (X = Y = Z = something).  As a side-effect this'll now also
13870         consume less local variables.  test-38.cs now passes with MCS, added
13871         a few new test cases to that test.
13872
13873 2002-07-20  Martin Baulig  <martin@gnome.org>
13874
13875         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
13876         instructions.  Fixes bug #27977, also added test-146.cs.
13877
13878 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13879
13880         * cs-tokenizer.cs: fixed getHex ().
13881
13882 2002-07-19  Martin Baulig  <martin@gnome.org>
13883
13884         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
13885         not Type.GetType() to lookup the array type.  This is needed when
13886         we're constructing an array of a user-defined type.
13887         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
13888         single-dimensional arrays, but also for single-dimensial arrays of
13889         type decimal.
13890
13891 2002-07-19  Martin Baulig  <martin@gnome.org>
13892
13893         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
13894         this function is called, it's not allowed to share LocalBuilders
13895         among ILGenerators.
13896
13897 2002-07-19  Martin Baulig  <martin@gnome.org>
13898
13899         * expression.cs (Argument.Resolve): Report an error 118 when trying
13900         to pass a type as argument.
13901
13902 2002-07-18  Martin Baulig  <martin@gnome.org>
13903
13904         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
13905         Conv_R_Un for the signed `long' type.
13906
13907 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
13908
13909         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
13910         `expr' for the temporary result, as that will fail if we do
13911         multiple resolves on the same expression.
13912
13913 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
13914
13915         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
13916         ec.TypeContainer for looking up aliases. 
13917
13918         * class.cs (TypeContainer): Remove LookupAlias from here.
13919
13920         * decl.cs (DeclSpace); Move here.
13921
13922 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
13923
13924         * class.cs (FindMembers): Only call filter if the constructor
13925         bulider is not null.
13926
13927         Also handle delegates in `NestedTypes' now.  Now we will perform
13928         type lookups using the standard resolution process.  This also
13929         fixes a bug.
13930
13931         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
13932         This uses Expressions (the limited kind that can be parsed by the
13933         tree) instead of strings.
13934
13935         * expression.cs (ComposedCast.ToString): Implement, used to flag
13936         errors since now we have to render expressions.
13937
13938         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
13939         FormArrayType. 
13940
13941         * ecore.cs (SimpleName.ToString): ditto.
13942
13943         * cs-parser.jay: Instead of using strings to assemble types, use
13944         Expressions to assemble the type (using SimpleName, ComposedCast,
13945         MemberAccess).  This should fix the type lookups in declarations,
13946         because we were using a different code path for this.
13947
13948         * statement.cs (Block.Resolve): Continue processing statements
13949         even when there is an error.
13950
13951 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
13952
13953         * class.cs (Event.Define): Also remove the `remove' method from
13954         the list of pending items.
13955
13956         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
13957         generate more compact code. 
13958
13959 2002-07-17  Martin Baulig  <martin@gnome.org>
13960
13961         * const.cs (Const.LookupConstantValue): Add support for constant
13962         `unchecked' and `checked' expressions.
13963         Also adding test case test-140.cs for this.
13964
13965 2002-07-17  Martin Baulig  <martin@gnome.org>
13966
13967         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
13968         check whether mi.ReturnType implements the IEnumerator interface; the
13969         `==' and the IsAssignableFrom() will fail in this situation.
13970
13971 2002-07-16  Ravi Pratap  <ravi@ximian.com>
13972
13973         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
13974         here too.
13975
13976 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13977
13978         * expression.cs: fixed bug #27811.
13979
13980 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
13981
13982         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
13983         Molaro: when we are a ref, the value already contains a pointer
13984         value, do not take the address of it.
13985
13986 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13987         * removed mb-parser.jay and mb-tokenizer.cs
13988
13989 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13990
13991         * expression.cs: check against the building corlib void type.
13992
13993 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
13994
13995         * ecore.cs: fix for valuetype static readonly fields: when 
13996         initializing them, we need their address, not the address of a copy.
13997
13998 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
13999
14000         * typemanager.cs: register also enum_type in corlib.
14001
14002 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14003
14004         * class.cs: allow calling this (but not base) initializers in structs.
14005
14006 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
14007
14008         * ecore.cs: make sure we compare against the building base types
14009         in GetTypeSize ().
14010
14011 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
14012
14013         * typemanager.cs: fix TypeToCoreType() to handle void and object
14014         (corlib gets no more typerefs after this change).
14015
14016 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
14017
14018         * expression.cs (ArrayCreation.EmitArrayArguments): use
14019         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
14020
14021         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
14022         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
14023         array indexes, the runtime actually forbids them.
14024
14025         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
14026         for array arguments here.
14027
14028         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
14029         instead of the default for ValueTypes.
14030
14031         (New.DoEmit): Use IsValueType instead of
14032         IsSubclassOf (value_type)
14033         (New.DoResolve): ditto.
14034         (Invocation.EmitCall): ditto.
14035
14036         * assign.cs (Assign): ditto.
14037
14038         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
14039         Statements *are* currently doing part of their resolution during
14040         Emit.  
14041
14042         Expressions do always resolve during resolve, but statements are
14043         only required to propagate resolution to their children.
14044
14045 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
14046
14047         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
14048
14049         (LoadAssembly): Do not add the dll if it is already specified
14050
14051         (MainDriver): Add the System directory to the link path at the end,
14052         after all the other -L arguments. 
14053
14054         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
14055         wrong opcode for loading bytes and bools (ldelem.i1 instead of
14056         ldelem.u1) and using the opposite for sbytes.
14057
14058         This fixes Digger, and we can finally run it.
14059
14060         * driver.cs (UnixParseOption): Move the option parsing here.  
14061         (CSCParseOption): Implement CSC-like parsing of options.
14062
14063         We now support both modes of operation, the old Unix way, and the
14064         new CSC-like way.  This should help those who wanted to make cross
14065         platform makefiles.
14066
14067         The only thing broken is that /r:, /reference: and /lib: are not
14068         implemented, because I want to make those have the same semantics
14069         as the CSC compiler has, and kill once and for all the confussion
14070         around this.   Will be doing this tomorrow.
14071
14072         * statement.cs (Unsafe.Resolve): The state is checked during
14073         resolve, not emit, so we have to set the flags for IsUnsfe here.
14074
14075 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14076
14077         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
14078         not catch the Error_ObjectRefRequired in SimpleName (as it is
14079         possible to have a class/instance variable name that later gets
14080         deambiguated), we have to check this here.      
14081
14082 2002-07-10  Ravi Pratap  <ravi@ximian.com>
14083
14084         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
14085         make static and put into Expression.
14086
14087         (Event.Define): Register the private field of the event with the 
14088         TypeManager so that GetFieldFromEvent can get at it.
14089
14090         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
14091         keep track of the private field associated with an event which
14092         has no accessors.
14093
14094         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
14095         private field.
14096
14097         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
14098
14099 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
14100
14101         * expression.cs (Binary.EmitBranchable): this routine emits the
14102         Binary expression in a branchable context.  This basically means:
14103         we need to branch somewhere, not just get the value on the stack.
14104
14105         This works together with Statement.EmitBoolExpression.
14106
14107         * statement.cs (Statement.EmitBoolExpression): Use
14108         EmitBranchable. 
14109
14110 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
14111
14112         * statement.cs (For): Reduce the number of jumps in loops.
14113
14114         (For): Implement loop inversion for the For statement.
14115
14116         (Break): We can be breaking out of a Try/Catch controlled section
14117         (foreach might have an implicit try/catch clause), so we need to
14118         use Leave instead of Br.
14119
14120         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
14121         now).  If the instace expression supports IMemoryLocation, we use
14122         the AddressOf method from the IMemoryLocation to extract the
14123         address instead of emitting the instance.
14124
14125         This showed up with `This', as we were emitting the instance
14126         always (Emit) instead of the Address of This.  Particularly
14127         interesting when This is a value type, as we dont want the Emit
14128         effect (which was to load the object).
14129
14130 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
14131
14132         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
14133
14134         * statement.cs (Checked): Set the CheckedState during the resolve
14135         process too, as the ConvCast operations track the checked state on
14136         the resolve process, and not emit.
14137
14138         * cs-parser.jay (namespace_member_declaration): Flag that we have
14139         found a declaration when we do.  This is used to flag error 1529
14140
14141         * driver.cs: Report ok when we display the help only.
14142
14143 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
14144
14145         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
14146
14147 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
14148
14149         * cs-tokenizer.cs (define): We also have to track locally the
14150         defines.  AllDefines is just used for the Conditional Attribute,
14151         but we also need the local defines for the current source code. 
14152
14153 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
14154
14155         * statement.cs (While, For, Do): These loops can exit through a
14156         Break statement, use this information to tell whether the
14157         statement is the last piece of code.
14158
14159         (Break): Flag that we break.
14160
14161         * codegen.cs (EmitContexts): New `Breaks' state variable.
14162
14163 2002-07-03  Martin Baulig  <martin@gnome.org>
14164
14165         * class.cs (TypeContainer.MethodModifiersValid): Allow override
14166         modifiers in method declarations in structs.  Otherwise, you won't
14167         be able to override things like Object.Equals().
14168
14169 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14170
14171         * class.cs (Method, Property, Indexer): Do not allow the public
14172         modifier to be used in explicit interface implementations.
14173
14174         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
14175         override modifiers in method declarations in structs
14176
14177 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
14178
14179         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
14180         integer or real overflow, report an error
14181
14182 2002-07-02  Martin Baulig  <martin@gnome.org>
14183
14184         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
14185         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
14186         to tell the runtime about our newly created System.Object and
14187         System.ValueType types.
14188
14189 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
14190
14191         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
14192         struct instead of Ldarg/Starg.
14193
14194 2002-07-02  Martin Baulig  <martin@gnome.org>
14195
14196         * expression.cs (Indirection.Indirection): Call
14197         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
14198
14199 2002-07-02  Martin Baulig  <martin@gnome.org>
14200
14201         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
14202         ValueType, call TypeManager.TypeToCoreType() on it.
14203         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
14204         the OpCodes.Newarr argument.
14205
14206 2002-07-02  Martin Baulig  <martin@gnome.org>
14207
14208         * expression.cs (Invocation.EmitCall): When compiling corlib,
14209         replace all calls to the system's System.Array type to calls to
14210         the newly created one.
14211
14212         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
14213         System.Array methods.
14214         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
14215         from the system's System.Array type which must be replaced.
14216
14217 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
14218
14219         * typemanager.cs: load unverifiable_code_ctor so we can build
14220         corlib using the correct type. Avoid using GetTypeCode() with
14221         TypeBuilders.
14222         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
14223         TypeManager.object_type to allow building corlib.
14224
14225 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
14226
14227         * ecore.cs: handle System.Enum separately in LoadFromPtr().
14228
14229 2002-07-01  Martin Baulig  <martin@gnome.org>
14230
14231         * class.cs: Make the last change actually work, we need to check
14232         whether `ifaces != null' to avoid a crash.
14233
14234 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
14235
14236         * class.cs: when we build structs without fields that implement
14237         interfaces, we need to add the interfaces separately, since there is
14238         no API to both set the size and add the interfaces at type creation
14239         time.
14240
14241 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
14242
14243         * expression.cs: the dimension arguments to the array constructors
14244         need to be converted if they are a long.
14245
14246 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
14247
14248         * class.cs: don't emit ldarg.0 if there is no parent constructor
14249         (fixes showstopper for corlib).
14250
14251 2002-06-29  Martin Baulig  <martin@gnome.org>
14252
14253         MCS now compiles corlib on GNU/Linux :-)
14254
14255         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
14256         ie. check for MethodImplOptions.InternalCall.
14257
14258         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
14259         and TypeManager.attribute_type are null, so we must explicitly check
14260         whether parent is not null to find out whether it's an attribute type.
14261         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
14262         and SetBuilder, not only if the property is neither abstract nor external.
14263         This is necessary to set the MethodImplOptions on the accessor methods.
14264         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
14265         SetBuilder, see Property.Emit().
14266
14267         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
14268         populate "System.Object", "System.ValueType" and "System.Attribute" since
14269         they've already been populated from BootCorlib_PopulateCoreTypes().
14270
14271 2002-06-29  Martin Baulig  <martin@gnome.org>
14272
14273         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
14274         is the NullLiteral, we also need to make sure that target_type is not
14275         an enum type.   
14276
14277 2002-06-29  Martin Baulig  <martin@gnome.org>
14278
14279         * rootcontext.cs (RootContext.ResolveCore): We must initialize
14280         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
14281         before calling BootstrapCorlib_ResolveDelegate ().
14282
14283 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14284
14285         * statement.cs: fixed build-breaker. All tests passed ok.
14286
14287 2002-06-27  Martin Baulig  <martin@gnome.org>
14288
14289         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
14290         for System.Decimal when compiling corlib.
14291
14292 2002-06-27  Martin Baulig  <martin@gnome.org>
14293
14294         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
14295         switch blocks which contain nothing but a default clause.
14296
14297 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
14298
14299        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
14300
14301 2002-06-27  Martin Baulig  <martin@gnome.org>
14302
14303         * ecore.cs (PropertyExpr.PropertyExpr): Call
14304         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
14305
14306         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
14307         is already a TypeBuilder.
14308
14309 2002-06-27  Martin Baulig  <martin@gnome.org>
14310
14311         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
14312         `target_type == TypeManager.array_type', not IsAssignableFrom() in
14313         the "from an array-type to System.Array" case.  This makes it work
14314         when compiling corlib.
14315
14316 2002-06-27  Martin Baulig  <martin@gnome.org>
14317
14318         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
14319         non-static PropertyExpr, set its InstanceExpression.  This makes
14320         the `ICollection.Count' property work in System/Array.cs.
14321
14322 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
14323
14324         * driver.cs: Made error handling more consistent.  Errors now
14325         tracked by Report class, so many methods which used to return int
14326         now return void.  Main() now prints success/failure and 
14327         errors/warnings message.
14328
14329         Renamed '--probe' compiler argument to '--expect-error'.  Removed
14330         the magic number return values (123 and 124).  Now, if the
14331         expected error occurs, the compiler exits with success (exit value
14332         0).  If the compilation completes without seeing that particular
14333         error, the compiler exits with failure (exit value 1).  The
14334         makefile in mcs/errors has been changed to handle the new behaviour.
14335
14336         * report.cs: Made 'expected error' number a property and renamed
14337         it from 'Probe' to 'ExpectedError'.
14338
14339         * genericparser.cs: Removed error handling support, since it is
14340         now all done by Report class.
14341
14342         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
14343         class, so parse() no longer returns an int.
14344
14345         * namespace.cs: Use Report.Error instead of GenericParser.error
14346
14347 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
14350         TypeContainer.AddOperator): At the front of the list put the
14351         explicit implementations, so they get resolved/defined first. 
14352
14353 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
14354
14355         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
14356         interface type is implemented by this TypeContainer.  Used during
14357         explicit interface implementation.
14358
14359         (Property.Define, Indexer.Define, Method.Define): Validate that
14360         the given interface in the explicit implementation is one of the
14361         base classes for the containing type.
14362
14363         Also if we are explicitly implementing an interface, but there is
14364         no match in the pending implementation table, report an error.
14365
14366         (Property.Define): Only define the property if we are
14367         not explicitly implementing a property from an interface.  Use the
14368         correct name also for those properties (the same CSC uses,
14369         although that is really not needed).
14370
14371         (Property.Emit): Do not emit attributes for explicitly implemented
14372         properties, as there is no TypeBuilder.
14373
14374         (Indexer.Emit): ditto.
14375
14376         Hiding then means that we do not really *implement* a pending
14377         implementation, which makes code fail.
14378
14379 2002-06-22  Martin Baulig  <martin@gnome.org>
14380
14381         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
14382         the return value of Object.GetType().  [FIXME: we need to do this whenever
14383         we get a type back from the reflection library].
14384
14385 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
14386
14387         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
14388
14389 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
14390
14391         * attribute.cs: Return null if we can not look up the type.
14392
14393         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
14394         the interface types found.
14395
14396         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
14397         interface types found.
14398
14399         * typemanager.cs (GetInterfaces): Make this routine returns alll
14400         the interfaces and work around the lame differences between
14401         System.Type and System.Reflection.Emit.TypeBuilder in the results
14402         result for GetInterfaces.
14403
14404         (ExpandInterfaces): Given an array of interface types, expand and
14405         eliminate repeated ocurrences of an interface.  This expands in
14406         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
14407         be IA, IB, IC.
14408
14409 2002-06-21  Martin Baulig  <martin@gnome.org>
14410
14411         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
14412         on System.Enum.
14413
14414 2002-06-21  Martin Baulig  <martin@gnome.org>
14415
14416         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
14417         and called with one of the core types, return the corresponding typebuilder for
14418         that type.
14419
14420         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
14421         element type.
14422
14423 2002-06-21  Martin Baulig  <martin@gnome.org>
14424
14425         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
14426         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
14427         (Expression.ConvertReferenceExplicit): Likewise.
14428
14429         * expression.cs (ElementAccess.DoResolve): Likewise.
14430         (ElementAccess.DoResolveLValue): Likewise.
14431
14432 2002-06-10  Martin Baulig  <martin@gnome.org>
14433
14434         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
14435         add the "value" parameter to the parameter list.
14436
14437         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
14438         to our caller.
14439
14440 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
14441
14442         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
14443         the argument to an int, uint, long or ulong, per the spec.  Also
14444         catch negative constants in array creation.
14445
14446 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
14447
14448         * class.cs: do not allow the same interface to appear twice in
14449         the definition list.
14450
14451 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
14452
14453         * ecore.cs: don't use ldlen with System.Array.
14454
14455 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
14456
14457         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
14458
14459 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
14460
14461         * modifiers.cs: produce correct field attributes for protected
14462         internal. Easy fix so miguel can work on ther harder stuff:-)
14463
14464 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
14465
14466         * pending.cs: New file.  Move the code from class.cs here.
14467         Support clearning the pending flag for all methods (when not doing
14468         explicit interface implementation).
14469
14470 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
14471
14472         * rootcontext.cs: added a couple more types needed to bootstrap.
14473
14474 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
14475
14476         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
14477         constructor in the type, instead of any constructor in the type
14478         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
14479         a bug in the Mono runtime when applying the params attribute). 
14480
14481 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
14482         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
14483
14484 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
14485
14486         * expression.cs (Unary.ResolveOperator): Use TypeManager
14487         to resolve the type.
14488
14489 2002-06-13  Ravi Pratap  <ravi@ximian.com>
14490
14491         * cs-parser.jay (enum_member_declaration): Pass in the attributes
14492         attached.
14493
14494         * enum.cs (AddEnumMember): Add support to store the attributes associated 
14495         with each member too.
14496
14497         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
14498         field builders too - this takes care of the enum member case.
14499
14500 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
14501
14502         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
14503         address-of operator on both value types and pointers.
14504
14505 2002-06-10  Martin Baulig  <martin@gnome.org>
14506
14507         * interface.cs (Interface.PopulateIndexer): Add the indexer's
14508         PropertyBuilder to the `property_builders' list.
14509
14510         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
14511         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
14512         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
14513         find any indexers which are inherited from an interface.
14514
14515 2002-06-09  Martin Baulig  <martin@gnome.org>
14516
14517         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
14518         the same type as the constant if necessary.  There's also a test-130.cs
14519         for this.
14520
14521         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
14522
14523         * typemanager.cs (TypeManager.ChangeType): Previously known as
14524         Enum.ChangeEnumType().
14525
14526 2002-06-09  Martin Baulig  <martin@gnome.org>
14527
14528         * expression.cs (Cast.TryReduce): Added support for consts.
14529
14530 2002-06-08  Ravi Pratap  <ravi@ximian.com>
14531
14532         * class.cs (Accessor): Hold attributes information so we can pass
14533         it along.
14534
14535         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
14536         Modify to pass in attributes attached to the methods.
14537
14538         (add_accessor_declaration, remove_accessor_declaration): Ditto.
14539
14540         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
14541         to handle the Accessor kind :-)
14542
14543         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
14544
14545 2002-06-08  Martin Baulig  <martin@gnome.org>
14546
14547         * expression.cs (Unary.TryReduceNegative): Added support for
14548         ULongConstants.
14549
14550 2002-06-08  Martin Baulig  <martin@gnome.org>
14551
14552         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
14553         name can't be found in the `defined_names' - the caller will do a
14554         MemberLookup in this case and thus find methods in System.Enum
14555         such as Enum.IsDefined().
14556
14557 2002-06-08  Martin Baulig  <martin@gnome.org>
14558
14559         * enum.cs (Enum.ChangeEnumType): This is a custom version of
14560         Convert.ChangeType() which works with TypeBuilder created types.
14561         (Enum.LookupEnumValue, Enum.Define): Use it here.
14562
14563         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
14564         `TypeBuilder.BaseType != null' check.
14565         (TypeContainer.FindMembers): Only lookup parent members if we
14566         actually have a parent.
14567         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
14568         (ConstructorInitializer.Resolve): Likewise.
14569
14570         * interface.cs (Interface.FindMembers): Added
14571         `TypeBuilder.BaseType != null' check.
14572
14573         * rootcontext.cs (RootContext.ResolveCore): Added
14574         "System.Runtime.CompilerServices.IndexerNameAttribute" to
14575         classes_second_stage.
14576
14577         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
14578         debug_type and trace_type when compiling with --nostdlib.       
14579
14580 2002-06-07  Martin Baulig  <martin@gnome.org>
14581
14582         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
14583         (AddField): Set it to true when adding a non-static field.
14584         (DefineType): Use `have_nonstatic_fields' to find out whether we
14585         have non-static fields, not `Fields != null'.
14586
14587 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
14588
14589         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
14590         dereferencing a null on the static-field code path)
14591
14592 2002-05-30  Martin Baulig  <martin@gnome.org>
14593
14594         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
14595         to take command line arguments.  Use reflection to call the new
14596         custom `Initialize' function on the symbol writer and pass it the
14597         command line arguments.
14598
14599         * driver.cs (--debug-args): New command line argument to pass command
14600         line arguments to the symbol writer.
14601
14602 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
14603
14604         * assign.cs (DoResolve): Forgot to do the implicit conversion to
14605         the target type for indexers and properties.  Thanks to Joe for
14606         catching this.
14607
14608 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
14609
14610         * typemanager.cs (MethodFlags): returns the method flags
14611         (Obsolete/ShouldIgnore) that control warning emission and whether
14612         the invocation should be made, or ignored. 
14613
14614         * expression.cs (Invocation.Emit): Remove previous hack, we should
14615         not do this on matching a base type, we should do this based on an attribute
14616
14617         Only emit calls to System.Diagnostics.Debug and
14618         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
14619         on the command line.
14620
14621         * rootcontext.cs: Global settings for tracing and debugging.
14622
14623         * cs-tokenizer.cs (define): New utility function to track
14624         defines.   Set the global settings for TRACE and DEBUG if found.
14625
14626 2002-05-25  Ravi Pratap  <ravi@ximian.com>
14627
14628         * interface.cs (Populate*): Pass in the TypeContainer as well as
14629         the DeclSpace as parameters so that we can create EmitContexts and
14630         then use that to apply attributes etc.
14631
14632         (PopulateMethod, PopulateEvent, PopulateProperty)
14633         (PopulateIndexer): Apply attributes everywhere.
14634
14635         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
14636         etc.
14637
14638         (ApplyAttributes): Update accordingly.
14639
14640         We now apply interface attributes for all members too.
14641
14642 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
14643
14644         * class.cs (Indexer.Define); Correctly check if we are explicit
14645         implementation (instead of checking the Name for a ".", we
14646         directly look up if the InterfaceType was specified).
14647
14648         Delay the creation of the PropertyBuilder.
14649
14650         Only create the PropertyBuilder if we are not an explicit
14651         interface implementation.   This means that explicit interface
14652         implementation members do not participate in regular function
14653         lookups, and hence fixes another major ambiguity problem in
14654         overload resolution (that was the visible effect).
14655
14656         (DefineMethod): Return whether we are doing an interface
14657         implementation. 
14658
14659         * typemanager.cs: Temporary hack until we get attributes in
14660         interfaces (Ravi is working on that) and we get IndexerName
14661         support in interfaces.
14662
14663         * interface.cs: Register the indexers as properties.
14664
14665         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
14666         warning, I have verified that this is a bug in the .NET runtime
14667         (JavaScript suffers of the same problem).
14668
14669         * typemanager.cs (MemberLookup): When looking up members for
14670         interfaces, the parent of an interface is the implicit
14671         System.Object (so we succeed in searches of Object methods in an
14672         interface method invocation.  Example:  IEnumerable x;  x.ToString
14673         ()) 
14674
14675 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
14676
14677         * class.cs (Event): Events should also register if they do
14678         implement the methods that an interface requires.
14679
14680         * typemanager.cs (MemberLookup); use the new GetInterfaces
14681         method. 
14682
14683         (GetInterfaces): The code used to lookup interfaces for a type is
14684         used in more than one place, factor it here. 
14685
14686         * driver.cs: Track the errors at the bottom of the file, we kept
14687         on going.
14688
14689         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
14690         instance if the method we are calling is static!
14691
14692 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
14693
14694         * attribute.cs (ApplyAttributes): Make this function filter out
14695         the IndexerName attribute (as that attribute in reality is never
14696         applied) and return the string constant for the IndexerName
14697         attribute. 
14698
14699         * class.cs (TypeContainer.Emit): Validate that all the indexers
14700         have the same IndexerName attribute, and if so, set the
14701         DefaultName attribute on the class. 
14702
14703         * typemanager.cs: The return value might contain other stuff (not
14704         only methods).  For instance, consider a method with an "Item"
14705         property and an Item method.
14706
14707         * class.cs: If there is a problem with the parameter types,
14708         return. 
14709
14710 2002-05-24  Ravi Pratap  <ravi@ximian.com>
14711
14712         * ecore.cs (ImplicitConversionExists): Wrapper function which also
14713         looks at user defined conversion after making a call to 
14714         StandardConversionExists - we need this for overload resolution.
14715
14716         * expression.cs : Update accordingly the various method calls.
14717
14718         This fixes 2 bugs filed against implicit user defined conversions 
14719
14720 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
14721
14722         * statement.cs: Track the result of the assignment.
14723
14724 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
14725
14726         * expression.cs (MemberAccess): Improved error reporting for
14727         inaccessible members.
14728
14729 2002-05-22  Martin Baulig  <martin@gnome.org>
14730
14731         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
14732         itself with debugging support.
14733
14734 2002-05-22  Martin Baulig  <martin@gnome.org>
14735
14736         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
14737         Removed, this isn't needed anymore.
14738
14739 2002-05-20  Martin Baulig  <martin@gnome.org>
14740
14741         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
14742         be underlying type for an enum.
14743
14744 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
14745
14746         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
14747         that splits out the loading of just the core types.
14748
14749         * rootcontext.cs (ResolveCore): Split the struct resolution in
14750         two, so we can load the enumeration underlying types before any
14751         enums are used.
14752
14753         * expression.cs (Is): Bandaid until we fix properly Switch (see
14754         bug #24985 for details).
14755
14756         * typemanager.cs (ImplementsInterface): The hashtable will contain
14757         a null if there are no interfaces implemented.
14758
14759 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
14760
14761         * cs-parser.jay (indexer_declarator): It is fine to have array
14762         parameters
14763
14764 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14765
14766         * typemanager.cs: (RegisterBuilder): New function used to register
14767         TypeBuilders that implement interfaces.  Since
14768         TypeBuilder.GetInterfaces (as usual) does not work with lame
14769         Reflection.Emit. 
14770         (AddUserType): register interfaces.
14771
14772         (ImplementsInterface): Use the builder_to_ifaces hash if we are
14773         dealing with TypeBuilder.  Also, arrays are showing up as
14774         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
14775         methods can not be invoked on them!
14776
14777         * ecore.cs (ExplicitReferenceConversionExists): Made public.
14778         (ImplicitReferenceConversionExists): Split out from
14779         StandardConversionExists. 
14780
14781         * expression.cs (As): We were only implementing one of the three
14782         cases for the as operator.  We now implement them all.
14783         (Is): Implement the various other cases for Is as well.
14784
14785         * typemanager.cs (CACHE): New define used to control if we want or
14786         not the FindMembers cache.  Seems to have a negative impact on
14787         performance currently
14788
14789         (MemberLookup): Nested types have full acess to
14790         enclosing type members
14791
14792         Remove code that coped with instance/static returns for events, we
14793         now catch this in RealFindMembers.
14794
14795         (RealFindMembers): only perform static lookup if the instance
14796         lookup did not return a type or an event.  
14797
14798 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
14799
14800         * assign.cs (CompoundAssign): We pass more semantic information
14801         now to Compound Assignments than we did before: now we have all
14802         the information at hand, and now we resolve the target *before* we
14803         do the expression expansion, which allows the "CacheValue" method
14804         to have the effect we intended (before, a [x] += 1 would generate
14805         two differen ArrayAccess expressions from the ElementAccess,
14806         during the resolution process).
14807
14808         (CompoundAssign.DoResolve): Resolve target and original_source here.
14809
14810 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
14811
14812         * expression.cs (ArrayAccess): dropped debugging information. 
14813
14814         * typemanager.cs: Small bug fix: I was always returning i_members,
14815         instead of one of i_members or s_members (depending on which had
14816         the content).
14817
14818         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
14819         method is invoked before any code generation takes place, and it
14820         is a mechanism to inform that the expression will be invoked more
14821         than once, and that the method should use temporary values to
14822         avoid having side effects
14823
14824         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
14825
14826         * ecore.cs (Expression.CacheTemporaries): Provide empty default
14827         implementation.
14828
14829         * expression.cs (Indirection, ArrayAccess): Add support for
14830         CacheTemporaries in these two bad boys. 
14831
14832         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
14833         ldobj or ldind_ref.  
14834         (StoreFromPtr): Handle stobj as well.
14835
14836         * expression.cs (UnaryMutator): Share more code.
14837
14838         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
14839         down: I was not tracking the Filter function as well, which
14840         was affecting the results of the cache.
14841
14842 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
14843
14844         * attribute.cs: Remove the hack to handle the CharSet property on
14845         StructLayouts. 
14846
14847 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
14848
14849         * attribute.cs (DoResolve): More uglyness, we now only try to
14850         resolve the attribute partially, to extract the CharSet
14851         information (only if we are a StructLayout attribute).  Otherwise 
14852
14853         (GetExtraTypeInfo): Add some code to conditionally kill in the
14854         future this.   I am more and more convinced that the .NET
14855         framework has special code to handle the attribute setting on
14856         certain elements.
14857
14858         * expression.cs (IsParamsMethodApplicable): Revert my previous
14859         foreach change here, it was wrong.
14860
14861 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
14864         (pp_expr): do not abort on unknown input, just return.
14865         (eval): abort if there are pending chars.
14866
14867         * attribute.cs (Attribute.Resolve): Positional parameters are
14868         optional.  Deal with that case.
14869
14870         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
14871         the Ansi/Unicode/Auto information for the type.
14872
14873         (TypeContainer.DefineType): instantiate the EmitContext here, as
14874         we will be using it during the type definition (to resolve
14875         attributes) and during the emit phase.
14876
14877         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
14878         to pull type information out of the attributes
14879
14880         (Attribute.Resolve): track the constructor builder, and allow for
14881         multiple invocations (structs and classes will use this).
14882
14883         * ecore.cs (MemberLookupFinal): new version with all the
14884         parameters customizable.
14885
14886         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
14887         constructors.  Return if the result value is null (as the error
14888         would have been flagged already by MemberLookupFinal)
14889
14890         Do not allow instances of abstract classes or interfaces to be
14891         created.
14892
14893         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
14894         We have to compare the assembly property here when dealing with
14895         FamANDAssem and Assembly access modifiers, because we might be
14896         creating an assembly from *modules* (that means that we are not
14897         getting TypeBuilders for types defined in other modules that are
14898         part of this assembly).
14899
14900         (Method.Emit): If the method is marked abstract and has a body,
14901         emit an error. 
14902
14903         (TypeContainer.DefineMembers): If both the defined member and the
14904         parent name match are methods, then do not emit any warnings: let
14905         the Method.Define routine take care of flagging warnings.  But if
14906         there is a mismatch (method overrides something else, or method is
14907         overriwritten by something, then emit warning).
14908
14909         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
14910         set to null, this means `do not check for the return type on the
14911         signature'. 
14912
14913         (Method.Define): set the return type for the method signature to
14914         null, so that we get methods with the same name and parameters and
14915         different return types.  This is used to flag warning 114 (you are
14916         hiding a method, and you probably want to use the new/override
14917         keywords instead).
14918
14919         * typemanager.cs (MemberLookup): Implemented proper access
14920         control, closing a long standing set of bug reports.  The problem
14921         was that the Framework only has two bits: Public and NonPublic,
14922         and NonPublic includes private and protected methods, but we need
14923         to enforce the FamANDAssem, FamOrAssem and Family. 
14924
14925 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
14926
14927         * statement.cs (GotoCase): Return true: Ammounts to giving up
14928         knowledge on whether we return or not, and letting the other case
14929         be responsible for it.
14930
14931 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
14932
14933         * driver.cs: Do not load directories for each file processed, only
14934         do it if there is a pattern.
14935
14936         * ecore.cs: Report readonly assigns here as well, as we might have
14937         been resolved only by MemberAccess.
14938
14939         (SimpleName.SimpleNameResolve): Also be useful for LValue
14940         resolution.   We need this to propagate assign to local readonly variables
14941
14942         * typemanager.cs: Use a ptrhashtable for the criteria, because we
14943         do not want to reuse potential criteria memory.
14944
14945         * class.cs (MyEventBuilder): Set reflected_type;
14946
14947         * ecore.cs (Constantify): Added support for constifying bools.
14948
14949         (RootContext.LookupType): Added a cache for values looked up in
14950         the declaration space.
14951
14952         * typemanager.cs (FindMembers): Now is a front-end to
14953         RealFindMembers, and provides a two-level hashtable-based cache to
14954         the request.  
14955
14956         15% performance improvement: from 22.5 to 19.2 seconds.
14957
14958         * expression.cs (IsParamsMethodApplicable): use foreach.
14959         (Invocation.DoResolve): ditto.
14960         (New.DoResolve): ditto.
14961         (ArrayCreation.DoResolve): ditto.
14962
14963         * ecore.cs (FindMostEncompassingType): use foreach.
14964
14965         * delegate.cs (NewDelegate.DoResolve): Use foreach
14966
14967         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
14968         (RemoveMethods): use foreach.
14969
14970         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
14971         nested foreach statements instead of for, and also break out of
14972         the inner loop once a match is found.
14973
14974         (Invocation.OverloadResolve): Use foreach, simplify the code. 
14975
14976 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
14977
14978         * cfold.cs (BinaryFold): During an enumeration evaluation context,
14979         we actually unwrap the expression to allow for extra information
14980         to be extracted. 
14981
14982         * expression.cs: Use Shr_Un on unsigned operations. 
14983
14984 2002-05-08  Ravi Pratap  <ravi@ximian.com>
14985
14986         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
14987         applicable operators was not being considered correctly. This closes
14988         the bug Miguel reported.
14989
14990 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
14991
14992         * attribute.cs: check that the type derives from System.Attribute
14993         and report the correct error in that case (moved the duplicate code to
14994         its own method, too).
14995
14996 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
14997
14998         * attribute.cs: lookup attribute type name as the spec says: first the
14999         bare attribute name and then name + "Attribute" (nant compiles with
15000         mcs after this fix).
15001
15002 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
15003
15004         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
15005         Because of the way we parse things, we should try to see if a
15006         UIntConstant can fit in an integer.
15007
15008 2002-05-07  Ravi Pratap  <ravi@ximian.com>
15009
15010         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
15011         when we are in an explicit context.
15012
15013         (ConvertReferenceExplicit): When converting from Iface type S to Class
15014         T make sure the rules are implemented as an OR.
15015
15016         * parameter.cs (ParameterType): Make it a property for now although the
15017         purpose really isn't anything immediate.
15018
15019         * expression.cs (Is*Applicable): Do better checking on the parameter type
15020         of a ref/out parameter. The ones from the system assemblies are already 
15021         marked with the correct type so we don't need to do any correction.
15022
15023         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
15024         the object type is standard too so include that.
15025
15026 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15027
15028         * ecore.cs (StandardConversionExists): Augment with missing code:
15029         deal with IntConstant, LongConstants and Enumerations.
15030
15031         * assign.cs: Report the error, instead of failing silently
15032
15033         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
15034         typecontainer that they are declared, because the
15035         typecontainer/namespace will have the list of using clauses that
15036         need to be applied.
15037
15038         Assembly Attributes were escaping the normal registration
15039         mechanism. 
15040
15041         (EmitCode): Apply attributes within an EmitContext that represents
15042         the container they were declared on.
15043
15044         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
15045
15046 2002-05-06  Ravi Pratap  <ravi@ximian.com>
15047
15048         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
15049         Revamp completely - make much cleaner as we now operate only
15050         on a set of Types.
15051
15052         (FindMostSpecificSource, FindMostSpecificTarget): New methods
15053         to implement the logic detailed in the spec more correctly.
15054
15055         (UserDefinedConversion): Update accordingly.
15056
15057 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * statement.cs: Return flow analysis information up.
15060
15061         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
15062         and the default.
15063
15064         (token): Do not consume an extra character before calling
15065         decimal_digits.
15066
15067 2002-05-06  Piers Haken <piersh@friskit.com>
15068
15069         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
15070
15071 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
15072
15073         * class.cs (Constructor.Emit): Set the IsStatic flag in the
15074         EmitContext during the instance constructor initializer
15075         resolution, to stop access to instance variables.
15076
15077         This is mandated by the spec, last paragraph of the `constructor
15078         initializers' section. 
15079
15080 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
15081
15082         * cs-parser.jay, class.cs (Accessor): new class used to represent
15083         an accessor (get or set).  In the past we used `null' to represent
15084         a missing accessor.  But this is ambiguous because there was no
15085         way to tell in abstract indexers/properties if one of them was
15086         specified.
15087
15088         Now there is a way of addressing that.
15089
15090         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
15091         instead of FindMembers.
15092
15093         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
15094         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
15095
15096         * attribute.cs: Treat indexers and properties as the same in terms
15097         of applying attributes
15098
15099         * ecore.cs (FindMostEncompassedType): Use statically initialized
15100         EmptyExpressions()s like we do elsewhere to avoid creating useless
15101         objects (and we take this out of the tight loop).
15102
15103         (GetConversionOperators): Move the code to extract the actual
15104         operators to a separate routine to clean things up.
15105
15106 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
15107
15108         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
15109         events are always registered FieldBuilders.
15110
15111         * class.cs (FieldBase): New class shared by Fields 
15112
15113         * delegate.cs: If we are a toplevel delegate, use our full name.
15114         If we are a nested delegate, then only use our tail name.
15115
15116 2002-05-02  Ravi Pratap  <ravi@ximian.com>
15117
15118         * expression.cs (IsApplicable): Ensure that we add the "&" to
15119         ref/out types before comparing it with the type of the argument.
15120
15121         (IsParamsMethodApplicable): Ditto.
15122
15123         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
15124         silly me ;-)
15125
15126         * delegate.cs : Handle the case when we have more than one applicable
15127         method. Flag an error only when we finish checking all.
15128
15129 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
15130
15131         * expression.cs: Add support for boolean static initializers.
15132
15133 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
15134
15135         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
15136
15137         * parameter.cs (ComputeParameterTypes,
15138         ComputeAndDefineParameterTypes): Better error handling: now we
15139         clear the `types' cache if we fail during any of the type lookups.
15140         We also return the status code correctly to our caller
15141
15142         * delegate.cs: If we fail to define a delegate, abort the extra
15143         steps. 
15144
15145         * expression.cs (Binary.ResolveOperator): for
15146         operator==(object,object) and operator !=(object, object) we also
15147         have to verify that there is an implicit conversion from one to
15148         the other.
15149
15150         (ArrayAccess.DoResolve): Array Access can operate on
15151         non-variables. 
15152
15153 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
15154
15155         * assign.cs (CompoundAssign): A new class used as a "flag" that
15156         the assignment actually is happening as part of a compound
15157         assignment operator.
15158
15159         During compound assignment, a few new rules exist to enable things
15160         like:
15161
15162         byte b |= 1 + 2
15163
15164         From the spec:
15165
15166         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
15167         to the type of x) if y is implicitly convertible to the type of x,
15168         and the operator is a builtin operator and the return type of the
15169         operator is explicitly convertible to the type of x. 
15170
15171         * rootcontext.cs: Reset warning level to 2.  4 catches various
15172         "interesting" features in mcs, we must clean this up at some
15173         point, but currently am trying to kill other bugs ;-)
15174
15175         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
15176         in container classes as well.  
15177
15178         * expression.cs (Binary.ResolveOperator): Handle string case
15179         before anything else (as operator overloading does emit an error
15180         before doing anything else).
15181
15182         This code could go away when we move to a table driven model, but
15183         i could not come up with a good plan last night.
15184
15185 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
15186
15187         * typemanager.cs (CSharpName): reimplementation using regex.
15188         * class.cs: added null check for fields in Emit
15189         * rootcontext.cs: set warninglevel to 4
15190
15191 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
15192
15193         * typemanager.cs (CSharpName): reimplemented with Lupus
15194         suggestion.
15195
15196 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
15197
15198         * statement.cs (If): correclty implement Resolve, because we were
15199         not catching sem errors in there.  The same process is needed
15200         everywhere else. 
15201         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
15202
15203
15204         (Statement.Warning_DeadCodeFound): Factorize code.
15205         (While): Report dead code here too.
15206
15207         (Statement): Added Resolve virtual method to allow
15208         for resolution split from the emit code.
15209
15210 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15211
15212         * statement.cs (EmitBoolExpression): No longer try to resolve the
15213         expression here.    
15214         (MakeBoolean): New utility function that resolve, implicitly
15215         converts to boolean and tags the expression. 
15216
15217
15218         (If, Do): Implement dead code elimination.
15219         (While): Implement loop inversion
15220
15221         (Do, While, For, If): Resolve the expression prior to calling our
15222         code generation.
15223
15224 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
15225
15226         * class.cs:
15227           - added method Report28 (warning: program has more than one entry point)
15228           - added method IsEntryPoint, implements paragraph 10.1 of the spec
15229           - modified method Method.Define, the part at the end of the method
15230
15231         * rootcontext.cs: added static public Location EntryPointLocation;
15232           
15233         * ../errors/cs0028.cs : Add test case for the above warning.              
15234
15235         * typemanager.cs:
15236           - modified method CSharpName to allow arrays of primitive type to
15237             be printed nicely (e.g. instead of System.Int32[][] it now prints
15238             int[][])
15239           - added method CSharpSignature: returns the signature of a method
15240             in string format to be used in reporting errors, warnings, etc.
15241
15242         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
15243         with String.Empty.
15244
15245 2002-04-26  Ravi Pratap  <ravi@ximian.com>
15246
15247         * delegate.cs (Define): Fix extremely silly bug where I was
15248         setting the type of the 'object' parameter of the BeginInvoke
15249         method to System.IAsyncResult instead of System.Object ;-)
15250
15251 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
15252
15253         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
15254         here. 
15255
15256         (Constructor.Emit): return if we fail to initialize the
15257         constructor.  Another door closed!  
15258
15259         * expression.cs (New.DoResolve): Improve error message (from -6 to
15260         1501).  Use DeclaredOnly lookup to find the exact constructor.
15261
15262         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
15263         loop.  This is useful.
15264
15265         * cs-parser.jay: Adjust the default parameters so that destructors
15266         have the proper signature.
15267
15268 2002-04-26  Martin Baulig  <martin@gnome.org>
15269
15270         * driver.cs (LoadAssembly): If `assembly' contains any characters
15271         which are only valid in path names and not in assembly names
15272         (currently slash, backslash and point), use Assembly.LoadFrom ()
15273         instead of Assembly.Load () on the `assembly' (before iteration
15274         over the link_paths).
15275
15276 2002-04-26  Martin Baulig  <martin@gnome.org>
15277
15278         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
15279
15280 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * class.cs (Property): use the new typemanager.MemberLookup
15283
15284         (TypeContainer.MemberLookup): Implement using the
15285         TypeManager.MemberLookup now. 
15286
15287         * typemanager.cs: Make MemberLookup a function of the TypeManager,
15288         and return MemberInfos, so that these can be used without an
15289         EmitContext (what we had before).
15290
15291 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
15292
15293         * expression.cs: Fix the case where the argument to params if the
15294         type of the params.  I omitted handling this before.   Fixed
15295
15296 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15297
15298         * driver.cs: Call BootCorlib_PopulateCoreType
15299
15300         * class.cs (Property.CheckBase): Check for properties only, not
15301         for all members. 
15302
15303         * interface.cs: Temporary hack: try/catch around the
15304         CustomAttributeBuilder, because I am getting an exception that I
15305         do not understand.
15306
15307         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
15308         types whose definitions are required to be there (attributes are
15309         defined before standard types).
15310
15311         Compute definitions as we boot the various types, as they are used
15312         immediately (value_type class will need object_type, but if we do
15313         not initialize object_type, we will pass a null, which will let
15314         the runtime pick the System.Object from the existing corlib, which
15315         is not what we want).
15316
15317 2002-04-22  Patrik Torstensson <totte@labs2.com>
15318
15319         * cs-tokenizer.cs: fixed a number of trim() issues.
15320
15321 2002-04-22  Ravi Pratap  <ravi@ximian.com>
15322
15323         * expression.cs (Argument.Type): Ensure that we return the correct
15324         type when we have out or ref parameters [in which case we 
15325         append a "&"].
15326
15327 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
15328
15329         * class.cs (Property, Indexer): Allow extern modifier in there. 
15330
15331         * typemanager.cs (InitBaseTypes): Initializes object_type and
15332         value_type, since those will be used early on during the bootstrap
15333         process to compile corlib.
15334
15335         (InitCoreTypes): Move code from here to InitBaseTypes.
15336
15337 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
15338
15339         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
15340         single-dimension arrays as using the ldlen opcode.  
15341
15342         Daniel Lewis discovered this optimization.  
15343
15344         * typemanager.cs: Add signature for System.Array::get_Length
15345
15346 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15347
15348         * statement.cs: report the error when the foreach does not apply to an
15349         array nor a collection.
15350
15351 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
15352
15353         * expression.cs: Add implicit conversions to the operator ~.
15354
15355         * constant.cs (DecimalConstant.Emit): Emit decimal value.
15356
15357         * typemanager.cs: Locate the decimal constructor.
15358
15359 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15360
15361         * attribute.cs: use the new property of TypeOf.
15362         * expression.cs: added 'get' property around typearg.
15363
15364         These changes fix a build breaker reported by NickD. Is this the
15365         correct way to fix?  If not, please, revert my changes and make it
15366         work :-).
15367
15368 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
15369
15370         * attribute.cs: Add support for typeof in attribute invocations.
15371         I am not sure that this is right though.
15372
15373 2002-04-14  Duncan Mak  <duncan@ximian.com>
15374
15375         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
15376         Binary.Operator.Division case.
15377
15378 2002-04-13  Ravi Pratap  <ravi@ximian.com>
15379
15380         * class.cs (DefineType): Ensure that we do a proper check on
15381         attribute types and also register it with the TypeManager.
15382
15383         (TypeContainer.Targets): The default for attribute types is
15384         AttributeTargets.All.
15385
15386         * attribute.cs (ApplyAttributes): Registering the attribute type
15387         is done elsewhere, not when we discover we have a Usage attribute.
15388
15389 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15390
15391         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
15392         and get rid of is_delegate parameter.
15393
15394         * everywhere : update.
15395
15396 2002-04-12  Ravi Pratap  <ravi@ximian.com>
15397
15398         * cs-parser.jay (compilation_unit): Revamp completely to use
15399         some new ideas that I got from Rhys' grammar to solve the problems
15400         with assembly level attributes.
15401
15402         (outer_declaration): New grammar production.
15403
15404         (attribute_sections): Add.
15405
15406         (opt_attributes): Base on attribute_sections
15407
15408         (namespace_declaration): Allow opt_attributes to tackle the case
15409         when we have assembly level attributes - we are clever in this
15410         regard now ;-)
15411
15412         * attribute.cs (ApplyAttributes): Do not worry about assembly 
15413         attributes in the non-global context.
15414
15415         * rootcontext.cs (AddGlobalAttributes): Go back to using this
15416         instead of SetGlobalAttributes.
15417
15418         * class.cs, rootcontext.cs : Ensure we define and generate 
15419         attribute types before anything else.
15420
15421         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
15422         and flag the new error -20 for the case when the attribute type
15423         does not have valid targets specified. csc does not catch this.
15424
15425         * ../errors/errors.txt : update for error # -20
15426
15427 2002-04-11  Ravi Pratap  <ravi@ximian.com>
15428
15429         * support.cs (InternalParameters.ParameterModifier): Do some null
15430         checking and return sane values.
15431
15432         * class.cs (Method.Define): If we are a PInvoke method, ensure
15433         that we are static and extern. Report error # 601
15434
15435         * ../errors/cs0601.cs : Add test case for the above error.
15436
15437 2002-04-07  Ravi Pratap  <ravi@ximian.com>
15438
15439         * rootcontext.cs (attribute_types): We need to keep type of
15440         all attribute types separately and emit code for them first.
15441
15442         (RegisterAttribute) : Implement.
15443
15444         * class.cs (DefineType): Check if the current Type is a custom
15445         attribute type and register it accordingly.
15446
15447         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
15448         adding the first attribute twice and rename to
15449
15450         (SetGlobalAttributes): this.
15451
15452         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
15453         lookups.
15454
15455         * attribute.cs (ApplyAttributes): Take an additional argument telling us
15456         if we are processing global arguments. Hmm, I am unsure of this.
15457
15458 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15459
15460         * expression.cs: added static array of strings to avoid calling
15461         Enum.ToString () for Operator in Binary. Significant recover of
15462         performance.
15463
15464 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
15465
15466         * class.cs (FindMembers): Allow the Builders of the various
15467         members to be null.  If they are skip them.  This only happens
15468         during the PInvoke declaration.
15469
15470 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
15471
15472         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
15473         failure, so we do not keep going afterwards.
15474
15475         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
15476         wanted to pass `false' as the `is_delegate' argument.  If this is
15477         the case, why not use delegate_type == null to mean `is_delegate =
15478         false' and anything else as is_delegate = true.
15479
15480 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
15481
15482         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
15483         code for the section, not the beginning of the tests.
15484
15485 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
15486
15487         * cfold.cs: Handle operator + (Enum x, Underlying x) 
15488
15489         * expression.cs (Binary): same.  Warn about errors where we have
15490         Enum/Enum in operator + as well.
15491
15492 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
15493
15494         * statement.cs:
15495                 - added support for switch(bool)
15496                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
15497                 - add TableSwitchEmit() to handle table-based switch statements
15498
15499 2002-04-05  Ravi Pratap  <ravi@ximian.com>
15500
15501         * expression.cs (Invocation.OverloadResolve): Factor out code which
15502         does parameter compatibility checking with arguments so that we can 
15503         re-use the code even from Delegate.VerifyApplicability
15504
15505         (VerifyArgumentsCompat): Move above code here.
15506
15507         * delegate.cs (VerifyApplicability): Get rid of duplicate code
15508         and instead make a call to the above method.
15509
15510 2002-03-31  Ravi Pratap  <ravi@ximian.com>
15511
15512         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
15513         We use it to keep track of classes which are attribute types.
15514
15515 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
15516
15517         * delegate.cs (Delegate.Define): Correctly define the types in the
15518         presence of fixed and array parameters.
15519
15520         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
15521         doing FindMembers.
15522
15523         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
15524         include NonPublic after the first iteration.
15525
15526         * class.cs (Indexer.CheckBase): Only check if both parents are
15527         non-null. 
15528
15529         * cs-parser.jay (accessor_body): If empty, set to null.
15530
15531         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
15532         same code path here to resolve constants names that we did have in
15533         MemberAccess.DoResolve.  There is too much code duplicated here.
15534
15535 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
15536
15537         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
15538
15539         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
15540         to MakeUnionSet.
15541
15542         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
15543         tokens, numbers and strings.
15544
15545         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
15546         parenthesis.
15547
15548         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
15549         asyncronous parameters and the regular parameters.  
15550
15551         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
15552         specify the target directory.
15553
15554         * expression.cs: (This.DoResolve): Simplify
15555         (As.Emit): Optimize, do not generate IsInst if the expression is
15556         always of the given type.
15557
15558         (Is.DoResolve): Bug fix, we were reporting both always/never for
15559         the is expression.
15560
15561         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
15562         creating too many unnecessary arrays.
15563
15564 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
15565
15566         * class.cs (EmitFieldInitializer): Use Assign expression to assign
15567         fields instead of rolling our own initializer.   Takes care of all
15568         implicit conversions, and drops unnecessary static checks/argument.
15569
15570 2002-03-31  Dick Porter  <dick@ximian.com>
15571
15572         * driver.cs: use the GetDirectories() return values properly, and
15573         use "/" as path separator.
15574
15575 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
15576
15577         * expression.cs (Unary): Optimize - - expr into expr.
15578         (Binary): Optimize a + (-b) into a -b.
15579
15580         * codegen.cs (CodeGen): Made all methods static.
15581
15582 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
15583
15584         * rootcontext.cs: 
15585
15586         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
15587         TypeBuilder property.
15588
15589         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
15590         instead. 
15591
15592         * tree.cs: Removed the various RecordXXXX, and replaced with a
15593         single RecordDecl.  Removed all the accessor methods, and just
15594         left a single access point Type 
15595
15596         * enum.cs: Rename DefineEnum to DefineType.
15597
15598         * decl.cs: New abstract method `DefineType' used to unify the
15599         Defines for Enumerations, Interfaces, TypeContainers and
15600         Delegates.
15601
15602         (FindType): Moved LookupInterfaceOrClass here.  Moved the
15603         LookupBaseClasses method that used to live in class.cs and
15604         interface.cs here, and renamed to FindType.
15605
15606         * delegate.cs: Implement DefineType.  Take advantage of the
15607         refactored pattern for locating the parent builder without taking
15608         the parent_builder argument (which we know does not work if we are
15609         nested, and triggering a toplevel definition).
15610
15611 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15612
15613         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
15614         accessibility of a member has changed during override and report
15615         an error if so.
15616
15617         * class.cs (Method.Define, Property.Define): Only complain on
15618         overrides if the method is private, any other accessibility is
15619         fine (and since we just checked the permission is the same, we are
15620         good to go).
15621
15622         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
15623         and elif are processed always.  The other pre-processing
15624         directives are only processed if we are "taking" the path
15625
15626 2002-03-29  Martin Baulig  <martin@gnome.org>
15627
15628         * class.cs (Method.Emit): Only emit symbolic debugging info if the
15629         current location is not Null.
15630
15631         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
15632         a separate method so we can profile it.
15633
15634         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
15635         `span.Seconds' are just seconds, but no minutes or hours.
15636         (MainDriver): Profile the CodeGen.SaveSymbols calls.
15637
15638 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15639
15640         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
15641         Remove the gratuitous set of Final:
15642
15643                                 // If an interface implementation, then we can set Final.
15644                                 if (((flags & MethodAttributes.Abstract) == 0) &&
15645                                     implementing.DeclaringType.IsInterface)
15646                                         flags |= MethodAttributes.Final;
15647
15648         I do not know what I was smoking when I used that.
15649
15650
15651         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
15652         step into fixing the name resolution issues for delegates and
15653         unifying the toplevel name resolution.
15654
15655 2002-03-28  Martin Baulig  <martin@gnome.org>
15656
15657         * class.cs (Method.Emit): If we have a symbol writer, call its
15658         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
15659         tell it about the current method.
15660
15661         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
15662         writer that we're going to emit the first byte of IL code for a new
15663         statement (a new source line).
15664         (EmitContext.EmitTopBlock): If we have a symbol writer, call
15665         EmitContext.Mark() before emitting any code.
15666
15667         * location.cs (SymbolDocument): Return null when we're Null.
15668
15669         * statement.cs (Statement): Moved the `Location loc' variable here.
15670         (Statement.EmitBoolExpression): If we have a symbol writer, call
15671         ec.Mark() before emitting any code to tell it that we're at the
15672         beginning of a new statement.
15673         (StatementExpression): Added `Location' argument to the constructor.
15674         (Block): Added public readonly variable `StartLocation' and public
15675         variable `EndLocation'.  The latter is to be set using SetEndLocation().
15676         (Block): Added constructor which takes a start and end location.
15677         (Block.SetEndLocation): New method. This sets the end location.
15678         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
15679         local variables we create.
15680         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
15681         each statement and do also mark the begin and end of the block.
15682
15683         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
15684         tell it the current lexer.Location, use Location.Null for the end of the
15685         block.
15686         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
15687         current block, set its end location using SetEndLocation().
15688         (statement_expression): StatementExpression constructor now takes the
15689         lexer.Location as additional argument.
15690         (for_statement, declare_local_variables): Likewise.
15691         (declare_local_variables): When creating a new implicit block, use the
15692         new Block constructor and pass it the lexer.Location.
15693
15694 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
15695
15696         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
15697         members also on the parent interfaces recursively.
15698
15699 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
15700
15701         * report.cs: Use new formats, since Gonzalo finished the missing
15702         bits. 
15703
15704         * expression.cs (Binary.ResolveOperator): added missing operator|
15705         operator& and operator^ for bool/bool.
15706
15707         * cs-parser.jay: CheckDef now takes a Location argument that is
15708         used to report errors more precisly (instead of reporting the end
15709         of a definition, we try to track something which is a lot closer
15710         to the source of the problem).
15711
15712         * cs-tokenizer.cs: Track global token use, so we can properly flag
15713         the use of #define/#undef after the first token has been seen.
15714
15715         Also, rename the reportXXXX to Error_DescriptiveName
15716
15717         * decl.cs (DeclSpace.IsTopLevel): Move property here from
15718         TypeContainer, so that Enum and Interface can use this too.
15719
15720         * class.cs (TypeContainer.LookupInterfaceOrClass,
15721         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
15722         `builder' argument.  Typically this was used to pass the parent
15723         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
15724         the definition).  
15725
15726         The problem is that a nested class could trigger the definition of
15727         a toplevel class, and the builder would be obviously wrong in that
15728         case. 
15729
15730         So we drop this argument, and we compute dynamically the
15731         TypeBuilder/ModuleBuilder (the correct information was available
15732         to us anyways from DeclSpace.Parent)
15733
15734         * interface.cs (Interface.DefineInterface): Drop builder
15735         parameter cleanup like class.cs
15736
15737         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
15738         like class.cs
15739
15740         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
15741         values. 
15742
15743         (Try.Emit): Propagate the returns value from the statement.
15744
15745         (Return.Emit): Even if we are leavning 
15746
15747         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
15748
15749         * modifiers.cs: Fix the computation of MethodAttributes flags.
15750
15751 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
15752
15753         * driver.cs: allow compilation of files that start with '/'.
15754         Add a default case when checking the argument of --target.
15755
15756 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
15757
15758         * interface.cs: Implement the same search algorithm for types in
15759         the interface code.
15760
15761         * delegate.cs: Do not allow multiple definition.
15762
15763         * Recovered ChangeLog that got accidentally amputated
15764
15765         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
15766
15767         * rootcontext.cs: Load manually enum to allow core classes to
15768         contain enumerations.
15769
15770         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
15771         Update to new static methods in TypeManager.
15772
15773         * typemanager.cs (GetMethod, GetConstructor): Use our
15774         implementation of FindMembers to find the members, since during
15775         corlib compilation, the types are TypeBuilders and GetMethod and
15776         GetConstructor do not work.
15777
15778         Make all methods in TypeManager static.
15779
15780         (InitCodeHelpers): Split the functionality from
15781         the InitCodeTypes function.
15782
15783         * driver.cs: Call InitCodeHelpers after we have populated the
15784         types. 
15785
15786         * cs-parser.jay (delegate_declaration): we did not used to compute
15787         the delegate name correctly for void delegates.
15788
15789 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
15790
15791         * rootcontext.cs (RootContext): Init the interface_resolve_order
15792         and type_container_resolve_order always.
15793
15794         (ResolveCore, BootstrapCorlib_ResolveClass,
15795         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
15796         compiler when compiling with --nostdlib
15797
15798         * class.cs (TypeContainer.DefineType): Check that our parent is
15799         not null.  This test is most important when we are bootstraping
15800         the core types.
15801
15802         * codegen.cs: Split out the symbol writing code.
15803
15804 2002-03-25  Martin Baulig  <martin@gnome.org>
15805
15806         * driver.cs (-g): Made -g an alias for --debug.
15807
15808 2002-03-24  Martin Baulig  <martin@gnome.org>
15809
15810         * codegen.cs (SymbolWriter): New public variable. Returns the
15811         current symbol writer.
15812         (CodeGen): Added `bool want_debugging_support' argument to the
15813          constructor. If true, tell the ModuleBuild that we want debugging
15814         support and ask it for the ISymbolWriter.
15815         (Save): If we have a symbol writer, call it's Close() method after
15816         saving the assembly.
15817
15818         * driver.c (--debug): New command line argument to create a
15819         debugger information file.
15820
15821         * location.cs (SymbolDocument): New public property. Returns an
15822         ISymbolDocumentWriter object for the current source file or null
15823         if we don't have a symbol writer.
15824
15825 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * driver.cs (LoadAssembly): Correctly return when all the paths
15828         have been tried and not before.
15829
15830         * statement.cs (Switch.Emit): return the actual coverage for this
15831         statement (returns/not-returns)
15832
15833         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
15834         switch of the statement if we are the last switch section.  That
15835         kills two problems: try/catch problems (we used to emit an empty
15836         nop at the end) and switch statements where all branches would
15837         return. 
15838
15839 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * driver.cs: Add default assemblies (the equivalent to the
15842         Microsoft CSC.RSP file)
15843
15844         * cs-tokenizer.cs: When updating `cols and setting it to zero,
15845         also update tokens_seen and set it to false.
15846
15847         * driver.cs: Implement --recurse for Mike.
15848
15849         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
15850         correctly splitting out the paths.
15851
15852 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
15853
15854         * interface.cs (Interface.PopulateProperty): Instead of using
15855         `parent' as the declaration space for the set parameters, use
15856         `this' 
15857
15858         * support.cs (InternalParameters): InternalParameters constructor
15859         takes a DeclSpace instead of a TypeContainer.
15860
15861         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
15862         types are being initialized, load the address of it before calling
15863         the function.  
15864
15865         (New): Provide a mechanism to disable the generation of local
15866         value type temporaries when the caller will be providing us with
15867         an address to store it.
15868
15869         (ArrayCreation.EmitDynamicInitializers): Use it.
15870
15871 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
15872
15873         * expression.cs (Invocation.EmitArguments): Only probe for array
15874         property if there is more than one argument.  Sorry about that.
15875
15876         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
15877         empty param arrays.
15878
15879         * class.cs (Method.LabelParameters): Fix incorrect code path that
15880         prevented the `ParamArrayAttribute' from being applied to the
15881         params attribute.
15882
15883 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
15884
15885         * support.cs (ReflectionParameters): Correctly compute whether the
15886         last argument is a params array.  Fixes the problem with
15887         string.Split ('a')
15888
15889         * typemanager.cs: Make the assemblies array always be non-null
15890         (empty, but non-null)
15891
15892         * tree.cs (RecordDecl): New function that abstracts the recording
15893         of names.  This reports error 101, and provides a pointer to the
15894         previous declaration.  Fixes a crash in the compiler.
15895
15896         * cs-parser.jay (constructor_declaration): Update to new grammar,
15897         and provide a constructor_body that can be empty.
15898
15899 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
15900
15901         * driver.cs: Add support for --resources.
15902
15903         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
15904         Make all types for the various array helper methods be integer.
15905
15906         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
15907         CheckState to ConvCast.
15908
15909         (ConvCast): Now it takes a `checked' state argument, to avoid
15910         depending on the emit context for the conversion, and just using
15911         the resolve time setting.
15912
15913         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
15914         instead of Invocation.EmitArguments.  We do not emit the original
15915         arguments, instead we emit those which have been converted to
15916         unsigned int expressions.
15917
15918         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
15919
15920         * codegen.cs: ditto.
15921
15922         * expression.cs (LocalVariableReference): Drop the use of the
15923         Store function that depended on the variable index.
15924
15925         * statement.cs (VariableInfo): Drop the `Idx' property from this
15926         class, as this is not taking into account the indexes for
15927         temporaries tat we generate during the execution, getting the
15928         indexes wrong.
15929
15930         * class.cs: First emit class initializers, then call the parent
15931         constructor. 
15932
15933         * expression.cs (Binary): Fix opcode emision.
15934         (UnaryMutator.EmitCode): Support checked code generation
15935
15936         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
15937         matches for events for both the Static and Instance scans,
15938         pointing to the same element.   Fix that.
15939
15940 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
15941
15942         * rootcontext.cs (ResolveTree): Always set the
15943         interface_resolve_order, because nested interfaces will be calling
15944         into us.
15945
15946         * class.cs (GetInterfaceOrClass): Track the same resolution
15947         process used by TypeManager.LookupType.  This fixes the nested
15948         type lookups in class declarations (separate path from
15949         LookupType). 
15950
15951         (TypeContainer.DefineType): Also define nested interfaces.
15952         (TypeContainer.RegisterOrder): New public function used to
15953         register the order in which child interfaces need to be closed.
15954
15955         Nested interfaces need to be closed after their parents have been
15956         created. 
15957
15958         * interface.cs (InterfaceAttr): Put all the logic for computing
15959         the interface attribute here. 
15960
15961         (DefineInterface): Register our interface order with the
15962         RootContext or with the TypeContainer depending on the case.
15963
15964 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15965
15966         * cs-parser.jay: rework foreach statement to work with the new
15967         changes to the policy on SimpleNames.
15968
15969         * report.cs: support Stacktrace on warnings as well.
15970
15971         * makefile: drop --unsafe and /unsafe from the compile.
15972
15973 2002-03-13  Ravi Pratap  <ravi@ximian.com>
15974
15975         * ecore.cs (StandardConversionExists): Modify to take an Expression
15976         as the first parameter. Ensure we do null -> reference type conversion
15977         checking.
15978
15979         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
15980         temporary Expression objects.
15981
15982 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
15983
15984         * interface.cs: workaround bug in method overloading resolution
15985         (there is already a bugzilla bug for it).
15986
15987 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
15988
15989         We could also solve this problem by having a separate path for
15990         performing type lookups, instead of DoResolve, we could have a
15991         ResolveType entry point, and only participating pieces of the
15992         production (simplename, deref, array) would implement this. 
15993
15994         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
15995         signal SimpleName to only resolve type names and not attempt to
15996         resolve anything else.
15997
15998         * expression.cs (Cast): Set the flag.
15999
16000         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
16001
16002         * class.cs: Only report 108 if there is no `new' modifier.
16003
16004         * cs-parser.jay: rework foreach statement to work with the new
16005         changes to the policy on SimpleNames.
16006         
16007         * report.cs: support Stacktrace on warnings as well.
16008
16009         * makefile: drop --unsafe and /unsafe from the compile.
16010
16011 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
16012
16013         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16014         lookups here, instead of doing that at parse time.  This means
16015         that our grammar will not introduce `LocalVariableReferences' as
16016         expressions at this point.  That solves the problem of code like
16017         this:
16018
16019         class X {
16020            static void Main ()
16021            { int X = 1;
16022             { X x = null }}}
16023
16024         This is only half the fix.  The full fix requires parameters to
16025         also be handled in this way.
16026
16027         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
16028         makes the use more obvious of the DeclSpace.  The
16029         ec.TypeContainer.TypeBuilder is now only used to pull the
16030         TypeBuilder for it.
16031
16032         My theory is that I can get rid of the TypeBuilder completely from
16033         the EmitContext, and have typecasts where it is used (from
16034         DeclSpace to where it matters).  
16035
16036         The only pending problem is that the code that implements Aliases
16037         is on TypeContainer, and probably should go in DeclSpace.
16038
16039         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
16040         lookups here, instead of doing that at parse time.  This means
16041         that our grammar will not introduce `LocalVariableReferences' as
16042         expressions at this point.  That solves the problem of code like
16043         this:
16044
16045         class X {
16046            static void Main ()
16047            { int X = 1;
16048             { X x = null }}}
16049
16050         This is only half the fix.  The full fix requires parameters to
16051         also be handled in this way.
16052
16053         * class.cs (Property.DefineMethod): When implementing an interface
16054         method, set newslot, when implementing an abstract method, do not
16055         set the flag (before we tried never setting it, or always setting
16056         it, which is the difference).
16057         (Indexer.DefineMethod): same.
16058         (Method.DefineMethod): same.
16059
16060         * ecore.cs: Only set the status used flag if we get back a Field.
16061
16062         * attribute.cs: Temporary hack, so Paolo can keep working.
16063
16064 2002-03-08  Ravi Pratap  <ravi@ximian.com>
16065
16066         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
16067         the unmanaged type in the case we have a MarshalAs attribute.
16068
16069         (Resolve): Handle the case when we are parsing the special MarshalAs
16070         attribute [we need to store the unmanaged type to use later]
16071
16072         * typemanager.cs (marshal_as_attr_type): Built in type for the 
16073         MarshalAs Attribute.
16074
16075         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
16076         on parameters and accordingly set the marshalling info.
16077
16078 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
16079
16080         * class.cs: Optimizing slightly by removing redundant code after
16081         we switched to the `NoTypes' return value.
16082         (Property.DefineMethod): use NoTypes here too.
16083
16084         This fixes the bug I introduced in my last batch of changes.
16085
16086 2002-03-05  Ravi Pratap  <ravi@ximian.com>
16087
16088         * tree.cs (RecordEnum): Add. We now keep track of enums too.
16089
16090         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
16091         Enums since those are types too. 
16092
16093         * cs-parser.jay (enum_declaration): Record enums as we parse them.
16094
16095         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
16096         thanks to a call during the lookup process.
16097
16098 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
16099
16100         * statement.cs (Foreach): Lots of work to accomodate a particular
16101         kind of foreach statement that I had not kept in mind.  It is
16102         possible to have foreachs on classes that provide a GetEnumerator
16103         method that return objects that implement the "pattern" for using
16104         a foreach, there is no need to support GetEnumerator
16105         specifically. 
16106
16107         This is needed to compile nant.
16108
16109         * decl.cs: Only report 114 if the member is not `Finalize' and if
16110         the warning level is at least 2.
16111
16112         * class.cs: Moved the compare function from Method to
16113         MethodSignature. 
16114
16115         (MethodSignature.InheritableMemberSignatureCompare): Add new
16116         filter function that is used to extract inheritable methods from a
16117         class. 
16118
16119         (Method.Define): Use the new `inheritable_method_signature_filter'
16120         delegate
16121
16122         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
16123         command. 
16124
16125 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
16126
16127         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
16128
16129         * cs-parser.jay: Add opt_semicolon to the interface declaration.
16130
16131         * expression.cs: Pass location information to
16132         ConvertImplicitStandard. 
16133
16134         * class.cs: Added debugging code to track return values from
16135         interfaces. 
16136
16137 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
16138
16139         * expression.cs (Is.DoResolve): If either side of the `is' is an
16140         interface, do not flag the warning.
16141
16142         * ecore.cs (ImplicitReferenceConversion): We need a separate test
16143         for interfaces
16144
16145         * report.cs: Allow for --fatal to be used with --probe.
16146
16147         * typemanager.cs (NoTypes): Move the definition for the empty Type
16148         array here. 
16149
16150         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
16151         properties. 
16152         (TypeContainer.DefineProxy): New function used to proxy to parent
16153         implementations when implementing interfaces.
16154         (TypeContainer.ParentImplements): used to lookup if our parent
16155         implements a public function that is required by an interface.
16156         (TypeContainer.VerifyPendingMethods): Hook this up.
16157
16158         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
16159         `modules' and `assemblies' arraylists into arrays.  We only grow
16160         these are the very early start up of the program, so this improves
16161         the speedof LookupType (nicely measured).
16162
16163         * expression.cs (MakeByteBlob): Replaced unsafe code with
16164         BitConverter, as suggested by Paolo.
16165
16166         * cfold.cs (ConstantFold.Binary): Special case: perform constant
16167         folding of string concatenation, but if either side is a string,
16168         and the other is not, then return null, and let the runtime use
16169         the concatenation on the string plus the object (using
16170         `Object.ToString'). 
16171
16172 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
16173
16174         Constant Folding has been implemented now.
16175
16176         * expression.cs (Unary.Reduce): Do not throw an exception, catch
16177         the error instead on types that are not supported in one's
16178         complement. 
16179
16180         * constant.cs (Constant and all children): New set of functions to
16181         perform implict and explicit conversions.
16182
16183         * ecore.cs (EnumConstant): Implement the new functions to perform
16184         conversion by proxying to the child expression.
16185
16186         * codegen.cs: (ConstantCheckState): Constant evaluation has its
16187         own separate setting that can not be turned off from the command
16188         line using --unchecked or --checked and is only controlled using
16189         the checked/unchecked statements and expressions.  This setting is
16190         used by the constant folder to flag errors.
16191
16192         * expression.cs (CheckedExpr, UncheckedExpr): Set the
16193         ConstantCheckState as well.   
16194
16195         During Resolve, they also have to flag the state, because the
16196         constant folder runs completely in the Resolve phase.
16197
16198         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
16199         well.
16200
16201 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16202
16203         * cfold.cs: New file, this file contains the constant folder.
16204
16205         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
16206         argument to track whether we are using the resulting address to
16207         load or store a value and provide better error messages. 
16208
16209         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
16210         new AddressOf arguments.
16211
16212         * statement.cs (Foreach.EmitCollectionForeach): Update
16213
16214         * expression.cs (Argument.Emit): Call AddressOf with proper
16215         arguments to track usage.
16216
16217         (New.DoEmit): Call AddressOf with new arguments.
16218
16219         (Unary.Emit): Adjust AddressOf call.
16220
16221 2002-03-01  Ravi Pratap  <ravi@ximian.com>
16222
16223         * cs-parser.jay (member_access): Change the case for pre-defined types
16224         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
16225         this suggestion.
16226
16227         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
16228         a method body.
16229
16230         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
16231         essentially like methods and apply attributes like MethodImplOptions to them too.
16232
16233         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
16234         not being null.
16235
16236         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
16237         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
16238         is the DeclSpace.
16239
16240         * Update code everywhere accordingly.
16241
16242         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
16243
16244         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
16245
16246 2002-02-28  Ravi Pratap  <ravi@ximian.com>
16247
16248         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
16249         try performing lookups against those instead of jumping straight into using
16250         the 'using' clauses.
16251
16252         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
16253
16254         (LookupType): Perform lookups in implicit parents too.
16255
16256         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
16257         sequence as RootContext.LookupType. 
16258
16259         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
16260         the various cases of namespace lookups into this method.
16261
16262 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
16263
16264         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
16265         in positional arguments)
16266
16267         * class.cs (Operator): Update the AllowedModifiers to contain
16268         extern. 
16269
16270         * cs-parser.jay: Update operator declaration to allow for the
16271         operator body to be empty.
16272
16273         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
16274         values. 
16275
16276 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
16277
16278         * class.cs (Method.Emit): Label parameters.
16279
16280         * driver.cs: Return 1 or 0 as the program exit code.
16281
16282 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * expression.cs: Special case the `null' object when trying to
16285         auto-compute the type, as anything can be explicitly converted to
16286         that. 
16287
16288         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
16289         spotting this Paolo.
16290
16291         (Expression.ImplicitNumericConversion): Perform comparissions of
16292         the type using the underlying type in the case of an enumeration
16293         rather than using the enumeration type for the compare.
16294
16295         Cope with the underlying == type case, which is not possible to
16296         catch before. 
16297
16298         (Expression.ConvertNumericExplicit): Perform comparissions of
16299         the type using the underlying type in the case of an enumeration
16300         rather than using the enumeration type for the compare.
16301
16302         * driver.cs: If the user does not supply an extension, assume .exe
16303
16304         * cs-parser.jay (if_statement): Rewrote so that we can track the
16305         location for the if statement.
16306
16307         * expression.cs (Binary.ConstantFold): Only concat strings when
16308         the operation is "+", not everything ;-)
16309
16310         * statement.cs (Statement.EmitBoolExpression): Take a location
16311         argument. 
16312         (If, While, Do): Track location.
16313
16314         * expression.cs (Binary.ResolveOperator): In the object + string
16315         case, I was missing a call to ConvertImplicit
16316
16317 2002-02-25  Ravi Pratap  <ravi@ximian.com>
16318
16319         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
16320         Location arguments. Ensure we use RootContext.LookupType to do our work
16321         and not try to do a direct Type.GetType and ModuleBuilder.GetType
16322
16323         * interface.cs (PopulateMethod): Handle the type of the parameter being
16324         null gracefully.
16325
16326         * expression.cs (Invocation.BetterFunction): Handle the case when we 
16327         have a params method with no fixed arguments and a call is made with no
16328         arguments.
16329
16330 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
16331
16332         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
16333         the verbatim-string-literal
16334
16335         * support.cs (InternalParameters.ParameterModifier): handle null
16336         fixed parameters.
16337         (InternalParameters.ParameterType): ditto.
16338
16339         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
16340         duplicating the name of the variable parameter.
16341         (GetParameterByName): Fix bug where we were not looking up array
16342         paramters if they were the only present (thanks Paolo!).
16343         (GetParameterInfo): We only have an empty set of types if both
16344         fixed and array are set to null.
16345         (GetParameterInfo-idx): Handle FixedParameter == null
16346
16347         * cs-parser.jay: Handle the case where there is no catch
16348         statements (missing null test).
16349
16350 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
16351
16352         * driver.cs (MainDriver): Be conservative on our command line
16353         handling.
16354
16355         Catch DirectoryNotFoundException when calling GetFiles.
16356
16357         (SplitPathAndPattern): Used to split the input specification into
16358         a path and a pattern that we can feed to Directory.GetFiles.
16359
16360 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * statement.cs (Fixed): Implement the last case of the Fixed
16363         statement (string handling).
16364
16365         * expression.cs (StringPtr): New class used to return a char * to
16366         a string;  Used by the Fixed statement.
16367
16368         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
16369
16370         * expression.cs (Binary.ResolveOperator): Remove redundant
16371         MemberLookup pn parent type.
16372         Optimize union call, we do not need a union if the types are the same.
16373         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
16374         type.
16375
16376         Specialize the use of MemberLookup everywhere, instead of using
16377         the default settings. 
16378
16379         (StackAlloc): Implement stackalloc keyword.
16380
16381         * cs-parser.jay: Add rule to parse stackalloc.
16382
16383         * driver.cs: Handle /h, /help, /?
16384
16385         * expression.cs (MakeByteBlob): Removed the hacks we had in place
16386         before we supported unsafe code.
16387
16388         * makefile: add --unsafe to the self compilation of mcs.
16389
16390 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
16391
16392         * expression.cs (PointerArithmetic): New class that is used to
16393         perform pointer arithmetic.
16394         (Binary.Resolve): Handle pointer arithmetic
16395         Handle pointer comparission.
16396         (ArrayPtr): Utility expression class that is used to take the
16397         address of an array.
16398
16399         (ElementAccess): Implement array access for pointers
16400
16401         * statement.cs (Fixed): Implement fixed statement for arrays, we
16402         are missing one more case before we are done.
16403
16404         * expression.cs (Indirection): Implement EmitAssign and set the
16405         ExprClass to Variable.  This allows pointer dereferences to be
16406         treated as variables, and to have values assigned to them.
16407
16408         * ecore.cs (Expression.StoreFromPtr): New utility function to
16409         store values dereferencing.
16410
16411 2002-02-20  Ravi Pratap  <ravi@ximian.com>
16412
16413         * expression.cs (Binary.ResolveOperator): Ensure that we are
16414         not trying to operate on a void type - this fixes the reported
16415         bug.
16416
16417         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
16418         the parent implementation is sealed.
16419
16420         * ../errors/cs0239.cs : Add.
16421
16422         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
16423
16424         * typemanager.cs (unverifiable_code_type): Corresponds to 
16425         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
16426         which have unsafe code in them.
16427
16428         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
16429         unsafe context.
16430
16431 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
16432
16433         * cs-tokenizer.cs: Add support for @"litreal strings"
16434
16435         Make tokenizer accept pre-processor directives
16436         on any column (remove the old C-like limitation). 
16437
16438         * rootcontext.cs (EmitCode): Emit any global attributes.
16439         (AddGlobalAttributes): Used to keep track of assembly attributes. 
16440
16441         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
16442
16443         * cs-parser.jay: Add support for global attributes.  
16444
16445 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
16446
16447         * expression.cs (Indirection): New helper class.  Unary will
16448         create Indirection classes to be able to implement the
16449         IMemoryLocation interface on it.
16450
16451 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
16452
16453         * cs-parser.jay (fixed_statement): reference the right statement.
16454
16455         * statement.cs (Fixed.Emit): Finish implementing the fixed
16456         statement for the &x case.
16457
16458 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
16459
16460         * class.cs (Property.Define, Method.Define): Remove newslot when
16461         `implementing'.  
16462
16463         * modifiers.cs: My use of NewSlot when `Abstract' was set was
16464         wrong.  NewSlot should only be used if the `new' keyword is present.
16465
16466         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
16467         locating our system dir.  Sorry about this.
16468
16469 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16470
16471         * driver.cs (GetSystemDir): Compute correctly the location of our
16472         system assemblies.  I was using the compiler directory instead of
16473         the library directory.
16474
16475 2002-02-13  Ravi Pratap  <ravi@ximian.com>
16476
16477         * expression.cs (BetterFunction): Put back in what Miguel commented out
16478         since it is the correct fix. The problem is elsewhere ;-)
16479
16480         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
16481         parameters of the parms method are themselves compatible or not !
16482
16483         (StandardConversionExists): Fix very dangerous bug where we were forgetting
16484         to check that a class implements an interface before saying that an implicit
16485         conversion was allowed. Use ImplementsInterface to do the checking.
16486
16487 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * class.cs (Method.Define): Track whether we are an explicit
16490         implementation or not.  And only call DefineMethodOverride if we
16491         are an explicit implementation.
16492
16493         (Property.DefineMethod): Ditto.
16494
16495 2002-02-11  Ravi Pratap  <ravi@ximian.com>
16496
16497         * expression.cs (BetterFunction): Catch hideous bug which was
16498          preventing us from detecting ambiguous calls due to implicit casts i.e
16499         cs0121.
16500
16501 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
16502
16503         * support.cs (Pair): Remove un-needed method.  I figured why I was
16504         getting the error in cs-parser.jay, the variable in a foreach loop
16505         is readonly, and the compiler does not really treat this as a variable.
16506
16507         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
16508         instead of EQUALS in grammar.  
16509
16510         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
16511
16512         * expression.cs (Unary.DoResolve): Check whether the argument is
16513         managed or not.
16514
16515 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
16516
16517         * support.cs: Api for Pair to set a value.  Despite the fact that
16518         the variables are public the MS C# compiler refuses to compile
16519         code that accesses the field if the variable is part of a foreach
16520         statement. 
16521
16522         * statement.cs (Fixed): Begin implementation of the fixed
16523         statement.
16524
16525         (Block.AddVariable): Return the VariableInfo on success and null
16526         on failure instead of true/false. 
16527
16528         * cs-parser.jay (foreach): Catch errors on variables already
16529         defined (we were ignoring this value before) and properly unwind
16530         the block hierarchy
16531
16532         (fixed_statement): grammar for the fixed statement.
16533
16534 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
16535
16536         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
16537         pointer types to be incretemented.
16538
16539         (SizeOf): Implement.
16540
16541         * cs-parser.jay (pointer_member_access): Implement
16542         expr->IDENTIFIER production.
16543
16544         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
16545         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
16546         on safe contexts.
16547
16548         (Unary): Implement indirection.
16549
16550         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
16551         use in non-unsafe context).
16552
16553         (SimpleName.DoResolve): Check for pointers in field access on safe
16554         contexts. 
16555
16556         (Expression.LoadFromPtr): Factor the load-indirect code in this
16557         function.  This was duplicated in UnboxCast and ParameterReference
16558
16559 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
16560
16561         * expression.cs (ComposedCast): report an error if a pointer cast
16562         is used in a safe region.
16563
16564         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
16565         pointer type casts in unsafe context.
16566
16567         * codegen.cs (EmitContext): Set up IsUnsafe.
16568
16569         * cs-parser.jay (non_expression_type): Add productions for pointer
16570         casts. 
16571
16572         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
16573         code.  We should not use force into static mode if the method is
16574         not virtual.  Fixes bug in MIS
16575
16576         * statement.cs (Do.Emit, While.Emit, For.Emit,
16577         Statement.EmitBoolExpression): Add support to Do and While to
16578         propagate infinite loop as `I do return' semantics.
16579
16580         Improve the For case to also test for boolean constants.
16581
16582         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
16583         to the list of attributes we can add.
16584
16585         Remove `EmitContext' argument.
16586
16587         * class.cs (Method.Define): Apply parameter attributes.
16588         (Constructor.Define): Apply parameter attributes.
16589         (MethodCore.LabelParameters): Move here the core of labeling
16590         parameters. 
16591
16592         * support.cs (ReflectionParameters.ParameterModifier,
16593         InternalParameters.ParameterModifier): Use IsByRef on the type and
16594         only return the OUT bit for these parameters instead of in/out/ref
16595         flags.
16596
16597         This is because I miss-understood things.  The ParameterInfo.IsIn
16598         and IsOut represent whether the parameter has the [In] and [Out]
16599         attributes set.  
16600
16601 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
16602
16603         * ecore.cs (FieldExpr.Emit): Release temporaries.
16604
16605         * assign.cs (LocalTemporary.Release): new function.
16606
16607         * codegen.cs (EmitContext.GetTemporaryStorage,
16608         EmitContext.FreeTemporaryStorage): Rework the way we deal with
16609         temporary storage.  Now we can "put back" localbuilders when we
16610         are done with them
16611
16612 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
16613
16614         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
16615         need to make a copy of the variable to generate verifiable code.
16616
16617 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
16618
16619         * driver.cs: Compute dynamically the system directory.
16620
16621         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
16622         Slower, but more generally useful.  Used by the abstract
16623         registering implementation. 
16624
16625         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
16626         the rules for the special rule on Type/instances.  First check if
16627         we have the same name, and if so, try that special static path
16628         rather than the instance path.
16629
16630 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
16631
16632         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
16633         for, while and if.
16634
16635         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
16636         Enum, ValueType, Delegate or Array for non-corlib compiles.
16637
16638         * cs-tokenizer.cs: Catch long identifiers (645)
16639
16640         * typemanager.cs (IndexerPropetyName): Ravi never tested this
16641         piece of code.
16642
16643         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
16644         fix, we were returning too early, so we were not registering
16645         pending methods from abstract classes.
16646
16647         Do not register pending methods if the class is abstract.
16648
16649         * expression.cs (Conditional.DoResolve): Report circular implicit
16650         conversions when we neecd to compute it for conditional
16651         expressions. 
16652
16653         (Is.DoResolve): If the expression is always of the provided type,
16654         flag warning 183.  If the expression can not ever be of the
16655         provided type flag warning 184.
16656
16657         * class.cs: Catch 169 as well.
16658
16659         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
16660         read. 
16661
16662 2002-01-18  Nick Drochak  <ndrochak@gol.com>
16663
16664         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
16665
16666 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
16667
16668         * interface.cs: (PopulateMethod): Check for pointers being defined
16669         only if the unsafe context is active.
16670         (PopulateProperty): ditto.
16671         (PopulateIndexer): ditto.
16672
16673         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
16674         specified.  If pointers are present, make sure that they are
16675         present in an unsafe context.
16676         (Constructor, Constructor.Define): ditto.
16677         (Field, Field.Define): ditto.
16678         (Property, Property.Define): ditto.
16679         (Event, Event.Define): ditto.
16680
16681         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
16682         hashtable if there are classes or structs defined.
16683
16684         * expression.cs (LocalVariableReference.DoResolve): Simplify this
16685         code, as the constant resolution moved.
16686
16687         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
16688         the metadata, so we can flag error 133. 
16689
16690         * decl.cs (MemberCore.UnsafeOK): New function to test that a
16691         pointer is being declared in an unsafe context.
16692
16693 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
16694
16695         * modifiers.cs (Modifiers.Check): Require a Location argument.
16696         Report error 227 for Unsafe use.
16697
16698         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
16699
16700         * statement.cs (For.Emit): If the test is null, then report that
16701         we do `return', as we wont reach anything afterwards.
16702
16703         (Switch.SwitchGoverningType): Track the expression that matched
16704         the conversion.
16705
16706         * driver.cs: Allow negative numbers as an error code to flag.
16707
16708         * cs-parser.jay: Handle 1551.
16709
16710         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
16711
16712 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16713
16714         * cs-parser.jay: Report 1518 (type declaration can only contain
16715         class, struct, interface, enum or delegate)
16716
16717         (switch_label): Report 1523 (keywords `case' or `default' must
16718         preced code)
16719
16720         (opt_switch_sections): Report 1522 (empty switch)
16721
16722         * driver.cs: Report 1515 (response file specified multiple times)
16723         Report 1516 (Source file specified multiple times).
16724
16725         * expression.cs (Argument.Resolve): Signal 1510
16726
16727         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
16728         access not allowed in static code)
16729
16730 2002-01-11  Ravi Pratap  <ravi@ximian.com>
16731
16732         * typemanager.cs (IsPointerType): Utility method which we are going
16733         to need a lot.
16734
16735         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
16736         the object type, so we take care of that.
16737
16738         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
16739
16740         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
16741         added to non-params parameters :-)
16742
16743         * typemanager.cs (CSharpName): Include 'void' type too. 
16744
16745         (void_ptr_type): Include in the set of core types.
16746
16747         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
16748         duplicating code.
16749
16750         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
16751         an unsafe context.
16752
16753         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
16754         completely forgotten about it.
16755
16756 2002-01-10  Ravi Pratap  <ravi@ximian.com>
16757
16758         * cs-parser.jay (pointer_type): Add. This begins our implementation
16759         of parsing rules for unsafe code.
16760
16761         (unsafe_statement): Implement.
16762
16763         (embedded_statement): Modify to include the above.
16764
16765         * statement.cs (Unsafe): Implement new class for unsafe blocks.
16766
16767         * codegen.cs (EmitContext.InUnsafe): Add. This determines
16768         if the current context is an unsafe one.
16769
16770         * cs-parser.jay (local_variable_pointer_type): Since local variable types
16771         are handled differently, we need separate rules for them.
16772
16773         (local_variable_declaration): Update to use local_variable_pointer_type
16774         to allow variable declarations of unmanaged pointer types.
16775
16776         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
16777         in unsafe contexts.
16778
16779         * ../errors/cs0214.cs : Add.
16780
16781 2002-01-16  Nick Drochak  <ndrochak@gol.com>
16782
16783         * makefile: remove 'response' file when cleaning.
16784
16785 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
16786
16787         * cs-parser.jay: Report 1524.
16788
16789 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
16790
16791         * typemanager.cs (RegisterMethod): drop checking if we have
16792         registered this from here
16793
16794 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
16795
16796         * class.cs (Method.EmitDestructor): Implement calling our base
16797         destructor. 
16798
16799         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
16800         value of InFinally.
16801
16802         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
16803         this routine and will wrap the call in a try/catch block.  Deal
16804         with the case.
16805
16806 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
16807
16808         * ecore.cs (Expression.MemberLookup): instead of taking a
16809         parameter `same_type' that was used to tell whether we could
16810         access private members we compute our containing type from the
16811         EmitContext.
16812
16813         (FieldExpr): Added partial support for volatile fields.  This does
16814         not work for volatile fields exposed from assemblies, as I can not
16815         figure out how to extract the modreq from it.
16816
16817         Updated all the source files to use this.
16818
16819         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
16820         because it is referenced by MemberLookup very often. 
16821
16822 2002-01-09  Ravi Pratap  <ravi@ximian.com>
16823
16824         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
16825         TypeBuilder.GetCustomAttributes to retrieve what we need.
16826
16827         Get rid of redundant default_member_attr_type as this is the same as
16828         default_member_type which already exists.
16829
16830         * interface.cs, attribute.cs : Update accordingly.
16831
16832 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
16833
16834         * typemanager.cs: Enable IndexerPropertyName again.  It does not
16835         work for TYpeBuilders though.  Ravi, can you please fix this?
16836
16837         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
16838
16839         * expression.cs (Argument.Emit): Handle the case of ref objects
16840         being passed to ref functions;  
16841
16842         (ParameterReference.EmitLoad): Loads the content of the pointer
16843         without dereferencing.
16844
16845 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16846
16847         * cs-tokenizer.cs: Implemented the pre-processing expressions.
16848
16849 2002-01-08  Ravi Pratap  <ravi@ximian.com>
16850
16851         * class.cs (Indexer.DefineMethod): Incorporate the interface
16852         type in the name of the method if we are doing explicit interface
16853         implementation.
16854
16855         * expression.cs (ConversionExists): Remove as it is completely obsolete.
16856
16857         (BetterConversion): Fix extremely trivial bug where we were referring to
16858         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
16859         again !
16860
16861         * ../errors/bug16.cs : Add although we have fixed it.
16862
16863 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
16864
16865         * expression.cs (BaseIndexer): Begin implementation.
16866
16867         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
16868
16869         * cs-parser.jay (indexer_declarator): Use qualified_identifier
16870         production directly to remove a shift/reduce, and implement
16871         explicit interface implementation.
16872
16873         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
16874         after a floating point suffix.
16875
16876         * expression.cs (DoNumericPromotions): Improved the conversion for
16877         uint/uint.  If we have a constant, we avoid doing a typecast to a
16878         larger type.
16879
16880         * class.cs (Indexer): Implement explicit interface implementation
16881         for indexers.
16882
16883 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
16884
16885         * class.cs: make the default instance constructor public and hidebysig.
16886
16887 2001-01-03  Ravi Pratap  <ravi@ximian.com>
16888
16889         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
16890         so we can call it from elsewhere.
16891
16892         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
16893         we emit it internally if the class has a defined indexer; otherwise the user
16894         emits it by decorating the class definition with the DefaultMemberAttribute.
16895
16896         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
16897         attribute is not used on a type which defines an indexer.
16898
16899         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
16900         character when we skip whitespace.
16901
16902         * ../errors/cs0646.cs : Add.
16903
16904 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
16905
16906         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
16907         again. 
16908
16909         * makefile: Add practical target `mcs3.exe' which builds the third
16910         generation compiler. 
16911
16912         * expression.cs (New): Fix structures constructor calling.
16913
16914         * class.cs (Property, Method, Indexer): Emit Final flag on the
16915         method if we are an interface implementation and we are not
16916         abstract. 
16917
16918         * ecore.cs (PropertyExpr): New public field `IsBase', tells
16919         whether this property is referencing a `base' method.
16920
16921         * expression.cs (Invocation.EmitCall): take an extra argument:
16922         is_base, this is used to determine whether the `call' or
16923         `callvirt' opcode should be used.
16924
16925
16926         * delegate.cs: update EmitCall.
16927
16928         * class.cs (Method.Define): Set NewSlot for the cases where we are
16929         not implementing an interface method.
16930
16931         (Property.Define): ditto.
16932
16933 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
16934
16935         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
16936         'r'.  Allows mcs to parse itself fully.
16937
16938 2002-01-02  Ravi Pratap  <ravi@ximian.com>
16939
16940         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
16941         of the number of initializers that require the InitializeArray method.
16942
16943         (CheckIndices): Store the Expression in all cases - not the plain value. Also
16944         update the above field where necessary.
16945
16946         (MakeByteBlob): Update accordingly.
16947
16948         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
16949         greater than 2.
16950
16951         (EmitDynamicInitializers): Update in accordance with the new optimization.
16952
16953         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
16954         same OpCode applies.
16955
16956         * cs-parser.jay : Fix some glaring errors I introduced.
16957
16958 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
16959
16960         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
16961         so that we can check for name clashes there too.
16962
16963         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
16964         for interface indexers.
16965
16966         * interfaces.cs (Define): Emit the default member attribute.
16967
16968         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
16969         variable was being referred to while setting the value ;-)
16970
16971 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
16972
16973         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
16974         byte-by-byte information when we know the data is zero.
16975
16976         Make the block always a multiple of 4, because
16977         DefineInitializedData has a bug.
16978
16979         * assign.cs: Fix, we should assign from the temporary, not from
16980         the source. 
16981
16982         * expression.cs (MakeByteBlob): Fix my incorrect code.
16983
16984 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
16985
16986         * typemanager.cs (EnumToUnderlying): This function is used to get
16987         the underlying type from an enumeration, because it does not
16988         always work. 
16989
16990         * constant.cs: Use the I4_S form for values between -128 and 127.
16991
16992         * statement.cs (Block.LookupLabel): Looks up a label.
16993         (Block): Drop support for labeled blocks.
16994
16995         (LabeledStatement): New kind of statement that represents a label
16996         only.
16997
16998         (Goto): Finally implement this bad boy.
16999
17000         * cs-parser.jay: Update to reflect new mechanism to implement
17001         labels.
17002
17003 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
17004
17005         * codegen.cs (EmitContext.This): a codegen property that keeps the
17006         a single instance of this instead of creating many different this
17007         instances. 
17008
17009         * delegate.cs (Delegate.DoResolve): Update to use the property;
17010
17011         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
17012
17013         * expression.cs (BaseAccess.DoResolve): Ditto.
17014
17015 2001-12-29  Ravi Pratap  <ravi@ximian.com>
17016
17017         * typemanager.cs (methodimpl_attr_type): Add to hold the type
17018         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
17019
17020         (InitCoreTypes): Update accordingly.
17021
17022         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
17023         so we can quickly store the state.
17024
17025         (ApplyAttributes): Set the correct implementation flags
17026         for InternalCall methods.
17027
17028 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
17029
17030         * expression.cs (EmitCall): if a method is not virtual, then do
17031         not use callvirt on it.
17032
17033         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
17034         user defined stuff) requires the use of stobj, which takes an
17035         address on the stack instead of an array and an index.  So emit
17036         the Ldelema operation for it.
17037
17038         (EmitStoreOpcode): Use stobj for valuetypes.
17039
17040         (UnaryMutator.EmitCode): Use the right 1 value depending on
17041         whether we are dealing with int64/uint64, float or doubles.
17042
17043         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
17044         constructors that I implemented last night.
17045
17046         (Constructor.IsDefault): Fix to work properly for static
17047         constructors.
17048
17049         * cs-parser.jay (CheckDef): report method signature errors.
17050         Update error number 103 to be 132.
17051
17052         * decl.cs: New AdditionResult enumeration value: MethodExists.
17053         Although we do this check for methods later on in the semantic
17054         analysis, catching repeated default constructors is so easy that
17055         we catch these here. 
17056
17057         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
17058         promotions code.
17059
17060         (ParameterReference.EmitAssign, Emit): handle
17061         bools as bytes.
17062
17063         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
17064         (ArrayAccess.EmitStoreOpcode): ditto.
17065
17066         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
17067
17068         * expression.cs (MakeByteBlob): Complete all the missing types
17069         (uint, short, ushort, byte, sbyte)
17070
17071         * class.cs: Only init instance field initializers on instance
17072         constructors. 
17073
17074         Rename `constructors' to instance_constructors. 
17075
17076         (TypeContainer.AddConstructor): Only add constructors to the list
17077         if it is not static.
17078
17079         Make sure that we handle default_static_constructor independently
17080         everywhere where we handle instance_constructors
17081
17082 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
17083
17084         * class.cs: Do not lookup or create a base initializer for a
17085         static constructor.
17086
17087         (ConstructorInitializer.Resolve): use the proper type to lookup
17088         for constructors.
17089
17090         * cs-parser.jay: Report error 1585 (modifiers between type and name).
17091
17092         * enum.cs, interface.cs: Remove CloseType, this is taken care by
17093         in DeclSpace. 
17094
17095         * decl.cs: CloseType is now an virtual method, the default
17096         implementation just closes this type.
17097
17098 2001-12-28  Ravi Pratap  <ravi@ximian.com>
17099
17100         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
17101         to PreserveSig by default. Also emit HideBySig on such methods.
17102
17103         Basically, set the defaults to standard values.
17104
17105         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
17106         argument, if candidate is better, it can't be worse than the best !
17107
17108         (Invocation): Re-write bits to differentiate between methods being
17109         applicable in their expanded form and their normal form - for params
17110         methods of course.
17111
17112         Get rid of use_standard everywhere as only standard conversions are allowed
17113         in overload resolution. 
17114
17115         More spec conformance.
17116
17117 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17118
17119         * driver.cs: Add --timestamp, to see where the compiler spends
17120         most of its time.
17121
17122         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
17123         `this' in static code.
17124
17125         (SimpleName.DoResolve): Implement in terms of a helper function
17126         that allows static-references to be passed upstream to
17127         MemberAccess.
17128
17129         (Expression.ResolveWithSimpleName): Resolve specially simple
17130         names when called by MemberAccess to implement the special
17131         semantics. 
17132
17133         (Expression.ImplicitReferenceConversion): Handle conversions from
17134         Null to reference types before others, as Null's type is
17135         System.Object. 
17136
17137         * expression.cs (Invocation.EmitCall): Handle the special case of
17138         calling methods declared on a reference type from a ValueType
17139         (Base classes System.Object and System.Enum)
17140
17141         (MemberAccess.Resolve): Only perform lookups on Enumerations if
17142         the left hand side is a TypeExpr, not on every enumeration. 
17143
17144         (Binary.Resolve): If types are reference types, then do a cast to
17145         object on operators != and == of both arguments.
17146
17147         * typemanager.cs (FindMembers): Extract instance and static
17148         members if requested.
17149
17150         * interface.cs (PopulateProperty): Use void_type instead of null
17151         as the return type for the setter method.
17152
17153         (PopulateIndexer): ditto.
17154
17155 2001-12-27  Ravi Pratap  <ravi@ximian.com>
17156
17157         * support.cs (ReflectionParameters): Fix minor bug where we
17158         were examining the wrong parameter for the ParamArray attribute.
17159
17160         Cope with requests for the type of the parameter at position
17161         greater than the params parameter's. We now return the element
17162         type of the params array as that makes more sense.
17163
17164         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
17165         accordingly as we no longer have to extract the element type
17166         ourselves.
17167
17168         (Invocation.OverloadResolve): Update.
17169
17170 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
17171
17172         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
17173         against IEnumerator, test whether the return value is a descendant
17174         of the IEnumerator interface.
17175
17176         * class.cs (Indexer.Define): Use an auxiliary method to implement
17177         the other bits of the method definition.  Begin support for
17178         explicit interface implementation.
17179
17180         (Property.DefineMethod): Use TypeManager.void_type instead of null
17181         for an empty return value.
17182
17183 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
17184
17185         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
17186         dealing with a FieldExpr which is composed of a FieldBuilder, in
17187         the code path we did extract the constant, but we should have
17188         obtained the underlying value to be able to cast it (otherwise we
17189         end up in an infinite loop, this is what Ravi was running into).
17190
17191         (ArrayCreation.UpdateIndices): Arrays might be empty.
17192
17193         (MemberAccess.ResolveMemberAccess): Add support for section
17194         14.5.4.1 that deals with the special case of E.I when E is a type
17195         and something else, that I can be a reference to a static member.
17196
17197         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
17198         handle a particular array type to create byte blobs, it is just
17199         something we dont generate byteblobs for.
17200
17201         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
17202         arguments. 
17203
17204         * location.cs (Push): remove the key from the hashtable that we
17205         are about to add.   This happens for empty files.
17206
17207         * driver.cs: Dispose files after we have parsed them.
17208
17209         (tokenize): new function that only runs the tokenizer on its
17210         input, for speed testing.
17211
17212 2001-12-26  Ravi Pratap  <ravi@ximian.com>
17213
17214         * class.cs (Event.Define): Define the private field only if there
17215         are no accessors defined.
17216
17217         * expression.cs (ResolveMemberAccess): If there is no associated
17218         field with the event, that means we have an event defined with its
17219         own accessors and we should flag error cs0070 since transforming
17220         ourselves into a field is not valid in that case.
17221
17222         * ecore.cs (SimpleName.DoResolve): Same as above.
17223
17224         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
17225         and charset to sane values.
17226
17227 2001-12-25  Ravi Pratap  <ravi@ximian.com>
17228
17229         * assign.cs (DoResolve): Perform check on events only if they 
17230         are being accessed outside the declaring type.
17231
17232         * cs-parser.jay (event_declarations): Update rules to correctly
17233         set the type of the implicit parameter etc.
17234
17235         (add_accessor, remove_accessor): Set current local parameters.
17236
17237         * expression.cs (Binary): For delegate addition and subtraction,
17238         cast the return value from the method into the appropriate delegate
17239         type.
17240
17241 2001-12-24  Ravi Pratap  <ravi@ximian.com>
17242
17243         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
17244         of these as the workaround is unnecessary.
17245
17246         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
17247         delegate data - none of that is needed at all.
17248
17249         Re-write bits to extract the instance expression and the delegate method
17250         correctly.
17251
17252         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
17253         on delegates too.
17254
17255         * attribute.cs (ApplyAttributes): New method to take care of common tasks
17256         of attaching attributes instead of duplicating code everywhere.
17257
17258         * everywhere : Update code to do attribute emission using the above method.
17259
17260 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17261
17262         * expression.cs (IsParamsMethodApplicable): if there are not
17263         parameters, return immediately.
17264
17265         * ecore.cs: The 0 literal can be implicity converted to an enum
17266         type. 
17267
17268         (SimpleName.DoResolve): First lookup the type, then lookup the
17269         members. 
17270
17271         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
17272         want to get its address.  If the InstanceExpression is not
17273         addressable, store the result in a temporary variable, then get
17274         the address of it.
17275
17276         * codegen.cs: Only display 219 errors on warning level or above. 
17277
17278         * expression.cs (ArrayAccess): Make it implement the
17279         IMemoryLocation interface.
17280
17281         (Binary.DoResolve): handle the operator == (object a, object b)
17282         and operator != (object a, object b) without incurring into a
17283         BoxedCast (because 5 != o should never be performed).
17284
17285         Handle binary enumerator operators.
17286
17287         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
17288         value type, otherwise use Ldelem_ref.
17289
17290         Use precomputed names;
17291
17292         (AddressOf): Implement address of
17293
17294         * cs-parser.jay (labeled_statement): Fix recursive block
17295         addition by reworking the production.
17296
17297         * expression.cs (New.DoEmit): New has a special case:
17298                 
17299                  If we are dealing with a ValueType, we have a few
17300                  situations to deal with:
17301                 
17302                     * The target of New is a ValueType variable, that is
17303                       easy, we just pass this as the variable reference
17304                 
17305                     * The target of New is being passed as an argument,
17306                       to a boxing operation or a function that takes a
17307                       ValueType.
17308                 
17309                       In this case, we need to create a temporary variable
17310                       that is the argument of New.
17311
17312
17313 2001-12-23  Ravi Pratap  <ravi@ximian.com>
17314
17315         * rootcontext.cs (LookupType): Check that current_type is not null before
17316         going about looking at nested types.
17317
17318         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
17319         not implement the IAssignMethod interface any more.
17320
17321         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
17322         where we tranform them into FieldExprs if they are being resolved from within
17323         the declaring type.
17324
17325         * ecore.cs (SimpleName.DoResolve): Do the same here.
17326
17327         * assign.cs (DoResolve, Emit): Clean up code considerably. 
17328
17329         * ../errors/bug10.cs : Add.
17330
17331         * ../errors/cs0070.cs : Add.
17332
17333         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
17334
17335         * assign.cs : Get rid of EventIsLocal everywhere.
17336
17337 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
17338
17339         * ecore.cs (ConvertIntLiteral): finished the implementation.
17340
17341         * statement.cs (SwitchLabel): Convert the value we are using as a
17342         key before looking up the table.
17343
17344 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17345
17346         * codegen.cs (EmitTopBlock): Require a Location argument now.
17347
17348         * cs-parser.jay (constructor_declarator): We need to setup
17349         current_local_parameters before we parse the
17350         opt_constructor_initializer, to allow the variables to be bound
17351         to the constructor arguments.
17352
17353         * rootcontext.cs (LookupType): First lookup nested classes in our
17354         class and our parents before we go looking outside our class.
17355
17356         * expression.cs (ConstantFold): Extract/debox the values at the
17357         beginnning. 
17358
17359         * rootcontext.cs (EmitCode): Resolve the constants first before we
17360         resolve the types.  This is not really needed, but it helps debugging.
17361
17362         * statement.cs: report location.
17363
17364         * cs-parser.jay: pass location to throw statement.
17365
17366         * driver.cs: Small bug fix.
17367
17368         * report.cs: Updated format to be 4-zero filled digits.
17369
17370 2001-12-22  Ravi Pratap  <ravi@ximian.com>
17371
17372         * expression.cs (CheckIndices): Fix minor bug where the wrong
17373         variable was being referred to ;-)
17374
17375         (DoEmit): Do not call EmitStaticInitializers when the 
17376         underlying type is System.Object.
17377
17378 2001-12-21  Ravi Pratap  <ravi@ximian.com>
17379
17380         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
17381         and do the usual workaround for SRE.
17382
17383         * class.cs (MyEventBuilder.EventType): New member to get at the type
17384         of the event, quickly.
17385
17386         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
17387
17388         * assign.cs (Assign.DoResolve): Handle the case when the target
17389         is an EventExpr and perform the necessary checks.
17390
17391         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
17392         interface.
17393
17394         (SimpleName.MemberStaticCheck): Include check for EventExpr.
17395
17396         (EventExpr): Set the type in the constructor itself since we 
17397         are meant to be born fully resolved.
17398
17399         (EventExpr.Define): Revert code I wrote earlier.
17400                 
17401         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
17402         instance expression is null. The instance expression is a This in that case
17403         or a null, depending on whether it is a static method or not.
17404
17405         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
17406         refers to more than one method.
17407
17408         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
17409         and accordingly flag errors.
17410
17411 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17412
17413         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
17414
17415 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
17416
17417         * location.cs (ToString): Provide useful rutine.
17418
17419 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
17420
17421         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
17422         objects, return the actual integral boxed.
17423
17424         * statement.cs (SwitchLabel): define an ILLabel for each
17425         SwitchLabel. 
17426
17427         (Switch.CheckSwitch): If the value is a Literal, extract
17428         the underlying literal.
17429
17430         Also in the unused hashtable we had, add the SwitchLabel so we can
17431         quickly look this value up.
17432
17433         * constant.cs: Implement a bunch of new constants.  Rewrite
17434         Literal based on this.  Made changes everywhere to adapt to this.
17435
17436         * expression.cs (Expression.MakeByteBlob): Optimize routine by
17437         dereferencing array only once, and also copes with enumrations.
17438
17439         bytes are two bytes wide, not one.
17440
17441         (Cast): Perform constant conversions.
17442
17443         * ecore.cs (TryImplicitIntConversion): Return literals instead of
17444         wrappers to the literals here.
17445
17446         * expression.cs (DoNumericPromotions): long literals can converted
17447         to ulong implicity (this is taken care of elsewhere, but I was
17448         missing this spot).
17449
17450         * ecore.cs (Expression.Literalize): Make the return type Literal,
17451         to improve type checking.
17452
17453         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
17454
17455 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17456
17457         * literal.cs: Revert code from ravi that checked the bounds.  The
17458         bounds are sane by the definition of the type itself. 
17459
17460         * typemanager.cs: Fix implementation of ImplementsInterface.  We
17461         need to actually look up in our parent hierarchy for interfaces
17462         implemented. 
17463
17464         * const.cs: Use the underlying type for enumerations
17465
17466         * delegate.cs: Compute the basename for the delegate creation,
17467         that should fix the delegate test case, and restore the correct
17468         Type Lookup semantics in rootcontext
17469
17470         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
17471         referencing a nested type with the Reflection API is using the "+"
17472         sign. 
17473
17474         * cs-parser.jay: Do not require EOF token at the end.
17475
17476 2001-12-20  Ravi Pratap  <ravi@ximian.com>
17477
17478         * rootcontext.cs (LookupType): Concatenate type names with
17479         a '.' instead of a '+' The test suite passes again.
17480
17481         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
17482         field of the enumeration.
17483
17484         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
17485         the case when the member is an EventExpr.
17486
17487         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
17488         static has an associated instance expression.
17489
17490         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
17491
17492         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
17493
17494         * class.cs (Event.Define): Register event and perform appropriate checks
17495         for error #111.
17496
17497         We define the Add and Remove methods even if the use provides none because
17498         in that case, we provide default implementations ourselves.
17499
17500         Define a private field of the type of the event. This is done by the CSC compiler
17501         and we should be doing it too ;-)
17502
17503         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
17504         More methods we use in code we generate.
17505
17506         (multicast_delegate_type, delegate_type): Two separate types since the distinction
17507         is important.
17508
17509         (InitCoreTypes): Update accordingly for the above.
17510
17511         * class.cs (Event.Emit): Generate code for default accessors that we provide
17512
17513         (EmitDefaultMethod): Do the job in the above.
17514
17515         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
17516         appropriate place.
17517
17518 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
17519
17520         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
17521         builders even if we were missing one.
17522
17523         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
17524         pass the Basename as our class name instead of the Name.  The
17525         basename will be correctly composed for us.
17526
17527         * parameter.cs (Paramters): Now takes a Location argument.
17528
17529         * decl.cs (DeclSpace.LookupType): Removed convenience function and
17530         make all the code call directly LookupType in RootContext and take
17531         this chance to pass the Location information everywhere.
17532
17533         * Everywhere: pass Location information.
17534
17535 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
17536
17537         * class.cs (Constructor.Define): Updated way of detecting the
17538         length of the parameters.
17539
17540         (TypeContainer.DefineType): Use basename as the type name for
17541         nested types.
17542
17543         (TypeContainer.Define): Do not recursively define types here, as
17544         definition is taken care in order by the RootContext.
17545
17546         * tree.cs: Keep track of namespaces in a per-file basis.
17547
17548         * parameter.cs (Parameter.ComputeSignature): Update to use
17549         DeclSpace. 
17550
17551         (Parameters.GetSignature): ditto.
17552
17553         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
17554         instead of a TypeContainer.
17555
17556         (Interface.SemanticAnalysis): Use `this' instead of our parent to
17557         resolve names.  Because we need to be resolve in our context, not
17558         our parents.
17559
17560         * driver.cs: Implement response files.
17561
17562         * class.cs (TypeContainer.DefineType): If we are defined, do not
17563         redefine ourselves.
17564
17565         (Event.Emit): Emit the code for add/remove handlers.
17566         (Event.Define): Save the MethodBuilders for add/remove.
17567
17568         * typemanager.cs: Use pair here too.
17569
17570         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
17571         DictionaryEntry requires the first argument to be non-null.  
17572
17573         (enum_declaration): Compute full name for registering the
17574         enumeration.
17575
17576         (delegate_declaration): Instead of using
17577         formal_parameter_list, use opt_formal_parameter_list as the list
17578         can be empty.
17579
17580         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
17581         (EventParsing): New property that controls whether `add' and
17582         `remove' are returned as tokens or identifiers (for events);
17583
17584 2001-12-19  Ravi Pratap  <ravi@ximian.com>
17585
17586         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
17587         use MyEventBuilder only and let it wrap the real builder for us.
17588
17589         (MyEventBuilder): Revamp constructor etc.
17590
17591         Implement all operations that we perform on EventBuilder in precisely the same
17592         way here too.
17593
17594         (FindMembers): Update to use the EventBuilder member.
17595
17596         (Event.Emit): Update accordingly.
17597
17598 2001-12-18  Ravi Pratap  <ravi@ximian.com>
17599
17600         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
17601         by calling the appropriate methods.
17602
17603         (GetCustomAttributes): Make stubs as they cannot possibly do anything
17604         useful.
17605
17606         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
17607
17608 2001-12-17  Ravi Pratap  <ravi@ximian.com>
17609
17610         * delegate.cs (Delegate.Populate): Check that the return type
17611         and various parameters types are indeed accessible.
17612
17613         * class.cs (Constructor.Define): Same here.
17614
17615         (Field.Define): Ditto.
17616
17617         (Event.Define): Ditto.
17618
17619         (Operator.Define): Check that the underlying Method defined itself
17620         correctly - so it's MethodBuilder should not be null.
17621
17622         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
17623         expression happens to be null.
17624
17625         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
17626         members but as of now we don't seem to be able to do anything really useful with it.
17627
17628         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
17629         not the EventBuilder.
17630
17631 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
17632
17633         * cs-tokenizer.cs: Add support for defines.
17634         Add support for #if, #elif, #else, #endif
17635
17636         (eval_var): evaluates a variable.
17637         (eval): stubbed for evaluating functions.
17638
17639         * cs-parser.jay: Pass the defines information
17640
17641         * driver.cs: Add --define command line option.
17642
17643         * decl.cs: Move MemberCore here.
17644
17645         Make it the base class for DeclSpace.  This allows us to catch and
17646         report 108 and 109 for everything now.
17647
17648         * class.cs (TypeContainer.Define): Extract all the members
17649         before populating and emit the warning 108 (new keyword required
17650         to override) instead of having each member implement this.
17651
17652         (MemberCore.Define): New abstract method, we will be using this in
17653         the warning reporting engine in Populate.
17654
17655         (Operator.Define): Adjust to new MemberCore protocol. 
17656
17657         * const.cs (Const): This does not derive from Expression, it is a
17658         temporary object we use to create fields, it is a MemberCore. 
17659
17660         * class.cs (Method.Define): Allow the entry point to be in a
17661         specific class.
17662
17663         * driver.cs: Rewrite the argument handler to clean it up a bit.
17664
17665         * rootcontext.cs: Made it just an auxiliary namespace feature by
17666         making everything static.
17667
17668         * driver.cs: Adapt code to use RootContext type name instead of
17669         instance variable.
17670
17671         * delegate.cs: Remove RootContext argument.
17672
17673         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
17674         argument. 
17675
17676         * class.cs (Event.Define): The lookup can fail.
17677
17678         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
17679
17680         * expression.cs: Resolve the this instance before invoking the code.
17681
17682 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
17683
17684         * cs-parser.jay: Add a production in element_access that allows
17685         the thing to become a "type" reference.  This way we can parse
17686         things like "(string [])" as a type.
17687
17688         Note that this still does not handle the more complex rules of
17689         casts. 
17690
17691
17692         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
17693
17694         * ecore.cs: (CopyNewMethods): new utility function used to
17695         assemble the list of methods from running FindMembers.
17696
17697         (MemberLookup): Rework FindMembers so that 
17698
17699 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
17700
17701         * class.cs (TypeContainer): Remove Delegates who fail to be
17702         defined.
17703
17704         * delegate.cs (Populate): Verify that we dont get null return
17705         values.   TODO: Check for AsAccessible.
17706
17707         * cs-parser.jay: Use basename to emit error 574 (destructor should
17708         have the same name as container class), not the full name.
17709
17710         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
17711         possible representation.  
17712
17713         Also implements integer type suffixes U and L.
17714
17715 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
17716
17717         * expression.cs (ArrayCreation.DoResolve): We need to do the
17718         argument resolution *always*.
17719
17720         * decl.cs: Make this hold the namespace.  Hold the root context as
17721         well.
17722         (LookupType): Move here.
17723
17724         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
17725
17726         * location.cs (Row, Name): Fixed the code, it was always returning
17727         references to the first file.
17728
17729         * interface.cs: Register properties defined through interfaces.
17730
17731         * driver.cs: Add support for globbing on the command line
17732
17733         * class.cs (Field): Make it derive from MemberCore as well.
17734         (Event): ditto.
17735
17736 2001-12-15  Ravi Pratap  <ravi@ximian.com>
17737
17738         * class.cs (Event::Define): Check that the type of the event is a delegate
17739         type else flag error #66.
17740
17741         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
17742         same.
17743
17744         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
17745         values of EntryPoint, CharSet etc etc.
17746
17747         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
17748
17749         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
17750         be null and we should ignore this. I am not sure if this is really clean. Apparently,
17751         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
17752         which needs this to do its work.
17753
17754         * ../errors/cs0066.cs : Add.
17755
17756 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
17757
17758         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
17759         helper functions.
17760
17761         * class.cs: (MethodSignature.MethodSignature): Removed hack that
17762         clears out the parameters field.
17763         (MemberSignatureCompare): Cleanup
17764
17765         (MemberCore): New base class used to share code between MethodCore
17766         and Property.
17767
17768         (RegisterRequiredImplementations) BindingFlags.Public requires
17769         either BindingFlags.Instace or Static.  Use instance here.
17770
17771         (Property): Refactored code to cope better with the full spec.
17772
17773         * parameter.cs (GetParameterInfo): Return an empty array instead
17774         of null on error.
17775
17776         * class.cs (Property): Abstract or extern properties have no bodies.
17777
17778         * parameter.cs (GetParameterInfo): return a zero-sized array.
17779
17780         * class.cs (TypeContainer.MethodModifiersValid): Move all the
17781         method modifier validation to the typecontainer so we can reuse
17782         this on properties.
17783
17784         (MethodCore.ParameterTypes): return an empty sized array of types.
17785
17786         (Property.Define): Test property modifier validity.
17787
17788         Add tests for sealed/override too.
17789
17790         (Method.Emit): abstract or extern methods have no bodies.
17791
17792 2001-12-14  Ravi Pratap  <ravi@ximian.com>
17793
17794         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
17795         thing.
17796
17797         (Method::Define, ::Emit): Modify accordingly.
17798
17799         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
17800
17801         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
17802
17803         * makefile: Pass in /unsafe.
17804
17805 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
17806
17807         * class.cs (MakeKey): Kill routine.
17808
17809         * class.cs (TypeContainer.Define): Correctly define explicit
17810         method implementations (they require the full interface name plus
17811         the method name).
17812
17813         * typemanager.cs: Deply the PtrHashtable here and stop using the
17814         lame keys.  Things work so much better.
17815
17816         This of course broke everyone who depended on `RegisterMethod' to
17817         do the `test for existance' test.  This has to be done elsewhere.
17818
17819         * support.cs (PtrHashtable): A hashtable that avoid comparing with
17820         the object stupid Equals method (because, that like fails all over
17821         the place).  We still do not use it.
17822
17823         * class.cs (TypeContainer.SetRequiredInterface,
17824         TypeContainer.RequireMethods): Killed these two routines and moved
17825         all the functionality to RegisterRequiredImplementations.
17826
17827         (TypeContainer.RegisterRequiredImplementations): This routine now
17828         registers all the implementations required in an array for the
17829         interfaces and abstract methods.  We use an array of structures
17830         which can be computed ahead of time to reduce memory usage and we
17831         also assume that lookups are cheap as most classes will not
17832         implement too many interfaces.
17833
17834         We also avoid creating too many MethodSignatures.
17835
17836         (TypeContainer.IsInterfaceMethod): Update and optionally does not
17837         clear the "pending" bit if we find that there are problems with
17838         the declaration.
17839
17840         (TypeContainer.VerifyPendingMethods): Update to report errors of
17841         methods that look like implementations but are not.
17842
17843         (TypeContainer.Define): Add support for explicit interface method
17844         implementation. 
17845
17846 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
17847
17848         * typemanager.cs: Keep track of the parameters here instead of
17849         being a feature of the TypeContainer.
17850
17851         * class.cs: Drop the registration of parameters here, as
17852         InterfaceMethods are also interface declarations.
17853
17854         * delegate.cs: Register methods with the TypeManager not only with
17855         the TypeContainer.  This code was buggy.
17856
17857         * interface.cs: Full registation here.
17858
17859 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
17860
17861         * expression.cs: Remove reducer for binary expressions, it can not
17862         be done this way.
17863
17864         * const.cs: Put here the code that used to go into constant.cs
17865
17866         * constant.cs: Put here the code for constants, this is a new base
17867         class for Literals.
17868
17869         * literal.cs: Make Literal derive from Constant.
17870
17871 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
17872
17873         * statement.cs (Return.Emit): Report error 157 if the user
17874         attempts to return from a finally block.
17875
17876         (Return.Emit): Instead of emitting a return, jump to the end of
17877         the function.
17878
17879         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
17880         LocalBuilder to store the result of the function.  ReturnLabel is
17881         the target where we jump.
17882
17883
17884 2001-12-09  Radek Doulik  <rodo@ximian.com>
17885
17886         * cs-parser.jay: remember alias in current namespace
17887
17888         * ecore.cs (SimpleName::DoResolve): use aliases for types or
17889         namespaces
17890
17891         * class.cs (LookupAlias): lookup alias in my_namespace
17892
17893         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
17894         aliases hashtable
17895         (LookupAlias): lookup alias in this and if needed in parent
17896         namespaces
17897
17898 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
17899
17900         * support.cs: 
17901
17902         * rootcontext.cs: (ModuleBuilder) Made static, first step into
17903         making things static.  I need this to avoid passing the
17904         TypeContainer when calling ParameterType.
17905
17906         * support.cs (InternalParameters.ParameterType): Remove ugly hack
17907         that did string manipulation to compute the type and then call
17908         GetType.  Use Parameter.ParameterType instead.
17909
17910         * cs-tokenizer.cs: Consume the suffix for floating values.
17911
17912         * expression.cs (ParameterReference): figure out whether this is a
17913         reference parameter or not.  Kill an extra variable by computing
17914         the arg_idx during emission.
17915
17916         * parameter.cs (Parameters.GetParameterInfo): New overloaded
17917         function that returns whether a parameter is an out/ref value or not.
17918
17919         (Parameter.ParameterType): The type of the parameter (base,
17920         without ref/out applied).
17921
17922         (Parameter.Resolve): Perform resolution here.
17923         (Parameter.ExternalType): The full type (with ref/out applied).
17924
17925         * statement.cs (Using.Emit, Using.EmitExpression): Implement
17926         support for expressions on the using statement.
17927
17928 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
17929
17930         * statement.cs (Using.EmitLocalVariableDecls): Split the
17931         localvariable handling of the using statement.
17932
17933         (Block.EmitMeta): Keep track of variable count across blocks.  We
17934         were reusing slots on separate branches of blocks.
17935
17936         (Try.Emit): Emit the general code block, we were not emitting it. 
17937
17938         Check the type of the declaration to be an IDisposable or
17939         something that can be implicity converted to it. 
17940
17941         Emit conversions if required.
17942
17943         * ecore.cs (EmptyExpression): New utility class.
17944         (Expression.ImplicitConversionExists): New utility function.
17945
17946 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
17947
17948         * statement.cs (Using): Implement.
17949
17950         * expression.cs (LocalVariableReference): Support read only variables.
17951
17952         * statement.cs: Remove the explicit emit for the Leave opcode.
17953         (VariableInfo): Add a readonly field.
17954
17955 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
17956
17957         * ecore.cs (ConvCast): new class used to encapsulate the various
17958         explicit integer conversions that works in both checked and
17959         unchecked contexts.
17960
17961         (Expression.ConvertNumericExplicit): Use new ConvCast class to
17962         properly generate the overflow opcodes.
17963
17964 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17965
17966         * statement.cs: The correct type for the EmptyExpression is the
17967         element_type, not the variable type.  Ravi pointed this out.
17968
17969 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17970
17971         * class.cs (Method::Define): Handle PInvoke methods specially
17972         by using DefinePInvokeMethod instead of the usual one.
17973
17974         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
17975         above to do the task of extracting information and defining the method.
17976
17977 2001-12-04  Ravi Pratap  <ravi@ximian.com>
17978
17979         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
17980         of the condition for string type.
17981
17982         (Emit): Move that here. 
17983
17984         (ArrayCreation::CheckIndices): Keep string literals in their expression
17985         form.
17986
17987         (EmitDynamicInitializers): Handle strings appropriately.
17988
17989 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
17990
17991         * codegen.cs (EmitContext): Replace multiple variables with a
17992         single pointer to the current Switch statement.
17993
17994         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
17995         EmitContext.
17996
17997 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
17998
17999         * statement.cs 
18000
18001         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
18002         default'.
18003
18004         (Foreach.Emit): Foreach on arrays was not setting
18005         up the loop variables (for break/continue).
18006
18007         (GotoCase): Semi-implented.
18008
18009 2001-12-03  Ravi Pratap  <ravi@ximian.com>
18010
18011         * attribute.cs (CheckAttribute): Handle system attributes by using
18012         Attribute.GetAttributes to examine information we need.
18013
18014         (GetValidPlaces): Same here.
18015
18016         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
18017
18018         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
18019
18020         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
18021
18022         (Method::Define): Set appropriate flags if we have a DllImport attribute.
18023
18024         (Method::Emit): Handle the case when we are a PInvoke method.
18025
18026 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
18027
18028         * expression.cs: Use ResolveWithSimpleName on compound names.
18029
18030 2001-12-02  Ravi Pratap  <ravi@ximian.com>
18031
18032         * constant.cs (EmitConstant): Make sure we resolve the associated expression
18033         before trying to reduce it.
18034
18035         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
18036
18037         * constant.cs (LookupConstantValue): Implement.
18038
18039         (EmitConstant): Use the above in emitting the constant.
18040
18041         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
18042         that are user-defined by doing a LookupConstantValue on them.
18043
18044         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
18045         too, like above.
18046
18047 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
18048
18049         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
18050
18051         (BaseAccess.DoResolve): Implement.
18052
18053         (MemberAccess.DoResolve): Split this routine into a
18054         ResolveMemberAccess routine that can be used independently
18055
18056 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
18057
18058         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
18059         As that share bits of the implementation.  Is returns a boolean,
18060         while As returns the Type that is being probed.
18061
18062 2001-12-01  Ravi Pratap  <ravi@ximian.com>
18063
18064         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
18065         instead of a Literal - much easier.
18066
18067         (EnumInTransit): Remove - utterly useless :-)
18068
18069         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
18070
18071         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
18072
18073         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
18074         chain when we have no associated expression.
18075
18076 2001-11-30  Ravi Pratap  <ravi@ximian.com>
18077
18078         * constant.cs (Define): Use Location while reporting the errror.
18079
18080         Also emit a warning when 'new' is used and there is no inherited
18081         member to hide.
18082
18083         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
18084         populated.
18085
18086         (LookupEnumValue): Implement to lookup an enum member's value and define it
18087         if necessary.
18088
18089         (Populate): Re-write accordingly to use the above routine.
18090
18091 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
18092
18093         * expression.cs (This): Fix prototype for DoResolveLValue to
18094         override the base class DoResolveLValue.
18095
18096         * cs-parser.cs: Report errors cs574 and cs575 (destructor
18097         declarations) 
18098
18099         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
18100         (we need to load the address of the field here).  This fixes
18101         test-22. 
18102
18103         (FieldExpr.DoResolveLValue): Call the DoResolve
18104         function to initialize the Instance expression.
18105
18106         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
18107         correctly the GetEnumerator operation on a value type.
18108
18109         * cs-parser.jay: Add more simple parsing error catches.
18110
18111         * statement.cs (Switch): Add support for string switches.
18112         Handle null specially.
18113
18114         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
18115
18116 2001-11-28  Ravi Pratap  <ravi@ximian.com>
18117
18118         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
18119
18120         (declare_local_constant): New helper function.
18121
18122         * statement.cs (AddConstant): Keep a separate record of constants
18123
18124         (IsConstant): Implement to determine if a variable is a constant.
18125
18126         (GetConstantExpression): Implement.
18127
18128         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
18129
18130         * statement.cs (IsVariableDefined): Re-write.
18131
18132 2001-11-27  Ravi Pratap  <ravi@ximian.com>
18133
18134         * class.cs (TypeContainer::FindMembers): Look for constants
18135         in the case when we are looking for MemberTypes.Field
18136
18137         * expression.cs (MemberAccess::DoResolve): Check that in the
18138         case we are a FieldExpr and a Literal, we are not being accessed
18139         by an instance reference.
18140
18141         * cs-parser.jay (local_constant_declaration): Implement.
18142
18143         (declaration_statement): Implement for constant declarations.
18144
18145 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
18146
18147         * statement.cs (Switch): Catch double defaults.
18148
18149         (Switch): More work on the switch() statement
18150         implementation.  It works for integral values now, need to finish
18151         string support.
18152
18153
18154 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18155
18156         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
18157         integer literals into other integer literals.  To be used by
18158         switch. 
18159
18160 2001-11-24  Ravi Pratap  <ravi@ximian.com>
18161
18162         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
18163         some memory.
18164
18165         (EmitDynamicInitializers): Cope with the above since we extract data
18166         directly from ArrayData now.
18167
18168         (ExpectInitializers): Keep track of whether initializers are mandatory
18169         or not.
18170
18171         (Bounds): Make it a hashtable to prevent the same dimension being 
18172         recorded for every element in that dimension.
18173
18174         (EmitDynamicInitializers): Fix bug which prevented the Set array method
18175         from being found.
18176
18177         Also fix bug which was causing the indices to be emitted in the reverse
18178         order.
18179
18180 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
18181
18182         * expression.cs (ArrayCreation): Implement the bits that Ravi left
18183         unfinished.  They do not work, because the underlying code is
18184         sloppy.
18185
18186 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * cs-parser.jay: Remove bogus fixme.
18189
18190         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
18191         on Switch statement.
18192
18193 2001-11-23  Ravi Pratap  <ravi@ximian.com>
18194
18195         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
18196         the same. 
18197
18198         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
18199         parameter. Apparently, any expression is allowed. 
18200
18201         (ValidateInitializers): Update accordingly.
18202
18203         (CheckIndices): Fix some tricky bugs thanks to recursion.
18204
18205         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
18206         I was being completely brain-dead.
18207
18208         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
18209         and re-write acordingly.
18210
18211         (DelegateInvocation): Re-write accordingly.
18212
18213         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
18214
18215         (MakeByteBlob): Handle types more correctly.
18216
18217         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
18218         initialization from expressions but it is incomplete because I am a complete
18219         Dodo :-|
18220
18221 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18222
18223         * statement.cs (If.Emit): Fix a bug that generated incorrect code
18224         on If.  Basically, we have to return `true' (ie, we do return to
18225         our caller) only if both branches of the if return.
18226
18227         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
18228         short-circuit operators, handle them as short circuit operators. 
18229
18230         (Cast.DoResolve): Resolve type.
18231         (Cast.Cast): Take an expression as the target type.
18232
18233         * cs-parser.jay (cast_expression): Remove old hack that only
18234         allowed a limited set of types to be handled.  Now we take a
18235         unary_expression and we resolve to a type during semantic
18236         analysis.
18237
18238         Use the grammar productions from Rhys to handle casts (this is
18239         not complete like Rhys syntax yet, we fail to handle that corner
18240         case that C# has regarding (-x), but we will get there.
18241
18242 2001-11-22  Ravi Pratap  <ravi@ximian.com>
18243
18244         * class.cs (EmitFieldInitializer): Take care of the case when we have a
18245         field which is an array type.
18246
18247         * cs-parser.jay (declare_local_variables): Support array initialization too.
18248
18249         * typemanager.cs (MakeKey): Implement.
18250
18251         (everywhere): Use the above appropriately.
18252
18253         * cs-parser.jay (for_statement): Update for array initialization while
18254         declaring variables.
18255
18256         * ecore.cs : The error message was correct, it's the variable's names that
18257         were misleading ;-) Make the code more readable.
18258
18259         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
18260         the correct type etc.
18261
18262         (ConvertExplicit): Handle Enum types by examining the underlying type.
18263
18264 2001-11-21  Ravi Pratap  <ravi@ximian.com>
18265
18266         * parameter.cs (GetCallingConvention): Always return
18267         CallingConventions.Standard for now.
18268
18269 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * expression.cs (Binary.ResolveOperator): Update the values of `l'
18272         and `r' after calling DoNumericPromotions.
18273
18274         * ecore.cs: Fix error message (the types were in the wrong order).
18275
18276         * statement.cs (Foreach.ProbeCollectionType): Need to pass
18277         BindingFlags.Instance as well 
18278
18279         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
18280         implicit int literal conversion in an empty cast so that we
18281         propagate the right type upstream.
18282
18283         (UnboxCast): new class used to unbox value types.
18284         (Expression.ConvertExplicit): Add explicit type conversions done
18285         by unboxing.
18286
18287         (Expression.ImplicitNumericConversion): Oops, forgot to test for
18288         the target type before applying the implicit LongLiterals to ULong
18289         literal cast.
18290
18291 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
18292
18293         * cs-parser.jay (for_statement): Reworked the way For works: now
18294         we declare manually any variables that are introduced in
18295         for_initializer to solve the problem of having out-of-band code
18296         emition (that is what got for broken).
18297
18298         (declaration_statement): Perform the actual variable declaration
18299         that used to be done in local_variable_declaration here.
18300
18301         (local_variable_declaration): Do not declare anything, just pass
18302         the information on a DictionaryEntry
18303
18304 2001-11-20  Ravi Pratap  <ravi@ximian.com>
18305
18306         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
18307         re-write of the logic to now make it recursive.
18308
18309         (UpdateIndices): Re-write accordingly.
18310
18311         Store element data in a separate ArrayData list in the above methods.
18312
18313         (MakeByteBlob): Implement to dump the array data into a byte array.
18314
18315 2001-11-19  Ravi Pratap  <ravi@ximian.com>
18316
18317         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
18318         into CheckIndices.
18319
18320         * constant.cs (Define): Implement.
18321
18322         (EmitConstant): Re-write fully.
18323
18324         Pass in location info.
18325
18326         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
18327         respectively.
18328
18329         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
18330         DictionaryEntry since we need location info too.
18331
18332         (constant_declaration): Update accordingly.
18333
18334         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
18335         code into another method : UpdateIndices.
18336
18337 2001-11-18  Ravi Pratap  <ravi@ximian.com>
18338
18339         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
18340         some type checking etc.
18341
18342 2001-11-17  Ravi Pratap  <ravi@ximian.com>
18343
18344         * expression.cs (ArrayCreation::ValidateInitializers): Implement
18345         bits to provide dimension info if the user skips doing that.
18346
18347         Update second constructor to store the rank correctly.
18348
18349 2001-11-16  Ravi Pratap  <ravi@ximian.com>
18350
18351         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
18352         and try to implement.
18353
18354         * ../errors/cs0150.cs : Add.
18355
18356         * ../errors/cs0178.cs : Add.
18357
18358 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
18359
18360         * statement.cs: Implement foreach on multi-dimensional arrays. 
18361
18362         * parameter.cs (Parameters.GetParameterByName): Also lookup the
18363         name of the params argument.
18364
18365         * expression.cs: Use EmitStoreOpcode to get the right opcode while
18366         initializing the array.
18367
18368         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
18369         we can use this elsewhere.
18370
18371         * statement.cs: Finish implementation of foreach for single
18372         dimension arrays.
18373
18374         * cs-parser.jay: Use an out-of-band stack to pass information
18375         around, I wonder why I need this.
18376
18377         foreach_block: Make the new foreach_block the current_block.
18378
18379         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
18380         function used to return a static Parameters structure.  Used for
18381         empty parameters, as those are created very frequently.
18382
18383         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
18384
18385 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18386
18387         * interface.cs : Default modifier is private, not public. The
18388         make verify test passes again.
18389
18390 2001-11-15  Ravi Pratap  <ravi@ximian.com>
18391
18392         * support.cs (ReflectionParameters): Fix logic to determine
18393         whether the last parameter is a params one. Test 9 passes again.
18394
18395         * delegate.cs (Populate): Register the builders we define with
18396         RegisterParameterForBuilder. Test 19 passes again.
18397
18398         * cs-parser.jay (property_declaration): Reference $6 instead
18399         of $$ to get at the location.
18400
18401         (indexer_declaration): Similar stuff.
18402
18403         (attribute): Ditto.
18404
18405         * class.cs (Property): Register parameters for the Get and Set methods
18406         if they exist. Test 23 passes again.
18407
18408         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
18409         call to EmitArguments as we are sure there aren't any params arguments. 
18410         Test 32 passes again.
18411
18412         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
18413         IndexOutOfRangeException. 
18414
18415         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
18416         Test 33 now passes again.
18417
18418 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
18419
18420         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
18421         broke a bunch of things.  Will have to come up with a better way
18422         of tracking locations.
18423
18424         * statement.cs: Implemented foreach for single dimension arrays.
18425
18426 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18427
18428         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
18429         an error.  This removes the lookup from the critical path.
18430
18431         * cs-parser.jay: Removed use of temporary_loc, which is completely
18432         broken. 
18433
18434 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * support.cs (ReflectionParameters.ParameterModifier): Report
18437         whether the argument is a PARAMS argument or not.
18438
18439         * class.cs: Set the attribute `ParamArrayAttribute' on the
18440         parameter argument.
18441
18442         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
18443         and cons_param_array_attribute (ConstructorInfo for
18444         ParamArrayAttribute)., 
18445
18446         * codegen.cs: Emit the return using the `Return' statement, that
18447         way we can report the error correctly for missing return values. 
18448
18449         * class.cs (Method.Emit): Clean up.
18450
18451         * expression.cs (Argument.Resolve): Take another argument: the
18452         location where this argument is used.  Notice that this is not
18453         part of the "Argument" class as to reduce the size of the
18454         structure (we know the approximate location anyways).
18455
18456         Test if the argument is a variable-reference, if not, then
18457         complain with a 206.
18458
18459         (Argument.Emit): Emit addresses of variables.
18460
18461         (Argument.FullDesc): Simplify.
18462
18463         (Invocation.DoResolve): Update for Argument.Resolve.
18464
18465         (ElementAccess.DoResolve): ditto.
18466
18467         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
18468         method should be virtual, as this method is always virtual.
18469
18470         (NewDelegate.DoResolve): Update for Argument.Resolve.
18471
18472         * class.cs (ConstructorInitializer.DoResolve): ditto.
18473
18474         * attribute.cs (Attribute.Resolve): ditto.
18475
18476 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
18477
18478         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
18479
18480         * expression.cs (ParameterReference): Drop IStackStorage and implement
18481         IAssignMethod instead. 
18482
18483         (LocalVariableReference): ditto.
18484
18485         * ecore.cs (FieldExpr): Drop IStackStorage and implement
18486         IAssignMethod instead. 
18487
18488 2001-11-13  Miguel de Icaza <miguel@ximian.com>
18489
18490         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
18491         enumerations that are used in heavily used structures derive from
18492         byte in a laughable and pathetic attempt to reduce memory usage.
18493         This is the kind of pre-optimzations that you should not do at
18494         home without adult supervision.
18495
18496         * expression.cs (UnaryMutator): New class, used to handle ++ and
18497         -- separatedly from the other unary operators.  Cleans up the
18498         code, and kills the ExpressionStatement dependency in Unary.
18499
18500         (Unary): Removed `method' and `Arguments' from this class, making
18501         it smaller, and moving it all to SimpleCall, so I can reuse this
18502         code in other locations and avoid creating a lot of transient data
18503         strucutres when not required.
18504
18505         * cs-parser.jay: Adjust for new changes.
18506
18507 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
18508
18509         * enum.cs (Enum.Populate): If there is a failure during
18510         definition, return
18511
18512         * cs-parser.jay (opt_enum_base): we used to catch type errors
18513         here, but this is really incorrect.  The type error should be
18514         catched during semantic analysis.
18515
18516 2001-12-11  Ravi Pratap  <ravi@ximian.com>
18517
18518         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
18519         current_local_parameters as expected since I, in my stupidity, had forgotten
18520         to do this :-)
18521
18522         * attribute.cs (GetValidPlaces): Fix stupid bug.
18523
18524         * class.cs (Method::Emit): Perform check on applicability of attributes.
18525
18526         (Constructor::Emit): Ditto.
18527
18528         (Field::Emit): Ditto.
18529
18530         (Field.Location): Store location information.
18531
18532         (Property, Event, Indexer, Operator): Ditto.
18533
18534         * cs-parser.jay (field_declaration): Pass in location for each field.
18535
18536         * ../errors/cs0592.cs : Add.
18537
18538 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18539
18540         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
18541
18542         (InitCoreTypes): Update accordingly.
18543
18544         (RegisterAttrType, LookupAttr): Implement.
18545
18546         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
18547         info about the same.
18548
18549         (Resolve): Update to populate the above as necessary.
18550
18551         (Error592): Helper.
18552
18553         (GetValidPlaces): Helper to the above.
18554
18555         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
18556
18557         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
18558
18559 2001-11-12  Ravi Pratap  <ravi@ximian.com>
18560
18561         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
18562
18563         * ../errors/cs0617.cs : Add.
18564
18565 2001-11-11  Ravi Pratap  <ravi@ximian.com>
18566
18567         * enum.cs (Emit): Rename to Populate to be more consistent with what
18568         we expect it to do and when exactly it is called.
18569
18570         * class.cs, rootcontext.cs : Update accordingly.
18571
18572         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
18573         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
18574
18575         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
18576
18577         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
18578         of a fieldinfo using the above, when dealing with a FieldBuilder.
18579
18580 2001-11-10  Ravi Pratap  <ravi@ximian.com>
18581
18582         * ../errors/cs0031.cs : Add.
18583
18584         * ../errors/cs1008.cs : Add.
18585
18586         * ../errrors/cs0543.cs : Add.
18587
18588         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
18589         enum type.
18590
18591         (FindMembers): Implement.
18592
18593         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
18594         enums and delegates too.
18595
18596         (enum_types): Rename to builder_to_enum.
18597
18598         (delegate_types): Rename to builder_to_delegate.
18599
18600         * delegate.cs (FindMembers): Implement.
18601
18602 2001-11-09  Ravi Pratap  <ravi@ximian.com>
18603
18604         * typemanager.cs (IsEnumType): Implement.
18605
18606         * enum.cs (Emit): Re-write parts to account for the underlying type
18607         better and perform checking etc.
18608
18609         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
18610         of the underlying type.
18611
18612         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
18613         value
18614
18615         * enum.cs (error31): Helper to report error #31.
18616
18617         * cs-parser.jay (enum_declaration): Store location of each member too.
18618
18619         * enum.cs (member_to_location): New hashtable. 
18620
18621         (AddEnumMember): Update location hashtable.
18622
18623         (Emit): Use the location of each member while reporting errors.
18624
18625 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
18626
18627         * cs-parser.jay: A for_initializer if is a
18628         local_variable_declaration really ammount to have an implicit
18629         block with the variable declaration and no initializer for for.
18630
18631         * statement.cs (For.Emit): Cope with null initializers.
18632
18633         This fixes the infinite loop on for initializers.
18634
18635 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
18636
18637         * enum.cs: More cleanup.
18638
18639         * ecore.cs: Remove dead code.
18640
18641         * class.cs (Property.Emit): More simplification.
18642         (Event.Emit): ditto.
18643
18644         Reworked to have less levels of indentation.
18645
18646 2001-11-08  Ravi Pratap  <ravi@ximian.com>
18647
18648         * class.cs (Property): Emit attributes.
18649
18650         (Field): Ditto.
18651
18652         (Event): Ditto.
18653
18654         (Indexer): Ditto.
18655
18656         (Operator): Ditto.
18657
18658         * enum.cs (Emit): Ditto.
18659
18660         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
18661         Enums too.
18662
18663         * class.cs (Field, Event, etc.): Move attribute generation into the
18664         Emit method everywhere.
18665
18666         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
18667         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
18668         as we had no way of defining nested enums !
18669
18670         * rootcontext.cs : Adjust code accordingly.
18671
18672         * typemanager.cs (AddEnumType): To keep track of enum types separately.
18673
18674 2001-11-07  Ravi Pratap  <ravi@ximian.com>
18675
18676         * expression.cs (EvalConstantExpression): Move into ecore.cs
18677
18678         * enum.cs (Enum): Rename some members and make them public and readonly
18679         according to our convention.
18680
18681         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
18682         nothing else.
18683
18684         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
18685
18686         (Enum::Emit): Write a simple version for now which doesn't try to compute
18687         expressions. I shall modify this to be more robust in just a while.
18688
18689         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
18690
18691         (TypeContainer::CloseType): Create the Enum types too.
18692
18693         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
18694
18695         * expression.cs (EvalConstantExpression): Get rid of completely.
18696
18697         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
18698         user-defined values and other cases.
18699
18700         (IsValidEnumLiteral): Helper function.
18701
18702         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
18703         out there in the case we had a literal FieldExpr.
18704
18705         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
18706
18707         (Literalize): Revamp a bit to take two arguments.
18708
18709         (EnumLiteral): New class which derives from Literal to wrap enum literals.
18710
18711 2001-11-06  Ravi Pratap  <ravi@ximian.com>
18712
18713         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
18714
18715         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
18716
18717         (Resolve): Use the above to ensure we have proper initializers.
18718
18719 2001-11-05  Ravi Pratap  <ravi@ximian.com>
18720
18721         * expression.cs (Expression::EvalConstantExpression): New method to 
18722         evaluate constant expressions.
18723
18724         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
18725
18726 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
18727
18728         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
18729         in an array.
18730
18731         (Binary.ResolveOperator): Handle operator != (object a, object b)
18732         and operator == (object a, object b);
18733
18734         (Binary.DoNumericPromotions): Indicate whether the numeric
18735         promotion was possible.
18736
18737         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
18738         Implement.  
18739
18740         Made the ArrayAccess implement interface IAssignMethod instead of
18741         IStackStore as the order in which arguments are passed reflects
18742         this.
18743
18744         * assign.cs: Instead of using expr.ExprClass to select the way of
18745         assinging, probe for the IStackStore/IAssignMethod interfaces.
18746
18747         * typemanager.cs: Load InitializeArray definition.
18748
18749         * rootcontext.cs (RootContext.MakeStaticData): Used to define
18750         static data that can be used to initialize arrays. 
18751
18752 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
18753
18754         * expression.cs: Handle operator== and operator!= for booleans.
18755
18756         (Conditioal.Reduce): Implement reducer for the ?: operator.
18757
18758         (Conditional.Resolve): Implement dead code elimination.
18759
18760         (Binary.Resolve): Catch string literals and return a new
18761         concatenated string.
18762
18763         (Unary.Reduce): Implement reduction of unary expressions.
18764
18765         * ecore.cs: Split out the expression core handling here.
18766
18767         (Expression.Reduce): New method used to perform constant folding
18768         and CSE.  This is needed to support constant-expressions. 
18769
18770         * statement.cs (Statement.EmitBoolExpression): Pass true and false
18771         targets, and optimize for !x.
18772
18773 2001-11-04  Ravi Pratap  <ravi@ximian.com>
18774
18775         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
18776         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
18777         set custom atttributes.
18778
18779         * literal.cs (Literal::GetValue): New abstract method to return the actual
18780         value of the literal, cast as an object.
18781
18782         (*Literal): Implement GetValue method.
18783
18784         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
18785         expressions to the arraylist but objects of type Argument.
18786
18787         * class.cs (TypeContainer::Emit): Emit our attributes too.
18788
18789         (Method::Emit, Constructor::Emit): Ditto.
18790
18791         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
18792         to be ignoring earlier.
18793
18794 2001-11-03  Ravi Pratap  <ravi@ximian.com>
18795
18796         * attribute.cs (AttributeSection::Define): Implement to do the business
18797         of constructing a CustomAttributeBuilder.
18798
18799         (Attribute): New trivial class. Increases readability of code.  
18800
18801         * cs-parser.jay : Update accordingly.
18802
18803         (positional_argument_list, named_argument_list, named_argument): New rules
18804
18805         (attribute_arguments): Use the above so that we are more correct.
18806
18807 2001-11-02  Ravi Pratap  <ravi@ximian.com>
18808
18809         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
18810         to perform all checks for a method with a params parameter.
18811
18812         (Invocation::OverloadResolve): Update to use the above method and therefore
18813         cope correctly with params method invocations.
18814
18815         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
18816         params too.
18817
18818         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
18819         constructors in our parent too because we can't afford to miss out on 
18820         protected ones ;-)
18821
18822         * attribute.cs (AttributeSection): New name for the class Attribute
18823
18824         Other trivial changes to improve readability.
18825
18826         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
18827         use the new class names.
18828
18829 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18830
18831         * class.cs (Method::Define): Complete definition for params types too
18832
18833         (Indexer::Define): Ditto.
18834
18835         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
18836         Cope everywhere with a request for info about the array parameter.
18837
18838 2001-11-01  Ravi Pratap  <ravi@ximian.com>
18839
18840         * tree.cs (RecordNamespace): Fix up to check for the correct key.
18841
18842         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
18843         local_variable_type to extract the string corresponding to the type.
18844
18845         (local_variable_type): Fixup the action to use the new helper method.
18846
18847         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
18848         go.
18849
18850         * expression.cs : Clean out code which uses the above.
18851
18852 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18853
18854         * typemanager.cs (RegisterMethod): Check if we already have an existing key
18855         and bale out if necessary by returning a false.
18856
18857         (RegisterProperty): Ditto.
18858
18859         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
18860         and print out appropriate error messages.
18861
18862         * interface.cs (everywhere): Ditto.
18863
18864         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
18865         location to constructor.
18866
18867         * class.cs (Property, Event, Indexer): Update accordingly.
18868
18869         * ../errors/cs111.cs : Added.
18870
18871         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
18872         of a method, as laid down by the spec.
18873
18874         (Invocation::OverloadResolve): Use the above method.
18875
18876 2001-10-31  Ravi Pratap  <ravi@ximian.com>
18877
18878         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
18879         now take a TypeContainer and a Parameters object.
18880
18881         (ParameterData): Modify return type of ParameterModifier method to be 
18882         Parameter.Modifier and not a string.
18883
18884         (ReflectionParameters, InternalParameters): Update accordingly.
18885
18886         * expression.cs (Argument::GetParameterModifier): Same here.
18887
18888         * support.cs (InternalParameters::ParameterType): Find a better way of determining
18889         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
18890         symbol in it at all so maybe this is only for now.
18891
18892 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18893
18894         * support.cs (InternalParameters): Constructor now takes an extra argument 
18895         which is the actual Parameters class.
18896
18897         (ParameterDesc): Update to provide info on ref/out modifiers.
18898
18899         * class.cs (everywhere): Update call to InternalParameters to pass in
18900         the second argument too.
18901
18902         * support.cs (ParameterData): Add ParameterModifier, which is a method 
18903         to return the modifier info [ref/out etc]
18904
18905         (InternalParameters, ReflectionParameters): Implement the above.
18906
18907         * expression.cs (Argument::ParameterModifier): Similar function to return
18908         info about the argument's modifiers.
18909
18910         (Invocation::OverloadResolve): Update to take into account matching modifiers 
18911         too.
18912
18913         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
18914         a new SetFormalParameters object which we pass to InternalParameters.
18915
18916 2001-10-30  Ravi Pratap  <ravi@ximian.com>
18917
18918         * expression.cs (NewArray): Merge into the ArrayCreation class.
18919
18920 2001-10-29  Ravi Pratap  <ravi@ximian.com>
18921
18922         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
18923         NewUserdefinedArray into one as there wasn't much of a use in having
18924         two separate ones.
18925
18926         * expression.cs (Argument): Change field's name to ArgType from Type.
18927
18928         (Type): New readonly property which returns the proper type, taking into 
18929         account ref/out modifiers.
18930
18931         (everywhere): Adjust code accordingly for the above.
18932
18933         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
18934         whether we are emitting for a ref or out parameter.
18935
18936         * expression.cs (Argument::Emit): Use the above field to set the state.
18937
18938         (LocalVariableReference::Emit): Update to honour the flag and emit the
18939         right stuff.
18940
18941         * parameter.cs (Attributes): Set the correct flags for ref parameters.
18942
18943         * expression.cs (Argument::FullDesc): New function to provide a full desc.
18944
18945         * support.cs (ParameterData): Add method ParameterDesc to the interface.
18946
18947         (ReflectionParameters, InternalParameters): Implement the above method.
18948
18949         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
18950         reporting errors.
18951
18952         (Invocation::FullMethodDesc): Ditto. 
18953
18954 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * cs-parser.jay: Add extra production for the second form of array
18957         creation. 
18958
18959         * expression.cs (ArrayCreation): Update to reflect the above
18960         change. 
18961
18962         * Small changes to prepare for Array initialization.
18963
18964 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
18965
18966         * typemanager.cs (ImplementsInterface): interface might be null;
18967         Deal with this problem;
18968
18969         Also, we do store negative hits on the cache (null values), so use
18970         this instead of calling t.GetInterfaces on the type everytime.
18971
18972 2001-10-28  Ravi Pratap  <ravi@ximian.com>
18973
18974         * typemanager.cs (IsBuiltinType): New method to help determine the same.
18975
18976         * expression.cs (New::DoResolve): Get rid of array creation code and instead
18977         split functionality out into different classes.
18978
18979         (New::FormArrayType): Move into NewBuiltinArray.
18980
18981         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
18982         quite useless.
18983
18984         (NewBuiltinArray): New class to handle creation of built-in arrays.
18985
18986         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
18987         account creation of one-dimensional arrays.
18988
18989         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
18990
18991         (NewUserdefinedArray::DoResolve): Implement.
18992
18993         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
18994
18995         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
18996         we maintain inside the TypeManager. This is necessary to perform lookups on the
18997         module builder.
18998
18999         (LookupType): Update to perform GetType on the module builders too.     
19000
19001         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
19002
19003         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
19004
19005 2001-10-23  Ravi Pratap  <ravi@ximian.com>
19006
19007         * expression.cs (New::DoResolve): Implement guts of array creation.
19008
19009         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
19010
19011 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
19012
19013         * expression.cs: Fix bug I introduced lsat night that broke
19014         Delegates. 
19015
19016         (Expression.Resolve): Report a 246 error (can not resolve name)
19017         if we find a SimpleName in the stream.
19018
19019         (Expression.ResolveLValue): Ditto.
19020
19021         (Expression.ResolveWithSimpleName): This function is a variant of
19022         ResolveName, this one allows SimpleNames to be returned without a
19023         warning.  The only consumer of SimpleNames is MemberAccess
19024
19025 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
19026
19027         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
19028         might arrive here.  I have my doubts that this is correct.
19029
19030         * statement.cs (Lock): Implement lock statement.
19031
19032         * cs-parser.jay: Small fixes to support `lock' and `using'
19033
19034         * cs-tokenizer.cs: Remove extra space
19035
19036         * driver.cs: New flag --checked, allows to turn on integer math
19037         checking. 
19038
19039         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
19040         Threading.Monitor.Exit 
19041
19042 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * expression.cs (IndexerAccess::DoResolveLValue): Set the
19045         Expression Class to be IndexerAccess.
19046
19047         Notice that Indexer::DoResolve sets the eclass to Value.
19048
19049 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
19050
19051         * class.cs (TypeContainer::Emit): Emit code for indexers.
19052
19053         * assign.cs (IAssignMethod): New interface implemented by Indexers
19054         and Properties for handling assignment.
19055
19056         (Assign::Emit): Simplify and reuse code. 
19057
19058         * expression.cs (IndexerAccess, PropertyExpr): Implement
19059         IAssignMethod, clean up old code. 
19060
19061 2001-10-22  Ravi Pratap  <ravi@ximian.com>
19062
19063         * typemanager.cs (ImplementsInterface): New method to determine if a type
19064         implements a given interface. Provides a nice cache too.
19065
19066         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
19067         method.
19068
19069         (ConvertReferenceExplicit): Ditto.
19070
19071         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
19072         various methods, with correct names etc.
19073
19074         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
19075         Operator.UnaryNegation.
19076
19077         * cs-parser.jay (operator_declarator): Be a little clever in the case where
19078         we have a unary plus or minus operator.
19079
19080         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
19081         UnaryMinus.
19082
19083         * everywhere : update accordingly.
19084
19085         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
19086         respectively.
19087
19088         * class.cs (Method::Define): For the case where we are implementing a method
19089         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
19090         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
19091
19092 2001-10-21  Ravi Pratap  <ravi@ximian.com>
19093
19094         * interface.cs (FindMembers): Implement to work around S.R.E
19095         lameness.
19096
19097         * typemanager.cs (IsInterfaceType): Implement.
19098
19099         (FindMembers): Update to handle interface types too.
19100
19101         * expression.cs (ImplicitReferenceConversion): Re-write bits which
19102         use IsAssignableFrom as that is not correct - it doesn't work.
19103
19104         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
19105         and accordingly override EmitStatement.
19106
19107         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
19108         using the correct logic :-)
19109
19110 2001-10-19  Ravi Pratap  <ravi@ximian.com>
19111
19112         * ../errors/cs-11.cs : Add to demonstrate error -11 
19113
19114 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
19115
19116         * assign.cs (Assign::Resolve): Resolve right hand side first, and
19117         then pass this as a hint to ResolveLValue.
19118
19119         * expression.cs (FieldExpr): Add Location information
19120
19121         (FieldExpr::LValueResolve): Report assignment to readonly
19122         variable. 
19123
19124         (Expression::ExprClassFromMemberInfo): Pass location information.
19125
19126         (Expression::ResolveLValue): Add new method that resolves an
19127         LValue. 
19128
19129         (Expression::DoResolveLValue): Default invocation calls
19130         DoResolve. 
19131
19132         (Indexers): New class used to keep track of indexers in a given
19133         Type. 
19134
19135         (IStackStore): Renamed from LValue, as it did not really describe
19136         what this did.  Also ResolveLValue is gone from this interface and
19137         now is part of Expression.
19138
19139         (ElementAccess): Depending on the element access type
19140
19141         * typemanager.cs: Add `indexer_name_type' as a Core type
19142         (System.Runtime.CompilerServices.IndexerNameAttribute)
19143
19144         * statement.cs (Goto): Take a location.
19145
19146 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19147
19148         * delegate.cs (Delegate::VerifyDelegate): New method to verify
19149         if two delegates are compatible.
19150
19151         (NewDelegate::DoResolve): Update to take care of the case when
19152         we instantiate a delegate from another delegate.
19153
19154         * typemanager.cs (FindMembers): Don't even try to look up members
19155         of Delegate types for now.
19156
19157 2001-10-18  Ravi Pratap  <ravi@ximian.com>
19158
19159         * delegate.cs (NewDelegate): New class to take care of delegate
19160         instantiation.
19161
19162         * expression.cs (New): Split the delegate related code out into 
19163         the NewDelegate class.
19164
19165         * delegate.cs (DelegateInvocation): New class to handle delegate 
19166         invocation.
19167
19168         * expression.cs (Invocation): Split out delegate related code into
19169         the DelegateInvocation class.
19170
19171 2001-10-17  Ravi Pratap  <ravi@ximian.com>
19172
19173         * expression.cs (New::DoResolve): Implement delegate creation fully
19174         and according to the spec.
19175
19176         (New::DoEmit): Update to handle delegates differently.
19177
19178         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
19179         because of which we were printing out arguments in reverse order !
19180
19181         * delegate.cs (VerifyMethod): Implement to check if the given method
19182         matches the delegate.
19183
19184         (FullDelegateDesc): Implement.
19185
19186         (VerifyApplicability): Implement.
19187
19188         * expression.cs (Invocation::DoResolve): Update to accordingly handle
19189         delegate invocations too.
19190
19191         (Invocation::Emit): Ditto.
19192
19193         * ../errors/cs1593.cs : Added.
19194
19195         * ../errors/cs1594.cs : Added.
19196
19197         * delegate.cs (InstanceExpression, TargetMethod): New properties.
19198
19199 2001-10-16  Ravi Pratap  <ravi@ximian.com>
19200
19201         * typemanager.cs (intptr_type): Core type for System.IntPtr
19202
19203         (InitCoreTypes): Update for the same.
19204
19205         (iasyncresult_type, asynccallback_type): Ditto.
19206
19207         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
19208         correct.
19209
19210         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
19211         too.
19212
19213         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
19214         the builders for the 4 members of a delegate type :-)
19215
19216         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
19217         type.
19218
19219         * expression.cs (New::DoResolve): Implement guts for delegate creation.
19220
19221         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
19222
19223 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * statement.cs (Break::Emit): Implement.   
19226         (Continue::Emit): Implement.
19227
19228         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19229         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19230         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
19231         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
19232         end loop
19233
19234         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
19235         properties that track the label for the current loop (begin of the
19236         loop and end of the loop).
19237
19238 2001-10-15  Ravi Pratap  <ravi@ximian.com>
19239
19240         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
19241         use of emitting anything at all.
19242
19243         * class.cs, rootcontext.cs : Get rid of calls to the same.
19244
19245         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
19246
19247         (Populate): Define the constructor correctly and set the implementation
19248         attributes.
19249
19250         * typemanager.cs (delegate_types): New hashtable to hold delegates that
19251         have been defined.
19252
19253         (AddDelegateType): Implement.
19254
19255         (IsDelegateType): Implement helper method.
19256
19257         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
19258
19259         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
19260         and accordingly handle it.
19261
19262         * delegate.cs (Populate): Take TypeContainer argument.
19263         Implement bits to define the Invoke method. However, I still haven't figured out
19264         how to take care of the native int bit :-(
19265
19266         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
19267         Qualify the name of the delegate, not its return type !
19268
19269         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
19270         conversion.
19271
19272         (StandardConversionExists): Checking for array types turns out to be recursive.
19273
19274         (ConvertReferenceExplicit): Implement array conversion.
19275
19276         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
19277
19278 2001-10-12  Ravi Pratap  <ravi@ximian.com>
19279
19280         * cs-parser.jay (delegate_declaration): Store the fully qualified
19281         name as it is a type declaration.
19282
19283         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
19284         readonly.
19285
19286         (DefineDelegate): Renamed from Define. Does the same thing essentially,
19287         as TypeContainer::DefineType.
19288
19289         (Populate): Method in which all the definition of the various methods (Invoke)
19290         etc is done.
19291
19292         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
19293         see.
19294
19295         (CloseDelegate): Finally creates the delegate.
19296
19297         * class.cs (TypeContainer::DefineType): Update to define delegates.
19298         (Populate, Emit and CloseType): Do the same thing here too.
19299
19300         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
19301         delegates in all these operations.
19302
19303 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
19304
19305         * expression.cs: LocalTemporary: a new expression used to
19306         reference a temporary that has been created.
19307
19308         * assign.cs: Handle PropertyAccess back here, so that we can
19309         provide the proper semantic access to properties.
19310
19311         * expression.cs (Expression::ConvertReferenceExplicit): Implement
19312         a few more explicit conversions. 
19313
19314         * modifiers.cs: `NEW' modifier maps to HideBySig.
19315
19316         * expression.cs (PropertyExpr): Make this into an
19317         ExpressionStatement, and support the EmitStatement code path. 
19318
19319         Perform get/set error checking, clean up the interface.
19320
19321         * assign.cs: recognize PropertyExprs as targets, and if so, turn
19322         them into toplevel access objects.
19323
19324 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
19325
19326         * expression.cs: PropertyExpr::PropertyExpr: use work around the
19327         SRE.
19328
19329         * typemanager.cs: Keep track here of our PropertyBuilders again to
19330         work around lameness in SRE.
19331
19332 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
19333
19334         * expression.cs (LValue::LValueResolve): New method in the
19335         interface, used to perform a second resolution pass for LValues. 
19336
19337         (This::DoResolve): Catch the use of this in static methods.
19338
19339         (This::LValueResolve): Implement.
19340
19341         (This::Store): Remove warning, assigning to `this' in structures
19342         is 
19343
19344         (Invocation::Emit): Deal with invocation of
19345         methods on value types.  We need to pass the address to structure
19346         methods rather than the object itself.  (The equivalent code to
19347         emit "this" for structures leaves the entire structure on the
19348         stack instead of a pointer to it). 
19349
19350         (ParameterReference::DoResolve): Compute the real index for the
19351         argument based on whether the method takes or not a `this' pointer
19352         (ie, the method is static).
19353
19354         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
19355         value types returned from functions when we need to invoke a
19356         method on the sturcture.
19357
19358
19359 2001-10-11  Ravi Pratap  <ravi@ximian.com>
19360
19361         * class.cs (TypeContainer::DefineType): Method to actually do the business of
19362         defining the type in the Modulebuilder or Typebuilder. This is to take
19363         care of nested types which need to be defined on the TypeBuilder using
19364         DefineNestedMethod.
19365
19366         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
19367         methods in RootContext, only ported to be part of TypeContainer.
19368
19369         (TypeContainer::GetInterfaceOrClass): Ditto.
19370
19371         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
19372
19373         * interface.cs (Interface::DefineInterface): New method. Does exactly
19374         what RootContext.CreateInterface did earlier, only it takes care of nested types 
19375         too.
19376
19377         (Interface::GetInterfaces): Move from RootContext here and port.
19378
19379         (Interface::GetInterfaceByName): Same here.
19380
19381         * rootcontext.cs (ResolveTree): Re-write.
19382
19383         (PopulateTypes): Re-write.
19384
19385         * class.cs (TypeContainer::Populate): Populate nested types too.
19386         (TypeContainer::Emit): Emit nested members too.
19387
19388         * typemanager.cs (AddUserType): Do not make use of the FullName property,
19389         instead just use the name argument passed in as it is already fully
19390         qualified.
19391
19392         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
19393         to TypeContainer mapping to see if a type is user-defined.
19394
19395         * class.cs (TypeContainer::CloseType): Implement. 
19396
19397         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
19398         the default constructor.
19399
19400         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
19401         twice.
19402
19403         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
19404
19405         * interface.cs (CloseType): Create the type here.
19406
19407         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
19408         the hierarchy.
19409
19410         Remove all the methods which are now in TypeContainer.
19411
19412 2001-10-10  Ravi Pratap  <ravi@ximian.com>
19413
19414         * delegate.cs (Define): Re-write bits to define the delegate
19415         correctly.
19416
19417 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
19418
19419         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
19420
19421         * expression.cs (ImplicitReferenceConversion): handle null as well
19422         as a source to convert to any reference type.
19423
19424         * statement.cs (Return): Perform any implicit conversions to
19425         expected return type.  
19426
19427         Validate use of return statement.  
19428
19429         * codegen.cs (EmitContext): Pass the expected return type here.
19430
19431         * class.cs (Method, Constructor, Property): Pass expected return
19432         type to EmitContext.
19433
19434 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
19435
19436         * expression.cs: Make DoResolve take an EmitContext instead of a
19437         TypeContainer.
19438
19439         Replaced `l' and `location' for `loc', for consistency.
19440
19441         (Error, Warning): Remove unneeded Tc argument.
19442
19443         * assign.cs, literal.cs, constant.cs: Update to new calling
19444         convention. 
19445
19446         * codegen.cs: EmitContext now contains a flag indicating whether
19447         code is being generated in a static method or not.
19448
19449         * cs-parser.jay: DecomposeQI, new function that replaces the old
19450         QualifiedIdentifier.  Now we always decompose the assembled
19451         strings from qualified_identifier productions into a group of
19452         memberaccesses.
19453
19454 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
19455
19456         * rootcontext.cs: Deal with field-less struct types correctly now
19457         by passing the size option to Define Type.
19458
19459         * class.cs: Removed hack that created one static field. 
19460
19461 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19462
19463         * statement.cs: Moved most of the code generation here. 
19464
19465 2001-10-09  Ravi Pratap  <ravi@ximian.com>
19466
19467         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
19468         seem very right.
19469
19470         (ElementAccess): Remove useless bits for now - keep checks as the spec
19471         says.
19472
19473 2001-10-08  Ravi Pratap  <ravi@ximian.com>
19474
19475         * expression.cs (ElementAccess::DoResolve): Remove my crap code
19476         and start performing checks according to the spec.
19477
19478 2001-10-07  Ravi Pratap  <ravi@ximian.com>
19479
19480         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
19481         rank_specifiers instead.
19482
19483         (rank_specifiers): Change the order in which the rank specifiers are stored
19484
19485         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
19486
19487         * expression.cs (ElementAccess): Implement the LValue interface too.
19488
19489 2001-10-06  Ravi Pratap  <ravi@ximian.com>
19490
19491         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
19492         except that user defined conversions are not included.
19493
19494         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
19495         perform the conversion of the return type, if necessary.
19496
19497         (New::DoResolve): Check whether we are creating an array or an object
19498         and accordingly do the needful.
19499
19500         (New::Emit): Same here.
19501
19502         (New::DoResolve): Implement guts of array creation.
19503
19504         (New::FormLookupType): Helper function.
19505
19506 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
19507
19508         * codegen.cs: Removed most of the code generation here, and move the
19509         corresponding code generation bits to the statement classes. 
19510
19511         Added support for try/catch/finalize and throw.
19512
19513         * cs-parser.jay: Added support for try/catch/finalize.
19514
19515         * class.cs: Catch static methods having the flags override,
19516         virtual or abstract.
19517
19518         * expression.cs (UserCast): This user cast was not really doing
19519         what it was supposed to do.  Which is to be born in fully resolved
19520         state.  Parts of the resolution were being performed at Emit time! 
19521
19522         Fixed this code.
19523
19524 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19525
19526         * expression.cs: Implicity convert the result from UserCast.
19527
19528 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19529
19530         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
19531         prevented it from working correctly. 
19532
19533         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
19534         merely ConvertImplicit.
19535
19536 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
19537
19538         * typemanager.cs: Make the LookupTypeContainer function static,
19539         and not per-instance.  
19540
19541         * class.cs: Make static FindMembers (the one that takes a Type
19542         argument). 
19543
19544         * codegen.cs: Add EmitForeach here.
19545
19546         * cs-parser.jay: Make foreach a toplevel object instead of the
19547         inline expansion, as we need to perform semantic analysis on it. 
19548
19549 2001-10-05  Ravi Pratap  <ravi@ximian.com>
19550
19551         * expression.cs (Expression::ImplicitUserConversion): Rename to
19552         UserDefinedConversion.
19553
19554         (Expression::UserDefinedConversion): Take an extra argument specifying 
19555         whether we look for explicit user conversions too.
19556
19557         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
19558
19559         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
19560
19561         (ExplicitUserConversion): Make it a call to UserDefinedConversion
19562         with the appropriate arguments.
19563
19564         * cs-parser.jay (cast_expression): Record location too.
19565
19566         * expression.cs (Cast): Record location info.
19567
19568         (Expression::ConvertExplicit): Take location argument.
19569
19570         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
19571         to determine if we are doing explicit conversions.
19572
19573         (UserCast::Emit): Update accordingly.
19574
19575         (Expression::ConvertExplicit): Report an error if everything fails.
19576
19577         * ../errors/cs0030.cs : Add.
19578
19579 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
19580
19581         * modifiers.cs: If the ABSTRACT keyword is present, also set the
19582         virtual and newslot bits. 
19583
19584         * class.cs (TypeContainer::RegisterRequiredImplementations):
19585         Record methods we need.
19586
19587         (TypeContainer::MakeKey): Helper function to make keys for
19588         MethodBases, since the Methodbase key is useless.
19589
19590         (TypeContainer::Populate): Call RegisterRequiredImplementations
19591         before defining the methods.   
19592
19593         Create a mapping for method_builders_to_methods ahead of time
19594         instead of inside a tight loop.
19595
19596         (::RequireMethods):  Accept an object as the data to set into the
19597         hashtable so we can report interface vs abstract method mismatch.
19598
19599 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * report.cs: Make all of it static.
19602
19603         * rootcontext.cs: Drop object_type and value_type computations, as
19604         we have those in the TypeManager anyways.
19605
19606         Drop report instance variable too, now it is a global.
19607
19608         * driver.cs: Use try/catch on command line handling.
19609
19610         Add --probe option to debug the error reporting system with a test
19611         suite. 
19612
19613         * report.cs: Add support for exiting program when a probe
19614         condition is reached.
19615
19616 2001-10-03  Ravi Pratap  <ravi@ximian.com>
19617
19618         * expression.cs (Binary::DoNumericPromotions): Fix the case when
19619         we do a forcible conversion regardless of type, to check if 
19620         ForceConversion returns a null.
19621
19622         (Binary::error19): Use location to report error.
19623
19624         (Unary::error23): Use location here too.
19625
19626         * ../errors/cs0019.cs : Check in.
19627
19628         * ../errors/cs0023.cs : Check in.
19629
19630         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
19631         case of a non-null MethodInfo object with a length of 0 !
19632
19633         (Binary::ResolveOperator): Flag error if overload resolution fails to find
19634         an applicable member - according to the spec :-)
19635         Also fix logic to find members in base types.
19636
19637         (Unary::ResolveOperator): Same here.
19638
19639         (Unary::report23): Change name to error23 and make first argument a TypeContainer
19640         as I was getting thoroughly confused between this and error19 :-)
19641
19642         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
19643         (::FindMostEncompassedType): Implement.
19644         (::FindMostEncompassingType): Implement.
19645         (::StandardConversionExists): Implement.
19646
19647         (UserImplicitCast): Re-vamp. We now need info about most specific
19648         source and target types so that we can do the necessary conversions.
19649
19650         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
19651         mathematical union with no duplicates.
19652
19653 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
19654
19655         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
19656         in order from base classes to child classes, so that we can in
19657         child classes look up in our parent for method names and
19658         attributes (required for handling abstract, virtual, new, override
19659         constructs: we need to instrospect our base class, and if we dont
19660         populate the classes in order, the introspection might be
19661         incorrect.  For example, a method could query its parent before
19662         the parent has any methods and would determine that the parent has
19663         no abstract methods (while it could have had them)).
19664
19665         (RootContext::CreateType): Record the order in which we define the
19666         classes.
19667
19668 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
19669
19670         * class.cs (TypeContainer::Populate): Also method definitions can
19671         fail now, keep track of this.
19672
19673         (TypeContainer::FindMembers): Implement support for
19674         DeclaredOnly/noDeclaredOnly flag.
19675
19676         (Constructor::Emit) Return the ConstructorBuilder.
19677
19678         (Method::Emit) Return the MethodBuilder. 
19679         Check for abstract or virtual methods to be public.
19680
19681         * rootcontext.cs (RootContext::CreateType): Register all the
19682         abstract methods required for the class to be complete and the
19683         interface methods that must be implemented. 
19684
19685         * cs-parser.jay: Report error 501 (method requires body if it is
19686         not marked abstract or extern).
19687
19688         * expression.cs (TypeOf::Emit): Implement.
19689
19690         * typemanager.cs: runtime_handle_type, new global type.
19691
19692         * class.cs (Property::Emit): Generate code for properties.
19693
19694 2001-10-02  Ravi Pratap  <ravi@ximian.com>
19695
19696         * expression.cs (Unary::ResolveOperator): Find operators on base type
19697         too - we now conform exactly to the spec.
19698
19699         (Binary::ResolveOperator): Same here.
19700
19701         * class.cs (Operator::Define): Fix minor quirk in the tests.
19702
19703         * ../errors/cs0215.cs : Added.
19704
19705         * ../errors/cs0556.cs : Added.
19706
19707         * ../errors/cs0555.cs : Added.
19708
19709 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
19712         single integer which is really efficient
19713
19714 2001-10-01  Ravi Pratap  <ravi@ximian.com>
19715
19716         *  expression.cs (Expression::ImplicitUserConversion): Use location
19717         even in the case when we are examining True operators.
19718  
19719         * class.cs (Operator::Define): Perform extensive checks to conform
19720         with the rules for operator overloading in the spec.
19721
19722         * expression.cs (Expression::ImplicitReferenceConversion): Implement
19723         some of the other conversions mentioned in the spec.
19724
19725         * typemanager.cs (array_type): New static member for the System.Array built-in
19726         type.
19727
19728         (cloneable_interface): For System.ICloneable interface.
19729
19730         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
19731         we start resolving the tree and populating types.
19732
19733         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
19734  
19735 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
19736
19737         * expression.cs (Expression::ExprClassFromMemberInfo,
19738         Expression::Literalize): Create literal expressions from
19739         FieldInfos which are literals.
19740
19741         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
19742         type casts, because they were wrong.  The test suite in tests
19743         caught these ones.
19744
19745         (ImplicitNumericConversion): ushort to ulong requires a widening
19746         cast. 
19747
19748         Int32 constant to long requires widening cast as well.
19749
19750         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
19751         for integers because the type on the stack is not i4.
19752
19753 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
19754
19755         * expression.cs (report118): require location argument. 
19756
19757         * parameter.cs: Do not dereference potential null value.
19758
19759         * class.cs: Catch methods that lack the `new' keyword when
19760         overriding a name.  Report warnings when `new' is used without
19761         anything being there to override.
19762
19763         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
19764
19765         * class.cs: Only add constructor to hashtable if it is non-null
19766         (as now constructors can fail on define).
19767
19768         (TypeManager, Class, Struct): Take location arguments.
19769
19770         Catch field instance initialization in structs as errors.
19771
19772         accepting_filter: a new filter for FindMembers that is static so
19773         that we dont create an instance per invocation.
19774
19775         (Constructor::Define): Catch errors where a struct constructor is
19776         parameterless 
19777
19778         * cs-parser.jay: Pass location information for various new
19779         constructs. 
19780
19781         * delegate.cs (Delegate): take a location argument.
19782
19783         * driver.cs: Do not call EmitCode if there were problesm in the
19784         Definition of the types, as many Builders wont be there. 
19785
19786         * decl.cs (Decl::Decl): Require a location argument.
19787
19788         * cs-tokenizer.cs: Handle properly hex constants that can not fit
19789         into integers, and find the most appropiate integer for it.
19790
19791         * literal.cs: Implement ULongLiteral.
19792
19793         * rootcontext.cs: Provide better information about the location of
19794         failure when CreateType fails.
19795
19796 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
19797
19798         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
19799         as well.
19800
19801         * expression.cs (Binary::CheckShiftArguments): Add missing type
19802         computation.
19803         (Binary::ResolveOperator): Add type to the logical and and logical
19804         or, Bitwise And/Or and Exclusive Or code paths, it was missing
19805         before.
19806
19807         (Binary::DoNumericPromotions): In the case where either argument
19808         is ulong (and most signed types combined with ulong cause an
19809         error) perform implicit integer constant conversions as well.
19810
19811 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19812
19813         * expression.cs (UserImplicitCast): Method should always be
19814         non-null. 
19815         (Invocation::BetterConversion): Simplified test for IntLiteral.
19816
19817         (Expression::ImplicitNumericConversion): Split this routine out.
19818         Put the code that performs implicit constant integer conversions
19819         here. 
19820
19821         (Expression::Resolve): Become a wrapper around DoResolve so we can
19822         check eclass and type being set after resolve.
19823
19824         (Invocation::Badness): Remove this dead function
19825
19826         (Binary::ResolveOperator): Do not compute the expensive argumnets
19827         unless we have a union for it.
19828
19829         (Probe::Emit): Is needs to do an isinst and then
19830         compare against null.
19831
19832         (::CanConvert): Added Location argument.  If the Location argument
19833         is null (Location.Null), then we do not report errors.  This is
19834         used by the `probe' mechanism of the Explicit conversion.  We do
19835         not want to generate an error for something that the user
19836         explicitly requested to be casted.  But the pipeline for an
19837         explicit cast first tests for potential implicit casts.
19838
19839         So for now, if the Location is null, it means `Probe only' to
19840         avoid adding another argument.   Might have to revise this
19841         strategy later.
19842
19843         (ClassCast): New class used to type cast objects into arbitrary
19844         classes (used in Explicit Reference Conversions).
19845
19846         Implement `as' as well.
19847
19848         Reverted all the patches from Ravi below: they were broken:
19849
19850                 * The use of `level' as a mechanism to stop recursive
19851                   invocations is wrong.  That was there just to catch the
19852                   bug with a strack trace but not as a way of addressing
19853                   the problem.
19854
19855                   To fix the problem we have to *understand* what is going
19856                   on and the interactions and come up with a plan, not
19857                   just get things going.
19858
19859                 * The use of the type conversion cache that I proposed
19860                   last night had an open topic: How does this work across
19861                   protection domains.  A user defined conversion might not
19862                   be public in the location where we are applying the
19863                   conversion, a different conversion might be selected
19864                   (ie, private A->B (better) but public B->A (worse),
19865                   inside A, A->B applies, but outside it, B->A will
19866                   apply).
19867
19868                 * On top of that (ie, even if the above is solved),
19869                   conversions in a cache need to be abstract.  Ie, `To
19870                   convert from an Int to a Short use an OpcodeCast', not
19871                   `To convert from an Int to a Short use the OpcodeCast on
19872                   the variable 5' (which is what this patch was doing).
19873
19874 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19875
19876         * expression.cs (Invocation::ConversionExists): Re-write to use
19877         the conversion cache
19878
19879         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
19880         cache all conversions done, not just user-defined ones.
19881
19882         (Invocation::BetterConversion): The real culprit. Use ConversionExists
19883         to determine if a conversion exists instead of acutually trying to 
19884         perform the conversion. It's faster too.
19885
19886         (Expression::ConvertExplicit): Modify to use ConversionExists to check
19887         and only then attempt the implicit conversion.
19888
19889 2001-09-28  Ravi Pratap  <ravi@ximian.com>
19890
19891         * expression.cs (ConvertImplicit): Use a cache for conversions
19892         already found. Check level of recursion and bail out if necessary.
19893
19894 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * typemanager.cs (string_concat_string_string, string_concat_object_object):
19897         Export standard methods that we expect for string operations.
19898
19899         * statement.cs (Block::UsageWarning): Track usage of variables and
19900         report the errors for not used variables.
19901
19902         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
19903         operator. 
19904
19905 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
19906
19907         * codegen.cs: remove unnneded code 
19908
19909         * expression.cs: Removed BuiltinTypeAccess class
19910
19911         Fix the order in which implicit conversions are
19912         done.  
19913
19914         The previous fixed dropped support for boxed conversions (adding a
19915         test to the test suite now)
19916
19917         (UserImplicitCast::CanConvert): Remove test for source being null,
19918         that code is broken.  We should not feed a null to begin with, if
19919         we do, then we should track the bug where the problem originates
19920         and not try to cover it up here.
19921
19922         Return a resolved expression of type UserImplicitCast on success
19923         rather than true/false.  Ravi: this is what I was talking about,
19924         the pattern is to use a static method as a "constructor" for
19925         objects. 
19926
19927         Also, do not create arguments until the very last minute,
19928         otherwise we always create the arguments even for lookups that
19929         will never be performed. 
19930
19931         (UserImplicitCast::Resolve): Eliminate, objects of type
19932         UserImplicitCast are born in a fully resolved state. 
19933
19934         * typemanager.cs (InitCoreTypes): Init also value_type
19935         (System.ValueType). 
19936
19937         * expression.cs (Cast::Resolve): First resolve the child expression.
19938
19939         (LValue): Add new method AddressOf to be used by
19940         the `&' operator.  
19941
19942         Change the argument of Store to take an EmitContext instead of an
19943         ILGenerator, because things like FieldExpr need to be able to call
19944         their children expression to generate the instance code. 
19945
19946         (Expression::Error, Expression::Warning): Sugar functions for
19947         reporting errors.
19948
19949         (Expression::MemberLookup): Accept a TypeContainer instead of a
19950         Report as the first argument.
19951
19952         (Expression::ResolvePrimary): Killed.  I still want to improve
19953         this as currently the code is just not right.
19954
19955         (Expression::ResolveMemberAccess): Simplify, but it is still
19956         wrong. 
19957
19958         (Unary::Resolve): Catch errors in AddressOf operators.
19959
19960         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
19961         index to a byte for the short-version, or the compiler will choose
19962         the wrong Emit call, which generates the wrong data.
19963
19964         (ParameterReference::Emit, ::Store): same.
19965
19966         (FieldExpr::AddressOf): Implement.
19967
19968         * typemanager.cs: TypeManager: made public variable instead of
19969         property.
19970
19971         * driver.cs: document --fatal.
19972
19973         * report.cs (ErrorMessage, WarningMessage): new names for the old
19974         Error and Warning classes.
19975
19976         * cs-parser.jay (member_access): Turn built-in access to types
19977         into a normal simplename
19978
19979 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19980
19981         * expression.cs (Invocation::BetterConversion): Fix to cope
19982         with q being null, since this was introducing a bug.
19983
19984         * expression.cs (ConvertImplicit): Do built-in conversions first.
19985
19986 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19987
19988         * expression.cs (UserImplicitCast::Resolve): Fix bug.
19989
19990 2001-09-27  Ravi Pratap  <ravi@ximian.com>
19991
19992         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
19993         I had introduced long ago (what's new ?).
19994
19995         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
19996         the work of all the checking. 
19997         (ConvertImplicit): Call CanConvert and only then create object if necessary.
19998         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
19999
20000         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
20001         that is the right way. 
20002
20003         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
20004         overloading resolution. Use everywhere instead of cutting and pasting code.
20005
20006         (Binary::ResolveOperator): Use MakeUnionSet.
20007
20008         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
20009         we have to convert to bool types. Not complete yet.
20010
20011 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * typemanager.cs (TypeManager::CSharpName): support ushort.
20014
20015         * expression.cs (Expression::TryImplicitIntConversion): Attempts
20016         to provide an expression that performsn an implicit constant int
20017         conversion (section 6.1.6).
20018         (Expression::ConvertImplicitRequired): Reworked to include
20019         implicit constant expression conversions.
20020
20021         (Expression::ConvertNumericExplicit): Finished.
20022
20023         (Invocation::Emit): If InstanceExpression is null, then it means
20024         that we perform a call on this.
20025
20026 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20027
20028         * expression.cs (Unary::Emit): Remove some dead code.
20029         (Probe): Implement Resolve and Emit for `is'.
20030         (Expression::ConvertImplicitRequired): Attempt to do constant
20031         expression conversions here.  Maybe should be moved to
20032         ConvertImplicit, but I am not sure.
20033         (Expression::ImplicitLongConstantConversionPossible,
20034         Expression::ImplicitIntConstantConversionPossible): New functions
20035         that tell whether is it possible to apply an implicit constant
20036         expression conversion.
20037
20038         (ConvertNumericExplicit): Started work on explicit numeric
20039         conversions.
20040
20041         * cs-parser.jay: Update operator constants.
20042
20043         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
20044         (Parameters::GetSignature): Hook up VerifyArgs here.
20045         (Parameters::VerifyArgs): Verifies that no two arguments have the
20046         same name. 
20047
20048         * class.cs (Operator): Update the operator names to reflect the
20049         ones that the spec expects (as we are just stringizing the
20050         operator names).
20051
20052         * expression.cs (Unary::ResolveOperator): Fix bug: Use
20053         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
20054         previous usage did only work for our methods.
20055         (Expression::ConvertImplicit): Handle decimal implicit numeric
20056         conversions as well.
20057         (Expression::InternalTypeConstructor): Used to invoke constructors
20058         on internal types for default promotions.
20059
20060         (Unary::Emit): Implement special handling for the pre/post
20061         increment/decrement for overloaded operators, as they need to have
20062         the same semantics as the other operators.
20063
20064         (Binary::ResolveOperator): ditto.
20065         (Invocation::ConversionExists): ditto.
20066         (UserImplicitCast::Resolve): ditto.
20067
20068 2001-09-26  Ravi Pratap  <ravi@ximian.com>
20069
20070         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
20071         operator, return after emitting body. Regression tests pass again !
20072
20073         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
20074         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
20075         (Invocation::OverloadResolve): Ditto.
20076         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
20077
20078         * everywhere : update calls to the above methods accordingly.
20079
20080 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * assign.cs (Assign): Make it inherit from ExpressionStatement.
20083
20084         * expression.cs (ExpressionStatement): New base class used for
20085         expressions that can appear in statements, so that we can provide
20086         an alternate path to generate expression that do not leave a value
20087         on the stack.
20088
20089         (Expression::Emit, and all the derivatives): We no longer return
20090         whether a value is left on the stack or not.  Every expression
20091         after being emitted leaves a single value on the stack.
20092
20093         * codegen.cs (EmitContext::EmitStatementExpression): Use the
20094         facilties of ExpressionStatement if possible.
20095
20096         * cs-parser.jay: Update statement_expression.
20097
20098 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
20099
20100         * driver.cs: Change the wording of message
20101
20102 2001-09-25  Ravi Pratap  <ravi@ximian.com>
20103
20104         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
20105         the type of the expression to the return type of the method if
20106         we have an overloaded operator match ! The regression tests pass again !
20107         (Unary::ResolveOperator): Ditto.
20108
20109         * expression.cs (Invocation::ConversionExists): Correct the member lookup
20110         to find "op_Implicit", not "implicit" ;-)
20111         (UserImplicitCast): New class to take care of user-defined implicit conversions.
20112         (ConvertImplicit, ForceConversion): Take TypeContainer argument
20113
20114         * everywhere : Correct calls to the above accordingly.
20115
20116         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
20117         (ConvertImplicit): Do user-defined conversion if it exists.
20118
20119 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
20120
20121         * assign.cs: track location.
20122         (Resolve): Use implicit conversions on assignment.
20123
20124         * literal.cs: Oops.  Not good, Emit of short access values should
20125         pass (Bytes) or the wrong argument will be selected.
20126
20127         * expression.cs (Unary::Emit): Emit code for -expr.
20128
20129         (Unary::ResolveOperator): Handle `Substract' for non-constants
20130         (substract from zero from the non-constants).
20131         Deal with Doubles as well. 
20132
20133         (Expression::ConvertImplicitRequired): New routine that reports an
20134         error if no implicit conversion exists. 
20135
20136         (Invocation::OverloadResolve): Store the converted implicit
20137         expressions if we make them
20138
20139 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20140
20141         * class.cs (ConstructorInitializer): Take a Location argument.
20142         (ConstructorBaseInitializer): Same here.
20143         (ConstructorThisInitializer): Same here.
20144
20145         * cs-parser.jay : Update all calls accordingly.
20146
20147         * expression.cs (Unary, Binary, New): Take location argument.
20148         Update accordingly everywhere.
20149
20150         * cs-parser.jay : Update all calls to the above to take a location
20151         argument.
20152
20153         * class.cs : Ditto.
20154
20155 2001-09-24  Ravi Pratap  <ravi@ximian.com>
20156
20157         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
20158         (Invocation::BetterConversion): Same here
20159         (Invocation::ConversionExists): Ditto.
20160
20161         (Invocation::ConversionExists): Implement.
20162
20163 2001-09-22  Ravi Pratap  <ravi@ximian.com>
20164
20165         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
20166         Also take an additional TypeContainer argument.
20167
20168         * All over : Pass in TypeContainer as argument to OverloadResolve.
20169
20170         * typemanager.cs (CSharpName): Update to check for the string type and return
20171         that too.
20172
20173         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
20174         a given method.
20175
20176 2001-09-21  Ravi Pratap  <ravi@ximian.com>
20177
20178         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
20179         (Invocation::BetterFunction): Implement.
20180         (Invocation::BetterConversion): Implement.
20181         (Invocation::ConversionExists): Skeleton, no implementation yet.
20182
20183         Okay, things work fine !
20184
20185 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
20186
20187         * typemanager.cs: declare and load enum_type, delegate_type and
20188         void_type. 
20189
20190         * expression.cs (Expression::Emit): Now emit returns a value that
20191         tells whether a value is left on the stack or not.  This strategy
20192         might be reveted tomorrow with a mechanism that would address
20193         multiple assignments.
20194         (Expression::report118): Utility routine to report mismatches on
20195         the ExprClass.
20196
20197         (Unary::Report23): Report impossible type/operator combination
20198         utility function.
20199
20200         (Unary::IsIncrementableNumber): Whether the type can be
20201         incremented or decremented with add.
20202         (Unary::ResolveOperator): Also allow enumerations to be bitwise
20203         complemented. 
20204         (Unary::ResolveOperator): Implement ++, !, ~,
20205
20206         (Invocation::Emit): Deal with new Emit convetion.
20207
20208         * All Expression derivatives: Updated their Emit method to return
20209         whether they leave values on the stack or not.
20210
20211         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
20212         stack for expressions that are statements. 
20213
20214 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20215
20216         * expression.cs (LValue): New interface.  Must be implemented by
20217         LValue objects.
20218         (LocalVariableReference, ParameterReference, FieldExpr): Implement
20219         LValue interface.
20220
20221         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
20222         interface for generating code, simplifies the code.
20223
20224 2001-09-20  Ravi Pratap  <ravi@ximian.com>
20225
20226         * expression.cs (everywhere): Comment out return statements in ::Resolve
20227         methods to avoid the warnings.
20228
20229 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
20230
20231         * driver.cs (parse): Report error 2001 if we can not open the
20232         source file.
20233
20234         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
20235         not resolve it.
20236
20237         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
20238         object. 
20239
20240         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
20241         otherwise nested blocks end up with the same index.
20242
20243         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
20244
20245         * expression.cs:  Instead of having FIXMEs in the Resolve
20246         functions, throw exceptions so it is obvious that we are facing a
20247         bug. 
20248
20249         * cs-parser.jay (invocation_expression): Pass Location information.
20250
20251         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
20252         Use a basename for those routines because .NET does not like paths
20253         on them. 
20254
20255         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
20256         already defined.
20257
20258 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
20259
20260         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
20261         are loading the correct data types (throws an exception if not).
20262         (TypeManager::InitCoreTypes): Use CoreLookupType
20263
20264         * expression.cs (Unary::ResolveOperator): return the child
20265         expression for expressions which are just +expr.
20266         (Unary::ResolveOperator): Return negative literals for -LITERAL
20267         expressions (otherwise they are Unary {Literal}).
20268         (Invocation::Badness): Take into account `Implicit constant
20269         expression conversions'.
20270
20271         * literal.cs (LongLiteral): Implement long literal class.
20272         (IntLiteral): export the `Value' of the intliteral. 
20273
20274 2001-09-19  Ravi Pratap  <ravi@ximian.com>
20275
20276         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
20277
20278         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
20279         instead of 'Operator'
20280
20281         * expression.cs (Binary::ResolveOperator): Update accordingly.
20282         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
20283         and 'Minus'
20284
20285         * cs-parser.jay (unary_expression): Update to use the new names.
20286
20287         * gen-treedump.cs (GetUnary): Same here.
20288
20289         * expression.cs (Unary::Resolve): Implement.
20290         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
20291         operators are found instead of making noise ;-)
20292         (Unary::ResolveOperator): New method to do precisely the same thing which
20293         Binary::ResolveOperator does for Binary expressions.
20294         (Unary.method, .Arguments): Add.
20295         (Unary::OperName): Implement.   
20296         (Unary::ForceConversion): Copy and Paste !
20297
20298         * class.cs (Operator::Define): Fix a small bug for the case when we have 
20299         a unary operator.
20300
20301         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
20302         for the inbuilt operators. Only overloading works for now ;-)
20303
20304 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
20305
20306         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
20307         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
20308
20309         * expression.cs (This::Emit): Implement. 
20310         (This::Resolve): Implement.
20311         (TypeOf:Resolve): Implement.
20312         (Expression::ResolveSimpleName): Add an implicit this to instance
20313         field references. 
20314         (MemberAccess::Resolve): Deal with Parameters and Fields. 
20315         Bind instance variable to Field expressions.
20316         (FieldExpr::Instance): New field used to track the expression that
20317         represents the object instance.
20318         (FieldExpr::Resolve): Track potential errors from MemberLookup not
20319         binding 
20320         (FieldExpr::Emit): Implement.
20321
20322         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
20323         the last instruction contains a return opcode to avoid generating
20324         the last `ret' instruction (this generates correct code, and it is
20325         nice to pass the peverify output).
20326
20327         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
20328         initializer for static and instance variables.
20329         (Constructor::Emit): Allow initializer to be null in the case of
20330         static constructors.  Only emit initializer for instance
20331         constructors. 
20332
20333         (TypeContainer::FindMembers): Return a null array if there are no
20334         matches.
20335
20336         Also fix the code for the MemberTypes.Method branch, as it was not
20337         scanning that for operators (or tried to access null variables before).
20338
20339         * assign.cs (Assign::Emit): Handle instance and static fields. 
20340
20341         * TODO: Updated.
20342
20343         * driver.cs: Stop compilation if there are parse errors.
20344
20345         * cs-parser.jay (constructor_declaration): Provide default base
20346         initializer for non-static constructors.
20347         (constructor_declarator): Do not provide a default base
20348         initializers if none was specified.
20349         Catch the fact that constructors should not have parameters.
20350
20351         * class.cs: Do not emit parent class initializers for static
20352         constructors, that should be flagged as an error.
20353
20354 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20355
20356         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
20357         Move back code into TypeContainer::Populate.
20358
20359 2001-09-18  Ravi Pratap  <ravi@ximian.com>
20360
20361         * class.cs (TypeContainer::AddConstructor): Fix the check to
20362         compare against Name, not Basename. 
20363         (Operator::OpType): Change Plus and Minus to Add and Subtract.
20364
20365         * cs-parser.jay : Update accordingly.
20366
20367         * class.cs (TypeContainer::FindMembers): For the case where we are searching
20368         for methods, don't forget to look into the operators too.
20369         (RegisterMethodBuilder): Helper method to take care of this for
20370         methods, constructors and operators.
20371         (Operator::Define): Completely revamp.
20372         (Operator.OperatorMethod, MethodName): New fields.
20373         (TypeContainer::Populate): Move the registering of builders into
20374         RegisterMethodBuilder.
20375         (Operator::Emit): Re-write.
20376
20377         * expression.cs (Binary::Emit): Comment out code path to emit method
20378         invocation stuff for the case when we have a user defined operator. I am
20379         just not able to get it right !
20380
20381 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20382
20383         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
20384         argument. 
20385
20386         (Expression::MemberLookup): Provide a version that allows to
20387         specify the MemberTypes and BindingFlags. 
20388
20389         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
20390         so it was not fetching variable information from outer blocks.
20391
20392         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
20393         Beforefieldinit as it was buggy.
20394
20395         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
20396         that Ravi put here.  
20397
20398         * class.cs (Constructor::Emit): Only emit if block is not null.
20399         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
20400         deal with this by semantically definining it as if the user had
20401         done it.
20402
20403         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
20404         constructors as we now "emit" them at a higher level.
20405
20406         (TypeContainer::DefineDefaultConstructor): Used to define the
20407         default constructors if none was provided.
20408
20409         (ConstructorInitializer): Add methods Resolve and Emit. 
20410
20411         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
20412
20413 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20414
20415         * class.cs (TypeContainer::EmitDefaultConstructor): Register
20416         the default constructor builder with our hashtable for methodbuilders
20417         to methodcores.
20418
20419         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
20420         and argument_count is 0 in which case we have a match.
20421         (Binary::ResolveOperator): More null checking and miscellaneous coding
20422         style cleanup.
20423
20424 2001-09-17  Ravi Pratap  <ravi@ximian.com>
20425
20426         * rootcontext.cs (IsNameSpace): Compare against null.
20427
20428         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
20429
20430         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
20431         and Unary::Operator.
20432
20433         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
20434         accordingly.
20435
20436         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
20437         we have overloaded operators.
20438         (Binary::ResolveOperator): Implement the part which does the operator overload
20439         resolution.
20440
20441         * class.cs (Operator::Emit): Implement.
20442         (TypeContainer::Emit): Emit the operators we have too.
20443
20444         * expression.cs (Binary::Emit): Update to emit the appropriate code for
20445         the case when we have a user-defined operator.
20446
20447 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
20448
20449         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
20450
20451 2001-09-16  Ravi Pratap  <ravi@ximian.com>
20452
20453         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
20454         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
20455         (Constructor::Emit): Implement.
20456         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
20457         if we have no work to do. 
20458         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
20459         Emit method.
20460
20461         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
20462         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
20463
20464         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
20465         of parent.parent.
20466
20467 2001-09-15  Ravi Pratap  <ravi@ximian.com>
20468
20469         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
20470         in the source.
20471         (Tree::RecordNamespace): Method to do what the name says ;-)
20472         (Tree::Namespaces): Property to get at the namespaces hashtable.
20473
20474         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
20475         keep track.
20476
20477         * rootcontext.cs (IsNamespace): Fixed it :-)
20478
20479 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20480
20481         * class.cs (TypeContainer::FindMembers): Add support for
20482         constructors. 
20483         (MethodCore): New class that encapsulates both the shared aspects
20484         of a Constructor and a Method.  
20485         (Method, Constructor): Factored pieces into MethodCore.
20486
20487         * driver.cs: Added --fatal which makes errors throw exceptions.
20488         Load System assembly as well as part of the standard library.
20489
20490         * report.cs: Allow throwing exceptions on errors for debugging.
20491
20492         * modifiers.cs: Do not use `parent', instead use the real type
20493         container to evaluate permission settings.
20494
20495         * class.cs: Put Ravi's patch back in.  He is right, and we will
20496         have to cope with the
20497
20498 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20499
20500         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
20501         FamORAssem, not FamANDAssem.
20502
20503 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
20504
20505         * driver.cs: Added --parse option that only parses its input files
20506         and terminates.
20507
20508         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
20509         incorrect.  IsTopLevel is not used to tell whether an object is
20510         root_types or not (that can be achieved by testing this ==
20511         root_types).  But to see if this is a top-level *class* (not
20512         necessarly our "toplevel" container). 
20513
20514 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20515
20516         * enum.cs (Enum::Define): Modify to call the Lookup method on the
20517         parent instead of a direct call to GetType.
20518
20519 2001-09-14  Ravi Pratap  <ravi@ximian.com>
20520
20521         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
20522         Modifiers.TypeAttr. This should just be a call to that method.
20523
20524         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
20525         object so that we can determine if we are top-level or not.
20526
20527         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
20528         TypeContainer too.
20529
20530         * enum.cs (Enum::Define): Ditto.
20531
20532         * modifiers.cs (FieldAttr): Re-write.
20533
20534         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
20535         (TypeContainer::HaveStaticConstructor): New property to provide access
20536         to precisely that info.
20537
20538         * modifiers.cs (MethodAttr): Re-write.
20539         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
20540
20541         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
20542         of top-level types as claimed.
20543
20544 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20545
20546         * expression.cs (MemberLookup): Fruitless attempt to lookup
20547         constructors.  Maybe I need to emit default constructors?  That
20548         might be it (currently .NET emits this for me automatically).
20549         (Invocation::OverloadResolve): Cope with Arguments == null.
20550         (Invocation::EmitArguments): new function, shared by the new
20551         constructor and us.
20552         (Invocation::Emit): Handle static and instance methods.  Emit
20553         proper call instruction for virtual or non-virtual invocations.
20554         (New::Emit): Implement.
20555         (New::Resolve): Implement.
20556         (MemberAccess:Resolve): Implement.
20557         (MethodGroupExpr::InstanceExpression): used conforming to the spec
20558         to track instances.
20559         (FieldExpr::Resolve): Set type.
20560
20561         * support.cs: Handle empty arguments.
20562                 
20563         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
20564         SimpleLookup): Auxiliary routines to help parse a qualifier
20565         identifier.  
20566
20567         Update qualifier_identifier rule.
20568
20569         * codegen.cs: Removed debugging messages.
20570
20571         * class.cs: Make this a global thing, this acts just as a "key" to
20572         objects that we might have around.
20573
20574         (Populate): Only initialize method_builders_to_methods once.
20575
20576         * expression.cs (PropertyExpr): Initialize type from the
20577         PropertyType. 
20578
20579         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
20580         Resolve pattern.  Attempt to implicitly convert value to boolean.
20581         Emit code.
20582
20583         * expression.cs: Set the type for the int32/int32 argument case.
20584         (Binary::ResolveOperator): Set the return type to boolean for
20585         comparission operators
20586
20587         * typemanager.cs: Remove debugging print code.
20588
20589         (Invocation::Resolve): resolve type.
20590
20591         * class.cs: Allocate a MemberInfo of the correct size, as the code
20592         elsewhere depends on the test to reflect the correct contents.
20593
20594         (Method::) Keep track of parameters, due to System.Reflection holes
20595
20596         (TypeContainer::Populate): Keep track of MethodBuilders to Method
20597         mapping here.
20598
20599         (TypeContainer::FindMembers): Use ArrayList and then copy an array
20600         of the exact size and return that.
20601
20602         (Class::LookupMethodByBuilder): New function that maps
20603         MethodBuilders to its methods.  Required to locate the information
20604         on methods because System.Reflection bit us again.
20605
20606         * support.cs: New file, contains an interface ParameterData and
20607         two implementations: ReflectionParameters and InternalParameters
20608         used to access Parameter information.  We will need to grow this
20609         as required.
20610
20611         * expression.cs (Invocation::GetParameterData): implement a cache
20612         and a wrapper around the ParameterData creation for methods. 
20613         (Invocation::OverloadResolve): Use new code.
20614
20615 2001-09-13  Ravi Pratap  <ravi@ximian.com>
20616
20617         * class.cs (TypeContainer::EmitField): Remove and move into 
20618         (Field::Define): here and modify accordingly.
20619         (Field.FieldBuilder): New member.
20620         (TypeContainer::Populate): Update accordingly.
20621         (TypeContainer::FindMembers): Implement.
20622
20623 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
20624
20625         * statement.cs: (VariableInfo::VariableType): New field to be
20626         initialized with the full type once it is resolved. 
20627
20628 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
20629
20630         * parameter.cs (GetParameterInfo): Use a type cache to compute
20631         things only once, and to reuse this information
20632
20633         * expression.cs (LocalVariableReference::Emit): Implement.
20634         (OpcodeCast::Emit): fix.
20635
20636         (ParameterReference::Resolve): Implement.
20637         (ParameterReference::Emit): Implement.
20638
20639         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
20640         that are expressions need to stay as Expressions.
20641
20642         * typemanager.cs (CSharpName): Returns the C# name of a type if
20643         possible. 
20644
20645         * expression.cs (Expression::ConvertImplicit): New function that
20646         implements implicit type conversions.
20647
20648         (Expression::ImplicitReferenceConversion): Implements implicit
20649         reference conversions.
20650
20651         (EmptyCast): New type for transparent casts.
20652
20653         (OpcodeCast): New type for casts of types that are performed with
20654         a sequence of bytecodes.
20655
20656         (BoxedCast): New type used for casting value types into reference
20657         types.  Emits a box opcode.
20658
20659         (Binary::DoNumericPromotions): Implements numeric promotions of
20660         and computation of the Binary::Type.
20661
20662         (Binary::EmitBranchable): Optimization.
20663
20664         (Binary::Emit): Implement code emission for expressions.
20665
20666         * typemanager.cs (TypeManager): Added two new core types: sbyte
20667         and byte.
20668
20669 2001-09-12  Ravi Pratap  <ravi@ximian.com>
20670
20671         * class.cs (TypeContainer::FindMembers): Method which does exactly
20672         what Type.FindMembers does, only we don't have to use reflection. No
20673         implementation yet.
20674
20675         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
20676         typecontainer objects as we need to get at them.
20677         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
20678
20679         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
20680         typecontainer object.
20681
20682         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
20683         of just a Report object.
20684
20685 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20686
20687         * class.cs (Event::Define): Go back to using the prefixes "add_" and
20688         "remove_"
20689         (TypeContainer::Populate): Now define the delegates of the type too.
20690         (TypeContainer.Delegates): Property to access the list of delegates defined
20691         in the type.
20692
20693         * delegates.cs (Delegate::Define): Implement partially.
20694
20695         * modifiers.cs (TypeAttr): Handle more flags.
20696
20697 2001-09-11  Ravi Pratap  <ravi@ximian.com>
20698
20699         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
20700         and not <=
20701         (Operator::Define): Re-write logic to get types by using the LookupType method
20702         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
20703         (Indexer::Define): Ditto.
20704         (Event::Define): Ditto.
20705         (Property::Define): Ditto.
20706
20707 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20708
20709         * class.cs (TypeContainer::Populate): Now define operators too. 
20710         (TypeContainer.Operators): New property to access the list of operators
20711         in a type.
20712         (Operator.OperatorMethodBuilder): New member to hold the method builder
20713         for the operator we are defining.
20714         (Operator::Define): Implement.
20715
20716 2001-09-10  Ravi Pratap  <ravi@ximian.com>
20717
20718         * class.cs (Event::Define): Make the prefixes of the accessor methods
20719         addOn_ and removeOn_ 
20720
20721         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
20722         of the location being passed in too. Ideally, this should go later since all
20723         error reporting should be done through the Report object.
20724
20725         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
20726         (Populate): Iterate thru the indexers we have and define them too.
20727         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
20728         for the get and set accessors.
20729         (Indexer::Define): Implement.
20730
20731 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
20732
20733         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
20734         my previous implementation, did not work.
20735
20736         * typemanager.cs: Add a couple of missing types (the longs).
20737
20738         * literal.cs: Use TypeManager.bool_type instead of getting it.
20739
20740         * expression.cs (EventExpr): New kind of expressions.
20741         (Expressio::ExprClassFromMemberInfo): finish
20742
20743 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
20744
20745         * assign.cs: Emit stores to static fields differently.
20746
20747 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20748
20749         * Merge in changes and adjust code to tackle conflicts. Backed out my
20750         code in Assign::Resolve ;-) 
20751
20752 2001-09-08  Ravi Pratap  <ravi@ximian.com>
20753
20754         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
20755         instead Report.Error and also pass in the location.
20756         (CSharpParser::Lexer): New readonly property to return the reference
20757         to the Tokenizer object.
20758         (declare_local_variables): Use Report.Error with location instead of plain 
20759         old error.
20760         (CheckDef): Ditto.
20761
20762         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
20763         (Operator.CheckBinaryOperator): Ditto.
20764
20765         * cs-parser.jay (operator_declarator): Update accordingly.
20766
20767         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
20768         (CheckBinaryOperator): Same here.
20769
20770         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
20771         on the name without any prefixes of namespace names etc. This is because we
20772         already might have something already fully qualified like 
20773         'System.Console.WriteLine'
20774
20775         * assign.cs (Resolve): Begin implementation. Stuck ;-)
20776
20777 2001-09-07  Ravi Pratap  <ravi@ximian.com>
20778
20779         * cs-tokenizer.cs (location): Return a string which also contains
20780         the file name.
20781
20782         * expression.cs (ElementAccess): New class for expressions of the
20783         type 'element access.'
20784         (BaseAccess): New class for expressions of the type 'base access.'
20785         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
20786         respectively.
20787
20788         * cs-parser.jay (element_access): Implement action.
20789         (base_access): Implement actions.
20790         (checked_expression, unchecked_expression): Implement.
20791
20792         * cs-parser.jay (local_variable_type): Correct and implement.
20793         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
20794
20795         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
20796
20797         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
20798         name and the specifiers.
20799
20800         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
20801
20802         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
20803         making them all public ;-)
20804
20805         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
20806         class anyways.
20807
20808 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
20809
20810         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
20811         PropertyExprs.
20812         (FieldExpr, PropertyExprs): New resolved expressions.
20813         (SimpleName::MemberStaticCheck): Perform static checks for access
20814         to non-static fields on static methods. Maybe this should be
20815         generalized for MemberAccesses. 
20816         (SimpleName::ResolveSimpleName): More work on simple name
20817         resolution. 
20818
20819         * cs-parser.jay (primary_expression/qualified_identifier): track
20820         the parameter index.
20821
20822         * codegen.cs (CodeGen::Save): Catch save exception, report error.
20823         (EmitContext::EmitBoolExpression): Chain to expression generation
20824         instead of temporary hack.
20825         (::EmitStatementExpression): Put generic expression code generation.
20826
20827         * assign.cs (Assign::Emit): Implement variable assignments to
20828         local variables, parameters and fields.
20829
20830 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
20831
20832         * statement.cs (Block::GetVariableInfo): New method, returns the
20833         VariableInfo for a variable name in a block.
20834         (Block::GetVariableType): Implement in terms of GetVariableInfo
20835
20836         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
20837         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
20838
20839 2001-09-06  Ravi Pratap  <ravi@ximian.com>
20840
20841         * cs-parser.jay (operator_declaration): Continue on my quest : update
20842         to take attributes argument.
20843         (event_declaration): Ditto.
20844         (enum_declaration): Ditto.
20845         (indexer_declaration): Ditto.
20846
20847         * class.cs (Operator::Operator): Update constructor accordingly.
20848         (Event::Event): Ditto.
20849
20850         * delegate.cs (Delegate::Delegate): Same here.
20851
20852         * enum.cs (Enum::Enum): Same here.
20853
20854 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20855
20856         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
20857
20858         * ../tests/cs0658.cs : New file to demonstrate error 0658.
20859
20860         * attribute.cs (Attributes): New class to encapsulate all attributes which were
20861         being passed around as an arraylist.
20862         (Attributes::AddAttribute): Method to add attribute sections.
20863
20864         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
20865         (struct_declaration): Update accordingly.
20866         (constant_declaration): Update.
20867         (field_declaration): Update.
20868         (method_header): Update.
20869         (fixed_parameter): Update.
20870         (parameter_array): Ditto.
20871         (property_declaration): Ditto.
20872         (destructor_declaration): Ditto.
20873
20874         * class.cs (Struct::Struct): Update constructors accordingly.
20875         (Class::Class): Ditto.
20876         (Field::Field): Ditto.
20877         (Method::Method): Ditto.
20878         (Property::Property): Ditto.
20879         (TypeContainer::OptAttribute): update property's return type.
20880
20881         * interface.cs (Interface.opt_attributes): New member.
20882         (Interface::Interface): Update to take the extra Attributes argument.
20883
20884         * parameter.cs (Parameter::Parameter): Ditto.
20885
20886         * constant.cs (Constant::Constant): Ditto.
20887
20888         * interface.cs (InterfaceMemberBase): New OptAttributes field.
20889         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
20890         the attributes as a parameter.
20891         (InterfaceProperty): Update constructor call.
20892         (InterfaceEvent): Ditto.
20893         (InterfaceMethod): Ditto.
20894         (InterfaceIndexer): Ditto.
20895
20896         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
20897         pass the attributes too.
20898         (interface_event_declaration): Ditto.
20899         (interface_property_declaration): Ditto.
20900         (interface_method_declaration): Ditto.
20901         (interface_declaration): Ditto.
20902
20903 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
20904
20905         * class.cs (Method::Define): Track the "static Main" definition to
20906         create an entry point. 
20907
20908         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
20909         EntryPoint if we find it. 
20910
20911         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
20912         (EmitContext::ig): Make this variable public.
20913
20914         * driver.cs: Make the default output file be the first file name
20915         with the .exe extension.  
20916
20917         Detect empty compilations
20918
20919         Handle various kinds of output targets.  Handle --target and
20920         rename -t to --dumper.
20921
20922         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
20923         methods inherited from Expression return now an Expression.  This
20924         will is used during the tree rewriting as we resolve them during
20925         semantic analysis.
20926
20927         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
20928         the spec.  Missing entirely is the information about
20929         accessability of elements of it.
20930
20931         (Expression::ExprClassFromMemberInfo): New constructor for
20932         Expressions that creates a fully initialized Expression based on
20933         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
20934         a Type.
20935
20936         (Invocation::Resolve): Begin implementing resolution of invocations.
20937
20938         * literal.cs (StringLiteral):  Implement Emit.
20939
20940 2001-09-05  Ravi Pratap  <ravi@ximian.com>
20941
20942         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
20943         member.
20944
20945 2001-09-04  Ravi Pratap  <ravi@ximian.com>
20946
20947         * cs-parser.jay (attribute_arguments): Implement actions.
20948         (attribute): Fix bug in production. Implement action.
20949         (attribute_list): Implement.
20950         (attribute_target): Implement.
20951         (attribute_target_specifier, opt_target_specifier): Implement
20952         (CheckAttributeTarget): New method to check if the attribute target
20953         is valid.
20954         (attribute_section): Implement.
20955         (opt_attributes): Implement.
20956
20957         * attribute.cs : New file to handle attributes.
20958         (Attribute): Class to hold attribute info.
20959
20960         * cs-parser.jay (opt_attribute_target_specifier): Remove production
20961         (attribute_section): Modify production to use 2 different rules to 
20962         achieve the same thing. 1 s/r conflict down !
20963         Clean out commented, useless, non-reducing dimension_separator rules.
20964
20965         * class.cs (TypeContainer.attributes): New member to hold list
20966         of attributes for a type.
20967         (Struct::Struct): Modify to take one more argument, the attribute list.
20968         (Class::Class): Ditto.
20969         (Field::Field): Ditto.
20970         (Method::Method): Ditto.
20971         (Property::Property): Ditto.
20972
20973         * cs-parser.jay (struct_declaration): Update constructor call to
20974         pass in the attributes too.
20975         (class_declaration): Ditto.
20976         (constant_declaration): Ditto.
20977         (field_declaration): Ditto.
20978         (method_header): Ditto.
20979         (fixed_parameter): Ditto.
20980         (parameter_array): Ditto.
20981         (property_declaration): Ditto.
20982
20983         * constant.cs (Constant::Constant): Update constructor similarly.
20984         Use System.Collections.
20985
20986         * parameter.cs (Parameter::Parameter): Update as above.
20987
20988 2001-09-02  Ravi Pratap  <ravi@ximian.com>
20989
20990         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
20991         (TypeContainer.delegates): New member to hold list of delegates.
20992
20993         * cs-parser.jay (delegate_declaration): Implement the action correctly 
20994         this time as I seem to be on crack ;-)
20995
20996 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
20997
20998         * rootcontext.cs (RootContext::IsNamespace): new function, used to
20999         tell whether an identifier represents a namespace.
21000
21001         * expression.cs (NamespaceExpr): A namespace expression, used only
21002         temporarly during expression resolution.
21003         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
21004         utility functions to resolve names on expressions.
21005
21006 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
21007
21008         * codegen.cs: Add hook for StatementExpressions. 
21009
21010         * class.cs: Fix inverted test for static flag in methods.
21011
21012 2001-09-02  Ravi Pratap  <ravi@ximian.com>
21013
21014         * class.cs (Operator::CheckUnaryOperator): Correct error number used
21015         to make it coincide with MS' number.
21016         (Operator::CheckBinaryOperator): Ditto.
21017
21018         * ../errors/errors.txt : Remove error numbers added earlier.
21019
21020         * ../errors/cs1019.cs : Test case for error # 1019
21021
21022         * ../errros/cs1020.cs : Test case for error # 1020
21023
21024         * cs-parser.jay : Clean out commented cruft.
21025         (dimension_separators, dimension_separator): Comment out. Ostensibly not
21026         used anywhere - non-reducing rule.
21027         (namespace_declarations): Non-reducing rule - comment out.
21028
21029         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
21030         with TypeContainer::AddEnum.
21031
21032         * delegate.cs : New file for delegate handling classes.
21033         (Delegate): Class for declaring delegates.
21034
21035         * makefile : Update.
21036
21037         * cs-parser.jay (delegate_declaration): Implement.
21038
21039 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
21040
21041         * class.cs (Event::Define): Implement.
21042         (Event.EventBuilder): New member.
21043
21044         * class.cs (TypeContainer::Populate): Update to define all enums and events
21045         we have.
21046         (Events): New property for the events arraylist we hold. Shouldn't we move to using
21047         readonly fields for all these cases ?
21048
21049 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21050
21051         * class.cs (Property): Revamp to use the convention of making fields readonly.
21052         Accordingly modify code elsewhere.
21053
21054         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
21055         the Define method of the Property class.
21056
21057         * class.cs : Clean up applied patch and update references to variables etc. Fix 
21058         trivial bug.
21059         (TypeContainer::Populate): Update to define all the properties we have. Also
21060         define all enumerations.
21061
21062         * enum.cs (Define): Implement.
21063
21064 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
21065
21066         * cs-parser.jay (overloadable_operator): The semantic value is an
21067         enum of the Operator class.
21068         (operator_declarator): Implement actions.
21069         (operator_declaration): Implement.
21070
21071         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
21072         validity of definitions.
21073         (Operator::CheckBinaryOperator): Static method to check for binary operators
21074         (TypeContainer::AddOperator): New method to add an operator to a type.
21075
21076         * cs-parser.jay (indexer_declaration): Added line to actually call the
21077         AddIndexer method so it gets added ;-)
21078
21079         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
21080         already taken care of by the MS compiler ?  
21081
21082 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21083
21084         * class.cs (Operator): New class for operator declarations.
21085         (Operator::OpType): Enum for the various operators.
21086
21087 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
21088
21089         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
21090         ostensibly handle this in semantic analysis.
21091
21092         * cs-parser.jay (general_catch_clause): Comment out
21093         (specific_catch_clauses, specific_catch_clause): Ditto.
21094         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
21095         (catch_args, opt_catch_args): New productions.
21096         (catch_clause): Rewrite to use the new productions above
21097         (catch_clauses): Modify accordingly.
21098         (opt_catch_clauses): New production to use in try_statement
21099         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
21100         and re-write the code in the actions to extract the specific and
21101         general catch clauses by being a little smart ;-)
21102
21103         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
21104         Hooray, try and catch statements parse fine !
21105
21106 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21107
21108         * statement.cs (Block::GetVariableType): Fix logic to extract the type
21109         string from the hashtable of variables.
21110
21111         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
21112         I end up making that mistake ;-)
21113         (catch_clauses): Fixed gross error which made Key and Value of the 
21114         DictionaryEntry the same : $1 !!
21115
21116 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21117
21118         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
21119
21120         * cs-parser.jay (event_declaration): Correct to remove the semicolon
21121         when the add and remove accessors are specified. 
21122
21123 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
21124
21125         * cs-parser.jay (IndexerDeclaration): New helper class to hold
21126         information about indexer_declarator.
21127         (indexer_declarator): Implement actions.
21128         (parsing_indexer): New local boolean used to keep track of whether
21129         we are parsing indexers or properties. This is necessary because 
21130         implicit_parameters come into picture even for the get accessor in the 
21131         case of an indexer.
21132         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
21133
21134         * class.cs (Indexer): New class for indexer declarations.
21135         (TypeContainer::AddIndexer): New method to add an indexer to a type.
21136         (TypeContainer::indexers): New member to hold list of indexers for the
21137         type.
21138
21139 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21140
21141         * cs-parser.jay (add_accessor_declaration): Implement action.
21142         (remove_accessor_declaration): Implement action.
21143         (event_accessors_declaration): Implement
21144         (variable_declarators): swap statements for first rule - trivial.
21145
21146         * class.cs (Event): New class to hold information about event
21147         declarations.
21148         (TypeContainer::AddEvent): New method to add an event to a type
21149         (TypeContainer::events): New member to hold list of events.
21150
21151         * cs-parser.jay (event_declaration): Implement actions.
21152
21153 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
21154
21155         * cs-parser.jay (dim_separators): Implement. Make it a string
21156         concatenating all the commas together, just as they appear.
21157         (opt_dim_separators): Modify accordingly
21158         (rank_specifiers): Update accordingly. Basically do the same
21159         thing - instead, collect the brackets here.
21160         (opt_rank_sepcifiers): Modify accordingly.
21161         (array_type): Modify to actually return the complete type string
21162         instead of ignoring the rank_specifiers.
21163         (expression_list): Implement to collect the expressions
21164         (variable_initializer): Implement. We make it a list of expressions
21165         essentially so that we can handle the array_initializer case neatly too.
21166         (variable_initializer_list): Implement.
21167         (array_initializer): Make it a list of variable_initializers
21168         (opt_array_initializer): Modify accordingly.
21169
21170         * expression.cs (New::NType): Add enumeration to help us
21171         keep track of whether we have an object/delegate creation
21172         or an array creation.
21173         (New:NewType, New::Rank, New::Indices, New::Initializers): New
21174         members to hold data about array creation.
21175         (New:New): Modify to update NewType
21176         (New:New): New Overloaded contructor for the array creation
21177         case.
21178
21179         * cs-parser.jay (array_creation_expression): Implement to call
21180         the overloaded New constructor.
21181
21182 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
21183
21184         * class.cs (TypeContainer::Constructors): Return member
21185         constructors instead of returning null.
21186
21187 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
21188
21189         * typemanager.cs (InitCoreTypes): Initialize the various core
21190         types after we have populated the type manager with the user
21191         defined types (this distinction will be important later while
21192         compiling corlib.dll)
21193
21194         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
21195         on Expression Classification.  Now all expressions have a method
21196         `Resolve' and a method `Emit'.
21197
21198         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
21199         generation from working.     Also add some temporary debugging
21200         code. 
21201
21202 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
21203
21204         * codegen.cs: Lots of code generation pieces.  This is only the
21205         beginning, will continue tomorrow with more touches of polish.  We
21206         handle the fundamentals of if, while, do, for, return.  Others are
21207         trickier and I need to start working on invocations soon.
21208
21209         * gen-treedump.cs: Bug fix, use s.Increment here instead of
21210         s.InitStatement. 
21211
21212         * codegen.cs (EmitContext): New struct, used during code
21213         emission to keep a context.   Most of the code generation will be
21214         here. 
21215
21216         * cs-parser.jay: Add embedded blocks to the list of statements of
21217         this block.  So code generation proceeds in a top down fashion.
21218
21219 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
21220
21221         * statement.cs: Add support for multiple child blocks.
21222
21223 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
21224
21225         * codegen.cs (EmitCode): New function, will emit the code for a
21226         Block of code given a TypeContainer and its ILGenerator. 
21227
21228         * statement.cs (Block): Standard public readonly optimization.
21229         (Block::Block constructors): Link children. 
21230         (Block::Child): Child Linker.
21231         (Block::EmitVariables): Emits IL variable declarations.
21232
21233         * class.cs: Drop support for MethodGroups here, delay until
21234         Semantic Analysis.
21235         (Method::): Applied the same simplification that I did before, and
21236         move from Properties to public readonly fields.
21237         (Method::ParameterTypes): Returns the parameter types for the
21238         function, and implements a cache that will be useful later when I
21239         do error checking and the semantic analysis on the methods is
21240         performed.
21241         (Constructor::GetCallingConvention): Renamed from CallingConvetion
21242         and made a method, optional argument tells whether this is a class
21243         or a structure to apply the `has-this' bit.
21244         (Method::GetCallingConvention): Implement, returns the calling
21245         convention. 
21246         (Method::Define): Defines the type, a second pass is performed
21247         later to populate the methods.
21248
21249         (Constructor::ParameterTypes): implement a cache similar to the
21250         one on Method::ParameterTypes, useful later when we do semantic
21251         analysis. 
21252
21253         (TypeContainer::EmitMethod):  New method.  Emits methods.
21254
21255         * expression.cs: Removed MethodGroup class from here.
21256
21257         * parameter.cs (Parameters::GetCallingConvention): new method.
21258
21259 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
21260
21261         * class.cs (TypeContainer::Populate): Drop RootContext from the
21262         argument. 
21263
21264         (Constructor::CallingConvention): Returns the calling convention.
21265         (Constructor::ParameterTypes): Returns the constructor parameter
21266         types. 
21267
21268         (TypeContainer::AddConstructor): Keep track of default constructor
21269         and the default static constructor.
21270
21271         (Constructor::) Another class that starts using `public readonly'
21272         instead of properties. 
21273
21274         (Constructor::IsDefault): Whether this is a default constructor. 
21275
21276         (Field::) use readonly public fields instead of properties also.
21277
21278         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
21279         track of static constructors;  If none is used, turn on
21280         BeforeFieldInit in the TypeAttributes. 
21281
21282         * cs-parser.jay (opt_argument_list): now the return can be null
21283         for the cases where there are no arguments. 
21284
21285         (constructor_declarator): If there is no implicit `base' or
21286         `this', then invoke the default parent constructor. 
21287
21288         * modifiers.cs (MethodAttr): New static function maps a set of
21289         modifiers flags into a MethodAttributes enum
21290         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
21291         MethodAttr, TypeAttr to represent the various mappings where the
21292         modifiers are used.
21293         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
21294
21295 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
21296
21297         * parameter.cs (GetParameterInfo): Fix bug where there would be no
21298         method arguments.
21299
21300         * interface.cs (PopulateIndexer): Implemented the code generator
21301         for interface indexers.
21302
21303 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
21304
21305         * interface.cs (InterfaceMemberBase): Now we track the new status
21306         here.  
21307
21308         (PopulateProperty): Implement property population.  Woohoo!  Got
21309         Methods and Properties going today. 
21310
21311         Removed all the properties for interfaces, and replaced them with
21312         `public readonly' fields. 
21313
21314 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
21315
21316         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
21317         initialize their hashtables/arraylists only when they are needed
21318         instead of doing this always.
21319
21320         * parameter.cs: Handle refs and out parameters.
21321
21322         * cs-parser.jay: Use an ArrayList to construct the arguments
21323         instead of the ParameterCollection, and then cast that to a
21324         Parameter[] array.
21325
21326         * parameter.cs: Drop the use of ParameterCollection and use
21327         instead arrays of Parameters.
21328
21329         (GetParameterInfo): Use the Type, not the Name when resolving
21330         types. 
21331
21332 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
21335         and instead use public readonly fields.
21336
21337         * class.cs: Put back walking code for type containers.
21338
21339 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
21340
21341         * class.cs (MakeConstant): Code to define constants.
21342
21343         * rootcontext.cs (LookupType): New function.  Used to locate types 
21344
21345
21346 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
21347
21348         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
21349         this System.Reflection code is.  Kudos to Microsoft
21350
21351         * typemanager.cs: Implement a type cache and avoid loading all
21352         types at boot time.  Wrap in LookupType the internals.  This made
21353         the compiler so much faster.  Wow.  I rule!
21354
21355         * driver.cs: Make sure we always load mscorlib first (for
21356         debugging purposes, nothing really important).
21357
21358         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
21359         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
21360
21361         * rootcontext.cs: Lookup types on their namespace;  Lookup types
21362         on namespaces that have been imported using the `using' keyword.
21363
21364         * class.cs (TypeContainer::TypeAttr): Virtualize.
21365         (Class::TypeAttr): Return attributes suitable for this bad boy.
21366         (Struct::TypeAttr): ditto.
21367         Handle nested classes.
21368         (TypeContainer::) Remove all the type visiting code, it is now
21369         replaced with the rootcontext.cs code
21370
21371         * rootcontext.cs (GetClassBases): Added support for structs. 
21372
21373 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
21374
21375         * interface.cs, statement.cs, class.cs, parameter.cs,
21376         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
21377         Drop use of TypeRefs, and use strings instead.
21378
21379 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * rootcontext.cs: 
21382
21383         * class.cs (Struct::Struct): set the SEALED flags after
21384         checking the modifiers.
21385         (TypeContainer::TypeAttr): new property, returns the
21386         TypeAttributes for a class.  
21387
21388         * cs-parser.jay (type_list): Oops, list production was creating a
21389         new list of base types.
21390
21391         * rootcontext.cs (StdLib): New property.
21392         (GetInterfaceTypeByName): returns an interface by type name, and
21393         encapsulates error handling here.
21394         (GetInterfaces): simplified.
21395         (ResolveTree): Encapsulated all the tree resolution here.
21396         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
21397         types. 
21398
21399         * driver.cs: Add support for --nostdlib, to avoid loading the
21400         default assemblies.
21401         (Main): Do not put tree resolution here. 
21402
21403         * rootcontext.cs: Beginning of the class resolution.
21404
21405 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
21406
21407         * rootcontext.cs: Provide better error reporting. 
21408
21409         * cs-parser.jay (interface_base): set our $$ to be interfaces.
21410
21411         * rootcontext.cs (CreateInterface): Handle the case where there
21412         are no parent interfaces.
21413
21414         (CloseTypes): Routine to flush types at the end.
21415         (CreateInterface): Track types.
21416         (GetInterfaces): Returns an array of Types from the list of
21417         defined interfaces.
21418
21419         * typemanager.c (AddUserType): Mechanism to track user types (puts
21420         the type on the global type hash, and allows us to close it at the
21421         end). 
21422
21423 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
21424
21425         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
21426         RecordInterface instead.
21427
21428         * cs-parser.jay: Updated to reflect changes above.
21429
21430         * decl.cs (Definition): Keep track of the TypeBuilder type that
21431         represents this type here.  Not sure we will use it in the long
21432         run, but wont hurt for now.
21433
21434         * driver.cs: Smaller changes to accomodate the new code.
21435
21436         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
21437         when done. 
21438
21439         * rootcontext.cs (CreateInterface):  New method, used to create
21440         the System.TypeBuilder type for interfaces.
21441         (ResolveInterfaces): new entry point to resolve the interface
21442         hierarchy. 
21443         (CodeGen): Property, used to keep track of the code generator.
21444
21445 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
21446
21447         * cs-parser.jay: Add a second production for delegate_declaration
21448         with `VOID'.
21449
21450         (enum_body): Put an opt_comma here instead of putting it on
21451         enum_body or enum_member_declarations so we can handle trailing
21452         commas on enumeration members.  Gets rid of a shift/reduce.
21453
21454         (type_list): Need a COMMA in the middle.
21455
21456         (indexer_declaration): Tell tokenizer to recognize get/set
21457
21458         * Remove old targets.
21459
21460         * Re-add the parser target.
21461
21462 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21463
21464         * cs-parser.jay: Add precendence rules for a number of operators
21465         ot reduce the number of shift/reduce conflicts in the grammar.
21466
21467 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
21468
21469         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
21470         and put it here.
21471
21472         Get rid of old crufty code.
21473
21474         * rootcontext.cs: Use this to keep track of the parsed
21475         representation and the defined types available to the program. 
21476
21477         * gen-treedump.cs: adjust for new convention.
21478
21479         * type.cs: Split out the type manager, and the assembly builder
21480         from here. 
21481
21482         * typemanager.cs: the type manager will live here now.
21483
21484         * cil-codegen.cs: And the code generator here. 
21485
21486 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
21487
21488         * makefile: Fixed up for easy making.
21489
21490 2001-07-13  Simon Cozens <simon@simon-cozens.org>
21491
21492         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
21493         the 
21494
21495         (unary_expression): Expand pre_increment_expression and
21496         post_decrement_expression to reduce a shift/reduce.
21497
21498 2001-07-11  Simon Cozens
21499
21500         * cs-tokenizer.cs: Hex numbers should begin with a 0.
21501
21502         Improve allow_keyword_as_indent name.
21503
21504 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
21505
21506         * Adjustments for Beta2. 
21507
21508 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
21509
21510         * decl.cs: Added `Define' abstract method.
21511         (InTransit): new property, used to catch recursive definitions. 
21512
21513         * interface.cs: Implement `Define'. 
21514
21515         * modifiers.cs: Map Modifiers.constants to
21516         System.Reflection.TypeAttribute flags.
21517
21518         * class.cs: Keep track of types and user-defined types.
21519         (BuilderInit): New method for creating an assembly
21520         (ResolveType): New function to launch the resolution process, only
21521         used by interfaces for now.
21522
21523         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
21524         that are inserted into the name space. 
21525
21526 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
21527
21528         * ARGH.  I have screwed up my tree so many times due to the use of
21529         rsync rather than using CVS.  Going to fix this at once. 
21530
21531         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
21532         load types.
21533
21534 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
21535
21536         * Experiment successful: Use System.Type rather that our own
21537         version of Type.  
21538
21539 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
21540
21541         * cs-parser.jay: Removed nsAliases from here.
21542
21543         Use new namespaces, handle `using XXX;' 
21544
21545         * namespace.cs: Reimplemented namespace handling, use a recursive
21546         definition of the class.  Now we can keep track of using clauses
21547         and catch invalid using clauses.
21548
21549 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
21550
21551         * gen-treedump.cs: Adapted for all the renaming.
21552
21553         * expression.cs (Expression): this class now has a Type property
21554         which returns an expression Type.
21555
21556         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
21557         `Type', as this has a different meaning now in the base
21558
21559 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
21560
21561         * interface.cs, class.cs: Removed from all the sources the
21562         references to signature computation, as we can not do method
21563         signature computation during the parsing time, as we are not
21564         trying to solve at that point distinguishing:
21565
21566         class X {
21567                 void a (Blah x) {}
21568                 void a (NS.Blah x) {}
21569         }
21570
21571         Which depending on the context might be valid or not, as we do not
21572         know if Blah is the same thing as NS.Blah at that point.
21573
21574         * Redid everything so the code uses TypeRefs now instead of
21575         Types.  TypeRefs are just temporary type placeholders, that need
21576         to be resolved.  They initially have a pointer to a string and the
21577         current scope in which they are used.  This is used later by the
21578         compiler to resolve the reference to an actual Type. 
21579
21580         * DeclSpace is no longer a CIR.Type, and neither are
21581         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
21582         are all DeclSpaces, but no Types. 
21583
21584         * type.cs (TypeRefManager): This implements the TypeRef manager,
21585         which keeps track of all the types that need to be resolved after
21586         the parsing has finished. 
21587
21588 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
21589
21590         * ARGH.  We are going to have to store `foreach' as a class rather
21591         than resolving it, as we need to verify error 1579 after name
21592         resolution.   *OR* we could keep a flag that says `This request to
21593         IEnumerator comes from a foreach statement' which we can then use
21594         to generate the error.
21595
21596 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
21597
21598         * class.cs (TypeContainer.AddMethod): we now add methods to the
21599         MethodGroup instead of the method hashtable.  
21600
21601         * expression.cs: Add MethodGroup abstraction, which gets us one
21602         step closer to the specification in the way we handle method
21603         declarations.  
21604
21605         * cs-parser.jay (primary_expression): qualified_identifier now
21606         tried to match up an identifier to a local variable reference or
21607         to a parameter reference.
21608
21609         current_local_parameters is now a parser global variable that
21610         points to the current parameters for the block, used during name
21611         lookup.
21612
21613         (property_declaration): Now creates an implicit `value' argument to
21614         the set accessor.
21615
21616 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
21617
21618         * parameter.cs: Do not use `param' arguments as part of the
21619         signature, per the spec.
21620
21621 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
21622
21623         * decl.cs: Base class for classes, structs and interfaces.  This
21624         is the "Declaration Space" 
21625
21626         * cs-parser.jay: Use CheckDef for checking declaration errors
21627         instead of having one on each function.
21628
21629         * class.cs: Factor out some code for handling error handling in
21630         accordance to the "Declarations" section in the "Basic Concepts"
21631         chapter in the ECMA C# spec.
21632
21633         * interface.cs: Make all interface member classes derive from
21634         InterfaceMemberBase.
21635
21636 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
21637
21638         * Many things: all interfaces are parsed and generated in
21639         gen-treedump.  Support for member variables, constructors,
21640         destructors, properties, constants is there.
21641
21642         Beginning of the IL backend, but very little done, just there for
21643         testing purposes. 
21644
21645 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
21646
21647         * cs-parser.jay: Fix labeled statement.
21648
21649         * cs-tokenizer.cs (escape): Escape " and ' always.
21650         ref_line, ref_name: keep track of the line/filename as instructed
21651         by #line by the compiler.
21652         Parse #line.
21653
21654 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
21655
21656         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
21657         to match the values in System.CodeDOM.
21658
21659         Divid renamed to Divide.
21660
21661         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
21662         statements. 
21663         (Statements.set): remove.
21664
21665         * System.CodeDOM/CodeCatchClause.cs: always have a valid
21666         statements. 
21667
21668         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
21669         falseStatements always have valid values. 
21670
21671         * cs-parser.jay: Use System.CodeDOM now.
21672