Apply Gert's version of the AutoResetEvent, and merge his test
[mono.git] / mcs / mcs / ChangeLog
1 2007-07-18  Marek Safar  <marek.safar@gmail.com>
2
3         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
4
5 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
6
7         * doc.cs : generic method arguments are written as ``x while generic
8           type arguments are `x. Combined with the previous change, fixed bug
9           #79706.
10
11 2007-07-18  Raja R Harinath  <rharinath@novell.com>
12
13         Fix #82120
14         * expression.cs (Binary.ResolveOperator): When converting
15         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
16
17 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
18
19         * doc.cs : when T: or whatever x: is specified, it does not really
20           check the doc comment's syntax correctness. Fixed bug #82006.
21
22 2007-07-18  Marek Safar  <marek.safar@gmail.com>
23
24         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
25         LambdaExpression better.
26         
27         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
28         
29         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
30         
31         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
32         as it can be generated.
33         
34         * expression.cs (Invocation.Error_InvalidArguments): Show correct
35         modifiers.
36         
37         * lambda.cs (LambdaExpression): Refactored to share same code with
38         AnonymousMethodExpression.
39         
40 2007-07-17  Marek Safar  <marek.safar@gmail.com>
41
42         * anonymous.cs (MakeName): Include host name for easier debugging.
43         (LambdaMethod): New class for lambda spcecific stuff.
44         
45         * attribute.cs: Set EmitContext return type.
46
47         * class.cs: Set EmitContext return type.
48         
49         * codegen.cs (EmitContext): Return type cannot be null to stop messing
50         with null/void meaning.
51         
52         * iterators.cs (ContainerType): Implemented.
53         
54         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
55         
56         * statement.cs (Return): Updated to lambda expressions.
57         (Block.CloneTo): Parent can be null.
58                 
59 2007-07-13  Marek Safar  <marek.safar@gmail.com>
60
61         A fix for bug #81917
62         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
63         
64         * class.cs (FixedField): Check whether field is in unsafe scope.
65
66         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
67         (FieldExpr.Emit): Fixed buffers cannot be volatile.
68
69         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
70         FieldExpr.
71         
72         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
73                 
74 2007-07-13  Marek Safar  <marek.safar@gmail.com>
75
76         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
77         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
78         from Report class.
79
80 2007-07-13  Marek Safar  <marek.safar@gmail.com>
81
82         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
83         
84 2007-07-13  Marek Safar  <marek.safar@gmail.com>
85
86         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
87         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
88         
89         * codegen.cs(EmitContext): Add ProbingMode flag.
90         
91         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
92         
93         * driver.cs: For now set both warning values.
94         
95         * ecore.cs (SimpleName): Name is readonly.
96         (MethodGroup.OverloadResolve): One quick path for probing.
97         
98         * expression.cs (Unary): Set Oper r/o.
99         (Binary): Set Oper r/o.
100         (ParameterReference): Set few instance variables as r/o.
101         (ParameterReference.DoResolveBase): Don't capture aruments when 
102         the probing is on.
103         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
104         (Arglist): arguments are private.
105         (SizeOf): type is private and r/o.
106         (MemberAccess): arguments are private.
107
108         * report.cs: Enhanced reporting on/off capabilities.
109         
110         * lambda.cs: Uses ec.IsInProbingMode.
111         (ContextualReturn): Derives from return.
112         
113         * rootcontext.cs: For now set both warning values.
114         
115         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
116         copy if one exists.
117         (Return.Resolve): Don't die immediately.
118         (Block.Resolve): Speed-up probing.
119         (Block.CloneTo): Clone only child blocks.
120
121 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
122
123         * iterators.cs: reverted Miguel's latest change (r81925) as it
124         breaks the build in System.
125
126 2007-07-13  Miguel de Icaza  <miguel@novell.com>
127
128         * iterators.cs (Yield.CheckContext): Check for the iterator type
129         also here as we can call into Yield even in codepaths that are not
130         directly checked by
131         (MethodOrOperator is the only path that was checked).
132
133         In addition to the standard check, use a more specific check for
134         constructors to report a more verbose error. 
135
136 2007-07-12  Miguel de Icaza  <miguel@novell.com>
137
138         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
139         report the warning and continue 
140
141         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
142         values on the stack on the call to Emit.   Use EmitStatement if
143         possible, or using Emit + Pop if not possible.   Fixes #82064
144
145 2007-07-12  Raja R Harinath  <rharinath@novell.com>
146
147         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
148         avoid try...finally in some cases.
149
150 2007-07-10  Marek Safar  <marek.safar@gmail.com>
151
152         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
153         
154         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
155         instead of method. Re-use standard error handling.
156         (ConstructorInitializer.Emit): Simplified.
157         
158         * delegate.cs: Updated after Invocation.EmitCall change.
159         
160         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
161         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
162         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
163         method and don't permanently changing input arguments.
164         (MethodGroupExpr): Introduced resolved best_candidate, when method group
165         is resolved it has one of the candidates is the best one which is later
166         used to emit. Removed a few unused method.
167         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
168
169         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
170         (Binary.ResolveOperator): Ditto.
171         (ConditionalLogicalOperator.DoResolve): Ditto.
172         (Invocation): Uses method group.
173         (Invocation.DoResolve): Simplified.
174         (Invocation.EmitCall): Removed useless is_static.
175         (Invocation.Emit): Delegate to method group.
176         (Invocation.EmitStatement): Simplified.
177         (New): Uses method group.
178         (MemberAccess.DoResolve): Don't destroy original expression.
179         
180         * statement.cs (ForEach.Resolve): Use null for no method arguments.
181         
182 2007-07-04  Marek Safar  <marek.safar@gmail.com>
183
184         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
185         
186         * anonymous.cs,
187         * lambda.cs: Add custom error message type.
188
189 2007-07-03  Marek Safar  <marek.safar@gmail.com>
190
191         * lambda.cs: Simplified little bit.
192         
193         * parameter.cs: Introduced ImplicitLambdaParameter.
194         (Parameters.CreateFullyResolved): New factory instead of ctor.
195         
196         * anonymous.cs,
197         * class.cs,
198         * delegate.cs: Updated parameter creation.
199         
200 2007-07-03  Marek Safar  <marek.safar@gmail.com>
201
202         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
203         arguments.
204         
205         * generic.cs: Synchronized with gmcs.
206         
207 2007-07-03  Marek Safar  <marek.safar@gmail.com>
208
209         * class.cs (Indexer): Check return type as soon as possible.
210         
211         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
212         members too.
213         
214         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
215         
216         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
217         
218         * parameter.cs (Parameter): Use expression type when it is available.
219         
220         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
221         method modifier for the first parameter only.
222
223 2007-06-24  Marek Safar  <marek.safar@gmail.com>
224
225         A fix for bug #81938
226         * typemanager.cs (ChangeType): Fixed couple of char conversions.
227         
228         * constant.cs: Tide up an exception message.
229
230 2007-06-22  Marek Safar  <marek.safar@gmail.com>
231
232         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
233         an uninitialized variable is used.
234         
235         * expression.cs (LocalVariableReference.DoResolve): Ditto.
236
237 2007-06-22  Marek Safar  <marek.safar@gmail.com>
238
239         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
240         not found error handling.
241
242         * expression.cs (ArrayCreation): Removed redundant fields and little bit
243         simplified.
244         (ArrayCreation.ResolveArrayElement): To be ready to customization.
245         (ArrayCreation.DoResolve): Simplified.
246         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
247         its own resolve process.
248         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
249
250 2007-06-20  Marek Safar  <marek.safar@gmail.com>
251
252         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
253         more error details.
254         
255 2007-06-20  Marek Safar  <marek.safar@gmail.com>
256
257         * cs-tokenizer.cs: Removed var related stuff.
258         
259         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
260         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
261         a type and a keyword at same time.
262         
263         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
264         matches to "var".
265         
266         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
267         implicitly typed arrays, more changes will follow.
268         
269         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
270         
271 2007-06-19  Marek Safar  <marek.safar@gmail.com>
272
273         * ecore.cs (VarExpr): Removed Handled field.
274         
275         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
276         build-in assign functionality.
277         (ForEach.Resolve): Removed all implicitly typed local variable code and
278         simplified.
279         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
280         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
281
282 2007-06-18  Marek Safar  <marek.safar@gmail.com>
283
284         * assign.cs: Removed implicitly typed local variable check.
285         
286         * expression.cs (LocalVariableReference.DoResolve): Add check for self
287         referencing implicitly typed local variable.
288         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
289         variable here.
290         
291         * statement.cs (Fixed): Removed unsupported implicitly typed local
292         variable code.
293
294 2007-06-15  Marek Safar  <marek.safar@gmail.com>
295
296         * decl.cs (MemberName): Moved all Unbound stuff to parser.
297
298 2007-06-14  Marek Safar  <marek.safar@gmail.com>
299
300         A fix for bugs #81855 and #76274
301         * attribute.cs (AttachTo): Always set owner for global attributes to
302         prefined owner.
303         
304         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
305         usefull too.
306         
307         * cs-parser.jay: Assembly and module attributes must precede all other
308         elements except using clauses and extern alias declarations.
309
310 2007-06-13  Marek Safar  <marek.safar@gmail.com>
311
312         A fix for bug #81748
313         * cs-tokenizer.cs,
314         * expression.cs: More checks for non ISO-1 features.
315
316 2007-06-12  Marek Safar  <marek.safar@gmail.com>
317
318         A fix for bug #81807
319         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
320         present inside switch statement and it is required by nullable check.
321
322 2007-06-12  Marek Safar  <marek.safar@gmail.com>
323
324         A fix for bug #81840
325         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
326         when type matching fails.
327         
328         * namespace.cs: Tiny error message change.
329
330 2007-06-12  Marek Safar  <marek.safar@gmail.com>
331
332         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
333         reporting. Added automatic property check.
334         
335         * class.cs: Updated after CheckAbstractAndExtern relocation.
336         (AEventPropertyAccessor.GetSignatureForError): Customized.
337         
338 2007-06-11  Marek Safar  <marek.safar@gmail.com>
339
340         * class.cs (DefineBaseTypes): Base type can be undefined.
341         
342         * ecore.cs (TypeLookup): Minor refactoring.
343         (DoResolveAsTypeStep): Removed redundant check.
344
345         * namespace.cs (Lookup): Removed redundant check.
346                 
347         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
348         ResolveAsTypeTerminal step.
349         (BootstrapCorlib_*): Simplified.
350         (PopulateCoreType): Core types can be now external.
351
352 2007-06-07  Marek Safar  <marek.safar@gmail.com>
353
354         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
355          verification only.
356          (InferTypeArguments): Infers anonymous expression type arguments.
357          (Compatible): Split to Compatible and InferTypeArguments. 
358         
359         * lambda.cs: Updated.
360
361 2007-06-08  Marek Safar  <marek.safar@gmail.com>
362
363         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
364
365 2007-06-07  Raja R Harinath  <harinath@gmail.com>
366
367         Fix #80477, cs0135-2.cs, cs0135-3.cs
368         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
369         names to the "known" variables list.
370         (Block.CheckInvariantMeaningInBlock): Handle the fact the
371         parameter names are also "known".
372         (Block.CheckError136): Remove.
373         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
374         null.
375
376 2007-06-07  Marek Safar  <marek.safar@gmail.com>
377
378         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
379
380 2007-06-06  Marek Safar  <marek.safar@gmail.com>
381
382         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
383         internal error not an user error.
384          
385         * expression.cs (IsApplicable): Refactored to make debugging easier.
386
387         * support.cs: More tricks for non-mono runtimes.
388         
389         * typemanager.cs (CoreLookupType): Made public.
390         (InitSystemCore): All linq specific stuff moved to linq.cs
391
392 2007-06-05  Marek Safar  <marek.safar@gmail.com>
393
394         * typemanager.cs (CSharpSignature): One more missing build-in types
395         replacement.
396         More tricks for non-mono runtime.
397
398 2007-06-05  Raja R Harinath  <harinath@gmail.com>
399
400         * statement.cs (Block.CheckError136_InParents): Remove.
401         (Block.AddVariable): Use GetParameterInfo instead.
402         (ToplevelBlock.ProcessArguments): Likewise.
403
404 2007-06-04  Raja R Harinath  <rharinath@novell.com>
405
406         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
407         information too.
408         (ToplevelBlock.GetParameterInfo): Split out of ...
409         (ToplevelBlock.GetParameterRefernce): ... this.
410         (ToplevelBlock.ParameterMap): Remove.
411         * expression.cs (ParameterReference): Update to use
412         ToplevelParameterInfo.
413
414         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
415         regression.
416
417         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
418         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
419
420         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
421         (ToplevelBlock.ProcessParameters) ... here.
422         (ToplevelBlock..ctor): Invoke it.
423
424         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
425         new parameters.
426
427         * statement.cs (IKnownVariable): New interface.
428         (LocalInfo): Implement it.
429         (ToplevelParameterInfo): New class.
430         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
431         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
432         GetKnownVariableInfo.
433
434 2007-06-03  Raja R Harinath  <harinath@gmail.com>
435
436         Partly speed up CS0136 error checks.
437         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
438         'recurse' parameter.
439         (Block.DoCheckError136): Only check errors in parameters.  Move
440         local variable checks ...
441         (Block.AddVariable): ... here, and ...
442         (ToplevelBlock.ResolveMeta): ... here.
443
444 2007-06-02  Raja R Harinath  <harinath@gmail.com>
445
446         * statement.cs (Block.IsChildOf): Remove.
447
448         * statement.cs (Statement.Clone): Move special case code ...
449         (Block.CloneTo): ... here.
450
451 2007-05-29  Raja R Harinath  <rharinath@novell.com>
452
453         * statement.cs (ToplevelBlock.container): Remove field.  It's
454         redundant with 'Parent'.
455         (ToplevelBlock.ContainerBlock): Remove accessor.
456         (ToplevelBlock..ctor): Update to changes.  Register anonymous
457         child with parent here, ...
458         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
459         current_block.
460         (start_anonymous): Don't save current_block.
461         (top_current_block): Remove.
462
463         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
464         (Block.Resolve): Update to changes.
465         (Block..ctor): Move setting of "correct" 'Toplevel'
466         and 'Explicit' fields to ...
467         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
468
469 2007-05-27  Raja R Harinath  <harinath@gmail.com>
470
471         Kill Block.Implicit
472         * statement.cs (Block.Implicit): Remove.
473         (Block): Update to changes.
474         * flowanalysis.cs: Likewise.
475
476         Mildly speed up CheckInvariantMeaningInBlock
477         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
478         Recursively call AddKnownVariable to all enclosing blocks.
479         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
480         Remove recursive calls.
481         (Block): Update to changes.
482
483         New ExplicitBlock invariants
484         * statement.cs (Block.Explicit): New field.  It points to the
485         immediately enclosing non-implicit block.
486         (Block..ctor): Maintain the invariant.
487         * cs-parser.jay: Take advantage of invariant.
488
489         Introduce ExplicitBlock
490         * statement.cs (ExplicitBlock): New.
491         (ToplevelBlock): Derive from it.
492         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
493         sense of flag.
494         (Block.Implicit): Update to changes.
495         * cs-parser.jay: Update to changes.
496
497         Remove unused field
498         * codegen.cs (EmitContext.IsLastStatement): Remove.
499         * statement.cs (Block.DoEmit): Update to changes.
500
501 2007-05-25  Raja R Harinath  <rharinath@novell.com>
502
503         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
504         modifying current_block directly.
505
506 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
507         
508         * class.cs: Implemented automatic properties (C# 3.0)
509           Thanks to Marek for the help.
510
511 2007-05-23  Raja R Harinath  <rharinath@novell.com>
512
513         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
514         variable as assigned, note also that all its components are
515         assigned too.
516         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
517
518 2007-05-19  Marek Safar  <marek.safar@gmail.com>
519
520         * anonymous.cs, class.cs: Emit Compiler generated attribute when
521         member is marked as compiler generated.
522         
523         * decl.cs (MemberCore): Refactored ModFlags into property.
524
525         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
526         (Check): Check only accessibility modifiers.
527
528 2007-05-18  Raja R Harinath  <rharinath@novell.com>
529
530         Track all assignable slots in one bit array
531         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
532         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
533         logic from VariableMap constructor here.  Use the same 'offset'
534         variable that's later used for computing offsets of local
535         variables.
536         * flowanalysis.cs (UsageVector.parameters): Remove.
537         (UsageVector): Update to changes.
538         (VariableMap): Remove.
539
540         Avoid creating ParameterMap in every block
541         * statement.cs (Block.ParameterMap): Move ...
542         (ToplevelBlock.ParameterMap): ... here.
543         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
544         only once.
545         * flowanalysis.cs (FlowBranching.param_map): Remove.
546         (FlowBranching.UsageVector): Update to changes.
547         (FlowBranchingToplevel.CheckOutParameters): Likewise.
548
549         * statement.cs (Block.CloneTo): Clone Toplevel field too.
550
551         * expression.cs (ParameterReference): Distinguish between block
552         where parameter was referenced and declared.
553
554 2007-05-18  Marek Safar  <marek.safar@gmail.com>
555
556         * flowanalysis.cs, statement.cs: Put back improved error handling.
557
558 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
559         
560         * assign.cs:
561         * expression.cs:
562           Imporved object and collection initialization (C# 3.0).
563
564 2007-05-15  Marek Safar  <marek.safar@gmail.com>
565
566         A fix for bug #81380
567         * expression.cs (Is.DoResolve): Only value types have constant `is'
568         behaviour.
569
570 2007-05-15  Raja R Harinath  <rharinath@novell.com>
571
572         * statement.cs (ToplevelBlock.child): Remove.
573
574 2007-05-15  Raja R Harinath  <harinath@gmail.com>
575
576         Rationalize ResolveMeta: refactoring
577         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
578         out constant handling code into ...
579         (Block.DoResolveConstants): ... this.
580
581         Rationalize ResolveMeta: kill local_map
582         * statement.cs (Block.local_map, Block.LocalMap): Remove.
583         (Block.AssignableSlots): New.
584         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
585         for locals -- move code from VariableMap here.  Avoid unnecessary
586         allocations.
587         * flowanalysis.cs (FlowBranching.local_map): Remove.
588         (FlowBranching..ctor): Use Block.AssignableSlots.
589         (VariableMap): Remove unused constructors.
590
591 2007-05-11  Raja R Harinath  <rharinath@novell.com>
592
593         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
594
595 2007-05-11  Marek Safar  <marek.safar@gmail.com>
596
597         * typemanager.cs (IsFriendAssembly): Should not be called for building
598         assembly.
599
600 2007-05-09  Marek Safar  <marek.safar@gmail.com>
601
602         * literal.cs (NullConstant): Print null in all cases.
603         
604         * expression.cs (Binary.ResolveOperator): Implemented delegate
605          comparison based on C# 2.0 changes.
606
607 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
608
609         This code is contributed under the MIT X11 license
610         
611         The following enables support for several C# 3.0 language features:
612         
613         * cs-tokenizer.cs: Added support for the "var" keyword.
614         
615         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
616           Added VarExpr class to facilitate type inferencing.
617         
618         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
619           to support anonymous types.
620         
621         * assign.cs: Added support for type inferencing and initialization.
622         
623         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
624         
625         * expression.cs: Added implicit array support to ArrayCreation.
626           Added 5 types and 1 interface:
627           
628           IInitializable                Implementing classes can inject initializing
629                                         statements after object instantiation.
630           
631           Initializer                   Stores data for object initialization.
632           
633           AnonymousType                 An expression for anonymous types.
634           
635           AnonymousTypeParameter        Stores data about an anonymous type's field.
636           
637           NewInitialize                 An expression for object initialization.
638           
639           CollectionInitialize          An expression for collection initialization.
640         
641         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
642           statements.
643
644 2007-05-06  Marek Safar  <marek.safar@gmail.com>
645
646         A fix for bug #81500
647         * cs-tokenizer.cs: Add special handling for coalescing operator.
648
649 2007-05-06  Marek Safar  <marek.safar@gmail.com>
650
651         A fix for bug #81529
652         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
653         its value from base class until it is redefined.
654
655 2007-05-02  Raja R Harinath  <rharinath@novell.com>
656
657         Fix regression in cs0631-3.cs
658         * cs-parser.jay (operator_declarator): Add opt_attributes to error
659         fallback.  Make error fallback catch more cases.
660
661 2007-05-01  Miguel de Icaza  <miguel@novell.com>
662
663         * cs-parser.jay: Allow parameters in operator declarations to have
664         attributes. 
665
666 2007-04-27  Miguel de Icaza  <miguel@novell.com>
667
668         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
669         exists. 
670
671         * lambda.cs (ContextualReturn.Resolve): An expression is valid
672         inside the ContextualReturn, it does not have to be an
673         ExpressionStatement. 
674
675 2007-04-24  Miguel de Icaza  <miguel@novell.com>
676
677         * lambda.cs (ContextualReturn.Resolve): if the return type is not
678         set, set it.
679
680 2007-04-23  Miguel de Icaza  <miguel@novell.com>
681
682         * anonymous.cs (AnonymousContainer): split the virtual Resolve
683         method in two methods: ResolveNoDefine and Resolve.
684
685         ResolveNoDefine will stop just after ResolveTopBlock has been
686         called.   
687
688         Resolve will then continue by creating a method and issuing the
689         call to method.Define ().
690
691         (AnonymousMethod): Split and implement the new Resolve and
692         ResolveNoDefine as well.
693
694         * lambda.cs (LambdaExpression): Split the anonymous method
695         resolution code into a separate routine (CoreCompatibilityTest)
696         from DoCompatibleTest.
697
698         (LambdaExpression.TryBuild): New method, this method tries to
699         build the LambdaExpression with the given set of types to be used
700         as the types for the various parameters of the lambda expression. 
701
702         If the compilation succeed with the given types, the infered type
703         of the Anonymous method is returned, otherwise null is returned.
704
705 2007-04-23  Marek Safar  <marek.safar@gmail.com>
706
707         A fix for bug #81414
708         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
709
710 2007-04-22  Miguel de Icaza  <miguel@novell.com>
711
712         * cs-tokenizer.cs: Change various identifiers here from the
713         camelCasing to the recommended Linux-like style for instance
714         variables from the Coding Guidelines. 
715
716 2007-04-19  Martin Baulig  <martin@ximian.com>
717
718         * convert.cs
719         (Convert.ImplicitReferenceConversionCore): Allow conversions from
720         System.Enum to System.ValueType.
721
722 2007-04-13  Martin Baulig  <martin@ximian.com>
723
724         Rewrote implicit reference conversions.  We need to distinguish
725         between implicit reference conversions (13.1.4) and implicit
726         boxing conversions (13.1.5).
727
728         According to the spec, there's an an implicit conversion
729         "From a one-dimensional array-type S[] to IList<T> and base
730         interfaces of this interface, provided there is an implicit
731         reference conversion from S to T."  Note that this does not
732         include boxing conversions.
733
734         * convert.cs
735         (Convert.ImplicitTypeParameterBoxingConversion): New method.
736         (Convert.ImplicitReferenceConversion): Split into
737         ImplicitReferenceConversionCore() and
738         ImplicitBoxingConversionExist().
739         (Convert.ImplicitReferenceConversionExists): Use the new
740         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
741
742 2007-04-12  Martin Baulig  <martin@ximian.com>
743
744         * convert.cs (Convert.ImplicitReferenceConversion): Move the
745         `TypeManager.null_type' checks up to the top of the method.
746
747 2007-04-11  Marek Safar  <marek.safar@gmail.com>
748
749         A fix for bug #81350
750         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
751         extension methods.
752
753 2007-04-11  Martin Baulig  <martin@ximian.com>
754
755         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
756         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
757         to make this work for generic classes; fixes #79561.
758
759 2007-04-11  Martin Baulig  <martin@ximian.com>
760
761         * expression.cs (As): Add support for nullable types; fixes #79371.
762
763 2007-04-11  Martin Baulig  <martin@ximian.com>
764
765         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
766         `type.FullName' is null; fixes #80243.
767
768 2007-04-11  Martin Baulig  <martin@ximian.com>
769
770         * expression.cs (Invocation.IsApplicable): Don't modify the method
771         if type inference succeeded, but the method was not applicable.
772         Fixes #81250.
773
774 2007-04-10  Marek Safar  <marek.safar@gmail.com>
775
776         A fix for bug #81324
777         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
778         internal and external namespaces containers.
779
780 2007-04-10  Martin Baulig  <martin@ximian.com>
781
782         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
783         TypeManager.DropGenericMethodArguments() so we also call
784         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
785
786 2007-04-10  Martin Baulig  <martin@ximian.com>
787
788         * iterators.cs (Iterator.CreateIterator): Don't crash if
789         `method.ReturnType' is null.  This happens if something went wrong
790         while resolving that typ (we already reported an error in this case).
791
792 2007-04-10  Martin Baulig  <martin@ximian.com>
793
794         * expression.cs (New.DoResolve): Don't call CheckComImport() on
795         generic interfaces; report the CS0144 directly.
796
797 2007-04-10  Martin Baulig  <martin@ximian.com>
798
799         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
800         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
801
802 2007-04-10  Martin Baulig  <martin@ximian.com>
803
804         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
805
806 2007-04-09  Raja R Harinath  <rharinath@novell.com>
807
808         A better fix
809         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
810         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
811
812         Fix #81338
813         * statement.cs (For.Resolve): If resolution fails, use
814         KillFlowBranching.
815
816 2007-04-08  Marek Safar  <marek.safar@gmail.com>
817
818         * anonymous.cs (MakeName): Make faster and zero-based.
819         (VerifyExplicitParameterCompatibility): Back to mode where generic
820         parameter is ignored.
821         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
822
823         * class.cs (EmitType): Method can emit another new method.
824
825         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
826
827         * driver.cs: Updated.
828
829         * lambda.cs: Reuse predefined empty parameters.
830
831         * parameter.cs: Updated
832
833         * support.cs: Implemented InflateTypes.
834
835         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
836         (InitSystemCore): Introduced to isolate 3.0 dependencies.
837
838 2007-04-03  Martin Baulig  <martin@ximian.com>
839
840         Fix #80632.
841
842         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
843         version of TypeManager.IsOverride() which also works with generic
844         types.  
845
846 2007-04-03  Martin Baulig  <martin@ximian.com>
847
848         Fix #81044.
849
850         * convert.cs
851         (Convert.ExplicitReferenceConversion): We need to cast when
852         converting from IList<T> to S[].
853
854 2007-04-01  Marek Safar  <marek.safar@gmail.com>
855
856         * decl.cs (FindExtensionMethods): Consider all candidates with same name
857         at this level.
858         
859         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
860
861 2007-03-31  Marek Safar  <marek.safar@gmail.com>
862
863         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
864         argument and return type inferring.
865
866         * codegen.cs (InferReturnType): Flag whether return can be inferred.
867         (ReturnType): Turned to property.
868
869         * statement.cs (Return): Implemented return type inferring.
870
871         * support.cs (ReflectionParameters): Use local types if possible.
872
873 2007-03-30  Raja R Harinath  <rharinath@novell.com>
874
875         * flowanalysis.cs (FlowBranching.Reachability): Remove.
876         (FlowBranching.UsageVector): Update to changes.
877
878         Prepare to kill 'Reachability'
879         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
880         argument of constructor.
881
882 2007-03-29  Raja R Harinath  <rharinath@novell.com>
883
884         Prepare to kill 'Reachability'
885         * flowanalysis.cs (UsageVector.is_unreachable): New.
886         (UsageVector): Update to maintain 'is_unreachable' in parallel to
887         'reachability', and verify they're consistent.
888
889         Fix #81121
890         * expression.cs (New.EmitStatement): Handle type parameters here too.
891
892 2007-03-29  Martin Baulig  <martin@ximian.com>
893
894         Fix #79148.
895
896         * anonymous.cs
897         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
898         CompilerGeneratedClass.
899         (ScopeInfo.EmitScopeInstance): Make this protected.
900         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
901         `ec.CurrentAnonymousMethod.Scope == Scope'.
902
903         * statement.cs (Block.ScopeInfo): Make this a property.
904
905 2007-03-27  Raja R Harinath  <harinath@gmail.com>
906
907         Prepare to kill 'Reachability'
908         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
909         (FlowBranching.UsageVector.Reachability): Remove property.
910         (FlowBranching.UsageVector.IsUnreachable): New property.
911         (FlowBranching.UsageVector.ResetBarrier): New.
912         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
913         * codegen.cs, statement.cs: Update to changes.
914
915 2007-03-27  Martin Baulig  <martin@ximian.com>
916
917         Fix #81209.
918
919         * decl.cs
920         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
921         generic types.
922
923 2007-03-26  Raja R Harinath  <rharinath@novell.com>
924
925         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
926         instead of TriState.  Remove all mention of TriState.
927
928         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
929         replaced by a boolean.  Add boolean 'is_unreachable' field, check
930         and maintain invariants.
931
932 2007-03-25  Marek Safar  <marek.safar@gmail.com>
933
934         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
935
936 2007-03-25  Marek Safar  <marek.safar@gmail.com>
937
938         * expression.cs: Stop using obsolete 2.0 opcodes.
939
940 2007-03-25  Marek Safar  <marek.safar@gmail.com>
941
942         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
943         one of the latests Martin's fixes.
944
945 2007-03-23  Miguel de Icaza  <miguel@novell.com>
946
947         * expression.cs: On BigEndian systems, swap the bytes, temporary
948         solution until we get a new bitconverter class.
949
950 2007-03-23  Martin Baulig  <martin@ximian.com>
951
952         Fix #81158.
953
954         * decl.cs (MemberCache.AddMembers): Add generic methods both as
955         "Method" and "Method`1".  Normally, a cache lookup is done on the
956         "Method" form (ie. without the generic arity), but this one makes
957         lookups on the full form work as well.
958
959 2007-03-22  Raja R Harinath  <rharinath@novell.com>
960
961         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
962         unused properties.
963
964 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
965         * class.cs: 
966         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
967         ordered_member_list, to TypeBuilder to store members to be defined
968         in the order they were parsed in.
969         - ordered_explicit_member_list contains all properties indexers
970           and methods that are defined as explicit implementation of an
971           interface or base class.
972         - ordered_member_list contains all properties indexers and methods
973           that are not defined as explicit implementation of an interface
974           or base class.
975
976         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
977         functionality in these removed classes has been replaced with 
978         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
979         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
980
981         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
982         to CheckForDuplications inside GetMethod and SetMethod Define Method
983         to handle method property and indexer name conflicts.
984
985         Fixes #79434
986
987         All code is contributed under the MIT/X11 license.
988
989 2007-03-20  Martin Baulig  <martin@ximian.com>
990
991         * class.cs (TypeContainer.Interfaces): Removed; they're now
992         included in `TypeContainer.Types'.
993
994 2007-03-20  Martin Baulig  <martin@ximian.com>
995
996         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
997
998         * class.cs (TypeContainer.CreateType): New public method.  This is
999         now called before DefineType() to create the TypeBuilders.
1000         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
1001         has already been created by CreateType().
1002         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
1003         don't resolve our base classes here; this has been moved into
1004         DefineBaseTypes().  We're now called from CreateType().
1005         (TypeContainer.DefineBaseTypes): New private method; resolve our
1006         base classes here.  We're now called from DefineType().
1007
1008         * rootcontext.cs
1009         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
1010         our types first to create all the TypeBuilders.  After that, call
1011         TypeContainer.DefineType() on all the types which'll resolve their
1012         base classes and setup the resolve order.
1013
1014 2007-03-20  Martin Baulig  <martin@ximian.com>
1015
1016         * class.cs (TypeContainer.Enums): Removed; they're now included in
1017         `TypeContainer.Types'.  
1018
1019 2007-03-20  Martin Baulig  <martin@ximian.com>
1020
1021         * class.cs
1022         (TypeContainer.DefineType): Don't call ResolveMembers() here.
1023         (TypeContainer.DoResolveMembers): Call DefineType() on our
1024         `compiler_generated' classes; moved here from DefineNestedTypes().
1025
1026         * rootcontext.cs
1027         (RootContext.ResolveTree): Call ResolveMembers() on all
1028         TypeContainer's in the `type_container_resolve_order'.
1029
1030 2007-03-19  Marek Safar  <marek.safar@gmail.com>
1031
1032         * class.cs: Use corlib to handle InternalMethodImplAttribute.
1033
1034 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1035
1036         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
1037         implementation flags.
1038
1039 2007-03-17  Marek Safar  <marek.safar@gmail.com>
1040
1041         * class.cs: More optimizations for type parameters.
1042
1043 2007-03-15  Marek Safar  <marek.safar@gmail.com>
1044
1045         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
1046
1047         * ecore.cs, parameter.cs: More common code for both corlibs.
1048
1049         * typemanager.cs (IsGenericMethod): Simplified.
1050
1051 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1052
1053         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1054         'returns'.
1055         * statement.cs, iterators.cs, lambda.cs: Update to changes.
1056
1057         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
1058         unconditionally.  Simplify explanation.
1059         (Try.Resolve, Using.Resolve): Likewise.
1060
1061 2007-03-15  Martin Baulig  <martin@ximian.com>
1062
1063         Fix #80731.
1064
1065         * decl.cs (DeclSpace): If we're a partial class, use our
1066         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
1067
1068 2007-03-15  Raja R Harinath  <rharinath@novell.com>
1069
1070         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
1071         'throws'.
1072         (FlowBranching.UsageVector): Update to changes.
1073         (FlowBranching.MergeSiblings): Likewise.
1074         * statement.cs: Likewise.
1075
1076 2007-03-15  Martin Baulig  <martin@ximian.com>
1077
1078         Fix #79302.
1079
1080         * decl.cs
1081         (MemberCache): Added a special .ctor for type parameters.
1082
1083         * typemanager.cs
1084         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
1085         `MemberCache'.  
1086
1087 2007-03-09  Martin Baulig  <martin@ximian.com>
1088
1089         * enum.cs (Enum): Make this a TypeContainer.
1090         (EnumMember): Derive from `Const'.
1091
1092         * const.cs
1093         (Const.DoResolveValue): New protected virtual method; move most of
1094         the functionality of ResolveValue() here so we can override it in
1095         `EnumMember'.
1096         (Const.CreateConstantReference): Make this virtual.
1097
1098         * class.cs (Kind): Add `Kind.Enum'.
1099         (TypeContainer.Emit): Don't emit the enums here; they're already
1100         in the `RootContext.typecontainer_resolve_order'.
1101
1102         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
1103         here; they're already in the `typecontainer_resolve_order'.
1104
1105         * ecore.cs (EnumConstant.ConvertImplicitly): Add
1106         TypeManager.DropGenericTypeArguments().
1107
1108         * typemanager.cs
1109         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
1110         (TypeManager.IsEnumType): Likewise.
1111         (TypeManager.EnumToUnderlying): Likewise.
1112         (TypeManager.IsEqual): Add support for enums.
1113
1114 2007-03-12  Raja R Harinath  <rharinath@novell.com>
1115
1116         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
1117         DefaultParameterValueAttribute to be undefined, say if System.dll
1118         is not referenced.
1119
1120 2007-03-11  Marek Safar  <marek.safar@gmail.com>
1121
1122         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
1123         any mscorlib.
1124
1125 2007-03-10  Marek Safar  <marek.safar@gmail.com>
1126
1127         * class.cs, parameter.cs: Unified parameters verification.
1128
1129 2007-03-08  Martin Baulig  <martin@ximian.com>
1130
1131         * cs-parser.jay (constructor_header): Pass the location to the
1132         newly created TopLevelBlock.
1133
1134 2007-03-07  Martin Baulig  <martin@ximian.com>
1135
1136         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
1137
1138 2007-03-06  Miguel de Icaza  <miguel@novell.com>
1139
1140         * convert.cs (ExplicitReferenceConversionExists): Sync this method
1141         with the changes from David, fixes the build.
1142
1143 2007-03-05  David Mitchell  <dmitchell@logos.com>
1144
1145         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
1146         and its base interfaces to a one-dimensional array type S[],
1147         provided there is an implicit or explicit reference conversion
1148         from S to T.
1149
1150 2007-03-03  Marek Safar  <marek.safar@gmail.com>
1151
1152         * cs-tokenizer.cs: Implemented basic linq grammar.
1153
1154         * driver.cs: Set linq lang version on demand.
1155
1156 2007-02-26  Marek Safar  <marek.safar@gmail.com>
1157
1158         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
1159
1160 2007-02-25  Marek Safar  <marek.safar@gmail.com>
1161
1162         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
1163         (Fixes #80455)
1164
1165         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
1166         here.
1167         Check property and event extern attributes.
1168
1169         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
1170         charset.
1171
1172 2007-02-24  Marek Safar  <marek.safar@gmail.com>
1173
1174         A fix for bug #80407
1175         * ecore.cs: Don't report ambiguity error when methods have same parent.
1176
1177 2007-02-23  Marek Safar  <marek.safar@gmail.com>
1178
1179         A fix for bug #80878
1180         * class.cs, cs-parser.jay: Event property can host anonymous methods.
1181
1182 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1183
1184         * attribute.cs: Enable ExtensionAttribute presence test.
1185
1186 2007-02-22  Marek Safar  <marek.safar@gmail.com>
1187
1188         * class.cs: Warn about missing GetHashCode only when Equals is override.
1189
1190         * decl.cs: Check accessibility of type arguments.
1191
1192         * typemanager.cs: Correctly report nullable array.
1193
1194 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1195
1196         * class.cs, report.cs: Capture more details when things go wrong.
1197
1198 2007-02-20  Marek Safar  <marek.safar@gmail.com>
1199
1200         A fix for bug #80650
1201         * cs-parser.jay: Anonymous container starts at constructor declaration
1202         and not at block beginning because it has to be usable in constructor
1203         initializer.
1204
1205         * statement.cs: Use context location and not block one for error reporting.
1206
1207 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1208
1209         A fix for bug #78712
1210         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
1211         too.
1212
1213 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1214
1215         A fix for bug #80493 by Atsushi Enomoto
1216         * cs-parser.jay: Ignore invalid attribute target.
1217
1218 2007-02-18  Marek Safar  <marek.safar@gmail.com>
1219  
1220         * cs-tokenizer.cs: Ignore '\0' as white space character.
1221
1222 2007-02-17  Miguel de Icaza  <miguel@novell.com>
1223
1224         * cs-parser.jay: Add support for lambda expressions to the mcs
1225         compiler as well.
1226
1227         * lambda.cs: Only clone when we are probing, not on the final call
1228         (Compatible is the final call). 
1229
1230         * statement.cs (CloneContext): Introduce class to provide block
1231         remapping during clone.
1232
1233         All statements Clone themselves now.
1234
1235         (Clone): special handling for blocks, when we clone a block, we
1236         register the block inside this routine, as children of the block
1237         might trigger a lookup. 
1238         
1239         * expression.cs: Add support for CloneContext in all expressions. 
1240         
1241 2007-02-17  Marek Safar  <marek.safar@gmail.com>
1242  
1243         A fix for bug #80493
1244         * statement.cs: Report ambiguous warning when interfaces are not related.
1245
1246 2007-02-15  Marek Safar  <marek.safar@gmail.com>
1247
1248         C# 3.0 extension methods.
1249
1250         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
1251         cannot be used directly.
1252
1253         * class.cs (Class.Emit): Emit extension attribute if any class method
1254         is extension method.
1255         (Method.Define): Add basic extension method validation conditions.
1256         (Method.Emit): Emit extension attribute for method.
1257
1258         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
1259         extension method exists. Currently we follow same approach as Microsoft
1260         does, emit even if a method or a class are private but this can change
1261         later.
1262
1263         * cs-parser.jay: Add handling of `this' keyword in method parameters
1264         context.
1265
1266         * decl.cs (DeclSpace.IsStaticClass): New property.
1267         (MemberCache.FindExtensionMethods): Looks for extension methods with
1268         defined name and extension type.
1269
1270         * doc.cs: Updated after OverloadResolve changes.
1271
1272         * driver.cs: Add new soft reference to System.Core.dll.
1273
1274         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
1275         (ExtensionMethodGroupExpr): Represents group of extension methods.
1276
1277         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
1278         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
1279         to MethodGroupExpr and made non-static for easier customization.
1280         (Invocation.DoResolve): Add extension method lookup when no standard
1281         method was found.
1282         (MemberAccess.DoResolve): Try extension methods if no member exists.
1283
1284         * modifiers.cs: Add METHOD_EXTENSION modifier.
1285
1286         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
1287         as well as candidate extension type.
1288         (ComputeNamespaces): When assembly constains extension methods registers
1289         them.
1290         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
1291         extension method lookup.
1292         (Namespace.LookupExtensionMethod): Looks for extension method in this
1293         namespace.
1294         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
1295         find a method which matches name and extensionType.
1296
1297         * parameter.cs (Parameter): Add This modifer.
1298         (HasExtensionMethodModifier): New property.
1299         (Resolve): Add extension parameter check.
1300         (ModFlags): turned to property to exclude this modifier as it is not real
1301         parameter modifier.
1302         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
1303
1304         * support.cs (ParameterData): Add ExtensionMethodType.
1305         (ReflectionParameters): Implemented ExtensionMethodType interface property.
1306
1307         * typemanager.cs: Add type and ctor extension attribute type.
1308
1309 2007-02-15  Miguel de Icaza  <miguel@novell.com>
1310
1311         * report.cs (DisableErrors, EnableErrors): used to prevent error
1312         output when we are "trying" to compile various methods with
1313         different types. 
1314
1315         * ecore.cs (Expression): Add Clone method that calls the virtual
1316         CloneTo method.  The current CloneTo method in Expression throws
1317         an exception so we can track down all the places where this must
1318         be implemented (not using abstract, because that would be a lot of
1319         up-front-work before we can start testing the implementation
1320         idea). 
1321
1322         Important: we only need Clone capabilities for expressions created
1323         by the parser, as the expressions we will be cloning are
1324         expressions in the pre-resolved state.   This vastly simplifies
1325         the work required. 
1326         
1327         (SimpleName): Add CloneTo that does nothing.
1328         (EmptyCast): Add CloneTo.
1329         
1330         * expression.cs (Binary): Implement CloneTo.
1331         (Invocation.IsApplicable): Store the current ec in
1332         EmitContext.TempEc and restore it on return.  This is used so we
1333         do not have to sprinkle hundres of methods with an extra
1334         EmitContext, we know that the only user is the lambda expression
1335         ImplicitConversionExists code. 
1336         
1337         (Argument): Add Cloning capabilities.
1338         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
1339         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
1340         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
1341         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
1342         IndexerAccess): Add Clone capability.
1343
1344         (LocalVariableReference, This): TODO: needs cloned Block mapping.
1345
1346         (Argument): Add cloning capability.
1347
1348         * assign.cs (Assign): Implement CloneTo.
1349
1350         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
1351         
1352         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
1353         version by calling Convert with the EmitContext (that we are
1354         currently storing in ec, this is not great, but will do for now,
1355         to avoid passing EmitContext parameters to hundreds of functions
1356         that do not need them now).
1357
1358         (SetExpression): Remove, it is not needed.
1359         
1360         (ContextualReturn): Implement CloneTo.
1361
1362         * statement.cs (Statement): Implement cloning infrastructure,
1363         similar to expressions.
1364
1365         (Block): Partial implementation of Clone for statements.
1366
1367         (Return): Implement clone.
1368         
1369         * constant.cs (Constant.CloneTo): New method, does nothing.
1370
1371         * codegen.cs (TempEc): Add a static EmitContext as a temporary
1372         solution, until we decide how to exactly do this.  
1373         
1374 2007-02-14  Marek Safar  <marek.safar@gmail.com>
1375  
1376         A fix for bug #80493
1377         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
1378         a property is override we need to use second accessor.
1379
1380 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1381  
1382         A fix for bug #80418
1383         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
1384         methods.
1385
1386 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1387
1388         Another fix for bug #80749
1389         * pending.cs: Abstract class has priority over interfaces.
1390
1391 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1392
1393         Another fix for bug #80749
1394         * pending.cs: Abstract class has priority over interfaces.
1395
1396 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1397
1398         Another fix for bug #80749
1399         * pending.cs: Abstract class has priority over interfaces.
1400
1401 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1402
1403         Another fix for bug #80749
1404         * pending.cs: Abstract class has priority over interfaces.
1405
1406 2007-02-13  Marek Safar  <marek.safar@gmail.com>
1407
1408         * class.cs Better error message.
1409
1410         * driver.cs: Add shorter versions of -optimize option.
1411
1412 2007-02-13  Martin Baulig  <martin@ximian.com>
1413
1414         * class.cs (Constructor.Emit): Check the return value of
1415         ec.ResolveTopBlock() and return on error.
1416
1417 2007-02-13  Raja R Harinath  <rharinath@novell.com>
1418
1419         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
1420         message to fix error message regression.
1421
1422 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1423
1424         * delegate.cs: Delegate creation expression cannot be of Nullable type.
1425
1426 2007-02-12  Marek Safar  <marek.safar@gmail.com>
1427
1428         A fix for bug #80749
1429         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
1430         its parent container.
1431
1432         * class.cs (DefineFieldInitializers): Each initializer can has different
1433         resolve context.
1434
1435         * const.cs: Updated.
1436
1437 2007-02-11  Miguel de Icaza  <miguel@novell.com>
1438
1439         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
1440         now all the heavy lifting to check that embedded statements or
1441         expressions have the right form is done in the ContextualReturn.
1442
1443         (ContextualReturn): New class.  
1444
1445         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
1446         method that can be invoked to report 201, so we do not replicate
1447         this everywhere.
1448
1449         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
1450         
1451         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
1452         treating tabs as spaces. 
1453
1454 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1455
1456         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
1457         * assign.cs: Use full implicit conversion for right side check.
1458
1459 2007-02-09  Marek Safar  <marek.safar@gmail.com>
1460
1461         * statement.cs (Switch): Switch over boolean type is not standardized.
1462
1463 2007-02-08  Marek Safar  <marek.safar@gmail.com>
1464
1465         A fix for bug #80755
1466         * decl.cs (FindBaseEvent): Don't use method cache for events.
1467
1468 2007-02-07  Marek Safar  <marek.safar@gmail.com>
1469
1470         * cs-parser.jay: Better syntax error handling.
1471
1472         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
1473         instead of underlying type value.
1474
1475 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1476
1477         * driver.cs: Check define identifier before is registered.
1478
1479         * namespace.cs: Use existing error message.
1480
1481         * report.cs: New warning.
1482
1483 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1484
1485         A fix for bug #80742
1486         * expression.cs: Delegate Invoke method can be called directly.
1487
1488 2007-02-06  Marek Safar  <marek.safar@gmail.com>
1489
1490         A fix for bug #80676
1491         * class.cs (IsEntryPoint): The Main method can have params modifier.
1492
1493 2007-02-04  Miguel de Icaza  <miguel@novell.com>
1494
1495         * parameter.cs (Parameter, Parameters): Add Clone method.
1496
1497         * anonymous.cs (Compatible): Turn method into virtual method, so
1498         LambdaExpression can implement a different behavior.
1499
1500         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
1501         out the basic checking here, so it can be used by
1502         LambdaExpressions.
1503         
1504         * lambda.cs: Introduce "Compatible" function that will do the
1505         heavy lifting.
1506
1507 2007-02-02  Marek Safar  <marek.safar@gmail.com>
1508
1509         * attribute.cs: Unified one error message.
1510
1511         * class.cs (Class): Use type attributes and not properties to test static
1512         class.
1513         (IsEntryPoint): Don's pass local variable.
1514
1515         * convert.cs: Removed duplicate check.
1516
1517         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
1518
1519         * driver.cs: Don't crash when soft reference does not exist.
1520
1521         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
1522         (UsingEntry): Removed redundant allocation.
1523
1524         * parameter.cs: Add fast path for type parameters.
1525
1526         * support.cs: Don't allocate attribute when it's not used.
1527
1528 2007-01-30  Miguel de Icaza  <miguel@novell.com>
1529
1530         * anonymous.cs
1531         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
1532         this into a virtual method, so we can override it in LambdaExpression.
1533
1534         * driver.cs: Improve diagnostics in case of failure. 
1535
1536         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
1537         write a function that is slightly more complex and that parses:
1538
1539         type identifier [, type identifier]* )
1540
1541         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
1542         this expression:
1543
1544                 (canEmpty ? i >= 0 : i > 0)
1545
1546 2007-01-30  Raja R Harinath  <rharinath@novell.com>
1547
1548         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
1549         exception on possibly valid code.
1550
1551 2007-01-29  Raja R Harinath  <rharinath@novell.com>
1552
1553         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
1554         Push/PopPosition.
1555         (parse_opt_type_arguments): Remove.  It's almost the same as
1556         parse_less_than.
1557         (parse_namespace_or_typename): Use parse_less_than.
1558
1559 2007-01-28  Miguel de Icaza  <miguel@novell.com>
1560
1561         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
1562         this bug took a few hours to find, because the state saved and
1563         restored by PushPosition and PopPosition was ignoring the state of
1564         parse_generic_less_than.
1565
1566         I can also now remove the handling of OP_LT and OP_GT, this solves
1567         the big mistery.
1568         
1569         * cs-tokenizer.cs: store the location for the ARROW token, we use
1570         that in the parser.
1571
1572         (PushPosition, PopPosition): save/restore also `current_token',
1573         restore `parse_generic_less_than' (was missing).
1574
1575         (parse_opt_type_arguments): use parse_type, not
1576         parse_namespace_or_typename to parse types.
1577
1578         * lambda.cs: Empty new file, will eventually have the lambda
1579         expression implementation.
1580
1581         * lambda.test: used to test the internal tokenizer. 
1582
1583         * report.cs (FeatureIsNotISO1): Rename from
1584         FeatureIsNotStandardized, because it was about the language level
1585         (1 vs 2) it was not about standarization.
1586
1587         (FeatureRequiresLINQ): New.
1588
1589         * support.cs (SeekableStreamReader): Only require that the reader
1590         is a TextReader, not a StreamReader, so we can plug StringReader. 
1591
1592         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
1593         given position in the input stream the following tokens can be
1594         parsed as a type followed by an identifier.
1595
1596         (is_punct): after a '(' if parse_type_and_parameter returns true,
1597         then return a special token OPEN_PARENS_LAMBDA which is used to
1598         avoid reduce/reduce errors in the grammar for the
1599         lambda_expression rules.
1600
1601         (parse_type): implement a type parser inside the
1602         tokenizer, the parser only returns true or false depending on
1603         whether the input at a given position can be parsed as a type.
1604
1605         (peek_token): new method used during type parsing.
1606
1607 2007-01-28  Raja R Harinath  <rharinath@novell.com>
1608
1609         Fix #80531
1610         * anonymous.cs (ScopeInfo.InflateParameters): New.
1611         (AnonymousContainer.Resolve): Use it to redirect types of
1612         delegate parameters.
1613
1614 2007-01-27  Raja R Harinath  <rharinath@novell.com>
1615
1616         Fix #80530
1617         * expression.cs (Error_InvalidArguments): Don't use two different
1618         messages for CS1503.  Use ExtraInformation and
1619         SymbolRelatedToPreviousError instead.
1620
1621         Fix #80358
1622         * decl.cs (DeclSpace.initialize_type_params): Don't access
1623         'type_params' of a partial class directly.
1624
1625 2007-01-26  Miguel de Icaza  <miguel@novell.com>
1626
1627         * constant.cs: Removed a handful of out-of-range checks that were
1628         not necessary. 
1629
1630 2007-01-25  Marek Safar  <marek.safar@gmail.com>
1631
1632         * expression.cs (CheckUselessComparison): Add additional check for char
1633         constants.
1634
1635         * namespace.cs: Fixed typo.
1636
1637 2007-01-23  Miguel de Icaza  <miguel@novell.com>
1638
1639         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
1640         gone, instead we inline the test, preventing the needless casts to
1641         longs, ulongs and doubles for the parameters, avoiding calls to
1642         methods that overchecked stuff, and instead inlined things
1643         nicely. 
1644
1645 2007-01-20  Marek Safar  <marek.safar@gmail.com>
1646
1647         * cs-parser.jay: Better parameter error handling.
1648
1649 2007-01-17  Marek Safar  <marek.safar@gmail.com>
1650
1651         A fix for bug #80368, #80522
1652         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
1653         whether array initializer contains constants only.
1654         (ArrayCreation.Emit): Use better formula to decide when
1655         are array initializers for static initialization.
1656         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
1657         have to emit even constants otherwise they are pre-initialized.
1658
1659 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
1660             Raja R Harinath  <rharinath@novell.com>
1661
1662         Fix emit order of 'get' vs. 'set'.
1663         * support.cs (Accessors): New.
1664         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
1665         Note the order in which accessors are declared in the source.
1666         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
1667         Refactored from Property.Define and Indexer.Define.
1668         (PropertyBase.DefineAccessors): New helper that calls the above in
1669         appropriate order as noted by the parser.
1670         (Property.Define, Indexer.Define): Update to changes.
1671         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
1672
1673 2007-01-17  Raja R Harinath  <rharinath@novell.com>
1674
1675         Fix cs0029-6.cs and gcs0029-2.cs (regression)
1676         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
1677         there's an implicit conversion from the current type to the target
1678         type before converting the underlying constant.
1679
1680 2007-01-16  Marek Safar  <marek.safar@gmail.com>
1681
1682         * const.cs (ResolveValue): Updated after constant conversion was made more
1683         generic.
1684
1685         * constant.cs (GetAttributableValue): constant to object conversion is
1686         used for attributes only.
1687         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
1688         constant conversions.
1689         (LongConstant.ConvertImplicitly): Ditto.
1690
1691         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
1692         (ImplicitConversionStandard): Handle constant conversion as extra step.
1693         It solves the issue when constant conversion was called indirectly like
1694         inside array initializer and constant folding was skipped.
1695
1696         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
1697         this change.
1698
1699         * statement.cs(ImplicitConversionStandard): Updated after constant
1700         conversion was made more generic.
1701
1702 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
1703
1704         * expression.cs (As.DoResolve): Use GenericConstraints instead of
1705         Constraints, solves the problem where the compiler incorrectly
1706         reported that a type parameter was not constrained to a class (Bug
1707         80518)
1708
1709 2007-01-14  Marek Habersack  <grendello@gmail.com>
1710
1711         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
1712
1713 2007-01-14  Marek Safar  <marek.safar@gmail.com>
1714
1715         A fix for bug #80368
1716         * assign.cs (FieldInitializer): New class implements field
1717         initializer statement.
1718
1719         * attribute.cs: Update after FieldMember rename.
1720
1721         * class.cs (PropertyBasedMember): New common class for property based
1722         types.
1723         (InterfaceMemberBase): New base class for all members which can be used as
1724         an interface members.
1725         (MethodCore): Moved really common code to InterfaceMemberBase.
1726         (Method.Define): Equal and GetHasCode detection is relevant for methods
1727         only.
1728         (MethodData.Define): Don't assume that public event implements an
1729         interface automatically.
1730         (MethodData.DefineMethodBuilder): Issue an error even if only extern
1731         modifier is used.
1732         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
1733         (FieldMember): Merged with FieldBase.
1734         (EventProperty.AEventPropertyAccessor): New specialization to check whether
1735         event extern modifier can be used.
1736         (EventField.EventFieldAccessor): Moved event field specific code here.
1737         (Event.AllowedModifiers): Even event can be extern.
1738         (Event.FindOutBaseMethod): New override specific to events.
1739         (Indexer.parameters): Reintroduce parameters because base class holds
1740         only properties common data.
1741         (Indexer.CheckForDuplications): Indexers are threated as methods so we
1742         need do extra parameters check.
1743
1744         * const.cs: Update after FieldMember rename.
1745
1746         * decl.cs (MemberCache.FindBaseEvent): New method.
1747
1748         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
1749         to reflect that indexer is now derived from PropertyBased.
1750
1751         * ecore.cs (GetMemberType): Made public.
1752         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
1753         obsolete event.
1754
1755         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
1756         
1757         * typemanager.cs (CSharpSignature): Correctly print event accessors.
1758         (RegisterEvent): Removed.
1759         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
1760         (GetPrivateFieldOfEvent): Renamed to GetEventField.
1761
1762 2007-01-11  Raja R Harinath  <rharinath@novell.com>
1763
1764         Fix #80249
1765         * statement.cs (CollectionForeach.TryType): Prefer generic
1766         GetEnumerator over non-generic variant.  Fix code to follow comments.
1767
1768 2007-01-09  Raja R Harinath  <rharinath@novell.com>
1769
1770         Fix #80446
1771         * support.cs (ReflectionParameter): Don't use an invalid index on
1772         the generic parameter data.
1773
1774 2007-01-08  Miguel de Icaza  <miguel@novell.com>
1775
1776         * driver.cs: Just add a tiny bit of infrastructure.
1777
1778 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1779
1780         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
1781         where field type is struct from current assembly.
1782         
1783         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
1784         it is possible.
1785
1786 2007-01-02  Marek Safar  <marek.safar@gmail.com>
1787
1788         A fix for bug #80381
1789         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
1790         the core types.
1791
1792         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
1793         messages.
1794         (Namespace.LookupType): Always use core types from corlib when speficied.
1795
1796         * report.cs: A new warning.
1797
1798         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
1799         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
1800         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
1801
1802         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
1803         (InitCoreTypes): Set expression type of object_type and value_type
1804         immediately after lookup.
1805
1806 2007-01-01  Miguel de Icaza  <miguel@novell.com>
1807
1808         * cs-tokenizer.cs: Accept Pc class characters (Connector
1809         Punctuation) as valid identifiers.  Fixes #78259
1810
1811         * expression.cs (Invocation.DoResolve): Moved the check for the
1812         use of `this' for doing method calls to the Invocation resolution
1813         step, after overload resolution has taken place instead of doing
1814         the check at the low-level `This.DoResolve' level.
1815
1816         The `This.DoResolve'(appens before overload resolution, so it has
1817         no way of knowing if the method that will be called will be
1818         instace or static, triggering an erroneous report for cs0188 (Bug
1819         78113).
1820
1821         We now do the check for instance method invocations after we know
1822         what method will be called.
1823
1824         (This.CheckThisUsage): Move the actual use of this structure
1825         checking into its own method and expose it. 
1826
1827         * Everywhere that called Error_ValueCannotBeConverted: pass a new
1828         EmitContext.
1829
1830         Exceptions: Null.ConvertImplicitly,
1831         Constant.ImplicitConversionRequired as there are too many call
1832         sites for passing the ec. 
1833
1834         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
1835         EmitContext, if the value is null, then we do not try to provide
1836         the extra information from the error (If a userdefined conversion
1837         exists, as UserDefinedConversion requires a non null-EmitContext).
1838
1839         Fixes: #80347
1840
1841 2006-12-30  Raja R Harinath  <rharinath@novell.com>
1842
1843         * flowanalysis.cs (MyBitVector): Document some invariants.
1844         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
1845         introduced below, and add a couple of others, 
1846
1847 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1848
1849         * attribute.cs (GetMethodObsoleteAttribute): Uses new
1850         GetPropertyFromAccessor and GetEventFromAccessor.
1851         
1852         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
1853         overrides non-obsolete one.
1854         (Indexer.Define): Error message has been moved to the parser.
1855
1856         * cs-parser.jay: Better syntax errors handling.
1857
1858         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
1859         when an invocation has no arguments.
1860
1861         * ecore.cs: Removed not used caching.
1862
1863         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
1864         implementation.
1865
1866         * report.cs: Add a new warning.
1867
1868         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
1869
1870         * typemanager.cs (enumeration_type): Removed.
1871         (CSharpSignature): Reuses IsSpecialMethod.
1872         (IsEqual): Hack for MS BCL.
1873         (GetPropertyFromAccessor): New method.
1874         (GetEventFromAccessor): New method.
1875         (IsSpecialMethod): Fixed to handle more cases.
1876
1877 2006-12-30  Marek Safar  <marek.safar@gmail.com>
1878
1879         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
1880         Made white spaces array static.
1881
1882         * ecore.cs (RemoveGenericArity): Optimized.
1883
1884         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
1885         10 times faster).
1886         (MyBitVector.initialize_vector): Simplified.
1887
1888 2006-12-22  Miguel de Icaza  <miguel@novell.com>
1889
1890         * ecore.cs: Am not entirely happy with this hack, but it seems to
1891         address the issue in 80257 (a small test case for
1892         CreativeDocs.NET). 
1893
1894         I set the MethodGroupExpr.Type to an internal compiler type
1895         (itself in this case) to force the resolution to take place.   Why
1896         it does not take place with a null is beyond me.
1897
1898 2006-12-20  Marek Safar  <marek.safar@gmail.com>
1899
1900         A fix for bug #80288
1901         * expression.cs (ResolveOperator): Consider user defined conversion for
1902         logical and operator too.
1903         (EmitBranchable): Optimization for logical and when full constant folding
1904         could not be applied but one operand is constant.
1905
1906 2006-12-19  Marek Safar  <marek.safar@gmail.com>
1907
1908         * class.cs (GetClassBases): Write 5 times every day, will never use
1909         FullName for error reporting.
1910
1911         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
1912
1913 2006-12-19  Martin Baulig  <martin@ximian.com>
1914
1915         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
1916         the symbol file info here.
1917
1918 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1919
1920         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
1921         of `elseif' is taking then following sections are not taking.
1922         Fixes an issue reported on mono mailing list.
1923
1924 2006-12-18  Marek Safar  <marek.safar@gmail.com>
1925
1926         A fix for bug #80300
1927         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
1928         a caller is not taking.
1929
1930 2006-12-18  Raja R Harinath  <rharinath@novell.com>
1931
1932         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
1933         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
1934         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
1935         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
1936         * class.cs: Update to changes.
1937
1938 2006-12-17  Marek Safar  <marek.safar@gmail.com>
1939
1940         A fix for bug #79934
1941         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
1942         partial container.
1943
1944         * class.cs (ResolveMembers): Register an iterator in current container and
1945         not in shared one.
1946
1947 2006-12-16  Raja R Harinath  <rharinath@novell.com>
1948
1949         Fix test-543.cs
1950         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
1951         satisfy a params annotated parameter.
1952
1953 2006-12-16  Marek Safar  <marek.safar@gmail.com>
1954
1955         A fix for bug #77014
1956         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
1957         paramters correctly and not rely on hacks in Parameters class.
1958         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
1959         at any possition.
1960         (Invocation.VerifyArgumentsCompat): Ditto.
1961         (Invocation.EmitArguments): Changed to correctly emit params arguments at
1962         any possition.
1963
1964         * parameter.cs (HasParams): Don't assume that params is the last one.
1965
1966         * support.cs (ReflectionParameters.ctor): Look for params attribute
1967         correctly.
1968         (ReflectionParameters.ParameterType): Removed hack when we returned last
1969         parameter for out of range parameters.
1970         (ParameterName, ParameterModifier): Ditto.
1971
1972 2006-12-14  Marek Safar  <marek.safar@gmail.com>
1973
1974         A fix for bug #79987
1975         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
1976         when assembly is not CLS compliant but type is. I have no idea why is this
1977         allowed.
1978
1979         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
1980
1981 2006-12-13  Miguel de Icaza  <miguel@novell.com>
1982
1983         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
1984         in struct constructors, they are basically no-ops.
1985
1986 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1987
1988         * cs-tokenizer.cs (Position): Save preprocessor status too.
1989
1990 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1991
1992         A fix for bug #77794
1993         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
1994
1995 2006-12-12  Marek Safar  <marek.safar@gmail.com>
1996
1997         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
1998         Fixes #69299.
1999         (pp_expr): Report error for an invalid expression.
2000         (handle_preprocessing_directive): Simplified; add more error checking.
2001
2002 2006-12-11  Marek Safar  <marek.safar@gmail.com>
2003
2004         A fix for bug #74939
2005         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
2006         directives handling.
2007
2008 2006-12-10  Marek Safar  <marek.safar@gmail.com>
2009
2010         A fix for bugs #80093, and #75984
2011         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
2012         logic, it seems to me as it worked before "by coincidence".
2013         (xtoken): Simplified to use reworked handle_preprocessing_directive.
2014         (cleanup): Enabled endif check.
2015
2016 2006-12-09  Marek Safar  <marek.safar@gmail.com>
2017
2018         A fix for bug #80162
2019         * statement.cs (CollectionForeach.TryType): Generics and non-generics
2020         enumerators are never ambiguous.
2021
2022 2006-12-08  Raja R Harinath  <rharinath@novell.com>
2023
2024         Fix #80060
2025         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
2026
2027 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2028
2029         A fix for bug #80144
2030         * class.cs (EventProperty.Define): Explicit implementation means
2031         that an even is used.
2032
2033 2006-12-06  Marek Safar  <marek.safar@gmail.com>
2034
2035         Fixes the operators implementation (part II)
2036
2037         * cfold.cs (DoConstantNumericPromotions): Renamed to
2038         DoBinaryNumericPromotions and simplified.
2039         (BinaryFold): Couple of conversion fixes; simplified.
2040
2041         * constant.cs, ecore.cs, literal.cs
2042         (ToType): Renamed to ConvertImplicitly.
2043         (Reduce): Renamed to ConvertExplicitly.
2044
2045         * class.cs, convert.cs: Updated.
2046
2047         * expression.cs: TryReduce doesn't throw an exception.
2048
2049 2006-12-01  Marek Safar  <marek.safar@gmail.com>
2050
2051         A fix for bug #80108
2052         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
2053         compatible.
2054
2055 2006-11-30  Marek Safar  <marek.safar@gmail.com>
2056
2057         Fixes unary operators implementation (part I)
2058         Also fixes #80026
2059
2060         * cfold.cs (Error_CompileTimeOverflow): Made internal
2061
2062         * const.cs (IConstant): Changed to use reference to constant and
2063         not constant itself.
2064         Updated IConstant implementations.
2065
2066         * constant.cs (CreateConstant): New factory method.
2067         Updated IConstant implementation.
2068
2069         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
2070
2071         * ecore.cs: Updated to use CreateConstantReference.
2072
2073         * enum.cs: Reflects IConstant changes.
2074
2075         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
2076
2077         * literal.cs (NullConstant): Change to be independently usable.
2078
2079 2006-11-29  Martin Baulig  <martin@ximian.com>
2080
2081         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
2082         we need to emit the scope initializer before calling the base .ctor.
2083
2084         * anonymous.cs: Merged back from the new anonymous methods branch.
2085         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
2086
2087         * expression.cs (ParameterReference.DoResolveBase): Create a
2088         "normal" ScopeInfo when capturing parameters rather than using the
2089         root scope; this makes things work with anonymous methods having
2090         parameters.
2091
2092         * statement.cs
2093         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
2094
2095 2006-11-22  Marek Safar  <marek.safar@gmail.com>
2096
2097         A fix for bug #79987
2098         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
2099         check to a base class.
2100         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
2101         only when assembly has missing attribute.
2102         * report.cs: Update.
2103
2104 2006-11-21  Marek Safar  <marek.safar@gmail.com>
2105
2106         * cs-tokenizer.cs: Merged with gmcs version.
2107
2108 2006-11-20  Marek Safar  <marek.safar@gmail.com>
2109
2110         * cs-tokenizer.cs,
2111         * cs-parser.jay: Better error message when partial keyword is misplaced.
2112
2113 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
2114
2115         A fix for bug #79810
2116         report.cs: CS1058 only applies to 2.0 profile (gmcs).
2117         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
2118         a RuntimeWrappedException by default.
2119
2120 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2121
2122         A fix for bug #79843
2123         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
2124         implementation.
2125         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
2126
2127 2006-11-18  Marek Safar  <marek.safar@gmail.com>
2128
2129         * driver.cs, namespace.cs: Uses faster IndexOf version.
2130
2131 2006-11-17  Marek Safar  <marek.safar@gmail.com>
2132
2133         A fix for bug #79941
2134         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
2135         operators.
2136         (Operator.Define): Implicit/Explicit operator of same type is duplicate
2137         even if internal name is different.
2138         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
2139         (UserDefinedConversion): Simplified as the operators cannot be internal.
2140         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
2141         conversions.
2142         (MethodLookup): Replaced EmitContext with parentType.
2143         * expression.cs: Updated.
2144
2145 2006-11-09  Raja R Harinath  <rharinath@novell.com>
2146
2147         * driver.cs (BadAssembly): Handle all the ugliness of
2148         DefineDynamicAssembly.
2149
2150 2006-11-08  Raja R Harinath  <rharinath@novell.com>
2151
2152         Address parts of #58244 -- most of what's left is in the runtime
2153         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
2154         CS1509 error checks, and handle them for all assembly loads, not
2155         just the first invocation.
2156         (LoadModule): Likewise.  Move handling of 'adder_method' ...
2157         * codegen.cs (AssemblyClass.AddModule): ... here.
2158
2159 2006-11-02  Marek Safar  <marek.safar@gmail.com>
2160
2161         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
2162         IEnumerable<T> is ambiguous.
2163
2164 2006-10-31  Marek Safar  <marek.safar@gmail.com>
2165
2166         A fix for bug #67689
2167         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
2168         GetEnumerator is ambiguous.
2169
2170         * report.cs: Add new warning.
2171
2172 2006-10-29  Marek Safar  <marek.safar@gmail.com>
2173
2174         A fix for bug #78602
2175         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2176         to protected member can be nested type.
2177
2178 2006-10-28  Marek Safar  <marek.safar@gmail.com>
2179
2180         A fix for bug #78965
2181         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
2182         to protected member must derive from current type.
2183
2184 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2185
2186         assign.cs: Reuses error method.
2187
2188         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
2189         instead of type for constants.
2190         (Expression.Error_ValueAssignment): Common error method.
2191
2192         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
2193         for any assignment.
2194
2195 2006-10-27  Marek Safar  <marek.safar@gmail.com>
2196
2197         A fix for bug #79081
2198         * expression.cs (MemberAccess.DoResolve): Check nested type
2199         accessibility.
2200
2201 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
2202
2203         * doc.cs : nested delegates were not handled. Fixed bug #79754.
2204
2205 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2206
2207         A fix for bug #76591
2208         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
2209
2210 2006-10-26  Marek Safar  <marek.safar@gmail.com>
2211
2212         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
2213         type forwarder of the same type multiple times.
2214
2215 2006-10-26  Raja R Harinath  <rharinath@novell.com>
2216
2217         Fix #78820
2218         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
2219         instance as an rvalue, even when we later resolve as an lvalue.
2220
2221 2006-10-25  Martin Baulig  <martin@ximian.com>
2222
2223         * anonymous.cs: Fix #79673.
2224
2225 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
2226
2227         A fix for bug #79666
2228         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
2229         ignored when is optimized (= default value) as its value is already set.
2230
2231 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2232
2233         A fix for bug #79724
2234         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
2235         TypeContainer for type lookup.
2236
2237 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
2238
2239         A fix for bug #79231
2240         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
2241         * expression.cs (OverloadResolve): Always convert type name for
2242         an error message.
2243         (ResolveNamespaceOrType): Don't confuse a nested type with any 
2244         other member.
2245
2246 2006-10-18  Martin Baulig <martin@ximian.com>
2247
2248         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
2249
2250 2006-10-17  Miguel de Icaza  <miguel@novell.com>
2251
2252         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
2253         an int32, but requesting an int64 from the conversion
2254
2255 2006-10-12  Martin Baulig  <martin@ximian.com>
2256
2257         * anonymous.cs
2258         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
2259         
2260 2006-10-12  Martin Baulig  <martin@ximian.com>
2261
2262         * statement.cs
2263         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
2264
2265 2006-10-11  Miguel de Icaza  <miguel@novell.com>
2266
2267         * convert.cs: Remove broken code: I was doing the "Existance"
2268         tests for Implicit conversions.
2269
2270 2006-10-10  Miguel de Icaza  <miguel@novell.com>
2271
2272         * convert.cs: Added one missing case in
2273         ImplicitStandardConversionExists uint64 to intptr.
2274
2275         Fixes #59800
2276         
2277         * typemanager.cs (uintptr_type): another core known type.   
2278
2279         * ecore.cs (OperatorCast): routine used to do cast operations that
2280         depend on op_Explicit.  We could change some of the Decimal
2281         conversions to use this.
2282
2283         This one has a probe mechanism that checks both types for an op_
2284         which it coudl be used to eliminate two classes: CastToDecimal
2285         and CastFromDecimal.
2286
2287         * convert.cs: Implement the conversions documented in #59800
2288         
2289 2006-10-10  Martin Baulig  <martin@ximian.com>
2290
2291         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
2292         before RootScope.ResolveMembers().
2293
2294         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
2295         `CurrentType' if appropriate.
2296
2297 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
2298
2299         A fix for bug #78568
2300         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
2301         when contains binary operators.
2302         * cs-parser.jay: Updated.
2303
2304 2006-10-09  Martin Baulig  <martin@ximian.com>
2305
2306         * delegate.cs
2307         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
2308         moved that into Define() and also do the other type parameter
2309         checks there.  Fixes #79094.  Added gtest-292.cs.
2310
2311         * expression.cs
2312         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
2313         since that doesn't include type parameters; don't use `Ldelema'
2314         for type parameters.  Fixes #78980.  Added gtest-293.cs.
2315
2316 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
2317
2318         A fix for #77796
2319         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
2320         conversion is allowed.
2321
2322 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2323
2324         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
2325         error reporting when no error occurs.
2326
2327 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
2328
2329         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
2330         does not exist.
2331
2332 2006-10-06  Raja R Harinath  <rharinath@novell.com>
2333
2334         Fix #79584
2335         * class.cs (DefineTypeBuilder): Check circular dependencies before
2336         setting the parent of the TypeBuilder.
2337         (CheckRecursiveDefinition): Don't use 'BaseType', since
2338         it may not be valid until after DefineTypeBuilder.  Use
2339         'base_type' instead.
2340
2341 2006-10-04  Martin Baulig  <martin@ximian.com>
2342
2343         Merged the Anonymous Methods patch.
2344
2345         * anonymous.cs, iterators.cs: The new anonymous methods code.
2346
2347         * statement.cs (Variable): New public abstract class.
2348         (LocalInfo.Variable): New public property.
2349         (LocalInfo.ResolveVariable): New public method.
2350         (Block.Flags): Add `IsIterator'.
2351         (Block.AddVariable): Improved the CS0136 check.
2352         (Block.AnonymousChildren): New public property.
2353         (Block.AddAnonymousChild): New public method.
2354         (ToplevelBlock): Update to use the new anonymous method framework.
2355         (ToplevelBlock.ctor): `container' is now a `Block' and not a
2356         `ToplevelBlock'; this is required to correctly implement the
2357         CS0136 check.
2358         (Fixed, Using): Use `TemporaryVariable' instead of directly
2359         creating the `LocalBuilder'.
2360
2361         * parameter.cs (Parameter.ResolveVariable): New public method.
2362         (Parameters.ResolveVariable): Likewise.
2363
2364         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
2365
2366         * class.cs (TypeContainer): Replaced the `iterators' list and
2367         corresponding methods with a list of `CompilerGeneratedClass'es.
2368         (TypeContainer.ResolveMembers): New public method.
2369         (Method): `IIteratorContainer' has been replaced by
2370         `IAnonymousHost'.
2371
2372         * expression.cs (VariableReference): New public abstract base
2373         class for `LocalVariableReference', `ParameterReference' and
2374         `This'.
2375
2376         * codegen.cs (EmitContext): Removed `capture_context',
2377         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
2378         (EmitContext.EmitThis): Removed.
2379
2380         * cs-parser.jay: Replace `iterator_container' with
2381         `anonymous_host'.       
2382
2383 2006-10-04  Martin Baulig  <martin@ximian.com>
2384
2385         * generic.cs (GenericMethod): Don't make this abstract.
2386         (Constraints.Clone): Added dummy implementation.
2387
2388 2006-10-04  Raja R Harinath  <harinath@gmail.com>
2389
2390         Fix #79577
2391         * namespace.cs (LookForAnyGenericType): Avoid nullref on
2392         'declspaces'.  Avoid allocating arrays willy-nilly.
2393
2394         Fix #79553
2395         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
2396         cases out of the switch.
2397
2398 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2399
2400         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
2401         message when non-generic type is used with the type arguments.
2402         * expression.cs: Updated.
2403
2404 2006-09-28  Raja R Harinath  <rharinath@novell.com>
2405
2406         Fix #79013
2407         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
2408         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2409         Change semantics slightly.  Don't insist on having only one
2410         temporary EmptyExpression -- just throttle the creation of new ones.
2411
2412         Fix #79451
2413         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
2414         non-interfaces too.  If no methods are found, don't try to create
2415         a MethodGroupExpr.
2416
2417 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
2418
2419         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
2420         generic type.
2421
2422         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
2423         us produce better error message.
2424
2425 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
2426
2427         * expression.cs (Binary.ResolveOperator): Warn about a side effect
2428         of the `|' operator.
2429
2430         * report.cs: A new warning added.
2431
2432 2006-09-27  Martin Baulig  <martin@ximian.com>
2433
2434         * generic.cs (GenericMethod): Don't make this abstract.
2435
2436 2006-09-27  Martin Baulig  <martin@ximian.com>
2437
2438         * report.cs
2439         (InternalErrorException): Added overloaded ctor taking a params array.
2440
2441 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
2442
2443         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
2444         Fixed the cases when same error was reported twice.
2445
2446         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
2447         now report symbol information.
2448
2449 2006-09-25  Martin Baulig  <martin@ximian.com>
2450
2451         * class.cs: Completely unified with the gmcs version.
2452
2453 2006-09-25  Martin Baulig  <martin@ximian.com>
2454
2455         * typemanager.cs (TypeManager.IsNullableType): New public function.
2456         (TypeManager.IsNullableTypeOf): Likewise.
2457         (TypeManager.IsNullableValueType): Likewise.
2458
2459         * class.cs (MethodCore): Added the `GenericMethod' argument from
2460         gmcs and also unified all classes derived from `MethodCore' with gmcs.
2461
2462 2006-09-24  Raja R Harinath  <harinath@gmail.com>
2463
2464         * convert.cs: Unify with gmcs version.
2465
2466 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2467
2468         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
2469         verify them as well.
2470
2471         * report.cs: New warning.
2472
2473 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2474
2475         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
2476         for anonymous block with out argument.
2477
2478 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
2479
2480         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
2481         not used private events only.
2482
2483 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
2484
2485         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
2486
2487         * const.cs (Const.Define): Check for constant type.
2488         (Const.IsConstantTypeValid): Looks for valid constant types.
2489
2490         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
2491
2492         * ecore.cs (EmptyConstantCast): New common class for all constant based
2493         EmptyCast(s).
2494
2495         * expression.cs (Is.DoResolve): Handle null constant especially.
2496         (New.DoResolve): Check for new void().
2497         (MemberAccess.DoResolve): Cope with all kind of nulls.
2498
2499         * literal.cs (NullConstant): Uses EmptyConstantCast.
2500         (NullDefault): Based on EmptyConstantCast.
2501         (NullLiteral): Uses EmptyConstantCast.
2502
2503         * statement.cs (Block.ResolveMeta): Check for constant type.
2504
2505 2006-09-22  Martin Baulig  <martin@ximian.com>
2506
2507         * delegate.cs, attribute.cs: Merged with the gmcs versions.
2508
2509 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2510
2511         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
2512         not the null type.
2513
2514         Fix part of #79451
2515         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
2516         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
2517         code slightly.
2518
2519 2006-09-22  Martin Baulig  <martin@ximian.com>
2520
2521         * ecore.cs: Merged with the gmcs version.
2522
2523         * generic.cs (ConstructedType): New dummy class.
2524         (TypeArguments): Don't make this abstract.
2525
2526         * typemanager.cs
2527         (TypeManager.IsGenericTypeDefinition): New method.
2528         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
2529
2530 2006-09-22  Raja R Harinath  <rharinath@novell.com>
2531
2532         * expression.cs (ComposedCast): Check for arrays of TypedReference
2533         before creating the type, not after.
2534
2535 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
2536
2537         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
2538         after ToType change.
2539
2540         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
2541         when constant must be implicitly convertible.
2542
2543         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
2544
2545         * ecore.cs (NullCast): Derives from NullConstant.
2546
2547         * expression.cs (Is.DoResolve): Removed useless variables.
2548         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
2549         (New.Constantify): Add enum support.
2550         (MemberAccess.DoResolve): Add warning when accessing null constant or
2551         variable.
2552
2553         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
2554         property.
2555
2556         * literal.cs (NullConstant): New abstract class with common
2557         functionality for all null specializations.
2558         (NullDefault): Represents default(X) when result can be
2559         reduced to null.
2560         (NullLiteral): Updated.
2561
2562         * report.cs: Add new warning.
2563
2564 2006-09-21  Martin Baulig  <martin@ximian.com>
2565
2566         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
2567
2568 2006-09-21  Martin Baulig  <martin@ximian.com>
2569
2570         * generic.cs (GenericConstraints): New dummy class.
2571         (Constraints): Likewise.
2572         (TypeParameter): Likewise.
2573         (TypeParameterName): Likewise.
2574         (GenericMethod): Likewise.
2575
2576         * typemanager.cs (TypeManager.GetGenericArguments): New method.
2577
2578         * decl.cs: Merged with the gmcs version.
2579
2580 2006-09-21  Raja R Harinath  <rharinath@novell.com>
2581
2582         * generic.cs (TypeParameter): Implement IMemberContainer.
2583         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
2584
2585         * rootcontext.cs: Unify with gmcs version.
2586
2587         * report.cs: Unify with gmcs version.
2588         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
2589         from gmcs/generics.cs.
2590         * generics.cs (TypeParameter): New dummy class.
2591
2592         * support.cs: Unify with gmcs version.
2593
2594 2006-09-20  Raja R Harinath  <rharinath@novell.com>
2595
2596         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
2597         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
2598
2599         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
2600         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
2601         * mcs.exe.sources: Add generic.cs.
2602
2603         * codegen.cs: Unify with gmcs version.
2604
2605         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
2606         (EmitContext): Add GenericDeclContainer implementation.
2607         * decl.cs (MemberCore, DeclSpace): Likewise.
2608         * namespace.cs: Remove #ifdef GMCS_SOURCE.
2609
2610         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
2611         MCS TypeManager has a corresponding dummy method.
2612
2613 2006-09-19  Martin Baulig  <martin@ximian.com>
2614
2615         * expression.cs: Completely merged with the gmcs version.
2616
2617 2006-09-19  Martin Baulig  <martin@ximian.com>
2618
2619         * expression.cs (Invocation): Merged with the gmcs version.
2620         (ArrayAccess.GetStoreOpcode): Likewise.
2621
2622 2006-09-19  Martin Baulig  <martin@ximian.com>
2623
2624         * typemanager.cs
2625         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
2626         (TypeManager.IsGenericMethodDefinition): Likewise.
2627
2628 2006-09-19  Martin Baulig  <martin@ximian.com>
2629
2630         * typemanager.cs
2631         (TypeManager.IsEqual): Moved the gmcs implementation here.
2632         (TypeManager.DropGenericTypeArguments): Likewise.
2633         (TypeManager.DropGenericMethodArguments): Likewise.
2634         (TypeManager.GetTypeArguments): Moved here from gmcs.
2635         (TypeManager.HasGenericArguments): Likewise.
2636
2637 2006-09-19  Martin Baulig  <martin@ximian.com>
2638
2639         * expression.cs (Binary): Merged with the gmcs version.
2640
2641 2006-09-19  Martin Baulig  <martin@ximian.com>
2642
2643         * expression.cs (Probe, As, Is): Merged with the gmcs version.
2644
2645 2006-09-19  Martin Baulig  <martin@ximian.com>
2646
2647         * typemanager.cs: Merged with the gmcs version.
2648
2649 2006-09-16  Raja R Harinath  <rharinath@novell.com>
2650
2651         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
2652         * driver.cs: Likewise.
2653
2654 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
2655
2656         A fix for #79401
2657         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
2658         only if parent type is class.
2659         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
2660         update.
2661
2662 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
2663
2664         * cs-parser.jay,
2665         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
2666         keywords are used.
2667         * typemanager.cs(CSharpName): Converts NullType to null.
2668
2669 2006-09-15  Martin Baulig  <martin@ximian.com>
2670
2671         * typemanager.cs
2672         (TypeManager.GetMethodName): Added mcs implementation.
2673         (TypeManager.IsEqual): Likewise.
2674
2675         * ecore.cs
2676         (SimpleName.RemoveGenericArity): Added dummy implementation.
2677
2678         * pending.cs: Merged with the gmcs version.     
2679
2680 2006-09-15  Martin Baulig  <martin@ximian.com>
2681
2682         * statement.cs: Merge with the gmcs version.
2683
2684 2006-09-15  Martin Baulig  <martin@ximian.com>
2685
2686         * statement.cs (Switch): Merge with the gmcs implementation
2687         (without nullables), which is newer.
2688
2689 2006-09-15  Martin Baulig  <martin@ximian.com>
2690
2691         * statement.cs (Block.Variables): Make this public.
2692         (ToplevelBlock.Parameters): Make this a property.
2693         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
2694
2695 2006-09-15  Martin Baulig  <martin@ximian.com>
2696
2697         * namespace.cs: Merge with the gmcs version.
2698
2699 2006-09-15  Martin Baulig  <martin@ximian.com>
2700
2701         * decl.cs (MemberName): Minor code cleanups.
2702
2703 2006-09-15  Martin Baulig  <martin@ximian.com>
2704
2705         * parameter.cs: Merge with the gmcs version.
2706
2707 2006-09-15  Martin Baulig  <martin@ximian.com>
2708
2709         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
2710         and an error in mcs.
2711
2712 2006-09-15  Martin Baulig  <martin@ximian.com>
2713
2714         * flowanalysis.cs: Merged from GMCS; added the generics code into
2715         a `GMCS_SOURCE' conditional so we can share this file.
2716
2717 2006-09-08  Martin Baulig  <martin@ximian.com>
2718
2719         * typemanager.cs (TypeManager.interlocked_type): New public field.
2720         (TypeManager.int_interlocked_compare-exchange): New public field.
2721         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
2722         enumerator types here and call InitGenericCoreTypes().
2723         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
2724         after calling InitEnumUnderlyingTypes().
2725
2726         * rootcontext.cs
2727         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
2728         `classes_second_stage'. 
2729
2730 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
2731
2732         * assign.cs, ecore.cs, expression.cs: Share error message text.
2733         * class.cs (FieldMember.Define): Check for varible of static type.
2734         * driver.cs (LoadAssembly): Uses error output for errors.
2735         * statement.cs: Updated.
2736
2737 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
2738
2739         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
2740         type instance.
2741
2742 2006-09-07  Martin Baulig  <martin@ximian.com>
2743
2744         * driver.cs
2745         (MainDriver): Revert r62663 from Marek; see #70506 for details.
2746
2747 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2748
2749         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
2750         
2751 2006-08-17  Miguel de Icaza  <miguel@novell.com>
2752
2753         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
2754         #52019 and #79064, the use of the \uXXXX sequence in source code
2755         to represent unicode characters.
2756
2757 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
2758
2759         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
2760         support.
2761         * class.cs, ecore.cs, statement.cs: Merged to one error message.
2762
2763 2006-08-13  Miguel de Icaza  <miguel@novell.com>
2764
2765         * assign.cs: Catch attempts to assign to a method groups in += and
2766         report as 1656
2767
2768 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
2769
2770         A fix for #79056
2771         * cs-parser.jay: Don't destroy current array type by typeof of array's.
2772
2773 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
2774
2775         * class.cs (Method.Define): Issue a warning when generic method looks like
2776         an entry point.
2777         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
2778         as well.
2779
2780 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
2781  
2782         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
2783         looking for ctor.
2784         * decl.cs (MemberCache.FindMembers): When container is interface we need to
2785         search all base interfaces as a member can be ambiguous.
2786         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
2787         Constructor member type filter. 
2788         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
2789         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
2790         reporting for returned memberinfos.
2791         * report.cs: Updated.
2792         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
2793         version to work on all runtimes.
2794         (TypeManager.RealMemberLookup): Removed members filtering.
2795
2796 2006-08-08  Raja R Harinath  <rharinath@novell.com>
2797
2798         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
2799         (PropertyExpr.EmitAssign): Likewise.
2800         * expression.cs (Indirection.EmitAssign): Likewise.
2801         (LocalVariableReference.EmitAssign): Likewise.
2802         (ParameterReference.EmitAssign): Likewise.
2803         (Invocation.EmitArguments): Likewise.
2804         (ArrayAccess.EmitAssign): Likewise.
2805         (IndexerAccess.EmitAssign): Likewise.
2806         (This.EmitAssign): Likewise.
2807         (ConditionalLogicalOperator.Emit): Likewise.
2808
2809         Fix #79026
2810         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
2811         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
2812         leave it in after returning it.
2813         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
2814
2815 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
2816
2817         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
2818         message.
2819
2820 2006-08-03  Raja R Harinath  <rharinath@novell.com>
2821
2822         Fix cs0146-3.cs and cs0146-4.cs.
2823         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
2824         enclosing types don't depend on the current type.
2825
2826 2006-08-02  Raja R Harinath  <rharinath@novell.com>
2827
2828         Fix #77963
2829         * class.cs (TypeContainer.DoDefineMembers): Use
2830         FindBaseMemberWithSameName on Parent, since we're interested in
2831         whether we hide inherited members or not.
2832         (FindBaseMemberWithSameName): Make slightly more robust.
2833
2834         Fix the non-generic testcase from #77396
2835         * decl.cs (DeclSpace.DeclContainer): Remove override.
2836
2837         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
2838         declspaces for doppelgangers too.
2839         (UsingEntry): Implement IResolveContext.
2840         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
2841         'this' as the resolve context.
2842         (LocalAliasEntry): Likewise.
2843
2844         Implement parts of #77403
2845         * roottypes.cs (RootDeclSpace): New.  Used to represent the
2846         toplevel declaration space.  Each namespace declaration introduces
2847         a "partial" root declaretion space.
2848         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
2849         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
2850         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
2851         from 'current_namespace.SlaveDeclSpace'.
2852         (namespace_declaration): Likewise.
2853         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
2854         check.  It can't happen now.
2855         * decl.cs (DeclSpace.LookupType): Likewise.
2856         * driver.cs (MainDriver): Sanity check.
2857
2858 2006-08-01  Raja R Harinath  <rharinath@novell.com>
2859
2860         * decl.cs (DeclSpace.FindNestedType): Remove.
2861         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
2862         LookupTypeContainer to get the container of the nested type.
2863         * class.cs (TypeContainer.FindNestedType): Make non-override.
2864
2865 2006-07-31  Raja R Harinath  <rharinath@novell.com>
2866
2867         * decl.cs (DeclSpace.PartialContainer): Move field from ...
2868         * class.cs (TypeContainer.PartialContainer): ... here.
2869         (TypeContainer.AddBasesForPart): New helper.
2870         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
2871         instead.
2872         * cs-parser.jay (current_class): Convert to DeclSpace.
2873         (struct_declaration, interface_declaration, class_declaration):
2874         Use AddBasesForPart instead of .Bases directly.
2875         * const.cs, iterators.cs: Update to changes.
2876
2877 2006-07-28  Raja R Harinath  <rharinath@novell.com>
2878
2879         * class.cs (TypeContainer.AddMemberType): Rename from
2880         AddToTypeContainer.
2881         (TypeContainer.AddMember): Rename from AddToMemberContainer.
2882         (AddTypeContainer): New.  Combine AddClassOrStruct and
2883         AddInterface.
2884         (AddPartial): Update.  Add 'is_partial' argument.
2885         * roottypes.cs: Update to changes.
2886         * cs-parser.jay (push_current_class): New helper for handling
2887         current_container and current_class.
2888         (struct_declaration, interface_declaration, class_declaration):
2889         Use it.
2890
2891 2006-07-26  Raja R Harinath  <rharinath@novell.com>
2892
2893         * roottypes.cs: Rename from tree.cs.
2894
2895         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
2896         * tree.cs (Tree, ITreeDump): Remove types.
2897         * rootcontext.cs (tree, Tree): Remove fields.
2898         (root, ToplevelTypes): New.
2899         * *.cs: Update to rename.
2900
2901         * tree.cs (Tree.RecordDecl): Remove.
2902         (RootTypes.AddToTypeContainer): Record the toplevel type in its
2903         namespace here.
2904         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
2905
2906 2006-07-23  Raja R Harinath  <harinath@gmail.com>
2907
2908         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
2909         DoFlowAnalysis and OmitStructFlowAnalysis here.
2910         (ec.With): Rename from WithUnsafe and generalize.
2911         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
2912         (ec.WithFlowAnalyis): New.
2913         * ecore.cs, expression.cs, statement.cs: Update.
2914
2915 2006-07-22  Raja R Harinath  <harinath@gmail.com>
2916
2917         * statement.cs (Block.ResolveMeta): Simplify slightly.
2918
2919         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
2920         multiple boolean fields.  Convert InUnsafe, constant_check_state,
2921         check_state to flags.
2922         (CheckState, ConstantCheckState): Update.
2923         (InUnsafe): New read-only property.
2924         (FlagsHandle): Rename from CheckStateHandle and convert to handle
2925         arbitrary flags.
2926         (WithUnsafe): New helper similar to WithCheckState.
2927         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
2928         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
2929
2930 2006-07-21  Raja R Harinath  <rharinath@novell.com>
2931
2932         Make comparisons use the same IL irrespective of whether they're
2933         in a 'checked' or 'unchecked' context: one of the issues in #78899
2934         * codegen.cs (EmitContext.CheckState): Make read-only property.
2935         (EmitContext.ConstantCheckState): Likewise.
2936         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
2937         helper that implement a save/restore stack for CheckState
2938         values.  This is the only way to change check-state.
2939         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
2940         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
2941         (CheckedExpr.EmitBranchable): New forwarding method.
2942         (UnCheckedExpr): Likewise.
2943         * statement.cs (Block.ResolveMeta): Use WithCheckState.
2944         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
2945         (Checked.Resolve, checked.DoEmit): Likewise.
2946
2947 2006-07-20  Miguel de Icaza  <miguel@novell.com>
2948
2949         * anonymous.cs: Cache the resolved anonymous delegate, and return
2950         this so that the ResolveTopBlock is only triggered once, not
2951         twice.
2952
2953         Currently we trigger ResolvetopBlock twice due to a first pass of
2954         argument check compatibility, and a second pass that does the
2955         actual resolution.   
2956         
2957 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2958
2959         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
2960         modifiers.
2961         * rootcontext.cs (Reset): Add helper_classes.
2962
2963 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
2964
2965         A fix for #78860
2966         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
2967         correctly.
2968
2969 2006-07-13  Miguel de Icaza  <miguel@novell.com>
2970
2971         * statement.cs (Lock): Handle expressions of type
2972         TypeManager.null_type specially.  Fixes #78770
2973
2974 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2975
2976         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
2977         to an event.
2978
2979 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
2980
2981         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
2982         for accessors as well.
2983         * ecore.cs (EventExpr): Add AccessorTable.
2984
2985 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
2986
2987         A fix for #78738
2988         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
2989         for CS0122 where appropriate.
2990         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
2991         level attributes.
2992         (Filter): Assembly can be null in the case of top level attributes.
2993
2994 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
2995
2996         A fix for #78690
2997
2998         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
2999         is done at global level.
3000
3001 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3002
3003         A fix for #77002, Implemented TypeForwarder support.
3004
3005         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
3006         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
3007         * typemanager.cs (): Add type_forwarder_attr_type.
3008
3009 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
3010
3011         * report.cs: Add CS0469 warning.
3012
3013 2006-06-21  Martin Baulig  <martin@ximian.com>
3014
3015         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
3016         the `try'-block, so we also report CS0016 etc. there.
3017
3018 2006-06-21  Martin Baulig  <martin@ximian.com>
3019
3020         * delegate.cs
3021         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
3022
3023 2006-06-21  Martin Baulig  <martin@ximian.com>
3024
3025         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
3026         also report CS1686 for parameters.
3027
3028 2006-06-21  Martin Baulig  <martin@ximian.com>
3029
3030         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
3031         instead of an error if the value is not implicitly convertible to
3032         the switch types; fixes #77964.
3033
3034 2006-06-21  Raja R Harinath  <rharinath@novell.com>
3035
3036         Fix #78673
3037         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
3038         FieldBuilder is null.
3039
3040         Fix #78662
3041         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
3042         'left' and 'right' before error-checking.
3043
3044 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
3045
3046         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
3047         Fixed bug #78601.
3048         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
3049         (FieldExpr.DoResolve): likewise.
3050         (PropertyExpr.InstanceResolve): likewise.
3051         (EventExpr.InstanceResolve): likewise. 
3052
3053 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
3054
3055         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
3056         attribute applicable tests for attribute argument.
3057
3058 2006-06-02  Raja R Harinath  <rharinath@novell.com>
3059
3060         Fix #78079
3061         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
3062         (Binary.OverloadResolve_PredefinedIntegral): New.
3063         (Binary.OverloadResolve_PredefinedFloating): New.
3064         (Binary.OverloadResolve_PredefinedString): New.
3065         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
3066         Follow the standard more closely, and treat numeric promotions in
3067         terms of overload resolution.
3068         (Binary.CheckShiftArguments): Simplify.
3069
3070 2006-06-01  Raja R Harinath  <rharinath@novell.com>
3071
3072         * flowanalysis.cs (MyBitVector): Simplify representation.
3073         (MyBitVector.Clone): Avoid allocating BitArray.
3074         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
3075         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
3076         (*): Update.  Change all references to MyBitVector.And and
3077         MyBitVector.Or to &= and |=.
3078
3079 2006-05-29  Raja R Harinath  <rharinath@novell.com>
3080
3081         Fix cs0231-[34].cs.
3082         * cs-parser.jay (formal_parameter_list): Extend the pattern below
3083         to param arguments too.
3084
3085 2006-05-26  Miguel de Icaza  <miguel@novell.com>
3086
3087         * cs-parser.jay: Catch another parsing form for arglist being
3088         followed by other arguments.  Fixes #78313.
3089
3090 2006-05-24  Raja R Harinath  <rharinath@novell.com>
3091
3092         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
3093         checking of out parameters to ...
3094         (FlowBranchingToplevel.Merge): ... here.
3095         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
3096         set, propagate the origin upward, and only complain if there was
3097         no other error.
3098         (FlowBranchingException.AddContinueOrigin): Likewise.
3099         (FlowBranchingException.AddReturnOrigin): Likewise.
3100         (FlowBranchingException.AddGotoOrigin): Likewise.       
3101
3102 2006-05-23  Raja R Harinath  <rharinath@novell.com>
3103
3104         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
3105         unreachable, skip it.
3106         (FlowBranchingException.Merge): Always propagate jumps, even if
3107         the finally block renders subsequent code unreachable.
3108
3109 2006-05-18  Raja R Harinath  <rharinath@novell.com>
3110
3111         Fix #77601
3112         * statement.cs (Goto.Resolve): Move responsibility for resolving
3113         'goto' to FlowBranching.AddGotoOrigin.
3114         (Goto.SetResolvedTarget): New.  Callback to set the
3115         LabeledStatement that's the target of the goto.
3116         (Goto.DoEmit): Use Leave instead of Br when crossing an
3117         unwind-protect boundary.
3118         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
3119         LookupLabel and adjust to new semantics.
3120         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
3121         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
3122         Goto.SetResolvedTarget to update target.
3123         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
3124         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
3125         AddBreakOrigin & co.  Delay propagation until ...
3126         (FlowBranchingException.Merge): ... this.
3127
3128         * statement.cs (Block.Resolve): Always depend on flow-branching to
3129         determine unreachability.  Kill workaround that originally emitted
3130         only one statement after an "unreachable" label (see infloop in
3131         test-515.cs).
3132
3133         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
3134         This is still "wrong", but anything better would probably need a
3135         multi-pass algorithm.
3136         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
3137         usage vector.  Force current usage vector to be reachable, to
3138         optimistically signify backward jumps.
3139         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
3140         detected.
3141         (FlowBranchingLabeled.Merge): New.  If no backward jump was
3142         detected, return the original salted-away usage vector instead,
3143         updated with appropriate changes.  Print unreachable warning if
3144         necessary.
3145         * statement.cs (Block.Resolve): Don't print unreachable warning on
3146         a labeled statement.
3147
3148 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
3149
3150         * driver.cs: Pass filename without path to AssemblyBuilder's 
3151         AddResourceFile. Fixes bug #78407.
3152
3153 2006-05-17  Raja R Harinath  <rharinath@novell.com>
3154
3155         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
3156         * flowanalysis.cs (FlowBranchingLabeled): ... here.
3157         (FlowBranching.MergeChild): Overwrite
3158         reachability information from Labeled branchings too.
3159
3160 2006-05-16  Raja R Harinath  <rharinath@novell.com>
3161
3162         * statement.cs (Goto.Resolve): Merge jump origins here ...
3163         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
3164
3165         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
3166         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
3167         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
3168         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
3169         here, ...
3170         * statement.cs (Goto.Resolve): ... not here.
3171         (Goto.Emit): Remove CS1632 check.
3172
3173 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
3174
3175         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
3176         error message.
3177
3178 2006-05-11  Raja R Harinath  <rharinath@novell.com>
3179
3180         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
3181         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
3182         (FlowBranchingException.Label): Likewise.
3183
3184         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
3185         given value.
3186         (MyBitVector.Or): Use it to avoid losing information (Count).
3187         (FlowBranching.MergeOrigins): Likewise.
3188
3189         * flowanalysis.cs (UsageVector.IsDirty): Remove.
3190         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
3191         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
3192         (UsageVector.ToString): Simplify.
3193         (UsageVector.MergeSiblings): Move here from ...
3194         (FlowBranching.Merge): ... here.
3195         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
3196         not a MyBitVector.
3197
3198 2006-05-10  Raja R Harinath  <rharinath@novell.com>
3199
3200         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
3201         null bitvector is treated as all-true.
3202
3203         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
3204         (MyBitVector): Rationalize invariants.  'vector != null' implies
3205         that we have our own copy of the bitvector.  Otherwise,
3206         'InheritsFrom == null' implies all inherited bits are true.
3207
3208 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
3209
3210         * statement.cs (LocalInfo): Add IsConstant.
3211         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
3212         local variable for constants.
3213
3214 2006-05-09  Raja R Harinath  <rharinath@novell.com>
3215
3216         * flowanalysis.cs (MyBitVector.Empty): New.
3217         (MyBitVector): Don't allow InheritedFrom to be null.
3218         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
3219         (UsageVector, FlowBranching): Update to changes.
3220
3221         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
3222         recursion.  The 'Parent == null' condition isn't sufficient for
3223         anonymous methods.
3224         (FlowBranching.AddBreakOrigin): Likewise.
3225         (FlowBranching.AddContinueOrigin): Likewise.
3226         (FlowBranching.AddReturnOrigin): Likewise.
3227         (FlowBranching.StealFinallyClauses): Likewise.
3228         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
3229         (FlowBranching.CheckOutParameters): Likewise.
3230         (FlowBranchingToplevel): Terminate all the above recursions here.
3231         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
3232         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
3233
3234         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
3235         toplevel block.
3236         (FlowBranchingToplevel): New.  Empty for now.
3237         (FlowBranching.MergeTopBlock): Update.
3238         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
3239         branching for the anonymous delegate.
3240         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
3241
3242         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
3243         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
3244         information at the start of the merge.  Reorganize.
3245
3246 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3247
3248         * class.cs (MethodData.Define): Method cannot implement interface accessor.
3249
3250 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3251
3252         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
3253         to newly introduced ctor.
3254
3255         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
3256         message to one place.
3257         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
3258         global namespace.
3259
3260 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
3261
3262         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
3263
3264         * ecore.cs (Expression.ResolveAsConstant): Updated.
3265
3266         * statement.cs (ResolveMeta): Updated.
3267
3268 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3269
3270         * cs-parser.jay: __arglist cannot be used in initializer.
3271
3272 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
3273
3274         A fix for #77879
3275         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
3276         private types.
3277
3278 2006-05-05  Raja R Harinath  <rharinath@novell.com>
3279
3280         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
3281         (LabeledStatement): Add 'name' parameter.
3282         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
3283         (Block.AddLabel): Update to changes.
3284         * cs-parser.jay (labeled_statement): Likewise.
3285
3286         * flowanalysis.cs (BranchingType.Labeled): New.
3287         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
3288         (FlowBranchingLabeled): New.  Does nothing for now, but will
3289         eventually handle 'goto' flows.
3290         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
3291         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
3292         that's terminated ...
3293         (Block.Resolve): ... here.
3294
3295         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
3296         (UsageVector.MergeFinallyOrigins): Likewise.
3297         (FlowBranching.InTryOrCatch): Likewise.
3298         (FlowBranching.AddFinallyVector): Likewise.
3299         (FlowBranchingException): Update to changes.
3300
3301         Fix #78290
3302         * statement.cs (Return.Resolve): Move error checking to ...
3303         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
3304         (FlowBranchingException): Handle return origins like break and
3305         continue origins.
3306         (FlowBranching.UsageVector.CheckOutParameters): Remove.
3307
3308 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3309
3310         A fix for #76122
3311         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
3312         filter.
3313
3314 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
3315
3316         A fix for #77543
3317         * class.cs (MethodData.Define): Do public accessor check only when method
3318         implements an interface.
3319
3320 2006-05-04  Raja R Harinath  <rharinath@novell.com>
3321
3322         Remove special handling of 'break'
3323         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
3324         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
3325         (UsageVector.Break): Remove.
3326         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
3327         reachability.
3328         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
3329
3330         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
3331         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
3332
3333 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3334
3335         A fix for #75726
3336         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
3337         be the interface member.
3338
3339 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
3340
3341         A fix for #60069
3342         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
3343         for emitting small (int) values.
3344
3345 2006-05-03  Raja R Harinath  <rharinath@novell.com>
3346
3347         Fix #59427
3348         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
3349         control-flow passes through the 'finally' after merging-in all the
3350         control-flows from 'try' and the 'catch' clauses.
3351
3352         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
3353         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
3354         always true at the only non-recursive entry point.
3355         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
3356         FlowBranchingBreakable.
3357         (FlowBranchingLoop): Remove.
3358         * statement.cs (Return.DoResolve): Update to changes.
3359
3360         Fix #76471, #76665
3361         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
3362         (FlowBranching.CreateBranching): Handle it: create a
3363         FlowBranchingContinuable.
3364         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
3365         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
3366         except that it handles the 'continue' command.
3367         (FlowBranching.UsageVector.MergeOrigins): Rename from
3368         MergeBreakOrigins.
3369         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
3370         except that it overrides AddContinueOrigin.
3371         (FlowBranchingException): Override AddContinueOrigin, similar to
3372         AddBreakOrigin.
3373         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
3374         Create a new branching around the embedded statement.
3375         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
3376         control flow after the embedded statement.
3377         (Continue.Resolve): Move all error checking to AddContinueOrigin.
3378
3379         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
3380         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
3381         FlowBranchingBreakable.
3382         (FlowBranchingSwitch): Remove.
3383
3384         Fix test-503.cs
3385         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
3386         error reporting to ...
3387         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
3388         Rename from 'AddBreakVector'.  Add new location argument.  Return
3389         a bool indicating whether the 'break' crosses an unwind-protect.
3390         (FlowBranchingException.AddBreakOrigin): Add.
3391         (FlowBranchingException.Merge): Propagate 'break's to surrounding
3392         flowbranching after updating with the effects of the 'finally'
3393         clause.
3394         (FlowBranchingBreakable): New common base class for
3395         FlowBranchingLoop and FlowBranchingSwitch.
3396
3397         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
3398         embedded statement.
3399         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
3400
3401 2006-05-02  Raja R Harinath  <rharinath@novell.com>
3402
3403         * statement.cs (Do.Resolve): If the loop is infinite, set the
3404         barrier.
3405         (While.Resolve, For.Resolve): Set a barrier after the embedded
3406         statement.  There's no direct control flow that goes from the end
3407         of the embedded statement to the end of the loop.
3408         * flowanalysis.cs (FlowBranching.Infinite): Remove.
3409         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
3410         above ensure that the reachability is correctly computed.
3411
3412         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
3413         (UsageVector.MergeBreakOrigins): If the current path is
3414         unreachable, treat it as if all parameters/locals are initialized.
3415         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
3416         infinite loops before merging-in break origins.
3417
3418         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
3419         (Reachability.Reachable): Split part into ...
3420         (Reachability.Unreachable): ... this.  Simplify.
3421         (Reachability.IsUnreachable): Use 'Unreachable' instead.
3422
3423         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
3424         (Reachability.SetThrowsSometimes): Likewise.
3425         (FlowBranchingBlock.MergeTopBlock): Don't compare against
3426         TriState.Always, use corresponding property.
3427         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
3428         (Block.Resolve): Likewise.  Remove some redundant checks.
3429
3430 2006-05-02  Raja R Harinath  <harinath@gmail.com>
3431
3432         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
3433         (Reachability.Meet): Don't bother checking AlwaysThrows --
3434         barrier is always set.
3435         (FlowBranchingBlock.Merge): Likewise.
3436
3437 2006-05-01  Raja R Harinath  <harinath@gmail.com>
3438
3439         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
3440         checks for unreachable.
3441
3442 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
3443
3444         A fix for #77980
3445         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
3446
3447         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
3448         whether field is really assigned.
3449
3450 2006-04-30  Raja R Harinath  <harinath@gmail.com>
3451
3452         * flowanalysis.cs (Reachability): Make 4-argument constructor
3453         private.
3454         (Reachability.Meet): Rename from 'And'.  Remove static variant.
3455         (Reachability.Always): Rename from the highly misleading
3456         'Reachability.Never'.
3457         (FlowBranching.Merge): Update to changes.  Mark an impossible
3458         situation with a 'throw'.
3459         (*): Update to changes.
3460
3461 2006-04-29  Raja R Harinath  <harinath@gmail.com>
3462
3463         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
3464         Remove 'Undefined'.
3465         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
3466         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
3467         (*): Update to changes.
3468         * statement.cs: Update to changes.
3469
3470 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
3471
3472         A fix for #78049
3473         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
3474
3475 2006-04-28  Raja R Harinath  <harinath@gmail.com>
3476
3477         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
3478         dummy UsageVector.
3479
3480         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
3481         argument to two arguments: an usage-vector and a bool.  Move call
3482         to FlowBranching.Merge () ...
3483         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
3484
3485         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
3486         handling of loop and switch reachability to ...
3487         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
3488
3489 2006-04-27  Raja R Harinath  <harinath@gmail.com>
3490
3491         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
3492         handling to FlowBranchingLoop.InLoop.
3493         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
3494
3495 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
3496
3497         A fix for #78115
3498         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
3499         anonymous method is allowed from AnonymousContainer here.
3500
3501         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
3502
3503 2006-04-24  Raja R Harinath  <rharinath@novell.com>
3504
3505         Fix #78156
3506         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
3507
3508 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
3509
3510         A fix for #49011.
3511         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
3512         (DoubleConstant.Reduce): Ditto.
3513
3514 2006-04-23  Raja R Harinath  <rharinath@novell.com>
3515
3516         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
3517         Remove 'lvalue_right_side' argument.  Move parts to ...
3518         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
3519         (LocalVariable.DoResolveLValue): ... these.
3520
3521 2006-04-21  Raja R Harinath  <rharinath@novell.com>
3522
3523         Fix cs1655.cs
3524         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
3525         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
3526         (LocalVariableReference.DoResolveBase): Use it to implement new
3527         CS1655 check.
3528         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
3529         (Argument.Resolve): Simplify.  Move CS1510 check ...
3530         * ecore.cs (Expression.ResolveLValue): ... here.
3531         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
3532         (PropertyExpr.DoResolveLValue): Likewise.
3533         (FieldExpr.Report_AssignToReadonly): Likewise.
3534         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
3535         LValueMemberAccess or LValueMemberOutAccess on instance depending
3536         on it.
3537         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
3538         DoResolve as appropriate.
3539
3540 2006-04-20  Raja R Harinath  <rharinath@novell.com>
3541
3542         Fix #75800
3543         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
3544         implicit conversions on 'out' and 'ref' arguments.
3545
3546         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
3547         improve clarity.  Remove dead code.
3548
3549         Fix #66031
3550         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
3551         (Catch.Resolve): Resolve VarBlock if it exists.
3552
3553 2006-04-19  Miguel de Icaza  <miguel@novell.com>
3554
3555         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
3556         twice, this was some residual code, the enumerator was emitted
3557         properly in the two branche of if later.
3558
3559 2006-04-19  Raja R Harinath  <rharinath@novell.com>
3560
3561         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
3562         cast is never an lvalue.
3563         (Cast.DoResolve, Cast.ResolveRest): Combine.
3564         (Argument.Emit): Simplify slightly.  Move 'Expr is
3565         IMemoryLocation' check ...
3566         (Argument.Resolve): ... here.
3567         (Argument.Error_LValueRequired): Remove.  Inline into only user.
3568
3569         Simplifications.  Fix cs0191-2.cs
3570         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
3571         CS1649 and CS1651 to ...
3572         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
3573         the actual selection of the error code and message to a lookup
3574         table.  Add a dummy return value to simplify callsites.
3575         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
3576         readonly fields of other instances of the same type.  Move CS0197
3577         warning from ...
3578         * expression.cs (Argument.Resolve): ... here.  Simplify code.
3579         Ensure that ec.InRefOutArgumentResolving is only set during LValue
3580         resolution of an out or ref argument.  The code simplification
3581         above uses this invariant.
3582
3583 2006-04-18  Raja R Harinath  <rharinath@novell.com>
3584
3585         Possibly fix #77752.  Fix cs1690-[4-7].cs.
3586         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
3587         CheckMarshallByRefAccess.  Drop parameter.
3588         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
3589         warning.
3590         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
3591         InstanceExpression.
3592         * report.cs (AllWarnings): Add CS1690.
3593         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
3594         for ref access too.
3595         (LocalVariableReference.DoResolveBase): Update.
3596
3597 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3598
3599         * class.cs (MethodOrOperator): Moved common parts from method class.
3600         detect obsolete attributes.
3601         (Method.Define): Simplified as it reuses code from base.
3602         (Constructor.ValidAttributeTargets): Fixed issue found during
3603         refactoring.
3604         (Destructor.ValidAttributeTargets): Fixed issue found during
3605         refactoring.
3606         (Operator): Finished refactoring set off by #78020. Operator class is now
3607         ordinary method class.
3608
3609         * anonymous.cs: Updated.
3610
3611         * decl.cs (DeclSpace): Add IsGeneric
3612
3613 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3614
3615         * class.cs (Constructor.Emit): Don't emit the attributes twice.
3616
3617 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3618
3619         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
3620         detect obsolete attributes.
3621         (Method.CreateEmitContext): Moved to MethodOrOperator.
3622
3623 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
3624
3625         A fix for #78048.
3626         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
3627         customized exception to make crash detection easier.
3628         (MethodOrOperator): Started to work on new base class for methods and
3629         operators.
3630         (Method): Derives from MethodOrOperator.
3631         (Constructor.Emit): Emits its own attributes.
3632         (AbstractPropertyEventMethod.Emit): Ditto.
3633         (Operator): Derives from MethodOrOperator, will refactor fully in extra
3634         patch.
3635         (Operator.Emit): It's temporary more tricky than should be.
3636         
3637         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
3638
3639         * report.cs (InternalErrorException): Add ctor with inner exception.
3640
3641 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
3642
3643         A fix for #76744.
3644         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
3645         only not visible.
3646
3647 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
3648
3649         A fix for #77916.
3650         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
3651         array.
3652
3653 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3654
3655         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
3656         attribute is present and Guid not.
3657         (Interface.ApplyAttributeBuilder): Ditto.
3658
3659         * attribute.cs: Add error message.
3660
3661 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
3662
3663         A fix for #78020.
3664
3665         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
3666         sources (it's composite) so hold them in extra array as they are used in
3667         Emit phase only. It worked in the previous versions by mistake.
3668         (Attribute.Emit): Emit attribute for more owners when exist.
3669
3670         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
3671         it has now different behaviour.
3672
3673 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
3674
3675         * constant.cs (Constant.IsDefaultInitializer): New method.
3676
3677         * class.cs: Updated.
3678
3679         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
3680         re-initialize default values. It saves KBs almost for every assembly.
3681         Thanks Zoltan for the idea.
3682         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
3683         (ArrayCreation.DoResolve): Resolve only once.
3684         (ArrayCreation.Emit): Emit static initializer only when it is faster.
3685         (ArrayCreation.GetAttributableValue): Cope with optimized values.
3686
3687 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
3688
3689         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
3690         From #77961.
3691
3692 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3693
3694         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
3695         in an embedded statement too.
3696
3697 2006-04-01  Raja R Harinath  <rharinath@novell.com>
3698
3699         Fix #77958
3700         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
3701
3702 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
3703
3704         A fix for #77966.
3705
3706         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
3707         was not specified.
3708
3709         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
3710
3711 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
3712
3713         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
3714         phase.
3715
3716         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
3717         LocalTemporary change.
3718
3719         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
3720         TypeContainer.
3721         (ClassOrStruct.DefineFieldInitializers): Implemented static field
3722         initializers optimization.
3723         (ClassOrStruct.TypeAttr): Moved from modifiers.
3724         (Constructor.CheckBase): Don't crash when static ctor has parameters.
3725         (FieldBase.ResolveInitializer): Resolves initializer.
3726         (FieldBase.HasDefaultInitializer): New property.
3727
3728         * cs-parser.jay: Removed message.
3729
3730         * expression.cs (CompilerGeneratedThis): New specialization.
3731
3732         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
3733
3734 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
3735
3736         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
3737
3738 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3739
3740         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
3741         be now EnumConstants only.
3742
3743 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
3744
3745         * attribute.cs, driver.cs: Reset more caches.
3746
3747 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3748
3749         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
3750
3751 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3752
3753         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
3754         for easier reuse. Updated all overrides.
3755         (IntegralConstant): New base class for all integral constants.
3756         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
3757         of the constant range, report custom error.
3758         (UIntConstant.Reduce): Fixed uint conversion.
3759
3760         * ecore.cs, literal.cs: Reduce updates.
3761
3762 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3763
3764         A fix for #75813.
3765
3766         * class.cs (Constructor.Define): Removed extra if for default ctors.
3767         A patch from Atsushi Enomoto.
3768
3769 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
3770
3771         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
3772         GetAttributableValue.
3773
3774         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
3775         when required.
3776
3777         * convert.cs (ImplicitConversionRequired): Error message moved to
3778         DoubleLiteral.
3779
3780         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
3781         automatic implicit conversion of an output value.
3782         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
3783
3784         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
3785         conversion.
3786         (TypeOf.GetAttributableValue): Add extra handling for object type.
3787
3788         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
3789         special error message.
3790
3791 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
3792
3793         * class.cs (Constructor.Emit): Don't crash when struct ctor is
3794         InternalCall.
3795         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
3796         compatible with MS runtime.
3797
3798 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
3799
3800         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
3801         attribute arguments here.
3802
3803         * class.cs (Indexer.Define): The check was moved to attribute class.
3804
3805 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
3806
3807         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
3808         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
3809         easier.
3810
3811 2006-03-22  Raja R Harinath  <rharinath@novell.com>
3812
3813         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
3814         mcs to keep code differences small.
3815         * attribute.cs (Attribute.GetParameterDefaultValue): New.
3816         * typemanager.cs (parameter_default_value_attribute_type): New.
3817         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
3818         CS1908 check.
3819
3820 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3821
3822         * expression.cs (StringConcat.Append): Reverted back to no warning state.
3823
3824 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
3825
3826         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
3827
3828         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
3829         the blocks too.
3830
3831 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
3832
3833         * doc-bootstrap.cs : fix build.
3834
3835 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3836
3837         * expression.cs (StringConcat.Append): Issue a warning when empty string
3838         is going to append.
3839
3840 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
3841
3842         * assign.cs (CompoundAssign.ResolveSource): Removed.
3843
3844         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
3845         clean up.
3846
3847         * class.cs (TypeContainer.FindMethods): Removed.
3848         (TypeContainer.CheckMemberUsage): Made static.
3849
3850         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
3851
3852         * constant.cs (CheckRange): Removed unused type argument.
3853         (CheckUnsigned): Removed unused type argument.
3854
3855         * cs-parser.jay: Updated after MemberAccess clean up.
3856         Uses Length for empty string test.
3857
3858         * cs-tokenizer.cs: Uses Length for empty string test.
3859         (IsCastToken): Made static.
3860         (is_hex): Made static.
3861         (real_type_suffix): Made static.
3862
3863         * decl.cs (SetupCache): Made static.
3864         (OnGenerateDocComment): Removed unused ds argument.
3865
3866         * delegate.cs (VerifyDelegate): Removed unused argument.
3867
3868         * doc.cs: Uses Length for empty string test.
3869
3870         * driver.cs: Uses Length for empty string test.
3871
3872         * enum.cs (IsValidEnumType): Made static
3873
3874         * expression.cs (EnumLiftUp): Removed unused argument.
3875         (ResolveMethodGroup): Ditto.
3876         (BetterConversion): Ditto.
3877         (GetVarargsTypes): Ditto.
3878         (UpdateIndices): Ditto.
3879         (ValidateInitializers): Ditto.
3880         (MemberAccess.ctor): Ditto.
3881         (GetIndexersForType): Ditto.
3882
3883         * flowanalysis.cs: (MergeFinally): Removed unused argument.
3884
3885         * iterators.cs: Updated after MemberAccess clean up.
3886
3887         * location.cs: Uses Length for empty string test.
3888
3889         * namespace.cs: Uses Length for empty string test.
3890
3891          * report.cs (CheckWarningCode): Made static.
3892
3893         * statement.cs (LabeledStatement): Removed unused argument.
3894
3895         * typemanager.cs (FilterNone): Removed.
3896
3897 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3898
3899         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
3900         obsolete.
3901
3902         * class.cs: Updated.
3903
3904 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3905
3906         * cs-parser.jay.cs: __arglist is not allowed for delegates.
3907
3908 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3909
3910         A fix for #77822.
3911
3912         * expression.cs (VerifyArgumentsCompat): Reverted to double error
3913         reporting, it's more tricky than I thought.
3914
3915 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
3916
3917         A fix for #77816.
3918
3919         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
3920         host container.
3921         (AnonymousMethod.ImplicitStandardConversionExists): New method.
3922         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
3923         Add more error reporting; Fixed issue with params.
3924
3925         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
3926
3927         * cs-parser.jay: AnonymousMethod requires host container.
3928
3929         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
3930
3931 2006-03-18  Raja R Harinath  <harinath@gmail.com>
3932
3933         * class.cs: Change 'TypeContainer ds' constructor argument to
3934         'DeclSpace parent'.  Some classes were missed below due to
3935         different naming convention.
3936
3937         * class.cs (MemberCore.Parent): Delete.  This makes the
3938         ParentContainer changes below enforceable by the compiler.
3939
3940         Treat pointers to enclosing declaration space as 'DeclSpace', not
3941         'TypeContainer'.
3942         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
3943         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
3944
3945         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
3946         of TypeContainer.
3947         (Block.AddThisVariable): Likewise.
3948         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
3949         (AbstractPropertyEventMethod.Emit): Likewise.
3950         (AbstractPropertyEventMethod.EmitMethod): Likewise.
3951         (GetMethod.Define, SetMethod.Define): Likewise.
3952         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
3953         (DelegateMethod.EmitMethod): Likewise.
3954
3955         Fix regression test-partial-13.cs.
3956         Rationalize use of PartialContainer.  Ensure that the partial
3957         class semantics can be tied to type-correctness, i.e., any
3958         violation will cause a compile error.
3959         * class.cs, const.cs: Access all fields that belong to class
3960         TypeContainer via ParentContainer.  Arguments of EmitContexts and
3961         Resolve()-like functions still use 'Parent'.
3962
3963         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
3964         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
3965         (PropertyMethod.CheckModifiers): Remove unused argument.
3966         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
3967         DeclSpace.
3968
3969 2006-03-17  Raja R Harinath  <harinath@gmail.com>
3970
3971         Make semantics of PartialContainer simpler.
3972         * decl.cs (DeclSpace.IsPartial): Remove.
3973         * class.cs (TypeContainer.IsPartial): Likewise.
3974         (TypeContainer..ctor): Set PartialContainer to point to self.
3975         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
3976         (TypeContainer.FindNestedType): Likewise.
3977         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
3978
3979 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
3980
3981         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
3982
3983 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3984
3985         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
3986         classes.
3987
3988 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
3989
3990         * class.cs (Operator.Define): An error for base conversion was not
3991         reported correctly.
3992
3993 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
3994
3995         * iterator.cs : yield break is allowed in try statement which has
3996           catch clauses. Fixed bug #77767.
3997
3998 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
3999
4000         A fix for #77593, #77574.
4001
4002         * class.cs (MethodCore.CheckBase): Another if for operator.
4003
4004 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
4005
4006         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
4007         were not resolved
4008
4009         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
4010         (DelegateCreation.ImplicitStandardConversionExists): New method for just
4011         conversion test.
4012         
4013         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
4014         not needed.
4015
4016         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
4017         Updated after another emitcontext usage was clean up. It should help us to
4018         synchronize with gmcs easier.
4019
4020 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
4021
4022         A fix for #77353.
4023
4024         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
4025         (Event.Define): ditto
4026         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
4027
4028         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
4029         Removed redundant code and set NewSlot for Invoke method too.
4030
4031         * parameter.cs (Parameters.ctor): Add custom, type ctor.
4032         (Parameters.MergeGenerated): New method. Use this method when you merge
4033         compiler generated argument with user arguments.
4034
4035 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * attribute.cs (ResolveAsTypeTerminal): Removed.
4038
4039         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
4040         specialization for predefined types; 30% speed up.
4041         Finally placed obsolete check to right place.
4042         (Expression.ResolveType): Removed.
4043
4044         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
4045         Updated after ResolveType was removed.
4046
4047         * expression.cs (Cast.ctor): Check void cast.
4048         (Binary.ResolveAsTypeTerminal): Is never type.
4049         (Conditional.ResolveAsTypeTerminal): Is never type.
4050
4051         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
4052
4053 2006-03-01  Raja R Harinath  <rharinath@novell.com>
4054
4055         Fix #77679.
4056         * expression.cs (ParameterReference.DoResolveBase): Change return
4057         type to bool.
4058         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
4059         Update.
4060
4061         Fix #77628.
4062         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
4063
4064         Fix #77642.
4065         * typemanager.cs (GetFullNameSignature): Don't nullref on
4066         protected accessors.
4067
4068 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
4069
4070         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
4071         these two separated members to simplify the code.
4072         (Attribute.Resolve): Refactored to use new fields and methods.
4073         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
4074         implemented obsolete attribute checking.
4075         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
4076         implemented obsolete checking again. It look line never ending quest ;-)
4077         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
4078
4079         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
4080
4081         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
4082
4083         *class.cs (Property.Define): Add RegisterProperty call.
4084
4085         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
4086         argument groups (only 2).
4087
4088         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
4089         encoding expression to arguments.
4090         (Expression.ExprClassToResolveFlags): Just turned to property.
4091
4092         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
4093         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
4094         optimized as well as implemented support for zero-length attributes.
4095
4096         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
4097         Add caching of PropertyInfo's.
4098
4099 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4100
4101         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
4102         error multiple times.
4103
4104 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
4105
4106         New partial class implementation.
4107         A fix for #77027, #77029, #77403
4108
4109         * attribute.cs (Attributable): Made attributes protected.
4110
4111         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
4112         the replacements of ClassPart and PartialContainer.
4113         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
4114         (TypeContainer.AddInterface): Ditto.
4115         (TypeContainer.AddPartial): The main method for partial classes. It checks
4116         for errors and merges ModFlags and attributes. At the end class is added to
4117         partial_parts list.
4118         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
4119         required here.
4120         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
4121         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
4122         from the rest of partial classes.
4123         (TypeContainer.GetClassBases): Simplified.
4124         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
4125         DefineType.
4126         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
4127         (TypeContainer.HasExplicitLayout): Uses Flags now.
4128         (PartialContainer): Removed.
4129         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
4130         (StaticClass): Was merged with Class.
4131         (Class.GetClassBases): class and static class bases are verified here.
4132         (Class.TypeAttr): Added static attributes when class is static.
4133         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
4134         (MemberBase): In some cases we need to call parent container for partial
4135         class. It should be eliminated but it's not easy now.
4136
4137         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
4138
4139         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
4140         partial classed to accumulate class comments.
4141         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
4142
4143         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
4144
4145         * driver.cs (MainDriver): Tree.GetDecl was removed.
4146
4147         * modifiers.cs (Modifiers): Add partial modifier.
4148
4149         * tree.cs (Tree.decl): Removed.
4150         (RootTypes): Started to use this class more often for root types
4151         specializations.
4152
4153 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4154
4155         A fix for #77615
4156
4157         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
4158         external interface does not have an attribute.
4159
4160 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
4161
4162         Another prerequisites for new partial classs implementation.
4163         
4164         * attribute.cs (Attribute.Equal): Implemented.
4165         (Attribute.Emit): Changed as attributes can be applied more than twice.
4166         (Attributes.Emit): Check for duplicate attributes here.
4167
4168         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
4169         as a parameter, clean-up.
4170
4171 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4172
4173         A fix for #77485
4174
4175         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
4176         contains obsolete attribute check which can in some cases look for base
4177         type of current class which is not initialized yet.
4178         (TypeContainer.BaseType): Replacement of ptype.
4179
4180         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
4181
4182 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
4183
4184         First of prerequisites for new partial classs implemention.
4185         
4186         * attribute.cs (Attributable): Extended by ResolveContext;
4187         Attributes finally have correct context for resolving in all cases.
4188         (AttachTo): Attribute owner is assigned here.
4189
4190         * codegen.cs (IResolveContext): Introduce new interface to hold
4191         all information needed in resolving phase.
4192         (EmitContext): Implements IResolveContext; more clean-up needed here.
4193         
4194         * decl.cs (MemberCore): Implemented IResolveContext.
4195
4196         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
4197         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
4198         parameter.cs, statement.cs, tree.cs, typemanager.cs:
4199         Refactored to use new IResolveContext instead of EmitContext; cleanup
4200
4201 2006-02-06  Miguel de Icaza  <miguel@novell.com>
4202
4203         * codegen.cs (EmitScopeInitFromBlock): check here the
4204         capture_context, there is no need to make two calls to the
4205         EmitContext. 
4206
4207         * anonymous.cs: Add some debugging messages that might help me
4208         track other instances of this problem in the future (the
4209         regression of test 467).
4210
4211         * cs-parser.jay: track the variable block, as we need to initalize
4212         any captured variables declared in this block for the "catch"
4213         portion of the "Try" statement.
4214
4215         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
4216         scope initialization for captured variables. 
4217
4218         Also, move the emit for the variables after the block location has
4219         been marked.
4220
4221 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
4222
4223         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
4224
4225 2006-02-02  Miguel de Icaza  <miguel@novell.com>
4226
4227         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
4228         commit yesterday, the initialization for the roots is necessary.
4229         What is not necessary is the scope activation.
4230
4231 2006-02-02  Raja R Harinath  <rharinath@novell.com>
4232
4233         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
4234         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
4235         CS0206 checks.
4236         (Argument.Resolve): Remove CS0206 checks.
4237
4238 2006-02-01  Miguel de Icaza  <miguel@novell.com>
4239
4240         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
4241         scopes for all the roots, the scopes will now be emitted when the
4242         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
4243
4244         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
4245         code.  This reduces a lot of existing cruft.
4246         
4247         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
4248         that the ScopeInfo is generated as we enter the scope, not at the
4249         time of use, which is what we used to do before.
4250
4251         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
4252         every time a Block is about to be emitted if we have a
4253         CaptureContext. 
4254
4255 2006-02-01  Raja R Harinath  <rharinath@novell.com>
4256
4257         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
4258         (Reset): Update.
4259         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
4260
4261         * typemanager.cs (cons_param_array_attribute): Make private.
4262         (Reset): Set it to null.
4263         (InitCoreHelpers): Don't initialize it.
4264         (ConsParamArrayAttribute): New.  Initialize it as needed.
4265         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
4266
4267 2006-01-31  Miguel de Icaza  <miguel@novell.com>
4268
4269         * expression.cs: There might be errors reported during the
4270         selection of applicable methods.  If there are errors, do not
4271         continue execution as it will lead the compiler to crash.
4272
4273 2006-01-30  Miguel de Icaza  <miguel@novell.com>
4274
4275         * expression.cs: Member access is not allowed on anonymous
4276         methods.  Fixes #77402.
4277
4278 2006-01-30  Raja R Harinath  <rharinath@novell.com>
4279
4280         Fix #77401
4281         * cs-parser.jay (VariableDeclaration): Don't set
4282         current_array_type to null.
4283         (field_declaration, event_declaration, declaration_statement):
4284         Set it to null here.
4285
4286 2006-01-28  Raja R Harinath  <harinath@gmail.com>
4287
4288         * typemanager.cs (GenericParameterPosition): New.
4289         * doc.cs: Use it.
4290
4291 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
4292
4293         * doc.cs : To process "include" elements, first we should create
4294           another list than XmlNodeList, because it could result in node
4295           removal, which could result in that the XmlNodeList gives up
4296           yielding next node.
4297
4298           (Also made code identical to gmcs again.)
4299
4300 2006-01-25  Miguel de Icaza  <miguel@novell.com>
4301
4302         * ecore.cs: Introduce an error report that we were not catching
4303         before, if not silent, we must report the error.  Gonzalo ran into
4304         it.
4305
4306 2006-01-23  Miguel de Icaza  <miguel@novell.com>
4307
4308         A fix for bug: #76957
4309         
4310         * iterators.cs (MoveNextMethod.CreateMethodHost): call
4311         ComputeMethodHost before creating the method, this is a new
4312         requirement. 
4313
4314         * anonymous.cs (AnonymousContainer): Now we track all the scopes
4315         that this method references (RegisterScope).  The actual scope
4316         where the method is hosted is computed with the ComputeMethodHost
4317         before we create the method.
4318
4319         Moved the Deepest routine here.
4320
4321         (AnonymousContainer.ComputeMethodHost): New routine used to
4322         compute the proper ScopeInfo that will host the anonymous method.
4323
4324         (ScopeInfo): Deal with multiple roots.  The problem was that we
4325         did not have a unique root where all ScopeInfos could be hanged
4326         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
4327         of roots.  
4328
4329         Remove AdjustMethodScope which is now computed at the end.  Remove
4330         LinkScope which did a partial link, instead link all ScopeInfos
4331         before code generation from the new "LinkScopes" routine. 
4332
4333         Simplify all the Add* routines as they no longer need to maintain
4334         the tree, they just need to record that they are using variables
4335         from a ScopeInfo.
4336
4337         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
4338         routines to produce the forest of ScopeInfo trees.
4339
4340         * class.cs (TypeContainer.AppendMethod): This is just like
4341         AddMethod, but ensures that an interface implementation method
4342         (IEnumerable.XXX) is not inserted at the beginning of the queue of
4343         methods, but at the end.
4344
4345         We use this functionality to ensure that the generated MoveNext
4346         method in the iterator class is resolved/emitted before the
4347         enumerator methods created.   
4348
4349         This is required because the MoveNext method computes the right
4350         ScopeInfo for the method.  And the other methods will eventually
4351         need to resolve and fetch information computed from the anonymous
4352         method. 
4353
4354 2006-01-21  Raja R Harinath  <harinath@gmail.com>
4355             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
4356
4357         Fix rest of #76995.
4358         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
4359         the 'aliases' hash.
4360         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
4361         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
4362
4363 2006-01-18  Raja R Harinath  <rharinath@novell.com>
4364
4365         Fix #76656, cs0231-2.cs.
4366         * cs-parser.jay (formal_parameter_list): Make error case catch
4367         more issues.
4368         (parenthesized_expression_0): Add CS1026 check.
4369         (invocation_expression): Remove unused { $$ = lexer.Location }.
4370
4371 2006-01-17  Raja R Harinath  <rharinath@novell.com>
4372
4373         Fix #76824.
4374         * cs-parser.jay (statement_expression): Don't list out the
4375         individual statement-expressions.  Convert syntax error into
4376         CS0201 check.
4377
4378 2006-01-16  Raja R Harinath  <rharinath@novell.com>
4379
4380         Fix #76874.
4381         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
4382         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
4383         CheckIntermediateModification.
4384         (FieldExpr.DoResolve): Add new two-argument version that
4385         allows us to resolve the InstanceExpression as an lvalue.
4386         The one-argument variant is now just a wrapper.
4387         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
4388         Resolve the lhs as an lvalue if the it has a value type.
4389         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
4390         from Assign.DoResolve.
4391         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
4392         resolved as an lvalue.
4393         (PropertyExpr.DoResolve): Update.
4394         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
4395         has a value type.  Move CS1612 check here from
4396         CheckIntermediateModification.
4397         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
4398         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
4399         'right_side' of a ResolveLValue on an 'out' argument.
4400         (EmptyExpression.LValueMemberAccess): New.  Used as the
4401         'right_side' of a propagated ResolveLValue on a value type.
4402         (LocalVariableReference.DoResolveBase): Recognize
4403         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
4404         Add CS1654 check.
4405         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
4406         EmptyExpression.Null.
4407
4408 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
4409
4410         * typemanager.cs : added IsGenericParameter(). In mcs it always
4411           return false.
4412         * doc.cs : for generic parameters, use GenericParameterPosition,
4413           not FullName.
4414
4415 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
4416
4417         * expression.cs: Fix Console.WriteLine ((this = x).foo);
4418
4419 2006-01-12  Miguel de Icaza  <miguel@novell.com>
4420
4421         This fixes the problem where we used ldfld instead of ldflda to
4422         load the "THIS" pointer on captured parameters, when THIS is a
4423         value type.  See bug #77205.
4424         
4425         * iterators.cs (CapturedThisReference.Emit): Pass false to
4426         EmitThis (we do not need the address).
4427
4428         * codegen.cs (EmitThis): it needs to know whether we need the
4429         address of `this' or not.  This is used by value types.  
4430
4431         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
4432         every other call passes false.
4433
4434 2006-01-12  Raja R Harinath  <rharinath@novell.com>
4435
4436         Fix #77221.
4437         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
4438         GetOverride.
4439         * expression.cs (Invocation.OverloadResolve): Update.
4440         (Invocation.DoResolve): Avoid double resolution of invocation.
4441
4442 2006-01-11  Raja R Harinath  <rharinath@novell.com>
4443
4444         Fix #77180.
4445         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
4446         unary negation of floating point types as 0-expr; negation cannot
4447         overflow in floating point types.
4448
4449         Fix #77204.
4450         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
4451         on operands of 'void' type.
4452
4453         Fix #77200.
4454         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
4455         and ExclusiveOr for boolean constants too.
4456
4457 2006-01-09  Raja R Harinath  <rharinath@novell.com>
4458
4459         Fix #75636.
4460         * expression.cs (Invocation.OverloadResolve): Replace reflected
4461         override methods with their base virtual methods, rather than
4462         skipping over them.
4463         * typemanager.cs (TypeManager.GetOverride): New.
4464
4465 2006-01-05  Jb Evain  <jbevain@gmail.com>
4466
4467         * class.cs (Property.Define, Indexer.Define): do not tag the
4468         properties as SpecialName | RTSpecialName.
4469
4470 2006-01-04  Miguel de Icaza  <miguel@novell.com>
4471
4472         * class.cs (MethodCore.IsDuplicateImplementation): This method was
4473         doing a low-level comparission of parameter types.  It was lacking
4474         a check for __argslist. 
4475
4476 2005-12-30  Miguel de Icaza  <miguel@novell.com>
4477
4478         * expression.cs (ParameterReference.DoResolveBase): Allow
4479         reference parameters if they are local to this block. 
4480
4481         This allows the ref and out parameters of a delegate to be used in
4482         an anonymous method, for example:
4483
4484         delegate void set (out int x);
4485
4486         set s = delegate (out int x){
4487                 x = 0;
4488         };
4489
4490         This is used by functionality introduced late in the C# language.
4491         
4492         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
4493         method that take ref and out parameters. 
4494
4495         Fixes #77119 which was a late change in the spec.
4496
4497 2005-12-23  Miguel de Icaza  <miguel@novell.com>
4498
4499         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
4500         parent if its the same scope.  Fixes #77060.
4501
4502 2005-12-21  Miguel de Icaza  <miguel@novell.com>
4503
4504         * driver.cs: Report the case of no source files and no -out:
4505         argument provided.
4506
4507 2005-12-20  Raja R Harinath  <rharinath@novell.com>
4508
4509         Fix #77035.
4510         * expression.cs (ComposedCast.GetSignatureForError): Define.
4511
4512 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
4513
4514         Fix #76995
4515
4516         * namespace.cs (NamespaceEntry): Add extern_aliases as a
4517         ListDictionary, to contain the ExternAliasEntry entries (in
4518         addition to the NamespaceEntry.aliases hashtable). This field is
4519         shared between the original entry and its doppelganger (bodyless 
4520         copy of it).
4521         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
4522         extern_aliases field.
4523         (NamespaceEntry.Lookup): Move the IsImplicit check after the
4524         lookup in extern_aliases.
4525
4526 2005-12-16  Raja R Harinath  <rharinath@novell.com>
4527
4528         Fix #77006.
4529         * class.cs (TypeContainer.Mark_HasEquals): New.
4530         (TypeContainer.Mark_HasGetHashCode): New.
4531         (ClassPart): Override them.
4532         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
4533
4534         Fix #77008.
4535         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
4536         'parent' argument to the base constructor.
4537
4538         Remove all mention of TypeContainer from decl.cs.
4539         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
4540         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
4541         (DeclSpace.DeclSpace): Likewise.
4542         (DeclSpace.DefineMembers): Remove unused argument.
4543         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
4544         debugging check -- we don't care if the debug code throws an
4545         InvalidCastException instead of an InternalErrorException.
4546         * class.cs (TypeContainer.DefineMembers): Update to changes.
4547         (TypeContainer.DoDefineMembers): Likewise.
4548         (TypeContainer.GetMethods): Likewise.
4549         (PropertyMember.Define): Likewise.
4550         (MemberBase.Parent): New property that forwards to
4551         MemberCore.Parent, but ensures that we get a TypeContainer.
4552         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
4553         (RootContext.PopulateTypes): Likewise.  Remove special case code
4554         for !RootContext.StdLib: DefineMembers is idempotent.
4555
4556 2005-12-14  Miguel de Icaza  <miguel@novell.com>
4557
4558         * convert.cs (ExplicitConversionCore): Check the return value from
4559         ExplicitConversionCore which can return null on failure.  Fixes #76914
4560
4561 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
4562
4563         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
4564
4565 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
4566
4567         * doc.cs : The search for referenced namespace was insufficient to
4568           get global one as it used to do. Fixed bug #76965.
4569
4570 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
4571
4572         * doc.cs : check name in cref in the last phase that whether it is
4573           namespace or not.
4574
4575 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4576
4577         * cs-tokenizer.cs : reverted the latest change: it somehow broke
4578           Mono.C5.
4579
4580 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4581
4582         * doc.cs : so it turned out that we cannot skip override check for 
4583           interface members. Fixed bug #76954.
4584
4585 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
4586
4587         * cs-tokenizer.cs : fixed bug #75984:
4588           - #warning and #error should not be handled when the source line
4589             is disabled.
4590           - #line is not checked strictly when the source line is disabled.
4591           - #define and #undef is on the other hand checked strictly at any
4592             state.
4593
4594 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
4595
4596         * cs-tokenizer.cs : missing Location (actually, filename) in one of
4597           CS1027 report.
4598
4599 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4600
4601         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
4602
4603         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
4604         event initializers.
4605         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
4606         (FieldBase.Initializer): Initializer is now optional.
4607         (EventField.Define): Only event field can have initializer.
4608
4609         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
4610
4611         * const.cs (Const): Reuse initializer.
4612
4613         * cs-parser.jay: Updated after FieldBase changes.
4614         Added current_array_type to simplify array initializers.
4615
4616         * ecore.cs (NullCast.IsDefaultValue): Implemented.
4617
4618         * expression.cs, iterators.cs: Updated.
4619
4620         * namespace.cs (NamespaceEntry): Made UsingFound private.
4621
4622 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4623
4624         * parameterCollection.cs: Obsolete, removed.
4625         * parser.cs: Obsolete, removed.
4626
4627 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
4628
4629         Fix #76849.
4630         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
4631
4632         * enum.cs (Enum.Define): Set obsolete context here.
4633
4634 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4635
4636         * doc.cs :
4637           - FindDocumentedMember() now expects 1) paramList as null
4638             when "we don't have to check the number of parameters" and
4639             2) Type.EmptyTypes when "there is no arguments".
4640           - Introduced FoundMember struct to hold the exact type which was
4641             used to find the documented member (the above change broke
4642             test-xml-044; it might be better just to use DeclaringType than
4643             what MS does, like this change does, but it depends on usage.)
4644
4645 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
4646
4647         * doc.cs : documented member might be from DeclaringType for nested
4648           types. Fixed bug #76782.
4649
4650 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
4651
4652         * anonymous.cs: Have the param code handle leaving copies on the
4653         stack etc. Allows anonymous params to take part in the assignment
4654         code (++, +=, etc). Fixes bug #76550
4655
4656         * expression.cs: Handle the prepare_for_load/leave_copy by passing
4657         it down to the anon code.
4658
4659         * iterators.cs: Use dummy var here
4660
4661         * codegen.cs: Handle new vars
4662
4663 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4664
4665         Fix #76849.
4666         * class.cs (MethodData.Define): Set proper Obsolete context.
4667
4668         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
4669         obsolete context.
4670         (FieldExpr.DoResolve): Ditto.
4671
4672 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
4673
4674         Fix #76849.
4675         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
4676         parent is not obsolete.
4677
4678 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
4679
4680         * doc.cs : (FindDocumentedMember) find parameterless members first
4681           and get CS0419 in the early stage. Fixed first case of bug #76727.
4682
4683 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
4684
4685         Fix #76859.
4686         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
4687         no error was reported.
4688
4689         *expression.cs (Binary.DoResolve): left can be null.
4690
4691 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
4692
4693         Fix #76783.
4694         * class.cs (MethodData.Emit): Parameters should be labeled first.
4695
4696 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
4697
4698         Fix #76761.
4699         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
4700
4701 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
4702
4703         * attribute.cs (AreParametersCompliant): Moved to Parameter.
4704
4705         * class.cs (MethodCore): Parameter clean up.
4706         (IMethodData): Added ParameterInfo.
4707         (MethodData): Parameter clean up.
4708         (Indexer.Define): Parameter clean up.
4709
4710         * anonymous.cs,
4711         * codegen.cs,
4712         * cs-parser.jay,
4713         * decl.cs,
4714         * doc.cs,
4715         * ecore.cs,
4716         * flowanalysis.cs,
4717         * iterators.cs,
4718         * pending.cs,
4719         * statement.cs,
4720         * typemanager.cs: Parameter clean up.
4721
4722         * delegate.cs (Define): Get rid of duplicated code.
4723
4724         * expression.cs (ParameterReference): Removed useless parameters
4725         and simplified.
4726         (Invocation): Ditto.
4727
4728         * parameter.cs (ParamsParameter): New class, params specialization.
4729         (ArglistParameter): Attemp to separate arglist.
4730         (Parameter): Refactored to be reusable and faster.
4731         (Parameter.Modifier): Made understandable.
4732         (Parameters): Changed to be used as a class for `this' assembly
4733         parameters. Refactored to use new specialized classes.
4734
4735         * support.cs (ParameterData): Added Types property.
4736         (InternalParameters): Deleted.
4737
4738 2005-08-20  Martin Baulig  <martin@ximian.com>
4739
4740         Merging this patch from GMCS to fix #75867.
4741
4742         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
4743         scope if we don't already have it.
4744
4745 2005-11-17  Martin Baulig  <martin@ximian.com>
4746
4747         * anonymous.cs
4748         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
4749         inherit the scope from our parent.  Fixes #76653.
4750
4751 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4752
4753         * doc.cs : the previous patch does not actually fix the bug.
4754           PropertyInfo override check is now implemented and really fixed it.
4755         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
4756
4757 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4758
4759         * doc.cs : apply "override filter" also to properties.
4760           Fixed bug #76730.
4761
4762 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
4763
4764         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
4765           no need to check overrides. For classes, omit those results from 
4766           interfaces since they must exist in the class. Fixed bug #76726.
4767
4768 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4769
4770         * typemanager.cs : (GetFullNameSignature) differentiate indexers
4771           with different parameters. Fixed the second problem in #76685.
4772
4773 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4774
4775         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
4776           get expected 'protected' access in CheckValidFamilyAccess()).
4777           Fixed bug #76692.
4778
4779 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
4780
4781         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
4782           Fixed bug #76705.  CS1569 was incorrectly commented out.
4783
4784 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4785
4786         * doc.cs : use Invocation.IsOverride() to do real override check.
4787         * expression.cs : made Invocation.IsOverride() internal.
4788
4789 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
4790
4791         * doc.cs : use TypeManager.FindMembers() instead of (possible)
4792           TypeBuilder.FindMembers() and filter overriden base members out.
4793           Fixed bug #76990.
4794
4795 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4796
4797         * doc.cs : ref/out parameters are represented as '@' (instead of
4798           '&' in type FullName). Fixed bug #76630 (additionally crefs).
4799
4800 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4801
4802         * doc.cs : when there was no '.' in cref to methods in doc comment,
4803           then parameters were missing in the output. Fixed bug #76691.
4804
4805 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4806
4807         * driver.cs : don't output docs when there is an error.
4808           Fixed bug #76693.
4809
4810 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4811
4812         * doc.cs :
4813           Now it should detect indexers. Fixed primary concern in bug #76685.
4814           Fixed CS0419 message to not show the identical member signature in
4815           the message.
4816
4817 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
4818
4819         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
4820           instead of Type.FindMembers() since it does not handle events.
4821           Fixed bug #71604.
4822
4823 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
4824
4825         * codegen.cs: Fixed typo (speficied -> specified).
4826
4827 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4828
4829         Fix #76369.
4830         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
4831
4832 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
4833
4834         * attribute.cs: Changed error message.
4835
4836         * cs-tokenizer.cs: One more check.
4837
4838 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4839
4840         * statement.cs (Block.Resolve): Ignore empty statement.
4841
4842 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
4843
4844         * report.cs: Made error/warning methods more strict to avoid
4845         their misuse.
4846
4847         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
4848         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
4849         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
4850         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
4851
4852 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
4853
4854         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
4855         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
4856
4857         * class.cs (TypeContainer.IsComImport): New property.
4858         (Constructor.Define): Create proper ctor for ComImport types.
4859
4860         * expression.cs (New.CheckComImport): Fixed.
4861
4862 2005-11-07  Miguel de Icaza  <miguel@novell.com>
4863
4864         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
4865         that a parameter has been captured does not mean that we do not
4866         have to do the rest of the processing.  This fixes the second part
4867         of #76592.  If there was another anonymous method capturing
4868         values in the past, the Scope would never be set for the second
4869         method that captured the same parameter.
4870
4871         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
4872         properly manipulate the stack.   Second part of fix for #76592.
4873
4874         * expression.cs (New): Add support for invoking "new" on
4875         interfaces that have been flagged with the ComImport attribute and
4876         the CoClass.  Fixes #76637 
4877
4878         * statement.cs (Try.DoEmit): When a variable is captured, do not
4879         try to emit the vi.LocalBuilder variable as it has been captured.
4880         Create a temporary variable and store the results on the
4881         FieldBuilder.  Fixes #76642
4882
4883 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
4884
4885         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
4886
4887         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
4888
4889         * expression.cs (Binary.DoResolve): Added && optimalization.
4890     
4891         * typemanager.cs (AddUserType): Removed useless argument.
4892
4893 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
4894
4895         * statement.cs (Block.variables): Uses ListDictionary.
4896
4897 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4898
4899         Fix #75969.
4900         * class.cs (PartialContainer.EmitType): Customized to emit
4901         security attributes.
4902         (ClassPart.ApplyAttributeBuilder): Transform security attribute
4903         for partial classes.
4904
4905 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
4906
4907         Fix #76599.
4908         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
4909         access has to be fixed.
4910         
4911         * typemanager.cs (IsUnmanagedType): Wrong common field type.
4912
4913 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
4914
4915         Fix #76590.
4916         * ecore.cs (NullCast.Reduce): Implemented.
4917
4918         * expression.cs (ArrayCreation.CheckIndices): Correcly check
4919         constant type.
4920         
4921         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
4922         properly.
4923         (Foreach.Resolve): Catch null properly.
4924
4925 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4926  
4927         * cs-tokenizer.cs: Warning text fix.
4928
4929         * driver.cs: AllWarningNumbers exposed on public interface.
4930
4931         * report.cs (): Reviewed warning numbers.
4932         (IsValidWarning): Use binary search.
4933
4934 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
4935  
4936         * driver.cs: Implemeted resource visibility.
4937         (Resources): New class for code sharing between /res: and
4938         /linkres:
4939  
4940 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
4941
4942         Fix #76568.
4943         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
4944         folding.
4945         
4946         * convert (Convert.ImplicitReferenceConversion): NullCast holds
4947         contants only.
4948         
4949         * ecore.cs (NullCast): Child is contant only.
4950         
4951         * literal.cs (NullLiteral.Reduce): null can be converted to any
4952         reference type.
4953
4954 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
4955
4956         * driver.cs: Use Encoding.Default as default code page instead
4957           of ISO-28591.
4958
4959 2005-10-27  Raja R Harinath  <rharinath@novell.com>
4960
4961         Fix #76085.
4962         * expression.cs (Invocation.Error_InvalidArguments): Handle
4963         __arglist parameters.
4964         (Invocation.VerifyArgumentsCompat): Likewise.
4965         * support.cs (ReflectionParameters.GetSignatureForError): Print
4966         __arglist parameters.
4967         (InternalParamters.GetSignatureForError): Likewise.
4968         * parameter.cs (Parameters.GetSignatureForError): Likewise.
4969
4970 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
4971
4972         * attribute.cs (GetPropertyValue): Made public.
4973
4974         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
4975         Resolve.
4976         Add new property WrapNonExceptionThrows to handle 2.0 assembly
4977         attribute.
4978         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
4979         is not defined.
4980         
4981         * driver.cs: Reflect method name change.
4982         
4983         * statement.cs (Try.Resolve): Warn when try has both general
4984         exception handlers.
4985         
4986         * typemanager.cs: runtime_compatibility_attr_type new predefined
4987         type.
4988
4989 2005-10-26  Raja R Harinath  <harinath@gmail.com>
4990
4991         Fix #76419.
4992         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
4993         treat it as an empty parameter list.
4994
4995 2005-10-26  Raja R Harinath  <rharinath@novell.com>
4996
4997         Fix #76271.     
4998         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
4999         ResolveAsTypeStep silent.
5000         * statement.cs (Block.AddConstant): Mark block as used.
5001         (Block.ResolveMeta): Avoid piling on error messages
5002         if a constant initializer resolution fails.
5003
5004 2005-10-25  Raja R Harinath  <rharinath@novell.com>
5005
5006         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
5007         Remove.
5008         (NamespaceEntry.VerifyAllUsing): New.
5009         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
5010         behaviour.  Delegates actual resolution of alias to ...
5011         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
5012         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
5013         Update.
5014         * driver.cs (Driver.MainDriver): Update.
5015         
5016         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
5017         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
5018         property.
5019         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
5020         Remove.
5021         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
5022         RootNamespace.DefineNamespacesForAll.
5023
5024 2005-10-24  Raja R Harinath  <harinath@gmail.com>
5025
5026         * typemanager.cs (assemblies, external_aliases, modules)
5027         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
5028         (ComputeNamespaces, GetRootNamespace): Remove extra staging
5029         overhead.  Move resposibility ...
5030         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
5031         * driver.cs, attribute.cs, codegen.cs: Update to changes.
5032
5033 2005-10-23  Raja R Harinath  <harinath@gmail.com>
5034
5035         * namespace.cs (RootNamespace.all_namespaces): Renamed from
5036         cached_namespaces.  Improve usage.
5037         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
5038         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
5039         Move from GlobalRootNamespace and simplify.
5040         (RootNamespace.Global): Make instance variable.
5041         (RootNamespace.RootNamespace): Add "alias name" parameter.
5042         (GlobalRootNamespace): Simplify drastically.
5043         (Namespace.Lookup): Don't use GetNamespace.
5044         * typemanager.cs (GetRootNamespace): Rename from
5045         ComputeNamespaceForAlias.
5046         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
5047
5048 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5049
5050         * anonymous.cs (AnonymousContainer): Don't crash when container
5051         doesn't exist.
5052
5053 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5054
5055         * expression.cs (Binary.DoResolve): Warn when comparing same
5056         values.
5057
5058 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
5059
5060         Fix #76486.
5061         * expression.cs (Binary.DoResolve): It looks like there are no
5062         convetsion rules in enum context.
5063
5064 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5065
5066         Add support for extern alias qualifiers.
5067         * typemanager.cs: Move some LookupTypeReflection code
5068         to namespace.cs, to have cleaner code. Added some methods
5069         to help us keep track of the extern aliased references.
5070         * driver.cs: Add suport for extern alias assemblies on command
5071         line and check for their warnings/errors. Also keep track of the
5072         extern aliased assemblies.
5073         * namespace.cs: Move the global functionality of Namespace
5074         to GlobalRootNamespace/RootNamespace. Now the global namespace
5075         is GlobalRootNamespace.Globa. Also the code moved from 
5076         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
5077         Finally added LocalAliasEntry (AliasEntry before) and
5078         ExternAliasEntry, to handle alias statements.
5079         * cs-parser.jay: Add support in the grammar for extern alias
5080         statement.
5081         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
5082         Update callings to Namespace (now in GlobalRootNamespace).
5083
5084 2005-10-18  Raja R Harinath  <rharinath@novell.com>
5085
5086         Fix #76371.
5087         * class.cs (TypeContainer.DefineType): Move updating of
5088         topological sort earlier in the code.
5089         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
5090
5091 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
5092
5093         Fix #76273.
5094         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
5095         
5096         * constant.cs (Constant.TryReduce): Moved from Cast class.
5097         (Reduce): Made little bit more OO and fixed missing conversions.
5098         
5099         * ecore.cs (Reduce): Implemented.
5100         (Binary.EnumLiftUp): New method to upgrade values to enum values.
5101         
5102         * literal.cs (Reduce): Implemented.
5103         
5104         * class.cs: Reverted Miguel's wrong commit.
5105
5106 2005-10-14  Miguel de Icaza  <miguel@novell.com>
5107
5108         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
5109
5110 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
5111
5112         * cs-parser.jay, expression.cs : CS0214 was missing error location
5113           for constants. Fixed bug #76404.
5114
5115 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
5116
5117         Fix #76370.
5118         * convert.cs (ExplicitConversionCore): Fixed object->enum
5119         conversion.
5120
5121 2005-10-10  Raja R Harinath  <rharinath@novell.com>
5122
5123         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
5124         InstanceExpression.
5125         (PropertyExpr.EmitCall): Likewise.
5126         * expression.cs (Invocation.EmitArguments): Handle case where
5127         arguments == null.
5128         (Invocation.EmitCall): Avoid allocating temporary variable if
5129         there are no arguments.
5130
5131 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5132
5133         Fix #76323.
5134         * convert.cs (ImplicitConversionStandard): Move conversion of
5135         void* to arbitrary pointer types ...
5136         (ExplicitConversionStandard): .. here.
5137         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
5138         error to always print typenames.
5139
5140 2005-10-07  Raja R Harinath  <rharinath@novell.com>
5141
5142         * convert.cs (GetConversionOperator): Rename from
5143         GetConversionOperators.  Move operator selection code from ...
5144         (UserDefinedConversion): ... here.
5145
5146 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
5147
5148         * convert.cs (ExplicitConversionCore): Removed duplicate enum
5149         conversion.
5150
5151 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
5152
5153         * assign.cs (Assign.DoResolve): Error method changed.
5154
5155         * cfold.cs (DoConstantNumericPromotions): Error method changed.
5156         
5157         * const.cs (ResolveValue): Reset in_transit immediately.
5158         
5159         * constant.cs: Error method changed.
5160         
5161         * convert.cs: Removed useless location parameter.
5162         (ExplicitNumericConversion): Don't do double enum check.
5163         (ExplicitConversionCore): Renamed from ExplicitConversion.
5164         (ExplicitUnsafe): Extracted from ExplicitConversion.
5165         (ExplicitConversion): Uses for error reporting.
5166         
5167         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
5168         error messages.
5169         (ResolveBoolean): Uses common error method.
5170         (CastToDecimal): Get rid of ec.
5171         (CastFromDecimal): Optimized.
5172         (ConvCast): Get rid of ec.
5173         
5174         * enum.cs (ResolveValue): Reset in_transit immediately.
5175         (Emit): Return after first error.
5176         
5177         * expression.cs: Convert changes.
5178         
5179         * literal.cs: Error method changed.
5180         
5181         * statement.cs: Error method changed.
5182
5183 2005-10-03  Raja R Harinath  <rharinath@novell.com>
5184
5185         * support.cs (SeekableStreamReader.Position): Don't error out when
5186         the requested position is just beyond the end of the current
5187         buffered data.
5188
5189 2005-09-28  Raja R Harinath  <rharinath@novell.com>
5190
5191         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
5192         try to keep in sync with the byte count of the underlying Stream.
5193         However, this limits us to a window size of 2048 characters: i.e.,
5194         the maximum lookahead of our lexer/parser can be 2048 characters.
5195
5196 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
5197
5198         Fix #76255.
5199         * driver.cs: Fix compilation files with full root path.
5200
5201 2005-09-25  Miguel de Icaza  <miguel@novell.com>
5202
5203         * report.cs (SymbolRelatedToPreviousError): Format the output so
5204         it does not use an open parenthesis that is never closed. 
5205
5206         * driver.cs: Follow coding guidelines
5207
5208 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5209
5210         Fix #72930.
5211         * const.cs (Const.ResolveValue): Check for assigning non-null
5212         value to reference type.
5213
5214 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
5215
5216         * anonymous.cs: Implemented ExprClassName.
5217         
5218         * assign.cs (Assign.DoResolve): Don't chrash when type is not
5219         delegate.
5220         
5221         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
5222         check.
5223         
5224         * class.cs (StaticClass.DefineContainerMembers): Report protected
5225         members as error.
5226         
5227         * codegen.cs: if(ed) PRODUCTION.
5228         
5229         * convert.cs (Error_CannotImplicitConversion): Better error
5230         distinction.
5231         
5232         * cs-parser.jay: More error checks.
5233         
5234         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
5235         
5236         * driver.cs (CSCParseOption): Enabled wrong option check.
5237         
5238         * ecore.cs (Expression.ExprClassName): Turned to property.
5239         (MemberExpr.CheckIntermediateModification): For checking boxed
5240         value types     modification.
5241         
5242         * statement.cs (Fixed.Resolve): Expression type must be
5243         convertible to fixed type.
5244         (CollectionForeach.GetEnumeratorFilter,TryType):
5245         Small refactoring for easier error checking.
5246
5247 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
5248
5249         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
5250         attributes.
5251         
5252         * class.cs (GeneratedBaseInitializer): New class for customization
5253         compiler generated initializers.
5254         (MemberBase.DoDefine): Check Obsolete attribute here.
5255         (FieldMember.DoDefine): Ditto.
5256         
5257         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
5258         constants.
5259         
5260         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
5261         (MemberCore.GetObsoleteAttribute): Removed argument.
5262         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
5263         (MemberCore.CheckObsoleteType): New helper.
5264         
5265         * delegate.cs,
5266         * enum.cs,
5267         * statement.cs: Updates after MemberCore changes.
5268         
5269         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
5270         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
5271         
5272         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
5273         obsolete attribute for compiler construct.
5274         (As.DoResolve): Cache result.
5275         
5276         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
5277
5278 2005-09-26  Raja R Harinath  <rharinath@novell.com>
5279
5280         Fix #76133.
5281         * expression.cs (This.VerifyFixed): In a value type T, the type of
5282         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
5283         value type R, 'this' is treated as a value parameter.
5284
5285 2005-09-22  Miguel de Icaza  <miguel@novell.com>
5286
5287         * statement.cs (Lock): Use the TemporaryVariable class instead of
5288         manually using local variables as those do not work when variables
5289         are captured.
5290
5291         * ecore.cs: Moved the TemporaryVariable class from being a nested
5292         class inside Foreach to be a public class that can be employed in
5293         other places. 
5294
5295 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
5296
5297         * cs-parser.jay: interface_accessors replaced by
5298         accessor_declarations.
5299
5300         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
5301         location.
5302         
5303         * statement.cs (GotoCase.Resolve): Convert null constant to
5304         null case.
5305         (SwitchLabel.ResolveAndReduce): Ditto.
5306         (SwitchLabel.NullStringCase): Custom null stamp.
5307         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
5308         
5309         typemanager.cs (CSharpSignature): Don't skip first argument
5310         for full names.
5311
5312 2005-09-18  Miguel de Icaza  <miguel@novell.com>
5313
5314         * driver.cs: Set InEmacs based on the environment variable EMACS. 
5315
5316         * location.cs (InEmacs): in this mode, do not report column
5317         location as it confuses Emacs.
5318
5319 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
5320
5321         * cfold.cs, constant.cs, convert.cs, ecore.cs,
5322         expression.cs, iterators.cs, literal.cs: Store constants and
5323         literals location.
5324         
5325         * class.cs (MemberBase.ShortName): Pass location.
5326         
5327         * cs-parser.jay: Some location fixes.
5328         
5329         * ecore.cs (Expression.Location): Made virtual.
5330
5331 2005-09-05  Miguel de Icaza  <miguel@novell.com>
5332
5333         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
5334         if the underlying types are the same, otherwise we need to produce
5335         code that will do the proper cast.
5336
5337         This was exposed by Marek's constant rewrite which produced
5338         invalid code for the call site:
5339
5340         enum X : long { a }
5341         void Method (X v) {}
5342
5343         Method ((X) 5)
5344
5345         This fixes test-49.cs
5346
5347 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5348
5349         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
5350           Type/Object should be allowed as well. Fixed bug #75968.
5351
5352 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
5353
5354         * expression.cs : (Binary.DoResolve): when one is enum constant and
5355           another is constant 0, then return enum one *as enum type*.
5356           Fixed bug 74846.
5357
5358 2005-09-02  Raja R Harinath  <rharinath@novell.com>
5359
5360         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
5361         internal.
5362
5363         Fix #75941.
5364         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
5365         flow-branching for LocalVariableReferences in case we were invoked
5366         from a MemberAccess.
5367         * expression.cs (LocalVariableReference.VerifyAssigned): New.
5368         Carved out of ...
5369         (LocalVariableReference.DoResolveBase): ... this.
5370         (MemberAccess.Resolve): Do the check that was disabled during
5371         SimpleNameResolve.
5372
5373 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5374
5375         * class.cs :
5376           (PartialContainer.Create): check abstract/sealed/static strictly
5377           but abstract/sealed can exist only at one side. Fixed bug #75883.
5378
5379 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
5380
5381         Fix #75945.
5382         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
5383         specified, don't default to UnmanagedType.I4.
5384
5385 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
5386
5387         * expression.cs : conditional operator should check possibly
5388           incorrect assign expression. Fixed bug #75946.
5389
5390 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5391
5392         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
5393           Reverting the change. gmcs is much complex than mcs on this matter.
5394
5395 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
5396
5397         * cs-tokenizer.cs : To read another token ahead of the actual 
5398           consumption, use new SavedToken and cache token instead of moving
5399           back the stream with SeekableStreamReader (it seemed problematic).
5400         * cs-parser.jay,
5401           driver.cs : Thus use StreamReader directly.
5402         * support.cs : Thus removed SeekableStreamReader.
5403
5404 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5405
5406         Fix #75934.
5407         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
5408         (ScopeInfo.EmitScopeType): Use it to construct field names from
5409         names of captured locals.
5410
5411         Fix #75929.
5412         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
5413         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
5414         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
5415         (ExplicitConversion): Remove enum cases already handled by
5416         implicit conversion.  Move implicit conversion check to the beginning.
5417         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
5418         * expression.cs (ArrayCreation.EmitDynamicInitializers):
5419         Don't treat System.Enum as a struct.
5420
5421 2005-08-30  Jb Evain  <jbevain@gmail.com>
5422
5423         * attribute.cs: handles as expression in parameters.
5424
5425 2005-08-30  Raja R Harinath  <rharinath@novell.com>
5426
5427         Fix #75802.
5428         * class.cs (TypeContainer.VerifyClsName): Don't use a
5429         PartialContainer when verifying CLS compliance.
5430         (AbstractPropertyEventMethod): Set Parent here, ...
5431         (PropertyMethod): ... not here.
5432
5433 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
5434
5435         * attribute.cs : escaped attribute name should not be allowed to be
5436           resolved (e.g. @class as classAttribute). Fixed bug #75930.
5437
5438 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5439
5440         Fix #75927.
5441         * convert.cs (ImplicitStandardConversionExists): Allow zero also
5442         when converting a long constant to unsigned long.
5443         * expression.cs (Invocation.OverloadResolve): Add sanity check to
5444         detect where IsApplicable and VerifyArgumentsCompat disagree.
5445
5446 2005-08-29  Raja R Harinath  <rharinath@novell.com>
5447         and Carlos Alberto Cortez  <carlos@unixmexico.org>
5448
5449         Fix #75848.
5450         * class.cs (TypeContainer.CanElideInitializer): New helper.
5451         (TypeContainer.EmitFieldInitializers): Use it to determine if we
5452         can safely emitting the initializer of a field.
5453
5454 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5455
5456         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
5457           allowed inside a switch (without loop). Fixed bug #75433.
5458
5459 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
5460
5461         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
5462         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
5463
5464 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5465
5466         * driver.cs : kinda reverting the default encoding changes (not exact 
5467           revert since I noticed that "codepage:reset" might not work fine).
5468
5469 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5470
5471         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
5472           Location. Now getter and setter store location correctly.
5473           (errors/cs0111-12.cs now reports the expected location.)
5474
5475 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
5476
5477         * driver.cs : Use default encoding on the environment.
5478           Removed (now that) extra parameter for SeekableStreamReader.
5479         * support.cs : (SeekableStreamReader) third .ctor() argument for
5480           StreamReader is not required (always true). preamble size could
5481           be acquired in simpler and safe way.
5482
5483 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
5484
5485         * cs-parser.jay: report CS0642 at warning level 3
5486           and report CS0642 for an if else statement also
5487           fixes bug #74745. Patch by John Luke (and a bit
5488           modified by me).
5489           Removed extra CS0642 warning check for "while",
5490           "for" and "fixed".
5491         * statement.cs: In Block.Resolve(), CS0642 check
5492           is reimplemented to check a sequence of an empty
5493           statement and a block.
5494
5495           Both fix bug #66777.
5496
5497 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
5498
5499         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
5500         detection until I fix it.
5501         
5502         * cs-tokenizer.cs: Changed error message.
5503         
5504         * cs-parser.jay: Fixed 2 error locations.
5505         
5506         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
5507         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
5508         properties.
5509         
5510         * enum.cs (GetSignatureForError): Fixed.
5511         
5512         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
5513         method detection.
5514         
5515         * class.cs,
5516         * typemanager.cs (RegisterProperty): Removed.
5517         
5518         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
5519
5520 2005-08-24  Raja R Harinath  <rharinath@novell.com>
5521
5522         Fix #75874.
5523         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
5524         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
5525
5526 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5527
5528         * expression.cs : tiny fix is required for not warning positive ulong.
5529           See test-441.cs.
5530
5531 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5532
5533         * expression.cs : add CS0652 check for constant and integral
5534           expression. Fixed bug #53974.
5535
5536 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5537
5538         * expression.cs : in DoNumericPromotions(), check if there is implicit
5539           conversion overload for string (to check CS0034). Fixed bug #52492.
5540
5541 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5542
5543         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
5544
5545 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5546
5547         * ecore.cs : report location when it is *not* Null.
5548
5549 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
5550
5551         * codegen.cs,
5552           ecore.cs,
5553           flowanalysis.cs,
5554           expression.cs:
5555           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
5556           correctly. Fixed bug #75721.
5557
5558 2005-08-23  Raja R Harinath  <rharinath@novell.com>
5559
5560         * support.cs (SeekableStreamReader.Position): Avoid an expensive
5561         loop that performs 'min (pos, char_count)'.
5562
5563         Fix #75862.
5564         * expression.cs (Unary.ResolveOperator): Don't discard implicit
5565         converted value in Operator.OnesComplement.
5566
5567 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
5568
5569         * anonymous.cs: If the anon method is pulled into a helper class,
5570         it needs to be `internal' not `private'. Fixes runtime behavior on
5571         msft. bug #75704
5572
5573 2005-08-20  Martin Baulig  <martin@ximian.com>
5574
5575         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
5576         scope if we don't already have it.
5577
5578         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
5579         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
5580         fixes #75867.
5581
5582 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
5583
5584         Fix #75803
5585         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
5586         is a partial class.
5587
5588 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
5589
5590         The big constants rewrite
5591         Fix #75746, #75685 and more
5592         As a side effect saved 1MB for MWF ;-)
5593         
5594         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
5595         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
5596         enum based for corlib compilation.
5597         
5598         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
5599         subtractions.
5600         
5601         * class.cs (FixedField.Define): Use ResolveAsConstant.
5602         
5603         * const.cs (IConstant): Interface constants and enums.
5604         (Const.ResolveValue): New method for constant resolvning.
5605         (ExternalConstant): Constants from imported assemblies.
5606         
5607         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
5608         conversion; like enums.
5609         (Constant.ToType): Converts this constant to different type.
5610         (Constant.Increment): Adds 1.
5611         
5612         * convert.cs (ImplicitConversionRequired): Simplified.
5613         
5614         * cs-parser.jay: Create EnumMember directly.
5615         
5616         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
5617         
5618         * doc.cs (GenerateEnumDocComment): Removed.
5619         
5620         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
5621         (ConvertIntLiteral): Removed.
5622         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
5623         
5624         * enum.cs (EnumMember): Implement IConstant.
5625         (Enum.IsValidEnumConstant): Removed.
5626         (Enum.GetNextDefaultValue): Removed.
5627         (Enum.FindMembers): Updated.
5628         (Enum.GenerateDocComment): Iterate enum members.
5629         
5630         * expression.cs (Cast.TryReduce): Handle enums correctly.
5631         (New.Constantify): Made public.
5632         (MemberAccess.DoResolve): Removed contant specific if(s).
5633         
5634         * literal.cs (NullLiteral): Implement new abstract methods.
5635         
5636         * statement.cs (GotoCase.Resolve): Use new constant methods.
5637         (SwitchLabel.ResolveAndReduce): Use new constant methods.
5638         
5639         * typemanager.cs (LookupEnum): Removed.
5640         (IsEnumType): Fixed to work with corlib.
5641         (RegisterConstant): Removed.
5642         (LookupConstant): Removed.
5643         (GetConstant): Changed to work with IConstant.
5644
5645 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
5646
5647         * location.cs : Fixed overflown (>255) column number.
5648
5649 2005-08-03  Raja R Harinath  <rharinath@novell.com>
5650
5651         First cut of the qualified-alias-member feature.
5652         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
5653         token.
5654         * cs-parser.jay (DOUBLE_COLON): New token.
5655         (namespace_or_type_name): Add rule for recognizing
5656         qualified-alias-members.
5657         (primary_expression): Likewise.
5658         (element_access): Allow QualifiedAliasMember as a possible
5659         type-bearing expression.
5660         (local_variable_type, local_variable_pointer_type): Likewise.
5661         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
5662         aliases in the current and enclosing namespace declarations.
5663         (NamespaceEntry.UsingAlias): Add CS0440 warning.
5664         * decl.cs (MemberName.is_double_colon): New.
5665         (MemberName.MemberName): Add new constructor for alias-member.
5666         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
5667         * expression.cs (QualifiedAliasMember): New expression type.
5668
5669 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5670
5671         * location.cs : it borked when no argument was specified.
5672
5673 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5674
5675         * location.cs : tiny ToString() format fix.
5676
5677 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5678
5679         * statement.cs : oops, it was missing.
5680
5681 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
5682
5683         A set of fixes for precise line/column location.
5684
5685         * location.cs :
5686           "token" field now holds a file/line "delta", a line number offset 
5687           from the segment, and a column number. See also:
5688           http://lists.ximian.com/pipermail/mono-devel-list/2004-
5689           December/009508.html
5690           Removed static IsNull. Use instance IsNull property instead.
5691         * cs-tokenizer.cs :
5692           For some tokens it stores Location. For Identifier it stores
5693           LocatedToken which is a pair of string name and location.
5694           Column numbers are adjusted only at getChar().
5695         * report.cs :
5696           Use Location.ToString() for reporting (it now contains column).
5697         * cs-parser.jay :
5698           Largely modified to use LocatedToken instead of
5699           string (IDENTIFIER), and to acquire Location from some tokens.
5700         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
5701           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
5702           codegen.cs :
5703           Now MemberName holds Location. DeclSpace.ctor() receives Location
5704           as a parameter. Removed extra parameters to all derived classes.
5705           Replaced Location.IsNull() with instance property.
5706         * assign.cs, expression.cs :
5707           Added .ctor() overload that omits Location.
5708         * attribute.cs :
5709           Added "nameEscaped" flag that indicates the identifier was escaped
5710           in the source file. This fixes bug #57047.
5711
5712 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
5713
5714         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
5715         New method, looking for lo-case imported cls type.
5716
5717         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
5718         here.
5719
5720         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
5721
5722         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
5723
5724         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
5725         all_imported_types.
5726         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
5727
5728         Optimized to save 3.5 MB for SWF compilation.
5729
5730 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5731
5732         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
5733         (PartialContainer.Create): Moved logic AddToContainer.
5734         (PartialContainer.MarkForDuplicationCheck): Shares name.
5735         
5736         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
5737         place.
5738         
5739         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
5740         initialization.
5741         (Namespace.GetSignatureForError): New method.
5742         
5743         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
5744         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
5745
5746 2005-08-01  Raja R Harinath  <rharinath@novell.com>
5747
5748         Fix #75669.
5749         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
5750         member lookup rather than qualifier_type, since qualifier_type can
5751         be null.
5752
5753 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
5754
5755         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
5756         enum member.
5757
5758 2005-07-31  Miguel de Icaza  <miguel@novell.com>
5759
5760         * statement.cs: Copy the local exception into the exception
5761         captured local.  Fixes 75674
5762
5763 2005-07-31  Raja R Harinath  <harinath@gmail.com>
5764
5765         Fix #75658.
5766         * expression.cs (Invocation.OverloadResolve): Don't report error
5767         CS1501 if error CS1502 has been reported.
5768         (New.DoResolve): Delegate CS1501 reporting to
5769         Invocation.OverloadResolve.
5770
5771         Fix #75656.
5772         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
5773         invariant-meaning-in-block property in an enclosing block if
5774         necessary.
5775
5776 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
5777
5778         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
5779         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
5780         (Switch.CheckSwitch): Just save 50kb for SWF.
5781
5782 2005-07-27  Martin Baulig  <martin@ximian.com>
5783
5784         * anonymous.cs (CaptureContext.AddField): Added
5785         `AnonymousContainer am' argument; compute its toplevel scope if
5786         it's not already computed.  Fixes #75649.
5787
5788 2005-07-26  Raja R Harinath  <rharinath@novell.com>
5789
5790         Fix #75628.
5791         * class.cs (Constructor.Emit): Reset block to null if the block
5792         resolve fails.
5793
5794 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5795
5796         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
5797
5798 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
5799
5800         * class.cs (MethodData.Define): Check whether accessor implementing
5801         interface is public.
5802
5803         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
5804
5805 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
5806
5807         Fix #57245
5808         * namespace.cs (LookupType): Moved same type check to...
5809         
5810         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
5811         with the same name.
5812
5813 2005-07-21  Raja R Harinath  <rharinath@novell.com>
5814
5815         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
5816         already found a typebuilder.
5817         * class.cs (MethodCore.IsDuplicateImplementation): Compare
5818         MemberNames, not strings.
5819
5820         * const.cs (Error_ExpressionMustBeConst): 
5821         Rename from Error_EpressionMustBeConst.
5822         * const.cs, class.cs, statement.cd: Update.
5823
5824 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
5825
5826         Fix #65573
5827
5828         * const.cs (Const.LookupConstantValue): Report missing contant expression
5829         everytime.
5830         (Error_EpressionMustBeConstant): Only one error method.
5831
5832         * class.cs, statement.c: Updated.
5833
5834 2005-07-20  Raja R Harinath  <rharinath@novell.com>
5835
5836         * statement.cs (Block.Flags): Add back HasVarargs.
5837         (Block.flags): Make protected.
5838         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
5839
5840         * typemanager.cs (types, typecontainers, user_types): Remove.
5841         (UserTypes, TypeContainers): Likewise.
5842         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
5843         (CleanUp, Reset): Update.
5844         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
5845         (GetNestedType): Use Type.GetNestedType.
5846         (CoreLookupType): Take two arguments, the namespace and the
5847         basename of the type.  Update to use the Namespace.Lookup
5848         mechanism.
5849         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
5850         (RealMemberLookup): Use IsNestedChildOf instead of playing with
5851         string concatenation and substring matches.
5852         * class.cs, enum.cs, delegate.cs: Update to changes.
5853
5854 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
5855
5856         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
5857         Expression and made virtual.
5858
5859         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
5860         (ImplicitStandardConversionExists): Fixed `byte' typo ?
5861
5862         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
5863
5864         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
5865         error message.
5866
5867         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
5868         change.
5869
5870 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
5871
5872         Fix #57707
5873         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
5874         AssemblyCultureAttribute is not used on executable.
5875
5876         * rootcontext.cs,
5877         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
5878
5879 2005-07-16  Raja R Harinath  <rharinath@novell.com>
5880
5881         Fix #60638.
5882         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
5883         New.  Reports CS0252/CS0253.
5884         Mostly taken from preliminary patch by Duncak Mak.
5885         (Binary.DoResolveOperator): Store results of operator lookup.
5886         Use them to detect if we need to warn about unintended reference
5887         comparisons.
5888
5889 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5890
5891         Fix #72969.
5892         * namespace.cs (Namespace.Lookup): Add back location parameter.
5893         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
5894         * delegate.cs, ecore.cs, expression.cs: Update to changes.
5895
5896         * codegen.cs (EmitContext.DeclSpace): Make readonly.
5897         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
5898         (Namespace.LookupType): ... this.
5899         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
5900         of namespaces.
5901         * typemanager.cs (LookupTypeReflection): Remove buggy code that
5902         purported to handle pointers.
5903         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
5904         CoreLookupType.
5905
5906 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
5907
5908         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
5909         type as namespace.
5910
5911 2005-07-15  Raja R Harinath  <rharinath@novell.com>
5912
5913         * namespace.cs (Namespace.Lookup): Drop location parameter.
5914         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
5915         (NamespaceEntry.Lookup): ... this.
5916         (NamespaceEntry.Error_AmbiguousTypeReference):
5917         Move here from DeclSpace.
5918         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
5919         names ...
5920         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
5921         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
5922         Move to NamespaceEntry.
5923         * delegate.cs, expression.cs: Update to changes.
5924
5925 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
5926
5927         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
5928         CheckAttributeType and refactored.
5929         (Attribute.ResolvePossibleAttributeType): Changed to reuse
5930         ResolveAsTypeTerminal error handling.
5931         (ResolveAsTypeTerminal): Introduced because of global attributes extra
5932         handling.
5933         (GetSignatureForError): Print errors in same way.
5934
5935         * class.cs,
5936         * codegen.cs: Reflect attribute GetSignatureForError change.
5937
5938         * ecore.cs,
5939         * expression.cs: Add silent parameter to ResolveAsTypeStep.
5940
5941         * namespace.cs (UsingEntry): Refactored to make fields private.
5942
5943         * assign.cs,
5944         statement.cs: Error_UnexpectedKind has extra parameter.
5945
5946 2005-07-14  Raja R Harinath  <rharinath@novell.com>
5947
5948         * ecore.cs (IAlias): Remove.
5949         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
5950         that implement the interface.
5951         * namespace.cs (Namespace): Likewise.
5952         (Namespace.declspaces): Renamed from 'defined_names'.
5953         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
5954         DeclSpace instead of an IAlias.
5955         * tree.cs (Tree.AddDecl): Update.
5956
5957 2005-07-12  Raja R Harinath  <rharinath@novell.com>
5958
5959         * statement.cs (Block.Flags); Remove HasVarargs.
5960         (Block.HasVarargs): Move to ToplevelBlock.
5961         (Block.ThisVariable, Block.AddThisVariable): Likewise.
5962         (Block.Variables): Make protected.  Initialize variable hashtable
5963         if necessary.
5964         (Block.AddVariable): Update.
5965         (Block.Resolve): Update to changes.
5966         (ToplevelBlock.HasVarargs): New boolean.
5967         (ToplevelBlock.ThisVariable): Move here from Block.
5968         (ToplevelBlock.AddThisVariable): Likewise.
5969         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
5970         * expression.cs (This.ResolveBase): Update to changes.
5971         (ArglistAccess.DoResolve): Likewise.
5972
5973 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5974
5975         Fix #75321
5976         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
5977
5978         * class.cs (TypeContainer.VerifyMembers): Distinguish between
5979         not used and not used & assigned.
5980         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
5981
5982 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
5983
5984         Fix #75053
5985         * expression.cs (Is.DoResolve): null is never provided type.
5986
5987 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
5988
5989         Fix #52496
5990         * cs-parser.jay: Less strict event error rule to catch more errors.
5991
5992 2005-07-08  Martin Baulig  <martin@ximian.com>
5993
5994         Fix test-iter-10.cs - distinguish whether we `yield' in a property
5995         gettter (allowed) or setter (not allowed).
5996
5997         * class.cs (Accessor): Implement IIteratorContainer.
5998         (Accessor.Yields): New public field.
5999         (PropertyBase.PropertyMethod.Define): Handle iterators on a
6000         per-accessor basis.
6001
6002         * cs-parser.jay
6003         (get_accessor_declaration, set_accessor_declaration): Set the
6004         `yields' flag on the accessor, not the property.
6005         (property_declaration): Do the iterators check on a per-accessor
6006         basis and not for the whole property.
6007
6008 2005-07-08  Martin Baulig  <martin@ximian.com>
6009
6010         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
6011         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
6012
6013 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
6014
6015         Fix #74975
6016         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
6017         (ExtractSecurityPermissionSet): Cope with self referencing security
6018         attributes properly.
6019
6020         * driver.cs (SetOutputFile): Made public property OutputFile.
6021
6022 2005-07-07  Raja R Harinath  <rharinath@novell.com>
6023
6024         Fix #75486.
6025         * class.cs (TypeContainer.first_nonstatic_field): Rename from
6026         has_nonstatic_fields.  Make into a FieldBase pointer.
6027         (TypeContainer.AddField): Add CS0282 check.
6028         (TypeContainer.EmitType): Update.
6029
6030 2005-07-06  Miguel de Icaza  <miguel@novell.com>
6031
6032         * cs-tokenizer.cs (consume_identifier): Do not create strings to
6033         compare if they start with __.
6034
6035 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6036
6037         * statement.cs (Switch.SwitchGoverningType): Only look at
6038         UserCasts that don't need implicit standard conversions to one of
6039         the allowed switch types (Fixes test-322.cs).
6040         (LocalInfo.Resolve): Re-enable sanity-test.
6041
6042 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
6043
6044         * cs-tokenizer.cs (consume_identifier): Detect double undescores
6045         
6046         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
6047         
6048         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
6049
6050 2005-07-06  Raja R Harinath  <rharinath@novell.com>
6051
6052         Fix #75472.
6053         * ecore.cs (SimpleName.GetSignatureForError): Add.
6054         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
6055         (MemberAccess.GetSignatureForError): Add.
6056
6057 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
6058  
6059         The big error and warning messages review.
6060         
6061         * anonymous.cs,
6062         * assign.cs,
6063         * attribute.cs,
6064         * class.cs,
6065         * codegen.cs,
6066         * convert.cs,
6067         * cs-parser.jay,
6068         * cs-tokenizer.cs,
6069         * decl.cs,
6070         * delegate.cs,
6071         * doc.cs,
6072         * driver.cs,
6073         * ecore.cs,
6074         * enum.cs,
6075         * expression.cs,
6076         * flowanalysis.cs,
6077         * iterators.cs,
6078         * literal.cs,
6079         * location.cs,
6080         * modifiers.cs,
6081         * namespace.cs,
6082         * parameter.cs,
6083         * pending.cs,
6084         * report.cs,
6085         * rootcontext.cs,
6086         * statement.cs,
6087         * support.cs,
6088         * tree.cs,
6089         * typemanager.cs: Updated.
6090         
6091         * class.cs: (MethodCore.SetYields): Moved here to share.
6092         (PropertyMethod.Define): Moved iterator setup here.
6093         
6094         * iterators.cs: Add orig_method to have full access to parent
6095         container.
6096
6097 2005-07-05  Raja R Harinath  <rharinath@novell.com>
6098
6099         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
6100         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
6101         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
6102         variable of struct type.
6103         * expression.cs (Unary.ResolveOperator): Update to change.
6104         (Indirection.VerifyFixed): Likewise.
6105         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
6106         (ParameterReference.VerifyFixed): Value parameters are fixed.
6107         (This.VerifyFixed): Treat 'this' as a value parameter.
6108         * statement.cs (LocalInfo.IsFixed): Remove.
6109
6110 2005-07-01  Martin Baulig  <martin@ximian.com>
6111
6112         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
6113         `ec.EmitThis ()' to get the correct scope.
6114
6115 2005-07-01  Martin Baulig  <martin@ximian.com>
6116
6117         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
6118         instance is a ParameterReference; fixes #75299.
6119
6120 2005-07-01  Martin Baulig  <martin@ximian.com>
6121
6122         Reverted Marek's latest patch (r46725):
6123         - it contains structural changes which are neither mentioned in
6124           the ChangeLog nor explained anywhere; for example the additional
6125           argument of EmitContext's and Iterator's .ctor's and the
6126           TypeContainer.DefineMembers() change.
6127         - structural changes like this should go in in seperate patches
6128           and not be hidden in a huge patch which just seems to affect
6129           warnings and errors.
6130           a big and hard to understand patch.
6131         - it breaks iterators and causes regressions, for instance in
6132           test-iter-03.cs.      
6133
6134 2005-06-30  Raja R Harinath  <rharinath@novell.com>
6135
6136         Fix #75412.
6137         * expression.cs (Indexers.map): Remove.
6138         (Indexers.Append): Filter out inaccessible setters and getters.
6139         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
6140
6141         Fix #75283.
6142         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
6143         Refactored from ...
6144         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
6145         (FieldExpr.Emit, PropertyExpr.Emit): Update.
6146         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
6147         * expression.cs (Invocation.EmitCall): Add CS0120 check.
6148
6149 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
6150
6151         Fix #75322
6152         * class.cs (FieldBase.GetInitializerExpression): One more field
6153         for backup.
6154
6155 2005-06-28  Miguel de Icaza  <miguel@novell.com>
6156
6157         * pending.cs: Do not define a proxy if the base method is virtual,
6158         it will be picked up by the runtime (bug 75270).
6159
6160 2005-06-08  Martin Baulig  <martin@ximian.com>
6161
6162         The big Iterators rewrite :-)
6163
6164         * iterators.cs: Rewrite this to use the anonymous methods framework.
6165
6166         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
6167         before the TypeContainers; see 2test-21.cs.
6168
6169         * class.cs
6170         (TypeContainer.DefineType): Don't create a new EmitContext if we
6171         already have one (this only happens if we're an Iterator).
6172         (TypeContainer.Define): Also call Define() on all our iterators.
6173         (Method.CreateEmitContext): Added support for iterators.
6174
6175         * anonymous.cs
6176         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
6177         (AnonymousContainer.CreateMethodHost): Moved here from
6178         AnonymousMethod and made abstract.
6179         (AnonymousContainer.CreateScopeType): New abstract method.
6180         (AnonymousContainer.IsIterator): New public property.
6181         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
6182         get the ScopeTypeBuilder rather than manually defining it here. 
6183         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
6184         iterators here.
6185
6186         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
6187         before RootContext.DefineTypes().
6188
6189         * codegen.cs (EmitContext.RemapToProxy): Removed.
6190         (EmitContext.CurrentAnonymousMethod): Changed type from
6191         AnonymousMethod -> AnonymousContainer.
6192         (EmitContext.ResolveTopBlock): Protect from being called twice.
6193         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
6194         (EmitContext.EmitThis): Removed the iterators hacks; use the
6195         anonymous methods framework for that.
6196
6197         * statement.cs
6198         (ToplevelBlock.Container): Make this a property, not a field.
6199         (ToplevelBlock.ReParent): New public method; move the
6200         ToplevelBlock into a new container.
6201         (Foreach.TemporaryVariable): Simplify.
6202
6203 2005-06-05  Martin Baulig  <martin@ximian.com>
6204
6205         * statement.cs (LocalInfo.CompilerGenerated): New flag.
6206         (Block.AddTemporaryVariable): New public method; creates a new
6207         `LocalInfo' for a temporary variable.
6208         (Block.EmitMeta): Create the LocalBuilders for all the temporary
6209         variables here.
6210         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
6211         non-iterator variables.
6212
6213 2005-06-05  Martin Baulig  <martin@ximian.com>
6214
6215         * statement.cs (Foreach.TemporaryVariable): Create the
6216         LocalBuilder in the Emit phase and not in Resolve since in some
6217         situations, we don't have an ILGenerator during Resolve; see
6218         2test-19.cs for an example.
6219
6220 2005-06-04  Martin Baulig  <martin@ximian.com>
6221
6222         **** Merged r45395 from GCS ****
6223
6224         The big Foreach rewrite - Part II.
6225
6226         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
6227         with `PropertyInfo ienumerator_getcurrent'.
6228
6229         * codegen.cs (VariableStorage): Removed.
6230
6231         * statement.cs
6232         (Foreach): Derive from Statement, not ExceptionStatement.
6233         (Foreach.CollectionForeach): New nested class.  Moved all the code
6234         dealing with collection foreach here.
6235         (Foreach.ForeachHelperMethods): Removed.
6236         (Foreach.TemporaryVariable): Implement IMemoryLocation.
6237
6238 2005-05-23  Martin Baulig  <martin@ximian.com>
6239
6240         * statement.cs (Try.DoResolve): Don't create a `finally' if we
6241         don't need to.  Fix #75014.
6242
6243 2005-05-20  Martin Baulig  <martin@ximian.com>
6244
6245         Merged r44808 from GMCS.
6246
6247         * class.cs (TypeContainer.CircularDepException): Removed.
6248         (TypeContainer.DefineType): Removed the `InTransit' stuff.
6249         (TypeContainer.CheckRecursiveDefinition): Check for circular class
6250         (CS0146) and interface (CS0529) dependencies here.
6251
6252 2005-06-21  Raja R Harinath  <rharinath@novell.com>
6253
6254         * expression.cs (Invocation.EmitCall): Fix initialization
6255         'this_call' to reflect current behaviour.  Fix indentation.
6256
6257         * convert.cs (FindMostEncompassedType): Add two trivial special
6258         cases (number_of_types == 0 || number_of_types == 1).
6259         (FindMostEncompasingType): Likewise.
6260
6261 2005-06-17  Raja R Harinath  <rharinath@novell.com>
6262
6263         Some cleanups preparing for the fix of #75283.
6264         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
6265         error testing.
6266         (EventExpr.InstanceResolve): Likewise.
6267         (EventExpr.DoResolve): Remove redundant checks.
6268
6269 2005-06-10  Duncan Mak  <duncan@novell.com>
6270
6271         * cs-tokenizer.cs (process_directives): New flag for controlling
6272         the processing of preprocessor directives.
6273         (x_token): After seeing a '#', return Token.NONE instead of going
6274         to handle_preprocessing_directive() when not processing
6275         directives. This avoids unnecessary processing during the token peek in
6276         is_punct().
6277
6278         This fixes #74939.
6279
6280         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
6281         the existing error reporting methods instead of Report.Error.
6282
6283         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
6284         after Raja's rewrite.
6285
6286 2005-06-08  Miguel de Icaza  <miguel@novell.com>
6287
6288         * class.cs: Small fix.
6289
6290 2005-06-08  Raja R Harinath  <rharinath@novell.com>
6291
6292         Fix #75160.
6293         * class.cs (GetPartialBases): Fix return value check of
6294         part.GetClassBases.
6295
6296 2005-06-07  Raja R Harinath  <rharinath@novell.com>
6297
6298         Ensure that partial classes are registered in their enclosing
6299         namespace.  Initial part of fix of #75160.
6300         * tree.cs (Tree.RecordDecl): Add new namespace argument.
6301         Register declspace with namespace here, not in
6302         DeclSpace.RecordDecl.
6303         * cs-parser.jay: Pass namespace to RecordDecl.
6304         * class.cs (PartialContainer.Create): Likewise.
6305         (ClassPart.DefineType): New sanity-check.  Throws an exception if
6306         called.
6307         * decl.cs (Declspace.RecordDecl): Remove.
6308         * namespace.cs (NamespaceEntry.DefineName): Remove.
6309
6310 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
6311
6312         * rootcontext.cs: Reset TargetExt as well.
6313
6314 2005-06-03  Raja R Harinath  <rharinath@novell.com>
6315
6316         * ecore.cs (Expression.Resolve): Emit CS0654 error when
6317         -langversion:ISO-1.
6318
6319 2005-06-02  Raja R Harinath  <rharinath@novell.com>
6320
6321         Fix #75080, cs0119.cs.
6322         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
6323         of ...
6324         (Expression.Resolve): ... this.  Use it.  Remove bogus code
6325         allowing ExprClass.Type and ExprClass.Namespace for
6326         ResolveFlags.VariableOrValue.
6327         (Expression.Resolve) [1-argument variant]: Change default resolve
6328         flags based on language version.
6329         (Expression.Error_UnexpectedKind): Use a simple string array
6330         rather than an ArrayList.
6331         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
6332         not ExprClass.Type.
6333         (TypeOfVoid.DoResolve): Likewise.
6334         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
6335         flags argument -- it always has the same value.
6336
6337 2005-05-31  Raja R Harinath  <rharinath@novell.com>
6338
6339         Fix #75081.
6340         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
6341         Use it in the error message.
6342         * assign.cs, expression.cs, statement.cs: Update.
6343
6344 2005-05-30  Raja R Harinath  <rharinath@novell.com>
6345
6346         Fix #75088.
6347         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
6348         the "almostMatchedMember" case too.
6349         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
6350         that failed the accessibility checks to 'almost_match'.
6351
6352 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
6353
6354         * attribute.cs: Use internal MethodBuilder methods to set
6355         ExactSpelling and SetLastError on PInvoke methods, instead
6356         of passing them via charset.  Fixes #75060.
6357
6358 2005-05-27  Raja R Harinath  <rharinath@novell.com>
6359
6360         * parameter.cs (Parameter): Remove TODO comment.
6361         (Parameter.DefineParameter): Remove Location parameter.
6362         (Parameters.LabelParameters): Likewise.
6363         * class.cs (Constructor.Emit): Update to change.
6364         (MethodData.Emit): Likewise.
6365         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
6366         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
6367
6368 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
6369
6370         * parameter.cs,
6371           Removed Parameters.Location and added Parameter.Location instead.
6372           Removed Location parameter from Emit() and GetSignature().
6373         * anonymous.cs,
6374           class.cs,
6375           cs-parser.jay,
6376           delegate.cs,
6377           iterators.cs,
6378           statement.cs :
6379           Modified all related calls.
6380
6381 2005-05-26  Raja R Harinath  <rharinath@novell.com>
6382
6383         Improve user-defined conversion handling.
6384         * convert.cs (GetConversionOperators): Rewrite.  Return only the
6385         applicable operators.
6386         (AddConversionOperators): New.  Helper for GetConversionOperators.
6387         (FindMostEncompassedType, FindMostEncompassingType): Verify that
6388         there is only one most encompassed/encompassing type.
6389         (FindMostSpecificSource, FindMostSpecificTarget): Remove
6390         "applicable operator" handling.
6391         (UserConversion): Move cache here from GetConversionOperators.
6392         Directly cache the chosen operator, rather than the whole
6393         MethodGroup.
6394         (ExplicitNumericConversion): Fix buggy implementation of Decimal
6395         case.  Allow conversion of decimal to sbyte and byte too.
6396         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
6397         New static methods.  Used to avoid allocating EmptyExpressions in
6398         convert.cs.
6399
6400 2005-05-24  Duncan Mak  <duncan@novell.com>
6401
6402         * ecore.cs (CastFromDecimal): New class for casting a decimal to
6403         another class, used in Convert.ExplicitNumericConversion.
6404         (CastToDecimal): New class, similar to above, but casts to
6405         System.Decimal, used in Convert.ImplicitNumericConversion and also
6406         in explicit convesion from double/float to decimal.
6407
6408         * convert.cs (ImplicitNumericConversion): Handle implicit
6409         conversions to System.Decimal.
6410         (ExplicitNumericConversion): handle explicit conversions to
6411         System.Decimal.
6412
6413         This fixes #68711.
6414         
6415 2005-05-20  Miguel de Icaza  <miguel@novell.com>
6416
6417         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
6418         know the type at this stage, just break through.   Fixes #75008 
6419
6420 2005-05-19  Martin Baulig  <martin@ximian.com>
6421
6422         * delegate.cs
6423         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
6424         to disable error reporting.
6425
6426         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
6427         here since we don't want to report an error; see the new test-336.cs.
6428
6429 2005-05-19  Raja R Harinath  <rharinath@novell.com>
6430
6431         * statement.cs (ToplevelBlock.GetParameterReference)
6432         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
6433         Move here from class Block.
6434         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
6435         * expression.cs (ParameterReference.DoResolveBase): Likewise.
6436
6437 2005-05-18  Martin Baulig  <martin@ximian.com>
6438
6439         Fix #74978.
6440
6441         * flowanalysis.cs
6442         (FlowBranching.Reachability): Add non-static public And() and Or()
6443         methods.
6444         (FlowBranchingSwitch): New class; do the `break_origins' thing
6445         like in FlowBranchingLoop.
6446         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
6447         reachability, not just locals and parameters.
6448         (FlowBranching.MergeChild): Remove some of the hacks for loop and
6449         switch; MergeBreakOrigins() now takes care of that.
6450
6451 2005-05-18  Martin Baulig  <martin@ximian.com>
6452
6453         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6454         a loop and may leave it, reset the barrier; fixes #74974.
6455
6456 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
6457         
6458         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
6459         is back.
6460         
6461         * cs-parser.jay: Catch more lexical errors.
6462         
6463         * report.cs: Add one more Error method.
6464         
6465         * rootcontext.cs,
6466         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
6467
6468 2005-05-17  Martin Baulig  <martin@ximian.com>
6469
6470         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
6471         #70970. 
6472
6473 2005-05-16  Raja R Harinath  <rharinath@novell.com>
6474
6475         Fix test-382.cs.  Emit values of decimal constants.
6476         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
6477         Carved out of ...
6478         (TypeContainer.AddField): ... this.
6479         (TypeContainer.EmitFieldInitializers): Allow the list of fields
6480         with initializers to include 'Const's.
6481         (ClassPart.RegisterFieldForInitialization): Forward to
6482         PartialContainer.
6483         * const.cs (Const.Const): Pass initializer to base class.
6484         (Const.Define): In case of decimal constants, register them for
6485         initialization in a static constructor.
6486
6487 2005-05-14  Martin Baulig  <martin@ximian.com>
6488
6489         * statement.cs (Block.Resolve): Correctly handle unreachable code;
6490         do not call ResolveUnreachable() on unreachable statements in
6491         here, see the comment in the source code.
6492
6493 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6494
6495         Fix #74934.
6496         * expression.cs (BinaryResolveOperator): If one of the operands of
6497         an equality comparison is 'null' and the other is a pointer type,
6498         convert the null to a NullPointer.
6499         * convert.cs (ImplicitReferenceConversion): If the expression is a
6500         NullLiteral and the target type is a pointer type, return a
6501         NullPointer instead.
6502         (ImplicitConversionStandard): Likewise.
6503
6504 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
6505         
6506         * cs-parser.jay: Set readonly context based on special constructs.
6507         
6508         * expression.cs (LocalVariableReference.DoResolveBase): Improved
6509         readonly variable error handling.
6510         
6511         * rootcontext.cs (EmitCode): Don't verify members when error
6512         occurred.
6513         
6514         * statement.cs (LocalInfo): Add reaodnly context information.
6515         (SetReadOnlyContext, GetReadOnlyContext): New methods.
6516
6517 2005-05-13  Raja R Harinath  <rharinath@novell.com>
6518
6519         * statement.cs (Block.Resolve): Revert change below.  Modify fix
6520         for #74041 to initialize 'resolved' to false only for explicit
6521         blocks.  Fixes #74873.
6522
6523 2005-05-12  Raja R Harinath  <harinath@gmail.com>
6524
6525         Fix #74920.
6526         * typemanager.cs (unmanaged_enclosing_types): New.
6527         (IsUnmanagedType): Avoid infloops by using
6528         'unmanaged_enclosing_types' to talk with recursive invocations.
6529
6530 2005-05-13  Martin Baulig  <martin@ximian.com>
6531
6532         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
6533         instance variable, not a local.  Fix #74873.
6534         (Block.ResolveUnreachable): Set it to true here.
6535
6536 2005-05-11  Duncan Mak  <duncan@novell.com>
6537
6538         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
6539         continuing to process for 'arg'.
6540         (handle_preprocessing_directive): Check the argument of the #endif
6541         directive and report error CS1025 if there are any trailing
6542         characters.
6543
6544         According to the C# spec, having even whitespace after the #endif
6545         directive is illegal; however, because we call arg.TrimEnd ()
6546         beforehand, we have the same behavior as csc, allowing whitespace
6547         after the directive.
6548
6549         Fixes #74892.
6550
6551 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
6552
6553         Fix #74863.
6554         
6555         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
6556         (Constructor.GetObsoleteAttribute): Implemented correctly.
6557
6558 2005-05-10  Martin Baulig  <martin@ximian.com>
6559
6560         * support.cs (ReflectionParameters.ParameterModifier): Use
6561         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
6562         and `ParameterAttributes.In'.  Fixes #74884.
6563
6564 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
6565
6566         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
6567         
6568         * expression.cs (Argument.GetParameterModifier): Turned to property.
6569         (Invocation.Error_InvalidArguments): Add more descriptive errors.
6570         
6571         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
6572         its C# equivalent.
6573         
6574 2005-05-09  Raja R Harinath  <rharinath@novell.com>
6575
6576         Fix #74852.
6577         * decl.cs (MemberCache.AddMethods): Register override methods,
6578         rather than non-override methods.
6579         * typemanager.cs (RegisterOverride): New.
6580         (IsOverride): Update.
6581
6582 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
6583
6584         Fix #73105.
6585         
6586         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
6587         recursive declaration.
6588         
6589         * statement.cs (Block.ResolveMeta): Report any error in resolving.
6590         
6591 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
6592
6593         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
6594         
6595         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
6596
6597 2005-05-05  Raja R Harinath  <rharinath@novell.com>
6598
6599         Fix #74797.
6600         * decl.cs (DeclSpace.FamilyAccessible): 
6601         Use TypeManager.IsNestedFamilyAccessible.
6602
6603         Fix reopened #64812.
6604         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
6605         internal'.
6606
6607 2005-05-04  Raja R Harinath  <rharinath@novell.com>
6608             Abin Thomas  <projectmonokochi@rediffmail.com>
6609             Anoob V E  <projectmonokochi@rediffmail.com>
6610             Harilal P R  <projectmonokochi@rediffmail.com>
6611
6612         Fix #64812.
6613         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
6614         allow access to all static members.
6615
6616 2005-05-04  Martin Baulig  <martin@ximian.com>
6617
6618         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
6619
6620 2005-05-04  Martin Baulig  <martin@ximian.com>
6621
6622         Fix #74655.
6623
6624         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
6625         section at the end; make things work if `default' is not the last
6626         section.        
6627
6628 2005-05-04  Martin Baulig  <martin@ximian.com>
6629
6630         Fix #70400.
6631
6632         * statement.cs (Switch): Replaced the `got_default' field with a
6633         `default_section' one.
6634         (Switch.CheckSwitch): Set `default_section' here.
6635         (Switch.Resolve): If we're a constant switch and the constant is
6636         not found, use the default section.
6637
6638 2005-05-03  Martin Baulig  <martin@ximian.com>
6639
6640         * expression.cs (ArrayAccess.EmitGetLength): New public method.
6641
6642         * statement.cs (Foreach.ArrayForeach): New nested class.
6643         (Foreach.TemporaryVariable): New nested class.
6644         (Foreach.EmitArrayForeach): Removed; this is now in the new
6645         ArrayForeach class.
6646
6647 2005-05-03  Raja R Harinath  <rharinath@novell.com>
6648
6649         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
6650         more conservative.
6651         (VerifyPendingMethods): Revert change below.
6652
6653         * typemanager.cs (IsOverride, RegisterNonOverride): New.
6654         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
6655         that used to trigger warning -28.  Remove warning -28.
6656         * expression.cs (Invocation.OverloadResolve): Use
6657         TypeManager.IsOverride to distinguish override methods.
6658
6659         Fix #74773.
6660         * pending.cs (VerifyPendingMethods): If a base type implements the
6661         requested interface, don't bother checking individual methods of
6662         the base type.  As a side-effect, this prevents the creation of
6663         unnecessary proxies.
6664
6665 2005-05-02  Martin Baulig  <martin@ximian.com>
6666
6667         Fix #70182.
6668
6669         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
6670         Also `And' the locals if the old vector is null.
6671         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
6672         null; in this case we basically reset all the variables.        
6673
6674 2005-05-02  Martin Baulig  <martin@ximian.com>
6675
6676         Fix #74529.
6677
6678         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
6679         Added `FlowBranching branching' argument; always `and' the
6680         variables instead of `or'ing them unless we're an infinite loop.
6681
6682         * statement.cs (While.Resolve): Create a new sibling unless we're
6683         infinite.       
6684
6685 2005-05-02  Martin Baulig  <martin@ximian.com>
6686
6687         Fix #70140.
6688
6689         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
6690         arguments; use it instead of creating a new TopLevelBlock.
6691         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
6692         our ConstructorInitializer.
6693
6694         * statement.cs
6695         (TopLevelBlock.TopLevelBranching): New public property.
6696         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
6697         and create our `TopLevelBranching'.
6698
6699         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
6700         anonymous method host, use `block.TopLevelBranching' rather than
6701         creating a new branching.
6702
6703 2005-04-20  Miguel de Icaza  <miguel@novell.com>
6704
6705         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
6706         a ScopeInfo, if any of the current children is a child of the new
6707         entry, move those children there.
6708
6709 2005-04-30  Martin Baulig  <martin@ximian.com>
6710
6711         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
6712         at the beginning of a SwitchSection.  Fix #73335.
6713
6714 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
6715
6716         Fix #74378
6717         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
6718         
6719         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
6720         (FieldExpr.DoResolve): Obsolete members are ignored for field
6721         initializers.
6722         
6723 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
6724
6725         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
6726         of arrays detection.
6727
6728         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
6729         verification.
6730         (Field.VerifyClsCompliance): Volatile fields are not compliant.
6731
6732         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
6733         arrays report.
6734
6735 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
6736
6737         * cs-parser.jay: Use the prefered version of -unsafe in error
6738         message.
6739
6740 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
6741
6742         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
6743         circumstances.
6744
6745 2005-04-20  John Luke  <john.luke@gmail.com>
6746
6747         * driver.cs: fix typo in error message, --outout to --output
6748
6749 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
6750
6751         * codegen.cs (InRefOutArgumentResolving): New field.
6752         
6753         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
6754         fields outside contructor.
6755         
6756         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
6757         
6758 2005-04-19  Miguel de Icaza  <miguel@novell.com>
6759
6760         * anonymous.cs (CaptureContext.EmitParameterInstance): The
6761         parameter code was not completed ever, so it was not as up-to-date
6762         as local variables.  Must finish it.
6763
6764         The bug fix was to compare the Toplevel of the block, not the
6765         current block.  Thanks for Ben for pointing this out. 
6766
6767 2005-04-19  Raja R Harinath  <rharinath@novell.com>
6768
6769         * decl.cs (AddMethods): Use the declaring type of the problem
6770         method to determine if we want to squash a warning.
6771
6772 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
6773
6774         * attribute.cs: Removed debug output.
6775
6776         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
6777         
6778         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
6779         Report.Stderr.
6780         
6781 2005-04-18  Raja R Harinath  <rharinath@novell.com>
6782
6783         Fix #74481.
6784         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
6785         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
6786         all null comparisons against reference types.
6787
6788 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
6789
6790         Fix# 74565
6791         * class.cs (TypeContainer.CircularDepException) New nested
6792         exception class.
6793         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
6794         (TypeContainer.DefineType): Removed error, reset InTransit before
6795         exit.
6796         (Class.DefineType): Throw exception when is in Transit.
6797         Catch exception and report error.
6798         (Struct.DefineType): Throw exception when is in Transit.
6799         Catch exception and report error.
6800         (Interface.DefineType): Throw exception when is in Transit.
6801         Catch exception and report error.
6802
6803         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
6804         handle nested exception handlers.
6805
6806         * flowanalysis.cs (InTryWithCatch): New method, search for try with
6807         a catch.
6808
6809         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
6810         InFinally and InCatch storage.
6811
6812         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
6813         (Catch.Resolve): Set and Restore ec.InCatch.
6814         (Try.Resolve): Set and Restore ec.InFinally.
6815         (Try.HasCatch): True when try has catch.
6816
6817 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
6818
6819         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
6820           for the same event member, so exclude such cases from warning 419.
6821           Fixed bug #74633.
6822
6823 2005-04-16  Miguel de Icaza  <miguel@novell.com>
6824
6825         * expression.cs (Binary.ResolveOperator): Apply patch from John
6826         Luke to fix bug 59864: operators &, | and ^ on enumerations
6827         require that the same enum type on both sides.
6828
6829         * driver.cs: Add warnings to old flag usage, this is to assist
6830         people who produce Makefiles and hope that the Makefiles will be
6831         used on Windows.
6832
6833         * class.cs (TypeContainer.EmitType): Moved the definition of the
6834         special $PRIVATE$ field from the resolve phase to the Emit phase.
6835         During resolve we do not know if we are a struct with
6836         HasExplicitLayout, we know this only after the attributes for the
6837         type are emitted.
6838
6839         Set the FieldOffset to zero on the dummy field that we create for
6840         the class.   Fixes 74590.
6841
6842 2005-04-16  Raja R Harinath  <rharinath@novell.com>
6843
6844         Fix #73834.
6845         * ecore.cs (PropertyExpr.resolved): New.
6846         (DoResolve): Use it to handle a case of double resolution here.
6847         Handle a case of identical-name-and-type-name.
6848         * expression.cs (ArrayCreation.CheckIndices): Avoid double
6849         resolution by storing the results of expression resolution back
6850         into the "probes" array.
6851
6852 2005-04-15  Raja R Harinath  <rharinath@novell.com>
6853
6854         Fix cs0208-7.cs and cs0208-8.cs.
6855         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
6856         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
6857         error reporting to point out the reason a struct is not unmanaged.
6858
6859 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6860
6861         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
6862           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
6863
6864 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6865
6866         Fix #74528.
6867         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
6868         IdenticalNameAndTypeName here.
6869         (EventExpr.InstanceResolve): Likewise.
6870
6871 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
6872
6873         C# 2.0 DefaultCharSetAttribute implementation
6874         
6875         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
6876         which allows us to set GlobalNamespace for every resolve.
6877         (Attribute.ResolveArguments): Cut from Resolve.
6878         (Attribute.GetCharSetValue): Returns CharSet named argument.
6879         (Attribute.DefinePInvokeMethod): Gets default charset from
6880         module settings.
6881         (GlobalAttribute.ResolveAsTypeStep): Override.
6882         (GlobalAttribute.ResolveArguments): Override.
6883         
6884         * class.cs (TypeAttr): Is protected.
6885         
6886         * codegen.cs (ModuleClass.DefaultCharSet): New member.
6887         (ModuleClass.DefaultCharSetType): New memeber.
6888         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
6889         
6890         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
6891         charset from module.
6892         
6893         * delegate.cs (TypeAttr): Override.
6894         (Delegate.DefineType): Use this TypeAttr.
6895         
6896         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
6897         at very early stage (before types are defined) to resolve model
6898         module attributes. It will probably not work with corlib but it
6899         should be ok.
6900         
6901         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
6902         charset from module.
6903         
6904         * typemanager.cs (default_charset_type): New type.
6905
6906 2005-04-13  Raja R Harinath  <rharinath@novell.com>
6907
6908         * decl.cs (MemberCache.AddMethods): Don't warn if
6909         System.Object.Finalize has buggy MethodAttributes.
6910
6911         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
6912         removed below.
6913
6914 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6915
6916         * doc.cs : detect ambiguous reference to overloaded members.
6917           Fixed bug #71603. MS 1.1 csc does not detect it.
6918
6919 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
6920
6921         * doc.cs : delegates must not be referenced with parameters.
6922           Fixed bug #71605.
6923
6924 2005-04-12  Miguel de Icaza  <miguel@novell.com>
6925
6926         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
6927
6928 2005-04-10  Miguel de Icaza  <miguel@novell.com>
6929
6930         * driver.cs (MainDriver): Stop processing if the CLS stage found
6931         errors. 
6932
6933         (CompilerCallableEntryPoint.InvokeCompiler): Always
6934         reset after execution;   Take a TextWriter argument for the
6935         output.
6936
6937         * report.cs: Use the error stream instead of hardcoding stderr. 
6938
6939 2005-04-09  Miguel de Icaza  <miguel@novell.com>
6940
6941         * class.cs: Reduce code paths to test, too small of an
6942         optimization to make it worth the extra testing.  Always perform
6943         it. 
6944
6945 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6946
6947         Fix #74510.
6948         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
6949         operators that had errors reported on them.
6950
6951 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
6952
6953         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
6954         argument types.
6955         (Attribute.Resolve): Add named argument type checking.
6956         
6957         * class.cs (FixedField.Define): Use IsPrimitiveType
6958         
6959         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
6960         
6961         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
6962         unsafe parameter types.
6963         
6964         * statement.cs (Using.ResolveExpression): Add better error description.
6965         
6966         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
6967         
6968 2005-04-08  Raja R Harinath  <rharinath@novell.com>
6969
6970         Fix #74484.
6971         * attribute.cs (Attribute.GetAttributeUsage): Resolve
6972         AttributeUsageAttribute in the emitcontext of the attribute class,
6973         not in the emitcontext of the attributable entity it was attached to.
6974         * cs-parser.jay: Use 'current_class', not 'current_container',
6975         when creating a GlobalAttribute.
6976
6977 2005-04-08  Alp Toker  <alp@atoker.com>
6978
6979         * pending.cs: The fix to #58413 failed to compile methods implementing
6980         interfaces with/without params modifiers and vice versa, even though
6981         params modifiers aren't part of the signature. Make the modifier check
6982         less strict as in csc.
6983
6984 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
6985             Anoob V E  <projectmonokochi@rediffmail.com>
6986             Harilal P R  <projectmonokochi@rediffmail.com>
6987
6988         Fix #58413.
6989         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
6990         modifiers of pending methods.
6991         (PendingImplementation.PendingImplementation): Initialize it.
6992         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
6993         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
6994         with ParameterData.  Add check for modifiers.
6995         * class.cs (MethodData.Define): Update to changes.
6996
6997 2005-04-07  Raja R Harinath  <rharinath@novell.com>
6998
6999         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
7000
7001 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
7002
7003         * class.cs (PropertyMethod.Define): Check private accessor in abstract
7004         property.
7005         
7006         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
7007         
7008         * rootcontext.cs,
7009         * typemanager.cs: Registered RequiredAttributeAttribute.
7010         
7011 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
7012
7013         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
7014         Warning CS0169 is back at level 3.
7015         (IMethodData.SetMemberIsUsed): New method.
7016         
7017         * decl.cs (IsUsed): New value; moved from FieldBase.Status
7018         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
7019         
7020         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
7021
7022         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
7023         contants.
7024         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
7025         is used.
7026         
7027         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
7028         is used.
7029         
7030         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
7031         to avoid the problems with nested types.
7032
7033 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
7034             Anoob V.E  <projectmonokochi@rediffmail.com>
7035             Harilal P.R  <projectmonokochi@rediffmail.com>
7036             Raja R Harinath  <rharinath@novell.com>
7037
7038         Fix #73820.
7039         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
7040         attribute.
7041         * typemanager (GetConstructor): Make public.
7042
7043 2005-04-05  John Luke  <john.luke@gmail.com>
7044             Raja R Harinath  <rharinath@novell.com>
7045
7046         Fix #62232.
7047         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
7048         struct too.  Return false quicker in a few cases.
7049         (VerifyUnManaged): Use it.
7050
7051 2005-04-05  Raja R Harinath  <rharinath@novell.com>
7052
7053         Fix #74041.
7054         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
7055         not 'unreachable_seen'.
7056
7057 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
7058
7059         * attribute.cs (Attribute.GetValue): Removed unused.
7060         
7061         * codegen.cs (CodeGen.TrimExt): Removed unused.
7062         
7063         * cs-parser.jay (output): Removed unused.
7064         
7065         * cs-tokenizer.cs (hex_digits): Removed unused.
7066         
7067         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
7068         
7069         * expression.cs (Indirection.LoadExprValue): Removed unused.
7070         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
7071         
7072         * iterators.cs (Iterator.param_types): Removed unused.
7073         
7074         * statement.cs (Goto.block): Removed unused.
7075         (ToplevelBlock.did): Removed unused.
7076         (Switch.ResolveConstantSwitch): Removed unused.
7077
7078 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
7079
7080         * rootcontext.cs: Allow mcs to bootstrap with the compilation
7081         resetting thingy.
7082
7083 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7084
7085         Fix #74232 and cs0208-3.cs.
7086         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
7087         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
7088         unmanaged type.  Don't use FieldBuilders when 't' is a
7089         TypeBuilder.  Use ModFlags and MemberType fields.
7090         * class.cs (MemberBase.member_type): Rename from MemberType.
7091         (MemberBase.MemberType): New property.  Determines member_type on
7092         demand.
7093         (MemberBase.DoDefine): Don't initialize MemberType here.
7094         (FieldMember.Define): Likewise.
7095
7096 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
7097
7098         Fix #74241
7099         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
7100         Attributes are emitted there.
7101         
7102 2005-04-01  Raja R Harinath  <rharinath@novell.com>
7103
7104         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
7105         keyword in 'partial enum' too.
7106         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
7107         is not allowed).
7108         Report from Kamil Skalski <nazgul@omega.pl>.
7109
7110         Fix #74309.
7111         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
7112         have partial containers too.
7113
7114         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
7115         in block' checks to Block.CheckInvariantMeaningInBlock.
7116         * statement.cs (Block.GetKnownVariableInfo): Make private.
7117         (Block.IsVariableUsedInChildBlock): Remove.
7118         (Block.IsVariableUsedInBlock): Likewise.
7119         (Block.CheckInvariantMeaningInBlock): New.  Show location of
7120         conflicting declaration.
7121         (Block.AddVariable): Make error messages less long-winded and more
7122         specific.  Show location of conflicting declaration.
7123         * parameter.cs (Parameters.Location): New readonly property.
7124
7125 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7126
7127         Clean up semantics of invoking ResolveMemberAccess.
7128         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
7129         can have an instance, ensure that we pass in a non-TypeExpression
7130         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
7131         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
7132         argument.  Update to changes and simplify.
7133         (FieldExpr.Emitinstance): Remove CS0120 check.
7134         (PropertyExpr.EmitInstance): Likewise.
7135         * expression.cs (Argument.Resolve): Likewise.
7136         (Invocation.DoResolve): Update to changes in semantics of
7137         InstanceExpression.
7138
7139 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
7140
7141         Fix #74241
7142         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
7143         customization.
7144         
7145         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
7146
7147 2005-03-31  Raja R Harinath  <rharinath@novell.com>
7148
7149         Fix difference in behaviour with commandline invocation.
7150         * driver.cs (Driver.Reset): New.
7151         (CompilerCallableEntryPoint): Call it.
7152
7153         * statement.cs (If.Resolve): Avoid spurious "uninitialized
7154         variable" warnings if the boolean expression failed to resolve.
7155
7156 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
7157
7158         * attribute.cs: Fix the union of several permissions when some of them
7159         are unrestricted (so the result isn't an unrestricted permission set).
7160         Fix #74036.
7161
7162 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7163
7164         * ecore.cs (MemberExpr): New class.  Convert from interface
7165         IMemberExpr.
7166         (MemberExpr.ResolveMemberAccess): Refactor and move here from
7167         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
7168         error checks.
7169         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
7170         (MethodGroupExpr.IsExplicitImpl): Remove.
7171         (Expression.GetFieldFromEvent): Remove.
7172         (SimpleName.MemberStaticCheck): Remove.
7173         (SimpleName.DoSimpleNameResolve): Update to changes.
7174         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
7175         (MemberAccess.IdenticalNameAndTypeName): Remove.
7176         (MemberAccess.error176): Move to MemberExpr.
7177         (MemberAccess.DoResolve): Update to changes.
7178         (BaseAccess.DoResolve): Likewise.
7179
7180 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
7181
7182         C# 2.0 Conditional attribute class implementation
7183         
7184         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
7185         Analyzes class whether it has attribute which has ConditionalAttribute
7186         and its condition is not defined.
7187         
7188         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
7189         (Class.IsExcluded): New method. Search for at least one defined
7190         condition in ConditionalAttribute of attribute class.
7191
7192 2005-03-30  Raja R Harinath  <rharinath@novell.com>
7193
7194         * ecore.cs (PropertyExpr): Derive from Expression, not
7195         ExpressionStatement.
7196         (PropertyExpr.EmitStatement): Remove.
7197
7198 2005-03-29  Raja R Harinath  <rharinath@novell.com>
7199
7200         Fix #74060.
7201         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
7202         internal field "value__" of an enum be private.  The examples for
7203         "value__" that I found on MSDN all used FieldAttributes.Private.
7204
7205         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
7206         Don't mention IL method attribute names.
7207
7208         Fix #47991.  Remove a TODO.
7209         * statement.cs (Block.Toplevel): Make into a field.
7210         (Block.Parameters): Move into ToplevelBlock.
7211         (Block.known_variables): Rename from child_variable_names.
7212         (Block.Block): Remove variants that take Parameters.  Initialize
7213         'Toplevel' with the immediately surrounding toplevel block.
7214         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
7215         LocalInfo parameter.
7216         (Block.GetKnownVariableInfo): New.
7217         (Block.IsVariableNameUsedInChildBlock): Update.
7218         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
7219         the block, even though it may not be in scope.
7220         (Block.AddVariable): Remove Parameters parameter.  Use
7221         Toplevel.Parameters instead.
7222         (Block.AddConstant): Remove Parameters parameter.
7223         (Block.GetParameterReference): Update to use Toplevel.Parameters.
7224         (Block.IsParamaterReference): Likewise.
7225         (Block.IsLocalParameter): Likewise.  Simplify a lot.
7226         (ToplevelBlock.Parameters): New.  Moved from Block.
7227         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
7228         initialize Parameters to a non-null value.
7229         * cs-parser.jay: Update to changes.
7230         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
7231         simple names that mean different things in the same block.  Use
7232         Block.IsVariableNameUsedInBlock.
7233
7234 2005-03-28  Raja R Harinath  <rharinath@novell.com>
7235
7236         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
7237         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
7238         GetTypeHandle.  It is possible for a reflected type to derive from
7239         a TypeBuilder (e.g., int[] derives from the TypeBuilder
7240         System.Array during mscorlib compilation).
7241         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
7242         contain a method_hash, don't create one either.  Don't create a
7243         deep copy of the base cache's method_hash.
7244         (MemberCache.SetupCache): Rename back from DeepCopy.
7245         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
7246         already initialized.  If we see an override function, add its
7247         underlying base virtual function to the member_hash too.
7248
7249         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
7250
7251 2005-03-26  Raja R Harinath  <harinath@acm.org>
7252
7253         Fix #73038.
7254         * assign.cs (Assign.DoResolve): When the RHS of an assignment
7255         fails to resolve, ensure that the LHS is still resolved as an
7256         lvalue.
7257
7258 2005-03-25  Raja R Harinath  <harinath@acm.org>
7259
7260         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
7261         ec.ContainerType.
7262         (Enum.current_ec): Remove.
7263         (Enum.LookupEnumValue): Remove EmitContext argument.
7264         Just uses the one created during DefineType.
7265         (Enum.FindMembers): Update.
7266         * expression.cs (MemberAccess.DoResolve): Update.
7267
7268 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
7269
7270         * assign.cs (Assign.DoResolve): Check for CS1717 when
7271         source and target are same (uses Equals).
7272
7273         * expression.cs (LocalVariableReference, ParameterReference,
7274         This): Implemented Equals, GetHashCode.
7275
7276         * statement.cs (Block.GetParameterReference): Removed useless
7277         local variable.
7278
7279 2005-03-22  Raja R Harinath  <rharinath@novell.com>
7280
7281         Fix cs0128.cs
7282         * statement.cs (Block.AddVariable): Ensure that we skip implicit
7283         blocks before deciding whether the error is cs0136 or cs0128.
7284
7285         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
7286         (using_alias_directive, using_namespace_directive): Pass
7287         MemberName, not an expression to Namespace.UsingAlias and
7288         Namespace.Using.
7289         (MakeName): Use the MemberName of the namespace.
7290         * namespace.cs (Namespace.MemberName): New.
7291         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
7292         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
7293         Likewise.
7294         * decl.cs (MemberName.Name): Make readonly.
7295         (MemberName.FromDotted): New "constructor".
7296         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
7297         (MemberCore.Name): Compute from MemberName on demand.
7298         (MemberCore.SetMemberName): Provide a way to change the
7299         MemberName.
7300         (MemberCore.AddToContainer): Don't take a fullname parameter.
7301         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
7302         fully qualified name of the container to the member name.
7303         (TypeContainer.AddToTypeContainer): Use a fully qualified name
7304         only if the type is a member of the root container.
7305         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
7306         MemberName.Left rather than searching for an embedded ".".
7307         (PartialContainer.CreatePart): Update to changes in RootContext.
7308         (MemberBase.ShortName): Turn into a property.  Use
7309         MemberCore.SetMemberName.
7310         (MemberBase.ExplicitInterfaceName): Remove.
7311         (MemberBase.UpdateMemberName): Remove.
7312         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
7313         (PropertyBase.SetMemberName): New override.
7314         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
7315         (Tree.GetDecl): New.
7316         (Tree.AllDecls): Rename from Decls.
7317         * attribute.cs, enum.cs, report.cs: Update to changes.
7318         * driver.cs (MainDriver): Use MemberName.FromDotted on
7319         RootContext.MainClass.
7320
7321 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
7322
7323         * class.cs (FixedField.Define): Check for CS1664 and more sanity
7324         checks.
7325
7326         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
7327
7328 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
7329
7330         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
7331         property accessor modifiers.
7332
7333         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
7334         fixed buffer attribute (CS1716).
7335         (PropertyMethod.HasCustomAccessModifier): When property accessor
7336         has custom modifier.
7337
7338         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
7339         modifiers.
7340         (PropertyExpr.DoResolveLValue): Add CS0272.
7341
7342 2005-03-17  Miguel de Icaza  <miguel@novell.com>
7343
7344         * convert.cs: When converting to a pointer, use the proper Conv.U
7345         or Conv.I depending on the source data type.
7346
7347         * cs-tokenizer.cs: Make the size for large decimal constants,
7348         fixes #72957.
7349
7350 2005-03-17  Martin Baulig  <martin@ximian.com>
7351
7352         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
7353         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
7354
7355 2005-03-17  Martin Baulig  <martin@ximian.com>
7356
7357         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
7358         to bool so we can return an error condition.
7359         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
7360         returned an error.
7361
7362 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
7363
7364         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
7365         attributes.
7366
7367 2005-03-16  Raja R Harinath  <rharinath@novell.com>
7368
7369         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
7370         Refactor to avoid traversing the list of assemblies, and to avoid
7371         string concatenation.
7372         * typemanager.cs (guid_attr_type): Remove.
7373         (negative_hits, pointers, references): Remove hashes.
7374         (type_hash): New.
7375         (GetConstructedType): New.  Uses type_hash to handle constructed
7376         types (arrays, references, pointers).
7377         (GetReferenceType, GetPointerType): Use it.
7378         (GetNestedType): New.  Uses type_hash to handle nested types of
7379         reflected types.
7380         (LookupType, LookupTypeDirect): Remove.
7381         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
7382         'types' hash and LookupTypeReflection directly.
7383         (params_string, params_object): Use GetConstructedType.
7384         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
7385         top-level types.
7386         (Namespace.Lookup): Use cached_types.
7387         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
7388         provided by old TypeManager.LookupType.
7389         * rootcontext.cs (MakeFQN): Remove.
7390         * decl.cs (DeclSpace.MakeFQN): Likewise.
7391         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
7392         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7393         TypeManager.GetConstructedType.
7394         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
7395
7396 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
7397
7398         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
7399         indexers.
7400
7401         * cs-parser.jay: Reports CS1527 for any namespace element.
7402
7403         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
7404         Added CS0407.
7405
7406         * expression.cs (ParameterReference.IsAssigned): Changed error to
7407         CS0269.
7408         (Error_WrongNumArguments): Moved CS0245 detection here.
7409
7410         * statement.cs (Return.Resolve): Add CS1622 report.
7411
7412 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
7413
7414         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
7415
7416 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
7417
7418         * attribute.cs expression.cs: Get rid of some allocations.
7419
7420 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
7421
7422         * doc.cs : just eliminate the latest change.
7423
7424 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7425
7426         * doc.cs : commented out the latest change. It breaks xml-030.cs
7427
7428 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7429
7430         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
7431           fail. So invoke CreateType() in FindDocumentedType().
7432
7433 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
7434
7435         * cs-tokenizer.cs : added IsKeyword().
7436         * doc.cs : Detect keyword incorrectly used as identifier.
7437           Allow identifiers prefixed by @.
7438
7439 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
7440
7441         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
7442         It caused exception in namespace resolving (again!).
7443         
7444         * class.cs (Class.ctor): Removed exit.
7445         (PropertyMethod.ctor): ditto.
7446         
7447         * codegen.cs (Codegen.Reset): Reset static data.
7448         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
7449         
7450         * cs-tokenizer.cs (Cleanup): Removed.
7451         
7452         * driver.cs (GetSystemDir): Rewrote to one line command.
7453         It caused problem with unloaded dynamic modules.
7454         (UnixParseOption): Removed Exit.
7455         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
7456         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
7457         Now can be mcs used as library.
7458         
7459         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
7460         empty location.
7461         
7462         * location.cs (Reset): Reset static data.
7463         
7464         * namespace.cs (Reset): Reset static data.
7465         
7466         * report.cs (Report.Reset): Reset static data.
7467         
7468         * rootcontext.cs (RootContext.Reset): Reset static data.
7469         
7470         * tree.cs (RootTypes.ctor): Use Location.Null
7471         
7472         * typemanager.cs (TypeManager.Reset): Reset static data.
7473         (CoreLookupType): Removed Exit.
7474         (TypeHandle.Reset): Reset static data.
7475         
7476 2005-03-10  Raja R Harinath  <rharinath@novell.com>
7477
7478         Fix #73516.
7479         * typemanager.cs (ComputeNamespaces): Import namespaces from
7480         referenced modules too.
7481
7482 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7483
7484         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
7485         than '.'.
7486
7487 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7488
7489         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
7490         enclosing DeclSpace.  This ensures that a name-lookup populates
7491         more caches and there are fewer 'TypeExpression's.  Carve out
7492         nested type lookup into ...
7493         (LookupNestedTypeInHierarchy): ... this.
7494
7495 2005-03-09  Raja R Harinath  <rharinath@novell.com>
7496
7497         Clean up a few partial-class semantics.  
7498         Fixes test-357.cs and cs1618-2.cs.
7499         * cs-parser.jay (struct_declaration): Use 'current_class' as
7500         parent of newly-created struct.  Remove call to Register ().
7501         Use 'pop_current_class' to complete handing the current struct.
7502         (interface_declaration): Likewise.
7503         (class_declaration): Likewise.
7504         (enum_declaration): Use 'current_class' as parent of newly created
7505         enum.
7506         (delegate_declaration): Likewise.
7507         (pop_current_class): New function.  This is used to handle closing
7508         up the 'current_class' and 'current_container', and pointing them
7509         to the enclosing class/container.
7510         (CSharpParser): Initialize 'current_class' too.
7511         * decl.cs (MemberCore): Add check for invariant: a partial
7512         container is not a parsed entity, and thus does not enclose any
7513         parsed members.
7514         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
7515         (DeclSpace.BaseTypeExpr): Use it.
7516         (DeclSpace.LookupType): Add check for invariant.
7517         * class.cs (TypeContainer): Add check for invariant: a nested
7518         class should have the same NamespaceEntry as its enclosing class.
7519         (TypeContainer.EmitFieldInitializers): Make virtual.
7520         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
7521         MemberCore.
7522         (TypeContainer.Register): Remove.
7523         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
7524         null.  Use TypeResolveEmitContext for resolving base types and
7525         interfaces.  Move initialization of Parts.TypeBuilder here from
7526         ...
7527         (TypeContainer.DefineNestedTypes): ... here.
7528         (PartialContainer): Take a Namespace not a NamespaceEntry.
7529         (PartialContainer.Create): Don't use Register.  Call the
7530         appropriate Add... function directly.
7531         (ClassPart): Take both the PartialContainer and the enclosing
7532         class as constructor arguments.
7533         (ClassPart.EmitFieldInitializers): Override.
7534         (ClassPart.PartFindNestedTypes): Remove.
7535         (FieldBase.GetInitializerExpression): Resolve the initializer
7536         expression in the emit context of the enclosing class.
7537         * tree.cs (RootTypes): Remove Register ().
7538         
7539 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
7540
7541         * cs-parser.jay: Removed CS0134.
7542         
7543         * driver.cs: Removed CS1901.
7544         
7545         * expression.cs (SizeOf.DoResolve): Don't report CS0233
7546         for predefined types.
7547
7548 2005-03-07  Duncan Mak  <duncan@novell.com>
7549
7550         * codegen.cs (Save):  Catch UnauthorizedAccessException as
7551         well. Fixes bug #73454.
7552
7553 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
7554
7555         * cs-tokenizer.cs (xtoken): Add CS1035.
7556         
7557         * class.cs (MethodData.Define): Add CS0683.
7558         (FieldMember.ctor): Add CS0681.
7559
7560 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7561
7562         * ecore.cs (SimpleName.DoResolve): Rename from
7563         SimpleName.DoResolveAllowStatic.
7564         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
7565         Pass 'intermediate' flag to MemberStaticCheck.
7566         (SimpleName.MemberStaticCheck): Skip "static check" only in case
7567         of "intermediate" lookups via MemberAccess.
7568         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
7569         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
7570
7571 2005-03-07  Raja R Harinath  <rharinath@novell.com>
7572
7573         Fix #73394.
7574         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
7575         slipped in because of variable names that are identical to a
7576         builtin type's BCL equivalent ('string String;', 'int Int32;').
7577         (PropertyExpr.EmitInstance): Likewise.
7578
7579 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
7580
7581         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
7582         
7583         * report.cs (warning_ignore_table): Made public.
7584
7585 2005-03-04  Raja R Harinath  <rharinath@novell.com>
7586
7587         Fix #73282.
7588         * class.cs (MethodData.Emit): Pass 'container' to
7589         container.GetObsoleteAttribute instead of 'container.Parent'.
7590
7591 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * cs-parser.jay: Add 1534 error test.
7594
7595         * iterators.cs (Yield.CheckContext): Add error 1629.
7596         (Iterator.ctor): Save unsafe modifier.
7597         (MoveNextMethod.DoEmit): Restore unsafe context.
7598
7599         * namespace.cs (UsingAlias): Better error message.
7600
7601 2005-03-03  Dan Winship  <danw@novell.com>
7602
7603         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
7604         the warning message [#73219]
7605
7606 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7607
7608         Fix compile with MCS 1.0.0.0.
7609         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
7610         w_restore to not depend on string constant folding.
7611
7612 2005-03-03  Raja R Harinath  <rharinath@novell.com>
7613
7614         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
7615         CS0246 check to users who passed 'silent = false'.
7616         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
7617         check.
7618         (SimpleName.SimpleNameResolve): Update.
7619         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
7620         (MemberAccess.IdenticalNameAndTypeName): Update.
7621         * doc.cs (FindDocumentedTypeNonArray): Update.
7622
7623 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
7624
7625         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
7626         * parameters.cs (ComputeAndDefineParameters): Remove.
7627         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
7628         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
7629         Use GetParameterInfo.
7630
7631 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
7632
7633         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
7634
7635 2005-03-02  Raja R Harinath  <rharinath@novell.com>
7636
7637         Unify DeclSpace.LookupType and DeclSpace.FindType.
7638         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
7639         is in charge of defining nested types on demand.
7640         (DeclSpace.LookupType): Use it when the current_type is a
7641         TypeBuilder.  Use LookupTypeDirect for reflected types.
7642         (DeclSpace.FindType): Remove.
7643         (DeclSpace.LookupInterfaceOrClass): Likewise.
7644         (DeclSpace.DefineTypeAndParents): Likewise.
7645         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
7646         DeclSpace.LookupType.
7647         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
7648         * typemanager.cs (LookupType): Simplify.
7649         (AddUserType): Remove type from negative_hits.
7650         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
7651         * class.cs (TypeContainer.FindMembers): Move handling of nested
7652         types ...
7653         (TypeContainer.FindMembers_NestedTypes): ... here.
7654         (TypeContainer.FindNestedType): Implement override.
7655         (ClassPart.FindNestedType): Delegate to PartialContainer.
7656         (ClassPart.PartFindNestedType): Looks up the nested types of the
7657         part alone.
7658
7659 2005-03-02  Martin Baulig  <martin@ximian.com>
7660
7661         * class.cs (TypeContainer.DoDefineMembers): We also need a default
7662         static constructor in static classes.
7663
7664 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7665
7666         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
7667         sizeParamIndex is not specified.
7668
7669 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
7670
7671         Fix #73117
7672         * report.cs (WarningMessage.IsEnabled): Missing null check.
7673
7674 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7675
7676         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
7677         in the fields and not in the properties.
7678
7679 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
7680
7681         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
7682         fields as well.
7683
7684 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7685
7686         * attribute.cs: Small refactoring (improved robustness).
7687         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
7688         (ValidateGuid): Removed.
7689         (Resolve): Removed referenced to above mentioned.
7690         (GetAttributeUsage): Made private and changed to work without
7691         class assistance.
7692         (GetIndexerAttributeValue): Don't crash.
7693         (GetConditionalAttributeValue): Ditto.
7694         (GetClsCompliantAttributeValue): Ditto.
7695         (ExtractSecurityPermissionSet): All attributes exceptions are
7696         error 648.
7697         (GetPropertyValue): New helper.
7698         (GetMethodImplOptions): New method.
7699         (DefinePInvokeMethod): Reuse common code. Implemented handling of
7700         some missing properties.
7701         
7702         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
7703         (Method.ApplyAttributeBuilder): Updated.
7704         
7705         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
7706         exception.
7707
7708 2005-02-28  Raja R Harinath  <rharinath@novell.com>
7709
7710         Fix #73052.
7711         * report.cs (Report.SymbolRelatedToPreviousError): Handle
7712         non-simple types (array, pointer, reference).
7713
7714 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
7715
7716         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
7717
7718         * class.cs (MethodCore.IsDuplicateImplementation): Special error
7719         for operators.
7720         (Method.CheckBase): Catch wrong destructor here.
7721         (MethodData.Define): Add errors 550, 668.
7722
7723         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
7724
7725         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
7726
7727         * pending.cs (VerifyPendingMethods): Add error 551.
7728
7729         * typemanager.cs (CSharpName): Next error report helper.
7730
7731 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
7732
7733         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
7734         attributes. Removed useless attribute double check.
7735         It saves almost 2MBs for corlib.
7736
7737 2005-02-25  Raja R Harinath  <rharinath@novell.com>
7738
7739         Fix #72924.
7740         * statement.cs (ExpressionStatement.Resolve): Make robust to being
7741         called twice in case of error.
7742
7743 2005-02-23  Chris Toshok  <toshok@ximian.com>
7744
7745         Fix compiler portions of #72827.
7746         * statement.cs (Block.Emit): call Begin/EndScope on the
7747         EmitContext instead of the ILGenerator.
7748
7749         * codegen.cs (EmitContext.BeginScope): new method, call
7750         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
7751         we have one.)
7752         (EmitContext.BeginScope): same, but EndScope and CloseScope
7753
7754         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
7755         offset and call the superclass's OpenScope(int) with it.
7756         (SymbolWriter.CloseScope): get the current il
7757         offset and call superclass's CloseScope(int) with it.
7758
7759 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
7760
7761         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
7762         CS1677 for out and ref as well.
7763
7764         * class.cs (Method.Define): Add error CS1599 detection.
7765         
7766         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
7767         
7768         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
7769         
7770         * delegate.cs (Delegate.Define): Add error CS1599 detection.
7771         
7772         * support.cs.cs (ModifierDesc): New helper method.
7773
7774 2005-02-23  Raja R Harinath  <rharinath@novell.com>
7775             Abin Thomas  <projectmonokochi@rediffmail.com>
7776             Anoob V E  <projectmonokochi@rediffmail.com>
7777             Harilal P R  <projectmonokochi@rediffmail.com>
7778
7779         Fix #57851, #72718.
7780         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
7781         MemberLookup (used for error reporting) actually returns a result.
7782         Fix error report number (122, not 112).
7783
7784 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
7785             Anoob V E  <projectmonokochi@rediffmail.com>
7786             Harilal P R  <projectmonokochi@rediffmail.com>
7787
7788         Fix #71134.
7789         * pending.cs (PendingImplementation.GetAbstractMethods):
7790         Find NonPublic members too.
7791
7792 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
7793
7794         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
7795         Fixed error 217.
7796         
7797         * class.cs (MethodCore.CheckMethodAgainstBase):
7798         Add error 239 report.
7799
7800 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7801
7802         Fix #68955.
7803         * expression.cs (Invocation.IsApplicable): Make public.
7804         (Invocation.IsParamsMethodApplicable): Likewise.
7805         * delegate.cs (Delegate.VerifyApplicability): Don't use
7806         Invocation.VerifyArgumentCompat for parameter applicability
7807         testing.  Use Invocation.IsApplicable and
7808         Invocation.IsParamsMethodApplicable.
7809
7810 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7811
7812         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
7813         
7814         * class.cs (Operator.Define): Add error 217 report.
7815         
7816 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7817
7818         * namespace.cs (UsingEntry.Resolve): Undo change below.
7819
7820 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7821
7822         Fix #72756.
7823         * ecore.cs (Expression.MemberLookupFailed): Add argument to
7824         disable the error message when the extended MemberLookup also
7825         fails.
7826         (Expression.MemberLookupFinal): Update.
7827         (SimpleName.DoSimpleNameResolve): Update.
7828         * expression.cs (MemberAccess.ResolveNamespaceOrType):
7829         Don't use MemberLookupFinal.
7830         (New.DoResolve): Update.
7831         (BaseAccess.CommonResolve): Update.
7832
7833 2005-02-21  Raja R Harinath  <rharinath@novell.com>
7834
7835         Fix #72732.
7836         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
7837         occured previously, don't resolve again.
7838
7839 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
7840
7841         Fix #69949
7842         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
7843         argument. Call ResolveAttributeUsage for unresolved.
7844         when types doesn't match ctor arguments.
7845         
7846         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
7847         for nested attribute classes.
7848         (Class.attribute_usage): Removed.
7849         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
7850         for attribute class.
7851         
7852         * ecore.cs (IsAttribute): Removed.
7853         
7854         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
7855         
7856         * rootcontext.cs (RegisterAttribute): Removed, attributes are
7857         now normal types.
7858         (attribute_types): Removed.
7859         (EmitCode): Global attributes are emited as the latest.
7860
7861 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
7862
7863         * class.cs (EmitFieldInitializers): Don't emit field initializer
7864         for default values when optimilization is on.
7865         
7866         * constant.cs (Constant.IsDefaultValue): New property.
7867         
7868         * driver.cs: Add /optimize handling.
7869         
7870         * constant.cs,
7871         * ecore.cs,
7872         * literal.cs: Implement new IsDefaultValue property.
7873         
7874         * rootcontext.cs (Optimize): New field, holds /optimize option.
7875
7876 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7877
7878         Fix crasher in re-opened #72347.
7879         * namespace.cs (Namespace.Lookup): Return null if
7880         DeclSpace.DefineType returns null.
7881
7882         Fix #72678.
7883         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
7884
7885 2005-02-18  Raja R Harinath  <rharinath@novell.com>
7886
7887         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
7888         now returns null if it cannot resolve to an lvalue.
7889         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
7890         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
7891         returned null.  Remove check for SimpleName.
7892         (EventExpr.DoResolveLValue): New.
7893         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
7894         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
7895         error from ...
7896         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
7897         avoid CS0131 error.
7898         (Unary.ResolveOperator): Move CS0211 check ...
7899         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
7900         CS0131 error.
7901         (Unary.DoResolveLValue): Simplify.
7902         (AddressOf.DoResolveLValue): New.
7903         (ArrayAccess.DoResolveLValue): New.
7904
7905 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
7906
7907         * attribute.cs (Attribute.Resolve): Add arguments casting for
7908         when types doesn't match ctor arguments.
7909
7910 2005-02-16  Raja R Harinath  <rharinath@novell.com>
7911
7912         Fix parts of #63202.
7913         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
7914         lookup of operator in base type.  Ensure that all checks happen
7915         when the operator resolves to an "op_..." method.
7916
7917 2005-02-15  Raja R Harinath  <rharinath@novell.com>
7918
7919         Fix #71992.
7920         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
7921         'ignore_cs0104' parameter.  Pass it to ...
7922         (NamespaceEntry.Lookup): ... this.
7923         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
7924         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
7925         (TypeLookupExpression.DoResolveAsTypeStep): Update.
7926         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
7927         Update.  Request that cs0104 errors be ignored.
7928         (ComposedCast.ResolveAsTypeStep): Update.
7929
7930 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7931
7932         Fix #59209.
7933         * expression.cs (Invocation.BetterFunction): Remove support for
7934         comparing virtual functions and their overrides.
7935         (Invocation.IsOverride): New.
7936         (Invocation.OverloadResolve): Don't consider 'override' functions
7937         during candidate selection.  Store them in a lookaside list.
7938         If the selected method is a 'virtual' function, use the list to
7939         find any overrides that are closer to the LHS type.
7940
7941 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
7942
7943         * expression.cs (New.DoResolve): Add complex core type reduction.
7944         (New.Constantify): Converts complex core type syntax like 'new int ()'
7945         to simple constant.
7946         
7947 2005-02-14  Raja R Harinath  <rharinath@novell.com>
7948
7949         * decl.cs (EntryType.EntryType): New constructor to create an
7950         updated copy of a cache entry.
7951         (MemberCache.AddMethods): Use it.
7952         (MemberCache.ClearDeclaredOnly): Remove.
7953         (MemberCache.MemberCache): Update.
7954
7955 2005-02-11  Miguel de Icaza  <miguel@novell.com>
7956
7957         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
7958         variable.  This one is represents the actual low-level declaration
7959         of the method, as opposed to the semantic level `IsStatic'.   
7960
7961         An anonymous method which is hosted into a static method might be
7962         actually an instance method.  IsStatic would reflect the
7963         container, while MethodIsStatic represents the actual code
7964         generated.
7965
7966         * expression.cs (ParameterReference): Use the new MethodIsStatic
7967         instead of IsStatic.
7968
7969         * anonymous.cs (AnonymousMethod.Compatible): Pass the
7970         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
7971         set on the current EmitContext. 
7972
7973         * expression.cs (Cast): Overload DoResolveLValue so we can pass
7974         resolve our casted expression as an LValue.  This triggers the
7975         proper LValue processing that is later required by Assign.
7976
7977         This fixes 72347.
7978
7979         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
7980
7981 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
7982
7983         C# 2.0 Fixed buffer implementation
7984
7985         * anonymous.cs: Update after RegisterHelperClass renaming.
7986
7987         * attribute.cs (AttributeTester.fixed_buffer_cache):
7988         Cache of external fixed buffers.
7989         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
7990         implementation if field is fixed buffer else null.
7991
7992         * class.cs
7993         (TypeContainer.AddField): Accept FieldMember instead of Field.
7994         (FieldBase.IsFieldClsCompliant): Extracted code from
7995         VerifyClsCompliance descendant customization.
7996         (FixedField): New class handles fixed buffer fields.
7997         (FixedFieldExternal): Keeps information about imported fixed
7998         buffer.
7999         (IFixedField): Make access to internal or external fixed buffer
8000         same.
8001
8002         * cs-parser.jay: Add fixed buffer parsing.
8003
8004         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
8005         buffer.
8006
8007         * expression.cs (Indirection): Extended implementation to accept
8008         fixed buffer field.
8009         (PointerArithmetic.Emit): Get element from fixed buffer as well.
8010         (ElementAccess.MakePointerAccess): Get type as parameter.
8011         (DoResolve): Add fixed buffer field expression conversion.
8012         (DoResolveLValue): Ditto.
8013         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
8014         (ArrayPtr): Derives from FixedBufferPtr.
8015         (ArrayPtr.Emit): Add extra emit for array elements.
8016
8017         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
8018
8019         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
8020         for compiler generated types.
8021         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
8022
8023         * statement.cs (Fixed): Refactored to be easier add fixed buffer
8024         and consume less memory.
8025         (Fixed.Resolve): Add fixed buffer case.
8026
8027         * typemanager.cs (compiler_generated_attr_ctor,
8028         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
8029         (HasElementType): Add our own implementation to work on every
8030         runtime.
8031
8032 2005-02-11  Miguel de Icaza  <miguel@novell.com>
8033
8034         * anonymous.cs (CaptureContext): Track whether `this' has been
8035         referenced.   
8036
8037         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
8038         only captured `this' if it was implicitly done (instance
8039         methods/variables were used). 
8040
8041         * codegen.cs (EmitContext.CaptureThis): New method to flag that
8042         `this' must be captured.
8043
8044 2005-01-30  Miguel de Icaza  <miguel@novell.com>
8045  
8046         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
8047         is null it means that there has been no need to capture anything,
8048         so we just create a sibling.
8049
8050         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
8051
8052         Just a partial fix.  The other half is fairly elusive.
8053         
8054 2005-02-10  Raja R Harinath  <rharinath@novell.com>
8055
8056         Fix #52586, cs0121-4.cs.
8057         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
8058         and return a hashtable.
8059         (MemberCache.ClearDeclaredOnly): New.
8060         (MemberCache.MemberCache): Update to change.  Make a deep copy of
8061         the method_hash of a base type too.
8062         (MemberCache.AddMethods): Adapt to having a deep copy of the base
8063         type methods.  Overwrite entries with the same MethodHandle so
8064         that the ReflectedType is correct.  The process leaves in base
8065         virtual functions and their overrides as distinct entries.
8066         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
8067         matters since it was boxed in a ArrayList before.
8068         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
8069         modifier.
8070         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
8071         case of a virtual function and its override (choose the overload
8072         as better).
8073         (Invocation.OverloadResolve): Avoid 'override' members during
8074         'applicable_type' calculation.
8075
8076 2005-02-09  Raja R Harinath  <rharinath@novell.com>
8077
8078         Combine two near-redundant caches.
8079         * typemanager.cs (method_params): Rename from method_internal_params.
8080         (TypeManager.GetParameterData): New.  Replace
8081         Invocation.GetParameterData.
8082         (TypeManager.LookupParametersByBuilder): Remove.
8083         * expression.cs (Invocation.method_parameter_cache): Remove.
8084         (Invocation.GetParameterData): Remove.
8085         Update to changes.
8086         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
8087         Update to changes.
8088
8089 2005-02-08  Raja R Harinath  <rharinath@novell.com>
8090
8091         Fix #72015.
8092         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
8093         TypeManager.multicast_delegate_type is null, resolve it by looking
8094         up "System.MulticastDelegate".
8095         * rootcontext.cs (RootContext.ResolveCore): Simplify.
8096
8097 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
8098             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
8099             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
8100
8101         Fix cs0164.cs.
8102         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
8103         (LabeledStatement.AddReference): New.  Set 'referenced'.
8104         (Goto.Resolve): Use it.
8105
8106 2005-02-05  John Luke  <john.luke@gmail.com>
8107
8108         * driver.cs: remove duplicate -doc line in Usage ()
8109
8110 2005-02-04  Raja R Harinath  <rharinath@novell.com>
8111
8112         * location.cs (Location.AddFile): Fix CS2002 error report.
8113
8114 2005-02-02  Martin Baulig  <martin@ximian.com>
8115
8116         * delegate.cs (Delegate.DefineType): Report an internal error if
8117         TypeManager.multicast_delegate_type is null.  See bug #72015 for
8118         details.        
8119
8120 2005-02-02  Raja R Harinath  <rharinath@novell.com>
8121
8122         Fix a crasher in a variant of #31984.
8123         * const.cs (Constant.CheckBase): New override that defers the
8124         new-or-override check in case the base type hasn't been populated
8125         yet.
8126         (Constant.Define): Ensure the new-or-override check is performed.
8127
8128 2005-02-01  Duncan Mak  <duncan@ximian.com>
8129
8130         * const.cs (LookupConstantValue): Check that `ce' is not null
8131         before calling GetValue ().
8132
8133 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8134
8135         Fix test-334.cs (#69519).
8136         * cs-parser.jay (using_alias_directive): Pass in an expression to
8137         NamespaceEntry.UsingAlias.
8138         (using_namespace_directive): Pass in an expression to
8139         NamespaceEntry.Using.
8140         (namespace_name): Don't flatten to a string.
8141         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
8142         (NamespaceEntry.AliasEntry.Resolve): Lookup using
8143         ResolveAsTypeStep.
8144         (NamespaceEntry.UsingEntry): Likewise.
8145         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
8146         changes.
8147         (NamespaceEntry.LookupForUsing): Remove.
8148         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
8149         names.
8150         (NamespaceEntry.Lookup): Remove support for dotted names.
8151
8152 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8153
8154         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
8155         split into two.
8156         (NamespaceEntry.ImplicitParent): Compute on demand.
8157         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
8158         parallels the current.
8159         (NamespaceEntry.LookupForUsing): Use it.
8160         (NamespaceEntry.Lookup): If the current namespace-entry is
8161         implicit, don't search aliases and using tables.
8162
8163 2005-02-01  Raja R Harinath  <rharinath@novell.com>
8164
8165         Fix #31984.
8166         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
8167         BaseCache here.
8168         (TypeContainer.BaseCache): Compute on demand.
8169         (TypeContainer.FindMembers): Define constants and types if they're
8170         not already created.
8171         (FieldMember.Define): Move resetting of ec.InUnsafe before error
8172         check.
8173         * const.cs (Constant.Define): Make idempotent.
8174
8175 2005-01-29  Miguel de Icaza  <miguel@novell.com>
8176
8177         * pending.cs: Produce better code (no nops produced by using Ldarg
8178         + value).
8179         
8180         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
8181         i - 1' it should be arg + 1.
8182
8183         Fixes bug #71819.
8184
8185 2005-01-28  Raja R Harinath  <rharinath@novell.com>
8186
8187         * attribute.cs (Attribute.CheckAttributeType): Make private
8188         non-virtual.
8189         (Attribute.ResolveType): Make virtual.
8190         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
8191         handling of RootContext.Tree.Types.
8192
8193 2005-01-27  Raja R Harinath  <rharinath@novell.com>
8194
8195         Update attribute-handling to use the SimpleName/MemberAccess
8196         mechanisms.
8197         * cs-parser.jay (attribute): Pass in an expression to the
8198         constructors of Attribute and GlobalAttribute.
8199         * attribute.cs (Attribute): Take an expression for the name.
8200         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
8201         passed in attribute name expression.
8202         (Attribute.CheckAttributeType): Use it.
8203         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
8204         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
8205         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
8206         argument to prevent error messages if the lookup fails.
8207
8208 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
8209
8210         * expression.cs (Indirection): Implemented IVariable interface
8211         to support indirection in AddressOf operator.
8212         (PointerArithmetic.Emit): Add optimalization for case where
8213         result can be precomputed.
8214
8215 2005-01-26  Martin Baulig  <martin@ximian.com>
8216
8217         * class.cs (TypeContainer.AttributeTargets): Return the correct
8218         AttributeTargets depending on our `Kind' instead of throwing an
8219         exception; fixes #71632.
8220
8221 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
8222
8223         Fix #71257
8224         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
8225         constant members.
8226
8227 2005-01-25  Raja R Harinath  <rharinath@novell.com>
8228
8229         Fix #71602.
8230         * expression.cs (MemberAccess.DoResolve): Don't complain with
8231         cs0572 when the LHS of a member access has identical name and type
8232         name.
8233
8234 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
8235
8236         Fix #71651, #71675
8237         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
8238         CreatePermission.
8239         Create custom PermissionSet only for PermissionSetAttribute.
8240
8241 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
8242
8243         Fix #71649
8244         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
8245         delegates in static class.
8246
8247 2005-01-24  Martin Baulig  <martin@ximian.com>
8248
8249         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8250         merging an implicit block, just use its reachability.
8251
8252         * statement.cs (Block.Resolve): Make the unreachable code check
8253         work wrt. implicit blocks; see test-337 from #63842.
8254
8255 2005-01-21  Alp Toker  <alp@atoker.com>
8256  
8257         * cs-parser.jay: destructor_declaration's container is PartialContainer
8258         not Class when partial types are used, so use Kind prop instead of
8259         'is'.
8260         
8261 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
8262
8263         * cs-parser.jay: Improve error reporting when an interface
8264         declares new types.
8265
8266 2005-01-20  Dick Porter  <dick@ximian.com>
8267
8268         * support.cs: SeekableStreamReader fix from Sandor Dobos
8269         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
8270         chars are read.  Fixes bug 70369.
8271
8272 2005-01-20  Raja R Harinath  <rharinath@novell.com>
8273
8274         * cs-parser.jay (catch_clause): Simplify current_block handling
8275         somewhat.
8276
8277 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
8278
8279         * convert.cs (ImplicitStandardConversionExists): Synchronize the
8280         code with ImplicitStandardConversion to handle the implicit
8281         conversion of method groups into valid delegate invocations. 
8282
8283         The problem is that in parameter handling we were using this code
8284         path.  Fixes bug #64698
8285
8286 2005-01-19  Raja R Harinath  <rharinath@novell.com>
8287
8288         * cs-parser.jay: Fix several infelicities.
8289         - Avoid assigning to the parser value stack.  Code like 
8290           '$3 = null' is unclean.  Synthesize a value for the code block
8291           instead. 
8292         - Avoid using oob_stack for storing location information.  Use ...
8293         (_mark_): ... this.  New (empty) rule.  Saves the current location
8294         in $$.
8295         (foreach_statement): Avoid using oob_stack for current_block
8296         handling.  Use technique used in for_statement and
8297         using_statement.  Synthesize a value for the code block to store
8298         additional intermediate information.
8299
8300 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
8301
8302         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
8303         of a different type is only allowed to private fields of a
8304         containing type, not on fields of a base class.
8305
8306         See test-174.cs and error cs0122-9.cs
8307
8308 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8309
8310         Fix test-335.cs (bug #58126).
8311         * cs-parser.jay (argument): Split out non-expression parts of the
8312         rule into 'non_simple_argument'.
8313         (invocation_expression): Support parenthesized invocations with
8314         multiple arguments, and with single non-simple arguments.
8315
8316 2005-01-13  Raja R Harinath  <rharinath@novell.com>
8317
8318         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
8319         places.
8320
8321 2005-01-12  Raja R Harinath  <rharinath@novell.com>
8322
8323         Fix cs0038-1.cs, cs1640-6.cs.
8324         * ecore.cs (Expression.Resolve): Remove special-case for
8325         SimpleName in error-handling.
8326         (Expression.almostMatchedMembers): Relax access permission to
8327         protected.
8328         (Expression.MemberLookupFailed): Handle duplicates in
8329         almostMatchedMembers list.
8330         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
8331         * expression.cs (New.DoResolve): Report CS1540 for more cases.
8332         * typemanager.cs (GetFullNameSignature): Use the MethodBase
8333         overload if the passed in MemberInfo is a MethodBase.
8334
8335 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
8336
8337         Fix #70749
8338         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
8339         for non-CAS & merge permission sets properly.
8340
8341 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8342
8343         Improve standard-compliance of simple name and member access 
8344         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
8345         * ecore.cs (FullNamedExpression): New abstract base class 
8346         for Namespaces and TypeExpressions.
8347         (ResolveFlags.SimpleName): Remove.
8348         (SimpleName): Remove support for dotted names.
8349         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
8350         DeclSpace.FindType and DeclSpace.LookupType.
8351         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
8352         (Expression.ExprClassName): Make member function.
8353         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
8354         a namespace.  Remove creation of dotted "SimpleName"s.
8355         (MemberAccess.DoResolve): Likewise.
8356         * decl.cs (DeclSpace.Cache): Make private.
8357         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
8358         (DeclSpace.FindType): Update.
8359         (DeclSpace.LookupType): Move here from RootContext.  Return a 
8360         FullNamedExpression.
8361         * namespace.cs (Namespace): Derive from FullNamedExpression
8362         so that it can be part of expression resolution.
8363         (Namespace.Lookup): Return an FullNamedExpression.
8364         (NamespaceEntry.LookupAlias): Lookup aliases only in current
8365         namespace.
8366         * rootcontext.cs (NamespaceLookup): Remove.
8367         (LookupType): Move to DeclSpace.
8368         * attribute.cs (CheckAttributeType): Update.
8369         * doc.cs (FindDocumentedType): Remove allowAlias argument.
8370         (FindDocumentedTypeNonArray): Likewise.
8371
8372 2005-01-11  Raja R Harinath  <rharinath@novell.com>
8373
8374         Fix cs0509.cs, cs1632.cs.
8375         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
8376         is the same as IsInterface.
8377         (TypeContainer.GetClassBases): Likewise.
8378         * statement.cs (LabeledStatement.ig): New field.
8379         (LabeledStatement.LabelTarget): Save ILGenerator which created the
8380         label.
8381         (LabeledStatement.DoEmit): Check that the label was created with
8382         the same ILGenerator.
8383
8384 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8385
8386         Fix #71058
8387         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
8388         accessors to its properties.
8389
8390         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
8391         from accessors to property.
8392         
8393 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
8394
8395         Fix #70722
8396         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
8397         only for overrides.
8398         
8399 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
8400
8401         * attribute.cs: Check for null and empty strings.  
8402
8403         I have lost another battle to Paolo.
8404
8405 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
8406
8407         Fix #70942
8408         * class.cs (PropertyMethod): Set Parent field in ctors.
8409         (SetMethod.InternalParameters): Add unsafe switch hack.
8410         Override MarkForDuplicationCheck where it is appropriate.
8411
8412         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
8413         It says whether container allows members with the same name.
8414         Base default is no.
8415         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
8416         Removed is_method parameter.
8417
8418 2005-01-06  Duncan Mak  <duncan@ximian.com>
8419
8420         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
8421         because the previous change led to incorrect reporting of CS1032
8422         ("Cannot define/undefine preprocessor symbols after first token in
8423         file"). Instead of using `tokens_seen' as the only flag that
8424         triggers CS1040, introduce `comments_seen'. This new flag is used
8425         to signify having seen comments on the current line, so it is
8426         unset after a newline.
8427
8428 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8429
8430         * doc.cs : When searching for a type, find nested type too.
8431           This fixes bug #71040.
8432
8433 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
8434
8435         * doc.cs :
8436           - Warn missing member comment on those classes which also does not
8437             have doc comments. Fixed bug #71041.
8438           - Don't warn missing doc comment on default constructor.
8439             Fixed bug #71042.
8440
8441 2005-01-06  Duncan Mak  <duncan@ximian.com>
8442
8443         * cs-tokenizer.cs (xtoken): After handling traditional C-style
8444         comments, set `tokens_seen' to true. This allows us to detect
8445         misplaced preprocessor directives (i.e. not at the beginning of
8446         the a line, nor after whitespaces). In that case, report error
8447         CS1040. This fixes bug #56460.
8448
8449         * cs-parser.jay (interface_member_declaration): Add checks for
8450         IsExplicitImpl, and report CS0541 error if an interface member is
8451         defined as an explicit interface declaration.
8452
8453 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
8454
8455         Fix #70817
8456         * class.cs (PropertyMethod): Set Parent field in ctors.
8457         (SetMethod.InternalParameters): Add unsafe switch hack.
8458         
8459         * decl.cs (MemberCore.Parent): Cannot be readonly.
8460
8461 2005-01-06  Raja R Harinath  <rharinath@novell.com>
8462
8463         * decl.cs (DeclSpace.ResolveType): Remove.
8464         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
8465         Merge in code from ...
8466         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
8467         * class.cs, enum.cs: Update to changes.
8468
8469 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
8470
8471         * anonymous.cs: Ensure that we init the scope of our parent if it
8472         has not been initialized yet.
8473
8474 2004-12-30  Duncan Mak  <duncan@ximian.com>
8475
8476         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
8477         if field.FieldBuilder is null. Fixes #70758.
8478
8479         * convert.cs: Fixed some typos and updated some of the comments.
8480         (ImplicitStandardConversionExists):
8481         (TryImplicitIntConversion): If `target_type' is an interface and
8482         the type of `ic' implements this interface, return true or a new
8483         BoxedCast instead of null. This fixes #70468.
8484
8485 2004-12-29  Duncan Mak  <duncan@ximian.com>
8486
8487         * expression.cs (Argument.Emit): Check that Expr is
8488         IMemoryLocation before casting to it, and report CS1510 otherwise.
8489
8490         This fixes #70402.
8491
8492 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
8493
8494         * statement.cs (Block.ThisVariable): remove the recursion here, to
8495         make the --profile more sane.
8496
8497 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
8498
8499         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
8500         assembly, by JB Evain.
8501
8502 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8503
8504         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
8505           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
8506         "parent" refers to enclosing type/class.  "base" refers to superclass.
8507
8508 2004-12-17  Raja R Harinath  <rharinath@novell.com>
8509
8510         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8511         Ensure that we only have GlobalAttributes.
8512         * attribute.cs (Attribute.Emit): Make non-virtual.
8513         (GlobalAttribute.Emit): Remove.
8514         (Attribute.Resolve): Make virtual.
8515         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
8516         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
8517         the argument. Don't create one.
8518         (Attribute.GetObsoleteAttribute): Likewise.
8519         (Attribute.GetClsCompliantAttributeValue): Likewise.
8520         * class.cs, decl.cs: Update to changes.
8521
8522 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
8523
8524         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
8525         
8526         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
8527         
8528         * statement.cs (Foreach.Resolve): Add error 186 report.
8529
8530 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
8531
8532         * expression.cs (Conditional.DoResolve): Add warning 429.
8533         
8534         * statement.cs (If.Resolve): Add warning 665.
8535
8536 2004-12-16  Raja R Harinath  <rharinath@novell.com>
8537
8538         New invariant: RootContext.Tree.Types.NamespaceEntry == null
8539         except when in the parser, and in GlobalAttribute.
8540         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
8541         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
8542         RootContext.Tree.Types.NamespaceEntry once work is done.
8543         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
8544         and resets RootContext.Tree.Types.NamespaceEntry.
8545
8546 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
8547
8548         * cs-parser.jay: Don't create a block for every variable.
8549
8550 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
8551
8552         * location.cs: Provide extra information.
8553
8554         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
8555         variables from the captured environment, it is the ldarg_0.
8556
8557 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8558
8559         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
8560         find a conclusion.
8561         
8562         * class.cs: Changed warning level for 169 to avoid developer
8563         displeasure from warning flooding. It will be changed back when they
8564         fix most of current BCL warnings.
8565         
8566         * RootContext.cs: Pushed default WarningLevel to 3.
8567         
8568         * statement.cs: Removed unused variable.
8569
8570 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
8571
8572         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
8573         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
8574         Add error 502 report.
8575         (StaticClass.DefineType): Add error 441 report.
8576         (Class.AllowedModifiersProp): New virtual property as temporary
8577         extension to AllowedModifiers.
8578         (Class.DefineType): Add error 418 report. Moved ModFlags check here
8579         to share implementation with StaticClass and don't call virtual
8580         methods from ctor.
8581         
8582         * driver.cs (MainDriver): Add error 1558 test.
8583
8584         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
8585         report. Moved error 36 test here.
8586
8587         * statement.cs (Throw.Resolve): Add error 724 report.
8588
8589         * typemanager.cs: Add out_attribute_type core type.
8590         
8591 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
8592
8593         * class.cs (TypeContainer.VerifyClsCompliance): Add error
8594         3018 report.
8595         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
8596
8597         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
8598         3017 report.
8599         
8600         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
8601
8602         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
8603         Add error 3023 report.
8604         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
8605
8606         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
8607         implementation.
8608
8609 2004-12-12  John Luke  <john.luke@gmail.com>
8610
8611         * driver.cs (AddArgs): take -- into account when
8612         adding arguments, fixes bug 65710 
8613
8614 2004-12-12  Martin Baulig  <martin@ximian.com>
8615
8616         * expression.cs (Unary.TryReduceNegative): Added support for
8617         SByteConstant and ByteConstant.
8618         (Unary.Reduce): Check error values from TryReduceNegative().
8619
8620 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
8621
8622         * attributes.cs (Attribute.Resolve): Avoid multiple error report
8623         and report exception as error 182.
8624
8625 2004-12-10  Raja R Harinath  <rharinath@novell.com>
8626
8627         * driver.cs (Main): Fix message when there are warnings.
8628
8629 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
8630
8631         * delegate.cs: Fixed my fix from yesterday, sorry about that.
8632
8633 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
8634
8635         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
8636         Reduced number of warnings.
8637         
8638         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
8639
8640 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
8641
8642         * driver.cs: Removed message.
8643
8644         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
8645
8646 2004-12-08    <vargaz@freemail.hu>
8647
8648         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
8649
8650 2004-12-08  Martin Baulig  <martin@ximian.com>
8651
8652         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
8653         instead of a CS3002 for properties and indexer.
8654
8655 2004-12-08  Martin Baulig  <martin@ximian.com>
8656
8657         * decl.cs (MemberName.ToString): Make this work again.
8658
8659 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
8660
8661         * attribute.cs (Resolve): Add error 591 detection.
8662
8663         * class.cs (FieldMember.Define): Add error 1547 detection.
8664         (Indexer.Define): Add error 620 detection.
8665         (Operator.Define): Add error 590 detection.
8666
8667         * ecore.cs: Missing argument for error 79.
8668
8669         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
8670         detection.
8671
8672 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
8673
8674         Fix #70106
8675         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
8676         only.
8677
8678 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
8679
8680         * cs-parser.jay : handle doc comments on implicit/explicit operators.
8681           Some operator comments were suppressed.
8682         * doc.cs : Implicit/explicit operator name in doc comments are like
8683           "op_Explicit(type)~returnType", so added suffix handling.
8684
8685 2004-12-07  Martin Baulig  <martin@ximian.com>
8686
8687         * decl.cs
8688         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8689         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8690         (DeclSpace.ec): New protected field; store the EmitContext here.
8691         (DeclSpace.EmitContext): New public property; moved here from
8692         `TypeContainer'.
8693         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8694         EmitContext.
8695
8696         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8697         (Enum.Emit): Don't create a new EmitContext.
8698
8699         * delegate.cs (Delegate.DefineType): Always create the
8700         EmitContext.
8701
8702         * iterators.cs (Iterators.DefineIterator): Create a new
8703         EmitContext and store it in `ec'.
8704
8705 2004-08-24  Martin Baulig  <martin@ximian.com>
8706
8707         * typemanager.cs
8708         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8709         this for accessibility checks.
8710         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8711         IsNestedFamilyAccessible.
8712         (TypeManager.IsSubclassOf): New method, do what the name actually
8713         says.   
8714
8715 2004-12-06  Raja R Harinath  <rharinath@novell.com>
8716
8717         Fix crash on cs0657-17.cs.
8718         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8719         Use RootContext.Tree.Types, not 'new RootTypes ()'.
8720         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
8721         the case where the NamespaceEntry gets overwritten.
8722
8723 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
8724
8725         Fixed #69195, #56821
8726         * ecore.cs (ResolveBoolean): Tiny refactoring.
8727
8728         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
8729         of right expression resolving when left is false constant and
8730         operator is LogicalAnd OR true constant and operator is LogicalOr.
8731
8732         * statement.cs (ResolveUnreachable): Always reports warning.
8733
8734 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
8735
8736         * class.cs: Distinguish between 1721 and 1722 (just a little help
8737         for the programmer).
8738
8739 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
8740
8741         * delegate.cs: Only allow this on new versions of the language. 
8742
8743 2004-12-02  Duncan Mak  <duncan@ximian.com>
8744
8745         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
8746         Expression class.
8747         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
8748         here as a static method. Take an additional bool out parameter
8749         `must_do_cs1540_check' for signaling to InstanceResolve.
8750         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
8751         member field from PropertyExpr class and made it an argument of
8752         the method instead.
8753         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
8754         check for MarshalByRefObject, and report CS0122 instead of CS1540.
8755         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
8756         and `remove_accessor' as well as InstanceResolve: report CS0122
8757         where applicable.
8758
8759         Fixes #70129.
8760
8761 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8762
8763         Fix test-327.cs, test-328.cs, and put in early infrastructure
8764         for eventually fixing #52697.
8765         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
8766         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
8767         from other methods.
8768         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
8769         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
8770         (VerifyUsing, error246): Update.
8771         * rootcontext.cs (RootContext.NamespaceLookup): Just use
8772         'NamespaceEntry.LookupNamespaceOrType'.
8773
8774 2004-12-03  Martin Baulig  <martin@ximian.com>
8775
8776         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8777         method as our child, call AnonymousMethod.Compatible() on it.
8778
8779 2004-12-03  Raja R Harinath  <rharinath@novell.com>
8780
8781         Disable XML documentation support in 'basic' profile.
8782         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
8783         Redirect XmlElement to System.Object.
8784         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
8785         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
8786         * mcs.exe.sources: Add doc-bootstrap.cs.
8787         * doc-bootstrap.cs: New file.  Contains empty stub implementation
8788         of doc.cs.
8789
8790 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
8791
8792         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
8793           comments are allowed.
8794
8795 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8796
8797         * delegate.cs: Add checks for subtypes in paramaters and return values
8798         in VerifyMethod () to add support for Covariance/Contravariance
8799         in delegates.
8800         
8801 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
8802
8803         * report.cs: Remove extra closing parenthesis.
8804
8805         * convert.cs (Error_CannotImplicitConversion): If the name of the
8806         types are the same, provide some extra information.
8807
8808         * class.cs (FieldBase): Use an unused bit field from the field to
8809         encode the `has_offset' property from the FieldMember.  This saves
8810         a couple of Ks on bootstrap compilation.
8811
8812         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
8813         method as our child, return the AnonymousMethod resolved
8814         expression.
8815
8816         * expression.cs (New.DoResolve): Allow return values from
8817         NewDelegate to also include AnonymousMethods.
8818
8819         Fixes #70150.
8820
8821 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
8822
8823         Fix bug #70102
8824         * attribute.cs (Resolve): Improved implementation of params
8825         attribute arguments.
8826
8827         * support.cs (ParameterData): Add HasParams to be faster.
8828
8829 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
8830
8831         all things are for /doc support:
8832
8833         * doc.cs: new file that supports XML documentation generation.
8834         * mcs.exe.sources: added doc.cs.
8835         * driver.cs:
8836           Handle /doc command line option.
8837           Report error 2006 instead of 5 for missing file name for /doc.
8838           Generate XML documentation when required, after type resolution.
8839         * cs-tokenizer.cs:
8840           Added support for picking up documentation (/// and /** ... */),
8841           including a new XmlCommentState enumeration.
8842         * cs-parser.jay:
8843           Added lines to fill Documentation element for field, constant,
8844           property, indexer, method, constructor, destructor, operator, event
8845           and class, struct, interface, delegate, enum.
8846           Added lines to warn incorrect comment.
8847         * rootcontext.cs :
8848           Added Documentation field (passed only when /doc was specified).
8849         * decl.cs:
8850           Added DocComment, DocCommentHeader, GenerateDocComment() and
8851           OnGenerateDocComment() and some supporting private members for
8852           /doc feature to MemberCore.
8853         * class.cs:
8854           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
8855         * delegate.cs:
8856           Added overriden DocCommentHeader.
8857         * enum.cs:
8858           Added overriden DocCommentHeader and GenerateDocComment().
8859
8860 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
8861
8862         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
8863         unwrapping the enumeration values, chain to
8864         DoConstantNumericPromotions again, so we can promote things to the
8865         fundamental types (takes care of enums that are bytes, sbytes).
8866
8867         Fixes bug #62054.
8868
8869 2004-12-01  Raja R Harinath  <rharinath@novell.com>
8870
8871         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
8872         Fix long-standing bug in type-lookup.  Use FindType instead of
8873         LookupType when ec.ResolvingTypeTree.
8874         (Attribute.ResolveType, Attribute.Resolve)
8875         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
8876         Update to changes.
8877         (Attributes.Search): Remove internal version.  Update.
8878         (Attributes.SearchMulti): Update.
8879         (Attributes.GetClsCompliantAttribute): Remove.
8880         (Attributes.GetIndexerNameAttribute): Remove.
8881         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
8882         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
8883         * class.cs (Indexer.Define): Likewise.
8884
8885 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
8886
8887         Fix bug #68790
8888         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
8889         MarshallByReference members access.
8890
8891         * expression.cs: Use CheckMarshallByRefAccess;
8892         Better error CS0197 message.
8893
8894         * report.cs: Print whole related error message.
8895
8896 2004-11-30  Raja R Harinath  <rharinath@novell.com>
8897
8898         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
8899         the current directory to help debugging.
8900
8901 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8902
8903         * class (GetClassBases): Better error 60 report.
8904         (EventProperty): Disabled warning 67 detection.
8905
8906 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8907
8908         Fix bug #60324
8909         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
8910
8911         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
8912         precise values.
8913
8914 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
8915
8916         Fix bug #49488
8917         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
8918
8919         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
8920
8921 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
8922
8923         * attribute.cs (Attribute.Resolve): Refine error reporting and
8924         report a cs0117 if the identifier does not exist, to distinguish
8925         from 0617 which is a miss-use of the actual identifier.
8926
8927         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
8928         between cs0070 and cs0079.
8929
8930         * class.cs (MemberBase.DoDefine): When reporting a wrong
8931         accessibility level, we use MethodCore to compare instead of
8932         Method (this was a regression in some refactoring effort).
8933
8934         So now we correctly report cs0056 again.
8935
8936         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
8937         testing the target_type (which was known to be object_type) and
8938         not the source type (which is anonymous_method).
8939
8940         Fixed reporting of error cs1660.
8941
8942         * expression.cs (UserCast.Source): Expose the underlying cast.
8943
8944         * statement.cs (Switch.SwitchGoverningType): Sort the list of
8945         allowed types to find a match to int32 first (most common).
8946
8947         In addition, it ignores any ImplicitUserConversions that did an
8948         internal implicit conversion (as the switch statement allows only
8949         one integral conversion to exist).
8950
8951         * class.cs (PartialContainer.Create): rename `name' to
8952         `member_name' for clarity.  Then replace the string calls with a
8953         call to MemberName.GetPartialName, as now using
8954         MemberName.ToString is an error (this is due to the side effects
8955         it had, that were fixed in the past).
8956
8957         This will restore the error reporting on a number of partial class
8958         errors that were missusing this (and getting an exception as a
8959         results, which is now just a plain textual warning, because
8960         yyparse debug output would crash otherwise).
8961
8962 2004-11-26  Raja R Harinath  <rharinath@novell.com>
8963
8964         * Makefile (PROGRAM_INSTALL_DIR): Remove.
8965
8966 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8967
8968         * rootcontext.cs (LookupType): Make sure to cache lookups that
8969         don't give us a negative result. This saves about 5% of corlib
8970         compilation time.
8971
8972 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8973
8974         * report.cs (AbstractMessage.Print): messages are sent to stderr
8975
8976         * class.cs (TypeContainer.GetClassBases): It is an error to have a
8977         non-interface in the list of interfaces (at this point, either
8978         parent was properly set, or a base class is being listed in the
8979         interfaces section).
8980
8981         This flags error 1722, and resolves the crash from bug 69259.
8982
8983 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
8984
8985         * statement.cs (Using.EmitExpressionFinally): make this work right
8986         for valuetypes. Fixes 69926.
8987
8988 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
8989
8990         * const.cs (Const.ChangeType): Cope with the "0 literal can be
8991         converted to an enum" here, before we try to change the underlying
8992         type.  This code exists, but it is a different code path than the
8993         one used while encoding constants.
8994
8995         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
8996         old bug: when converting from the null literal to a pointer,
8997         return an EmptyCast, not the NullLiteral.
8998
8999         This fixes #69921, the recent null_type changes probably made this
9000         bug more prominent.
9001
9002         (ImplicitReferenceConversionExists): In addition, resynchronized
9003         the code here, so it matches the same code in
9004         ImplicitReferenceConversionExists for the `from any class-type S
9005         to any interface-type T'.
9006         
9007
9008 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
9009
9010         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
9011
9012 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
9013
9014         * cs-parser.jay: Use verbosity accordingly. 
9015
9016 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9017
9018         * expression.cs (Unary.ResolveOperator): Do not report warning;
9019         AddressOf reads from variable.
9020         
9021         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
9022
9023 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
9024
9025         Fix bug #69462
9026
9027         * attribute.cs (Attributable): Removed CheckTargets.
9028         (Attributes.Emit): Explicit attribute targets are tested here.
9029
9030         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
9031         not enabled for interfaces.
9032
9033         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
9034         (GetAssemblyName): Ouch next bug there.
9035
9036 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
9037
9038         * expression.cs: Error 275 added.
9039         
9040 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
9041
9042         Fix bug #69177 (Implemented decimal constant support)
9043
9044         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
9045         (BinaryFold): Add DecimalConstant.
9046
9047         * const.cs (Define): Decimal constant 
9048         (is not constant.
9049         (ChangeType): Add decimal type handling.
9050         (LookupConstantValue): Don't set value for decimal type but
9051         emit DecimalConstantAttribute. Needed for constant optimization.
9052
9053         * constant.cs (ToDecimal): New method.
9054         (ConvertToDecimal): New method.
9055         (IntConstant): Implemented ConvertToDecimal.
9056         (DecimalConstant.Emit): Emit optimized version for decimals in
9057         int range.
9058
9059         * expression.cs (ResolveOperator): Changed order of constant
9060         reduction to work correctly with native types which have
9061         overloaded operators.
9062         (ResolveMemberAccess): Extract constant value from attribute
9063         for decimal type.
9064
9065         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
9066
9067         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
9068         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
9069         (ChangeType): Decimal is special.
9070         (TypeToCoreType): Add decimal type.
9071
9072 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9073
9074         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
9075         decimal types.
9076
9077 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
9078
9079         * class.cs (EventField.ApplyAttributeBuilder): Fix error
9080         test cs1667-5.cs.
9081
9082 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9083
9084         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
9085
9086         * pending.cs (PendingImplementation): Grab only interfaces.
9087
9088 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
9089
9090         * statement.cs (ForeachHelperMethods): Add location member and
9091         error 202 detection.
9092
9093 2004-11-19  Raja R Harinath  <rharinath@novell.com>
9094
9095         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
9096         automatically handled by executable.make.
9097         (PROGRAM): Make profile-specific.
9098
9099 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
9100
9101         * expression.cs (DoResolveBase): Fixed wrong warning for out
9102         variables.
9103
9104 2004-11-18  Martin Baulig  <martin@ximian.com>
9105
9106         Merged latest changes into gmcs.  Please keep this comment in
9107         here, it makes it easier for me to see what changed in MCS since
9108         the last time I merged.
9109
9110 2004-11-17  Raja R Harinath  <rharinath@novell.com>
9111
9112         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
9113         (TypeHandle.GetMemberCache): New.
9114         (TypeHandle.TypeHandle): Update.
9115         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
9116         (TypeManager.LookupParentInterfacesCache):
9117         Rename from LookupInterfaceCache.  Optimize slightly.
9118         (TypeManager.MemberLookup_FindMembers): Update.
9119         * decl.cs (MemberCache.MemberCache): Set Container to null in the
9120         multi-type variant.
9121         (AddCacheContents): Rename from AddHashtable.
9122         * class.cs (TypeContainer.parent_container): Remove.
9123         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
9124         (TypeContainer.DoDefineMembers): Don't initialize it.
9125         Update to name changes.
9126         
9127 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
9128
9129         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
9130         that factors the code to check access modifiers on override.  
9131
9132         (PropertyBase): Use the code here.
9133
9134         Patch from Lluis S'anchez, fixes bug #69361.
9135
9136 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
9137
9138         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
9139         routine that is used to report the use of a captured variable
9140         whose address has been taken.
9141
9142         There are two checks: one when variables are being captured and
9143         the other check is when the address of a variable is taken. 
9144         
9145         (because an anonymous methods might be resolved before *or* after
9146         the address has been taken) and 
9147
9148         * expression.cs (Conditional.DoResolve): Remove the special
9149         casing that Martin added to trueExpr and falseExpr being both
9150         NullLiteral.  We get the right behavior now just by introducing
9151         the null_type into the compiler. 
9152
9153         * convert.cs (ExplicitConversion): Change the code to use
9154         null_type instead of testing `expr is NullLiteral'.
9155         (ImplicitConversionStandard): use null_type too.
9156         (ImplicitReferenceConversionExists): use null_type too.
9157         (ImplicitReferenceConversion): use null_type too.
9158
9159         * literal.cs: The type of `NullLiteral' is now null_type instead
9160         of object_type. 
9161         (Resolve): Set the type here.
9162
9163         * typemanager.cs: Introduce null_type.
9164
9165 2004-11-17  Martin Baulig  <martin@ximian.com>
9166
9167         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
9168         direction, like FindMembers() does.  Fixes #69546, testcase is in
9169         test-315.cs.    
9170
9171 2004-11-16  Martin Baulig  <martin@ximian.com>
9172
9173         This is based on a patch from Marek Safar, see bug #69082.
9174         Fixes bugs #63705 and #67130.
9175
9176         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
9177         method; create a MemberCache for an interface type and cache the
9178         result.
9179
9180         * decl.cs (IMemberContainer.ParentContainer): Removed.
9181         (IMemberContainer.ParentCache): New property.
9182         (MemberCache.SetupCacheForInterface): Removed.
9183         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
9184         to create a cache for an interface's "parent".
9185
9186         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
9187         interfaces too.
9188
9189 2004-11-16  Martin Baulig  <martin@ximian.com>
9190
9191         Merged back from gmcs; these changes already went into gmcs a
9192         couple of weeks ago.
9193
9194         * typemanager.cs
9195         (TypeManager.AddUserType): Removed the `ifaces' argument.
9196         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
9197         `TypeExpr []'.
9198         (TypeManager.AddUserInterface): Removed.
9199         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
9200         `TypeExpr []'.
9201         (TypeManager.GetInterfaces): Likewise.
9202         (TypeManager.GetExplicitInterfaces): Likewise.
9203
9204         * ecore.cs (TypeExpr.GetInterfaces): Removed.
9205
9206         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
9207         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
9208
9209 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
9210
9211         * statement.cs: Avoid adding bools to a hashtable.
9212
9213 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
9214
9215         * expression.cs (Invocation.OverloadResolve): Flag error if we are
9216         calling an unsafe method from a safe location.
9217
9218 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
9219
9220         Fix #69167
9221         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
9222
9223 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
9224
9225         * namespace.cs (VerifyUsing): use GetPartialName instead of
9226         ToString. 
9227
9228 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
9229
9230         * statement.cs (Return.Resolve): Fix regression in typo: if
9231         `in_exc', we have to request a NeedReturnLabel, this was a typo
9232         introduced in the anonymous method check-in.  Fixes #69131.
9233
9234         * Indexers were using the ShortName when defining themselves,
9235         causing a regression in the compiler bootstrap when applying the
9236         patch from 2004-11-02 (first part), now they use their full name
9237         and the bug is gone.
9238
9239 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
9240
9241         * driver.cs: Strip the path from the names of embedded resources. Fixes
9242         #68519.
9243
9244 2004-11-04  Raja R Harinath  <rharinath@novell.com>
9245
9246         Fix error message regression: cs0104-2.cs.
9247         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
9248         (AliasEntry.Resolve): Update.
9249         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
9250         'silent' flag.
9251         (RootContext.LookupType): Update.
9252
9253 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
9254
9255         * cs-parser.jay: Add support for handling accessor modifiers
9256         * class: Add support port accessor modifiers and error checking,
9257         define PropertyMethod.Define as virtual (not abstract anymore)
9258         * ecore.cs: Add checking for proeprties access with access modifiers
9259         * iterators.cs: Modify Accessor constructor call based in the modified
9260         constructor
9261 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
9262
9263         * expression.cs (StringConcat): Handle being called twice,
9264         as when we have a concat in a field init with more than two
9265         ctors in the class
9266
9267 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
9268
9269         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
9270         special case explicit implementations, we should always produce
9271         the .property or .event declaration.
9272         
9273         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
9274         since it will not return correct data if people use this
9275         unresolved in the presence of using statements (see test-313).
9276
9277         * class.cs (MethodData.Define): If we are an explicit interface
9278         implementation, set the method name to the full name of the
9279         interface plus the name of the method.  
9280
9281         Notice that using the method.MethodName.GetFullName() does not
9282         work, as it will only contain the name as declared on the source
9283         file (it can be a shorthand in the presence of using statements)
9284         and not the fully qualifed type name, for example:
9285
9286         using System;
9287
9288         class D : ICloneable {
9289                 object ICloneable.Clone ()  {
9290                 }
9291         }
9292
9293         Would produce a method called `ICloneable.Clone' instead of
9294         `System.ICloneable.Clone'.
9295
9296         * namespace.cs (Alias.Resolve): Use GetPartialName.
9297         
9298 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9299
9300         * cs-parser.jay: Add error 1055 report.
9301
9302 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
9303
9304         * assign.cs (Assign.DoResolve): Only do the transform of
9305         assignment into a New if the types are compatible, if not, fall
9306         through and let the implicit code deal with the errors and with
9307         the necessary conversions. 
9308
9309 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
9310
9311         * cs-parser.jay: Add error 1031 report.
9312
9313         * cs-tokenizer.cs: Add location for error 1038.
9314
9315 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9316
9317         * cs-parser.jay: Add error 1016 report.
9318
9319 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9320
9321         * cs-parser.jay: Add errors 1575,1611 report.
9322
9323 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9324
9325         * cs-parser.jay: Add error 1001 report.
9326
9327 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9328
9329         Fix #68850
9330         * attribute.cs (GetMarshal): Add method argument for
9331         caller identification.
9332
9333         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
9334         agument for GetMarshal and RuntimeMissingSupport.
9335
9336 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
9337
9338         * attribute.cs (ExtractSecurityPermissionSet): Removed
9339         TypeManager.code_access_permission_type.
9340
9341         * typemanager.cs: Removed TypeManager.code_access_permission_type.
9342
9343 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
9344
9345         * expression.cs (LocalVariableReference.DoResolveLValue): Check
9346         for obsolete use of a variable here.   Fixes regression on errors
9347         cs0619-25 and cs0619-26.
9348
9349 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
9350
9351         Fix #62358, implemented security attribute encoding.
9352
9353         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
9354         Tests permitted SecurityAction for assembly or other types.
9355         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
9356         data from SecurityPermissionAttribute to PermisionSet class.
9357
9358         * class.cs (ApplyAttributeBuilder): Added special handling
9359         for System.Security.Permissions.SecurityAttribute based types.
9360
9361         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
9362         special handling for System.Security.Permissions.SecurityAttribute
9363         based types.
9364
9365         * enum.cs (ApplyAttributeBuilder): Added special handling
9366         for System.Security.Permissions.SecurityAttribute based types.
9367
9368         * parameter.cs (ApplyAttributeBuilder): Added special handling
9369         for System.Security.Permissions.SecurityAttribute based types.
9370
9371         * rootcontext.cs: Next 2 core types.
9372
9373         * typemanager.cs (TypeManager.security_permission_attr_type):
9374         Built in type for the SecurityPermission Attribute.
9375         (code_access_permission_type): Build in type.
9376
9377 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
9378
9379         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
9380         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
9381         all of this information into
9382         EmitContext.EmitCapturedVariableInstance.
9383         
9384         * codegen.cs (EmitCapturedVariableInstance): move here the
9385         funcionality of emitting an ldarg.0 in the presence of a
9386         remapping.   This centralizes the instance emit code.
9387
9388         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
9389         then emit a load of this: it means that we have reached the
9390         topmost ScopeInfo: the one that contains the pointer to the
9391         instance of the class hosting the anonymous method.
9392
9393         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
9394         captures to the topmost CaptureContext.
9395
9396 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
9397
9398         * expression.cs (LocalVariableReference): Move the knowledge about
9399         the iterators into codegen's EmitCapturedVariableInstance.
9400
9401 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
9402
9403         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
9404         all code paths return a value from an anonymous method (it is the
9405         same as the 161 error, but for anonymous methods).
9406
9407 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
9408
9409         The introduction of anonymous methods in the compiler changed
9410         various ways of doing things in the compiler.  The most
9411         significant one is the hard split between the resolution phase
9412         and the emission phases of the compiler.
9413
9414         For instance, routines that referenced local variables no
9415         longer can safely create temporary variables during the
9416         resolution phase: they must do so from the emission phase,
9417         since the variable might have been "captured", hence access to
9418         it can not be done with the local-variable operations from the runtime.
9419         
9420         * statement.cs 
9421
9422         (Block.Flags): New flag `IsTopLevel' to indicate that this block
9423         is a toplevel block.
9424
9425         (ToplevelBlock): A new kind of Block, these are the blocks that
9426         are created by the parser for all toplevel method bodies.  These
9427         include methods, accessors and anonymous methods.
9428
9429         These contain some extra information not found in regular blocks:
9430         A pointer to an optional CaptureContext (for tracking captured
9431         local variables and parameters).  A pointer to the parent
9432         ToplevelBlock.
9433         
9434         (Return.Resolve): Catch missmatches when returning a value from an
9435         anonymous method (error 1662).
9436         Invoke NeedReturnLabel from the Resolve phase instead of the emit
9437         phase.
9438
9439         (Break.Resolve): ditto.
9440
9441         (SwitchLabel): instead of defining the labels during the
9442         resolution phase, we now turned the public ILLabel and ILLabelCode
9443         labels into methods called GetILLabelCode() and GetILLabel() that
9444         only define the label during the Emit phase.
9445
9446         (GotoCase): Track the SwitchLabel instead of the computed label
9447         (its contained therein).  Emit the code by using
9448         SwitchLabel.GetILLabelCode ().
9449
9450         (LocalInfo.Flags.Captured): A new flag has been introduce to track
9451         whether the Local has been captured or not.
9452
9453         (LocalInfo.IsCaptured): New property, used to tell whether the
9454         local has been captured.
9455         
9456         * anonymous.cs: Vastly updated to contain the anonymous method
9457         support.
9458
9459         The main classes here are: CaptureContext which tracks any
9460         captured information for a toplevel block and ScopeInfo used to
9461         track the activation frames for various local variables.   
9462
9463         Each toplevel block has an optional capture context associated
9464         with it.  When a method contains an anonymous method both the
9465         toplevel method and the anonymous method will create a capture
9466         context.   When variables or parameters are captured, they are
9467         recorded on the CaptureContext that owns them, for example:
9468
9469         void Demo () {
9470              int a;
9471              MyDelegate d = delegate {
9472                  a = 1;
9473              }
9474         }
9475
9476         Here `a' will be recorded as captured on the toplevel
9477         CapturedContext, the inner captured context will not have anything
9478         (it will only have data if local variables or parameters from it
9479         are captured in a nested anonymous method.
9480
9481         The ScopeInfo is used to track the activation frames for local
9482         variables, for example:
9483
9484         for (int i = 0; i < 10; i++)
9485                 for (int j = 0; j < 10; j++){
9486                    MyDelegate d = delegate {
9487                         call (i, j);
9488                    }
9489                 }
9490
9491         At runtime this captures a single captured variable `i', but it
9492         captures 10 different versions of the variable `j'.  The variable
9493         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
9494         recorded on a child.  
9495
9496         The toplevel ScopeInfo will also track information like the `this'
9497         pointer if instance variables were referenced (this is necessary
9498         as the anonymous method lives inside a nested class in the host
9499         type of the method). 
9500
9501         (AnonymousMethod): Expanded to track the Toplevel, implement
9502         `AnonymousMethod.Compatible' to tell whether an anonymous method
9503         can be converted to a target delegate type. 
9504
9505         The routine now also produces the anonymous method content
9506
9507         (AnonymousDelegate): A helper class that derives from
9508         DelegateCreation, this is used to generate the code necessary to
9509         produce the delegate for the anonymous method that was created. 
9510
9511         * assign.cs: API adjustments for new changes in
9512         Convert.ImplicitStandardConversionExists.
9513
9514         * class.cs: Adjustments to cope with the fact that now toplevel
9515         blocks are of type `ToplevelBlock'. 
9516
9517         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
9518         insteda of standard blocks.
9519
9520         Flag errors if params arguments are passed to anonymous methods.
9521
9522         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
9523         `CurrentAnonymousMethod' which points to the current Anonymous
9524         Method.  The variable points to the AnonymousMethod class that
9525         holds the code being compiled.  It is set in the new EmitContext
9526         created for the anonymous method.
9527
9528         (EmitContext.Phase): Introduce a variable and an enumeration to
9529         assist in enforcing some rules about when and where we are allowed
9530         to invoke certain methods (EmitContext.NeedsReturnLabel is the
9531         only one that enfonces this right now).
9532
9533         (EmitContext.HaveCaptureInfo): new helper method that returns
9534         whether we have a CapturedContext initialized.
9535
9536         (EmitContext.CaptureVariable): New method used to register that a
9537         LocalInfo must be flagged for capturing. 
9538
9539         (EmitContext.CapturedParameter): New method used to register that a
9540         parameters must be flagged for capturing. 
9541         
9542         (EmitContext.CapturedField): New method used to register that a
9543         field must be flagged for capturing. 
9544
9545         (EmitContext.HaveCapturedVariables,
9546         EmitContext.HaveCapturedFields): Return whether there are captured
9547         variables or fields. 
9548
9549         (EmitContext.EmitMethodHostInstance): This is used to emit the
9550         instance for the anonymous method.  The instance might be null
9551         (static methods), this (for anonymous methods that capture nothing
9552         and happen to live side-by-side with the current method body) or a
9553         more complicated expression if the method has a CaptureContext.
9554
9555         (EmitContext.EmitTopBlock): Routine that drives the emission of
9556         code: it will first resolve the top block, then emit any metadata
9557         and then emit the code.  The split is done so that we can extract
9558         any anonymous methods and flag any captured variables/parameters.
9559         
9560         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
9561         during this phase, the ILGenerator should not be used as labels
9562         and local variables declared here might not be accessible to any
9563         code that is part of an anonymous method.  
9564
9565         Exceptions to this include the temporary variables that are
9566         created by some statements internally for holding temporary
9567         variables. 
9568         
9569         (EmitContext.EmitMeta): New routine, in charge of emitting all the
9570         metadata for a cb
9571
9572         (EmitContext.TemporaryReturn): This method is typically called
9573         from the Emit phase, and its the only place where we allow the
9574         ReturnLabel to be defined other than the EmitMeta.  The reason is
9575         that otherwise we would have to duplicate a lot of logic in the
9576         Resolve phases of various methods that today is on the Emit
9577         phase. 
9578
9579         (EmitContext.NeedReturnLabel): This no longer creates the label,
9580         as the ILGenerator is not valid during the resolve phase.
9581
9582         (EmitContext.EmitThis): Extended the knowledge in this class to
9583         work in anonymous methods in addition to iterators. 
9584
9585         (EmitContext.EmitCapturedVariableInstance): This emits whatever
9586         code is necessary on the stack to access the instance to a local
9587         variable (the variable will be accessed as a field).
9588
9589         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
9590         EmitContext.EmitAddressOfParameter): Routines to support
9591         parameters (not completed at this point). 
9592         
9593         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
9594         will also remove the parameters.
9595
9596         * convert.cs (Convert): Define a `ConstantEC' which points to a
9597         null.  This is just to prefity some code that uses
9598         ImplicitStandardConversion code and do not have an EmitContext
9599         handy.
9600
9601         The idea is to flag explicitly that at that point in time, it is
9602         known that the conversion will not trigger the delegate checking
9603         code in implicit conversions (which requires a valid
9604         EmitContext). 
9605
9606         Everywhere: pass new EmitContext parameter since
9607         ImplicitStandardConversionExists now requires it to check for
9608         anonymous method conversions. 
9609
9610         (Convert.ImplicitStandardConversionExists): If the type of an
9611         expression is the anonymous_method_type, and the type is a
9612         delegate, we invoke the AnonymousMethod.Compatible method to check
9613         whether an implicit conversion is possible. 
9614
9615         (Convert.ImplicitConversionStandard): Only do implicit method
9616         group conversions if the language level is not ISO_1.
9617
9618         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
9619         MethodInfo for the Invoke method.  used by Delegate and
9620         AnonymousDelegate.
9621
9622         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
9623         method conversions if the target type is a delegate.
9624
9625         Removed extra debugging nops.
9626
9627         (LocalVariableReference): Turn the `local_info' into a public
9628         field. 
9629
9630         Add `prepared' field, the same hack used for FieldExprs to cope
9631         with composed assignments, as Local variables do not necessarily
9632         operate purely on the stack as they used to: they can be captured
9633         fields. 
9634
9635         Add `temp' for a temporary result, like fields.
9636
9637         Refactor DoResolve and DoResolveLValue into DoResolveBase.
9638
9639         It now copes with Local variables that are captured and emits the
9640         proper instance variable to load it from a field in the captured
9641         case. 
9642
9643         (ParameterReference.DoResolveBase): During the resolve phase,
9644         capture parameters if we are in an anonymous method.
9645
9646         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
9647         anonymous method, use the EmitContext helper routines to emit the
9648         parameter reference.
9649
9650         * iterators.cs: Set RemapToProxy to true/false during the
9651         EmitDispose class.
9652
9653         * parameters.cs (GetParameterByName): New helper method. 
9654
9655         * typemanager.cs (anonymous_method_type) a new type that
9656         represents an anonyous method.  This is always an internal type,
9657         used as a fencepost to test against the anonymous-methodness of an
9658         expression. 
9659         
9660 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
9661
9662         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
9663         561 report.
9664         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
9665
9666 2004-10-18  Martin Baulig  <martin@ximian.com>
9667
9668         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
9669         `Type' directly, but call ResolveType() on it.
9670         (Catch.Resolve): Likewise.
9671         (Foreach.Resolve): Likewise.
9672
9673 2004-10-18  Martin Baulig  <martin@ximian.com>
9674
9675         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
9676         `Type' directly, but call ResolveType() on it.
9677         (Probe.DoResolve): Likewise.
9678         (ArrayCreation.LookupType): Likewise.
9679         (TypeOf.DoResolve): Likewise.
9680         (SizeOf.DoResolve): Likewise.
9681
9682 2004-10-18  Martin Baulig  <martin@ximian.com>
9683
9684         * expression.cs (Invocation.BetterFunction): Put back
9685         TypeManager.TypeToCoreType().
9686
9687 2004-10-18  Raja R Harinath  <rharinath@novell.com>
9688
9689         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
9690         the ResolveType.
9691
9692 2004-10-18  Martin Baulig  <martin@ximian.com>
9693
9694         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
9695         `Type' directly, but call ResolveType() on it.
9696
9697 2004-10-18  Martin Baulig  <martin@ximian.com>
9698
9699         * class.cs (FieldMember.Define): Don't access the TypeExpr's
9700         `Type' directly, but call ResolveType() on it.
9701         (MemberBase.DoDefine): Likewise.
9702
9703         * expression.cs (New.DoResolve): Don't access the TypeExpr's
9704         `Type' directly, but call ResolveType() on it.
9705         (ComposedCast.DoResolveAsTypeStep): Likewise.
9706
9707         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
9708         `Type' directly, but call ResolveType() on it.
9709
9710 2004-10-17  John Luke  <john.luke@gmail.com>
9711
9712         * class.cs (Operator.GetSignatureForError): use CSharpName
9713
9714         * parameter.cs (Parameter.GetSignatureForError): Returns
9715         correct name even if was not defined.
9716
9717 2004-10-13  Raja R Harinath  <rharinath@novell.com>
9718
9719         Fix #65816.
9720         * class.cs (TypeContainer.EmitContext): New property.
9721         (DefineNestedTypes): Create an emitcontext for each part.
9722         (MethodCore.DoDefineParameters): Use container's emitcontext.
9723         Pass type array to InternalParameters.
9724         (MemberBase.DoDefine): Use container's emitcontext.
9725         (FieldMember.Define): Likewise.
9726         (Event.Define): Likewise.
9727         (SetMethod.GetParameterInfo): Change argument to EmitContext.
9728         Pass type array to InternalParameters.
9729         (SetIndexerMethod.GetParameterInfo): Likewise.
9730         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
9731         * delegate.cs (Define): Pass emitcontext to
9732         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
9733         array to InternalParameters.
9734         * expression.cs (ParameterReference.DoResolveBase): Pass
9735         emitcontext to GetParameterInfo.
9736         (ComposedCast.DoResolveAsTypeStep): Remove check on
9737         ec.ResolvingTypeTree.
9738         * parameter.cs (Parameter.Resolve): Change argument to
9739         EmitContext.  Use ResolveAsTypeTerminal.
9740         (Parameter.GetSignature): Change argument to EmitContext.
9741         (Parameters.ComputeSignature): Likewise.
9742         (Parameters.ComputeParameterTypes): Likewise.
9743         (Parameters.GetParameterInfo): Likewise.
9744         (Parameters.ComputeAndDefineParameterTypes): Likewise.
9745         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
9746         * support.cs (InternalParameters..ctor): Remove variant that takes
9747         a DeclSpace.
9748         * typemanager.cs (system_intptr_expr): New.
9749         (InitExpressionTypes): Initialize it.
9750
9751 2004-10-12  Chris Toshok  <toshok@ximian.com>
9752
9753         * cs-parser.jay: fix location for try_statement and catch_clause.
9754
9755 2004-10-11  Martin Baulig  <martin@ximian.com>
9756
9757         * report.cs: Don't make --fatal abort on warnings, we have
9758         -warnaserror for that.
9759
9760 2004-10-07  Raja R Harinath  <rharinath@novell.com>
9761
9762         More DeclSpace.ResolveType avoidance.
9763         * decl.cs (MemberCore.InUnsafe): New property.
9764         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
9765         with newly created EmitContext.
9766         (FieldMember.Define): Likewise.
9767         * delegate.cs (Delegate.Define): Likewise.
9768         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
9769         only if normal name-lookup fails.
9770         (TypeExpr.DoResolve): Enable error-checking.
9771         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
9772         (SizeOf.DoResolve): Likewise.
9773         (ComposedCast.DoResolveAsTypeStep): Likewise.
9774         (StackAlloc.DoResolve): Likewise.
9775         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
9776         (Block.Unsafe): New property.
9777         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
9778         (Unsafe): Set 'unsafe' flag of contained block.
9779         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
9780         (Fixed.Resolve): Likewise.
9781         (Catch.Resolve): Likewise.
9782         (Using.ResolveLocalVariableDecls): Likewise.
9783         (Foreach.Resolve): Likewise.
9784
9785 2004-10-05  John Luke <john.luke@gmail.com>
9786
9787         * cs-parser.jay: add location to error CS0175
9788
9789 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
9790
9791         * ecore.cs (Expression.Constantity): Add support for turning null
9792         into a constant.
9793
9794         * const.cs (Const.Define): Allow constants to be reference types
9795         as long as the value is Null.
9796
9797 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
9798
9799         * namespace.cs (NamespaceEntry.Using): No matter which warning
9800         level is set, check if this namespace name has already been added.
9801
9802 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
9803
9804         * expression.cs: reftype [!=]= null should always use br[true,false].
9805         # 67410
9806
9807 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
9808
9809         Fix #67108
9810         * attribute.cs: Enum conversion moved to 
9811         GetAttributeArgumentExpression to be applied to the all
9812         expressions.
9813
9814 2004-10-01  Raja R Harinath  <rharinath@novell.com>
9815
9816         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
9817         * class.c (TypeContainer.DefineType): Flag error if
9818         base types aren't accessible due to access permissions.
9819         * decl.cs (DeclSpace.ResolveType): Move logic to
9820         Expression.ResolveAsTypeTerminal.
9821         (DeclSpace.ResolveTypeExpr): Thin layer over
9822         Expression.ResolveAsTypeTerminal.
9823         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
9824         Refactor code into NestedAccess.  Use it.
9825         (DeclSpace.NestedAccess): New.
9826         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
9827         argument to silence errors.  Check access permissions.
9828         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
9829         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
9830         (Cast.DoResolve): Likewise.
9831         (New.DoResolve): Likewise.
9832         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
9833         (TypeOf.DoResolve): Likewise.
9834
9835         * expression.cs (Invocation.BetterConversion): Return the Type of
9836         the better conversion.  Implement section 14.4.2.3 more faithfully.
9837         (Invocation.BetterFunction): Make boolean.  Make correspondence to
9838         section 14.4.2.2 explicit.
9839         (Invocation.OverloadResolve): Update.
9840         (Invocation): Remove is_base field.
9841         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
9842         (Invocation.Emit): Likewise.
9843
9844 2004-09-27  Raja R Harinath  <rharinath@novell.com>
9845
9846         * README: Update to changes.
9847
9848 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
9849
9850         * cs-parser.jay: Reverted 642 warning fix.
9851
9852 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9853
9854         Fix bug #66615
9855         * decl.cs (FindMemberWithSameName): Indexer can have more than
9856         1 argument.
9857
9858 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9859
9860         * expression.cs (LocalVariableReference.DoResolveLValue):
9861         Do not report warning 219 for out values.
9862         (EmptyExpression.Null): New member to avoid extra allocations.
9863
9864 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9865
9866         * cs-parser.jay: Fix wrong warning 642 report.
9867
9868         * cs-tokenizer.cs (CheckNextToken): New helper;
9869         Inspect next character if is same as expected.
9870
9871 2004-09-23  Martin Baulig  <martin@ximian.com>
9872
9873         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
9874         (Convert.ImplicitReferenceConversionExists): Likewise.
9875
9876 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
9877
9878         * class.cs (Operator.Define): Add error 448 and 559 report.
9879
9880 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9881
9882         * class.cs (MemberBase.IsTypePermitted): New protected
9883         method for checking error CS0610.
9884
9885 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9886
9887         * class.cs (TypeContainer.HasExplicitLayout): New property
9888         Returns whether container has StructLayout attribute set Explicit.
9889         (FieldMember): New abstract class for consts and fields.
9890         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
9891         (Field): Reuse FieldMember.
9892
9893         * const.cs (Const): Reuse FieldMember.
9894
9895         * rootcontext.cs: EmitConstants call moved to class.
9896
9897 2004-09-22  Martin Baulig  <martin@ximian.com>
9898
9899         Thanks to Peter Sestoft for this bug report.
9900
9901         * expression.cs (Conditional): If both the `trueExpr' and the
9902         `falseExpr' is a NullLiteral, return a NullLiteral.
9903
9904 2004-09-22  Martin Baulig  <martin@ximian.com>
9905
9906         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
9907         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
9908         for the "get_Current" call.
9909
9910 2004-09-22  Martin Baulig  <martin@ximian.com>
9911
9912         Marek and me just fixed one of our oldest bugs: #28562 :-)
9913
9914         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
9915
9916         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
9917         we're an EnumConstant, just return that.
9918         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
9919         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
9920         to get the value which'll actually be written into the attribute.
9921         However, we have to use GetValue() to access the attribute's value
9922         in the compiler.        
9923
9924 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
9925
9926         * constant.cs (Constant.IsNegative): New abstract property
9927         IsNegative.
9928
9929         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
9930         (StackAlloc.DoResolve): Reused IsNegative.
9931
9932 2004-09-21  Martin Baulig  <martin@ximian.com>
9933
9934         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
9935         if we're used in an iterator, we may be called from different
9936         methods.
9937
9938         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
9939         we actually have an exception block.
9940
9941 2004-09-20  John Luke <jluke@cfl.rr.com>
9942
9943         * class.cs, cs-parser.jay: Improve the error report for 1520:
9944         report the actual line where the error happens, not where the
9945         class was declared.
9946
9947         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
9948         Pass location information that was available elsewhere.
9949
9950 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
9951
9952         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
9953         runtime to delay sign assemblies.
9954
9955 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9956
9957         * cs-parser.jay: Do not report the stack trace, this is barely
9958         used nowadays.
9959
9960 2004-08-22  John Luke  <john.luke@gmail.com>
9961  
9962         * driver.cs : check that a resource id is not already used
9963         before adding it, report CS1508 if it is, bug #63637
9964
9965 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
9966
9967         * ecore.cs: Removed dead code.
9968
9969 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
9970
9971         * class.cs: Do not report warning CS0067 on the interfaces.
9972
9973 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9974
9975         * cs-parser.jay: Add error 504 report.
9976
9977 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9978
9979         * rootcontext.cs: WarningLevel is 4 by default now.
9980
9981         * statement.cs (Fixed.Resolve): Do not null
9982         VariableInfo.
9983
9984 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
9985
9986         Fixed bug #55780
9987         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
9988         deep search when property is not virtual.
9989         (PropertyExpr.ResolveAccessors): Make one call for both
9990         accessors.
9991
9992 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9993
9994         Fixed bug #65766
9995         * statement.cs: Error 152 report constains also location.
9996
9997 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
9998
9999         Fixed bug #65766
10000         * const.cs: Explicitly set constant as static.
10001
10002 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10003
10004         Fixed bug #64226
10005         * cs-parser.jay: Add error 1017 report.
10006
10007 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
10008
10009         Fixed bug #59980, #64224
10010         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
10011
10012         * typemanager.cs (IsSpecialMethod): Simplified
10013
10014 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10015
10016         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
10017         condition with better params.
10018
10019 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10020
10021         Fixed bug #65238
10022         * attribute.cs (Resolve): Property has to have both
10023         accessors.
10024
10025 2004-09-14  Martin Baulig  <martin@ximian.com>
10026
10027         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
10028
10029 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
10030
10031         Fixed bug #61902
10032         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
10033         called and is obsolete then this member suppress message
10034         when call is inside next [Obsolete] method or type.
10035
10036         * expression.cs: Use TestObsoleteMethodUsage member.
10037
10038 2004-09-14  Martin Baulig  <martin@ximian.com>
10039
10040         * cs-parser.jay: Sync a bit with the GMCS version.
10041
10042 2004-09-14  Martin Baulig  <martin@ximian.com>
10043
10044         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
10045         (CSharpParser.yacc_verbose_flag): New public field.
10046
10047         * genericparser.cs: Removed.
10048
10049 2004-09-14  Raja R Harinath  <rharinath@novell.com>
10050
10051         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
10052
10053 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
10054
10055         * class.cs (MethodCore.CheckBase): Fix bug #65757.
10056
10057 2004-09-10  Martin Baulig  <martin@ximian.com>
10058
10059         Backported my MemberName changes from GMCS into MCS.
10060
10061         - we are now using a special `MemberName' class instead of using
10062         strings; in GMCS, the `MemberName' also contains the type
10063         arguments.
10064
10065         - changed the grammar rules a bit:
10066           * the old `member_name' is now a `namespace_or_type_name':
10067             The rule is that we use `namespace_or_type_name' everywhere
10068             where we expect either a "member name" (GetEnumerator) or a
10069             "member name" with an explicit interface name
10070             (IEnumerable.GetEnumerator).
10071             In GMCS, the explicit interface name may include type arguments
10072             (IEnumerable<T>.GetEnumerator).
10073           * we use `member_name' instead of just `IDENTIFIER' for
10074             "member names":
10075             The rule is that we use `member_name' wherever a member may
10076             have type parameters in GMCS.       
10077
10078         * decl.cs (MemberName): New public class.
10079         (MemberCore.MemberName): New public readonly field.
10080         (MemberCore.ctor): Take a `MemberName' argument, not a string.
10081         (DeclSpace): Likewise.
10082
10083         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
10084         * enum.cs (Enum.ctor): Likewise.
10085
10086         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
10087         MemberName.     
10088         (AliasEntry.ctor): Take a MemberName, not an Expression.
10089         (AliasEntry.UsingAlias): Likewise.
10090
10091         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
10092         (IMethodData.MemberName): Changed type from string to MemberName.
10093         (MemberBase.ExplicitInterfaceName): Likewise.
10094         (AbstractPropertyEventMethod.SetupName): Make this private.
10095         (AbstractPropertyEventMethod.ctor): Added `string prefix'
10096         argument; compute the member name here.
10097         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
10098         on the `member.MemberName' and the `prefix'.
10099
10100         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
10101         not `type_name'.
10102         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
10103         thus, we get a `MemberName' instead of a `string'.  These
10104         declarations may have type parameters in GMCS.
10105         (interface_method_declaration, delegate_declaration): Likewise.
10106         (class_declaration, interface_declaration): Likewise.
10107         (method_header): Use `namespace_or_type_name' instead of
10108         `member_name'.  We may be an explicit interface implementation.
10109         (property_declaration, event_declaration): Likewise.
10110         (member_name): This is now just an `IDENTIFIER', not a
10111         `namespace_or_type_name'.
10112         (type_name, interface_type): Removed.
10113         (namespace_or_type_name): Return a MemberName, not an Expression.
10114         (primary_expression): Use `member_name' instead of `IDENTIFIER';
10115         call GetTypeExpression() on the MemberName to get an expression.
10116         (IndexerDeclaration.interface_type): Changed type from string to
10117         MemberName.
10118         (MakeName): Operate on MemberName's instead of string's.
10119
10120 2004-09-13  Raja R Harinath  <rharinath@novell.com>
10121
10122         Fix bug #55770.
10123         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
10124         (NamespaceEntry.Lookup): Add new argument to flag if we want the
10125         lookup to avoid symbols introduced by 'using'.
10126         * rootcontext.cs (NamespaceLookup): Update.
10127
10128 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10129
10130         * class.cs (TypeContainer.DoDefineMembers): Do not call
10131         DefineDefaultConstructor for static classes.
10132
10133 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
10134
10135         * attribute.cs (Attribute.Resolve): Add error 653 report.
10136
10137         * class.cs (Class.ApplyAttributeBuilder): Add error 641
10138         report.
10139         (Method.ApplyAttributeBuilder): Add error 685 report.
10140         (Operator.Define): Add error 564 report.
10141
10142         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
10143
10144         * expression.cs (Invocation.DoResolve): Add error
10145         245 and 250 report.
10146
10147         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
10148         error 674 report.
10149
10150 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10151
10152         * class.cs (ConstructorInitializer.Resolve):
10153         Wrong error number (515->516).
10154
10155 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10156
10157         * class.cs (Indexer.Define): Add error 631 report.
10158
10159 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10160
10161         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
10162
10163 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
10164
10165         * expression.cs (Probe.DoResolve): Add error CS0241 report.
10166
10167 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
10168
10169         * cs-parser.jay: Added error CS0241 report.
10170
10171 2004-09-10  Raja R Harinath  <rharinath@novell.com>
10172
10173         * cs-parser.jay (fixed_statement): Introduce a scope for the
10174         declaration in the 'fixed' statement.
10175
10176 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10177
10178         * cs-parser.jay: Added CS0230 error report.
10179
10180 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10181
10182         * cs-parser.jay: Added errors CS0231 and CS0257 report.
10183
10184 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10185
10186         * expression.cs (Argument.Resolve): Added error CS0192 and
10187         CS0199 report.
10188
10189 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
10190
10191         C# 2.0 #pragma warning feature
10192
10193         * cs-tokenizer.cs (PreProcessPragma): New method; 
10194         Handles #pragma directive.
10195
10196         * report.cs (WarningRegions): New class; Support
10197         class for #pragma warning directive. It tests whether
10198         warning is enabled for a given line.
10199
10200 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
10201
10202         * const.cs: Add more descriptive error report, tahnks to
10203         Sebastien. 
10204
10205 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
10206
10207         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
10208
10209 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
10210
10211         * expression.cs: Apply patch from Ben: Remove dead code from
10212         ArrayCreation, and remove the TurnintoConstant call in const.cs,
10213         as that code just threw an exception anwyays.
10214
10215         * const.cs: Remove the call to the turnintoconstant, for details
10216         see bug: #63144
10217         
10218         * literal.cs: The type of the null-literal is the null type;  So
10219         we use a placeholder type (literal.cs:System.Null, defined here)
10220         for it.
10221
10222         * expression.cs (Conditional.DoResolve): Remove some old code that
10223         is no longer needed, conversions have been fixed.
10224
10225         (ArrayCreationExpression.DoResolve): Return false if we fail to
10226         resolve the inner expression.
10227
10228 2004-09-07  Raja R Harinath  <rharinath@novell.com>
10229
10230         Fix test-290.cs.
10231         * cs-parser.jay (delegate_declaration): Record a delegate
10232         declaration as a type declaration.
10233         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
10234
10235 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
10236
10237         * parameter.cs: Do not crash if the type can not be resolved. 
10238
10239         * expression.cs: Report errors with unsafe pointers, fixes #64896
10240
10241 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10242
10243         * expression.cs: Pointer arith always needs to do a conv.i
10244         if the operand is a long. fix 65320
10245
10246 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10247
10248         Fixed cs0619-37.cs, cs0619-38.cs
10249
10250         * enum.cs (GetObsoleteAttribute): Removed.
10251
10252         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
10253         on Enum member is double staged. The first is tested member
10254         and then enum.
10255
10256 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
10257
10258         Fixed #56986, #63631, #65231
10259
10260         * class.cs: (TypeContainer.AddToMemberContainer): New method,
10261         adds member to name container.
10262         (TypeContainer.AddToTypeContainer): New method, adds type to
10263         name container.
10264         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
10265         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
10266         AddOperator): Simplified by reusing AddToMemberContainer.
10267         (TypeContainer.UserDefinedStaticConstructor): Changed to property
10268         instead of field.
10269         (Method.CheckForDuplications): Fixed implementation to test all
10270         possibilities.
10271         (MemberBase): Detection whether member is explicit interface
10272         implementation is now in constructor.
10273         (MemberBase.UpdateMemberName): Handles IndexerName.
10274         (Accessor): Changed to keep also location information.
10275         (AbstractPropertyEventMethod): Is derived from MemberCore.
10276         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
10277         will be emited or not.
10278         (PropertyBase.AreAccessorsDuplicateImplementation):
10279         Tests whether accessors are not in collision with some method.
10280         (Operator): Is derived from MethodCore to simplify common
10281         operations.
10282
10283         * decl.cs (Flags.TestMethodDuplication): Test for duplication
10284         must be performed.
10285         (DeclSpace.AddToContainer): Adds the member to defined_names
10286         table. It tests for duplications and enclosing name conflicts.
10287
10288         * enum.cs (EnumMember): Clean up to reuse the base structures
10289
10290 2004-09-03  Martin Baulig  <martin@ximian.com>
10291
10292         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
10293         into TypeContainer, to make partial classes work again.
10294
10295 2004-09-03  Martin Baulig  <martin@ximian.com>
10296
10297         * rootcontext.cs (RootContext.V2): Removed.
10298
10299 2004-03-23  Martin Baulig  <martin@ximian.com>
10300
10301         * expression.cs (Invocation.OverloadResolve): Added `bool
10302         may_fail' argument and use it instead of the Location.IsNull() hack.
10303
10304 2004-09-03  Martin Baulig  <martin@ximian.com>
10305
10306         Merged latest changes into gmcs.  Please keep this comment in
10307         here, it makes it easier for me to see what changed in MCS since
10308         the last time I merged.
10309
10310 2004-09-03  Raja R Harinath  <rharinath@novell.com>
10311
10312         Fix #61128.
10313         * expression.cs (BetterConversion): Don't allow either conversion 
10314         to be null.  Remove redundant implicit conversion test when 'q ==
10315         null' -- when this function is invoked, we already know that the
10316         implicit conversion exists.
10317         (BetterFunction): Assume that 'best' is non-null.  Remove
10318         redundant reimplementation of IsApplicable when 'best' is null.
10319         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
10320         number of arguments.
10321         (IsAncestralType): Extract from OverloadResolve.
10322         (OverloadResolve): Make robust to the MethodGroupExpr being
10323         unsorted.  Implement all the logic of Section 14.5.5.1, and
10324         support overloading of methods from multiple applicable types.
10325         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
10326
10327         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
10328         (RealError, Warning): Append type of report to related symbol.
10329
10330 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
10331
10332         * enum.cs: Fixed CLS-Compliance checks for enum members.
10333         Error tests cs3008-8.cs, cs3014-8.cs
10334
10335 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10336
10337         Fixed bug #62342, #63102
10338         * class.cs: ImplementIndexer uses member.IsExplicitImpl
10339         like ImplementMethod.
10340
10341 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
10342
10343         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10344         Fixed bug #65170.
10345
10346 2004-09-02  Martin Baulig  <martin@ximian.com>
10347
10348         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
10349         TypeManager.GetArgumentTypes() rather than calling GetParameters()
10350         on the MethodBase.
10351
10352 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
10353
10354         C# 2.0 Static classes implemented
10355
10356         * class.cs (TypeContainer): instance_constructors,
10357         initialized_fields, initialized_static_fields,
10358         default_constructor, base_inteface_types are protected to be
10359         accessible from StaticClass.
10360         (TypeContainer.DefineDefaultConstructor): New virtual method
10361         for custom default constructor generating
10362         (StaticClass): New class to handle "Static classes" feature.
10363
10364         * cs-parser.jay: Handle static keyword on class like instance
10365         of StaticClass.
10366
10367         * driver.cs: Added "/langversion" command line switch with two
10368         options (iso-1, default).
10369
10370 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
10371
10372         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
10373
10374 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * delegate.cs: Style.
10377
10378 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10379
10380         * delegate.cs: Add seperate instance expr field for miguel.
10381
10382 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10383
10384         * PointerArithmetic (Resolve): make sure we are not doing
10385         pointer arith on void*. Also, make sure we are resolved
10386         by not setting eclass until resolve.
10387
10388         All callers: Make sure that PointerArithmetic gets resolved.
10389
10390 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10391
10392         * ArrayCreation (LookupType): If the type does not resolve 
10393         to an array, give an error.
10394
10395 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
10396
10397         * statement.cs (Try.Resolve): Fixed bug #64222
10398
10399 2004-08-27  Martin Baulig  <martin@ximian.com>
10400
10401         * class.cs
10402         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
10403         crash here.     
10404
10405 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10406
10407         * ecore.cs (Constantify): Get underlying type via
10408         System.Enum.GetUnderlyingType to avoid StackOverflow on the
10409         Windows in special cases.
10410
10411 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
10412
10413         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
10414         for obtaining also private methods.
10415         (GetRemoveMethod): Used GetRemoveMethod (true)
10416         for obtaining also private methods.
10417
10418 2004-08-24  Martin Baulig  <martin@ximian.com>
10419
10420         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
10421         MethodAttributes.HideBySig for operators.
10422
10423 2004-08-23  Martin Baulig  <martin@ximian.com>
10424
10425         Back to the old error reporting system :-)
10426
10427         * report.cs (Message): Removed.
10428         (Report.MessageData, ErrorData, WarningData): Removed.
10429         (Report.Error, Warning): Back to the old system.
10430
10431 2004-08-23  Martin Baulig  <martin@ximian.com>
10432
10433         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
10434
10435         * class.cs (TypeContainer.ParentContainer): New public virtual
10436         method; replaces the explicit interface implementation.
10437         (ClassPart.ParentContainer): Override.
10438
10439 2004-08-23  Martin Baulig  <martin@ximian.com>
10440
10441         * statement.cs (Switch): Added support for constant switches; see
10442         #59428 or test-285.cs.
10443
10444 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10445
10446         Fixed bug #62740.
10447         * statement.cs (GetEnumeratorFilter): Removed useless
10448         logic because C# specs is strict. GetEnumerator must be
10449         public.
10450
10451 2004-08-22  Martin Baulig  <martin@ximian.com>
10452
10453         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10454         a switch and may break, reset the barrier.  Fixes #59867.
10455
10456 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
10457
10458         CLS-Compliance speed up (~5% for corlib)
10459
10460         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
10461         New method. Tests container for CLS-Compliant names
10462
10463         * class.cs (TypeContainer.VerifyClsName): New method.
10464         Checks whether container name is CLS Compliant.
10465         (Constructor): Implements IMethodData.
10466
10467         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
10468         low-case table for CLS Compliance test.
10469         (MemberCache.VerifyClsParameterConflict): New method.
10470         Checks method parameters for CS3006 error.
10471
10472         * enum.cs (EnumMember): Is derived from MemberCore.
10473         (Enum.VerifyClsName): Optimized for better performance.
10474
10475 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10476
10477         * report.cs: Renamed Error_T to Error and changed all
10478         references.
10479
10480 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
10481
10482         * class.cs (TypeContainer.IndexerArrayList): New inner class
10483         container for indexers.
10484         (TypeContainer.DefaultIndexerName): New constant for default
10485         indexer name. Replaced all "Item" with this constant.
10486         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
10487
10488         * typemanager.cs (TypeManager.default_member_ctor): Cache here
10489         DefaultMemberAttribute constructor.
10490
10491 2004-08-05  Martin Baulig  <martin@ximian.com>
10492
10493         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
10494         Fix bug #59429.
10495
10496 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
10497
10498         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
10499         multi platforms problem.
10500
10501         * compiler.csproj: Included shared files.
10502
10503 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10504
10505         Fix bug 60333, 55971 in the more general way
10506         * attribute.cs (Attribute.GetAttributeArgumentExpression):
10507         Added arg_type argument for constant conversion.
10508         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
10509
10510 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10511
10512         Fix bug #59760
10513         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
10514         OperatorArrayList, MethodCoreArrayList for typecontainer
10515         containers. Changed class member types to these new types.
10516         (MethodArrayList.DefineMembers): Added test for CS0659.
10517
10518 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
10519
10520         * cfold.cs: Synchronize the folding with the code in expression.cs
10521         Binary.DoNumericPromotions for uint operands.
10522
10523         * attribute.cs: Revert patch from Raja, it introduced a regression
10524         while building Blam-1.2.1 (hard to isolate a test case).
10525
10526 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
10527
10528         Fix for #55382
10529         * class.cs:
10530         (TypeContainer.Define): Renamed to DefineContainerMembers because of
10531         name collision.
10532         (MethodCore.parent_method): New member. The method we're overriding
10533         if this is an override method.
10534         (MethodCore.CheckBase): Moved from Method class and made common.
10535         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
10536         private.
10537         (MethodCore.CheckForDuplications): New abstract method. For custom
10538         member duplication search in a container
10539         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
10540         method and its return type.
10541         (Event.conflict_symbol): New member. Symbol with same name in the
10542         parent class.
10543
10544         * decl.cs:
10545         (MemberCache.FindMemberWithSameName): New method. The method
10546         is looking for conflict with inherited symbols.
10547
10548 2004-08-04  Martin Baulig  <martin@ximian.com>
10549
10550         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
10551
10552         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
10553
10554 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10555
10556         * report.cs (Message): New enum for better error, warning reference in
10557         the code.
10558         (MessageData): New inner abstract class. It generally handles printing of
10559         error and warning messages.
10560         Removed unused Error, Warning, Message methods.
10561
10562 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10563
10564         Fix for cs0592-8.cs test
10565         * attribute.cs
10566         (Attributable.ValidAttributeTargets): Made public.
10567         (Attribute.ExplicitTarget): New member for explicit target value.
10568         (Attribute.CheckTargets): Now we translate explicit attribute
10569         target to Target here.
10570
10571 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
10572
10573         * ecore.cs (MethodGroupExpr): new IsBase property.
10574
10575         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
10576
10577         * delegate.cs (DelegateCreation): store a MethodGroupExpr
10578         rather than an instance expr.
10579
10580         (DelegateCreation.Emit): Use the method group rather than
10581         the instance expression. Also, if you have base.Foo as the
10582         method for a delegate, make sure to emit ldftn, not ldftnvirt.
10583
10584         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
10585
10586         (NewDelegate.DoResolve): Only check for the existance of Invoke
10587         if the method is going to be needed. Use MethodGroupExpr.
10588
10589         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
10590
10591         * expression.cs: For pointer arith., make sure to use
10592         the size of the type, not the size of the pointer to
10593         the type.
10594
10595 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
10596
10597         Fix for #60722
10598         * class.cs (Class): Added error CS0502 test.
10599
10600 2004-08-03  John Luke  <jluke@cfl.rr.com>
10601             Raja R Harinath  <rharinath@novell.com>
10602
10603         Fix for #60997.
10604         * attribute.cs (Attribute.complained_before): New flag.
10605         (Attribute.ResolveType, Attribute.Resolve),
10606         (Attribute.DefinePInvokeMethod): Set it.
10607         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
10608         
10609 2004-08-03  Martin Baulig  <martin@ximian.com>
10610
10611         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
10612         use a user-defined operator; we still need to do numeric
10613         promotions in case one argument is a builtin type and the other
10614         one has an implicit conversion to that type.  Fixes #62322.
10615
10616 2004-08-02  Martin Baulig  <martin@ximian.com>
10617
10618         * statement.cs (LocalInfo.Flags): Added `IsThis'.
10619         (LocalInfo.IsThis): New public property.
10620         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
10621
10622 2004-08-01  Martin Baulig  <martin@ximian.com>
10623
10624         * class.cs (TypeContainer.GetClassBases): Don't set the default
10625         here since we may get called from GetPartialBases().
10626         (TypeContainer.DefineType): If GetClassBases() didn't return a
10627         parent, use the default one.
10628
10629 2004-07-30  Duncan Mak  <duncan@ximian.com>
10630
10631         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
10632
10633 2004-07-30  Martin Baulig  <martin@ximian.com>
10634
10635         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
10636
10637         * class.cs (SourceMethod): New public class, derive from the
10638         symbol writer's ISourceMethod.
10639         (Method): Use the new symbol writer API.
10640
10641         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
10642         as argument and use the new symbol writer.
10643
10644         * location.cs
10645         (SourceFile): Implement the symbol writer's ISourceFile.
10646         (Location.SymbolDocument): Removed.
10647         (Location.SourceFile): New public property.
10648
10649         * symbolwriter.cs: Use the new symbol writer API.
10650
10651 2004-07-30  Raja R Harinath  <rharinath@novell.com>
10652
10653         * Makefile (install-local): Remove.  Functionality moved to
10654         executable.make.
10655
10656 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
10657
10658         * Makefile: Install mcs.exe.config file together with mcs.exe.
10659         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
10660         correct runtime version.
10661         
10662 2004-07-25  Martin Baulig  <martin@ximian.com>
10663
10664         * class.cs
10665         (TypeContainer.RegisterOrder): Removed, this was unused.
10666         (TypeContainer, interface_order): Removed.
10667         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
10668         TypeContainer as argument since we can also be called with a
10669         `PartialContainer' for a partial class/struct/interface.
10670         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
10671         of checking whether we're an `Interface' - we could be a
10672         `PartialContainer'.
10673         (PartialContainer.Register): Override; call
10674         AddClass()/AddStruct()/AddInterface() on our parent.
10675
10676         * cs-parser.jay (interface_member_declaration): Add things to the
10677         `current_container', not the `current_class'.
10678
10679         * rootcontext.cs (RegisterOrder): The overloaded version which
10680         takes an `Interface' was unused, removed.
10681
10682         * typemanager.cs (TypeManager.LookupInterface): Return a
10683         `TypeContainer', not an `Interface'.
10684         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
10685         contain a `PartialContainer' for an interface, so check it's
10686         `Kind' to figure out what it is.
10687
10688 2004-07-25  Martin Baulig  <martin@ximian.com>
10689
10690         * class.cs (Class.DefaultTypeAttributes): New public constant.
10691         (Struct.DefaultTypeAttributes): Likewise.
10692         (Interface.DefaultTypeAttributes): Likewise.
10693         (PartialContainer.TypeAttr): Override this and add the
10694         DefaultTypeAttributes.
10695
10696 2004-07-25  Martin Baulig  <martin@ximian.com>
10697
10698         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
10699         we can just use the `Parent' field instead.
10700
10701 2004-07-25  Martin Baulig  <martin@ximian.com>
10702
10703         * class.cs (TypeContainer.Emit): Renamed to EmitType().
10704
10705 2004-07-25  Martin Baulig  <martin@ximian.com>
10706
10707         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
10708         our parts before defining any methods.
10709         (TypeContainer.VerifyImplements): Make this virtual.
10710         (ClassPart.VerifyImplements): Override and call VerifyImplements()
10711         on our PartialContainer.
10712
10713 2004-07-25  Martin Baulig  <martin@ximian.com>
10714
10715         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
10716
10717         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
10718         argument, we can just use the `Parent' field instead.
10719
10720         * class.cs
10721         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
10722         (MemberBase.DoDefine): Likewise.
10723
10724 2004-07-24  Martin Baulig  <martin@ximian.com>
10725
10726         * decl.cs (MemberCore.Parent): New public field.
10727         (DeclSpace.Parent): Moved to MemberCore.
10728
10729         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
10730         (MemberBase.ctor): Added TypeContainer argument, pass it to our
10731         parent's .ctor.
10732         (FieldBase, Field, Operator): Likewise.
10733         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
10734         (EventField, Event): Likewise.
10735
10736 2004-07-23  Martin Baulig  <martin@ximian.com>
10737
10738         * class.cs (PartialContainer): New public class.
10739         (ClassPart): New public class.
10740         (TypeContainer): Added support for partial classes.
10741         (TypeContainer.GetClassBases): Splitted some of the functionality
10742         out into GetNormalBases() and GetPartialBases().
10743
10744         * cs-tokenizer.cs (Token.PARTIAL): New token.
10745         (Tokenizer.consume_identifier): Added some hacks to recognize
10746         `partial', but only if it's immediately followed by `class',
10747         `struct' or `interface'.
10748
10749         * cs-parser.jay: Added support for partial clases.
10750
10751 2004-07-23  Martin Baulig  <martin@ximian.com>
10752
10753         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
10754         a `DeclSpace' and also made it readonly.
10755         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
10756         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
10757         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
10758
10759         * cs-parser.jay: Pass the `current_class', not the
10760         `current_container' (at the moment, this is still the same thing)
10761         to a new Method, Property, Event, Indexer or Constructor.
10762
10763 2004-07-23  Martin Baulig  <martin@ximian.com>
10764
10765         * cs-parser.jay (CSharpParser): Added a new `current_class' field
10766         and removed the `current_interface' one.
10767         (struct_declaration, class_declaration, interface_declaration):
10768         Set `current_class' to the newly created class/struct/interface;
10769         set their `Bases' and call Register() before parsing their body.
10770
10771 2004-07-23  Martin Baulig  <martin@ximian.com>
10772
10773         * class.cs (Kind): New public enum.
10774         (TypeContainer): Made this class abstract.
10775         (TypeContainer.Kind): New public readonly field.
10776         (TypeContainer.CheckDef): New public method; moved here from
10777         cs-parser.jay.
10778         (TypeContainer.Register): New public abstract method.
10779         (TypeContainer.GetPendingImplementations): New public abstract
10780         method.
10781         (TypeContainer.GetClassBases): Removed the `is_class' and
10782         `is_iface' parameters.
10783         (TypeContainer.DefineNestedTypes): Formerly known as
10784         DoDefineType().
10785         (ClassOrStruct): Made this class abstract.
10786
10787         * tree.cs (RootTypes): New public type. 
10788
10789 2004-07-20  Martin Baulig  <martin@ximian.com>
10790
10791         * tree.cs (Tree.RecordNamespace): Removed.
10792         (Tree.Namespaces): Removed.
10793
10794         * rootcontext.cs (RootContext.IsNamespace): Removed.
10795
10796         * cs-parser.jay (namespace_declaration): Just create a new
10797         NamespaceEntry here.
10798
10799 2004-07-20  Martin Baulig  <martin@ximian.com>
10800
10801         * statement.cs (ExceptionStatement): New abstract class.  This is
10802         now used as a base class for everyone who's using `finally'.
10803         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
10804         our local variables before using them.
10805
10806         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
10807         virtual method.  This is used by Yield.Resolve() to "steal" an
10808         outer block's `finally' clauses.
10809         (FlowBranchingException): The .ctor now takes an ExceptionStatement
10810         argument.
10811
10812         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
10813         version which takes an ExceptionStatement.  This version must be
10814         used to create exception branchings.
10815
10816         * iterator.cs
10817         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
10818         (Iterator.EmitMoveNext): Added exception support; protect the
10819         block with a `fault' clause, properly handle 'finally' clauses.
10820         (Iterator.EmitDispose): Run all the `finally' clauses here.
10821
10822 2004-07-20  Martin Baulig  <martin@ximian.com>
10823
10824         * iterator.cs: This is the first of a set of changes in the
10825         iterator code.  Match the spec more closely: if we're an
10826         IEnumerable, then GetEnumerator() must be called.  The first time
10827         GetEnumerator() is called, it returns the current instance; all
10828         subsequent invocations (if any) must create a copy.
10829
10830 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
10831
10832         * expression.cs: Resolve the constant expression before returning
10833         it. 
10834
10835 2004-07-19  Martin Baulig  <martin@ximian.com>
10836
10837         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
10838         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
10839         the return type of the new EmitContext.
10840
10841 2004-07-18  Martin Baulig  <martin@ximian.com>
10842
10843         * class.cs (Property.Define): Fix iterators.
10844
10845         * iterators.cs (Iterator.Define): Moved the
10846         `container.AddInterator (this)' call here from the .ctor; only do
10847         it if we resolved successfully.
10848
10849 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
10850
10851         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
10852         `true' for preprocessing directives that we parse.  The return
10853         value indicates whether we should return to regular tokenizing or
10854         not, not whether it was parsed successfully.
10855
10856         In the past if we were in: #if false ... #line #endif, we would
10857         resume parsing after `#line'.  See bug 61604.
10858
10859         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
10860         building: IsEnumType should return true only for enums, not for
10861         enums or System.Enum itself.  This fixes #61593.
10862
10863         Likely what happened is that corlib was wrong: mcs depended on
10864         this bug in some places.  The bug got fixed, we had to add the
10865         hack, which caused bug 61593.
10866
10867         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
10868         that was a workaround for the older conditions.
10869
10870 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
10871
10872         * assign.cs: IAssignMethod has a new interface, as documented
10873         inline. All assignment code now uses this new api.
10874
10875         * ecore.cs, expression.cs: All classes which implement
10876         IAssignMethod now use the new interface.
10877
10878         * expression.cs (Invocation): add a hack to EmitCall so that
10879         IndexerAccess can be the target of a compound assignment without
10880         evaluating its arguments twice.
10881
10882         * statement.cs: Handle changes in Invocation api.
10883
10884 2004-07-16  Martin Baulig  <martin@ximian.com>
10885
10886         * iterators.cs: Rewrote this.  We're now using one single Proxy
10887         class for both the IEnumerable and the IEnumerator interface and
10888         `Iterator' derives from Class so we can use the high-level API.
10889
10890         * class.cs (TypeContainer.AddIterator): New method.
10891         (TypeContainer.DoDefineType): New protected virtual method, which
10892         is called from DefineType().
10893         (TypeContainer.DoDefineMembers): Call DefineType() and
10894         DefineMembers() on all our iterators.
10895         (TypeContainer.Emit): Call Emit() on all our iterators.
10896         (TypeContainer.CloseType): Call CloseType() on all our iterators.
10897
10898         * codegen.cs (EmitContext.CurrentIterator): New public field.
10899
10900 2004-07-15  Martin Baulig  <martin@ximian.com>
10901
10902         * typemanager.cs
10903         (TypeManager.not_supported_exception_type): New type.   
10904
10905 2004-07-14  Martin Baulig  <martin@ximian.com>
10906
10907         * iterators.cs: Use real error numbers.
10908
10909 2004-07-14  Martin Baulig  <martin@ximian.com>
10910
10911         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
10912         requires this to be a System.Collection.IEnumerable and not a
10913         class implementing that interface.
10914         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
10915
10916 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
10917
10918         * class.cs: Fixed previous fix, it broke some error tests.
10919
10920 2004-07-12  Martin Baulig  <martin@ximian.com>
10921
10922         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
10923         Fixes #61293.
10924
10925 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
10926
10927         * assign.cs (LocalTemporary): Add new argument: is_address,If
10928         `is_address' is true, then the value that we store is the address
10929         to the real value, and not the value itself.
10930         
10931         * ecore.cs (PropertyExpr): use the new local temporary
10932         stuff to allow us to handle X.Y += z (where X is a struct)
10933
10934 2004-07-08  Martin Baulig  <martin@ximian.com>
10935
10936         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
10937         not always return, just like we're doing in Using.Resolve().
10938
10939 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
10940
10941         * cs-parser.jay (fixed_statement): flag this as Pinned.
10942
10943 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
10944
10945         * typemanager.cs (TypeManager): Removed MakePinned method, this
10946         mechanism is replaced with the .NET 2.x compatible mechanism of
10947         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
10948
10949         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
10950         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
10951         `IsFixed' property which has a different meaning.
10952
10953 2004-07-02  Raja R Harinath  <rharinath@novell.com>
10954
10955         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
10956         visible from inside a nested class, not just the names of the
10957         immediately enclosing class.
10958         Fix for bug #60730.
10959
10960 2004-06-24  Raja R Harinath  <rharinath@novell.com>
10961
10962         * expression.cs (BetterConversion): Remove buggy special-case
10963         handling of "implicit constant expression conversions".  At this
10964         point, we already know that the conversion is possible -- we're
10965         only checking to see which is better.
10966
10967 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10968
10969         * cs-parser.jay: Added error CS0210 test.
10970
10971 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10972
10973         * cs-parser.jay: Added error CS0134 test.
10974
10975 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10976
10977         Fix bug #52507
10978         * cs-parser.jay: Added error CS0145 test.
10979
10980 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
10981
10982         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
10983
10984 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
10985         
10986         * expression.cs (StackAlloc.Resolve): The argument may not
10987         be a constant; deal with this case.
10988         
10989 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
10990
10991         * attribute.cs (IndexerName_GetIndexerName): Renamed to
10992         GetIndexerAttributeValue.
10993         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
10994
10995         * class.cs (Indexer.Define): Added error tests for CS0415,
10996         CS0609.
10997
10998 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
10999
11000         * attribute.cs (Attribute.Resolve): Keep field code in sync with
11001         property code.
11002
11003 2004-06-23  Martin Baulig  <martin@ximian.com>
11004
11005         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
11006         neither return nor throw, reset the barrier as well.  Fixes #60457.
11007
11008 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
11009
11010         * class.cs : EventAttributes is now set to None by default.
11011           This fixes bug #60459.
11012
11013 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11014
11015         Fix bug #60219
11016         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11017         Don't throw exception but return null (it's sufficient now).
11018
11019 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
11020
11021         * typemanager.cs (GetArgumentTypes): Faster implementation.
11022
11023 2004-06-18  Martin Baulig  <martin@ximian.com>
11024
11025         * attribute.cs (Attribute.Resolve): Check whether we're an
11026         EmptyCast which a Constant child.  Fixes #60333.
11027
11028 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
11029
11030         * statement.cs (EmitCollectionForeach): Account for the fact that
11031         not all valuetypes are in areas which we can take the address of.
11032         For these variables, we store to a temporary variable. Also, make
11033         sure that we dont emit a `callvirt' on a valuetype method.
11034
11035 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11036
11037         * expression.cs (StackAlloc.DoReSolve): Added test for
11038         negative parameter (CS0247).
11039
11040 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11041
11042         Fix bug #59792
11043         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
11044
11045 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
11046
11047         Fix bug #59781
11048         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
11049         ulong.
11050
11051 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11052
11053         Fix bug #58254 & cs1555.cs, cs1556.cs
11054         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
11055
11056 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
11057
11058         * cs-parser.jay: Added error CS1669 test for indexers.
11059
11060 2004-06-11  Martin Baulig  <martin@ximian.com>
11061
11062         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
11063         call this twice: for params and varargs methods.
11064
11065 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11066
11067         * class.cs:
11068         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
11069
11070 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11071
11072         * attribute.cs (Attribute.GetValidTargets): Made public.
11073
11074         * class.cs: 
11075         (AbstractPropertyEventMethod): New class for better code sharing.
11076         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
11077         CS1667 report.
11078         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
11079
11080 2004-06-11  Raja R Harinath  <rharinath@novell.com>
11081
11082         Fix bug #59477.
11083         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
11084         that the call to Resolve is part of a MemberAccess.
11085         (Expression.Resolve): Use it for SimpleName resolution.
11086         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
11087         Add 'intermediate' boolean argument.
11088         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
11089         error message when the SimpleName can be resolved ambiguously
11090         between an expression and a type.
11091         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
11092         public.
11093         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
11094         call on the left-side.
11095
11096 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11097
11098         * class.cs:
11099         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
11100
11101 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11102
11103         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
11104
11105 2004-06-11  Martin Baulig  <martin@ximian.com>
11106
11107         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
11108         varargs methods if applicable.
11109
11110 2004-06-11  Martin Baulig  <martin@ximian.com>
11111
11112         * expression.cs (Invocation.EmitCall): Don't use
11113         `method.CallingConvention == CallingConventions.VarArgs' since the
11114         method could also have `CallingConventions.HasThis'.
11115
11116 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
11117
11118         * class.cs (Event.GetSignatureForError): Implemented.
11119         Fixed crash in error test cs3010.cs
11120
11121 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
11122
11123         * cs-tokenizer.cs: Change the way we track __arglist to be
11124         consistent with the other keywords.
11125
11126 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
11127
11128         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
11129         tomorrow.
11130
11131 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
11132
11133         * codegen.cs: Check that all referenced assemblies have a strongname
11134         before strongnaming the compiled assembly. If not report error CS1577.
11135         Fix bug #56563. Patch by Jackson Harper.
11136         * typemanager.cs: Added a method to return all referenced assemblies.
11137         Fix bug #56563. Patch by Jackson Harper.
11138
11139 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11140
11141         * class.cs:
11142         (Method.ApplyAttributeBuilder): Moved and added conditional
11143         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
11144
11145         * delegate.cs:
11146         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
11147
11148 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
11149
11150         Fixed #59640
11151         * class.cs: (EventField.attribute_targets): Changed default target.
11152
11153 2004-06-08  Martin Baulig  <martin@ximian.com>
11154
11155         * expression.cs (Invocation.EmitCall): Enable varargs methods.
11156
11157 2004-06-08  Martin Baulig  <martin@ximian.com>
11158
11159         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
11160
11161 2004-06-07  Martin Baulig  <martin@ximian.com>
11162
11163         Added support for varargs methods.
11164
11165         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
11166         keyword.
11167
11168         * cs-parser.jay: Added support for `__arglist'.
11169
11170         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
11171
11172         * expression.cs (Argument.AType): Added `ArgList'.
11173         (Invocation): Added support for varargs methods.
11174         (ArglistAccess): New public class.
11175         (Arglist): New public class.
11176
11177         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
11178
11179         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
11180         a method's top-level block if the method has varargs.
11181
11182         * support.cs (ReflectionParameters, InternalParameters): Added
11183         support for varargs methods.    
11184
11185 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
11186
11187         * class.cs: Provide location in indexer error report.
11188
11189         * driver.cs: Use standard names.
11190
11191         * namespace.cs: Catch the use of using after a namespace has been
11192         declared also on using aliases.
11193
11194 2004-06-03  Raja R Harinath  <rharinath@novell.com>
11195
11196         Bug #50820.
11197         * typemanager.cs (closure_private_ok, closure_invocation_type)
11198         (closure_qualifier_type, closure_invocation_assembly)
11199         (FilterWithClosure): Move to ...
11200         (Closure): New internal nested class.
11201         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
11202         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
11203         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
11204         (MemberLookup, MemberLookupFailed): Use it.
11205         * expression.cs (New.DoResolve): Treat the lookup for the
11206         constructor as being qualified by the 'new'ed type.
11207         (Indexers.GetIndexersForTypeOrInterface): Update.
11208
11209 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
11210
11211         * attribute.cs
11212         (GetConditionalAttributeValue): New method. Returns
11213         condition of ConditionalAttribute.
11214         (SearchMulti): New method.  Returns all attributes of type 't'.
11215         Use it when attribute is AllowMultiple = true.
11216         (IsConditionalMethodExcluded): New method.
11217
11218         * class.cs
11219         (Method.IsExcluded): Implemented. Returns true if method has conditional
11220         attribute and the conditions is not defined (method is excluded).
11221         (IMethodData): Extended interface for ConditionalAttribute support.
11222         (PropertyMethod.IsExcluded): Implemented.
11223
11224         * decl.cs
11225         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
11226
11227         * expression.cs
11228         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
11229         on the method.
11230
11231 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11232
11233         * expression.cs (ArrayCreationExpression): Make this just an
11234         `expression'. It can't be a statement, so the code here was
11235         dead.
11236
11237 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11238
11239         Fixed #59072
11240         * typemanager.cs (GetFullNameSignature): New method for
11241         MethodBase types.
11242
11243 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
11244
11245         Fixed #56452
11246         * class.cs (MemberBase.GetSignatureForError): New virtual method.
11247         Use this method when MethodBuilder is null.
11248         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
11249         Added test for error CS0626 (MONO reports error for this situation).
11250         (IMethodData.GetSignatureForError): Extended interface.
11251
11252 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11253
11254         * attribute.cs
11255         (AttributeTester.GetObsoleteAttribute): Returns instance of
11256         ObsoleteAttribute when type is obsolete.
11257
11258         * class.cs
11259         (TypeContainer.VerifyObsoleteAttribute): Override.
11260         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
11261         (MethodCode.VerifyObsoleteAttribute): Override.
11262         (MemberBase.VerifyObsoleteAttribute): Override.
11263
11264         * decl.cs
11265         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
11266         and report proper error.
11267
11268         *delegate.cs
11269         Delegate.VerifyObsoleteAttribute): Override.
11270
11271         * ecore.cs
11272         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
11273         and report proper error.
11274         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
11275
11276         * enum.cs
11277         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
11278         and enum member.
11279
11280         * expression.cs
11281         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
11282         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
11283         Added test for ObsoleteAttribute.
11284
11285         * statement.cs
11286         (Catch): Derived from Statement.
11287
11288 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
11289  
11290         Fixed bug #59071 & cs0160.cs
11291  
11292         * statement.cs (Try.Resolve): Check here whether order of catch
11293         clauses matches their dependencies.
11294
11295 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
11296
11297         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
11298         caused a regression: #59343.  Referencing nested classes from an
11299         assembly stopped working.
11300
11301 2004-05-31  Martin Baulig  <martin@ximian.com>
11302
11303         MCS is now frozen for beta 2.
11304
11305 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11306
11307         * convert.cs: add a trivial cache for overload operator resolution.
11308
11309 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11310
11311         * decl.cs: If possible, use lookuptypedirect here. We can only do
11312         this if there is no `.' after the namespace. Avoids using
11313         LookupType, which does lots of slow processing.
11314         (FindNestedType) New method, does what it says :-).
11315         * namespace.cs: use LookupTypeDirect.
11316         * rootcontext.cs: use membercache, if possible.
11317         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
11318
11319 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11320
11321         * expression.cs:
11322         According to the spec, 
11323
11324         In a member access of the form E.I, if E is a single identifier,
11325         and if the meaning of E as a simple-name (§7.5.2) is a constant,
11326         field, property, localvariable, or parameter with the same type as
11327         the meaning of E as a type-name (§3.8), then both possible
11328         meanings of E are permitted.
11329
11330         We did not check that E as a simple-name had the same type as E as
11331         a type name.
11332
11333         This trivial check gives us 5-7% on bootstrap time.
11334
11335 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
11336
11337         * expression.cs (Invocation.OverloadResolve): Avoid the
11338         use of hashtables and boxing here by allocating on demand.
11339
11340 2004-05-30  Martin Baulig  <martin@ximian.com>
11341
11342         * rootcontext.cs (RootContext.LookupType): Don't cache things if
11343         we're doing a silent lookup.  Don't try to lookup nested types in
11344         TypeManager.object_type (thanks to Ben Maurer).
11345
11346 2004-05-30  Martin Baulig  <martin@ximian.com>
11347
11348         Committing a patch from Ben Maurer.
11349
11350         * rootcontext.cs (RootContext.LookupType): Cache negative results.
11351
11352 2004-05-29  Martin Baulig  <martin@ximian.com>
11353
11354         * class.cs (IMethodData.ShouldIgnore): New method.
11355
11356         * typemanager.cs (TypeManager.MethodFlags): Don't take a
11357         `Location' argument, we don't need it anywhere.  Use
11358         `IMethodData.ShouldIgnore ()' instead of
11359         `MethodData.GetMethodFlags ()'.
11360         (TypeManager.AddMethod): Removed.
11361         (TypeManager.AddMethod2): Renamed to AddMethod.
11362
11363 2004-05-29  Martin Baulig  <martin@ximian.com>
11364
11365         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
11366
11367         * convert.cs (Convert.ImplicitReferenceConversion): If we're
11368         converting from a class type S to an interface type and we already
11369         have an object on the stack, don't box it again.  Fixes #52578.
11370
11371 2004-05-29  Martin Baulig  <martin@ximian.com>
11372
11373         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
11374         Added support for `params' parameters.  Fixes #59267.
11375
11376 2004-05-29  Martin Baulig  <martin@ximian.com>
11377
11378         * literal.cs (NullPointer): Provide a private .ctor which sets
11379         `type' to TypeManager.object_type.  Fixes #59048.
11380
11381 2004-05-29  Martin Baulig  <martin@ximian.com>
11382
11383         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
11384         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
11385
11386         * ecore.cs (EventExpr.instance_expr): Make the field private.
11387
11388 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
11389
11390         Fixed bug #50080 & cs0214-2.cs
11391         * expression.cs (Cast.DoResolve): Check unsafe context here.
11392         
11393         * statement.cs (Resolve.DoResolve): Likewise.
11394
11395 2004-05-26  Martin Baulig  <martin@ximian.com>
11396
11397         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
11398
11399         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
11400         (RootContext.LookupType): Pass down the `silent' flag.
11401
11402 2004-05-25  Martin Baulig  <martin@ximian.com>
11403
11404         * expression.cs
11405         (MethodGroupExpr.IdenticalTypeName): New public property.
11406         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
11407         expression actually refers to a type.
11408
11409 2004-05-25  Martin Baulig  <martin@ximian.com>
11410
11411         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
11412         for #56176 and made it actually work.
11413
11414 2004-05-25  Martin Baulig  <martin@ximian.com>
11415
11416         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
11417         (FieldExpr, PropertyExpr): Override and implement
11418         CacheTemporaries.  Fixes #52279.
11419
11420 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
11421
11422         * location.cs: In the new compiler listing a file twice is a
11423         warning, not an error.
11424
11425 2004-05-24  Martin Baulig  <martin@ximian.com>
11426
11427         * enum.cs (Enum.DefineType): For the `BaseType' to be a
11428         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
11429
11430 2004-05-24  Martin Baulig  <martin@ximian.com>
11431
11432         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
11433         walking the `using' list.  Fixes #53921.
11434
11435 2004-05-24  Martin Baulig  <martin@ximian.com>
11436
11437         * const.cs (Const.LookupConstantValue): Added support for
11438         EmptyCast's; fixes #55251.
11439
11440 2004-05-24  Martin Baulig  <martin@ximian.com>
11441
11442         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
11443         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
11444         which does the CS0135 check.  The reason is that we first need to
11445         check whether the variable actually exists.
11446
11447 2004-05-24  Martin Baulig  <martin@ximian.com>
11448
11449         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
11450         than RootContext.LookupType() to find the explicit interface
11451         type.  Fixes #58584.
11452
11453 2004-05-24  Raja R Harinath  <rharinath@novell.com>
11454
11455         * Makefile: Simplify.  Use executable.make.
11456         * mcs.exe.sources: New file.  List of sources of mcs.exe.
11457
11458 2004-05-24  Anders Carlsson  <andersca@gnome.org>
11459
11460         * decl.cs:
11461         * enum.cs:
11462         Use the invariant culture when doing String.Compare for CLS case
11463         sensitivity.
11464         
11465 2004-05-23  Martin Baulig  <martin@ximian.com>
11466
11467         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
11468         don't have any dots.  Fixes #52622, added cs0246-8.cs.
11469
11470         * namespace.cs (NamespaceEntry.Lookup): Likewise.
11471         
11472 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11473
11474         * class.cs (MemberBase.Define): Reuse MemberType member for 
11475         resolved type. Other methods can use it too.
11476
11477 2004-05-23  Martin Baulig  <martin@ximian.com>
11478
11479         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
11480         the variable also exists in the current block (otherwise, we need
11481         to report a CS0103).  Fixes #58670.
11482
11483 2004-05-23  Martin Baulig  <martin@ximian.com>
11484
11485         * flowanalysis.cs (Reachability.Reachable): Compute this
11486         on-the-fly rather than storing it as a field.
11487
11488 2004-05-23  Martin Baulig  <martin@ximian.com>
11489
11490         * flowanalysis.cs (Reachability.And): Manually compute the
11491         resulting `barrier' from the reachability.      
11492        
11493 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
11494
11495         Fix bug #57835
11496         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
11497         instance of ObsoleteAttribute when symbol is obsolete.
11498
11499         * class.cs
11500         (IMethodData): Extended interface for ObsoleteAttribute support.
11501
11502 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11503
11504         * attribute.cs: Fix bug #55970
11505
11506 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
11507
11508         Fix bug #52705
11509         * attribute.cs
11510         (GetObsoleteAttribute): New method. Creates the instance of
11511         ObsoleteAttribute.
11512         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
11513         ObsoleteAttribute when member is obsolete.
11514         (AttributeTester.Report_ObsoleteMessage): Common method for
11515         Obsolete error/warning reporting.
11516
11517         * class.cs
11518         (TypeContainer.base_classs_type): New member for storing parent type.
11519
11520         * decl.cs
11521         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
11522         for this MemberCore.
11523
11524 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11525
11526         * attribute.cs, const.cs: Fix bug #58590
11527
11528 2004-05-21  Martin Baulig  <martin@ximian.com>
11529
11530         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
11531         out parameters if the end of the method is unreachable.  Fixes
11532         #58098. 
11533
11534 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11535
11536         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
11537         Hari was right, why extra method.
11538
11539 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
11540
11541         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
11542
11543 2004-05-20  Martin Baulig  <martin@ximian.com>
11544
11545         Merged this back from gmcs to keep the differences to a minumum.
11546
11547         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
11548         instead of a Declspace.
11549         (Attribute.ResolveType): Likewise.
11550         (Attributes.Search): Likewise.
11551         (Attributes.Contains): Likewise.
11552         (Attributes.GetClsCompliantAttribute): Likewise.
11553
11554         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
11555         argument.
11556         (MethodData.ApplyAttributes): Take an EmitContext instead of a
11557         DeclSpace.
11558
11559 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
11560
11561         Fix bug #58688 (MCS does not report error when the same attribute
11562         is assigned twice)
11563
11564         * attribute.cs (Attribute.Emit): Distinction between null and default.
11565
11566 2004-05-19  Raja R Harinath  <rharinath@novell.com>
11567
11568         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
11569         of a top-level attribute without an attribute target.
11570         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
11571         Make non-static.
11572         (Attribute.Conditional_GetConditionName), 
11573         (Attribute.Obsolete_GetObsoleteMessage): Update.
11574         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
11575         part of ScanForIndexerName.
11576         (Attribute.CanIgnoreInvalidAttribute): New function.
11577         (Attribute.ScanForIndexerName): Move to ...
11578         (Attributes.ScanForIndexerName): ... here.
11579         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
11580         (Attributes.Search): New internal variant that can choose not to
11581         complain if types aren't resolved.  The original signature now
11582         complains.
11583         (Attributes.GetClsCompliantAttribute): Use internal variant, with
11584         complaints suppressed.
11585         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
11586         only if it not useful.
11587         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
11588         top-level for attributes that are shared between the assembly
11589         and a top-level class.
11590         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
11591         * class.cs: Update to reflect changes.
11592         (DefineIndexers): Fuse loops.
11593         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
11594         a couple more variants of attribute names.
11595
11596 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
11597
11598         Fix bug #52585 (Implemented explicit attribute declaration)
11599
11600         * attribute.cs:
11601         (Attributable.ValidAttributeTargets): New abstract method. It gets
11602         list of valid attribute targets for explicit target declaration.
11603         (Attribute.Target): It holds target itself.
11604         (AttributeSection): Removed.
11605         (Attribute.CheckTargets): New method. It checks whether attribute
11606         target is valid for the current element.
11607
11608         * class.cs:
11609         (EventProperty): New class. For events that are declared like
11610         property (with add and remove accessors).
11611         (EventField): New class. For events that are declared like field.
11612         class.cs
11613
11614         * cs-parser.jay: Implemented explicit attribute target declaration.
11615
11616         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
11617         Override ValidAttributeTargets.
11618
11619         * parameter.cs:
11620         (ReturnParameter): Class for applying custom attributes on 
11621         the return type.
11622         (ParameterAtribute): New class. Class for applying custom
11623         attributes on the parameter type.
11624
11625 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
11626
11627         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
11628         definitions. 
11629
11630         (Method): Allow UNSAFE here.
11631
11632         * modifiers.cs: Support unsafe reporting.
11633
11634 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
11635
11636         * decl.cs: Fix bug #58478.
11637
11638 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11639
11640         * statement.cs: When checking for unreachable code on an EmptyStatement,
11641         set the location. Fixes bug #58488.
11642
11643 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
11644
11645         * driver.cs: Add -pkg handling.
11646
11647         From Gonzalo: UseShelLExecute=false
11648
11649 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
11650
11651         * attribute.cs:
11652         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
11653         for attribute.
11654         (Attribute.IsClsCompliaceRequired): Moved to base for better
11655         accesibility.
11656         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
11657         when attribute is AttributeUsageAttribute.
11658         (Attribute.GetValidTargets): Simplified.
11659         (Attribute.GetAttributeUsage): New method returns AttributeUsage
11660         attribute for this type.
11661         (Attribute.ApplyAttributes): Method renamed to Emit and make
11662         non-static.
11663         (GlobalAttributeSection): New class for special handling of global
11664         attributes (assembly, module).
11665         (AttributeSection.Emit): New method.
11666
11667         * class.cs: Implemented Attributable abstract methods.
11668         (MethodCore.LabelParameters): Moved to Parameter class.
11669         (Accessor): Is back simple class.
11670         (PropertyMethod): Implemented Attributable abstract class.
11671         (DelegateMethod): Implemented Attributable abstract class.
11672         (Event): New constructor for disctintion between normal Event
11673         and Event with accessors.
11674
11675         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
11676
11677         * codegen.cs, const.cs, decl.cs, delegate.cs:
11678         (CommonAssemblyModulClass): Implemented Attributable abstract class
11679         and simplified.
11680
11681         * enum.cs: Implement IAttributeSupport interface.
11682         (EnumMember): New class for emum members. Implemented Attributable
11683         abstract class
11684
11685         * parameter.cs:
11686         (ParameterBase): Is abstract.
11687         (ReturnParameter): New class for easier [return:] attribute handling.
11688
11689         * typemanager.cs: Removed builder_to_attr.
11690
11691 2004-05-11  Raja R Harinath  <rharinath@novell.com>
11692
11693         Fix bug #57151.
11694         * attribute.cs (Attribute.GetPositionalValue): New function.
11695         * class.cs (TypeContainer.VerifyMembers): New function.
11696         (TypeContainer.Emit): Use it.
11697         (ClassOrStruct): New base class for Class and Struct.
11698         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
11699         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
11700         class.
11701         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
11702         then each non-static field should have a FieldOffset attribute.
11703         Otherwise, none of the fields should have a FieldOffset attribute.
11704         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
11705         and FieldOffset attributes.
11706         * typemanager.cs (TypeManager.struct_layout_attribute_type)
11707         (TypeManager.field_offset_attribute_type): New core types.
11708         (TypeManager.InitCoreTypes): Initialize them.
11709
11710 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
11711
11712         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
11713         Return correct type.
11714         From bug #58270.
11715
11716 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
11717
11718         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
11719         be implicitly converted to ulong.
11720         
11721         * expression.cs: The logic for allowing operator &, | and ^ worked
11722         was wrong, it worked before because we did not report an error in
11723         an else branch.  Fixes 57895.
11724
11725         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
11726         allow volatile fields to be reference types.
11727
11728 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
11729
11730         * driver.cs: Add support for /debug-
11731
11732 2004-05-07  Raja R Harinath  <rharinath@novell.com>
11733
11734         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
11735         Add a 'complain' parameter to silence errors.
11736         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
11737         silently overlooked type-resolutions.
11738         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
11739         to reflect changes.
11740         (Attributes.Search): New function.
11741         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
11742         (Attributes.GetAttributeFullName): Remove hack.
11743         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
11744         Update to reflect changes.
11745         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11746         Use Attributes.Search instead of nested loops.
11747
11748 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
11749
11750         * decl.cs:
11751         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
11752         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
11753         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
11754
11755         * report.cs: (Report.Warning): Renamed to Warning_T because of
11756         parameter collision.
11757
11758 2004-05-05  Raja R Harinath  <rharinath@novell.com>
11759
11760         * expression.cs (MemberAccess.ResolveMemberAccess):
11761         Exit with non-zero status after Report.Error.
11762         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
11763         Likewise.
11764         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
11765
11766 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11767
11768         * support.cs: Don't hang when the file is empty.
11769
11770 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
11771
11772         * support.cs: In SeekableStreamReader, compute the preamble size of the
11773           underlying stream. Position changes should take into account that initial
11774           count of bytes.
11775
11776 2004-05-03  Todd Berman  <tberman@sevenl.net>
11777
11778         * driver.cs: remove unused GetSysVersion function.
11779
11780 2004-05-03  Todd Berman  <tberman@sevenl.net>
11781
11782         * driver.cs: Remove the hack from saturday, as well as the hack
11783         from jackson (LoadAssemblyFromGac), also adds the CWD to the
11784         link_paths to get that bit proper.
11785
11786 2004-05-01  Todd Berman  <tberman@sevenl.net>
11787
11788         * driver.cs: Try a LoadFrom before a Load, this checks the current
11789         path. This is currently a bug in mono that is be fixed, however, this
11790         provides a workaround for now. This will be removed when the bug
11791         is fixed.
11792
11793 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
11794
11795         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11796         incomplete key pairs (#57941).
11797
11798 2004-05-01  Todd Berman  <tberman@sevenl.net>
11799
11800         * driver.cs: Remove '.' from path_chars, now System.* loads properly
11801         from the GAC
11802
11803 2004-04-30  Jackson Harper  <jackson@ximian.com>
11804
11805         * codegen.cs: Open keys readonly.
11806         
11807 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11808
11809         * typemanager.cs: don't report cyclic struct layout when a struct
11810         contains 2 or more fields of the same type. Failed for Pango.AttrShape
11811         which has 2 Pango.Rectangle fields.
11812
11813 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11814
11815         * expression.cs: Handle IntPtr comparisons with IL code
11816         rather than a method call.
11817
11818 2004-04-29  Martin Baulig  <martin@ximian.com>
11819
11820         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
11821         the list of PropertyInfo's in class hierarchy and find the
11822         accessor.  Fixes #56013.
11823
11824 2004-04-29  Martin Baulig  <martin@ximian.com>
11825
11826         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
11827
11828 2004-04-29  Martin Baulig  <martin@ximian.com>
11829
11830         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11831
11832         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
11833
11834 2004-04-29  Martin Baulig  <martin@ximian.com>
11835
11836         * class.cs (ConstructorInitializer.Resolve): Check whether the
11837         parent .ctor is accessible.  Fixes #52146.
11838
11839 2004-04-29  Martin Baulig  <martin@ximian.com>
11840
11841         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
11842
11843         * statement.cs (Using.EmitLocalVariableDecls): Use
11844         TypeManager.idisposable_type, not typeof (IDisposable).
11845         (Foreach.EmitCollectionForeach): Added support for valuetypes.
11846
11847 2004-04-29  Martin Baulig  <martin@ximian.com>
11848
11849         * class.cs (Event.Define): Don't emit the field and don't set
11850         RTSpecialName and SpecialName for events on interfaces.  Fixes
11851         #57703. 
11852
11853 2004-04-29  Raja R Harinath  <rharinath@novell.com>
11854
11855         Refactor Attribute.ApplyAttributes.
11856         * attribute.cs (Attributable): New base class for objects that can
11857         have Attributes applied on them.
11858         (Attribute): Make AttributeUsage fields public.
11859         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
11860         (Attribute.IsInternalCall): New property.
11861         (Attribute.UsageAttr): Convert to a public read-only property.
11862         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
11863         (Attribute.ResolveType, Attribute.Resolve)
11864         (Attribute.ScanForIndexerName): Update to reflect changes.
11865         (Attribute.CheckAttributeTarget): Re-format.
11866         (Attribute.ApplyAttributes): Refactor, to various
11867         Attributable.ApplyAttributeBuilder methods.
11868         * decl.cs (MemberCore): Make Attributable.
11869         * class.cs (Accessor): Make Attributable.
11870         (MethodData.ApplyAttributes): Use proper attribute types, not
11871         attribute names.
11872         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
11873         (TypeContainer.ApplyAttributeBuilder)
11874         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
11875         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
11876         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
11877         (Operator.ApplyAttributeBuilder): New factored-out methods.
11878         * const.cs (Const.ApplyAttributeBuilder): Likewise.
11879         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
11880         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
11881         * parameter.cs (ParameterBase): New Attributable base class
11882         that can also represent Return types.
11883         (Parameter): Update to the changes.
11884
11885 2004-04-29  Jackson Harper  <jackson@ximian.com>
11886
11887         * driver.cs: Prefer the corlib system version when looking for
11888         assemblies in the GAC. This is still a hack, but its a better hack
11889         now.
11890         
11891 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
11892
11893         * decl.cs, enum.cs: Improved error 3005 reporting.
11894   
11895         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
11896         (related_symbols): New private member for list of symbols
11897         related to reported error/warning.
11898         
11899         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
11900
11901 2004-04-29  Martin Baulig  <martin@ximian.com>
11902
11903         * ecore.cs (Expression.Constantify): If we're an enum and
11904         TypeManager.TypeToCoreType() doesn't give us another type, use
11905         t.UnderlyingSystemType.  Fixes #56178.  
11906
11907 2004-04-29  Martin Baulig  <martin@ximian.com>
11908
11909         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
11910         interfaces and for each interface, only add members directly
11911         declared in that interface.  Fixes #53255.
11912
11913 2004-04-28  Martin Baulig  <martin@ximian.com>
11914
11915         * expression.cs (ConditionalLogicalOperator): Use a temporary
11916         variable for `left' to avoid that we evaluate it more than once;
11917         bug #52588.
11918
11919 2004-04-28  Martin Baulig  <martin@ximian.com>
11920
11921         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
11922         `void[]' (CS1547).
11923
11924 2004-04-28  Martin Baulig  <martin@ximian.com>
11925
11926         * statement.cs (LocalInfo.Resolve): Check whether the type is not
11927         void (CS1547).
11928
11929         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
11930         whether the type is not void (CS1547).
11931
11932 2004-04-28  Martin Baulig  <martin@ximian.com>
11933
11934         * expression.cs (Unary.DoResolveLValue): Override this and report
11935         CS0131 for anything but Operator.Indirection.
11936
11937 2004-04-28  Martin Baulig  <martin@ximian.com>
11938
11939         Committing a patch from Ben Maurer; see bug #50820.
11940
11941         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11942         check for classes.
11943
11944         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11945         classes.        
11946
11947 2004-04-28  Martin Baulig  <martin@ximian.com>
11948
11949         Committing a patch from Ben Maurer; see bug #50820.
11950
11951         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
11952         check for classes.
11953
11954         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
11955         classes.        
11956
11957 2004-04-28  Martin Baulig  <martin@ximian.com>
11958
11959         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
11960         (Block.AddLabel): Call DoLookupLabel() to only search in the
11961         current block.
11962
11963 2004-04-28  Martin Baulig  <martin@ximian.com>
11964
11965         * cfold.cs (ConstantFold.BinaryFold): Added special support for
11966         comparing StringConstants and NullLiterals in Equality and Inequality.
11967
11968 2004-04-28  Jackson Harper  <jackson@ximian.com>
11969
11970         * driver.cs: Attempt to load referenced assemblies from the
11971         GAC. This is the quick and dirty version of this method that
11972         doesnt take into account versions and just takes the first
11973         canidate found. Will be good enough for now as we will not have more
11974         then one version installed into the GAC until I update this method.
11975
11976 2004-04-28  Martin Baulig  <martin@ximian.com>
11977
11978         * typemanager.cs (TypeManager.CheckStructCycles): New public
11979         static method to check for cycles in the struct layout.
11980
11981         * rootcontext.cs (RootContext.PopulateTypes): Call
11982         TypeManager.CheckStructCycles() for each TypeContainer.
11983         [Note: We only need to visit each type once.]
11984
11985 2004-04-28  Martin Baulig  <martin@ximian.com>
11986
11987         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
11988
11989         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
11990         success and added `out object value'.  Use a `bool resolved' field
11991         to check whether we've already been called rather than
11992         `ConstantValue != null' since this breaks for NullLiterals.
11993
11994 2004-04-28  Raja R Harinath  <rharinath@novell.com>
11995
11996         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
11997         setting of this flag, since the 'set' method may be non-public.
11998
11999 2004-04-28  Raja R Harinath  <rharinath@novell.com>
12000
12001         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
12002         check on current_vector.Block.
12003
12004 2004-04-27  Martin Baulig  <martin@ximian.com>
12005
12006         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
12007         a field initializer.  Fixes #56459.
12008
12009 2004-04-27  Martin Baulig  <martin@ximian.com>
12010
12011         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
12012         we're not attempting to use an indexer.  Fixes #52154.
12013
12014 2004-04-27  Martin Baulig  <martin@ximian.com>
12015
12016         * statement.cs (Return): Don't create a return label if we don't
12017         need it; reverts my change from January 20th.  Thanks to Ben
12018         Maurer for this.
12019
12020 2004-04-27  Martin Baulig  <martin@ximian.com>
12021
12022         According to the spec, `goto' can only leave a nested scope, but
12023         never enter it.
12024
12025         * statement.cs (Block.LookupLabel): Only lookup in the current
12026         block, don't recurse into parent or child blocks.
12027         (Block.AddLabel): Check in parent and child blocks, report
12028         CS0140/CS0158 if we find a duplicate.
12029         (Block): Removed this indexer for label lookups.
12030         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
12031         this already does the error reporting for us.
12032
12033         * flowanalysis.cs
12034         (FlowBranching.UsageVector.Block): New public variable; may be null.
12035         (FlowBranching.CreateSibling): Added `Block' argument.
12036         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
12037         label for the target of a `goto' and check whether we're not
12038         leaving a `finally'.
12039
12040 2004-04-27  Martin Baulig  <martin@ximian.com>
12041
12042         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12043         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
12044         just for returns).
12045
12046 2004-04-27  Martin Baulig  <martin@ximian.com>
12047
12048         * statement.cs (Block.AddLabel): Also check for implicit blocks
12049         and added a CS0158 check.
12050
12051 2004-04-27  Martin Baulig  <martin@ximian.com>
12052
12053         * flowanalysis.cs (FlowBranchingLoop): New class.
12054         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
12055         UsageVector's instead of an ArrayList.
12056         (FlowBranching.Label): Likewise.
12057         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
12058         (FlowBranching.AddBreakVector): New method.
12059
12060 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
12061
12062         * attribute.cs: Small regression fix: only convert the type if we
12063         the type is different, fixes System.Drawing build.
12064
12065 2004-04-27  Martin Baulig  <martin@ximian.com>
12066
12067         * attribute.cs (Attribute.Resolve): If we have a constant value
12068         for a named field or property, implicity convert it to the correct
12069         type.
12070
12071 2004-04-27  Raja R Harinath  <rharinath@novell.com>
12072
12073         * statement.cs (Block.Block): Implicit blocks share
12074         'child_variable_names' fields with parent blocks.
12075         (Block.AddChildVariableNames): Remove.
12076         (Block.AddVariable): Mark variable as "used by a child block" in
12077         every surrounding block.
12078         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
12079         been used in a child block, complain about violation of "Invariant
12080         meaning in blocks" rule.
12081         * cs-parser.jay (declare_local_variables): Don't use
12082         AddChildVariableNames.
12083         (foreach_statement): Don't create an implicit block: 'foreach'
12084         introduces a scope.
12085
12086 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
12087
12088         * convert.cs (ImplicitNumericConversion): 0 is also positive when
12089         converting from 0L to ulong.  Fixes 57522.
12090
12091 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12092
12093         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
12094         derived class hides via 'new' keyword field from base class (test-242.cs).
12095         TODO: Handle this in the more general way.
12096         
12097         * class.cs (CheckBase): Ditto.
12098
12099 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
12100
12101         * decl.cs (caching_flags): New member for storing cached values
12102         as bit flags.
12103         (MemberCore.Flags): New enum where bit flags for caching_flags
12104         are defined.
12105         (MemberCore.cls_compliance): Moved to caching_flags.
12106         (DeclSpace.Created): Moved to caching_flags.
12107
12108         * class.cs: Use caching_flags instead of DeclSpace.Created
12109         
12110 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
12111
12112         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
12113         if we are only a derived class, not a nested class.
12114
12115         * typemanager.cs: Same as above, but do this at the MemberLookup
12116         level (used by field and methods, properties are handled in
12117         PropertyExpr).   Allow for the qualified access if we are a nested
12118         method. 
12119
12120 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
12121
12122         * class.cs: Refactoring.
12123         (IMethodData): New inteface; Holds links to parent members
12124         to avoid member duplication (reduced memory allocation).
12125         (Method): Implemented IMethodData interface.
12126         (PropertyBase): New inner classes for get/set methods.
12127         (PropertyBase.PropertyMethod): Implemented IMethodData interface
12128         (Event): New inner classes for add/remove methods.
12129         (Event.DelegateMethod): Implemented IMethodData interface.
12130
12131         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
12132         EmitContext (related to class.cs refactoring).
12133
12134 2004-04-21  Raja R Harinath  <rharinath@novell.com>
12135
12136         * delegate.cs (Delegate.VerifyApplicability): If the number of
12137         arguments are the same as the number of parameters, first try to
12138         verify applicability ignoring  any 'params' modifier on the last
12139         parameter.
12140         Fixes #56442.
12141
12142 2004-04-16  Raja R Harinath  <rharinath@novell.com>
12143
12144         * class.cs (TypeContainer.AddIndexer): Use
12145         'ExplicitInterfaceName' to determine if interface name was
12146         explicitly specified.  'InterfaceType' is not initialized at this time.
12147         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
12148         Indexers array is already in the required order.  Initialize
12149         'IndexerName' only if there are normal indexers.
12150         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
12151         (TypeContainer.Emit): Emit DefaultMember attribute only if
12152         IndexerName is initialized.
12153         Fixes #56300.
12154
12155 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
12156
12157         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
12158         Fixes #57007
12159
12160 2004-04-15  Raja R Harinath  <rharinath@novell.com>
12161
12162         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
12163         attributes.
12164         Fix for #56456.
12165
12166         * attribute.cs (Attribute.Resolve): Check for duplicate named
12167         attributes.
12168         Fix for #56463.
12169
12170 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
12171
12172         * iterators.cs (MarkYield): track whether we are in an exception,
12173         and generate code accordingly.  Use a temporary value to store the
12174         result for our state.
12175
12176         I had ignored a bit the interaction of try/catch with iterators
12177         since their behavior was not entirely obvious, but now it is
12178         possible to verify that our behavior is the same as MS .NET 2.0
12179
12180         Fixes 54814
12181
12182 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
12183
12184         * iterators.cs: Avoid creating temporaries if there is no work to
12185         do. 
12186
12187         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
12188         Enumerations, use TypeManager.EnumToUnderlying and call
12189         recursively. 
12190
12191         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
12192         bug #57013
12193
12194         (This.Emit): Use EmitContext.EmitThis to emit our
12195         instance variable.
12196
12197         (This.EmitAssign): Ditto.
12198
12199         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
12200         codepaths, we will move all the functionality into
12201         Mono.CSharp.This 
12202
12203         (FieldExpr.EmitAssign): Ditto.
12204
12205         This fixes several hidden bugs that I uncovered while doing a code
12206         review of this today.
12207
12208         * codegen.cs (EmitThis): reworked so the semantics are more clear
12209         and also support value types "this" instances.
12210
12211         * iterators.cs: Changed so that for iterators in value types, we
12212         do not pass the value type as a parameter.  
12213
12214         Initialization of the enumerator helpers is now done in the caller
12215         instead of passing the parameters to the constructors and having
12216         the constructor set the fields.
12217
12218         The fields have now `assembly' visibility instead of private.
12219
12220 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
12221
12222         * expression.cs (Argument.Resolve): Check if fields passed as ref
12223         or out are contained in a MarshalByRefObject.
12224
12225         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
12226         another compiler type.
12227
12228 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12229
12230         * class.cs (Indexer.Define): use the new name checking method.
12231         Also, return false on an error.
12232         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
12233         (is_identifier_[start/part]_character): make static.
12234
12235 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
12236
12237         * expression.cs (Binary.ResolveOperator): Do no append strings
12238         twice: since we can be invoked more than once (array evaluation)
12239         on the same concatenation, take care of this here.  Based on a fix
12240         from Ben (bug #56454)
12241
12242 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
12243
12244         * codegen.cs: Fix another case where CS1548 must be reported (when 
12245         delay-sign isn't specified and no private is available #56564). Fix
12246         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
12247         error when MCS is used on the MS runtime and we need to delay-sign 
12248         (which seems unsupported by AssemblyBuilder - see #56621).
12249
12250 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
12251
12252         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
12253         (TypeManager.ComputeNamespaces): Faster implementation for
12254         Microsoft runtime.
12255
12256         * compiler.csproj: Updated AssemblyName to mcs.
12257
12258 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
12259
12260         * rootcontext.cs: Add new types to the boot resolution.
12261
12262         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
12263         MulticastDelegate is not allowed.
12264
12265         * typemanager.cs: Add new types to lookup: System.TypedReference
12266         and ArgIterator.
12267
12268         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
12269         check for TypedReference or ArgIterator, they are not allowed. 
12270
12271         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
12272         makes us properly catch 1510 in some conditions (see bug 56016 for
12273         details). 
12274
12275 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
12276
12277         * CryptoConvert.cs: update from corlib version
12278         with endian fixes.
12279
12280 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
12281
12282         * class.cs (Indexer.Define): Check indexername declaration
12283
12284 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
12285
12286         * attribute.cs (IsClsCompliant): Fixed problem with handling
12287         all three states (compliant, not-compliant, undetected).
12288
12289 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
12290
12291         * attribute.cs (Attribute): Location is now public.
12292         (Resolve): Store resolved arguments (pos_values) in attribute class.
12293         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
12294         (GetClsCompliantAttributeValue): New method that gets
12295         CLSCompliantAttribute value.
12296         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
12297         if exists else null.
12298         (AttributeTester): New class for CLS-Compliant verification routines.
12299
12300         * class.cs (Emit): Add CLS-Compliant verification.
12301         (Method.GetSignatureForError): Implemented.
12302         (Constructor.GetSignatureForError): Implemented
12303         (Constructor.HasCompliantArgs): Returns if constructor has
12304         CLS-Compliant arguments.
12305         (Constructor.Emit): Override.
12306         (Construcor.IsIdentifierClsCompliant): New method; For constructors
12307         is needed to test only parameters.
12308         (FieldBase.GetSignatureForError): Implemented.
12309         (TypeContainer): New member for storing base interfaces.
12310         (TypeContainer.FindMembers): Search in base interfaces too.
12311
12312         * codegen.cs (GetClsComplianceAttribute): New method that gets
12313         assembly or module CLSCompliantAttribute value.
12314         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
12315         for assembly.
12316         (ModuleClass.Emit): Add error 3012 test.
12317
12318         * const.cs (Emit): Override and call base for CLS-Compliant tests.
12319
12320         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
12321         state for all decl types.
12322         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
12323         if CLS-Compliant tests are required.
12324         (IsClsCompliaceRequired): New method. Analyze whether code
12325         must be CLS-Compliant.
12326         (IsExposedFromAssembly): New method. Returns true when MemberCore
12327         is exposed from assembly.
12328         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
12329         value or gets cached value.
12330         (HasClsCompliantAttribute): New method. Returns true if MemberCore
12331         is explicitly marked with CLSCompliantAttribute.
12332         (IsIdentifierClsCompliant): New abstract method. This method is
12333         used to testing error 3005.
12334         (IsIdentifierAndParamClsCompliant): New method. Common helper method
12335         for identifier and parameters CLS-Compliant testing.
12336         (VerifyClsCompliance): New method. The main virtual method for
12337         CLS-Compliant verifications.
12338         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
12339         null. I don't know why is null (too many public members !).
12340         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
12341         and get value of first CLSCompliantAttribute that found.
12342
12343         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
12344         (VerifyClsCompliance): Override and add extra tests.
12345
12346         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
12347         clscheck- disable CLS-Compliant verification event if assembly is has
12348         CLSCompliantAttribute(true).
12349
12350         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
12351         ApllyAttribute is now called in emit section as in the other cases.
12352         Possible future Emit integration.
12353         (IsIdentifierClsCompliant): New override.
12354         (VerifyClsCompliance): New override.
12355         (GetEnumeratorName): Returns full enum name.
12356
12357         * parameter.cs (GetSignatureForError): Implemented.
12358
12359         * report.cs (WarningData): New struct for Warning message information.
12360         (LocationOfPreviousError): New method.
12361         (Warning): New method. Reports warning based on the warning table.
12362         (Error_T): New method. Reports error based on the error table.
12363
12364         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
12365         verifications are done here.
12366
12367         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
12368
12369         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
12370         CLSCompliantAttribute.
12371         (all_imported_types): New member holds all imported types from other
12372         assemblies.
12373         (LoadAllImportedTypes): New method fills static table with exported types
12374         from all referenced assemblies.
12375         (Modules): New property returns all assembly modules.
12376
12377 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
12378
12379         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
12380         throwing a parser error.
12381
12382         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
12383         which removes the hardcoded get_/set_ prefixes for properties, as
12384         IL allows for the properties to be named something else.  
12385
12386         Bug #56013
12387
12388         * expression.cs: Do not override operand before we know if it is
12389         non-null.  Fix 56207
12390
12391 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12392
12393         * typemanager.cs: support for pinned variables.
12394
12395 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12396
12397         * decl.cs, typemanager.cs: Avoid using an arraylist
12398         as a buffer if there is only one result set.
12399
12400 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12401
12402         * expression.cs: Make sure you cant call a static method
12403         with an instance expression, bug #56174.
12404
12405 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
12406
12407         * class.cs (IsDuplicateImplementation): Improve error reporting to
12408         flag 663 (method only differs in parameter modifier).
12409
12410         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
12411         in preprocessor directives.
12412
12413         * location.cs (LookupFile): Allow for the empty path.
12414
12415         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
12416         better approach for some of that patch, but its failing with the
12417         CharSet enumeration.  For now try/catch will do.
12418
12419         * typemanager.cs: Do not crash if a struct does not have fields.
12420         Fixes 56150.
12421
12422 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12423
12424         * expression.cs: cs0213, cant fix a fixed expression.
12425         fixes 50231.
12426
12427 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12428
12429         * cs-parser.jay: detect invalid embeded statements gracefully.
12430         bug #51113.
12431
12432 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12433
12434         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
12435         As a regex:
12436         s/
12437         the invocation type may not be a subclass of the tye of the item/
12438         The type of the item must be a subclass of the invocation item.
12439         /g
12440
12441         Fixes bug #50820.
12442
12443 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
12444
12445         * attribute.cs: Added methods to get a string and a bool from an
12446         attribute. Required to information from AssemblyKeyFileAttribute,
12447         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
12448         * codegen.cs: Modified AssemblyName creation to include support for
12449         strongnames. Catch additional exceptions to report them as CS1548.
12450         * compiler.csproj: Updated include CryptoConvert.cs.
12451         * compiler.csproj.user: Removed file - user specific configuration.
12452         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
12453         Mono.Security assembly. The original class is maintained and tested in
12454         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
12455         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
12456         like CSC 8.0 (C# v2) supports.
12457         * Makefile: Added CryptoConvert.cs to mcs sources.
12458         * rootcontext.cs: Added new options for strongnames.
12459
12460 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
12461
12462         * driver.cs: For --expect-error, report error code `2'
12463         if the program compiled with no errors, error code `1' if
12464         it compiled with an error other than the one expected.
12465
12466 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
12467
12468         * compiler.csproj: Updated for Visual Studio .NET 2003.
12469         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
12470         * compiler.sln: Updated for Visual Studio .NET 2003.
12471
12472 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
12473
12474         * expression.cs: Fix bug #47234. We basically need to apply the
12475         rule that we prefer the conversion of null to a reference type
12476         when faced with a conversion to 'object' (csc behaviour).
12477
12478 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12479
12480         * statement.cs: Shorter form for foreach, eliminates
12481         a local variable. r=Martin.
12482
12483 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12484
12485         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
12486         checks if we can use brtrue/brfalse to test for 0.
12487         * expression.cs: use the above in the test for using brtrue/brfalse.
12488         cleanup code a bit.
12489
12490 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12491
12492         * expression.cs: Rewrite string concat stuff. Benefits:
12493
12494         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
12495         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
12496         rather than a concat chain.
12497
12498         * typemanager.cs: Add lookups for more concat overloads.
12499
12500 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12501
12502         * expression.cs: Emit shorter il code for array init.
12503
12504         newarr
12505         dup
12506         // set 1
12507
12508         // set 2
12509
12510         newarr
12511         stloc.x
12512
12513         ldloc.x
12514         // set 1
12515
12516         ldloc.x
12517         // set 2
12518
12519 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
12520
12521         * statement.cs: Before, two switch blocks would be merged if the
12522         total size of the blocks (end_item - begin_item + 1) was less than
12523         two times the combined sizes of the blocks.
12524
12525         Now, it will only merge if after the merge at least half of the
12526         slots are filled.
12527
12528         fixes 55885.
12529
12530 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
12531
12532         * class.cs : csc build fix for GetMethods(). See bug #52503.
12533
12534 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
12535
12536         * expression.cs: Make sure fp comparisons work with NaN.
12537         This fixes bug #54303. Mig approved this patch a long
12538         time ago, but we were not able to test b/c the runtime
12539         had a related bug.
12540
12541 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
12542
12543         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
12544
12545 2004-03-19  Martin Baulig  <martin@ximian.com>
12546
12547         * class.cs (MemberCore.IsDuplicateImplementation): Report the
12548         error here and not in our caller.
12549
12550 2004-03-19  Martin Baulig  <martin@ximian.com>
12551
12552         * interface.cs: Completely killed this file.
12553         (Interface): We're now a TypeContainer and live in class.cs.
12554
12555         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
12556         argument; we're now also called for interfaces.
12557         (TypeContainer.DefineMembers): Allow this method being called
12558         multiple times.
12559         (TypeContainer.GetMethods): New public method; formerly known as
12560         Interface.GetMethod().  This is used by PendingImplementation.
12561         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
12562         it's now private and non-static.
12563         (Interface): Moved this here; it's now implemented similar to
12564         Class and Struct.
12565         (Method, Property, Event, Indexer): Added `bool is_interface'
12566         argument to their .ctor's.
12567         (MemberBase.IsInterface): New public field.
12568
12569         * cs-parser.jay: Create normal Method, Property, Event, Indexer
12570         instances instead of InterfaceMethod, InterfaceProperty, etc.
12571         (opt_interface_base): Removed; we now use `opt_class_base' instead.
12572         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
12573
12574 2004-03-19  Martin Baulig  <martin@ximian.com>
12575
12576         * class.cs (MethodCore.IsDuplicateImplementation): New private
12577         method which does the CS0111 checking.
12578         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
12579         Use IsDuplicateImplementation().
12580
12581 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
12582
12583         * decl.cs (FindMemberToOverride): New method to find the correct
12584         method or property to override in the base class.
12585         * class.cs
12586             - Make Method/Property use the above method to find the
12587               version in the base class.
12588             - Remove the InheritableMemberSignatureCompare as it is now
12589               dead code.
12590
12591         This patch makes large code bases much faster to compile, as it is
12592         O(n) rather than O(n^2) to do this validation.
12593
12594         Also, it fixes bug 52458 which is that nested classes are not
12595         taken into account when finding the base class member.
12596
12597         Reviewed/Approved by Martin.
12598
12599 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
12600
12601         * interface.cs: In all interface classes removed redundant
12602         member initialization.
12603
12604 2004-03-16  Martin Baulig  <martin@ximian.com>
12605
12606         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12607
12608 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12609
12610         * decl.cs (DefineTypeAndParents): New helper method to define a
12611         type's containers before the type itself is defined;  This is a
12612         bug exposed by the recent changes to Windows.Forms when an
12613         implemented interface was defined inside a class that had not been
12614         built yet.   
12615
12616         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
12617
12618         (Check): Loop correctly to report errors modifiers
12619         (UNSAFE was not in the loop, since it was the same as TOP).
12620
12621         * interface.cs: Every interface member now takes a ModFlags,
12622         instead of a "is_new" bool, which we set on the base MemberCore. 
12623
12624         Every place where we called "UnsafeOk" in the interface, now we
12625         call the proper member (InterfaceMethod.UnsafeOK) instead to get
12626         the unsafe settings from the member declaration instead of the
12627         container interface. 
12628
12629         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
12630
12631         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12632         `set_indexer_name' to the pending bits (one per type).
12633
12634         We fixed a bug today that was picking the wrong method to
12635         override, since for properties the existing InterfaceMethod code
12636         basically ignored the method name.  Now we make sure that the
12637         method name is one of the valid indexer names.
12638
12639 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
12640  
12641         * support.cs (SeekableStreamReader): Keep track of stream byte
12642         positions and don't mix them with character offsets to the buffer.
12643
12644         Patch from Gustavo Giráldez
12645
12646 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
12647
12648         * interface.cs (InterfaceSetGetBase): Removed double member
12649         initialization, base class does it as well.
12650
12651 2004-03-13  Martin Baulig  <martin@ximian.com>
12652
12653         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
12654         when compiling corlib.
12655
12656 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
12657
12658         * convert.cs (ExplicitConversion): We were reporting an error on
12659         certain conversions (object_type source to a value type, when the
12660         expression was `null') before we had a chance to pass it through
12661         the user defined conversions.
12662
12663         * driver.cs: Replace / and \ in resource specifications to dots.
12664         Fixes 50752
12665
12666         * class.cs: Add check for duplicate operators.  Fixes 52477
12667
12668 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
12669
12670         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
12671         that are in the middle of the statements, not only at the end.
12672         Fixes #54987
12673
12674         * class.cs (TypeContainer.AddField): No longer set the
12675         `HaveStaticConstructor' flag, now we call it
12676         `UserDefineStaticConstructor' to diferentiate the slightly
12677         semantic difference.
12678
12679         The situation is that we were not adding BeforeFieldInit (from
12680         Modifiers.TypeAttr) to classes that could have it.
12681         BeforeFieldInit should be set to classes that have no static
12682         constructor. 
12683
12684         See:
12685
12686         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
12687
12688         And most importantly Zoltan's comment:
12689
12690         http://bugzilla.ximian.com/show_bug.cgi?id=44229
12691
12692         "I think beforefieldinit means 'it's ok to initialize the type sometime 
12693          before its static fields are used', i.e. initialization does not need
12694          to be triggered by the first access to the type. Setting this flag
12695          helps the JIT to compile better code, since it can run the static
12696          constructor at JIT time, and does not need to generate code to call it
12697          (possibly lots of times) at runtime. Unfortunately, mcs does not set
12698          this flag for lots of classes like String. 
12699          
12700          csc sets this flag if the type does not have an explicit static 
12701          constructor. The reasoning seems to be that if there are only static
12702          initalizers for a type, and no static constructor, then the programmer
12703          does not care when this initialization happens, so beforefieldinit
12704          can be used.
12705          
12706          This bug prevents the AOT compiler from being usable, since it 
12707          generates so many calls to mono_runtime_class_init that the AOT code
12708          is much slower than the JITted code. The JITted code is faster, 
12709          because it does not generate these calls if the vtable is type is
12710          already initialized, which is true in the majority of cases. But the
12711          AOT compiler can't do this."
12712
12713 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12714
12715         * class.cs (MethodData.Emit): Refactor the code so symbolic
12716         information is generated for destructors;  For some reasons we
12717         were taking a code path that did not generate symbolic information
12718         before. 
12719
12720 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12721
12722         * class.cs: Create a Constructor.CheckBase method that
12723         takes care of all validation type code. The method
12724         contains some code that was moved from Define.
12725
12726         It also includes new code that checks for duplicate ctors.
12727         This fixes bug #55148.
12728
12729 2004-03-09  Joshua Tauberer <tauberer@for.net>
12730
12731         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12732         a { ... }-style array creation invokes EmitStaticInitializers
12733         which is not good for reference-type arrays.  String, decimal
12734         and now null constants (NullCast) are not counted toward
12735         static initializers.
12736
12737 2004-03-05  Martin Baulig  <martin@ximian.com>
12738
12739         * location.cs (SourceFile.HasLineDirective): New public field;
12740         specifies whether the file contains or is referenced by a "#line"
12741         directive.
12742         (Location.DefineSymbolDocuments): Ignore source files which
12743         either contain or are referenced by a "#line" directive.        
12744
12745 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12746
12747         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12748         direct access to our parent, so check the method inline there.
12749
12750 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12751
12752         * expression.cs (Invocation.EmitCall): Miguel's last commit
12753         caused a regression. If you had:
12754
12755             T t = null;
12756             t.Foo ();
12757
12758         In Foo the implict this would be null.
12759
12760 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12761
12762         * expression.cs (Invocation.EmitCall): If the method is not
12763         virtual, do not emit a CallVirt to it, use Call.
12764
12765         * typemanager.cs (GetFullNameSignature): Improve the method to
12766         cope with ".ctor" and replace it with the type name.
12767
12768         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12769         as an argument the ConstructorBuilder where it is being defined,
12770         to catch the recursive constructor invocations.
12771
12772 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12773
12774         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12775         routines to check if a type is an enumerable/enumerator allow
12776         classes that implement the IEnumerable or IEnumerator interfaces.
12777
12778         * class.cs (Property, Operator): Implement IIteratorContainer, and
12779         implement SetYields.
12780
12781         (Property.Define): Do the block swapping for get_methods in the
12782         context of iterators.   We need to check if Properties also
12783         include indexers or not.
12784
12785         (Operator): Assign the Block before invoking the
12786         OperatorMethod.Define, so we can trigger the Iterator code
12787         replacement. 
12788
12789         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12790         Property and Operator classes are not created when we parse the
12791         declarator but until we have the block completed, so we use a
12792         singleton SimpleIteratorContainer.Simple to flag whether the
12793         SetYields has been invoked.
12794
12795         We propagate this setting then to the Property or the Operator to
12796         allow the `yield' to function.
12797
12798 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12799
12800         * codegen.cs: Implemented attribute support for modules.
12801         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12802         Assembly/Module functionality.
12803
12804         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12805         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12806         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12807
12808 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12809
12810         * interface.cs (FindMembers): The operation is performed on all base
12811         interfaces and not only on the first. It is required for future CLS Compliance patch.
12812
12813 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12814
12815         * statement.cs, codegen.cs:
12816         This patch deals with patterns such as:
12817
12818         public class List : IEnumerable {
12819
12820                 public MyEnumerator GetEnumerator () {
12821                         return new MyEnumerator(this);
12822                 }
12823
12824                 IEnumerator IEnumerable.GetEnumerator () {
12825                         ...
12826                 }
12827                 
12828                 public struct MyEnumerator : IEnumerator {
12829                         ...
12830                 }
12831         }
12832
12833         Before, there were a few things we did wrong:
12834         1) we would emit callvirt on a struct, which is illegal
12835         2) we emited ldarg when we needed to emit ldarga
12836         3) we would mistakenly call the interface methods on an enumerator
12837         type that derived from IEnumerator and was in another assembly. For example:
12838
12839         public class MyEnumerator : IEnumerator
12840
12841         Would have the interface methods called, even if there were public impls of the
12842         method. In a struct, this lead to invalid IL code.
12843
12844 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12845
12846         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12847           renamed to Emit.
12848
12849         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12850
12851 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12852
12853         * cs-parser.jay: Fix small regression: we were not testing V2
12854         compiler features correctly.
12855
12856         * interface.cs: If the emit context is null, then create one
12857
12858 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12859
12860         * decl.cs (GetSignatureForError): New virtual method to get full name
12861           for error messages.
12862
12863         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12864           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12865
12866         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12867           Duplicated members and code in these classes has been removed.
12868           Better encapsulation in these classes.
12869
12870 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12871
12872         * assign.cs (Assign.DoResolve): When dealing with compound
12873         assignments, there is a new rule in ECMA C# 2.4 (might have been
12874         there before, but it is documented here) that states that in:
12875
12876         a op= b;
12877
12878         If b is of type int, and the `op' is a shift-operator, then the
12879         above is evaluated as:
12880
12881         a = (int) a op b 
12882
12883         * expression.cs (Binary.ResolveOperator): Instead of testing for
12884         int/uint/long/ulong, try to implicitly convert to any of those
12885         types and use that in pointer arithmetic.
12886
12887         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12888         method to print information for from the type, not from the
12889         null-method we were given.
12890
12891 2004-02-01  Duncan Mak  <duncan@ximian.com>
12892
12893         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12894         parsing for cmd, fixes bug #53694.
12895
12896 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12897
12898         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12899         in the member name duplication tests. Property and operator name duplication
12900         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12901
12902 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12903
12904         * interface.cs (PopulateMethod): Fixed crash when interface method
12905         returns not existing type (error test cs0246-3.cs).
12906
12907 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12908
12909         * cs-parser.jay (interface_accessors): Re-write actions to also
12910         store attributes attached to get and set methods. Fix spelling
12911         while at it.
12912
12913         (inteface_property_declaration): Modify accordingly.
12914
12915         (InterfaceAccessorInfo): New helper class to store information to pass
12916         around between rules that use interface_accessors.
12917
12918         * interface.cs (Emit): Apply attributes on the get and set
12919         accessors of properties and indexers too.
12920
12921         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12922         right MethodBuilder when applying attributes to the get and set accessors.
12923
12924 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12925
12926         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12927
12928 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12929
12930         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12931
12932 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12933
12934         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12935         changes that treat `yield' specially when present before `break'
12936         or `return' tokens.
12937
12938         * cs-tokenizer.cs: yield is no longer a keyword.
12939
12940 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12941
12942         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12943         setting for default constructors.
12944         For default constructors are almost every time set wrong Modifier. The
12945         generated IL code has been alright. But inside mcs this values was
12946         wrong and this was reason why several of my CLS Compliance tests
12947         failed.
12948
12949 2004-01-22  Martin Baulig  <martin@ximian.com>
12950
12951         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12952         not a QualifiedIdentifier.  This is what `type_name_expression'
12953         was previously doing.
12954         (type_name_expression): Removed; the code is now in
12955         `namespace_or_type_name'.
12956         (qualified_identifier): Removed, use `namespace_or_type_name'
12957         instead.
12958         (QualifiedIdentifier): Removed this class.      
12959
12960 2004-01-22  Martin Baulig  <martin@ximian.com>
12961
12962         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12963         not a string as alias name.
12964
12965 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12966
12967         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12968         #52730 bug, and instead compute correctly the need to use a
12969         temporary variable when requesting an address based on the
12970         static/instace modified of the field and the constructor.
12971  
12972 2004-01-21  Martin Baulig  <martin@ximian.com>
12973
12974         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12975         class and namespace before looking up aliases.  Fixes #52517.
12976
12977 2004-01-21  Martin Baulig  <martin@ximian.com>
12978
12979         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12980         assinged in a 'try'; fixes exception4.cs.
12981
12982 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12983         * class.cs : Implemented parameter-less constructor for TypeContainer
12984
12985         * decl.cs: Attributes are now stored here. New property OptAttributes
12986
12987         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12988
12989         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12990
12991 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12992
12993         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12994           (CSharpSignature): New method for indexer and property signature.
12995
12996 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12997
12998         * pending.cs (IsVirtualFilter): Faster implementation.
12999
13000 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13001
13002         * typemanager.cs: Avoid inclusion of same assembly more than once.
13003
13004 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13005
13006         * cs-parser.jay: Fixed problem where the last assembly attribute
13007           has been applied also to following declaration (class, struct, etc.)
13008           
13009 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
13010
13011         * class.cs: Added error CS0538, CS0539 reporting.
13012         Fixed crash on Microsoft runtime when field type is void.
13013
13014         * cs-parser.jay: Added error CS0537 reporting.
13015
13016         * pending.cs: Added error CS0535 reporting.
13017         Improved error report for errors CS0536, CS0534.
13018
13019 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
13020
13021         Merge a few bits from the Anonymous Method MCS tree.
13022
13023         * statement.cs (ToplevelBlock): New class for toplevel methods,
13024         will hold anonymous methods, lifted variables.
13025
13026         * cs-parser.jay: Create toplevel blocks for delegates and for
13027         regular blocks of code. 
13028
13029 2004-01-20  Martin Baulig  <martin@ximian.com>
13030
13031         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
13032         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
13033         and `NeedExplicitReturn'; added `IsLastStatement'.
13034         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
13035         have a `ReturnLabel' or we're not unreachable.
13036
13037         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
13038         child's reachability; don't just override ours with it.  Fixes
13039         #58058 (lluis's example).
13040         (FlowBranching): Added public InTryOrCatch(), InCatch(),
13041         InFinally(), InLoop(), InSwitch() and
13042         BreakCrossesTryCatchBoundary() methods.
13043
13044         * statement.cs (Return): Do all error checking in Resolve().
13045         Unless we are the last statement in a top-level block, always
13046         create a return label and jump to it.
13047         (Break, Continue): Do all error checking in Resolve(); also make
13048         sure we aren't leaving a `finally'.
13049         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
13050         statement in a top-level block.
13051         (Block.Flags): Added `IsDestructor'.
13052         (Block.IsDestructor): New public property.
13053
13054 2004-01-20  Martin Baulig  <martin@ximian.com>
13055
13056         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
13057
13058 2004-01-20  Martin Baulig  <martin@ximian.com>
13059
13060         * statement.cs (Statement.ResolveUnreachable): New public method.
13061         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
13062         (Block.Resolve): Resolve unreachable statements.
13063
13064 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13065
13066         * expression.cs: We need to fix the case where we do
13067         not have a temp variable here.
13068
13069         * assign.cs: Only expression compound assignments need
13070         temporary variables.
13071
13072 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
13073
13074         * flowanalysis.cs: Reduce memory allocation in a few ways:
13075           - A block with no variables should not allocate a bit
13076             vector for itself.
13077           - A method with no out parameters does not need any tracking
13078             for assignment of the parameters, so we need not allocate
13079             any data for it.
13080           - The arrays:
13081                 public readonly Type[] VariableTypes;
13082                 public readonly string[] VariableNames;
13083             Are redundant. The data is already stored in the variable
13084             map, so we need not allocate another array for it.
13085           - We need to add alot of checks for if (params | locals) == null
13086             due to the first two changes.
13087
13088 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
13089
13090         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
13091         implement IMemoryLocation, we store a copy on a local variable and
13092         take the address of it.  Patch from Benjamin Jemlich
13093
13094         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
13095         to use a special "type_name_expression" rule which reduces the
13096         number of "QualifiedIdentifier" classes created, and instead
13097         directly creates MemberAccess expressions.
13098
13099 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
13100
13101         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
13102         that fixes #52853.  Null literal assignment to ValueType
13103
13104         * class.cs (MethodData.Emit): Instead of checking the name of the
13105         method to determine if its a destructor, create a new derived
13106         class from Method called Destructor, and test for that.  
13107
13108         * cs-parser.jay: Create a Destructor object instead of a Method.  
13109
13110         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
13111
13112         Fixes: 52933
13113
13114 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
13115
13116         * expression.cs (Binary.ResolveOperator): Perform an implicit
13117         conversion from MethodGroups to their delegate types on the
13118         Addition operation.
13119
13120         * delegate.cs: Introduce a new class DelegateCreation that is the
13121         base class for `NewDelegate' and `ImplicitDelegateCreation',
13122         factor some code in here.
13123
13124         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
13125         conversion from MethodGroups to compatible delegate types. 
13126
13127         * ecore.cs (Expression.Resolve): Do not flag error 654
13128         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
13129         we allow conversions from MethodGroups to delegate types now.
13130
13131         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
13132         assignments in v2 either.
13133
13134 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
13135
13136         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
13137         static read-only fields in ctors.
13138
13139         Applied patch from Benjamin Jemlich 
13140
13141         * expression.cs (UnaryMutator): Avoid leaking local variables. 
13142
13143 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
13144
13145         * cs-tokenizer.cs (IsCastToken): Allow the various native types
13146         here to return true, as they can be used like this:
13147
13148                 (XXX) int.MEMBER ()
13149
13150         Fixed 49836 and all the other dups
13151
13152 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
13153
13154         * driver.cs: Implement /win32res and /win32icon.
13155
13156 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
13157
13158         * cs-parser.jay: Add a rule to improve error handling for the
13159         common mistake of placing modifiers after the type.
13160
13161 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
13162
13163         * cs-parser.jay (interface_event_declaration): Catch
13164         initialization of events on interfaces, and report cs0068
13165
13166         * cs-parser.jay (interface_event_declaration): Catch
13167         initialization of events. 
13168
13169         * ecore.cs: Better report missing constructors.
13170
13171         * expression.cs (Binary.ResolveOperator): My previous bug fix had
13172         the error reporting done in the wrong place.  Fix.
13173
13174         * expression.cs (Binary.ResolveOperator): Catch the 
13175         operator + (E x, E y) error earlier, and later allow for implicit
13176         conversions in operator +/- (E e, U x) from U to the underlying
13177         type of E.
13178
13179         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
13180         52596, if the container class is abstract, the default constructor
13181         is protected otherwise its public (before, we were always public).
13182
13183         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
13184         fixed statement.
13185
13186         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
13187         Jemlich that fixes bug #52597, MCS was generating invalid code for
13188         idisposable structs.   Thanks to Ben for following up with this
13189         bug as well.
13190
13191 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * driver.cs: Allow assemblies without code to be generated, fixes
13194         52230.
13195
13196 2004-01-07  Nick Drochak <ndrochak@gol.com>
13197
13198         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
13199
13200 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
13201
13202         * cs-parser.jay: Add rules to improve error reporting if fields or
13203         methods are declared at the namespace level (error 116)
13204
13205         * Add rules to catch event add/remove
13206
13207 2004-01-04  David Sheldon <dave-mono@earth.li>
13208
13209   * expression.cs: Added matching ")" to error message for 
13210   CS0077
13211
13212 2004-01-03 Todd Berman <tberman@gentoo.org>
13213
13214         * ecore.cs, attribute.cs:
13215         Applying fix from #52429.
13216
13217 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13218
13219         * ecore.cs, expression.cs, statement.cs:
13220         Total rewrite of how we handle branching. We
13221         now handle complex boolean expressions with fewer
13222         jumps. As well if (x == 0) no longer emits a ceq.
13223
13224         if (x is Foo) is much faster now, because we generate
13225         better code.
13226
13227         Overall, we get a pretty big improvement on our benchmark
13228         tests. The code we generate is smaller and more readable.
13229
13230         I did a full two-stage bootstrap. The patch was reviewed
13231         by Martin and Miguel.
13232
13233 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13234
13235         * cs-parser.jay: Make primary_expression not take a QI.
13236         we dont need this because the member_access rule covers
13237         us here. So we replace the rule with just IDENTIFIER.
13238
13239         This has two good effects. First, we remove a s/r conflict.
13240         Second, we allocate many fewer QualifiedIdentifier objects.
13241
13242 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13243
13244         * attribute.cs: Handle MarshalAs attributes as pseudo, and
13245         set the correct information via SRE. This prevents
13246         hanging on the MS runtime. Fixes #29374.
13247
13248 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
13249
13250         * convert.cs: correctly handle conversions to value types
13251         from Enum and ValueType as unboxing conversions.
13252
13253         Fixes bug #52569. Patch by Benjamin Jemlich.
13254
13255 2004-01-02  Ravi Pratap  <ravi@ximian.com>
13256
13257         * expression.cs (BetterConversion): Prefer int -> uint
13258         over int -> ulong (csc's behaviour). This fixed bug #52046.
13259
13260 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13261
13262         * decl.cs (MemberCache.FindMembers): now returns a
13263         MemberInfo [].
13264
13265         * typemanager.cs: In general, go with with ^^.
13266         (CopyNewMethods): take an IList.
13267         (RealMemberLookup): Only allocate an arraylist
13268         if we copy from two sets of methods.
13269
13270         This change basically does two things:
13271         1) Fewer array lists allocated due to CopyNewMethods.
13272         2) the explicit cast in MemberList costed ALOT.
13273
13274 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
13275
13276         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
13277         a hashtable to avoid needless string allocations when an identifier is
13278         used more than once (the common case).
13279
13280 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13281
13282         * pending.cs: MS's TypeBuilder.GetInterfaces ()
13283         is broken, it will not return anything. So, we
13284         have to use the information we have in mcs to
13285         do the task.
13286
13287         * typemanager.cs: Add a cache for GetInterfaces,
13288         since this will now be used more often (due to ^^)
13289
13290         (GetExplicitInterfaces) New method that gets the
13291         declared, not effective, interfaces on a type
13292         builder (eg, if you have interface IFoo, interface
13293         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
13294         { IBar }.
13295
13296         This patch makes MCS able to bootstrap itself on
13297         Windows again.
13298
13299 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
13300
13301         * expression.cs: Remove the Nop's that Miguel put
13302         in by mistake.
13303
13304 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13305
13306         * report.cs, codegen.cs: Give the real stack trace to
13307         the error when an exception is thrown.
13308
13309 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13310
13311         * decl.cs: only allocate hashtables for ifaces if 
13312         it is an iface!
13313
13314 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13315
13316         * expression.cs: fix the error from cs0121-2.cs
13317         (a parent interface has two child interfaces that
13318         have a function with the same name and 0 params
13319         and the function is called through the parent).
13320
13321 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13322
13323         * class.cs, rootcontext.cs, typmanager.cs: do not
13324         leak pointers.
13325
13326 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
13327
13328         * codegen.cs: remove stack for the ec flow branching.
13329         It is already a linked list, so no need.
13330
13331 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
13332
13333         * Makefile: Allow custom profiler here.
13334
13335 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13336
13337         * typemanager.cs (LookupType):
13338           - Use a static char [], because split takes
13339             a param array for args, so it was allocating
13340             every time.
13341           - Do not store true in a hashtable, it boxes.
13342
13343 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
13344
13345         * flowanalysis.cs: bytify common enums.
13346
13347 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13348
13349         * modifiers.cs: Add a new set of flags for the
13350         flags allowed on explicit interface impls.
13351         * cs-parser.jay: catch the use of modifiers in
13352         interfaces correctly.
13353         * class.cs: catch private void IFoo.Blah ().
13354
13355         All related to bug #50572.
13356
13357 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13358
13359         * decl.cs: Rewrite the consistant accessability checking.
13360         Accessability is not linear, it must be implemented in
13361         a tableish way. Fixes #49704.
13362
13363 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
13364
13365         * expression.cs: Handle negation in a checked context.
13366         We must use subtraction from zero. Fixes #38674.
13367
13368 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13369
13370         * class.cs: Ignore static void main in DLLs.
13371         * rootcontext.cs: Handle the target type here,
13372         since we are have to access it from class.cs
13373         * driver.cs: account for the above.
13374
13375 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
13376
13377         * report.cs: Give line numbers and files if available.
13378
13379 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
13380
13381         * driver.cs: Implement /addmodule.
13382
13383         * typemanager.cs:  Change 'modules' field so it now contains Modules not
13384         ModuleBuilders.
13385
13386 2003-12-20  Martin Baulig  <martin@ximian.com>
13387
13388         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
13389         (FieldBase.IsAssigned): Removed this field.
13390         (FieldBase.SetAssigned): New public method.
13391         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
13392
13393 2003-12-20  Martin Baulig  <martin@ximian.com>
13394
13395         * expression.cs (LocalVariableReference.DoResolve): Don't set
13396         `vi.Used' if we're called from DoResolveLValue().
13397
13398         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
13399         returns the usage vector it just merged into the current one -
13400         pass this one to UsageWarning().
13401         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
13402         of the `EmitContext', don't call this recursively on our children.
13403
13404 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
13405
13406         * driver.cs: Implement /target:module.
13407
13408 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
13409
13410         * support.cs (CharArrayHashtable): New helper class.
13411
13412         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
13413         char arrays, not strings, so we can avoid creating a string in
13414         consume_identifier if the identifier is a keyword.
13415
13416 2003-12-16  Martin Baulig  <martin@ximian.com>
13417
13418         * statement.cs (LocalInfo.Assigned): Removed this property.
13419         (LocalInfo.Flags): Removed `Assigned'.
13420         (LocalInfo.IsAssigned): New public method; takes the EmitContext
13421         and uses flow analysis.
13422         (Block.UsageWarning): Made this method private.
13423         (Block.Resolve): Call UsageWarning() if appropriate.
13424
13425         * expression.cs (LocalVariableReference.DoResolve): Always set
13426         LocalInfo.Used here.
13427
13428 2003-12-13  Martin Baulig  <martin@ximian.com>
13429
13430         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
13431         any value here; we're now using flow analysis to figure out
13432         whether a statement/block returns a value.
13433
13434 2003-12-13  Martin Baulig  <martin@ximian.com>
13435
13436         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
13437         working again.
13438         (FlowBranching.MergeFinally): Don't call
13439         `branching.CheckOutParameters()' here, this is called in
13440         MergeTopBlock().
13441         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
13442         when adding the `finally' vector.       
13443
13444 2003-12-13  Martin Baulig  <martin@ximian.com>
13445
13446         * flowanalysis.cs
13447         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
13448         actually work and also fix #48962.
13449
13450 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
13451
13452         * decl.cs: Do not check System.Object for nested types,
13453         since we know it does not have any. Big bang for buck:
13454
13455         BEFORE:
13456            Run 1:   8.35 seconds
13457            Run 2:   8.32 seconds
13458            corlib:  17.99 seconds
13459         AFTER:
13460            Run 1:   8.17 seconds
13461            Run 2:   8.17 seconds
13462            corlib:  17.39 seconds
13463
13464 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13465
13466         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13467         time we are returning 0 members, so we save alot here.
13468
13469 2003-12-11  Martin Baulig  <martin@ximian.com>
13470
13471         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13472         `MergeChild()', also just take the `FlowBranching' as argument;
13473         call Merge() on it and return the result.
13474         (FlowBranching.Merge): We don't need to do anything if we just
13475         have one sibling.
13476
13477 2003-12-11  Martin Baulig  <martin@ximian.com>
13478
13479         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13480         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13481         Maurer for this idea.
13482
13483 2003-12-11  Martin Baulig  <martin@ximian.com>
13484
13485         * flowanalysis.cs (MergeResult): This class is now gone; we now
13486         use the `UsageVector' for this.  The reason for this is that if a
13487         branching just has one sibling, we don't need to "merge" them at
13488         all - that's the next step to do.
13489         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13490         `MergeResult'.
13491
13492 2003-12-11  Martin Baulig  <martin@ximian.com>
13493
13494         Reworked flow analyis and made it more precise and bug-free.  The
13495         most important change is that we're now using a special `Reachability'
13496         class instead of having "magic" meanings of `FlowReturns'.  I'll
13497         do some more cleanups and optimizations and also add some more
13498         documentation this week.
13499
13500         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13501         largely reworked this class.
13502         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13503         the new `Reachability' class instead of having "magic" values here.
13504         (FlowBranching): We're now using an instance of `Reachability'
13505         instead of having separate `Returns', `Breaks' etc. fields.
13506
13507         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13508         based on flow analysis; ignore the return value of block.Emit ().
13509
13510 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13511
13512         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13513         if they are private.
13514
13515 2003-12-09  Martin Baulig  <martin@ximian.com>
13516
13517         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13518         call them directly on the UsageVector.
13519
13520 2003-12-09  Martin Baulig  <martin@ximian.com>
13521
13522         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13523         Changed return type from `FlowReturns' to `Reachability'.
13524
13525 2003-12-09  Martin Baulig  <martin@ximian.com>
13526
13527         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13528         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13529         `Reachable' fields with a single `Reachability' one.
13530
13531 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13532
13533         * class.cs (FindMembers): Remove foreach's.
13534
13535         Bootstrap times:
13536
13537         BEFORE
13538                 Run 1:   8.74 seconds
13539                 Run 2:   8.71 seconds
13540
13541         AFTER
13542                 Run 1:   8.64 seconds
13543                 Run 2:   8.58 seconds
13544
13545
13546 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13547
13548         * cs-parser.jay:
13549         * gen-treedump.cs:
13550         * statement.cs:
13551         This patch does a few things:
13552                 1. EmptyStatement is now a singleton, so it is never reallocated.
13553                 2. All blah is EmptyStatement constructs have been changed to
13554                    blah == EmptyStatement.Value, which is much faster and valid
13555                    now that EmptyStatement is a singleton.
13556                 3. When resolving a block, rather than allocating a new array for
13557                    the non-empty statements, empty statements are replaced with
13558                    EmptyStatement.Value
13559                 4. Some recursive functions have been made non-recursive.
13560         Mainly the performance impact is from (3), however (1) and (2) are needed for
13561         this to work. (4) does not make a big difference in normal situations, however
13562         it makes the profile look saner.
13563
13564         Bootstrap times:
13565
13566         BEFORE
13567         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13568         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13569         Total memory allocated: 56397 KB
13570
13571         AFTER
13572         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13573         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13574         Total memory allocated: 55666 KB
13575
13576 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13577
13578         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13579         than the hashtable in a hashtable version
13580
13581         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13582         we always end up concating a string. This results in a huge perf
13583         loss, because many strings have to be tracked by the GC. In this
13584         patch, we first use a hashtable that works with two keys, so that
13585         the strings do not need to be concat'ed.
13586
13587         Bootstrap times:
13588         BEFORE
13589                 Run 1:   8.74 seconds
13590                 Run 2:   8.71 seconds
13591
13592         AFTER
13593                 Run 1:   8.65 seconds
13594                 Run 2:   8.56 seconds
13595
13596 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13597
13598         * Makefile: Add a new target `do-time' that does a quick and simple
13599         profile, leaving easy to parse output.
13600
13601 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13602
13603         * codegen.cs (Init): Create the dynamic assembly with 
13604         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13605
13606 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13607
13608         * support.cs: Make the PtrHashtable use only one
13609         instance of its comparer.
13610
13611 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13612
13613         * typemanager.cs: Fix lookup of GetNamespaces.
13614
13615 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13616
13617         * expression.cs: Removed redundant line.
13618
13619         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13620         ArrayLists, use for loops with bounds.  
13621
13622         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13623         arraylist.
13624
13625         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13626         arraylists, use for loop with bounds.
13627
13628         The above three changes give us a 0.071 second performance
13629         improvement out of 3.294 seconds down to 3.223.  On my machine
13630         the above changes reduced the memory usage by 1,387 KB during
13631         compiler bootstrap.
13632
13633         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13634         QualifiedIdentifiers.  Before we created a new string through
13635         concatenation, and mostly later on, the result would be
13636         manipulated by DecomposeQI through string manipulation.
13637
13638         This reduced the compiler memory usage for bootstrapping from
13639         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13640         compile times in 0.05 seconds.
13641
13642 2003-11-28  Dick Porter  <dick@ximian.com>
13643
13644         * support.cs: Do string compares with the Invariant culture.
13645
13646         * rootcontext.cs: 
13647         * gen-treedump.cs: 
13648         * expression.cs: 
13649         * driver.cs: 
13650         * decl.cs: 
13651         * codegen.cs: 
13652         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13653         the comparison is done with the Invariant culture.
13654
13655 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13656
13657         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13658         GetEnumerator method.
13659
13660         (ProbeCollectionType): Iterate starting at the most specific type
13661         upwards looking for a GetEnumerator
13662
13663         * expression.cs: Shift count can be up to 31 for int/uint and 63
13664         for long/ulong.
13665
13666 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13667
13668         * statement.cs (Block.LookupLabel): Also look for the label on the
13669         children blocks.  Use a hash table to keep track of visited
13670         nodes. 
13671
13672         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13673         we actually did transform the other operand, otherwise fall back
13674         to the common codepath that casts to long.
13675
13676         * cs-tokenizer.cs: Use the same code pattern as the int case.
13677         Maybe I should do the parsing myself, and avoid depending on the
13678         Parse routines to get this done.
13679
13680 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13681
13682         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13683         which fixes bug 51347.  This time test it.
13684
13685         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13686         attributes for example can not tell the difference between these.
13687         The difference was only a syntax feature of the language. 
13688
13689         * attribute.cs: Apply attributes to delegates.
13690
13691         * delegate.cs: Call the apply attributes method.
13692
13693 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13694
13695         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13696         comparing 0 vs Byte.MinValue, not the value
13697
13698         (ImplicitConversionRequired): When reporting a conversion error,
13699         use error 31 to print out the constant error instead of the
13700         simpler 29.
13701
13702         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13703         which fixes bug 51347.
13704
13705 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13706
13707         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13708         which fixes the -warnaserror command line option.
13709
13710 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13711
13712         * cfold.cs (DoNumericPromotions): During constant folding of
13713         additions on UIntConstant, special case intconstants with
13714         IntConstants like we do on the expression binary operator. 
13715
13716 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13717
13718         * convert.cs (ImplicitReferenceConversion): We were missing a case
13719         (System.Enum are not value types or class types, so we need to
13720         classify them separatedly).
13721
13722         * driver.cs: We do not support error 2007.
13723
13724 2003-11-12 Jackson Harper <jackson@ximian.com>
13725
13726         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13727         system directory. Also use the full file name so users can
13728         libraries names mscorlib-o-tron.dll in a non system dir.
13729
13730 2003-11-10  Martin Baulig  <martin@ximian.com>
13731
13732         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13733         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13734         calling `ResolveType()' on them, directly assign their `Type'.
13735
13736 2003-11-08  Martin Baulig  <martin@ximian.com>
13737
13738         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13739         return value and the `out parent' parameter.
13740         (TypeContainer.DefineType): Moved the CS0644 check into
13741         GetClassBases().  Don't pass the interface types to the
13742         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13743         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13744
13745         * ecore.cs (TypeExpr.IsAttribute): New property.
13746         (TypeExpr.GetInterfaces): New method.
13747
13748         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13749         TypeExpr instead of a Type.
13750         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13751         (Interface.DefineType): Don't pass the interface types to the
13752         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13753         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13754
13755         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13756         instead of a `Type[]'.
13757         (TypeManager.RegisterBuilder): Likewise.
13758         (TypeManager.AddUserInterface): Likewise.
13759         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13760         `Type[]' and also return a `TypeExpr[]'.
13761         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13762
13763 2003-11-08  Martin Baulig  <martin@ximian.com>
13764
13765         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13766         Expression.     
13767
13768 2003-11-08  Martin Baulig  <martin@ximian.com>
13769
13770         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13771         TypeManager.ResolveExpressionTypes().
13772
13773         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13774         instead of an Expression.
13775         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13776         (TypeExpression): New public class; formerly known as `TypeExpr'.
13777
13778         * expression.cs (ComposedCast): Derive from TypeExpr.
13779
13780         * typemanager.cs (TypeManager.system_*_expr): These are now
13781         TypExpr's instead of Expression's.
13782         (TypeManager.ResolveExpressionTypes): New public static function;
13783         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13784         of them.        
13785
13786 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13787
13788         * expression.cs (New.DoResolve): Do not dereference value that
13789         might be a null return.
13790
13791         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13792         sure that the constant value has the right type.  Fixes an
13793         unreported bug, similar to 50425.
13794
13795         * const.cs (Const.LookupConstantValue): Call
13796         ImplicitStandardConversionExists before doing a conversion to
13797         avoid havng the TypeManager.ChangeType do conversions.
13798
13799         Reduced the number of casts used
13800
13801         (Const.ChangeType): New routine to enable reuse of the constant
13802         type changing code from statement.
13803
13804         * typemanager.cs (ChangeType): Move common initialization to
13805         static global variables.
13806
13807         Fixes #50425.
13808
13809         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13810         every value type to go through, even if it was void.  Fix that. 
13811
13812         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13813         character of the define, and the is_identifier_part_character for
13814         the rest of the string.
13815
13816 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13817
13818         * expression.cs (UnaryMutator.EmitCode): When I updated
13819         LocalVariableReference.DoResolve, I overdid it, and dropped an
13820         optimization done on local variable references.
13821
13822 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13823
13824         * ecore.cs: Convert the return from Ldlen into an int.
13825
13826 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13827
13828         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13829         the accessibility, this is a special case for toplevel non-public
13830         classes (internal for instance).
13831
13832 2003-10-20  Nick Drochak <ndrochak@gol.com>
13833
13834         * ecore.cs: Fix typo and build.  Needed another right paren.
13835
13836 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13837
13838         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13839         `internal' case regular and protected, but not allowing protected
13840         to be evaluated later.  Bug 49840
13841
13842 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13845         to kb.Nlast, and not the kb.nFirst to isolate the switch
13846         statement.
13847
13848         Extract the underlying type, so enumerations of long/ulong are
13849         treated like long/ulong.
13850
13851 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13852
13853         * expression.cs (New): Overload the meaning of RequestedType to
13854         track the possible creation of the NewDelegate type, since
13855         DoResolve is invoked more than once for new constructors on field
13856         initialization.
13857
13858         See bugs: #48800 and #37014
13859
13860         * cs-parser.jay (declare_local_constants): Take an arraylist
13861         instead of a single constant.
13862
13863         (local_constant_declaration): It should take a
13864         constant_declarators, not a constant_declarator.  Fixes 49487
13865
13866         * convert.cs: Fix error report.
13867
13868 2003-10-13 Jackson Harper <jackson@ximian.com>
13869
13870         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13871         bug #49611
13872
13873 2003-10-09  Martin Baulig  <martin@ximian.com>
13874
13875         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13876         to the .ctor.
13877         (MethodCore.DoDefineParameters): Removed the TypeContainer
13878         argument; use the DeclSpace which was passed to the .ctor instead.
13879         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13880         TypeContainer; we only need a DeclSpace here.
13881
13882 2003-10-09  Martin Baulig  <martin@ximian.com>
13883
13884         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13885         to the .ctor.
13886         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13887         EmitContext's .ctor.    
13888
13889 2003-10-09  Martin Baulig  <martin@ximian.com>
13890
13891         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13892         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13893         AsAccessible(), moved them as well.
13894
13895         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13896
13897 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13898
13899         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13900
13901 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13902
13903         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13904         generation for >=, as spotted by Paolo, bug 48679.  
13905         Patch from David Waite.
13906
13907         * cs-tokenizer.cs: Add handling for #pragma.
13908
13909         * cs-parser.jay: Allow for both yield and yield return in the
13910         syntax.  The anti-cobolization of C# fight will go on!
13911
13912         * class.cs (TypeBuilder.DefineType): Catch error condition here
13913         (Parent.DefineType erroring out and returning null).
13914
13915         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13916         coping with enumerations variables, we were mistakenly processing
13917         them as a regular value type instead of built-in types.  Fixes the
13918         bug #48063
13919
13920         * typemanager.cs (IsBuiltinOrEnum): New method.
13921
13922 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13923
13924         * cs-parser.jay: Upgrade: yield now needs the return clause.
13925
13926 2003-09-19  Martin Baulig  <martin@ximian.com>
13927
13928         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13929         `MemberCache parent' argument.  Normally, an interface doesn't
13930         have a parent type except System.Object, but we use this in gmcs
13931         for generic type parameters.
13932
13933 2003-09-18  Martin Baulig  <martin@ximian.com>
13934
13935         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13936         on `type.IsInterface'; don't check whether the type has a parent
13937         to determine whether it's an interface.
13938
13939 2003-09-15  Martin Baulig  <martin@ximian.com>
13940
13941         * class.cs (TypeContainer.DefineType): Added an error flag to
13942         avoid reporting duplicate CS0146's ("class definition is
13943         circular.").
13944
13945         * driver.cs (Driver.MainDriver): Abort if
13946         RootContext.ResolveTree() reported any errors.
13947
13948 2003-09-07  Martin Baulig  <martin@ximian.com>
13949
13950         * report.cs (Error, Warning): Added overloaded versions which take
13951         a `params object[] args' and call String.Format().
13952
13953 2003-09-07  Martin Baulig  <martin@ximian.com>
13954
13955         * decl.cs (DeclSpace..ctor): Don't call
13956         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13957         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13958         (DeclSpace.RecordDecl): New method.
13959
13960         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13961
13962 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13963
13964         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13965         value attributes to be applied to ParameterBuilders.
13966
13967         * class.cs (MethodCore.LabelParameters): Make static and more
13968         generic so that it can be used from other places - like interface
13969         methods, for instance.
13970
13971         * interface.cs (Interface.Emit): Call LabelParameters before
13972         emitting attributes on the InterfaceMethod.
13973
13974 2003-08-26  Martin Baulig  <martin@ximian.com>
13975
13976         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13977         resolving aliases; fixes #47927.
13978
13979 2003-08-26  Martin Baulig  <martin@ximian.com>
13980
13981         * statement.cs (Using.DoResolve): This is internally emitting a
13982         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13983         do not always return.  Fixes #47681.
13984
13985 2003-08-26  Martin Baulig  <martin@ximian.com>
13986
13987         * decl.cs (MemberCore): Moved WarningNotHiding(),
13988         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13989         into MemberBase.
13990         (AdditionResult): Make this nested in DeclSpace.
13991         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13992         argument; call NamespaceEntry.Define() unless we're nested in a
13993         class or struct.
13994
13995         * namespace.cs (Namespace.DefineName): New public function.  This
13996         is called from DeclSpace's .ctor to add 
13997         (Namespace.Lookup): Include DeclSpaces in the lookup.
13998
13999         * class.cs (Operator): Derive from MemberBase, not MemberCore.
14000
14001         * const.cs (Const): Derive from MemberBase, not MemberCore.     
14002
14003 2003-08-25  Martin Baulig  <martin@ximian.com>
14004
14005         * convert.cs (Convert.ExplicitReferenceConversion): When
14006         converting from an interface type to a class, unbox if the target
14007         type is a struct type.  Fixes #47822.
14008
14009 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14010
14011         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
14012         #47854.
14013
14014 2003-08-22  Martin Baulig  <martin@ximian.com>
14015
14016         * class.cs (TypeManager.DefineType): When defining a nested type,
14017         call DefineType() on our parent; fixes #47801.
14018
14019 2003-08-22  Martin Baulig  <martin@ximian.com>
14020
14021         * class.cs (MethodData.Define): While checking if a method is an
14022         interface implementation, improve the test a bit more to fix #47654.
14023
14024 2003-08-22  Martin Baulig  <martin@ximian.com>
14025
14026         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
14027         correctly; fixes #47722.
14028
14029 2003-08-22  Martin Baulig  <martin@ximian.com>
14030
14031         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
14032         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
14033
14034         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
14035
14036 2003-08-22  Martin Baulig  <martin@ximian.com>
14037
14038         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
14039         can only be assigned in static constructors.  Fixes #47161.
14040
14041 2003-08-22  Martin Baulig  <martin@ximian.com>
14042
14043         Rewrote and improved the flow analysis code.
14044
14045         * flowbranching.cs (FlowBranching): Make this class abstract.
14046         (FlowBranching.CreateBranching): New static function to create a
14047         new flow branching.
14048         (FlowBranchingBlock, FlowBranchingException): New classes.
14049         (FlowBranching.UsageVector.Type): New public readonly field.
14050         (FlowBranching.UsageVector.Breaks): Removed the setter.
14051         (FlowBranching.UsageVector.Returns): Removed the setter.
14052         (FlowBranching.UsageVector): Added Break(), Return(),
14053         NeverReachable() and Throw() methods to modify the reachability.
14054         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
14055         done by FlowBranching.Merge().
14056         (FlowBranching.UsageVector.MergeChild): New method; merges the
14057         merge result into the current vector.
14058         (FlowBranching.Merge): New abstract method to merge a branching.
14059
14060 2003-08-12  Martin Baulig  <martin@ximian.com>
14061
14062         * expression.cs (Indirection.CacheTemporaries): Create the
14063         LocalTemporary with the pointer type, not its element type.
14064
14065 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
14066
14067         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
14068         token was a keyword or not.
14069
14070         Add `error' options where an IDENTIFIER was expected;  Provide
14071         CheckToken and CheckIdentifierToken convenience error reporting
14072         functions. 
14073
14074         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
14075
14076         * decl.cs: Rename `NamespaceEntry Namespace' public field into
14077         NameSpaceEntry NameSpaceEntry.
14078
14079         (LookupInterfaceOrClass): Avoid creating a full qualified name
14080         from namespace and name: avoid doing lookups when we know the
14081         namespace is non-existant.   Use new Tree.LookupByNamespace which
14082         looks up DeclSpaces based on their namespace, name pair.
14083
14084         * driver.cs: Provide a new `parser verbose' to display the
14085         exception thrown during parsing.  This is turned off by default
14086         now, so the output of a failure from mcs is more graceful.
14087
14088         * namespace.cs: Track all the namespaces defined in a hashtable
14089         for quick lookup.
14090
14091         (IsNamespace): New method
14092
14093 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
14094
14095         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
14096         we know that we need to concatenate (full typename can never be
14097         null). 
14098
14099         * class.cs: ditto.
14100
14101         * statement.cs: Use a bitfield;  Do not initialize to null things
14102         which are done by the constructor by default.
14103
14104         * cs-parser.jay: bug fix, parameter was 4, not 3.
14105
14106         * expression.cs: Just use the property;
14107
14108         * statement.cs: No need for GetVariableInfo method.
14109
14110 2003-08-08  Martin Baulig  <martin@ximian.com>
14111
14112         * flowanalysis.cs (FlowReturns): This is now nested in the
14113         `FlowBranching' class.
14114         (MyBitVector): Moved this here from statement.cs.
14115         (FlowBranching.SiblingType): New enum type.
14116         (FlowBranching.CreateSibling): Added `SiblingType' argument.
14117
14118 2003-08-07  Martin Baulig  <martin@ximian.com>
14119
14120         * flowanalysis.cs (FlowBranchingType): This is now nested in the
14121         `FlowBranching' class and called `BranchingType'.
14122
14123 2003-08-07  Martin Baulig  <martin@ximian.com>
14124
14125         * flowanalysis.cs: Moved all the control flow analysis code into
14126         its own file.
14127
14128 2003-08-07  Martin Baulig  <martin@ximian.com>
14129
14130         * assign.cs (Assign.DoResolve): `target' must either be an
14131         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14132         #37319.
14133
14134 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14135
14136         * expression.cs (BinaryMethod): This kind of expression is created by the
14137         Binary class if it determines that the operator has to be handled
14138         by a method.
14139
14140         (BinaryDelegate): This kind of expression is created if we are
14141         dealing with a + or - operator on delegates.
14142
14143         (Binary): remove method, argumetns, and DelegateOperator: when
14144         dealing with methods, 
14145
14146         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14147
14148         * statement.cs (Block): use bitfields for the three extra booleans
14149         we had in use.   Remove unused topblock parameter.
14150
14151         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14152
14153         * assign.cs: Drop extra unneeded tests.
14154
14155 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14156
14157         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14158
14159         * statement.cs (Foreach): Use VariableStorage instead of
14160         LocalBuilders.   
14161
14162         * codegen.cs (VariableStorage): New class used by clients that
14163         require a variable stored: locals or fields for variables that
14164         need to live across yield.
14165
14166         Maybe provide a convenience api for EmitThis+EmitLoad?
14167
14168         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14169         these bad boys.
14170
14171 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14172
14173         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14174         RemapParameterLValue): New methods that are used to turn a
14175         precomputed FieldInfo into an expression like this:
14176
14177                 instance.FieldInfo
14178
14179         The idea is to use this instead of making LocalVariableReference
14180         have more than one meaning.
14181
14182         * cs-parser.jay: Add error production to BASE.
14183
14184         * ecore.cs: Deal with TypeManager.GetField returning null, which
14185         is now a valid return value.
14186
14187         (FieldExprNoAddress): New expression for Fields whose address can
14188         not be taken.
14189
14190         * expression.cs (LocalVariableReference): During the resolve
14191         phases, create new expressions if we are in a remapping context.
14192         Remove code that dealt with remapping here.
14193
14194         (ParameterReference): same.
14195
14196         (ProxyInstance): New expression, like the `This' expression, but
14197         it is born fully resolved.  We know what we are doing, so remove
14198         the errors that are targeted to user-provided uses of `this'.
14199
14200         * statement.cs (Foreach): our variable is now stored as an
14201         Expression;  During resolution, follow the protocol, dont just
14202         assume it will return this.
14203
14204 2003-08-06  Martin Baulig  <martin@ximian.com>
14205
14206         * support.cs (SeekableStreamReader.cs): New public class.
14207
14208         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14209         SeekableStreamReader instead of the normal StreamReader.
14210
14211 2003-08-04  Martin Baulig  <martin@ximian.com>
14212
14213         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14214         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14215         deambiguate casts and delegate invocations.
14216         (parenthesized_expression): Use the new tokens to ensure this is
14217         not a cast of method invocation.
14218
14219         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14220         when reading a `)' and Deambiguate_CloseParens () was previously
14221         called.
14222
14223         * expression.cs (ParenthesizedExpression): New class.  This is
14224         just used for the CS0075 test.
14225         (Binary.DoResolve): Check for CS0075.   
14226
14227 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14228
14229         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14230         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14231         reference comparison.
14232
14233         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14234         examine the ReturnType for equality - this is necessary in the
14235         cases of implicit and explicit operators whose signature also
14236         includes the return type.
14237
14238 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14239
14240         * namespace.cs: Cache the result of the namespace computation,
14241         instead of computing it every time.
14242
14243 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14244
14245         * decl.cs: Use a global arraylist that we reuse over invocations
14246         to avoid excesive memory consumption.  Reduces memory usage on an
14247         mcs compile by one meg (45 average).
14248
14249         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14250         private, work around that.
14251
14252 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14253
14254         * literal.cs (IntLiteral): Define Zero and One static literals. 
14255
14256         * cs-parser.jay (integer_literal): use static literals to reduce
14257         memory usage for the most used literals (0, 1 and -1).  211kb
14258         reduced in memory usage.
14259
14260         Replace all calls to `new ArrayList' with `new
14261         ArrayList(4)' which is a good average number for most allocations,
14262         and also requires only 16 bytes of memory for its buffer by
14263         default. 
14264
14265         This reduced MCS memory usage in seven megabytes for the RSS after
14266         bootstrapping.
14267
14268 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14269
14270         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14271         handle params methods the correct way by forming only one
14272         applicable set with params and normal methods in them. Earlier we
14273         were looking at params methods only if we found no normal methods
14274         which was not the correct thing to do.
14275
14276         (Invocation.BetterFunction): Take separate arguments indicating
14277         when candidate and the best method are params methods in their
14278         expanded form.
14279
14280         This fixes bugs #43367 and #46199.
14281
14282         * attribute.cs: Documentation updates.
14283
14284         (CheckAttribute): Rename to CheckAttributeTarget.
14285         (GetValidPlaces): Rename to GetValidTargets.
14286
14287         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14288         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14289
14290         Fixes bug #44468.
14291
14292 2003-07-28  Martin Baulig  <martin@ximian.com>
14293
14294         * class.cs (TypeContainer.DefineMembers): Use the base type's full
14295         name when looking up the base class of a nested class.  Fixes #46977.
14296
14297 2003-07-26  Martin Baulig  <martin@ximian.com>
14298
14299         * expression.cs (Indexers.Indexer): New nested struct; contains
14300         getter, setter and the indexer's type.
14301         (Indexers.Properties): This is now an ArrayList of
14302         Indexers.Indexer's.
14303         (IndexerAccess.DoResolveLValue): Correctly set the type if the
14304         indexer doesn't have any getters.
14305
14306         * assign.cs (Assign.DoResolve): Also do the implicit conversions
14307         for embedded property and indexer assignments.
14308
14309 2003-07-26  Martin Baulig  <martin@ximian.com>
14310
14311         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
14312         preprocessor directive is not the first non-whitespace character
14313         on a line.
14314
14315 2003-07-26  Martin Baulig  <martin@ximian.com>
14316
14317         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
14318         namespace parsing, follow the spec more closely.
14319
14320         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
14321         NamespaceEntry.Lookup().
14322
14323 2003-07-25  Martin Baulig  <martin@ximian.com>
14324
14325         * MethodCore.cs (OverridesSomething): New public field; it's set
14326         from TypeContainer.DefineMembers if this method overrides
14327         something (which doesn't need to be a method).  Fix #39462.
14328
14329 2003-07-25  Ravi Pratap  <ravi@ximian.com>
14330
14331         * typemanager.cs (GetMembers): Ensure that the list of members is
14332         reversed. This keeps things in sync.
14333
14334         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
14335         find an AttributeUsage attribute.
14336
14337         * expression.cs (Invocation.OverloadResolve): Perform the check
14338         which disallows Invoke to be directly called on a Delegate.
14339
14340         (Error_InvokeOnDelegate): Report error cs1533.
14341
14342 2003-07-25  Martin Baulig  <martin@ximian.com>
14343
14344         * expression.cs (Indexers.GetIndexersForType): Only look in the
14345         interface hierarchy if the requested type is already an
14346         interface.  Fixes #46788 while keeping #46502 fixed.
14347
14348 2003-07-25  Martin Baulig  <martin@ximian.com>
14349
14350         * class.cs (TypeContainer.DefineMembers): Check whether all
14351         readonly fields have been assigned and report warning CS0649 if
14352         not.
14353
14354         * statement.cs (LocalInfo.IsFixed): Always return true if this is
14355         a valuetype.
14356
14357 2003-07-24  Ravi Pratap  <ravi@ximian.com>
14358
14359         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
14360         returned from GetMethods to make things consistent with the
14361         assumptions MCS makes about ordering of methods.
14362
14363         This should comprehensively fix bug #45127 and it does :-)
14364
14365         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
14366         ordering is actually reverse.
14367
14368         * Clean up some debug messages I left lying around.
14369
14370         * interface.cs (Populate*): Get rid of code which emits attributes
14371         since the stage in which we emit attributes is the 'Emit' stage,
14372         not the define stage.
14373
14374         (Emit): Move attribute emission for interface members here.
14375
14376 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14377
14378         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14379         closely: we eliminate methods in base types when we have an
14380         applicable method in a top-level type.
14381
14382         Please see section 14.5.5.1 for an exact description of what goes
14383         on. 
14384
14385         This fixes bug #45127 and a host of other related to corlib compilation.
14386
14387         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14388         array is the method corresponding to the top-level type (this is
14389         because of the changes made to icall.c) so we change this
14390         accordingly.
14391
14392         (MethodGroupExpr.Name): This too.
14393
14394         * typemanager.cs (GetElementType): New method which does the right
14395         thing when compiling corlib. 
14396
14397         * everywhere: Make use of the above in the relevant places.
14398
14399 2003-07-22  Martin Baulig  <martin@ximian.com>
14400
14401         * cs-parser.jay (invocation_expression): Moved
14402         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14403         `cast_expression', but create a InvocationOrCast which later
14404         resolves to either an Invocation or a Cast.
14405
14406         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14407         method; call this before EmitStatement() to make sure that this
14408         expression can be used as a statement.
14409
14410         * expression.cs (InvocationOrCast): New class; resolves to either
14411         an Invocation or a Cast.
14412
14413         * statement.cs (StatementExpression): Call ResolveStatement() on
14414         the ExpressionStatement before emitting it.
14415
14416 2003-07-21  Martin Baulig  <martin@ximian.com>
14417
14418         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14419         `ref' and `out' attributes match; fixes #46220.
14420         (MemberAccess.ResolveMemberAccess): You can't reference a type
14421         through an expression; fixes #33180.
14422         (Indexers.GetIndexersForType): Don't return the indexers from
14423         interfaces the class implements; fixes #46502.
14424
14425 2003-07-21  Martin Baulig  <martin@ximian.com>
14426
14427         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14428         CS0661 checks; fixes bug #30442.
14429
14430 2003-07-21  Martin Baulig  <martin@ximian.com>
14431
14432         * decl.cs (AdditionResult): Added `Error'.
14433
14434         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14435
14436         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
14437         makes cs0031.cs actually work.
14438
14439 2003-07-20  Martin Baulig  <martin@ximian.com>
14440
14441         * namespace.cs: Fixed that bug which caused a crash when compiling
14442         the debugger's GUI.
14443
14444 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14445
14446         * typemanager.cs (LookupTypeReflection): Never expose types which
14447         are NotPublic, NestedPrivate, NestedAssembly, or
14448         NestedFamANDAssem.  We used to return these, and later do a check
14449         that would report a meaningful error, but the problem is that we
14450         would not get the real match, if there was a name override.
14451
14452 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14453
14454         * namespace.cs (Namespace, Name): Do not compute the namespace
14455         name dynamically, compute it in the constructor.  This reduced
14456         memory usage by 1697 KB.
14457
14458         * driver.cs: Use --pause to pause at the end.
14459
14460 2003-07-17  Peter Williams  <peter@newton.cx>
14461
14462         * Makefile: Change the name of the test target so that it doesn't
14463         conflict with the recursive test target.
14464
14465 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14466
14467         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14468         AddressOf): Do not use EmitThis, that was wrong, use the actual
14469         this pointer.
14470
14471 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14472
14473         * class.cs (MethodData.Define): While checking if a method is an
14474         interface implementation, improve the test: If we are not public
14475         (use new test here: use the computed MethodAttributes directly,
14476         instead of the parsed modifier flags) check if the `implementing'
14477         method comes from an interface or not.
14478
14479         * pending.cs (VerifyPendingMethods): Slightly better error
14480         message.
14481
14482         * makefile: add test target that does the mcs bootstrap.
14483
14484 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14485
14486         * interface.cs (Define): Do nothing here since there are no
14487         members to populate etc. Move the attribute emission out of here
14488         since this was just totally the wrong place to put it. Attribute
14489         application happens during the 'Emit' phase, not in the 'Define'
14490         phase.
14491
14492         (Emit): Add this method and move the attribute emission here
14493
14494         * rootcontext.cs (EmitCode): Call the Emit method on interface
14495         types too.
14496
14497 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14498
14499         * expression.cs (OverloadResolve): Report error only if Location
14500         is not 'Null' which means that there was a probe going on.
14501
14502 2003-07-14  Martin Baulig  <martin@ximian.com>
14503
14504         * expression.cs (ConditionalLogicalOperator): New public class to
14505         implement user defined conditional logical operators.
14506         This is section 14.11.2 in the spec and bug #40505.
14507
14508 2003-07-14  Martin Baulig  <martin@ximian.com>
14509
14510         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14511
14512 2003-07-14  Martin Baulig  <martin@ximian.com>
14513
14514         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14515
14516         * ecore.cs (IVariable.VerifyFixed): New interface method.
14517
14518         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14519         operator, check whether the variable is actually fixed.  Fixes bug
14520         #36055.  Set a variable definitely assigned when taking its
14521         address as required by the spec.
14522
14523         * statement.cs (LocalInfo.IsFixed): New field.
14524         (LocalInfo.MakePinned): Set `IsFixed' to true.
14525
14526 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14527
14528         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14529         for .ctors, ensure that we only ask for members declared in the
14530         attribute type (BindingFlags.DeclaredOnly).
14531
14532         Fixes bug #43632.
14533
14534         * expression.cs (Error_WrongNumArguments): Report error 1501
14535         correctly the way CSC does.
14536
14537 2003-07-13  Martin Baulig  <martin@ximian.com>
14538
14539         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14540         lookup on the fully qualified name, to make things like "X.X" work
14541         where "X.X" is a fully qualified type name, but we also have a
14542         namespace "X" in the using list.  Fixes #41975.
14543
14544 2003-07-13  Martin Baulig  <martin@ximian.com>
14545
14546         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14547         function. If we're a CompoundAssign, we need to create an embedded
14548         CompoundAssign, not an embedded Assign.
14549         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14550         Fixes #45854.
14551
14552 2003-07-13  Martin Baulig  <martin@ximian.com>
14553
14554         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14555         work to fix bug #46088.
14556
14557 2003-07-13  Ravi Pratap <ravi@ximian.com>
14558
14559         * class.cs (Operator.Emit): Do not emit attributes here - it is
14560         taken care of by the Method class that we delegate too. This takes
14561         care of bug #45876.
14562
14563 2003-07-10  Martin Baulig  <martin@ximian.com>
14564
14565         * expression.cs (TypeOfVoid): New class.
14566         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14567
14568 2003-07-10  Martin Baulig  <martin@ximian.com>
14569
14570         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14571         bug #35957.
14572
14573 2003-07-10  Martin Baulig  <martin@ximian.com>
14574
14575         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14576         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14577
14578         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14579
14580         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14581
14582 2003-07-10  Martin Baulig  <martin@ximian.com>
14583
14584         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14585         of decimal.  Fixes #42850.
14586
14587         NOTE: I also fixed the created byte blob, but this doesn't work on
14588         the MS runtime and csc never produces any byte blobs for decimal
14589         arrays.
14590
14591 2003-07-10  Martin Baulig  <martin@ximian.com>
14592
14593         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14594         structs; fixes #32068.
14595         (Block.AddChildVariableNames): Fixed #44302.
14596
14597 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14598
14599         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14600
14601 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14602
14603         * attribute.cs: And this test is onger needed.
14604
14605 2003-07-08  Martin Baulig  <martin@ximian.com>
14606
14607         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14608         inaccessible types.  Fixes #36313.
14609
14610         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14611
14612         * namespace.cs (NamespaceEntry): Create implicit entries for all
14613         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14614         implicit entries for N1.N2 and N1.
14615
14616 2003-07-08  Martin Baulig  <martin@ximian.com>
14617
14618         Rewrote the handling of namespaces to fix a lot of the issues
14619         wrt. `using' aliases etc.
14620
14621         * namespace.cs (Namespace): Splitted this class into a
14622         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14623
14624         * typemanager.cs (TypeManager.IsNamespace): Removed.
14625         (TypeManager.ComputeNamespaces): Only compute namespaces from
14626         loaded assemblies here, not the namespaces from the assembly we're
14627         currently compiling.
14628
14629 2003-07-08  Martin Baulig  <martin@ximian.com>
14630
14631         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14632
14633 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14634
14635         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14636         already fixed it.  
14637
14638         I thought about the memory savings here, but LookupTypeReflection
14639         is used under already very constrained scenarios.  Compiling
14640         corlib or mcs only exposes one hit, so it would not really reduce
14641         any memory consumption.
14642
14643 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14644
14645         * typemanager.cs: fixes bug #45889 by only adding public types from
14646         other assemblies to the list of known types.
14647
14648 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14649
14650         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14651         on the type we resolved.
14652
14653 2003-07-05  Martin Baulig  <martin@ximian.com>
14654
14655         * pending.cs (PendingImplementation.ParentImplements): Don't
14656         create the proxy if the parent is abstract.
14657
14658         * class.cs (TypeContainer.DefineIndexers): Process explicit
14659         interface implementations first.  Fixes #37714.
14660
14661 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14662
14663         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14664         defined recursively;  but since we modify the input parameters
14665         (left is set to `this' temporarily), we reset this value if the
14666         left_is_explicit is false, which gives the original semantics to
14667         the code.  
14668
14669         * literal.cs (NullPointer): new class used to represent a null
14670         literal in a pointer context.
14671
14672         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14673         type is a pointer, use a NullPointer object instead of a
14674         NullLiteral.   Closes 43687
14675
14676         (ExplicitConversion): Convert pointer values using
14677         the conv opcode to the proper type.
14678
14679         * ecore.cs (New): change ValueTypeVariable property into a method,
14680         that returns whether the valuetype is suitable for being used.
14681
14682         * expression.cs (Binary.DoNumericPromotions): Only return if we
14683         the int constant was a valid uint, and we can return both left and
14684         right as uints.  If not, we continue processing, to trigger the
14685         type conversion.  This fixes 39018.
14686
14687         * statement.cs (Block.EmitMeta): During constant resolution, set
14688         the CurrentBlock property on the emitcontext, so that we resolve
14689         constants propertly.
14690
14691 2003-07-02  Martin Baulig  <martin@ximian.com>
14692
14693         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14694         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14695
14696         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14697         than emitting it here.
14698
14699         * statement.cs: Fixed some more flow analysis bugs.
14700
14701 2003-07-02  Martin Baulig  <martin@ximian.com>
14702
14703         * class.cs (MethodData.Define): When implementing interface
14704         methods, set Final unless we're Virtual.
14705
14706         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14707         check work for interface methods.
14708
14709 2003-07-01  Martin Baulig  <martin@ximian.com>
14710
14711         * ecore.cs (EmitContext.This): Replaced this property with a
14712         GetThis() method which takes a Location argument.  This ensures
14713         that we get the correct error location for a CS0188.
14714
14715 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14716
14717         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14718         ImplicitStandardConversion.
14719
14720         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14721
14722 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14723
14724         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14725         optimization.
14726
14727 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14728
14729         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14730         constructors.
14731
14732         (MethodData.Define): Turn off initlocals for unsafe methods.
14733
14734 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14735
14736         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14737         complete;  Fixes #37521.
14738
14739         * delegate.cs: Use Modifiers.TypeAttr to compute the
14740         TypeAttributes, instead of rolling our own.  This makes the flags
14741         correct for the delegates.
14742
14743 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14744
14745         * class.cs (Constructor.Define): Set the private flag for static
14746         constructors as well.
14747
14748         * cs-parser.jay (statement_expression): Set the return value to
14749         null, to avoid a crash when we catch an error.
14750
14751 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14752
14753         * cs-parser.jay: Applied patch from Jackson that adds support for
14754         extern and unsafe modifiers to destructor declarations.
14755
14756         * expression.cs: Report error 21 if the user is trying to index a
14757         System.Array.
14758
14759         * driver.cs: Add an error message, suggested by the bug report.
14760
14761         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14762         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14763
14764 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14765
14766         * namespace.cs: Add some information to reduce FAQs.
14767
14768 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14769
14770         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14771         underlying enumeration types.  Fixes #43915.
14772
14773         * expression.cs: Treat ushort/short as legal values to be used in
14774         bitwise operations.
14775
14776 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14777
14778         * delegate.cs: transfer custom attributes for paramenters from
14779         the delegate declaration to Invoke and BeginInvoke.
14780
14781 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14782
14783         * attribute.cs: handle custom marshalers and emit marshal info
14784         for fields, too.
14785
14786 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14787
14788         * makefile.gnu: Added anonymous.cs to the compiler sources.
14789
14790 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14791
14792         * iterators.cs: Change the name of the proxy class to include two
14793         underscores.
14794
14795         * cs-parser.jay: Update grammar to include anonymous methods.
14796
14797         * anonymous.cs: new file.
14798
14799 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14800
14801         * class.cs (Field.Define): Add missing test for pointers and
14802         safety. 
14803
14804 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14805
14806         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14807         we use the stobj opcode.
14808
14809         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14810         since it wasn't the correct fix. 
14811
14812         It still is puzzling that we are required to use stobj for IntPtr
14813         which seems to be a ValueType.
14814
14815 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14818         during regular simple name resolution.   Now, the trick is that
14819         instead of returning for processing the simplename, we do a
14820         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14821         contextual lookup type).   If a match is found, return that, if
14822         not, return for further composition.
14823
14824         This fixes long-standing 30485.
14825
14826         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14827         using the address to initialize an object, do an Stobj instead of
14828         using the regular Stelem.
14829
14830         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14831         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14832         Because if we are a BaseIndexerAccess that value will be true.
14833         Fixes 43643.
14834
14835         * statement.cs (GotoCase.Resolve): Return after reporting an
14836         error, do not attempt to continue. 
14837
14838         * expression.cs (PointerArithmetic.Emit): If our operand is a
14839         long, convert our constants to match the operand before
14840         multiplying.  Convert to I type before adding.   Fixes 43670.
14841
14842 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14843
14844         * enum.cs (ImplicitConversionExists) : Rename to
14845         ImplicitEnumConversionExists to remove ambiguity. 
14846
14847         * ecore.cs (NullCast): New type of cast expression class which
14848         basically is very similar to EmptyCast with the difference being
14849         it still is a constant since it is used only to cast a null to
14850         something else
14851         (eg. (string) null)
14852
14853         * convert.cs (ImplicitReferenceConversion): When casting a null
14854         literal, we return a NullCast.
14855
14856         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14857         should be around anymore.
14858
14859         The renaming (reported was slightly wrong). Corrections:
14860
14861         ConvertImplicitStandard -> ImplicitConversionStandard
14862         ConvertExplicitStandard -> ExplicitConversionStandard
14863
14864         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14865         before passing them in !
14866
14867         * convert.cs (ImplicitConversionStandard): When comparing for
14868         equal expr and target types, ensure that expr is not a
14869         NullLiteral.
14870
14871         In general, we must not be checking (expr_type ==
14872         target_type) in the top level conversion methods
14873         (ImplicitConversion, ExplicitConversion etc). This checking is
14874         done in the methods that they delegate to.
14875
14876 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14877
14878         * convert.cs: Move Error_CannotConvertType,
14879         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14880         ImplicitNumericConversion, ImplicitConversionExists,
14881         ImplicitUserConversionExists, StandardConversionExists,
14882         FindMostEncompassedType, FindMostSpecificSource,
14883         FindMostSpecificTarget, ImplicitUserConversion,
14884         ExplicitUserConversion, GetConversionOperators,
14885         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14886         TryImplicitIntConversion, Error_CannotConvertImplicit,
14887         ConvertImplicitRequired, ConvertNumericExplicit,
14888         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14889         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14890         its own file.
14891
14892         Perform the following renames:
14893
14894         StandardConversionExists -> ImplicitStandardConversionExists
14895         ConvertImplicit -> ImplicitConversion
14896         ConvertImplicitStandard -> ImplicitStandardConversion
14897         TryImplicitIntConversion -> ImplicitIntConversion
14898         ConvertImplicitRequired -> ImplicitConversionRequired
14899         ConvertNumericExplicit -> ExplicitNumericConversion
14900         ConvertReferenceExplicit -> ExplicitReferenceConversion
14901         ConvertExplicit -> ExplicitConversion
14902         ConvertExplicitStandard -> ExplicitStandardConversion
14903
14904 2003-05-19  Martin Baulig  <martin@ximian.com>
14905
14906         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14907         (TypeInfo): Added support for structs having structs as fields.
14908
14909         * ecore.cs (FieldExpr): Implement IVariable.
14910         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14911         VariableInfo for the field.
14912
14913 2003-05-18  Martin Baulig  <martin@ximian.com>
14914
14915         * expression.cs (This.DoResolve): Report a CS0027 if we're
14916         emitting a field initializer.
14917
14918 2003-05-18  Martin Baulig  <martin@ximian.com>
14919
14920         * expression.cs (This.ResolveBase): New public function.
14921         (This.DoResolve): Check for CS0188.
14922
14923         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14924         This.Resolve().
14925
14926         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14927         `instance_expression' to null if we don't have any non-static
14928         methods.
14929
14930 2003-05-18  Martin Baulig  <martin@ximian.com>
14931
14932         Reworked the way how local variables and parameters are handled by
14933         the flow analysis code.
14934
14935         * statement.cs (TypeInfo, VariableMap): New public classes.
14936         (VariableInfo): New public class.  This is now responsible for
14937         checking whether a variable has been assigned.  It is used for
14938         parameters and local variables.
14939         (Block.EmitMeta): Take the InternalParameters as argument; compute
14940         the layout of the flow vectors here.
14941         (Block.LocalMap, Block.ParameterMap): New public properties.
14942         (FlowBranching): The .ctor doesn't get the InternalParameters
14943         anymore since Block.EmitMeta() now computes the layout of the flow
14944         vector.
14945         (MyStructInfo): This class is now known as `StructInfo' and nested
14946         in `TypeInfo'; we don't access this directly anymore.
14947
14948         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14949         property and removed IsAssigned(), IsFieldAssigned(),
14950         SetAssigned() and SetFieldAssigned(); we now call them on the
14951         VariableInfo so we don't need to duplicate this code everywhere.
14952
14953         * expression.cs (ParameterReference): Added `Block block' argument
14954         to the .ctor.
14955         (LocalVariableReference, ParameterReference, This): The new
14956         VariableInfo class is now responsible for all the definite
14957         assignment stuff.
14958
14959         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14960         IsParameterAssigned, SetParameterAssigned): Removed.
14961
14962 2003-05-18  Martin Baulig  <martin@ximian.com>
14963
14964         * typemanager.cs (InitCoreTypes): Try calling
14965         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14966         the 3-args-version.  Corlib now also needs our `void_type'.
14967         (GetMethod): Added overloaded version which takes an optional
14968         `bool report_errors' to allow lookups of optional methods.
14969
14970 2003-05-12  Martin Baulig  <martin@ximian.com>
14971
14972         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14973         only used for locals and not for parameters.
14974
14975 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14976
14977         * support.cs (InternalParameters.ParameterType): Return the
14978         ExternalType of the parameter.
14979
14980         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14981         they were unused.
14982
14983 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14984
14985         * class.cs (MethodData.Define): Do not set the `newslot' on
14986         interface members, if they are also flagged as "override".
14987
14988         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14989         better code for ++i and i++.  This only works for static fields
14990         and local variables.
14991
14992         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14993         want to pull the DeclSpace out of the builder_to_declspace instead
14994         of the TypeBuilder (like in TypeContainer.FindMembers).
14995
14996         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14997         instead of LookupTypeContainer.  Fixes the crash on .NET for
14998         looking up interface members.
14999
15000         * const.cs: Create our own emit context during the Definition
15001         stage, so that constants are evaluated in the proper context, when
15002         a recursive definition happens.
15003
15004 2003-05-11  Martin Baulig  <martin@ximian.com>
15005
15006         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
15007         new block for a switch section.
15008         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
15009         the adding/lookup in the switch block.  Fixes #39828.
15010
15011 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
15012
15013         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
15014         functionality: I needed to convert the data after I had performed
15015         the add/sub operation into the operands type size.
15016
15017         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
15018         pass the type for the box operation, otherwise the resulting
15019         object would have been of type object.
15020
15021         (BoxedCast): Add constructor to specify the type to box as.
15022
15023 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
15024
15025         * iterators.cs: I was reusing the `count' variable inadvertently,
15026         take steps to not allow this to happen.
15027
15028 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
15029
15030         * attribute.cs (Attribute.Resolve): Params attributes are encoded
15031         by creating an array at the point where the params starts and
15032         putting all those arguments there, then adjusting the size of the
15033         array.
15034
15035 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
15036
15037         * expression.cs (New.AddressOf): Implement interface
15038         IMemoryLocation.  This is used when the `new' operator is used in
15039         the context of an invocation to a method on a value type.
15040
15041         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
15042         example. 
15043
15044         * namespace.cs: Also check the using aliases here.
15045
15046         * driver.cs: Move the test for using validity after the types have
15047         been entered, so we do a single pass that also includes the using
15048         aliases. 
15049
15050         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
15051         in the regular case.   CreateSiblingForFinally is doing extra
15052         error checking.
15053
15054         * attribute.cs (GetAttributeArgumentExpression): Store the result
15055         on an out value, and use the return value to indicate failure
15056         instead of using null (which is a valid return for Constant.GetValue).
15057
15058         * statement.cs: Perform the analysis flow for the increment
15059         portion after the statement, because this will be the real flow of
15060         execution.  Fixes #42385
15061
15062         * codegen.cs (EmitContext.EmitArgument,
15063         EmitContext.EmitStoreArgument): New helper functions when the
15064         RemapToProxy flag is set.
15065
15066         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
15067         function.
15068
15069         Add support for remapping parameters. 
15070
15071         * iterators.cs: Propagate parameter values;  Store parameter
15072         values in the proxy classes.
15073
15074 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
15075
15076         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
15077         need a proxy reference;  I do not know what I was thinking
15078
15079         * cs-parser.jay (constructor_initializer): catch another error,
15080         and display nice message.
15081
15082         (field_declaration): catch void field declaration
15083         to flag a better error. 
15084
15085         * class.cs (MemberBase.CheckBase): Report an error instead of a
15086         warning if a new protected member is declared in a struct. 
15087         (Field.Define): catch the error of readonly/volatile.
15088
15089         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
15090
15091         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
15092         volatile variable is taken
15093
15094 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
15095
15096         * statement.cs (Fixed.Resolve): Report an error if we are not in
15097         an unsafe context.
15098
15099 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
15100
15101         * typemanager.cs: reuse the code that handles type clashes for
15102         delegates and enumerations.
15103
15104         * class.cs (Report28): Always report.
15105
15106         * expression.cs (EncodeAsAttribute): Allow nulls here.
15107
15108 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
15109
15110         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
15111         the functionality for testing whether an expression is valid for
15112         an attribute here.  Also handle the case of arrays of elements
15113         being stored. 
15114
15115         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
15116         encoding a linear array into an array of objects that are suitable
15117         to be passed to an CustomAttributeBuilder.
15118
15119         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15120
15121         * ecore.cs: (FieldExpr): Handle field remapping here.
15122
15123         * iteratators.cs: Pass the instance variable (if the method is an
15124         instance method) to the constructors, so we can access the field
15125         variables on the class.
15126
15127         TODO: Test this with structs.  I think the THIS variable on
15128         structs might have to be a pointer, and not a refenrece
15129
15130 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15131
15132         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15133         local variables to fields in a proxy class.
15134
15135         * iterators.cs (PopulateProxy): Rename our internal fields to
15136         <XXX>.  
15137         Create a <THIS> field if we are an instance method, so we can
15138         reference our parent container variables.
15139         (MapVariable): Called back from the EmitContext code to enter a
15140         new variable to field mapping into the proxy class (we just create
15141         a FieldBuilder).
15142
15143         * expression.cs
15144         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15145         for using the remapped locals to fields.
15146
15147         I placed the code here, because that gives the same semantics to
15148         local variables, and only changes the Emit code.
15149
15150         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15151         statements inside iterators.
15152         (VariableInfo): Add a FieldBuilder for the cases when we are
15153         remapping local variables to fields in a proxy class
15154
15155         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15156         current_block != null.
15157
15158         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15159         not cope with strings, as it has been moved to the
15160         TableSwitchEmit.  Fixed bug in switch generation.
15161
15162         * expression.cs (New.DoResolve): Provide more context for the user
15163         when reporting an error.
15164
15165         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15166         pointers. 
15167
15168         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15169         check the permissions for it.  Note than in a type-resolution
15170         context the check was already present in DeclSpace.ResolveType,
15171         but was missing from the MemberAccess.
15172
15173         (ArrayCreation.CheckIndices): warn if the user has
15174         more nested levels of expressions, but there are no more
15175         dimensions specified.  Avoids crash on bug 41906.
15176
15177 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15178
15179         * statement.cs (Block): replace Implicit bool, for a generic
15180         flags.   
15181         New flag: `Unchecked'.  This is used during the EmitMeta phase
15182         (which is out-of-line with the regular Resolve/Emit process for a
15183         statement, as this is done ahead of time, but still gets a chance
15184         to call constant resolve).
15185
15186         (Block.Flags): new enum for adding a new flag.
15187
15188         (Block.EmitMeta): track the state of unchecked.
15189
15190         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15191         to enable constant resolution to work there as well.
15192
15193 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15194
15195         * typemanager.cs (ienumerable_type): Also look up
15196         System.Collections.IEnumerable. 
15197
15198 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15199
15200         TODO: Test more than one conditional per method.
15201
15202         * class.cs (Indexer.Define): Report the location where the user is
15203         referencing the unsupported feature.
15204
15205         (MethodData): Overload the use of `conditionals' to
15206         minimize the creation of needless ArrayLists.   This saves roughly
15207         212kb on my machine.
15208
15209         (Method): Implement the new IIteratorContainer interface.
15210         (Method.SetYields): Implement the method by setting the ModFlags
15211         to contain METHOD_YIELDS.
15212
15213         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15214         which just got set to null.
15215
15216         * iterators.cs: New file.
15217
15218         (Yield, YieldBreak): New statements.
15219
15220         * statement.cs (Return.Resolve): Flag an error if we are used in
15221         an iterator method.
15222
15223         * codegen.cs (InIterator): New flag set if the code is being
15224         compiled in an iterator method.
15225
15226         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15227         internal modifier, and we just use it to avoid adding extra
15228         fields, as this is seldom used.  
15229
15230         * cs-parser.jay: Add yield_statement (yield and yield break).
15231
15232         * driver.cs: New flag -v2 to turn on version 2 features. 
15233
15234         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15235         hashtable when v2 is enabled.
15236
15237 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15238
15239         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15240         there is already a namespace defined with this name.
15241
15242         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15243         people upgraded their corlibs.
15244
15245         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15246         always use fully qualified types, no need to use the compiler
15247         front end.
15248
15249         (TypeManager.IsNamespace): Use binarysearch.
15250
15251         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15252         AddDelegate): I did not quite use the new IsValid API properly: I
15253         have to pass the short-name and the fullname.  I was passing only
15254         the basename instead of the fullname sometimes. 
15255
15256         (TypeContainer.DefineType): call NamespaceClash.
15257
15258         * interface.cs (Interface.DefineType): use NamespaceClash before
15259         defining the type.
15260
15261         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15262         defining the type.
15263
15264         * enum.cs: (Enum.DefineType): use NamespaceClash before
15265         defining the type.
15266
15267         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15268         speed increase.  First, use the negative_hits cache when we get a
15269         negative.  Second, add the type with its full original name
15270         instead of the new . and + encoded name (reflection uses + to
15271         separate type from a nested type).  Use LookupTypeReflection
15272         directly which bypasses the type->name hashtable (that we already
15273         know does not contain the type.
15274
15275         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15276         location/container type. 
15277
15278         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15279
15280 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15281
15282         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15283
15284         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15285         method is being referenced in the method group from a static
15286         context, and report error 120 if so.
15287
15288         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15289         Error118. 
15290
15291         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15292         is created, we create the A namespace).
15293
15294         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15295         Fixes #41591
15296
15297 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15298
15299         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15300         invocation to ModuleBuilder.GetType with the same values will
15301         return a new type instance, so we need to cache its return
15302         values. 
15303
15304         * expression.cs (Binary.ResolveOperator): Only allow the compare
15305         operators on enums if they are of the same type.
15306
15307         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15308         types of ValueType on their own case.  Before we were giving them
15309         the same treatment as objects.
15310
15311         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15312         fullname.  Short name is used to compare against container name.
15313         Fullname is used to check against defined namespace names.
15314
15315         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15316         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15317
15318         (Method.CheckBase): Call parent.
15319         (MemberBase.CheckBase): Check for protected members on sealed
15320         classes.
15321         (PropertyBase.CheckBase): Call parent.
15322         (Field.Define): Call parent.
15323
15324         * report.cs: Negative error codes are now mapped to 8000 - code,
15325         so that the display is render more nicely.
15326
15327         * typemanager.cs: Do not use try/catch, instead report a regular
15328         error. 
15329
15330         (GetPointerType, GetReferenceType): These methods provide
15331         mechanisms to obtain the T* and T& from a T.  We had the code
15332         previously scattered around the code base, and it also used
15333         TypeManager.LookupType that would go through plenty of caches.
15334         This one goes directly to the type source.
15335
15336         In some places we did the Type.GetType followed by
15337         ModuleBuilder.GetType, but not in others, so this unifies the
15338         processing as well.
15339
15340         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15341         statements now that we have namespace information.
15342
15343         * typemanager.cs (IsNamespace): New method, returns whether the
15344         string presented is a namespace or not.
15345
15346         (ComputeNamespaces): New public entry point, computes the list of
15347         available namespaces, using the GetNamespaces API call in Mono, or
15348         the slower version in MS.NET.   
15349
15350         Now before we start the semantic analysis phase, we have a
15351         complete list of namespaces including everything that the user has
15352         provided.
15353
15354         Deleted old code to cache namespaces in .nsc files.
15355
15356 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15357
15358         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15359         class/struct location definition Location for the implicit
15360         constructor location.
15361
15362         (Operator.Define): Use the location of the operator for the
15363         implicit Method definition.
15364
15365         (Constructor.Emit): use the constructor location for the implicit
15366         base initializer constructor.
15367
15368         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15369         and the Expression class now contains two new methods:
15370
15371         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15372         isolate type lookup from the rest of the resolution process.
15373
15374         Since we use Expressions to hold type definitions due to the way
15375         we parse the input we have historically overloaded Resolve to
15376         perform the Type lookups if a special flag is passed.  Now this is
15377         eliminated and two methods take their place. 
15378
15379         The differences in the two methods between xStep and xTerminal is
15380         that xStep is involved in our current lookup system that uses
15381         SimpleNames to compose a name, while xTerminal is used just to
15382         catch the case where the simplename lookup failed.
15383
15384 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15385
15386         * expression.cs (ResolveMemberAccess): Remove redundant code.
15387         TypeExpr expressions are always born fully resolved.
15388
15389         * interface.cs (PopulateMethod): Do not lookup the types twice.
15390         We were doing it once during SemanticAnalysis and once during
15391         PopulateMethod.
15392
15393         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15394         in local variable type definitions, were being returned as a
15395         SimpleName (we decomposed everything into a string), that is
15396         because primary_expression was being used instead of a type in the
15397         grammar (reduce/reduce conflicts).
15398
15399         The part that was wrong is that we converted the expression into a
15400         string (an oversimplification in one hand, compounded with primary
15401         expressions doing string concatenation).
15402
15403         So things like:
15404
15405         A.B.C [] x;
15406
15407         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15408         using clauses from working on this particular context.  And a type
15409         was being matched directly against "A.B.C[]".
15410
15411         We now use the correct approach, and allow for ComposedCast to be
15412         part of the unary expression.  So the "A.B.C []" become a composed
15413         cast of "A.B.C" (as a nested group of MemberAccess with a
15414         SimpleName at the end) plus the rank composition "[]". 
15415
15416         Also fixes 35567
15417
15418 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15421         for the access level checking.
15422
15423         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15424         `TypeContainer container', because I kept getting confused when I
15425         was debugging this code.
15426
15427         * expression.cs (Indexers): Instead of tracking getters/setters,
15428         we now track them in parallel.  We create one arraylist less, but
15429         most importantly it is possible now for the LValue code to find a
15430         matching get for a set.
15431
15432         (IndexerAccess.DoResolveLValue): Update the code.
15433         GetIndexersForType has been modified already to extract all the
15434         indexers from a type.  The code assumed it did not.
15435
15436         Also make the code set the correct return type for the indexer.
15437         This was fixed a long time ago for properties, but was missing for
15438         indexers.  It used to be void_type.
15439
15440         (Binary.Emit): Test first for doubles instead of
15441         floats, as they are more common.
15442
15443         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15444         when dealing with floats and the <=, >= operators.  This fixes bug
15445         #39314 
15446
15447         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15448         to load the array value by emitting a load on the foreach variable
15449         type.  This was incorrect.  
15450
15451         We now emit the code to load an element using the the array
15452         variable type, and then we emit the conversion operator.
15453
15454         Fixed #40176
15455
15456 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15457
15458         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15459
15460 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15461
15462         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15463         test for protection before we test for signatures. 
15464
15465         (MethodSignature.ToString): implement.
15466
15467         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15468         to the case where we reduced into a LongConstant.
15469
15470         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15471         depend on whether the information is acurrate, because the
15472         Microsoft runtime will always claim that the array type is public,
15473         regardless of the real state.
15474
15475         If the type is a pointer, another problem happens: the type is
15476         reported as non-public in Microsoft.  
15477
15478         In both cases we have to call CheckAccessLevel recursively with
15479         the underlying type as the argument to be tested.
15480
15481 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15482
15483         * assign.cs (Assign.Emit): If we are dealing with a compound
15484         assignment expression, we should use the code path that stores the
15485         intermediate result in a temporary value.  This fixes #40903.
15486
15487         *expression.cs (Indirection.ToString): Provide ToString method for
15488         debugging. 
15489
15490 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15491
15492         * class.cs: Null out fields holding references to Block objects so
15493         they can be garbage collected.
15494
15495         * expression.cs (OverloadResolve): Remove unused local.
15496
15497 2003-04-07  Martin Baulig  <martin@ximian.com>
15498
15499         * codegen.cs (EmitContext.CurrentFile): New public field.
15500         (EmitContext.Mark): Use the CurrentFile to check whether the
15501         location is in the correct file.
15502         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15503
15504 2003-04-07  Martin Baulig  <martin@ximian.com>
15505
15506         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15507
15508         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15509         location.  [FIXME: The location argument which gets passed to this
15510         method is sometimes wrong!]
15511
15512 2003-04-07  Nick Drochak <ndrochak@gol.com>
15513
15514         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15515
15516 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15517
15518         * expression.cs (Indirection.EmitAssign): We were using the
15519         temporary, but returning immediately instead of continuing the
15520         EmitAssing flow.
15521
15522 2003-04-06  Martin Baulig  <martin@ximian.com>
15523
15524         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15525         if it's a nested child, but also deriving from the outer class.
15526         See test 190.cs.
15527
15528         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15529         nested child, but also deriving from the outer class.  See
15530         test-190.cs.
15531         (FilterWithClosure): We may access private members of the outer
15532         class if we're a nested child and deriving from the outer class.
15533         (RealMemberLookup): Only set `closure_private_ok' if the
15534         `original_bf' contained BindingFlags.NonPublic.
15535
15536 2003-04-05  Martin Baulig  <martin@ximian.com>
15537
15538         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
15539
15540 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * class.cs (Event.Define): Do not allow abstract events to have
15543         initializers. 
15544
15545 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15546
15547         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15548         block in event declarations.
15549
15550         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15551         value type, get its address.
15552
15553         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15554         leaving a class on the stack instead of a boolean value (int
15555         0/1).  Change the code so we compare against null, and then the
15556         result against zero.
15557
15558         * class.cs (TypeContainer.GetClassBases): We were checking for the
15559         parent class being sealed too late.
15560
15561         * expression.cs (Binary.Emit): For <= and >= when dealing with
15562         floating point values, use cgt.un and clt.un instead of cgt and
15563         clt alone.
15564
15565 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15566
15567         * statement.cs: Apply the same optimization as MS: skip the 
15568         GetEnumerator returning an IEnumerator, and use the one returning a 
15569         CharEnumerator instead. This allows us to avoid the try-finally block 
15570         and the boxing.
15571
15572 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15573
15574         * cs-parser.jay: Attributes cannot be applied to
15575                          namespaces. Fixes #40473
15576
15577 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15578
15579         * class.cs:
15580         (Add*): check if the name is valid using the full name for constants,
15581         fields, properties and events.
15582
15583 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15584
15585         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15586         char constants to be part of the enumeration.
15587
15588         * expression.cs (Conditional.DoResolve): Add support for operator
15589         true. Implements the missing functionality from 14.12
15590
15591         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15592         operator true/false as required by the spec.
15593
15594         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15595         implicit conversion to boolean.
15596
15597         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15598         also one where the type implements `operator true'. 
15599
15600         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15601         get an expression that will invoke operator true based on an
15602         expression.  
15603
15604         (GetConversionOperators): Removed the hack that called op_True
15605         here.  
15606
15607         (Expression.ResolveBoolean): Move this from Statement.
15608
15609 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15610
15611         * ecore.cs (FieldExpr): do not allow initialization of initonly
15612         fields on derived classes
15613
15614 2003-03-13  Martin Baulig  <martin@ximian.com>
15615
15616         * statement.cs (Block.Emit): Call ig.BeginScope() and
15617         ig.EndScope() when compiling with debugging info; call
15618         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15619
15620 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * expression.cs (Indexers): Do not construct immediately, allow
15623         for new members to be appended as we go.  Fixes 38143
15624
15625 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15626
15627         * expression.cs: save/restore context when resolving an unchecked
15628         expression.
15629
15630 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15631
15632         * cfold.cs: Catch division by zero in modulus operator during
15633         constant folding.
15634
15635 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15636
15637         * interface.cs (Interface.DefineMembers): Avoid defining members
15638         twice. 
15639
15640 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * driver.cs: handle the +/- options for -noconfig
15643
15644         * statement.cs (Unckeched.Resolve): Also track the state of
15645         unchecked in the Resolve phase.
15646
15647 2003-02-27  Martin Baulig  <martin@ximian.com>
15648
15649         * ecore.cs (Expression.MemberLookup): Don't create a
15650         MethodGroupExpr for something which is not a method.  Fixes #38291.
15651
15652 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15653
15654         * class.cs (MemberBase.CheckParameters): Also check that the type
15655         is unmanaged if it is a pointer.
15656
15657         * expression.cs (SizeOf.Resolve): Add location information.
15658
15659         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15660         a managed type is declared.
15661
15662         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15663         parameter modifiers as well.  Fixes bug 38606
15664
15665         * class.cs: Very sad.  Am backing out the speed up changes
15666         introduced by the ArrayList -> Array in the TypeContainer, as they
15667         were not actually that much faster, and introduced a bug (no error
15668         reports on duplicated methods).
15669
15670         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15671         source first, this will guarantee that we have a valid expression
15672         before calling in lower levels functions that will require a
15673         resolved object.  Then use this original_source in the
15674         target.ResolveLValue instead of the original source that was
15675         passed to us.
15676
15677         Another change.  Use target.Resolve instead of LValueResolve.
15678         Although we are resolving for LValues, we will let the Assign code
15679         take care of that (it will be called again from Resolve).  This
15680         basically allows code like this:
15681
15682         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15683         class Y { void A (X x) { x [0] += o; }
15684
15685         The problem was that the indexer was trying to resolve for
15686         set_Item (idx, object o) and never finding one.  The real set_Item
15687         was set_Item (idx, X).  By delaying the process we get the right
15688         semantics. 
15689
15690         Fixes bug 36505
15691
15692 2003-02-23  Martin Baulig  <martin@ximian.com>
15693
15694         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15695         while calling DoEmit ().
15696
15697         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15698         source files; if you use the #line directive inside a method, the
15699         compiler stops emitting line numbers for the debugger until it
15700         reaches the end of the method or another #line directive which
15701         restores the original file.
15702
15703 2003-02-23  Martin Baulig  <martin@ximian.com>
15704
15705         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15706
15707 2003-02-23  Martin Baulig  <martin@ximian.com>
15708
15709         * statement.cs (Block.AddChildVariableNames): We need to call this
15710         recursively, not just for our immediate children.
15711
15712 2003-02-23  Martin Baulig  <martin@ximian.com>
15713
15714         * class.cs (Event.Define): Always make the field private, like csc does.
15715
15716         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15717         actually work, fixes bug #37521.
15718
15719 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15720
15721         * delegate.cs: When creating the various temporary "Parameters"
15722         classes, make sure that we call the ComputeAndDefineParameterTypes
15723         on those new parameters (just like we do with the formal ones), to
15724         allow them to be resolved in the context of the DeclSpace.
15725
15726         This fixes the bug that Dick observed in Bugzilla #38530.
15727
15728 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15729
15730         * expression.cs (ResolveMemberAccess): When resolving a constant,
15731         do not attempt to pull a constant if the value was not able to
15732         generate a valid constant.
15733
15734         * const.cs (LookupConstantValue): Do not report more errors than required.
15735
15736 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15737
15738         * expression.cs: fixes bug #38328.
15739
15740 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * class.cs: Changed all the various members that can be part of a
15743         class from being an ArrayList to be an Array of the right type.
15744         During the DefineType type_list, interface_list, delegate_list and
15745         enum_list are turned into types, interfaces, delegates and enums
15746         arrays.  
15747
15748         And during the member population, indexer_list, event_list,
15749         constant_list, field_list, instance_constructor_list, method_list,
15750         operator_list and property_list are turned into their real arrays.
15751
15752         Although we could probably perform this operation earlier, for
15753         good error reporting we need to keep the lists and remove the
15754         lists for longer than required.
15755
15756         This optimization was triggered by Paolo profiling the compiler
15757         speed on the output of `gen-sample-program.pl' perl script. 
15758
15759         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15760         not crash in methods like MemberLookupFailed that use this field.  
15761
15762         This problem arises when the compiler fails to resolve a type
15763         during interface type definition for example.
15764
15765 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15766
15767         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15768         inherit from System.Object, so we have to stop at null, not only
15769         when reaching System.Object.
15770
15771 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15774         DeclaredOnly because the parent indexer might have had a different
15775         name, but did not loop until the top of the hierarchy was reached.
15776
15777         The problem this one fixes is 35492: when a class implemented an
15778         indexer from an interface, we were getting the interface method
15779         (which was abstract) and we were flagging an error (can not invoke
15780         abstract method).
15781
15782         This also keeps bug 33089 functioning, and test-148 functioning.
15783
15784         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15785         out if a method is special is to see if it is declared in a
15786         property or event, or whether it is one of the predefined operator
15787         names.   This should fix correctly #36804.
15788
15789 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15790
15791         The goal here is to remove the dependency on EmptyCast.Peel ().
15792         Killing it completely.
15793
15794         The problem is that currently in a number of places where
15795         constants are expected, we have to "probe" for an EmptyCast, and
15796         Peel, which is not the correct thing to do, as this will be
15797         repetitive and will likely lead to errors. 
15798
15799         The idea is to remove any EmptyCasts that are used in casts that
15800         can be reduced to constants, so we only have to cope with
15801         constants. 
15802
15803         This bug hunt was triggered by Bug 37363 and the desire to remove
15804         the duplicate pattern where we were "peeling" emptycasts to check
15805         whether they were constants.  Now constants will always be
15806         constants.
15807
15808         * ecore.cs: Use an enumconstant here instead of wrapping with
15809         EmptyCast.  
15810
15811         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15812         throwing me off.  By handling this we can get rid of a few hacks.
15813
15814         * statement.cs (Switch): Removed Peel() code.
15815
15816 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15817
15818         * class.cs: Location information for error 508
15819
15820         * expression.cs (New.DoResolve): Add a guard against double
15821         resolution of an expression.  
15822
15823         The New DoResolve might be called twice when initializing field
15824         expressions (see EmitFieldInitializers, the call to
15825         GetInitializerExpression will perform a resolve on the expression,
15826         and later the assign will trigger another resolution
15827
15828         This leads to bugs (#37014)
15829
15830         * delegate.cs: The signature for EndInvoke should contain any ref
15831         or out parameters as well.  We were not doing this in the past. 
15832
15833         * class.cs (Field.Define): Do not overwrite the type definition
15834         inside the `volatile' group.  Turns out that volatile enumerations
15835         were changing the type here to perform a validity test, which
15836         broke conversions. 
15837
15838 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15839
15840         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15841         and structs, we do not want to load the instance variable
15842
15843         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15844         enum_type has to be handled like an object reference (implicit
15845         conversions exists from this to object), but the regular IsClass
15846         and IsValueType tests will never return true for this one.
15847
15848         Also we use TypeManager.IsValueType instead of type.IsValueType,
15849         just for consistency with the rest of the code (this is only
15850         needed if we ever use the construct exposed by test-180.cs inside
15851         corlib, which we dont today).
15852
15853 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15854
15855         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15856         just InternalCall.
15857
15858 2003-02-09  Martin Baulig  <martin@ximian.com>
15859
15860         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15861         (Namespace.DefineNamespaces): New static public method; this is
15862         called when we're compiling with debugging to add all namespaces
15863         to the symbol file.
15864
15865         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15866         pass it to the Namespace's .ctor.
15867
15868         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15869         and MethodBase arguments; pass the namespace ID to the symwriter;
15870         pass the MethodBase instead of the token to the symwriter.
15871         (SymbolWriter.DefineNamespace): New method to add a namespace to
15872         the symbol file.
15873
15874 2003-02-09  Martin Baulig  <martin@ximian.com>
15875
15876         * symbolwriter.cs: New file.  This is a wrapper around
15877         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15878         methods here in near future.
15879
15880 2003-02-09  Martin Baulig  <martin@ximian.com>
15881
15882         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15883         ILGenerator.MarkSequencePoint() which are actually used by the
15884         symbol writer.
15885
15886 2003-02-09  Martin Baulig  <martin@ximian.com>
15887
15888         * location.cs (SourceFile): New public sealed class.  This
15889         contains the name and an index which is used in the location's token.
15890         (Location): Reserve an appropriate number of bits in the token for
15891         the source file instead of walking over that list, this gives us a
15892         really huge performance improvement when compiling with debugging.
15893
15894         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15895         `SourceFile' argument instead of a string.
15896         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15897         but don't parse/tokenize here, we need to generate the list of all
15898         source files before we do that.
15899         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15900         the files.
15901
15902         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15903         instead of a string.
15904
15905         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15906         of a string.
15907
15908 2003-02-09  Martin Baulig  <martin@ximian.com>
15909
15910         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15911         filename on `#line default'.
15912
15913 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15914
15915         * statement.cs: don't clear the pinned var when the fixed statement
15916         returns from the method (fixes bug#37752).
15917
15918 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15919
15920         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15921         to IsValueType.
15922
15923 2003-02-07  Martin Baulig  <martin@ximian.com>
15924
15925         * driver.cs: Removed the `--debug-args' command line argument.
15926
15927         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15928         automatically by the AsssemblyBuilder.
15929         (CodeGen.InitializeSymbolWriter): We don't need to call any
15930         initialization function on the symbol writer anymore.  This method
15931         doesn't take any arguments.
15932
15933 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15934
15935         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15936         from referenced assemblies as well.
15937
15938 2003-02-02  Martin Baulig  <martin@ximian.com>
15939
15940         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15941
15942 2003-02-02  Martin Baulig  <martin@ximian.com>
15943
15944         * class.cs (Constructor.Emit): Open the symbol writer before
15945         emitting the constructor initializer.
15946         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15947         single-stepping through constructor initializers.
15948
15949 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15950
15951         * class.cs: Handle error 549: do not allow virtual methods in
15952         sealed classes. 
15953
15954 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15955
15956         * decl.cs: Check access levels when resolving types
15957
15958 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15959
15960         * statement.cs: Add parameters and locals set in catch blocks that might 
15961         return to set vector
15962
15963 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15964
15965         * class.cs (Operator): Set the SpecialName flags for operators.
15966
15967         * expression.cs (Invocation.DoResolve): Only block calls to
15968         accessors and operators on SpecialName methods.
15969
15970         (Cast.TryReduce): Handle conversions from char constants.
15971
15972
15973 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15974
15975         * statement.cs: small memory and time optimization in FlowBranching.
15976
15977 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15978
15979         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15980         problem that the last fix but in the other sid (Set).
15981
15982         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15983         access when there is no indexer in the hierarchy.
15984
15985 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15986
15987         * class.cs: Combine some if statements.
15988
15989 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15990
15991         * driver.cs: fixed bug #37187.
15992
15993 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15994
15995         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15996         any indexer, it's needed to build a list with all the indexers in the
15997         hierarchy (AllGetters), else we have problems. Fixes #35653.
15998
15999 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
16000
16001         * class.cs (MethodData.Define): It is wrong for an interface
16002         implementation to be static in both cases: explicit and implicit.
16003         We were only handling this in one case.
16004
16005         Improve the if situation there to not have negations.
16006
16007         * class.cs (Field.Define): Turns out that we do not need to check
16008         the unsafe bit on field definition, only on usage.  Remove the test.
16009
16010 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16011
16012         * driver.cs: use assembly.Location instead of Codebase (the latest
16013         patch made mcs fail when using MS assemblies).
16014
16015 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
16016
16017         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
16018         get the path to *corlib.dll.
16019
16020 2003-01-21  Nick Drochak <ndrochak@gol.com>
16021
16022         * cs-tokenizer.cs:
16023         * pending.cs:
16024         * typemanager.cs: Remove compiler warnings
16025
16026 2003-01-20  Duncan Mak  <duncan@ximian.com>
16027
16028         * AssemblyInfo.cs: Bump the version number to 0.19.
16029
16030 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16031
16032         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
16033
16034 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
16035
16036         * class.cs (Constructor::Emit): Emit debugging info for constructors.
16037
16038 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
16039
16040         * cs-parser.jay: Small fix: we were not comparing the constructor
16041         name correctly.   Thanks to Zoltan for the initial pointer.
16042
16043 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
16044
16045         * cs-tokenizer.cs: Set file name when specified with #line
16046
16047 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
16048
16049         * cs-parser.jay: Only perform the constructor checks here if we
16050         are named like the class;  This will help provider a better
16051         error.  The constructor path is taken when a type definition is
16052         not found, but most likely the user forgot to add the type, so
16053         report that rather than the constructor error.
16054
16055 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
16056
16057         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
16058         allocations.
16059
16060 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16061
16062         * cs-parser.jay: Add cleanup call.
16063
16064 2003-01-13  Duncan Mak  <duncan@ximian.com>
16065
16066         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
16067         consistent with other methods.
16068
16069 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
16070
16071         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
16072
16073 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
16074
16075         * attribute.cs: only set GuidAttr to true when we have a
16076         GuidAttribute.
16077
16078 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16079
16080         * ecore.cs:
16081         * expression.cs:
16082         * typemanager.cs: fixes to allow mcs compile corlib with the new
16083         Type.IsSubclassOf fix.
16084
16085 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
16086
16087         * expression.cs (LocalVariableReference.DoResolve): Classify a
16088         constant as a value, not as a variable.   Also, set the type for
16089         the variable.
16090
16091         * cs-parser.jay (fixed_statement): take a type instead of a
16092         pointer_type, so we can produce a better error message later.
16093
16094         * statement.cs (Fixed.Resolve): Flag types that are not pointers
16095         as an error.  
16096
16097         (For.DoEmit): Make inifinite loops have a
16098         non-conditional branch back.
16099
16100         (Fixed.DoEmit): First populate the pinned variables, then emit the
16101         statement, then clear the variables.  Before I was emitting the
16102         code once for each fixed piece.
16103
16104
16105 2003-01-08  Martin Baulig  <martin@ximian.com>
16106
16107         * statement.cs (FlowBranching.MergeChild): A break in a
16108         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16109
16110 2003-01-08  Martin Baulig  <martin@ximian.com>
16111
16112         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16113         lives in the same number space than `param_map'.  Fixes #36154.
16114
16115 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16116
16117         * cs-parser.jay (constructor_declaration): Set the
16118         Constructor.ModFlags before probing for it.  This makes the
16119         compiler report 514, 515 and 132 (the code was there, but got
16120         broken). 
16121
16122         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16123         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16124         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16125
16126 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16127
16128         * enum.cs: create the enum static fields using the enum type.
16129
16130 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16131
16132         * class.cs: don't try to create the ParamBuilder for the return
16133         type if it's not needed (and handle it breaking for the ms runtime
16134         anyway).
16135
16136 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16137
16138         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16139
16140 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16141
16142         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16143         the command.   This showed up while compiling the JANET source
16144         code, which used \r as its only newline separator.
16145
16146 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16147
16148         * class.cs (Method.Define): If we are an operator (because it
16149         reuses our code), then set the SpecialName and HideBySig.  #36128
16150
16151 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16152
16153         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16154         exception, report error 120 `object reference required'.
16155
16156         * driver.cs: Add --pause option, used during to measure the size
16157         of the process as it goes with --timestamp.
16158
16159         * expression.cs (Invocation.DoResolve): Do not allow methods with
16160         SpecialName to be invoked.
16161
16162 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16165         number before adding it.
16166
16167 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16168
16169         * ecore.cs (StandardImplicitConversion): When in an unsafe
16170         context, we allow conversion between void * to any other pointer
16171         type. This fixes bug #35973.
16172
16173 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16174
16175         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16176         is not thrown when extensionless outputs are used 
16177
16178 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16179
16180         * rootcontext.cs: fixed compilation of corlib.
16181
16182 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16183
16184         * attribute.cs (Attributes.Contains): Add new method.
16185
16186         * class.cs (MethodCore.LabelParameters): if the parameter is an
16187         `out' parameter, check that no attribute `[In]' has been passed.
16188
16189         * enum.cs: Handle the `value__' name in an enumeration.
16190
16191 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16192
16193         * decl.cs: Added special case to allow overrides on "protected
16194         internal" methods
16195
16196 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16197
16198         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16199         since it makes much more sense.
16200
16201         (Attributes.ctor): Don't require a Location parameter.
16202
16203         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16204
16205         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16206         since we already have that information per attribute.
16207
16208         * everywhere : make appropriate changes.
16209
16210         * class.cs (LabelParameters): Write the code which actually
16211         applies attributes to the return type. We can't do this on the MS
16212         .NET runtime so we flag a warning in the case an exception is
16213         thrown.
16214
16215 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16216
16217         * const.cs: Handle implicit null conversions here too.
16218
16219 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16220
16221         * class.cs (MethodCore.LabelParameters): Remove the extra
16222         Type [] parameter since it is completely unnecessary. Instead
16223         pass in the method's attributes so that we can extract
16224         the "return" attribute.
16225
16226 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16227
16228         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16229         of ignoring it and letting the compile continue.
16230
16231         * typemanager.cs (ChangeType): use an extra argument to return an
16232         error condition instead of throwing an exception.
16233
16234 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16235
16236         * expression.cs (Unary.TryReduce): mimic the code for the regular
16237         code path.  Perform an implicit cast in the cases where we can
16238         implicitly convert to one of the integral types, and then reduce
16239         based on that constant.   This fixes bug #35483.
16240
16241 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16242
16243         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16244
16245 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16246
16247         * namespace.cs: fixed bug #35489.
16248
16249 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16250
16251         * class.cs: Remove some dead code.
16252
16253         * cs-parser.jay: Estimate the number of methods needed
16254         (RootContext.MethodCount);
16255
16256         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16257         numbers instead of StringBuilders.
16258
16259         * support.cs (PtrHashtable): Add constructor with initial size;
16260         We can now reduce reallocations of the method table.
16261
16262 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16263
16264         * attribute.cs (ApplyAttributes): Keep track of the emitted
16265         attributes on a per-target basis. This fixes bug #35413.
16266
16267 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16268
16269         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16270         default to the Windows 1252 encoding.
16271
16272         (UnixParseOption): Support version, thanks to Alp for the missing
16273         pointer. 
16274
16275         * AssemblyInfo.cs: Add nice assembly information.
16276
16277         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16278         (bug 35169).
16279
16280         * cs-parser.jay: Allow a trailing comma before the close bracked
16281         in the attribute_section production.
16282
16283         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16284         address of the instance was being taken, I will take this out,
16285         because we take the address of the object immediately here.
16286
16287 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16288
16289         * typemanager.cs (AreMultipleAllowed): Take care of the most
16290         obvious case where attribute type is not in the current assembly -
16291         stupid me ;-)
16292
16293 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16294
16295         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16296         definitions, instead of doing that afterwards.  
16297
16298         Also we use a nice little hack, depending on the constructor, we
16299         know if we are a "composed" name or a simple name.  Hence, we
16300         avoid the IndexOf test, and we avoid 
16301
16302         * codegen.cs: Add code to assist in a bug reporter to track down
16303         the source of a compiler crash. 
16304
16305 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16306
16307         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16308         types have been emitted for a given element and flag an error
16309         if something which does not have AllowMultiple set is used more
16310         than once.
16311
16312         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16313         attribute types and their corresponding AllowMultiple properties
16314
16315         (AreMultipleAllowed): Check the property for a given type.
16316
16317         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16318         property in the case we have a TypeContainer.
16319
16320         (Attributes.AddAttribute): Detect duplicates and just skip on
16321         adding them. This trivial fix catches a pretty gross error in our
16322         attribute emission - global attributes were being emitted twice!
16323
16324         Bugzilla bug #33187 is now fixed.
16325
16326 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16327
16328         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16329         instead of pp_and).
16330
16331         * expression.cs (Binary.ResolveOperator): I can only use the
16332         Concat (string, string, string) and Concat (string, string,
16333         string, string) if the child is actually a concatenation of
16334         strings. 
16335
16336 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16337
16338         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16339         context where we need a 2-character lookahead.
16340
16341         * pending.cs (PendingImplementation): Rework so we can keep track
16342         of interface types all the time, and flag those which were
16343         implemented by parents as optional.
16344
16345 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16346
16347         * expression.cs (Binary.ResolveOperator): Use
16348         String.Concat(string,string,string) or
16349         String.Concat(string,string,string,string) when possible. 
16350
16351         * typemanager: More helper methods.
16352
16353
16354 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16355
16356         * pending.cs: remove the bogus return from GetMissingInterfaces()
16357         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16358
16359 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16360
16361         * namespace.cs: avoid duplicated 'using xxx' being added to
16362         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16363         when we get more than one 'using' statement for the same namespace.
16364         Report a CS0105 warning for it.
16365
16366 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16367
16368         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16369         of calling getChar/putback, uses internal knowledge of it.    
16370
16371         (xtoken): Reorder tokenizer so most common patterns are checked
16372         first.  This reduces the compilation time in another 5% (from 8.11s
16373         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16374
16375         The parsing time is 22% of the compilation in mcs, and from that
16376         64% is spent on the tokenization process.  
16377
16378         I tried using a binary search for keywords, but this is slower
16379         than the hashtable.  Another option would be to do a couple of
16380         things:
16381
16382                 * Not use a StringBuilder, instead use an array of chars,
16383                   with a set value.  Notice that this way we could catch
16384                   the 645 error without having to do it *afterwards*.
16385
16386                 * We could write a hand-parser to avoid the hashtable
16387                   compares altogether.
16388
16389         The identifier consumption process takes 37% of the tokenization
16390         time.  Another 15% is spent on is_number.  56% of the time spent
16391         on is_number is spent on Int64.Parse:
16392
16393                 * We could probably choose based on the string length to
16394                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16395                   computations. 
16396
16397         Another 3% is spend on wrapping `xtoken' in the `token' function.
16398
16399         Handle 0xa0 as whitespace (#34752)
16400
16401 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16402
16403         * typemanager.cs (IsCLRType): New routine to tell whether a type
16404         is one of the builtin types.  
16405
16406         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16407         typecode in more places instead of doing pointer comparissions.
16408         We could leverage some knowledge about the way the typecodes are
16409         laid out.
16410
16411         New code to cache namespaces in assemblies, it is currently not
16412         invoked, to be used soon.
16413
16414         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16415
16416         * expression.cs (Binary.ResolveOperator): specially handle
16417         strings, and do not perform user-defined operator overloading for
16418         built-in types.
16419
16420 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16421
16422         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16423         internalcall as it is a pretty simple operation;  Avoid whenever
16424         possible to call Char.IsLetter.
16425
16426         (consume_identifier): Cut by half the number of
16427         hashtable calls by merging the is_keyword and GetKeyword behavior.
16428
16429         Do not short-circuit, because if we do, we
16430         report errors (ie, #if false && true would produce an invalid
16431         directive error);
16432
16433
16434 2002-11-24  Martin Baulig  <martin@ximian.com>
16435
16436         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16437         check constant ranges and report a CS0221.  Fixes #33186.
16438
16439 2002-11-24  Martin Baulig  <martin@ximian.com>
16440
16441         * cs-parser.jay: Make this work for uninitialized variable
16442         declarations in the `for' initializer.  Fixes #32416.
16443
16444 2002-11-24  Martin Baulig  <martin@ximian.com>
16445
16446         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16447         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16448
16449 2002-11-24  Martin Baulig  <martin@ximian.com>
16450
16451         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16452         argument; if true, we also check for user-defined conversions.
16453         This is only needed if both arguments are of a user-defined type.
16454         Fixes #30443, added test-175.cs.
16455         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16456
16457         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16458
16459 2002-11-24  Martin Baulig  <martin@ximian.com>
16460
16461         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16462         function to get the store opcode.
16463         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16464         only emit the Ldelema if the store opcode is Stobj.  You must run
16465         both test-34 and test-167 to test this.  Fixes #34529.
16466
16467 2002-11-23  Martin Baulig  <martin@ximian.com>
16468
16469         * ecore.cs (Expression.MemberLookup): Added additional
16470         `qualifier_type' argument which is used when we're being called
16471         from MemberAccess.DoResolve() and null if we're called from a
16472         SimpleName lookup.
16473         (Expression.MemberLookupFailed): New method to report errors; this
16474         does the CS1540 check and reports the correct error message.
16475
16476         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16477         argument for the CS1540 check and redone the way how we're dealing
16478         with private members.  See the comment in the source code for details.
16479         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16480         `closure_start_type' to `closure_qualifier_type' and check whether
16481         it's not null.  It was not this filter being broken, it was just
16482         being called with the wrong arguments.
16483
16484         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16485         and pass it the correct `qualifier_type'; this also does the error
16486         handling for us.
16487
16488 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16489
16490         * expression.cs (Invocation.EmitParams): If the we are dealing
16491         with a non-built-in value type, load its address as well.
16492
16493         (ArrayCreation): Use a a pretty constant instead
16494         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16495         static initializers.  
16496
16497         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16498         because they are not really value types, just glorified integers. 
16499
16500         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16501
16502         * ecore.cs: Remove redundant code for enumerations, make them use
16503         the same code path as everything else, fixes the casting issue
16504         with enumerations in Windows.Forms.
16505
16506         * attribute.cs: Do only cast to string if it is a string, the
16507         validation happens later.
16508
16509         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16510         people upgrade their corlibs.
16511
16512         * ecore.cs: Oops, enumerations were not following the entire code path
16513
16514 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16515
16516         * typemanager.cs (FilterWithClosure): Commented out the test for
16517         1540 in typemanager.cs, as it has problems when accessing
16518         protected methods from a parent class (see test-174.cs). 
16519
16520         * attribute.cs (Attribute.ValidateGuid): new method.
16521         (Attribute.Resolve): Use above.
16522
16523 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16524
16525         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16526
16527         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16528         handling for enumerations, as we only needed the TypeContainer
16529         functionality to begin with (this is required for the fix below to
16530         work for enums that reference constants in a container class for
16531         example). 
16532
16533         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16534
16535         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16536         a valid TypeBuilder to perform lookups on.o
16537
16538         * class.cs (InheritableMemberSignatureCompare): Use true in the
16539         call to GetGetMethod and GetSetMethod, because we are comparing
16540         the signature, and we need to get the methods *even* if they are
16541         private. 
16542
16543         (PropertyBase.CheckBase): ditto.
16544
16545         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16546         GotoCase.Resolve): Use Peel on EmpytCasts.
16547
16548         * ecore.cs (EmptyCast): drop child, add Peel method.
16549
16550 2002-11-17  Martin Baulig  <martin@ximian.com>
16551
16552         * ecore.cs (EmptyCast.Child): New public property.
16553
16554         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16555         label resolved to an EmptyCast.  Fixes #34162.
16556         (GotoCase.Resolve): Likewise.
16557         (Block.EmitMeta): Likewise.
16558
16559 2002-11-17  Martin Baulig  <martin@ximian.com>
16560
16561         * expression.cs (Invocation.BetterConversion): Prefer int over
16562         uint; short over ushort; long over ulong for integer literals.
16563         Use ImplicitConversionExists instead of StandardConversionExists
16564         since we also need to check for user-defined implicit conversions.
16565         Fixes #34165.  Added test-173.cs.
16566
16567 2002-11-16  Martin Baulig  <martin@ximian.com>
16568
16569         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16570         with the `true' and `false' literals.  Fixes #33151.
16571
16572 2002-11-16  Martin Baulig  <martin@ximian.com>
16573
16574         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16575         October 22nd; don't do the cs1540 check for static members.
16576
16577         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16578         now using our own filter here and doing the cs1540 check again.
16579
16580 2002-11-16  Martin Baulig  <martin@ximian.com>
16581
16582         * support.cs (InternalParameters): Don't crash if we don't have
16583         any fixed parameters.  Fixes #33532.
16584
16585 2002-11-16  Martin Baulig  <martin@ximian.com>
16586
16587         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16588         when looking up static methods to make this work on Windows.
16589         Fixes #33773.
16590
16591 2002-11-16  Martin Baulig  <martin@ximian.com>
16592
16593         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16594         a setter rather than using PropertyInfo.CanWrite.
16595
16596 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16597
16598         * class.cs: Allow acces to block member by subclasses. Fixes build
16599         breaker.
16600
16601 2002-11-14  Martin Baulig  <martin@ximian.com>
16602
16603         * class.cs (Constructor.Emit): Added the extern/block check.
16604         Fixes bug #33678.
16605
16606 2002-11-14  Martin Baulig  <martin@ximian.com>
16607
16608         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16609         iteration while looking for indexers, this is needed because the
16610         indexer may have a different name in our base classes.  Fixed the
16611         error reporting (no indexers at all, not get accessor, no
16612         overloaded match).  Fixes bug #33089.
16613         (IndexerAccess.DoResolveLValue): Likewise.
16614
16615 2002-11-14  Martin Baulig  <martin@ximian.com>
16616
16617         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16618         indexers.  Fixes the first part of bug #33089.
16619         (MethodSignature.InheritableMemberSignatureCompare): Added support
16620         for properties.
16621
16622 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16623
16624         * attribute.cs (Attribute.Resolve): Catch the
16625         NullReferenceException and report it since it isn't supposed to
16626         happen. 
16627
16628 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16631         LogicalOr and LogicalAnd that can benefit from recursively
16632         handling EmitBranchable.  The code now should be nice for Paolo.
16633
16634 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16635
16636         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16637         the Type lookups, as we perform quite a number of lookups on
16638         non-Types.  This can be removed once we can deterministically tell
16639         whether we have a type or a namespace in advance.
16640
16641         But this might require special hacks from our corlib.
16642
16643         * TODO: updated.
16644
16645         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16646         and double which avoids a conversion from an integer to a double.
16647
16648         * expression.cs: tiny optimization, avoid calling IsConstant,
16649         because it effectively performs the lookup twice.
16650
16651 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16652
16653         But a bogus return here to keep the semantics of the old code
16654         until the Mono runtime is fixed.
16655
16656         * pending.cs (GetMissingInterfaces): New method used to remove all
16657         the interfaces that are already implemented by our parent
16658         classes from the list of pending methods. 
16659
16660         * interface.cs: Add checks for calls after ResolveTypeExpr.
16661
16662 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16663
16664         * class.cs (Class.Emit): Report warning 67: event not used if the
16665         warning level is beyond 3.
16666
16667         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16668         being a NullLiteral.
16669
16670         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16671         specifiers. 
16672
16673         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16674         path that might fail if a type can not be resolved.
16675
16676         * expression.cs (Binary.Emit): Emit unsigned versions of the
16677         operators. 
16678
16679         * driver.cs: use error 5.
16680
16681 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16682
16683         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16684
16685 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16686
16687         * cs-parser.jay (switch_section): A beautiful patch from Martin
16688         Baulig that fixed 33094.
16689
16690 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16691
16692         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16693         Check whether the base is abstract and report an error if so.
16694
16695         * expression.cs (IndexerAccess.DoResolveLValue,
16696         IndexerAccess.DoResolve): ditto. 
16697
16698         (Invocation.DoResolve): ditto.
16699
16700         (Invocation.FullMethodDesc): Improve the report string.
16701
16702         * statement.cs (Block): Eliminate IsVariableDefined as it is
16703         basically just a wrapper for GetVariableInfo.
16704
16705         * ecore.cs (SimpleName): Use new 
16706
16707         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16708         type, as we return the actual parameter ref/unref state on a
16709         different call.
16710
16711 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16712
16713         * support.cs: Return proper flags REF/OUT fixing the previous
16714         commit.  
16715
16716         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16717         not used to mean `ref' but `ref or out' in ParameterReference
16718
16719         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16720         full type signature instead of calling TypeManger.CSharpName
16721         ourselves. 
16722
16723         * support.cs (InternalParameters.ParameterDesc): Do not compare
16724         directly to the modflags, because REF/OUT will actually be bitsets
16725         if set. 
16726
16727         * delegate.cs (VerifyMethod): Check also the modifiers.
16728
16729         * cs-tokenizer.cs: Fix bug where floating point values with an
16730         exponent where a sign was missing was ignored.
16731
16732         * driver.cs: Allow multiple assemblies to be specified in a single
16733         /r: argument
16734
16735 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16738         because identifiers after a parenthesis would end up in this kind
16739         of production, and we needed to desamiguate it for having casts
16740         like:
16741
16742                 (UserDefinedType *) xxx
16743
16744 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16745
16746         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16747         we should set on the Bindingflags.NonPublic, but not turn on
16748         private_ok.  private_ok controls whether a Private member is
16749         returned (this is chekced on the filter routine), while the
16750         BindingFlags.NonPublic just controls whether private/protected
16751         will be allowed.   This fixes the problem part of the problem of
16752         private properties being allowed to be used in derived classes.
16753
16754         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16755         so we can call the children DoResolveLValue method (this will
16756         properly signal errors on lvalue assignments to base properties)
16757
16758         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16759         getter are null, and we have a property info, we know that this
16760         happened because the lookup failed, so we report an error 122 for
16761         protection level violation.
16762
16763         We also silently return if setter and getter are null in the
16764         resolve functions, this condition only happens if we have flagged
16765         the error before.  This is the other half of the problem. 
16766
16767         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16768         not have accessibility information, that is why we were returning
16769         true in the filter function in typemanager.cs.
16770
16771         To properly report 122 (property is inaccessible because of its
16772         protection level) correctly, we report this error in ResolveAccess
16773         by failing if both the setter and the getter are lacking (ie, the
16774         lookup failed). 
16775
16776         DoResolve and DoLResolve have been modified to check for both
16777         setter/getter being null and returning silently, the reason being
16778         that I did not want to put the knowledge about this error in upper
16779         layers, like:
16780
16781         int old = Report.Errors;
16782         x = new PropertyExpr (...);
16783         if (old != Report.Errors)
16784                 return null;
16785         else
16786                 return x;
16787
16788         So the property expr is returned, but it is invalid, so the error
16789         will be flagged during the resolve process. 
16790
16791         * class.cs: Remove InheritablePropertySignatureCompare from the
16792         class, as we no longer depend on the property signature to compute
16793         whether it is possible to implement a method or not.
16794
16795         The reason is that calling PropertyInfo.GetGetMethod will return
16796         null (in .NET, in Mono it works, and we should change this), in
16797         cases where the Get Method does not exist in that particular
16798         class.
16799
16800         So this code:
16801
16802         class X { public virtual int A { get { return 1; } } }
16803         class Y : X { }
16804         class Z : Y { public override int A { get { return 2; } } }
16805
16806         Would fail in Z because the parent (Y) would not have the property
16807         defined.  So we avoid this completely now (because the alternative
16808         fix was ugly and slow), and we now depend exclusively on the
16809         method names.
16810
16811         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16812         reference method, instead of using the property.
16813
16814         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16815         routines are gone now.
16816
16817         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16818         names, they were incorrectly named.
16819
16820         * cs-tokenizer.cs: Return are more gentle token on failure. 
16821
16822         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16823         had an out-of-sync index variable, which caused it to remove from
16824         the list of pending methods the wrong method sometimes.
16825
16826 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16829         CanWrite, because those refer to this particular instance of the
16830         property, and do not take into account the fact that we can
16831         override single members of a property.
16832
16833         Constructor requires an EmitContext.  The resolution process does
16834         not happen here, but we need to compute the accessors before,
16835         because the resolution does not always happen for properties.
16836
16837         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16838         subclass, before we did not update this flag, but we did update
16839         bindingflags. 
16840
16841         (GetAccessors): Drop this routine, as it did not work in the
16842         presence of partially overwritten set/get methods. 
16843
16844         Notice that this broke the cs1540 detection, but that will require
16845         more thinking. 
16846
16847 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16848
16849         * class.cs:
16850         * codegen.cs:
16851         * driver.cs: issue a warning instead of an error if we don't support
16852         debugging for the platform. Also ignore a couple of errors that may
16853         arise when trying to write the symbols. Undo my previous patch.
16854
16855 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16856
16857         * driver.cs: ignore /debug switch except for Unix platforms.
16858
16859 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16860
16861         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16862
16863 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16864
16865         * driver.cs: Do not make mcs-debug conditional, so we do not break
16866         builds that use it.
16867
16868         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16869         review this patch.  But basically after all the children variables
16870         have been merged, the value of "Breaks" was not being set to
16871         new_breaks for Switch blocks.  I think that it should be set after
16872         it has executed.  Currently I set this to the value of new_breaks,
16873         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16874         conservative, but I do not understand this code very well.
16875
16876         I did not break anything in the build, so that is good ;-)
16877
16878         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16879
16880 2002-10-20  Mark Crichton  <crichton@gimp.org>
16881
16882         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16883
16884 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16885
16886         * cfold.cs: Fixed compile blocker.
16887
16888 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * driver.cs: I was chekcing the key, not the file.
16891
16892 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16893
16894         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16895         message that we were generating - we just need to silently return
16896         a null.
16897
16898 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16899
16900         * class.cs (Event.Define): Change my previous commit, as this
16901         breaks the debugger.  This is a temporary hack, as it seems like
16902         the compiler is generating events incorrectly to begin with.
16903
16904         * expression.cs (Binary.ResolveOperator): Added support for 
16905         "U operator - (E x, E y)"
16906
16907         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16908         y)".
16909
16910         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16911         init-only variables, but this path did not take into account that
16912         there might be also instance readonly variables.  Correct this
16913         problem. 
16914
16915         This fixes bug 32253
16916
16917         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16918         delegates as well.
16919
16920         * driver.cs: Change the extension for modules to `netmodule'
16921
16922         * cs-parser.jay: Improved slightly the location tracking for
16923         the debugger symbols.
16924
16925         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16926         modifiers that were specified instead of the hardcoded value
16927         (FamAndAssem).  This was basically ignoring the static modifier,
16928         and others.  Fixes 32429.
16929
16930         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16931         fixed a bug in the process (32476)
16932
16933         * expression.cs (ArrayAccess.EmitAssign): Patch from
16934         hwang_rob@yahoo.ca that fixes bug 31834.3
16935
16936 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16937
16938         * driver.cs: Make the module extension .netmodule.
16939
16940 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16941
16942         * driver.cs: Report an error if the resource file is not found
16943         instead of crashing.
16944
16945         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16946         false, like Emit does.
16947
16948 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16949
16950         * typemanager.cs: Remove unused private member.  Also reported mcs
16951         bug to report this as a warning like csc.
16952
16953 2002-10-15  Martin Baulig  <martin@gnome.org>
16954
16955         * statement.cs (Statement.Emit): Made this a virtual method; emits
16956         the line number info and calls DoEmit().
16957         (Statement.DoEmit): New protected abstract method, formerly knows
16958         as Statement.Emit().
16959
16960         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16961
16962 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16963
16964         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16965         have fixed a remaining problem: not every AddXXXX was adding a
16966         fully qualified name.  
16967
16968         Now everyone registers a fully qualified name in the DeclSpace as
16969         being defined instead of the partial name.  
16970
16971         Downsides: we are slower than we need to be due to the excess
16972         copies and the names being registered this way.  
16973
16974         The reason for this is that we currently depend (on the corlib
16975         bootstrap for instance) that types are fully qualified, because
16976         we dump all the types in the namespace, and we should really have
16977         types inserted into the proper namespace, so we can only store the
16978         basenames in the defined_names array.
16979
16980 2002-10-10  Martin Baulig  <martin@gnome.org>
16981
16982         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16983         from bug #31834, see the bug report for a testcase which is
16984         miscompiled.
16985
16986 2002-10-10  Martin Baulig  <martin@gnome.org>
16987
16988         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16989         flow analysis code for this.
16990
16991         * statement.cs (Do, While, For): Tell the flow analysis code about
16992         infinite loops.
16993         (FlowBranching.UsageVector): Added support for infinite loops.
16994         (Block.Resolve): Moved the dead code elimination here and use flow
16995         analysis to do it.
16996
16997 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * class.cs (Field.Define): Catch cycles on struct type
17000         definitions. 
17001
17002         * typemanager.cs (IsUnmanagedtype): Do not recursively check
17003         fields if the fields are static.  We only need to check instance
17004         fields. 
17005
17006         * expression.cs (As.DoResolve): Test for reference type.
17007
17008         * statement.cs (Using.ResolveExpression): Use
17009         ConvertImplicitRequired, not ConvertImplicit which reports an
17010         error on failture
17011         (Using.ResolveLocalVariableDecls): ditto.
17012
17013         * expression.cs (Binary.ResolveOperator): Report errors in a few
17014         places where we had to.
17015
17016         * typemanager.cs (IsUnmanagedtype): Finish implementation.
17017
17018 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
17019
17020         * expression.cs: Use StoreFromPtr instead of extracting the type
17021         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
17022
17023         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
17024         an enumeration value to a System.Enum, but System.Enum is not a
17025         value type, but an class type, so we need to box.
17026
17027         (Expression.ConvertExplicit): One codepath could return
17028         errors but not flag them.  Fix this.  Fixes #31853
17029
17030         * parameter.cs (Resolve): Do not allow void as a parameter type.
17031
17032 2002-10-06  Martin Baulig  <martin@gnome.org>
17033
17034         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
17035         if it's a class type and not a struct.  Fixes #31815.
17036
17037 2002-10-06  Martin Baulig  <martin@gnome.org>
17038
17039         * statement.cs: Reworked the flow analysis code a bit to make it
17040         usable for dead code elimination.
17041
17042 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17043
17044         * cs-parser.jay: allow empty source files. Fixes bug #31781.
17045
17046 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17047
17048         * expression.cs (ComposedCast.DoResolveType): A quick workaround
17049         to fix the test 165, will investigate deeper.
17050
17051 2002-10-04  Martin Baulig  <martin@gnome.org>
17052
17053         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
17054         finally blocks actually work.
17055         (Try.Resolve): We don't need to create a sibling for `finally' if
17056         there is no finally block.
17057
17058 2002-10-04  Martin Baulig  <martin@gnome.org>
17059
17060         * class.cs (Constructor.Define): The default accessibility for a
17061         non-default constructor is private, not public.
17062
17063 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
17064
17065         * class.cs (Constructor): Make AllowedModifiers public, add
17066         EXTERN.
17067
17068         * cs-parser.jay: Perform the modifiers test here, as the
17069         constructor for the Constructor class usually receives a zero
17070         because of the way we create it (first we create, later we
17071         customize, and we were never checking the modifiers).
17072
17073         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
17074         is a version of LookupTypeReflection that includes the type-name
17075         cache.  This can be used as a fast path for functions that know
17076         the fully qualified name and are only calling into *.GetType() to
17077         obtain a composed type.
17078
17079         This is also used by TypeManager.LookupType during its type
17080         composition.
17081
17082         (LookupType): We now also track the real type name, as sometimes
17083         we can get a quey for the real type name from things like
17084         ComposedCast.  This fixes bug 31422.
17085
17086         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
17087         complete type fullname, it does not have to go through the type
17088         resolution system to obtain the composed version of the type (for
17089         obtaining arrays or pointers).
17090
17091         (Conditional.Emit): Use the EmitBoolExpression to
17092         generate nicer code, as requested by Paolo.
17093
17094         (ArrayCreation.CheckIndices): Use the patch from
17095         hwang_rob@yahoo.ca to validate the array initializers. 
17096
17097 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17098
17099         * class.cs (ConstructorInitializer.Emit): simplify code by using
17100         Invocation.EmitCall, and at the same time, fix the bugs in calling
17101         parent constructors that took variable arguments. 
17102
17103         * ecore.cs (Expression.ConvertNumericExplicit,
17104         Expression.ImplicitNumericConversion): Remove the code that
17105         manually wrapped decimal (InternalTypeConstructor call is now gone
17106         as well).
17107
17108         * expression.cs (Cast.TryReduce): Also handle decimal types when
17109         trying to perform a constant fold on the type.
17110
17111         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17112
17113         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17114         that only turned off an error report, and did nothing else. 
17115
17116 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17117
17118         * driver.cs: Handle and ignore /fullpaths
17119
17120 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17121
17122         * expression.cs (Binary.ResolveOperator): Catch the case where
17123         DoNumericPromotions returns true, 
17124
17125         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17126
17127 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17130         report error 70.
17131
17132 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17133
17134         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17135         conversion exists, but it is also required that the conversion be
17136         performed.  This manifested in "(Type64Enum) 2".  
17137
17138         * class.cs (TypeManager.AddMethod): The fix is not to change
17139         AddEnum, because that one was using a fully qualified name (every
17140         DeclSpace derivative does), but to change the AddMethod routine
17141         that was using an un-namespaced name.  This now correctly reports
17142         the duplicated name.
17143
17144         Revert patch until I can properly fix it.  The issue
17145         is that we have a shared Type space across all namespaces
17146         currently, which is wrong.
17147
17148         Options include making the Namespace a DeclSpace, and merge
17149         current_namespace/current_container in the parser.
17150
17151 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17152
17153         * cs-parser.jay: Improve error reporting when we get a different
17154         kind of expression in local_variable_type and
17155         local_variable_pointer_type. 
17156
17157         Propagate this to avoid missleading errors being reported.
17158
17159         * ecore.cs (ImplicitReferenceConversion): treat
17160         TypeManager.value_type as a target just like object_type.   As
17161         code like this:
17162
17163         ValueType v = 1;
17164
17165         Is valid, and needs to result in the int 1 being boxed before it
17166         is assigned to the value type v.
17167
17168         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17169         to validate the enumeration name.
17170
17171         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17172         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17173         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17174
17175         * ecore.cs (TryImplicitIntConversion): When doing an
17176         implicit-enumeration-conversion, check if the type is 64-bits and
17177         perform a conversion before passing to EnumConstant.
17178
17179 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17180
17181         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17182         report ambiguous type references.  Unlike the MS version, we
17183         report what the ambiguity is.   Innovation at work ;-)
17184
17185         (DeclSpace.FindType): Require a location argument to
17186         display when we display an ambiguous error.
17187
17188         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17189
17190         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17191
17192         * expression.cs (EmitDynamicInitializers): Apply patch from
17193         hwang_rob@yahoo.ca that fixes the order in which we emit our
17194         initializers. 
17195
17196 2002-09-21  Martin Baulig  <martin@gnome.org>
17197
17198         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17199         delegate takes no arguments.
17200
17201 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17202
17203         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17204         from integers.
17205
17206         * expression.cs: Extract the underlying type.
17207
17208         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17209
17210         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17211
17212 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17213
17214         * class.cs (TypeContainer.DefineType): We can not use the nice
17215         PackingSize with the size set to 1 DefineType method, because it
17216         will not allow us to define the interfaces that the struct
17217         implements.
17218
17219         This completes the fixing of bug 27287
17220
17221         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17222         means also structs.  This fixes part of the problem. 
17223         (Expresion.ImplicitReferenceConversionExists): ditto.
17224
17225         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17226         error if there were no errors reported during the type lookup
17227         process, to avoid duplicates or redundant errors.  Without this
17228         you would get an ambiguous errors plus a type not found.  We have
17229         beaten the user enough with the first error.  
17230
17231         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17232         reference. 
17233
17234         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17235         during the resolution process, stop the lookup, this avoids
17236         repeated error reports (same error twice).
17237
17238         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17239
17240         * typemanager.cs (LookupType): Redo the type lookup code to match
17241         the needs of System.Reflection.  
17242
17243         The issue is that System.Reflection requires references to nested
17244         types to begin with a "+" sign instead of a dot.  So toplevel
17245         types look like: "NameSpace.TopLevelClass", and nested ones look
17246         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17247         levels. 
17248
17249 2002-09-19  Martin Baulig  <martin@gnome.org>
17250
17251         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17252         says that a method always returns or always throws an exception,
17253         don't report the CS0161.
17254
17255         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17256         set `Returns = new_returns'.
17257
17258 2002-09-19  Martin Baulig  <martin@gnome.org>
17259
17260         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17261         to an enum constant, check for a CS0176.
17262
17263 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17264
17265         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17266         for operators that must be in pairs and report errors.
17267
17268         * ecore.cs (SimpleName.DoResolveType): During the initial type
17269         resolution process, when we define types recursively, we must
17270         check first for types in our current scope before we perform
17271         lookups in the enclosing scopes.
17272
17273         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17274
17275         (Invocation.VerifyArgumentsCompat): Call
17276         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17277         I thought we were supposed to always call this, but there are a
17278         few places in the code where we dont do it.
17279
17280 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17281
17282         * driver.cs: Add support in -linkres and -resource to specify the
17283         name of the identifier.
17284
17285 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17286
17287         * ecore.cs (StandardConversionExists): Sync with the conversion
17288         code: allow anything-* to void* conversions.
17289
17290         (FindMostSpecificSource): Use an Expression argument
17291         instead of a Type, because we might be handed over a Literal which
17292         gets a few more implicit conversions that plain types do not.  So
17293         this information was being lost.
17294
17295         Also, we drop the temporary type-holder expression when not
17296         required.
17297
17298 2002-09-17  Martin Baulig  <martin@gnome.org>
17299
17300         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17301         this is an explicit interface implementation.
17302
17303 2002-09-17  Martin Baulig  <martin@gnome.org>
17304
17305         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17306         different `IndexerName' attributes.
17307
17308         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17309         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17310         virtual CommonResolve().
17311
17312 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17313
17314         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17315         and convert that to the UnderlyingType.
17316
17317         * statement.cs (Foreach.Resolve): Indexers are just like variables
17318         or PropertyAccesses.
17319
17320         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17321         inside quoted strings, we were not doing this before.
17322
17323 2002-09-16  Martin Baulig  <martin@gnome.org>
17324
17325         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17326         resolve it.  This is needed for the definite assignment check of the
17327         instance expression, fixes bug #29846.
17328         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17329
17330 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17331
17332         * parameter.cs: Fix compile error.  Cannot reference static member
17333         from an instance object.  Is this an mcs bug?
17334
17335 2002-09-14  Martin Baulig  <martin@gnome.org>
17336
17337         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17338         multiple times.  Fixes bug #30295, added test-166.cs.
17339
17340 2002-09-14  Martin Baulig  <martin@gnome.org>
17341
17342         * statement.cs (Block.Emit): Don't emit unreachable code.
17343         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17344         `break' statements.
17345         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17346
17347 2002-09-14  Martin Baulig  <martin@gnome.org>
17348
17349         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17350         is set.
17351
17352 2002-09-14  Martin Baulig  <martin@gnome.org>
17353
17354         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17355         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17356         be false on the ms runtime.
17357
17358 2002-09-13  Martin Baulig  <martin@gnome.org>
17359
17360         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17361         the CS0038 error message.
17362
17363 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17364
17365         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17366         constant inside, return it.
17367
17368 2002-09-12  Martin Baulig  <martin@gnome.org>
17369
17370         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17371         implicit conversion can be done between enum types.
17372
17373         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17374         check whether an implicit conversion to the current enum's UnderlyingType
17375         exists and report an error if not.
17376
17377         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17378         without debugging support.
17379
17380         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17381         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17382
17383 2002-09-12  Martin Baulig  <martin@gnome.org>
17384
17385         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17386
17387         * ecore.cs (IMemberExpr.DeclaringType): New property.
17388         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17389         nonstatic member of an outer type (CS0038).
17390
17391 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17392
17393         * driver.cs: Activate the using-error detector at warning level
17394         4 (at least for MS-compatible APIs).
17395
17396         * namespace.cs (VerifyUsing): Small buglett fix.
17397
17398         * pending.cs (PendingImplementation): pass the container pointer. 
17399
17400         * interface.cs (GetMethods): Allow for recursive definition.  Long
17401         term, I would like to move every type to support recursive
17402         definitions, not the current ordering mechanism that we have right
17403         now.
17404
17405         The situation is this: Attributes are handled before interfaces,
17406         so we can apply attributes to interfaces.  But some attributes
17407         implement interfaces, we will now handle the simple cases
17408         (recursive definitions will just get an error).  
17409
17410         * parameter.cs: Only invalidate types at the end if we fail to
17411         lookup all types.  
17412
17413 2002-09-09  Martin Baulig  <martin@gnome.org>
17414
17415         * ecore.cs (PropertyExpr.Emit): Also check for
17416         TypeManager.system_int_array_get_length so this'll also work when
17417         compiling corlib.  Fixes #30003.
17418
17419 2002-09-09  Martin Baulig  <martin@gnome.org>
17420
17421         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17422         and throw an exception if we can't get the type's size.  Fixed #30040,
17423         added test-165.cs.
17424
17425 2002-09-09  Martin Baulig  <martin@gnome.org>
17426
17427         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17428
17429         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17430         context.  Fixes bug #30027.
17431
17432         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17433         virtual functions.  Fixes bug #30043, added test-164.cs.
17434
17435 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17436
17437         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17438
17439 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17440
17441         * driver.cs: Use an object to get the windows codepage since it's not a
17442         static property.
17443
17444 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * statement.cs (For.Emit): for infinite loops (test == null)
17447         return whether there is a break inside, not always "true".
17448
17449         * namespace.cs (UsingEntry): New struct to hold the name of the
17450         using definition, the location where it is defined, and whether it
17451         has been used in a successful type lookup.
17452
17453         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17454         strings.
17455
17456         * decl.cs: ditto.
17457
17458 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17459
17460         * attribute.cs : Fix incorrect code which relied on catching
17461         a NullReferenceException to detect a null being passed in
17462         where an object was expected.
17463
17464 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * statement.cs (Try): flag the catch variable as assigned
17467
17468         * expression.cs (Cast): Simplified by using ResolveType instead of
17469         manually resolving.
17470
17471         * statement.cs (Catch): Fix bug by using ResolveType.
17472
17473 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17474
17475         * expression.cs (BetterConversion): Special case for when we have
17476         a NullLiteral as the argument and we have to choose between string
17477         and object types - we choose string the way csc does.
17478
17479         * attribute.cs (Attribute.Resolve): Catch the
17480         NullReferenceException and report error #182 since the Mono
17481         runtime no more has the bug and having this exception raised means
17482         we tried to select a constructor which takes an object and is
17483         passed a null.
17484
17485 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17486
17487         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17488         message (1502, 1503) when we can't locate a method after overload
17489         resolution. This is much more informative and closes the bug
17490         Miguel reported.
17491
17492         * interface.cs (PopulateMethod): Return if there are no argument
17493         types. Fixes a NullReferenceException bug.
17494
17495         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17496         expressions too. Previously we were checking only in one place for
17497         positional arguments leaving out named arguments.
17498
17499         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17500         type to the enum type is not allowed. Remove code corresponding to
17501         that.
17502
17503         (ConvertNumericExplicit): Allow explicit conversions from
17504         the underlying type to enum type. This precisely follows the spec
17505         and closes a bug filed by Gonzalo.
17506
17507 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17508
17509         * compiler.csproj:
17510         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17511
17512 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17513
17514         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17515         it was important that we stored the right value after the
17516         reduction in `converted'.
17517
17518 2002-09-04  Martin Baulig  <martin@gnome.org>
17519
17520         * location.cs (Location.SymbolDocument): Use full pathnames for the
17521         source files.
17522
17523 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17524
17525         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17526         of the expression resolve mechanism, because that will catch the
17527         SimpleName error failures.
17528
17529         (Conditional): If we can not resolve the
17530         expression, return, do not crash.
17531
17532 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17533
17534         * cs-tokenizer.cs:
17535         (location): display token name instead of its number.
17536
17537 2002-08-28  Martin Baulig  <martin@gnome.org>
17538
17539         * expression.cs (Binary.ResolveOperator): Don't silently return
17540         but return an error if an operator cannot be applied between two
17541         enum types.
17542
17543 2002-08-28  Martin Baulig  <martin@gnome.org>
17544
17545         * class.cs (Constructor.Define): Set the permission attributes
17546         correctly instead of making all constructors public.
17547
17548 2002-08-28  Martin Baulig  <martin@gnome.org>
17549
17550         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17551         for private members before reporting a CS0103; if we find anything,
17552         it's a CS0122.
17553
17554 2002-08-28  Martin Baulig  <martin@gnome.org>
17555
17556         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17557         to check whether `closure_start_type == closure_invocation_type',
17558         we also need to check whether `m.DeclaringType == closure_invocation_type'
17559         before bypassing the permission checks.  We might be accessing
17560         protected/private members from the base class.
17561         (TypeManager.RealMemberLookup): Only set private_ok if private
17562         members were requested via BindingFlags.NonPublic.
17563
17564         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17565
17566         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17567         MethodGroupExpr.IsExplicitImpl if appropriate.
17568         (Invocation.DoResolve): Don't report the CS0120 for explicit
17569         interface implementations.
17570
17571 2002-08-27  Martin Baulig  <martin@gnome.org>
17572
17573         * expression.cs (Invocation.DoResolve): If this is a static
17574         method and we don't have an InstanceExpression, we must report
17575         a CS0120.
17576
17577 2002-08-25  Martin Baulig  <martin@gnome.org>
17578
17579         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17580         `==' between a valuetype and an object.
17581
17582 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17583
17584         * ecore.cs (TypeExpr): Provide a ToString method.
17585
17586 2002-08-24  Martin Baulig  <martin@gnome.org>
17587
17588         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17589         now called proggie.dbg and it's a binary file.
17590
17591 2002-08-23  Martin Baulig  <martin@gnome.org>
17592
17593         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17594
17595 2002-08-23  Martin Baulig  <martin@gnome.org>
17596
17597         * struct.cs (MyStructInfo.ctor): Make this work with empty
17598         structs; it's not allowed to use foreach() on null.
17599
17600 2002-08-23  Martin Baulig  <martin@gnome.org>
17601
17602         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17603         writer the full pathname of the generated assembly.
17604
17605 2002-08-23  Martin Baulig  <martin@gnome.org>
17606
17607         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17608         A `finally' block never returns or breaks; improved handling of
17609         unreachable code.
17610
17611 2002-08-23  Martin Baulig  <martin@gnome.org>
17612
17613         * statement.cs (Throw.Resolve): Allow `throw null'.
17614
17615 2002-08-23  Martin Baulig  <martin@gnome.org>
17616
17617         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17618         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17619         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17620         MemberLookup would return a wrong event if this is an explicit
17621         interface implementation and the class has an event with the same
17622         name.
17623
17624 2002-08-23  Martin Baulig  <martin@gnome.org>
17625
17626         * statement.cs (Block.AddChildVariableNames): New public method.
17627         (Block.AddChildVariableName): Likewise.
17628         (Block.IsVariableNameUsedInChildBlock): Likewise.
17629         (Block.AddVariable): Check whether a variable name has already
17630         been used in a child block.
17631
17632         * cs-parser.jay (declare_local_variables): Mark all variable names
17633         from the current block as being used in a child block in the
17634         implicit block.
17635
17636 2002-08-23  Martin Baulig  <martin@gnome.org>
17637
17638         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17639         find the symbol writer.
17640
17641         * driver.cs: csc also allows the arguments to /define being
17642         separated by commas, not only by semicolons.
17643
17644 2002-08-23  Martin Baulig  <martin@gnome.org>
17645
17646         * interface.cs (Interface.GetMembers): Added static check for events.
17647
17648 2002-08-15  Martin Baulig  <martin@gnome.org>
17649
17650         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17651         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17652
17653         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17654         why the MethodData.EmitDestructor() change was necessary.
17655
17656 2002-08-20  Martin Baulig  <martin@gnome.org>
17657
17658         * class.cs (TypeContainer.FindMembers): Added static check for events.
17659
17660         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17661
17662         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17663         use Type.GetEvents(), not Type.FindMembers().
17664
17665 2002-08-20  Martin Baulig  <martin@gnome.org>
17666
17667         * decl.cs (MemberCache): Added a special method cache which will
17668         be used for method-only searched.  This ensures that a method
17669         search will return a MethodInfo with the correct ReflectedType for
17670         inherited methods.      
17671
17672 2002-08-20  Martin Baulig  <martin@gnome.org>
17673
17674         * decl.cs (DeclSpace.FindMembers): Made this public.
17675
17676 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17677
17678         * delegate.cs: fixed build on windows.
17679         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17680
17681 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17682
17683         * ecore.cs (StandardConversionExists): Return a false
17684         if we are trying to convert the void type to anything else
17685         since that is not allowed.
17686
17687         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17688         we flag error 70 in the event an event is trying to be accessed
17689         directly from outside the declaring type.
17690
17691 2002-08-20  Martin Baulig  <martin@gnome.org>
17692
17693         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17694         MemberCache from typemanager.cs to decl.cs.
17695
17696 2002-08-19  Martin Baulig  <martin@gnome.org>
17697
17698         * class.cs (TypeContainer): Implement IMemberContainer.
17699         (TypeContainer.DefineMembers): Create the MemberCache.
17700         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17701         return public members if BindingFlags.Public was given, check
17702         whether members are static.
17703
17704 2002-08-16  Martin Baulig  <martin@gnome.org>
17705
17706         * decl.cs (DeclSpace.Define): Splitted this in Define and
17707         DefineMembers.  DefineMembers is called first and initializes the
17708         MemberCache.
17709
17710         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17711         DefineMembers() on all our DeclSpaces.
17712
17713         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17714         but call DefineMembers() on all nested interfaces.  We call their
17715         Define() in our new Define() function.
17716
17717         * interface.cs (Interface): Implement IMemberContainer.
17718         (Interface.Define): Moved all code except the attribute stuf to
17719         DefineMembers().
17720         (Interface.DefineMembers): Initialize the member cache.
17721
17722         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17723         need this anymore since we can use MemberCache.FindMembers directly.
17724
17725 2002-08-19  Martin Baulig  <martin@gnome.org>
17726
17727         * typemanager.cs (MemberCache): When creating the cache for an
17728         interface type, add all inherited members.
17729         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17730         to `out bool used_cache' and documented it.
17731         (TypeManager.MemberLookup): If we already used the cache in the first
17732         iteration, we don't need to do the interfaces check.
17733
17734 2002-08-19  Martin Baulig  <martin@gnome.org>
17735
17736         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17737         here from IMemberFinder and don't implement this interface anymore.
17738         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17739
17740         * typemanager.cs (IMemberFinder): This interface is now only used by
17741         classes which actually support the member cache.
17742         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17743         since we only put DeclSpaces into this Hashtable.
17744         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17745         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17746
17747 2002-08-16  Martin Baulig  <martin@gnome.org>
17748
17749         * typemanager.cs (ICachingMemberFinder): Removed.
17750         (IMemberFinder.MemberCache): New property.
17751         (TypeManager.FindMembers): Merged this with RealFindMembers().
17752         This function will never be called from TypeManager.MemberLookup()
17753         so we can't use the cache here, just the IMemberFinder.
17754         (TypeManager.MemberLookup_FindMembers): Check whether the
17755         IMemberFinder has a MemberCache and call the cache's FindMembers
17756         function.
17757         (MemberCache): Rewrote larger parts of this yet another time and
17758         cleaned it up a bit.
17759
17760 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17761
17762         * driver.cs (LoadArgs): Support quoting.
17763
17764         (Usage): Show the CSC-like command line arguments.
17765
17766         Improved a few error messages.
17767
17768 2002-08-15  Martin Baulig  <martin@gnome.org>
17769
17770         * typemanager.cs (IMemberContainer.Type): New property.
17771         (IMemberContainer.IsInterface): New property.
17772
17773         The following changes are conditional to BROKEN_RUNTIME, which is
17774         defined at the top of the file.
17775
17776         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17777         class'es members, but add all members from TypeHandle.ObjectType
17778         if we're an interface.
17779         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17780         is the current type.
17781         (MemberCache.CacheEntry.Container): Removed this field.
17782         (TypeHandle.GetMembers): Include inherited members.
17783
17784 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17785
17786         * typemanager.cs: fixed compilation and added a comment on a field that
17787         is never used.
17788
17789 2002-08-15  Martin Baulig  <martin@gnome.org>
17790
17791         * class.cs (ConstructorInitializer.Resolve): In the
17792         Expression.MemberLookup call, use the queried_type as
17793         invocation_type.
17794
17795         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17796         declared' attribute, it's always true.
17797         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17798         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17799         temporary wrapper for FindMembers which tells MemberLookup whether
17800         members from the base classes are included in the return value.
17801         This will go away soon.
17802         (TypeManager.MemberLookup): Use this temporary hack here; once the
17803         new MemberCache is completed, we don't need to do the DeclaredOnly
17804         looping here anymore since the MemberCache will take care of this.
17805         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17806         (MemberCache): When creating the MemberCache for a class, get
17807         members from the current class and all its base classes.
17808         (MemberCache.CacheEntry.Container): New field.  This is a
17809         temporary hack until the Mono runtime is fixed to distinguish
17810         between ReflectedType and DeclaringType.  It allows us to use MCS
17811         with both the MS runtime and the unfixed Mono runtime without
17812         problems and without accecting performance.
17813         (MemberCache.SearchMembers): The DeclaredOnly looping from
17814         TypeManager.MemberLookup is now done here.      
17815
17816 2002-08-14  Martin Baulig  <martin@gnome.org>
17817
17818         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17819         Type.GetFields on dynamic types but get the fields from the
17820         corresponding TypeContainer.
17821         (MyStructInfo.GetStructInfo): Added check for enum types.
17822
17823         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17824         (MemberList.SyncRoot): Implemented.
17825         (TypeManager.FilterWithClosure): No need to check permissions if
17826         closure_start_type == closure_invocation_type, don't crash if
17827         closure_invocation_type is null.
17828
17829 2002-08-13  Martin Baulig  <martin@gnome.org>
17830
17831         Rewrote TypeContainer.FindMembers to use a member cache.  This
17832         gives us a speed increase of about 35% for the self-hosting MCS
17833         build and of about 15-20% for the class libs (both on GNU/Linux).
17834
17835         * report.cs (Timer): New class to get enhanced profiling.  This
17836         whole class is "TIMER" conditional since it remarkably slows down
17837         compilation speed.
17838
17839         * class.cs (MemberList): New class.  This is an IList wrapper
17840         which we're now using instead of passing MemberInfo[]'s around to
17841         avoid copying this array unnecessarily.
17842         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17843         (ICachingMemberFinder, IMemberContainer): New interface.
17844         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17845         has already been checked, otherwise use it for the name comparision.
17846         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17847         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17848         if possible.  Returns a MemberList, not a MemberInfo [].
17849         (TypeHandle): New class, implements IMemberContainer.  We create
17850         one instance of this class per type, it contains a MemberCache
17851         which is used to do the member lookups.
17852         (MemberCache): New class.  Each instance of this class contains
17853         all members of a type and a name-based hash table.
17854         (MemberCache.FindMembers): This is our new member lookup
17855         function.  First, it looks up all members of the requested name in
17856         the hash table.  Then, it walks this list and sorts out all
17857         applicable members and returns them.
17858
17859 2002-08-13  Martin Baulig  <martin@gnome.org>
17860
17861         In addition to a nice code cleanup, this gives us a performance
17862         increase of about 1.4% on GNU/Linux - not much, but it's already
17863         half a second for the self-hosting MCS compilation.
17864
17865         * typemanager.cs (IMemberFinder): New interface.  It is used by
17866         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17867         Enum, Delegate or Interface.
17868         (TypeManager.finder_to_member_finder): New PtrHashtable.
17869         (TypeManager.finder_to_container): Removed.
17870         (TypeManager.finder_to_delegate): Removed.
17871         (TypeManager.finder_to_interface): Removed.
17872         (TypeManager.finder_to_enum): Removed.
17873
17874         * interface.cs (Interface): Implement IMemberFinder.
17875
17876         * delegate.cs (Delegate): Implement IMemberFinder.
17877
17878         * enum.cs (Enum): Implement IMemberFinder.
17879
17880         * class.cs (TypeContainer): Implement IMemberFinder.
17881
17882 2002-08-12  Martin Baulig  <martin@gnome.org>
17883
17884         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17885
17886 2002-08-12  Martin Baulig  <martin@gnome.org>
17887
17888         * ecore.cs (ITypeExpression): New interface for expressions which
17889         resolve to a type.
17890         (TypeExpression): Renamed to TypeLookupExpression.
17891         (Expression.DoResolve): If we're doing a types-only lookup, the
17892         expression must implement the ITypeExpression interface and we
17893         call DoResolveType() on it.
17894         (SimpleName): Implement the new ITypeExpression interface.
17895         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17896         hack, the situation that we're only looking up types can't happen
17897         anymore when this method is called.  Moved the type lookup code to
17898         DoResolveType() and call it.
17899         (SimpleName.DoResolveType): This ITypeExpression interface method
17900         is now doing the types-only lookup.
17901         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17902         (ResolveFlags): Added MaskExprClass.
17903
17904         * expression.cs (MemberAccess): Implement the ITypeExpression
17905         interface.
17906         (MemberAccess.DoResolve): Added support for a types-only lookup
17907         when we're called via ITypeExpression.DoResolveType().
17908         (ComposedCast): Implement the ITypeExpression interface.
17909
17910         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17911         Expression.Resolve() with ResolveFlags.Type instead.
17912
17913 2002-08-12  Martin Baulig  <martin@gnome.org>
17914
17915         * interface.cs (Interface.Define): Apply attributes.
17916
17917         * attribute.cs (Attribute.ApplyAttributes): Added support for
17918         interface attributes.
17919
17920 2002-08-11  Martin Baulig  <martin@gnome.org>
17921
17922         * statement.cs (Block.Emit): Only check the "this" variable if we
17923         do not always throw an exception.
17924
17925         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17926         whether the property has a set accessor.
17927
17928 2002-08-11  Martin Baulig  <martin@gnome.org>
17929
17930         Added control flow analysis support for structs.
17931
17932         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17933         with control flow analysis turned off.
17934         (IVariable): New interface.
17935         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17936         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17937         (FieldExpr.DoResolve): Resolve the instance expression with flow
17938         analysis turned off and do the definite assignment check after the
17939         resolving when we know what the expression will resolve to.
17940
17941         * expression.cs (LocalVariableReference, ParameterReference):
17942         Implement the new IVariable interface, only call the flow analysis
17943         code if ec.DoFlowAnalysis is true.
17944         (This): Added constructor which takes a Block argument.  Implement
17945         the new IVariable interface.
17946         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17947         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17948         This does the definite assignment checks for struct members.
17949
17950         * class.cs (Constructor.Emit): If this is a non-static `struct'
17951         constructor which doesn't have any initializer, call
17952         Block.AddThisVariable() to tell the flow analysis code that all
17953         struct elements must be initialized before control returns from
17954         the constructor.
17955
17956         * statement.cs (MyStructInfo): New public class.
17957         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17958         argument to this indexer.  If non-zero, check an individual struct
17959         member, not the whole struct.
17960         (FlowBranching.CheckOutParameters): Check struct members.
17961         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17962         overloaded versions of these methods which take an additional
17963         `int field_idx' argument to check struct members.
17964         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17965         overloaded versions of these methods which take an additional
17966         `string field_name' argument to check struct member.s
17967         (VariableInfo): Implement the IVariable interface.
17968         (VariableInfo.StructInfo): New public property.  Returns the
17969         MyStructInfo instance of the variable if it's a struct or null.
17970         (Block.AddThisVariable): New public method.  This is called from
17971         Constructor.Emit() for non-static `struct' constructor which do
17972         not have any initializer.  It creates a special variable for the
17973         "this" instance variable which will be checked by the flow
17974         analysis code to ensure that all of the struct's fields are
17975         initialized before control returns from the constructor.
17976         (UsageVector): Added support for struct members.  If a
17977         variable/parameter is a struct with N members, we reserve a slot
17978         in the usage vector for each member.  A struct is considered fully
17979         initialized if either the struct itself (slot 0) or all its
17980         members are initialized.
17981
17982 2002-08-08  Martin Baulig  <martin@gnome.org>
17983
17984         * driver.cs (Driver.MainDriver): Only report an error CS5001
17985         if there were no compilation errors.
17986
17987         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17988         `UnsafeContext' property to determine whether the parent is in
17989         unsafe context rather than checking the parent's ModFlags:
17990         classes nested in an unsafe class are unsafe as well.
17991
17992 2002-08-08  Martin Baulig  <martin@gnome.org>
17993
17994         * statement.cs (UsageVector.MergeChildren): Distinguish between
17995         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17996         we return.  Added test17() and test18() to test-154.cs.
17997
17998 2002-08-08  Martin Baulig  <martin@gnome.org>
17999
18000         * typemanager.cs (TypeManager.FilterWithClosure): If we have
18001         Family access, make sure the invoking type isn't a subclass of the
18002         queried type (that'd be a CS1540).
18003
18004         * ecore.cs (Expression.MemberLookup): Added overloaded version of
18005         this method which takes an additional `Type invocation_type'.
18006
18007         * expression.cs (BaseAccess.DoResolve): Use the base type as
18008         invocation and query type.
18009         (MemberAccess.DoResolve): If the lookup failed and we're about to
18010         report a CS0122, try a lookup with the ec.ContainerType - if this
18011         succeeds, we must report a CS1540.
18012
18013 2002-08-08  Martin Baulig  <martin@gnome.org>
18014
18015         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
18016         (MethodGroupExpr): Implement the IMemberExpr interface.
18017
18018         * expression (MemberAccess.ResolveMemberAccess): No need to have
18019         any special code for MethodGroupExprs anymore, they're now
18020         IMemberExprs.   
18021
18022 2002-08-08  Martin Baulig  <martin@gnome.org>
18023
18024         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
18025         Family, FamANDAssem and FamORAssem permissions.
18026         (TypeManager.IsSubclassOrNestedChildOf): New public method.
18027
18028 2002-08-08  Martin Baulig  <martin@gnome.org>
18029
18030         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
18031         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
18032         or loop block.
18033
18034 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
18035
18036         * driver.cs: implemented /resource option to embed managed resources.
18037
18038 2002-08-07  Martin Baulig  <martin@gnome.org>
18039
18040         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
18041         (FieldBase.HasFieldInitializer): New public property.
18042         (FieldBase.GetInitializerExpression): New public method.  Resolves and
18043         returns the field initializer and makes sure it is only resolved once.
18044         (TypeContainer.EmitFieldInitializers): Call
18045         FieldBase.GetInitializerExpression to get the initializer, this ensures
18046         that it isn't resolved multiple times.
18047
18048         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
18049         the resolving process (SimpleName/MemberLookup) that we're currently
18050         emitting a field initializer (which must not access any instance members,
18051         this is an error CS0236).
18052
18053         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
18054         argument, if the `IsFieldInitializer' flag is set, we must report and
18055         error CS0236 and not an error CS0120.   
18056
18057 2002-08-07  Martin Baulig  <martin@gnome.org>
18058
18059         * ecore.cs (IMemberExpr): New public interface.
18060         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
18061         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
18062         if the expression is an IMemberExpr.
18063
18064         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
18065         to be null, implicitly default to `this' if we're non-static in
18066         this case.  Simplified the code a lot by using the new IMemberExpr
18067         interface.  Also fixed bug #28176 here.
18068
18069 2002-08-06  Martin Baulig  <martin@gnome.org>
18070
18071         * cs-parser.jay (SimpleLookup): Removed.  We need to create
18072         ParameterReferences during semantic analysis so that we can do a
18073         type-only search when resolving Cast, TypeOf and SizeOf.
18074         (block): Pass the `current_local_parameters' to the Block's
18075         constructor.
18076
18077         * class.cs (ConstructorInitializer): Added `Parameters parameters'
18078         argument to the constructor.
18079         (ConstructorInitializer.Resolve): Create a temporary implicit
18080         block with the parameters.
18081
18082         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
18083         references here if we aren't doing a type-only search.
18084
18085         * statement.cs (Block): Added constructor which takes a
18086         `Parameters parameters' argument.
18087         (Block.Parameters): New public property.
18088
18089         * support.cs (InternalParameters.Parameters): Renamed `parameters'
18090         to `Parameters' and made it public readonly.
18091
18092 2002-08-06  Martin Baulig  <martin@gnome.org>
18093
18094         * ecore.cs (Expression.Warning): Made this public as well.
18095
18096         * report.cs (Report.Debug): Print the contents of collections.
18097
18098 2002-08-06  Martin Baulig  <martin@gnome.org>
18099
18100         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18101         used to tell Resolve() which kinds of expressions it may return.
18102         (Expression.Resolve): Added overloaded version of this method which
18103         takes a `ResolveFlags flags' argument.  This can be used to tell
18104         Resolve() which kinds of expressions it may return.  Reports a
18105         CS0118 on error.
18106         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18107         ResolveFlags.SimpleName.
18108         (Expression.Error118): Added overloaded version of this method which
18109         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18110         which kinds of expressions are allowed.
18111
18112         * expression.cs (Argument.ResolveMethodGroup): New public method.
18113         Resolves an argument, but allows a MethodGroup to be returned.
18114         This is used when invoking a delegate.
18115
18116         * TODO: Updated a bit.
18117
18118 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18119
18120         Fixed compilation with csc.
18121
18122         * ecore.cs: Expression.Error made public. Is this correct? Should
18123         Warning be made public too?
18124
18125         * expression.cs: use ea.Location instead of ea.loc.
18126         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18127
18128 2002-08-06  Martin Baulig  <martin@gnome.org>
18129
18130         * ecore.cs (Expression.loc): Moved the location here instead of
18131         duplicating it in all derived classes.
18132         (Expression.Location): New public property.
18133         (Expression.Error, Expression.Warning): Made them non-static and
18134         removed the location argument.
18135         (Expression.Warning): Added overloaded version which takes an
18136         `int level' argument.
18137         (Expression.Error118): Make this non-static and removed the
18138         expression and location arguments.
18139         (TypeExpr): Added location argument to the constructor.
18140
18141         * expression.cs (StaticCallExpr): Added location argument to
18142         the constructor.
18143         (Indirection, PointerArithmetic): Likewise.
18144         (CheckedExpr, UnCheckedExpr): Likewise.
18145         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18146         (StringPtr): Likewise.
18147
18148
18149 2002-08-05  Martin Baulig  <martin@gnome.org>
18150
18151         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18152
18153         * assign.cs (Assign.DoResolve): Check whether the source
18154         expression is a value or variable.
18155
18156         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18157         while resolving the corresponding blocks.
18158
18159         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18160         an error, don't silently return null.
18161
18162         * statement.cs (Block.AddVariable): Do the error reporting here
18163         and distinguish between CS0128 and CS0136.
18164         (Block.DoResolve): Report all unused labels (warning CS0164).
18165         (LabeledStatement): Pass the location to the constructor.
18166         (LabeledStatement.HasBeenReferenced): New property.
18167         (LabeledStatement.Resolve): Set it to true here.
18168
18169         * statement.cs (Return.Emit): Return success even after reporting
18170         a type mismatch error (CS0126 or CS0127), this is what csc does and
18171         it avoids confusing the users with any consecutive errors.
18172
18173 2002-08-05  Martin Baulig  <martin@gnome.org>
18174
18175         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18176
18177         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18178
18179         * expression.cs (MemberAccess.DoResolve): Silently return if an
18180         error has already been reported.
18181
18182         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18183         error has already been reported.
18184
18185 2002-08-05  Martin Baulig  <martin@gnome.org>
18186
18187         * statement.cs (UsageVector): Only initialize the `parameters'
18188         vector if we actually have any "out" parameters.
18189
18190 2002-08-05  Martin Baulig  <martin@gnome.org>
18191
18192         * expression.cs (Binary.ResolveOperator): When combining delegates,
18193         they must have the same type.
18194
18195 2002-08-05  Martin Baulig  <martin@gnome.org>
18196
18197         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18198         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18199         work with the ms runtime and we also don't need it: if we're a
18200         PropertyBuilder and not in the `indexer_arguments' hash, then we
18201         are a property and not an indexer.
18202
18203         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18204         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18205         since the latter one doesn't work with the ms runtime.
18206
18207 2002-08-03  Martin Baulig  <martin@gnome.org>
18208
18209         Fixed bugs #27998 and #22735.
18210
18211         * class.cs (Method.IsOperator): New public field.
18212         (Method.CheckBase): Report CS0111 if there's already a method
18213         with the same parameters in the current class.  Report CS0508 when
18214         attempting to change the return type of an inherited method.
18215         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18216         and it's not marked abstract or extern.
18217         (PropertyBase): New abstract base class for Property and Indexer.
18218         (PropertyBase.CheckBase): Moved here from Property and made it work
18219         for indexers.
18220         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18221         the same so we can reuse it there.
18222         (Property, Indexer): Derive from PropertyBase.
18223         (MethodSignature.inheritable_property_signature_filter): New delegate
18224         to find properties and indexers.
18225
18226         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18227         argument and improved error reporting.
18228
18229         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18230         EmptyReadOnlyParameters and made it a property.
18231
18232         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18233         version of this method which takes a `PropertyInfo indexer'.
18234         (TypeManager.RegisterIndexer): New method.
18235
18236         * class.cs: Added myself as author of this file :-)
18237
18238 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18239
18240         * class.cs: fixed compilation on windoze.
18241
18242 2002-08-03  Martin Baulig  <martin@gnome.org>
18243
18244         * interface.cs (Interface.GetInterfaceBases): Check whether all
18245         base interfaces are at least as accessible than the current one.
18246
18247         * class.cs (TypeContainer.GetClassBases): Check whether base types
18248         are at least as accessible than the current type.
18249         (TypeContainer.AsAccessible): Implemented and made non-static.
18250         (MemberBase.CheckParameters): Report errors if the accessibility
18251         checks fail.
18252
18253         * delegate.cs (Delegate.Delegate): The default visibility is
18254         internal for top-level types and private for nested types.
18255         (Delegate.Define): Report errors if the accessibility checks fail.
18256
18257         * enum.cs (Enum.Enum): The default visibility is internal for
18258         top-level types and private for nested types.
18259         (Enum.DefineType): Compute the correct visibility.
18260
18261         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18262         function which takes a `bool is_toplevel' instead of a TypeContainer.
18263
18264         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18265         builtin type.
18266
18267 2002-08-02  Martin Baulig  <martin@gnome.org>
18268
18269         * expression.cs (LocalVariableReferenc): Added constructor which
18270         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18271         (LocalVariableReference.IsReadOnly): New property.
18272         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18273         variable is readonly, use our own readonly flag to do this; you can
18274         use the new constructor to get a writable reference to a read-only
18275         variable.
18276
18277         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18278         reference to the local variable.
18279
18280 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18281
18282         * rootcontext.cs (ResolveCore): Also include System.Exception
18283
18284         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18285         we reach an EmptyStatement.
18286
18287         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18288         is also fine.
18289
18290         * expression.cs (Binary.ResolveOperator): Check error result in
18291         two places.
18292
18293         use brtrue/brfalse directly and avoid compares to null.
18294
18295 2002-08-02  Martin Baulig  <martin@gnome.org>
18296
18297         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18298         Fixes bug #28407, added test-155.cs.
18299
18300 2002-08-01  Martin Baulig  <martin@gnome.org>
18301
18302         * class.cs (Event.EmitDefaultMethod): Make this work with static
18303         events.  Fixes #28311, added verify-3.cs.
18304
18305 2002-08-01  Martin Baulig  <martin@gnome.org>
18306
18307         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18308         `is_disposable' fields.
18309         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18310         `hm.is_disposable' if we're using the collection pattern.
18311         (Foreach.EmitCollectionForeach): Use the correct type for the
18312         enumerator's local variable, only emit the try/finally block if
18313         necessary (fixes #27713).
18314
18315 2002-08-01  Martin Baulig  <martin@gnome.org>
18316
18317         * ecore.cs (Expression.report118): Renamed to Error118 and made
18318         it public static.
18319
18320         * statement.cs (Throw.Resolve): Check whether the expression is of
18321         the correct type (CS0118) and whether the type derives from
18322         System.Exception (CS0155).
18323         (Catch.Resolve): New method.  Do the type lookup here and check
18324         whether it derives from System.Exception (CS0155).
18325         (Catch.CatchType, Catch.IsGeneral): New public properties.
18326
18327         * typemanager.cs (TypeManager.exception_type): Added.
18328
18329 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18330
18331         * driver.cs: Updated About function.
18332
18333 2002-07-31  Martin Baulig  <martin@gnome.org>
18334
18335         Implemented Control Flow Analysis.
18336
18337         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18338         (EmitContext.CurrentBranching): Added.
18339         (EmitContext.StartFlowBranching): Added.
18340         (EmitContext.EndFlowBranching): Added.
18341         (EmitContext.KillFlowBranching): Added.
18342         (EmitContext.IsVariableAssigned): Added.
18343         (EmitContext.SetVariableAssigned): Added.
18344         (EmitContext.IsParameterAssigned): Added.
18345         (EmitContext.SetParameterAssigned): Added.
18346         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18347         Added control flow analysis stuff here.
18348
18349         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18350         resolve the expression as lvalue.
18351         (LocalVariableReference.DoResolve): Check whether the variable has
18352         already been assigned.
18353         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18354         the parameter as assigned here.
18355         (ParameterReference.DoResolve): Check whether the parameter has already
18356         been assigned.
18357         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18358         expression as lvalue.
18359
18360         * statement.cs (FlowBranching): New class for the flow analysis code.
18361         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18362         (LabeledStatement.IsDefined): New public property.
18363         (LabeledStatement.AddUsageVector): New public method to tell flow
18364         analyis that the label may be reached via a forward jump.
18365         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18366         flow analysis.
18367         (VariableInfo.Number): New public field.  This is used by flow analysis
18368         to number all locals of a block.
18369         (Block.CountVariables): New public property.  This is the number of
18370         local variables in this block (including the locals from all parent
18371         blocks).
18372         (Block.EmitMeta): Number all the variables.
18373
18374         * statement.cs: Added flow analysis support to all classes.
18375
18376 2002-07-31  Martin Baulig  <martin@gnome.org>
18377
18378         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18379         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18380         then use this argument.
18381
18382         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18383
18384         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18385         use this to specify /define options.
18386
18387 2002-07-29  Martin Baulig  <martin@gnome.org>
18388
18389         * statement.cs (Fixed): Moved all code that does variable lookups
18390         and resolvings from Emit to Resolve.
18391
18392         * statement.cs (For): Moved all code that does variable lookups
18393         and resolvings from Emit to Resolve.
18394
18395         * statement.cs (Using): Moved all code that does variable lookups
18396         and resolvings from Emit to Resolve.
18397
18398 2002-07-29  Martin Baulig  <martin@gnome.org>
18399
18400         * attribute.cs (Attribute.Resolve): Explicitly catch a
18401         System.NullReferenceException when creating the
18402         CustromAttributeBuilder and report a different warning message.
18403
18404 2002-07-29  Martin Baulig  <martin@gnome.org>
18405
18406         * support.cs (ParameterData.ParameterName): Added method to
18407         get the name of a parameter.
18408
18409         * typemanager.cs (TypeManager.IsValueType): New public method.
18410
18411 2002-07-29  Martin Baulig  <martin@gnome.org>
18412
18413         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18414         is a flag which specifies that it's either ref or out.
18415         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18416         the out parameter to `out Parameter.Modifier mod', also set the
18417         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18418
18419         * support.cs (InternalParameters.ParameterModifier): Distinguish
18420         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18421         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18422
18423         * expression.cs (Argument.GetParameterModifier): Distinguish
18424         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18425         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18426
18427 2002-07-29  Martin Baulig  <martin@gnome.org>
18428
18429         * expression.cs (ParameterReference.ParameterReference): Added
18430         `Location loc' argument to the constructor.
18431
18432         * cs-parser.jay: Pass location to ParameterReference.
18433
18434 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * statement.cs (Try): Initialize the location.
18437
18438         * cs-parser.jay: pass location to Try.
18439
18440         * expression.cs (Unary.Reduce): Change the prototype to return
18441         whether a constant fold could be performed or not.  The result is
18442         returned in an out parameters.  In the case of Indirection and
18443         AddressOf, we want to perform the full tests.
18444
18445 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18446
18447         * statement.cs (Statement.Emit): Flag dead code.
18448
18449 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18450
18451         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18452
18453 2002-07-27  Martin Baulig  <martin@gnome.org>
18454
18455         * class.cs (MethodData.Define): Put back call to
18456         TypeManager.AddMethod(), accidentally commented this out.
18457
18458         * report.cs (Debug): New public method to print debugging information,
18459         this is `[Conditional ("DEBUG")]'.
18460
18461 2002-07-26  Martin Baulig  <martin@gnome.org>
18462
18463         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18464         (switch_statement): Push the current_block to the switch_stack and
18465         pop it again when we're done with the switch.
18466         (switch_section): The new block is a child of the current_block.
18467         Fixes bug #24007, added test-152.cs.
18468
18469 2002-07-27  Martin Baulig  <martin@gnome.org>
18470
18471         * expression.cs (Invocation.EmitArguments): When calling a varargs
18472         function with only its fixed arguments, we need to pass an empty
18473         array.
18474
18475 2002-07-27  Martin Baulig  <martin@gnome.org>
18476
18477         Mono 0.13 has been released.
18478
18479 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18480
18481         * driver.cs: Rename --resource to --linkres, because that is what
18482         we do currently, we dont support --resource yet.
18483
18484         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18485
18486 2002-07-25  Martin Baulig  <martin@gnome.org>
18487
18488         * class.cs (MethodData): New public class.  This is a `method builder'
18489         class for a method or one accessor of a Property/Indexer/Event.
18490         (MethodData.GetMethodFlags): Moved here from MemberBase.
18491         (MethodData.ApplyAttributes): Likewise.
18492         (MethodData.ApplyObsoleteAttribute): Likewise.
18493         (MethodData.ApplyConditionalAttribute): Likewise.
18494         (MethodData.ApplyDllImportAttribute): Likewise.
18495         (MethodData.CheckAbstractAndExternal): Likewise.
18496         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18497         (MethodData.Emit): Formerly known as Method.Emit().
18498         (MemberBase): Moved everything which was specific to a single
18499         accessor/method to MethodData.
18500         (Method): Create a new MethodData and call Define() and Emit() on it.
18501         (Property, Indexer, Event): Create a new MethodData objects for each
18502         accessor and call Define() and Emit() on them.
18503
18504 2002-07-25  Martin Baulig  <martin@gnome.org>
18505
18506         Made MethodCore derive from MemberBase to reuse the code from there.
18507         MemberBase now also checks for attributes.
18508
18509         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18510         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18511         as virtual.
18512         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18513         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18514         (MemberBase.ApplyAttributes): New virtual method; applies the
18515         attributes to a method or accessor.
18516         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18517         (MemberBase.ApplyConditionalAttribute): Likewise.
18518         (MemberBase.ApplyDllImportAttribute): Likewise.
18519         (MemberBase.CheckAbstractAndExternal): Likewise.
18520         (MethodCore.ParameterTypes): This is now a property instead of a
18521         method, it's initialized from DoDefineParameters().
18522         (MethodCore.ParameterInfo): Removed the set accessor.
18523         (MethodCore.DoDefineParameters): New protected virtual method to
18524         initialize ParameterTypes and ParameterInfo.
18525         (Method.GetReturnType): We can now simply return the MemberType.
18526         (Method.GetMethodFlags): Override the MemberBase version and add
18527         the conditional flags.
18528         (Method.CheckBase): Moved some code from Define() here, call
18529         DoDefineParameters() here.
18530         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18531         here to avoid some larger code duplication.
18532         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18533         ensure that abstract and external accessors don't declare a body.
18534
18535         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18536         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18537         lookup in the attribute's parent classes, so we need to abort as soon
18538         as we found the first match.
18539         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18540         the attribute has no arguments.
18541
18542         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18543         of a Method.
18544
18545 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18546
18547         * cs-parser.jay: reverted previous patch.
18548
18549 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18550
18551         * cs-parser.jay: fixed bug #22119.
18552
18553 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18554
18555         * attribute.cs: fixed compilation. The error was:
18556         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18557         be assigned to before control leaves the current method."
18558         [FIXME:  Filed as bug #28186: MCS must report this error.]
18559
18560 2002-07-25  Martin Baulig  <martin@gnome.org>
18561
18562         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18563         method to pull the condition name ouf of a Conditional attribute.
18564         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18565         the obsolete message and error flag out of an Obsolete attribute.
18566
18567         * class.cs (Method.GetMethodFlags): New public method to get the
18568         TypeManager.MethodFlags for this method.
18569         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18570         private methods.
18571         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18572         if we're overriding a virtual function, set the new private variable
18573         `parent_method'; call the new TypeManager.AddMethod().
18574
18575         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18576         the MethodBuilder and the Method in a PtrHashtable.
18577         (TypeManager.builder_to_method): Added for this purpose.
18578         (TypeManager.MethodFlags): Added IsObsoleteError.
18579         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18580         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18581         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18582         the message from the attribute.
18583
18584 2002-07-24  Martin Baulig  <martin@gnome.org>
18585
18586         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18587         preprocessor directives, ensure that the argument to #define/#undef is
18588         exactly one identifier and that it's actually an identifier.
18589
18590         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18591         did not work ....
18592
18593 2002-07-24  Martin Baulig  <martin@gnome.org>
18594
18595         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18596         initialize it to TypeManager.object_type in the constructor.
18597         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18598         of the `hm.get_current' method if we're using the collection pattern.
18599         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18600         for the explicit conversion to make it work when we're using the collection
18601         pattern and the `Current' property has a different return type than `object'.
18602         Fixes #27713.
18603
18604 2002-07-24  Martin Baulig  <martin@gnome.org>
18605
18606         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18607         does not match, but don't report any errors.  This method is called in
18608         order for all methods in a MethodGroupExpr until a matching method is
18609         found, so we don't want to bail out if the first method doesn't match.
18610         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18611         matches, report the 123.  Fixes #28070.
18612
18613 2002-07-24  Martin Baulig  <martin@gnome.org>
18614
18615         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18616         TypeManager.TypeToCoreType() to the top of the method so the
18617         following equality checks will work.  Fixes #28107.
18618
18619 2002-07-24  Martin Baulig  <martin@gnome.org>
18620
18621         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18622         operand is of type uint, and the other operand is of type sbyte,
18623         short or int, the operands are converted to type long." -
18624         Actually do what this comment already told us.  Fixes bug #28106,
18625         added test-150.cs.
18626
18627 2002-07-24  Martin Baulig  <martin@gnome.org>
18628
18629         * class.cs (MethodBase): New abstract class.  This is now a base
18630         class for Property, Indexer and Event to avoid some code duplication
18631         in their Define() and DefineMethods() methods.
18632         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18633         generic methods for Define() and DefineMethods().
18634         (FieldBase): Derive from MemberBase, not MemberCore.
18635         (Property): Derive from MemberBase, not MemberCore.
18636         (Property.DefineMethod): Moved all the code from this method to the
18637         new MethodBase.DefineAccessor(), just call it with appropriate
18638         argumetnts.
18639         (Property.Define): Call the new Property.DoDefine(), this does some
18640         sanity checks and we don't need to duplicate the code everywhere.
18641         (Event): Derive from MemberBase, not MemberCore.
18642         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18643         accessors, this will also make them work with interface events.
18644         (Indexer): Derive from MemberBase, not MemberCore.
18645         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18646         (Indexer.Define): Use the new MethodBase functions.
18647
18648         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18649         argument to the constructor.
18650         (Interface.FindMembers): Added support for interface events.
18651         (Interface.PopluateEvent): Implemented.
18652
18653         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18654
18655 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18656
18657         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18658         but this is required to check for a method name being the same as
18659         the containing class.  
18660
18661         Handle this now.
18662
18663 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18664
18665         * interface.cs: initialize variable.
18666
18667 2002-07-23  Martin Baulig  <martin@gnome.org>
18668
18669         Implemented the IndexerName attribute in interfaces.
18670
18671         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18672         name if this is an explicit interface implementation.
18673         (Indexer.InterfaceIndexerName): New public variable.  If we're
18674         implementing an interface indexer, this is the IndexerName in that
18675         interface.  Otherwise, it's the IndexerName.
18676         (Indexer.DefineMethod): If we're implementing interface indexer,
18677         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18678         and Pending.ImplementIndexer methods.
18679         (Indexer.Define): Also define the PropertyBuilder if we're
18680         implementing an interface indexer and this is neither an explicit
18681         interface implementation nor do the IndexerName match the one in
18682         the interface.
18683
18684         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18685         If a method is defined here, then we always need to create a proxy
18686         for it.  This is used when implementing interface indexers.
18687         (Pending.IsInterfaceIndexer): New public method.
18688         (Pending.ImplementIndexer): New public method.
18689         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18690         This is used when implementing interface indexers to define a proxy
18691         if necessary.
18692         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18693         define a proxy if necessary.
18694
18695         * interface.cs (Interface.IndexerName): New public variable.
18696         (Interface.PopulateIndexer): Set the IndexerName.
18697         (Interface.DefineIndexers): New private method.  Populate all the
18698         indexers and make sure their IndexerNames match.
18699
18700         * typemanager.cs (IndexerPropertyName): Added support for interface
18701         indexers.
18702
18703 2002-07-22  Martin Baulig  <martin@gnome.org>
18704
18705         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18706         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18707         ret if HasReturnLabel.
18708         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18709         variables.
18710
18711         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18712         and set the ec.LoopBeginTryCatchLevel.
18713         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18714         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18715         the current ec.TryCatchLevel, the branch goes out of an exception
18716         block.  In this case, we need to use Leave and not Br.
18717
18718 2002-07-22  Martin Baulig  <martin@gnome.org>
18719
18720         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18721         block unless the block does not always return or it is contained in
18722         another try { ... } catch { ... } block.  Fixes bug #26506.
18723         Added verify-1.cs to the test suite.
18724
18725 2002-07-22  Martin Baulig  <martin@gnome.org>
18726
18727         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18728         then we do not always return.  Fixes bug #24985.
18729
18730 2002-07-22  Martin Baulig  <martin@gnome.org>
18731
18732         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18733         lookup on a per-class level; ie. walk up the class hierarchy until we
18734         found at least one applicable method, then choose the best among them.
18735         Fixes bug #24463 and test-29.cs.
18736
18737 2002-07-22  Martin Baulig  <martin@gnome.org>
18738
18739         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18740         return types of the methods.  The return type is not part of the
18741         signature and we must not check it to make the `new' modifier work.
18742         Fixes bug #27999, also added test-147.cs.
18743         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18744
18745         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18746         on the method's return type.
18747
18748 2002-07-21  Martin Baulig  <martin@gnome.org>
18749
18750         * assign.cs: Make this work if the rightmost source is a constant and
18751         we need to do an implicit type conversion.  Also adding a few more tests
18752         to test-38.cs which should have caught this.
18753
18754         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18755         target in the makefile for this.  The makefile.gnu is primarily intended
18756         for end-users who don't want to debug the compiler.
18757
18758 2002-07-21  Martin Baulig  <martin@gnome.org>
18759
18760         * assign.cs: Improved the Assign class so it can now handle embedded
18761         assignments (X = Y = Z = something).  As a side-effect this'll now also
18762         consume less local variables.  test-38.cs now passes with MCS, added
18763         a few new test cases to that test.
18764
18765 2002-07-20  Martin Baulig  <martin@gnome.org>
18766
18767         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18768         instructions.  Fixes bug #27977, also added test-146.cs.
18769
18770 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18771
18772         * cs-tokenizer.cs: fixed getHex ().
18773
18774 2002-07-19  Martin Baulig  <martin@gnome.org>
18775
18776         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18777         not Type.GetType() to lookup the array type.  This is needed when
18778         we're constructing an array of a user-defined type.
18779         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18780         single-dimensional arrays, but also for single-dimensial arrays of
18781         type decimal.
18782
18783 2002-07-19  Martin Baulig  <martin@gnome.org>
18784
18785         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18786         this function is called, it's not allowed to share LocalBuilders
18787         among ILGenerators.
18788
18789 2002-07-19  Martin Baulig  <martin@gnome.org>
18790
18791         * expression.cs (Argument.Resolve): Report an error 118 when trying
18792         to pass a type as argument.
18793
18794 2002-07-18  Martin Baulig  <martin@gnome.org>
18795
18796         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18797         Conv_R_Un for the signed `long' type.
18798
18799 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18802         `expr' for the temporary result, as that will fail if we do
18803         multiple resolves on the same expression.
18804
18805 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18806
18807         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18808         ec.TypeContainer for looking up aliases. 
18809
18810         * class.cs (TypeContainer): Remove LookupAlias from here.
18811
18812         * decl.cs (DeclSpace); Move here.
18813
18814 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18815
18816         * class.cs (FindMembers): Only call filter if the constructor
18817         bulider is not null.
18818
18819         Also handle delegates in `NestedTypes' now.  Now we will perform
18820         type lookups using the standard resolution process.  This also
18821         fixes a bug.
18822
18823         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18824         This uses Expressions (the limited kind that can be parsed by the
18825         tree) instead of strings.
18826
18827         * expression.cs (ComposedCast.ToString): Implement, used to flag
18828         errors since now we have to render expressions.
18829
18830         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18831         FormArrayType. 
18832
18833         * ecore.cs (SimpleName.ToString): ditto.
18834
18835         * cs-parser.jay: Instead of using strings to assemble types, use
18836         Expressions to assemble the type (using SimpleName, ComposedCast,
18837         MemberAccess).  This should fix the type lookups in declarations,
18838         because we were using a different code path for this.
18839
18840         * statement.cs (Block.Resolve): Continue processing statements
18841         even when there is an error.
18842
18843 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18844
18845         * class.cs (Event.Define): Also remove the `remove' method from
18846         the list of pending items.
18847
18848         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18849         generate more compact code. 
18850
18851 2002-07-17  Martin Baulig  <martin@gnome.org>
18852
18853         * const.cs (Const.LookupConstantValue): Add support for constant
18854         `unchecked' and `checked' expressions.
18855         Also adding test case test-140.cs for this.
18856
18857 2002-07-17  Martin Baulig  <martin@gnome.org>
18858
18859         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18860         check whether mi.ReturnType implements the IEnumerator interface; the
18861         `==' and the IsAssignableFrom() will fail in this situation.
18862
18863 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18864
18865         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18866         here too.
18867
18868 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18869
18870         * expression.cs: fixed bug #27811.
18871
18872 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18873
18874         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18875         Molaro: when we are a ref, the value already contains a pointer
18876         value, do not take the address of it.
18877
18878 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18879         * removed mb-parser.jay and mb-tokenizer.cs
18880
18881 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18882
18883         * expression.cs: check against the building corlib void type.
18884
18885 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18886
18887         * ecore.cs: fix for valuetype static readonly fields: when 
18888         initializing them, we need their address, not the address of a copy.
18889
18890 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18891
18892         * typemanager.cs: register also enum_type in corlib.
18893
18894 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18895
18896         * class.cs: allow calling this (but not base) initializers in structs.
18897
18898 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18899
18900         * ecore.cs: make sure we compare against the building base types
18901         in GetTypeSize ().
18902
18903 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18904
18905         * typemanager.cs: fix TypeToCoreType() to handle void and object
18906         (corlib gets no more typerefs after this change).
18907
18908 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18909
18910         * expression.cs (ArrayCreation.EmitArrayArguments): use
18911         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18912
18913         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18914         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18915         array indexes, the runtime actually forbids them.
18916
18917         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18918         for array arguments here.
18919
18920         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18921         instead of the default for ValueTypes.
18922
18923         (New.DoEmit): Use IsValueType instead of
18924         IsSubclassOf (value_type)
18925         (New.DoResolve): ditto.
18926         (Invocation.EmitCall): ditto.
18927
18928         * assign.cs (Assign): ditto.
18929
18930         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18931         Statements *are* currently doing part of their resolution during
18932         Emit.  
18933
18934         Expressions do always resolve during resolve, but statements are
18935         only required to propagate resolution to their children.
18936
18937 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18940
18941         (LoadAssembly): Do not add the dll if it is already specified
18942
18943         (MainDriver): Add the System directory to the link path at the end,
18944         after all the other -L arguments. 
18945
18946         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18947         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18948         ldelem.u1) and using the opposite for sbytes.
18949
18950         This fixes Digger, and we can finally run it.
18951
18952         * driver.cs (UnixParseOption): Move the option parsing here.  
18953         (CSCParseOption): Implement CSC-like parsing of options.
18954
18955         We now support both modes of operation, the old Unix way, and the
18956         new CSC-like way.  This should help those who wanted to make cross
18957         platform makefiles.
18958
18959         The only thing broken is that /r:, /reference: and /lib: are not
18960         implemented, because I want to make those have the same semantics
18961         as the CSC compiler has, and kill once and for all the confussion
18962         around this.   Will be doing this tomorrow.
18963
18964         * statement.cs (Unsafe.Resolve): The state is checked during
18965         resolve, not emit, so we have to set the flags for IsUnsfe here.
18966
18967 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18968
18969         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18970         not catch the Error_ObjectRefRequired in SimpleName (as it is
18971         possible to have a class/instance variable name that later gets
18972         deambiguated), we have to check this here.      
18973
18974 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18975
18976         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18977         make static and put into Expression.
18978
18979         (Event.Define): Register the private field of the event with the 
18980         TypeManager so that GetFieldFromEvent can get at it.
18981
18982         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18983         keep track of the private field associated with an event which
18984         has no accessors.
18985
18986         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18987         private field.
18988
18989         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18990
18991 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18992
18993         * expression.cs (Binary.EmitBranchable): this routine emits the
18994         Binary expression in a branchable context.  This basically means:
18995         we need to branch somewhere, not just get the value on the stack.
18996
18997         This works together with Statement.EmitBoolExpression.
18998
18999         * statement.cs (Statement.EmitBoolExpression): Use
19000         EmitBranchable. 
19001
19002 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
19003
19004         * statement.cs (For): Reduce the number of jumps in loops.
19005
19006         (For): Implement loop inversion for the For statement.
19007
19008         (Break): We can be breaking out of a Try/Catch controlled section
19009         (foreach might have an implicit try/catch clause), so we need to
19010         use Leave instead of Br.
19011
19012         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
19013         now).  If the instace expression supports IMemoryLocation, we use
19014         the AddressOf method from the IMemoryLocation to extract the
19015         address instead of emitting the instance.
19016
19017         This showed up with `This', as we were emitting the instance
19018         always (Emit) instead of the Address of This.  Particularly
19019         interesting when This is a value type, as we dont want the Emit
19020         effect (which was to load the object).
19021
19022 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
19023
19024         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
19025
19026         * statement.cs (Checked): Set the CheckedState during the resolve
19027         process too, as the ConvCast operations track the checked state on
19028         the resolve process, and not emit.
19029
19030         * cs-parser.jay (namespace_member_declaration): Flag that we have
19031         found a declaration when we do.  This is used to flag error 1529
19032
19033         * driver.cs: Report ok when we display the help only.
19034
19035 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
19036
19037         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
19038
19039 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
19040
19041         * cs-tokenizer.cs (define): We also have to track locally the
19042         defines.  AllDefines is just used for the Conditional Attribute,
19043         but we also need the local defines for the current source code. 
19044
19045 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
19046
19047         * statement.cs (While, For, Do): These loops can exit through a
19048         Break statement, use this information to tell whether the
19049         statement is the last piece of code.
19050
19051         (Break): Flag that we break.
19052
19053         * codegen.cs (EmitContexts): New `Breaks' state variable.
19054
19055 2002-07-03  Martin Baulig  <martin@gnome.org>
19056
19057         * class.cs (TypeContainer.MethodModifiersValid): Allow override
19058         modifiers in method declarations in structs.  Otherwise, you won't
19059         be able to override things like Object.Equals().
19060
19061 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19062
19063         * class.cs (Method, Property, Indexer): Do not allow the public
19064         modifier to be used in explicit interface implementations.
19065
19066         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
19067         override modifiers in method declarations in structs
19068
19069 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
19070
19071         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
19072         integer or real overflow, report an error
19073
19074 2002-07-02  Martin Baulig  <martin@gnome.org>
19075
19076         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
19077         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
19078         to tell the runtime about our newly created System.Object and
19079         System.ValueType types.
19080
19081 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
19082
19083         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
19084         struct instead of Ldarg/Starg.
19085
19086 2002-07-02  Martin Baulig  <martin@gnome.org>
19087
19088         * expression.cs (Indirection.Indirection): Call
19089         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
19090
19091 2002-07-02  Martin Baulig  <martin@gnome.org>
19092
19093         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
19094         ValueType, call TypeManager.TypeToCoreType() on it.
19095         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19096         the OpCodes.Newarr argument.
19097
19098 2002-07-02  Martin Baulig  <martin@gnome.org>
19099
19100         * expression.cs (Invocation.EmitCall): When compiling corlib,
19101         replace all calls to the system's System.Array type to calls to
19102         the newly created one.
19103
19104         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19105         System.Array methods.
19106         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19107         from the system's System.Array type which must be replaced.
19108
19109 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19110
19111         * typemanager.cs: load unverifiable_code_ctor so we can build
19112         corlib using the correct type. Avoid using GetTypeCode() with
19113         TypeBuilders.
19114         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19115         TypeManager.object_type to allow building corlib.
19116
19117 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19118
19119         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19120
19121 2002-07-01  Martin Baulig  <martin@gnome.org>
19122
19123         * class.cs: Make the last change actually work, we need to check
19124         whether `ifaces != null' to avoid a crash.
19125
19126 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19127
19128         * class.cs: when we build structs without fields that implement
19129         interfaces, we need to add the interfaces separately, since there is
19130         no API to both set the size and add the interfaces at type creation
19131         time.
19132
19133 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19134
19135         * expression.cs: the dimension arguments to the array constructors
19136         need to be converted if they are a long.
19137
19138 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19139
19140         * class.cs: don't emit ldarg.0 if there is no parent constructor
19141         (fixes showstopper for corlib).
19142
19143 2002-06-29  Martin Baulig  <martin@gnome.org>
19144
19145         MCS now compiles corlib on GNU/Linux :-)
19146
19147         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19148         ie. check for MethodImplOptions.InternalCall.
19149
19150         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19151         and TypeManager.attribute_type are null, so we must explicitly check
19152         whether parent is not null to find out whether it's an attribute type.
19153         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19154         and SetBuilder, not only if the property is neither abstract nor external.
19155         This is necessary to set the MethodImplOptions on the accessor methods.
19156         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19157         SetBuilder, see Property.Emit().
19158
19159         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19160         populate "System.Object", "System.ValueType" and "System.Attribute" since
19161         they've already been populated from BootCorlib_PopulateCoreTypes().
19162
19163 2002-06-29  Martin Baulig  <martin@gnome.org>
19164
19165         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19166         is the NullLiteral, we also need to make sure that target_type is not
19167         an enum type.   
19168
19169 2002-06-29  Martin Baulig  <martin@gnome.org>
19170
19171         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19172         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19173         before calling BootstrapCorlib_ResolveDelegate ().
19174
19175 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19176
19177         * statement.cs: fixed build-breaker. All tests passed ok.
19178
19179 2002-06-27  Martin Baulig  <martin@gnome.org>
19180
19181         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19182         for System.Decimal when compiling corlib.
19183
19184 2002-06-27  Martin Baulig  <martin@gnome.org>
19185
19186         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19187         switch blocks which contain nothing but a default clause.
19188
19189 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19190
19191        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19192
19193 2002-06-27  Martin Baulig  <martin@gnome.org>
19194
19195         * ecore.cs (PropertyExpr.PropertyExpr): Call
19196         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19197
19198         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19199         is already a TypeBuilder.
19200
19201 2002-06-27  Martin Baulig  <martin@gnome.org>
19202
19203         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19204         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19205         the "from an array-type to System.Array" case.  This makes it work
19206         when compiling corlib.
19207
19208 2002-06-27  Martin Baulig  <martin@gnome.org>
19209
19210         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19211         non-static PropertyExpr, set its InstanceExpression.  This makes
19212         the `ICollection.Count' property work in System/Array.cs.
19213
19214 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19215
19216         * driver.cs: Made error handling more consistent.  Errors now
19217         tracked by Report class, so many methods which used to return int
19218         now return void.  Main() now prints success/failure and 
19219         errors/warnings message.
19220
19221         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19222         the magic number return values (123 and 124).  Now, if the
19223         expected error occurs, the compiler exits with success (exit value
19224         0).  If the compilation completes without seeing that particular
19225         error, the compiler exits with failure (exit value 1).  The
19226         makefile in mcs/errors has been changed to handle the new behaviour.
19227
19228         * report.cs: Made 'expected error' number a property and renamed
19229         it from 'Probe' to 'ExpectedError'.
19230
19231         * genericparser.cs: Removed error handling support, since it is
19232         now all done by Report class.
19233
19234         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19235         class, so parse() no longer returns an int.
19236
19237         * namespace.cs: Use Report.Error instead of GenericParser.error
19238
19239 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19240
19241         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19242         TypeContainer.AddOperator): At the front of the list put the
19243         explicit implementations, so they get resolved/defined first. 
19244
19245 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19246
19247         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19248         interface type is implemented by this TypeContainer.  Used during
19249         explicit interface implementation.
19250
19251         (Property.Define, Indexer.Define, Method.Define): Validate that
19252         the given interface in the explicit implementation is one of the
19253         base classes for the containing type.
19254
19255         Also if we are explicitly implementing an interface, but there is
19256         no match in the pending implementation table, report an error.
19257
19258         (Property.Define): Only define the property if we are
19259         not explicitly implementing a property from an interface.  Use the
19260         correct name also for those properties (the same CSC uses,
19261         although that is really not needed).
19262
19263         (Property.Emit): Do not emit attributes for explicitly implemented
19264         properties, as there is no TypeBuilder.
19265
19266         (Indexer.Emit): ditto.
19267
19268         Hiding then means that we do not really *implement* a pending
19269         implementation, which makes code fail.
19270
19271 2002-06-22  Martin Baulig  <martin@gnome.org>
19272
19273         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19274         the return value of Object.GetType().  [FIXME: we need to do this whenever
19275         we get a type back from the reflection library].
19276
19277 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19278
19279         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19280
19281 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19282
19283         * attribute.cs: Return null if we can not look up the type.
19284
19285         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19286         the interface types found.
19287
19288         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19289         interface types found.
19290
19291         * typemanager.cs (GetInterfaces): Make this routine returns alll
19292         the interfaces and work around the lame differences between
19293         System.Type and System.Reflection.Emit.TypeBuilder in the results
19294         result for GetInterfaces.
19295
19296         (ExpandInterfaces): Given an array of interface types, expand and
19297         eliminate repeated ocurrences of an interface.  This expands in
19298         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19299         be IA, IB, IC.
19300
19301 2002-06-21  Martin Baulig  <martin@gnome.org>
19302
19303         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19304         on System.Enum.
19305
19306 2002-06-21  Martin Baulig  <martin@gnome.org>
19307
19308         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19309         and called with one of the core types, return the corresponding typebuilder for
19310         that type.
19311
19312         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19313         element type.
19314
19315 2002-06-21  Martin Baulig  <martin@gnome.org>
19316
19317         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19318         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19319         (Expression.ConvertReferenceExplicit): Likewise.
19320
19321         * expression.cs (ElementAccess.DoResolve): Likewise.
19322         (ElementAccess.DoResolveLValue): Likewise.
19323
19324 2002-06-10  Martin Baulig  <martin@gnome.org>
19325
19326         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19327         add the "value" parameter to the parameter list.
19328
19329         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19330         to our caller.
19331
19332 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19333
19334         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19335         the argument to an int, uint, long or ulong, per the spec.  Also
19336         catch negative constants in array creation.
19337
19338 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19339
19340         * class.cs: do not allow the same interface to appear twice in
19341         the definition list.
19342
19343 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19344
19345         * ecore.cs: don't use ldlen with System.Array.
19346
19347 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19348
19349         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19350
19351 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19352
19353         * modifiers.cs: produce correct field attributes for protected
19354         internal. Easy fix so miguel can work on ther harder stuff:-)
19355
19356 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * pending.cs: New file.  Move the code from class.cs here.
19359         Support clearning the pending flag for all methods (when not doing
19360         explicit interface implementation).
19361
19362 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19363
19364         * rootcontext.cs: added a couple more types needed to bootstrap.
19365
19366 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19369         constructor in the type, instead of any constructor in the type
19370         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19371         a bug in the Mono runtime when applying the params attribute). 
19372
19373 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19374         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19375
19376 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19377
19378         * expression.cs (Unary.ResolveOperator): Use TypeManager
19379         to resolve the type.
19380
19381 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19382
19383         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19384         attached.
19385
19386         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19387         with each member too.
19388
19389         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19390         field builders too - this takes care of the enum member case.
19391
19392 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19393
19394         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19395         address-of operator on both value types and pointers.
19396
19397 2002-06-10  Martin Baulig  <martin@gnome.org>
19398
19399         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19400         PropertyBuilder to the `property_builders' list.
19401
19402         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19403         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19404         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19405         find any indexers which are inherited from an interface.
19406
19407 2002-06-09  Martin Baulig  <martin@gnome.org>
19408
19409         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19410         the same type as the constant if necessary.  There's also a test-130.cs
19411         for this.
19412
19413         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19414
19415         * typemanager.cs (TypeManager.ChangeType): Previously known as
19416         Enum.ChangeEnumType().
19417
19418 2002-06-09  Martin Baulig  <martin@gnome.org>
19419
19420         * expression.cs (Cast.TryReduce): Added support for consts.
19421
19422 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19423
19424         * class.cs (Accessor): Hold attributes information so we can pass
19425         it along.
19426
19427         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19428         Modify to pass in attributes attached to the methods.
19429
19430         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19431
19432         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19433         to handle the Accessor kind :-)
19434
19435         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19436
19437 2002-06-08  Martin Baulig  <martin@gnome.org>
19438
19439         * expression.cs (Unary.TryReduceNegative): Added support for
19440         ULongConstants.
19441
19442 2002-06-08  Martin Baulig  <martin@gnome.org>
19443
19444         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19445         name can't be found in the `defined_names' - the caller will do a
19446         MemberLookup in this case and thus find methods in System.Enum
19447         such as Enum.IsDefined().
19448
19449 2002-06-08  Martin Baulig  <martin@gnome.org>
19450
19451         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19452         Convert.ChangeType() which works with TypeBuilder created types.
19453         (Enum.LookupEnumValue, Enum.Define): Use it here.
19454
19455         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19456         `TypeBuilder.BaseType != null' check.
19457         (TypeContainer.FindMembers): Only lookup parent members if we
19458         actually have a parent.
19459         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19460         (ConstructorInitializer.Resolve): Likewise.
19461
19462         * interface.cs (Interface.FindMembers): Added
19463         `TypeBuilder.BaseType != null' check.
19464
19465         * rootcontext.cs (RootContext.ResolveCore): Added
19466         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19467         classes_second_stage.
19468
19469         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19470         debug_type and trace_type when compiling with --nostdlib.       
19471
19472 2002-06-07  Martin Baulig  <martin@gnome.org>
19473
19474         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19475         (AddField): Set it to true when adding a non-static field.
19476         (DefineType): Use `have_nonstatic_fields' to find out whether we
19477         have non-static fields, not `Fields != null'.
19478
19479 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19480
19481         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19482         dereferencing a null on the static-field code path)
19483
19484 2002-05-30  Martin Baulig  <martin@gnome.org>
19485
19486         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19487         to take command line arguments.  Use reflection to call the new
19488         custom `Initialize' function on the symbol writer and pass it the
19489         command line arguments.
19490
19491         * driver.cs (--debug-args): New command line argument to pass command
19492         line arguments to the symbol writer.
19493
19494 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19495
19496         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19497         the target type for indexers and properties.  Thanks to Joe for
19498         catching this.
19499
19500 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19501
19502         * typemanager.cs (MethodFlags): returns the method flags
19503         (Obsolete/ShouldIgnore) that control warning emission and whether
19504         the invocation should be made, or ignored. 
19505
19506         * expression.cs (Invocation.Emit): Remove previous hack, we should
19507         not do this on matching a base type, we should do this based on an attribute
19508
19509         Only emit calls to System.Diagnostics.Debug and
19510         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19511         on the command line.
19512
19513         * rootcontext.cs: Global settings for tracing and debugging.
19514
19515         * cs-tokenizer.cs (define): New utility function to track
19516         defines.   Set the global settings for TRACE and DEBUG if found.
19517
19518 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19519
19520         * interface.cs (Populate*): Pass in the TypeContainer as well as
19521         the DeclSpace as parameters so that we can create EmitContexts and
19522         then use that to apply attributes etc.
19523
19524         (PopulateMethod, PopulateEvent, PopulateProperty)
19525         (PopulateIndexer): Apply attributes everywhere.
19526
19527         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19528         etc.
19529
19530         (ApplyAttributes): Update accordingly.
19531
19532         We now apply interface attributes for all members too.
19533
19534 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19535
19536         * class.cs (Indexer.Define); Correctly check if we are explicit
19537         implementation (instead of checking the Name for a ".", we
19538         directly look up if the InterfaceType was specified).
19539
19540         Delay the creation of the PropertyBuilder.
19541
19542         Only create the PropertyBuilder if we are not an explicit
19543         interface implementation.   This means that explicit interface
19544         implementation members do not participate in regular function
19545         lookups, and hence fixes another major ambiguity problem in
19546         overload resolution (that was the visible effect).
19547
19548         (DefineMethod): Return whether we are doing an interface
19549         implementation. 
19550
19551         * typemanager.cs: Temporary hack until we get attributes in
19552         interfaces (Ravi is working on that) and we get IndexerName
19553         support in interfaces.
19554
19555         * interface.cs: Register the indexers as properties.
19556
19557         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19558         warning, I have verified that this is a bug in the .NET runtime
19559         (JavaScript suffers of the same problem).
19560
19561         * typemanager.cs (MemberLookup): When looking up members for
19562         interfaces, the parent of an interface is the implicit
19563         System.Object (so we succeed in searches of Object methods in an
19564         interface method invocation.  Example:  IEnumerable x;  x.ToString
19565         ()) 
19566
19567 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * class.cs (Event): Events should also register if they do
19570         implement the methods that an interface requires.
19571
19572         * typemanager.cs (MemberLookup); use the new GetInterfaces
19573         method. 
19574
19575         (GetInterfaces): The code used to lookup interfaces for a type is
19576         used in more than one place, factor it here. 
19577
19578         * driver.cs: Track the errors at the bottom of the file, we kept
19579         on going.
19580
19581         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19582         instance if the method we are calling is static!
19583
19584 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19585
19586         * attribute.cs (ApplyAttributes): Make this function filter out
19587         the IndexerName attribute (as that attribute in reality is never
19588         applied) and return the string constant for the IndexerName
19589         attribute. 
19590
19591         * class.cs (TypeContainer.Emit): Validate that all the indexers
19592         have the same IndexerName attribute, and if so, set the
19593         DefaultName attribute on the class. 
19594
19595         * typemanager.cs: The return value might contain other stuff (not
19596         only methods).  For instance, consider a method with an "Item"
19597         property and an Item method.
19598
19599         * class.cs: If there is a problem with the parameter types,
19600         return. 
19601
19602 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19603
19604         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19605         looks at user defined conversion after making a call to 
19606         StandardConversionExists - we need this for overload resolution.
19607
19608         * expression.cs : Update accordingly the various method calls.
19609
19610         This fixes 2 bugs filed against implicit user defined conversions 
19611
19612 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19613
19614         * statement.cs: Track the result of the assignment.
19615
19616 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19617
19618         * expression.cs (MemberAccess): Improved error reporting for
19619         inaccessible members.
19620
19621 2002-05-22  Martin Baulig  <martin@gnome.org>
19622
19623         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19624         itself with debugging support.
19625
19626 2002-05-22  Martin Baulig  <martin@gnome.org>
19627
19628         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19629         Removed, this isn't needed anymore.
19630
19631 2002-05-20  Martin Baulig  <martin@gnome.org>
19632
19633         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19634         be underlying type for an enum.
19635
19636 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19637
19638         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19639         that splits out the loading of just the core types.
19640
19641         * rootcontext.cs (ResolveCore): Split the struct resolution in
19642         two, so we can load the enumeration underlying types before any
19643         enums are used.
19644
19645         * expression.cs (Is): Bandaid until we fix properly Switch (see
19646         bug #24985 for details).
19647
19648         * typemanager.cs (ImplementsInterface): The hashtable will contain
19649         a null if there are no interfaces implemented.
19650
19651 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19652
19653         * cs-parser.jay (indexer_declarator): It is fine to have array
19654         parameters
19655
19656 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19657
19658         * typemanager.cs: (RegisterBuilder): New function used to register
19659         TypeBuilders that implement interfaces.  Since
19660         TypeBuilder.GetInterfaces (as usual) does not work with lame
19661         Reflection.Emit. 
19662         (AddUserType): register interfaces.
19663
19664         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19665         dealing with TypeBuilder.  Also, arrays are showing up as
19666         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19667         methods can not be invoked on them!
19668
19669         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19670         (ImplicitReferenceConversionExists): Split out from
19671         StandardConversionExists. 
19672
19673         * expression.cs (As): We were only implementing one of the three
19674         cases for the as operator.  We now implement them all.
19675         (Is): Implement the various other cases for Is as well.
19676
19677         * typemanager.cs (CACHE): New define used to control if we want or
19678         not the FindMembers cache.  Seems to have a negative impact on
19679         performance currently
19680
19681         (MemberLookup): Nested types have full acess to
19682         enclosing type members
19683
19684         Remove code that coped with instance/static returns for events, we
19685         now catch this in RealFindMembers.
19686
19687         (RealFindMembers): only perform static lookup if the instance
19688         lookup did not return a type or an event.  
19689
19690 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19691
19692         * assign.cs (CompoundAssign): We pass more semantic information
19693         now to Compound Assignments than we did before: now we have all
19694         the information at hand, and now we resolve the target *before* we
19695         do the expression expansion, which allows the "CacheValue" method
19696         to have the effect we intended (before, a [x] += 1 would generate
19697         two differen ArrayAccess expressions from the ElementAccess,
19698         during the resolution process).
19699
19700         (CompoundAssign.DoResolve): Resolve target and original_source here.
19701
19702 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19703
19704         * expression.cs (ArrayAccess): dropped debugging information. 
19705
19706         * typemanager.cs: Small bug fix: I was always returning i_members,
19707         instead of one of i_members or s_members (depending on which had
19708         the content).
19709
19710         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19711         method is invoked before any code generation takes place, and it
19712         is a mechanism to inform that the expression will be invoked more
19713         than once, and that the method should use temporary values to
19714         avoid having side effects
19715
19716         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19717
19718         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19719         implementation.
19720
19721         * expression.cs (Indirection, ArrayAccess): Add support for
19722         CacheTemporaries in these two bad boys. 
19723
19724         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19725         ldobj or ldind_ref.  
19726         (StoreFromPtr): Handle stobj as well.
19727
19728         * expression.cs (UnaryMutator): Share more code.
19729
19730         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19731         down: I was not tracking the Filter function as well, which
19732         was affecting the results of the cache.
19733
19734 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19735
19736         * attribute.cs: Remove the hack to handle the CharSet property on
19737         StructLayouts. 
19738
19739 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19740
19741         * attribute.cs (DoResolve): More uglyness, we now only try to
19742         resolve the attribute partially, to extract the CharSet
19743         information (only if we are a StructLayout attribute).  Otherwise 
19744
19745         (GetExtraTypeInfo): Add some code to conditionally kill in the
19746         future this.   I am more and more convinced that the .NET
19747         framework has special code to handle the attribute setting on
19748         certain elements.
19749
19750         * expression.cs (IsParamsMethodApplicable): Revert my previous
19751         foreach change here, it was wrong.
19752
19753 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19754
19755         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19756         (pp_expr): do not abort on unknown input, just return.
19757         (eval): abort if there are pending chars.
19758
19759         * attribute.cs (Attribute.Resolve): Positional parameters are
19760         optional.  Deal with that case.
19761
19762         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19763         the Ansi/Unicode/Auto information for the type.
19764
19765         (TypeContainer.DefineType): instantiate the EmitContext here, as
19766         we will be using it during the type definition (to resolve
19767         attributes) and during the emit phase.
19768
19769         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19770         to pull type information out of the attributes
19771
19772         (Attribute.Resolve): track the constructor builder, and allow for
19773         multiple invocations (structs and classes will use this).
19774
19775         * ecore.cs (MemberLookupFinal): new version with all the
19776         parameters customizable.
19777
19778         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19779         constructors.  Return if the result value is null (as the error
19780         would have been flagged already by MemberLookupFinal)
19781
19782         Do not allow instances of abstract classes or interfaces to be
19783         created.
19784
19785         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19786         We have to compare the assembly property here when dealing with
19787         FamANDAssem and Assembly access modifiers, because we might be
19788         creating an assembly from *modules* (that means that we are not
19789         getting TypeBuilders for types defined in other modules that are
19790         part of this assembly).
19791
19792         (Method.Emit): If the method is marked abstract and has a body,
19793         emit an error. 
19794
19795         (TypeContainer.DefineMembers): If both the defined member and the
19796         parent name match are methods, then do not emit any warnings: let
19797         the Method.Define routine take care of flagging warnings.  But if
19798         there is a mismatch (method overrides something else, or method is
19799         overriwritten by something, then emit warning).
19800
19801         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19802         set to null, this means `do not check for the return type on the
19803         signature'. 
19804
19805         (Method.Define): set the return type for the method signature to
19806         null, so that we get methods with the same name and parameters and
19807         different return types.  This is used to flag warning 114 (you are
19808         hiding a method, and you probably want to use the new/override
19809         keywords instead).
19810
19811         * typemanager.cs (MemberLookup): Implemented proper access
19812         control, closing a long standing set of bug reports.  The problem
19813         was that the Framework only has two bits: Public and NonPublic,
19814         and NonPublic includes private and protected methods, but we need
19815         to enforce the FamANDAssem, FamOrAssem and Family. 
19816
19817 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19818
19819         * statement.cs (GotoCase): Return true: Ammounts to giving up
19820         knowledge on whether we return or not, and letting the other case
19821         be responsible for it.
19822
19823 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19824
19825         * driver.cs: Do not load directories for each file processed, only
19826         do it if there is a pattern.
19827
19828         * ecore.cs: Report readonly assigns here as well, as we might have
19829         been resolved only by MemberAccess.
19830
19831         (SimpleName.SimpleNameResolve): Also be useful for LValue
19832         resolution.   We need this to propagate assign to local readonly variables
19833
19834         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19835         do not want to reuse potential criteria memory.
19836
19837         * class.cs (MyEventBuilder): Set reflected_type;
19838
19839         * ecore.cs (Constantify): Added support for constifying bools.
19840
19841         (RootContext.LookupType): Added a cache for values looked up in
19842         the declaration space.
19843
19844         * typemanager.cs (FindMembers): Now is a front-end to
19845         RealFindMembers, and provides a two-level hashtable-based cache to
19846         the request.  
19847
19848         15% performance improvement: from 22.5 to 19.2 seconds.
19849
19850         * expression.cs (IsParamsMethodApplicable): use foreach.
19851         (Invocation.DoResolve): ditto.
19852         (New.DoResolve): ditto.
19853         (ArrayCreation.DoResolve): ditto.
19854
19855         * ecore.cs (FindMostEncompassingType): use foreach.
19856
19857         * delegate.cs (NewDelegate.DoResolve): Use foreach
19858
19859         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19860         (RemoveMethods): use foreach.
19861
19862         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19863         nested foreach statements instead of for, and also break out of
19864         the inner loop once a match is found.
19865
19866         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19867
19868 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19869
19870         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19871         we actually unwrap the expression to allow for extra information
19872         to be extracted. 
19873
19874         * expression.cs: Use Shr_Un on unsigned operations. 
19875
19876 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19877
19878         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19879         applicable operators was not being considered correctly. This closes
19880         the bug Miguel reported.
19881
19882 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19883
19884         * attribute.cs: check that the type derives from System.Attribute
19885         and report the correct error in that case (moved the duplicate code to
19886         its own method, too).
19887
19888 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19889
19890         * attribute.cs: lookup attribute type name as the spec says: first the
19891         bare attribute name and then name + "Attribute" (nant compiles with
19892         mcs after this fix).
19893
19894 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19897         Because of the way we parse things, we should try to see if a
19898         UIntConstant can fit in an integer.
19899
19900 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19901
19902         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19903         when we are in an explicit context.
19904
19905         (ConvertReferenceExplicit): When converting from Iface type S to Class
19906         T make sure the rules are implemented as an OR.
19907
19908         * parameter.cs (ParameterType): Make it a property for now although the
19909         purpose really isn't anything immediate.
19910
19911         * expression.cs (Is*Applicable): Do better checking on the parameter type
19912         of a ref/out parameter. The ones from the system assemblies are already 
19913         marked with the correct type so we don't need to do any correction.
19914
19915         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19916         the object type is standard too so include that.
19917
19918 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19919
19920         * ecore.cs (StandardConversionExists): Augment with missing code:
19921         deal with IntConstant, LongConstants and Enumerations.
19922
19923         * assign.cs: Report the error, instead of failing silently
19924
19925         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19926         typecontainer that they are declared, because the
19927         typecontainer/namespace will have the list of using clauses that
19928         need to be applied.
19929
19930         Assembly Attributes were escaping the normal registration
19931         mechanism. 
19932
19933         (EmitCode): Apply attributes within an EmitContext that represents
19934         the container they were declared on.
19935
19936         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19937
19938 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19939
19940         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19941         Revamp completely - make much cleaner as we now operate only
19942         on a set of Types.
19943
19944         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19945         to implement the logic detailed in the spec more correctly.
19946
19947         (UserDefinedConversion): Update accordingly.
19948
19949 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19950
19951         * statement.cs: Return flow analysis information up.
19952
19953         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19954         and the default.
19955
19956         (token): Do not consume an extra character before calling
19957         decimal_digits.
19958
19959 2002-05-06  Piers Haken <piersh@friskit.com>
19960
19961         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19962
19963 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19964
19965         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19966         EmitContext during the instance constructor initializer
19967         resolution, to stop access to instance variables.
19968
19969         This is mandated by the spec, last paragraph of the `constructor
19970         initializers' section. 
19971
19972 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19973
19974         * cs-parser.jay, class.cs (Accessor): new class used to represent
19975         an accessor (get or set).  In the past we used `null' to represent
19976         a missing accessor.  But this is ambiguous because there was no
19977         way to tell in abstract indexers/properties if one of them was
19978         specified.
19979
19980         Now there is a way of addressing that.
19981
19982         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19983         instead of FindMembers.
19984
19985         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19986         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19987
19988         * attribute.cs: Treat indexers and properties as the same in terms
19989         of applying attributes
19990
19991         * ecore.cs (FindMostEncompassedType): Use statically initialized
19992         EmptyExpressions()s like we do elsewhere to avoid creating useless
19993         objects (and we take this out of the tight loop).
19994
19995         (GetConversionOperators): Move the code to extract the actual
19996         operators to a separate routine to clean things up.
19997
19998 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
20001         events are always registered FieldBuilders.
20002
20003         * class.cs (FieldBase): New class shared by Fields 
20004
20005         * delegate.cs: If we are a toplevel delegate, use our full name.
20006         If we are a nested delegate, then only use our tail name.
20007
20008 2002-05-02  Ravi Pratap  <ravi@ximian.com>
20009
20010         * expression.cs (IsApplicable): Ensure that we add the "&" to
20011         ref/out types before comparing it with the type of the argument.
20012
20013         (IsParamsMethodApplicable): Ditto.
20014
20015         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
20016         silly me ;-)
20017
20018         * delegate.cs : Handle the case when we have more than one applicable
20019         method. Flag an error only when we finish checking all.
20020
20021 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
20022
20023         * expression.cs: Add support for boolean static initializers.
20024
20025 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
20026
20027         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
20028
20029         * parameter.cs (ComputeParameterTypes,
20030         ComputeAndDefineParameterTypes): Better error handling: now we
20031         clear the `types' cache if we fail during any of the type lookups.
20032         We also return the status code correctly to our caller
20033
20034         * delegate.cs: If we fail to define a delegate, abort the extra
20035         steps. 
20036
20037         * expression.cs (Binary.ResolveOperator): for
20038         operator==(object,object) and operator !=(object, object) we also
20039         have to verify that there is an implicit conversion from one to
20040         the other.
20041
20042         (ArrayAccess.DoResolve): Array Access can operate on
20043         non-variables. 
20044
20045 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
20046
20047         * assign.cs (CompoundAssign): A new class used as a "flag" that
20048         the assignment actually is happening as part of a compound
20049         assignment operator.
20050
20051         During compound assignment, a few new rules exist to enable things
20052         like:
20053
20054         byte b |= 1 + 2
20055
20056         From the spec:
20057
20058         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
20059         to the type of x) if y is implicitly convertible to the type of x,
20060         and the operator is a builtin operator and the return type of the
20061         operator is explicitly convertible to the type of x. 
20062
20063         * rootcontext.cs: Reset warning level to 2.  4 catches various
20064         "interesting" features in mcs, we must clean this up at some
20065         point, but currently am trying to kill other bugs ;-)
20066
20067         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
20068         in container classes as well.  
20069
20070         * expression.cs (Binary.ResolveOperator): Handle string case
20071         before anything else (as operator overloading does emit an error
20072         before doing anything else).
20073
20074         This code could go away when we move to a table driven model, but
20075         i could not come up with a good plan last night.
20076
20077 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
20078
20079         * typemanager.cs (CSharpName): reimplementation using regex.
20080         * class.cs: added null check for fields in Emit
20081         * rootcontext.cs: set warninglevel to 4
20082
20083 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
20084
20085         * typemanager.cs (CSharpName): reimplemented with Lupus
20086         suggestion.
20087
20088 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
20089
20090         * statement.cs (If): correclty implement Resolve, because we were
20091         not catching sem errors in there.  The same process is needed
20092         everywhere else. 
20093         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
20094
20095
20096         (Statement.Warning_DeadCodeFound): Factorize code.
20097         (While): Report dead code here too.
20098
20099         (Statement): Added Resolve virtual method to allow
20100         for resolution split from the emit code.
20101
20102 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20103
20104         * statement.cs (EmitBoolExpression): No longer try to resolve the
20105         expression here.    
20106         (MakeBoolean): New utility function that resolve, implicitly
20107         converts to boolean and tags the expression. 
20108
20109
20110         (If, Do): Implement dead code elimination.
20111         (While): Implement loop inversion
20112
20113         (Do, While, For, If): Resolve the expression prior to calling our
20114         code generation.
20115
20116 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20117
20118         * class.cs:
20119           - added method Report28 (warning: program has more than one entry point)
20120           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20121           - modified method Method.Define, the part at the end of the method
20122
20123         * rootcontext.cs: added static public Location EntryPointLocation;
20124           
20125         * ../errors/cs0028.cs : Add test case for the above warning.              
20126
20127         * typemanager.cs:
20128           - modified method CSharpName to allow arrays of primitive type to
20129             be printed nicely (e.g. instead of System.Int32[][] it now prints
20130             int[][])
20131           - added method CSharpSignature: returns the signature of a method
20132             in string format to be used in reporting errors, warnings, etc.
20133
20134         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20135         with String.Empty.
20136
20137 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20138
20139         * delegate.cs (Define): Fix extremely silly bug where I was
20140         setting the type of the 'object' parameter of the BeginInvoke
20141         method to System.IAsyncResult instead of System.Object ;-)
20142
20143 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20144
20145         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20146         here. 
20147
20148         (Constructor.Emit): return if we fail to initialize the
20149         constructor.  Another door closed!  
20150
20151         * expression.cs (New.DoResolve): Improve error message (from -6 to
20152         1501).  Use DeclaredOnly lookup to find the exact constructor.
20153
20154         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20155         loop.  This is useful.
20156
20157         * cs-parser.jay: Adjust the default parameters so that destructors
20158         have the proper signature.
20159
20160 2002-04-26  Martin Baulig  <martin@gnome.org>
20161
20162         * driver.cs (LoadAssembly): If `assembly' contains any characters
20163         which are only valid in path names and not in assembly names
20164         (currently slash, backslash and point), use Assembly.LoadFrom ()
20165         instead of Assembly.Load () on the `assembly' (before iteration
20166         over the link_paths).
20167
20168 2002-04-26  Martin Baulig  <martin@gnome.org>
20169
20170         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20171
20172 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20173
20174         * class.cs (Property): use the new typemanager.MemberLookup
20175
20176         (TypeContainer.MemberLookup): Implement using the
20177         TypeManager.MemberLookup now. 
20178
20179         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20180         and return MemberInfos, so that these can be used without an
20181         EmitContext (what we had before).
20182
20183 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20184
20185         * expression.cs: Fix the case where the argument to params if the
20186         type of the params.  I omitted handling this before.   Fixed
20187
20188 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20189
20190         * driver.cs: Call BootCorlib_PopulateCoreType
20191
20192         * class.cs (Property.CheckBase): Check for properties only, not
20193         for all members. 
20194
20195         * interface.cs: Temporary hack: try/catch around the
20196         CustomAttributeBuilder, because I am getting an exception that I
20197         do not understand.
20198
20199         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20200         types whose definitions are required to be there (attributes are
20201         defined before standard types).
20202
20203         Compute definitions as we boot the various types, as they are used
20204         immediately (value_type class will need object_type, but if we do
20205         not initialize object_type, we will pass a null, which will let
20206         the runtime pick the System.Object from the existing corlib, which
20207         is not what we want).
20208
20209 2002-04-22  Patrik Torstensson <totte@labs2.com>
20210
20211         * cs-tokenizer.cs: fixed a number of trim() issues.
20212
20213 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20214
20215         * expression.cs (Argument.Type): Ensure that we return the correct
20216         type when we have out or ref parameters [in which case we 
20217         append a "&"].
20218
20219 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20220
20221         * class.cs (Property, Indexer): Allow extern modifier in there. 
20222
20223         * typemanager.cs (InitBaseTypes): Initializes object_type and
20224         value_type, since those will be used early on during the bootstrap
20225         process to compile corlib.
20226
20227         (InitCoreTypes): Move code from here to InitBaseTypes.
20228
20229 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20230
20231         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20232         single-dimension arrays as using the ldlen opcode.  
20233
20234         Daniel Lewis discovered this optimization.  
20235
20236         * typemanager.cs: Add signature for System.Array::get_Length
20237
20238 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20239
20240         * statement.cs: report the error when the foreach does not apply to an
20241         array nor a collection.
20242
20243 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20244
20245         * expression.cs: Add implicit conversions to the operator ~.
20246
20247         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20248
20249         * typemanager.cs: Locate the decimal constructor.
20250
20251 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20252
20253         * attribute.cs: use the new property of TypeOf.
20254         * expression.cs: added 'get' property around typearg.
20255
20256         These changes fix a build breaker reported by NickD. Is this the
20257         correct way to fix?  If not, please, revert my changes and make it
20258         work :-).
20259
20260 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20261
20262         * attribute.cs: Add support for typeof in attribute invocations.
20263         I am not sure that this is right though.
20264
20265 2002-04-14  Duncan Mak  <duncan@ximian.com>
20266
20267         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20268         Binary.Operator.Division case.
20269
20270 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20271
20272         * class.cs (DefineType): Ensure that we do a proper check on
20273         attribute types and also register it with the TypeManager.
20274
20275         (TypeContainer.Targets): The default for attribute types is
20276         AttributeTargets.All.
20277
20278         * attribute.cs (ApplyAttributes): Registering the attribute type
20279         is done elsewhere, not when we discover we have a Usage attribute.
20280
20281 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20282
20283         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20284         and get rid of is_delegate parameter.
20285
20286         * everywhere : update.
20287
20288 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20289
20290         * cs-parser.jay (compilation_unit): Revamp completely to use
20291         some new ideas that I got from Rhys' grammar to solve the problems
20292         with assembly level attributes.
20293
20294         (outer_declaration): New grammar production.
20295
20296         (attribute_sections): Add.
20297
20298         (opt_attributes): Base on attribute_sections
20299
20300         (namespace_declaration): Allow opt_attributes to tackle the case
20301         when we have assembly level attributes - we are clever in this
20302         regard now ;-)
20303
20304         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20305         attributes in the non-global context.
20306
20307         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20308         instead of SetGlobalAttributes.
20309
20310         * class.cs, rootcontext.cs : Ensure we define and generate 
20311         attribute types before anything else.
20312
20313         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20314         and flag the new error -20 for the case when the attribute type
20315         does not have valid targets specified. csc does not catch this.
20316
20317         * ../errors/errors.txt : update for error # -20
20318
20319 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20320
20321         * support.cs (InternalParameters.ParameterModifier): Do some null
20322         checking and return sane values.
20323
20324         * class.cs (Method.Define): If we are a PInvoke method, ensure
20325         that we are static and extern. Report error # 601
20326
20327         * ../errors/cs0601.cs : Add test case for the above error.
20328
20329 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20330
20331         * rootcontext.cs (attribute_types): We need to keep type of
20332         all attribute types separately and emit code for them first.
20333
20334         (RegisterAttribute) : Implement.
20335
20336         * class.cs (DefineType): Check if the current Type is a custom
20337         attribute type and register it accordingly.
20338
20339         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20340         adding the first attribute twice and rename to
20341
20342         (SetGlobalAttributes): this.
20343
20344         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20345         lookups.
20346
20347         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20348         if we are processing global arguments. Hmm, I am unsure of this.
20349
20350 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20351
20352         * expression.cs: added static array of strings to avoid calling
20353         Enum.ToString () for Operator in Binary. Significant recover of
20354         performance.
20355
20356 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20357
20358         * class.cs (FindMembers): Allow the Builders of the various
20359         members to be null.  If they are skip them.  This only happens
20360         during the PInvoke declaration.
20361
20362 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20363
20364         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20365         failure, so we do not keep going afterwards.
20366
20367         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20368         wanted to pass `false' as the `is_delegate' argument.  If this is
20369         the case, why not use delegate_type == null to mean `is_delegate =
20370         false' and anything else as is_delegate = true.
20371
20372 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20373
20374         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20375         code for the section, not the beginning of the tests.
20376
20377 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20380
20381         * expression.cs (Binary): same.  Warn about errors where we have
20382         Enum/Enum in operator + as well.
20383
20384 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20385
20386         * statement.cs:
20387                 - added support for switch(bool)
20388                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20389                 - add TableSwitchEmit() to handle table-based switch statements
20390
20391 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20392
20393         * expression.cs (Invocation.OverloadResolve): Factor out code which
20394         does parameter compatibility checking with arguments so that we can 
20395         re-use the code even from Delegate.VerifyApplicability
20396
20397         (VerifyArgumentsCompat): Move above code here.
20398
20399         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20400         and instead make a call to the above method.
20401
20402 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20403
20404         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20405         We use it to keep track of classes which are attribute types.
20406
20407 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * delegate.cs (Delegate.Define): Correctly define the types in the
20410         presence of fixed and array parameters.
20411
20412         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20413         doing FindMembers.
20414
20415         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20416         include NonPublic after the first iteration.
20417
20418         * class.cs (Indexer.CheckBase): Only check if both parents are
20419         non-null. 
20420
20421         * cs-parser.jay (accessor_body): If empty, set to null.
20422
20423         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20424         same code path here to resolve constants names that we did have in
20425         MemberAccess.DoResolve.  There is too much code duplicated here.
20426
20427 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20428
20429         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20430
20431         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20432         to MakeUnionSet.
20433
20434         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20435         tokens, numbers and strings.
20436
20437         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20438         parenthesis.
20439
20440         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20441         asyncronous parameters and the regular parameters.  
20442
20443         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20444         specify the target directory.
20445
20446         * expression.cs: (This.DoResolve): Simplify
20447         (As.Emit): Optimize, do not generate IsInst if the expression is
20448         always of the given type.
20449
20450         (Is.DoResolve): Bug fix, we were reporting both always/never for
20451         the is expression.
20452
20453         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20454         creating too many unnecessary arrays.
20455
20456 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20457
20458         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20459         fields instead of rolling our own initializer.   Takes care of all
20460         implicit conversions, and drops unnecessary static checks/argument.
20461
20462 2002-03-31  Dick Porter  <dick@ximian.com>
20463
20464         * driver.cs: use the GetDirectories() return values properly, and
20465         use "/" as path separator.
20466
20467 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * expression.cs (Unary): Optimize - - expr into expr.
20470         (Binary): Optimize a + (-b) into a -b.
20471
20472         * codegen.cs (CodeGen): Made all methods static.
20473
20474 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20475
20476         * rootcontext.cs: 
20477
20478         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20479         TypeBuilder property.
20480
20481         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20482         instead. 
20483
20484         * tree.cs: Removed the various RecordXXXX, and replaced with a
20485         single RecordDecl.  Removed all the accessor methods, and just
20486         left a single access point Type 
20487
20488         * enum.cs: Rename DefineEnum to DefineType.
20489
20490         * decl.cs: New abstract method `DefineType' used to unify the
20491         Defines for Enumerations, Interfaces, TypeContainers and
20492         Delegates.
20493
20494         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20495         LookupBaseClasses method that used to live in class.cs and
20496         interface.cs here, and renamed to FindType.
20497
20498         * delegate.cs: Implement DefineType.  Take advantage of the
20499         refactored pattern for locating the parent builder without taking
20500         the parent_builder argument (which we know does not work if we are
20501         nested, and triggering a toplevel definition).
20502
20503 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20504
20505         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20506         accessibility of a member has changed during override and report
20507         an error if so.
20508
20509         * class.cs (Method.Define, Property.Define): Only complain on
20510         overrides if the method is private, any other accessibility is
20511         fine (and since we just checked the permission is the same, we are
20512         good to go).
20513
20514         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20515         and elif are processed always.  The other pre-processing
20516         directives are only processed if we are "taking" the path
20517
20518 2002-03-29  Martin Baulig  <martin@gnome.org>
20519
20520         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20521         current location is not Null.
20522
20523         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20524         a separate method so we can profile it.
20525
20526         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20527         `span.Seconds' are just seconds, but no minutes or hours.
20528         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20529
20530 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20531
20532         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20533         Remove the gratuitous set of Final:
20534
20535                                 // If an interface implementation, then we can set Final.
20536                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20537                                     implementing.DeclaringType.IsInterface)
20538                                         flags |= MethodAttributes.Final;
20539
20540         I do not know what I was smoking when I used that.
20541
20542
20543         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20544         step into fixing the name resolution issues for delegates and
20545         unifying the toplevel name resolution.
20546
20547 2002-03-28  Martin Baulig  <martin@gnome.org>
20548
20549         * class.cs (Method.Emit): If we have a symbol writer, call its
20550         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20551         tell it about the current method.
20552
20553         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20554         writer that we're going to emit the first byte of IL code for a new
20555         statement (a new source line).
20556         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20557         EmitContext.Mark() before emitting any code.
20558
20559         * location.cs (SymbolDocument): Return null when we're Null.
20560
20561         * statement.cs (Statement): Moved the `Location loc' variable here.
20562         (Statement.EmitBoolExpression): If we have a symbol writer, call
20563         ec.Mark() before emitting any code to tell it that we're at the
20564         beginning of a new statement.
20565         (StatementExpression): Added `Location' argument to the constructor.
20566         (Block): Added public readonly variable `StartLocation' and public
20567         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20568         (Block): Added constructor which takes a start and end location.
20569         (Block.SetEndLocation): New method. This sets the end location.
20570         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20571         local variables we create.
20572         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20573         each statement and do also mark the begin and end of the block.
20574
20575         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20576         tell it the current lexer.Location, use Location.Null for the end of the
20577         block.
20578         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20579         current block, set its end location using SetEndLocation().
20580         (statement_expression): StatementExpression constructor now takes the
20581         lexer.Location as additional argument.
20582         (for_statement, declare_local_variables): Likewise.
20583         (declare_local_variables): When creating a new implicit block, use the
20584         new Block constructor and pass it the lexer.Location.
20585
20586 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20589         members also on the parent interfaces recursively.
20590
20591 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20592
20593         * report.cs: Use new formats, since Gonzalo finished the missing
20594         bits. 
20595
20596         * expression.cs (Binary.ResolveOperator): added missing operator|
20597         operator& and operator^ for bool/bool.
20598
20599         * cs-parser.jay: CheckDef now takes a Location argument that is
20600         used to report errors more precisly (instead of reporting the end
20601         of a definition, we try to track something which is a lot closer
20602         to the source of the problem).
20603
20604         * cs-tokenizer.cs: Track global token use, so we can properly flag
20605         the use of #define/#undef after the first token has been seen.
20606
20607         Also, rename the reportXXXX to Error_DescriptiveName
20608
20609         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20610         TypeContainer, so that Enum and Interface can use this too.
20611
20612         * class.cs (TypeContainer.LookupInterfaceOrClass,
20613         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20614         `builder' argument.  Typically this was used to pass the parent
20615         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20616         the definition).  
20617
20618         The problem is that a nested class could trigger the definition of
20619         a toplevel class, and the builder would be obviously wrong in that
20620         case. 
20621
20622         So we drop this argument, and we compute dynamically the
20623         TypeBuilder/ModuleBuilder (the correct information was available
20624         to us anyways from DeclSpace.Parent)
20625
20626         * interface.cs (Interface.DefineInterface): Drop builder
20627         parameter cleanup like class.cs
20628
20629         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20630         like class.cs
20631
20632         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20633         values. 
20634
20635         (Try.Emit): Propagate the returns value from the statement.
20636
20637         (Return.Emit): Even if we are leavning 
20638
20639         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20640
20641         * modifiers.cs: Fix the computation of MethodAttributes flags.
20642
20643 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20644
20645         * driver.cs: allow compilation of files that start with '/'.
20646         Add a default case when checking the argument of --target.
20647
20648 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * interface.cs: Implement the same search algorithm for types in
20651         the interface code.
20652
20653         * delegate.cs: Do not allow multiple definition.
20654
20655         * Recovered ChangeLog that got accidentally amputated
20656
20657         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20658
20659         * rootcontext.cs: Load manually enum to allow core classes to
20660         contain enumerations.
20661
20662         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20663         Update to new static methods in TypeManager.
20664
20665         * typemanager.cs (GetMethod, GetConstructor): Use our
20666         implementation of FindMembers to find the members, since during
20667         corlib compilation, the types are TypeBuilders and GetMethod and
20668         GetConstructor do not work.
20669
20670         Make all methods in TypeManager static.
20671
20672         (InitCodeHelpers): Split the functionality from
20673         the InitCodeTypes function.
20674
20675         * driver.cs: Call InitCodeHelpers after we have populated the
20676         types. 
20677
20678         * cs-parser.jay (delegate_declaration): we did not used to compute
20679         the delegate name correctly for void delegates.
20680
20681 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * rootcontext.cs (RootContext): Init the interface_resolve_order
20684         and type_container_resolve_order always.
20685
20686         (ResolveCore, BootstrapCorlib_ResolveClass,
20687         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20688         compiler when compiling with --nostdlib
20689
20690         * class.cs (TypeContainer.DefineType): Check that our parent is
20691         not null.  This test is most important when we are bootstraping
20692         the core types.
20693
20694         * codegen.cs: Split out the symbol writing code.
20695
20696 2002-03-25  Martin Baulig  <martin@gnome.org>
20697
20698         * driver.cs (-g): Made -g an alias for --debug.
20699
20700 2002-03-24  Martin Baulig  <martin@gnome.org>
20701
20702         * codegen.cs (SymbolWriter): New public variable. Returns the
20703         current symbol writer.
20704         (CodeGen): Added `bool want_debugging_support' argument to the
20705          constructor. If true, tell the ModuleBuild that we want debugging
20706         support and ask it for the ISymbolWriter.
20707         (Save): If we have a symbol writer, call it's Close() method after
20708         saving the assembly.
20709
20710         * driver.c (--debug): New command line argument to create a
20711         debugger information file.
20712
20713         * location.cs (SymbolDocument): New public property. Returns an
20714         ISymbolDocumentWriter object for the current source file or null
20715         if we don't have a symbol writer.
20716
20717 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20718
20719         * driver.cs (LoadAssembly): Correctly return when all the paths
20720         have been tried and not before.
20721
20722         * statement.cs (Switch.Emit): return the actual coverage for this
20723         statement (returns/not-returns)
20724
20725         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20726         switch of the statement if we are the last switch section.  That
20727         kills two problems: try/catch problems (we used to emit an empty
20728         nop at the end) and switch statements where all branches would
20729         return. 
20730
20731 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20732
20733         * driver.cs: Add default assemblies (the equivalent to the
20734         Microsoft CSC.RSP file)
20735
20736         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20737         also update tokens_seen and set it to false.
20738
20739         * driver.cs: Implement --recurse for Mike.
20740
20741         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20742         correctly splitting out the paths.
20743
20744 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20745
20746         * interface.cs (Interface.PopulateProperty): Instead of using
20747         `parent' as the declaration space for the set parameters, use
20748         `this' 
20749
20750         * support.cs (InternalParameters): InternalParameters constructor
20751         takes a DeclSpace instead of a TypeContainer.
20752
20753         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20754         types are being initialized, load the address of it before calling
20755         the function.  
20756
20757         (New): Provide a mechanism to disable the generation of local
20758         value type temporaries when the caller will be providing us with
20759         an address to store it.
20760
20761         (ArrayCreation.EmitDynamicInitializers): Use it.
20762
20763 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20764
20765         * expression.cs (Invocation.EmitArguments): Only probe for array
20766         property if there is more than one argument.  Sorry about that.
20767
20768         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20769         empty param arrays.
20770
20771         * class.cs (Method.LabelParameters): Fix incorrect code path that
20772         prevented the `ParamArrayAttribute' from being applied to the
20773         params attribute.
20774
20775 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20776
20777         * support.cs (ReflectionParameters): Correctly compute whether the
20778         last argument is a params array.  Fixes the problem with
20779         string.Split ('a')
20780
20781         * typemanager.cs: Make the assemblies array always be non-null
20782         (empty, but non-null)
20783
20784         * tree.cs (RecordDecl): New function that abstracts the recording
20785         of names.  This reports error 101, and provides a pointer to the
20786         previous declaration.  Fixes a crash in the compiler.
20787
20788         * cs-parser.jay (constructor_declaration): Update to new grammar,
20789         and provide a constructor_body that can be empty.
20790
20791 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20792
20793         * driver.cs: Add support for --resources.
20794
20795         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20796         Make all types for the various array helper methods be integer.
20797
20798         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20799         CheckState to ConvCast.
20800
20801         (ConvCast): Now it takes a `checked' state argument, to avoid
20802         depending on the emit context for the conversion, and just using
20803         the resolve time setting.
20804
20805         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20806         instead of Invocation.EmitArguments.  We do not emit the original
20807         arguments, instead we emit those which have been converted to
20808         unsigned int expressions.
20809
20810         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20811
20812         * codegen.cs: ditto.
20813
20814         * expression.cs (LocalVariableReference): Drop the use of the
20815         Store function that depended on the variable index.
20816
20817         * statement.cs (VariableInfo): Drop the `Idx' property from this
20818         class, as this is not taking into account the indexes for
20819         temporaries tat we generate during the execution, getting the
20820         indexes wrong.
20821
20822         * class.cs: First emit class initializers, then call the parent
20823         constructor. 
20824
20825         * expression.cs (Binary): Fix opcode emision.
20826         (UnaryMutator.EmitCode): Support checked code generation
20827
20828         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20829         matches for events for both the Static and Instance scans,
20830         pointing to the same element.   Fix that.
20831
20832 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * rootcontext.cs (ResolveTree): Always set the
20835         interface_resolve_order, because nested interfaces will be calling
20836         into us.
20837
20838         * class.cs (GetInterfaceOrClass): Track the same resolution
20839         process used by TypeManager.LookupType.  This fixes the nested
20840         type lookups in class declarations (separate path from
20841         LookupType). 
20842
20843         (TypeContainer.DefineType): Also define nested interfaces.
20844         (TypeContainer.RegisterOrder): New public function used to
20845         register the order in which child interfaces need to be closed.
20846
20847         Nested interfaces need to be closed after their parents have been
20848         created. 
20849
20850         * interface.cs (InterfaceAttr): Put all the logic for computing
20851         the interface attribute here. 
20852
20853         (DefineInterface): Register our interface order with the
20854         RootContext or with the TypeContainer depending on the case.
20855
20856 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20857
20858         * cs-parser.jay: rework foreach statement to work with the new
20859         changes to the policy on SimpleNames.
20860
20861         * report.cs: support Stacktrace on warnings as well.
20862
20863         * makefile: drop --unsafe and /unsafe from the compile.
20864
20865 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20866
20867         * ecore.cs (StandardConversionExists): Modify to take an Expression
20868         as the first parameter. Ensure we do null -> reference type conversion
20869         checking.
20870
20871         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20872         temporary Expression objects.
20873
20874 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20875
20876         * interface.cs: workaround bug in method overloading resolution
20877         (there is already a bugzilla bug for it).
20878
20879 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20880
20881         We could also solve this problem by having a separate path for
20882         performing type lookups, instead of DoResolve, we could have a
20883         ResolveType entry point, and only participating pieces of the
20884         production (simplename, deref, array) would implement this. 
20885
20886         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20887         signal SimpleName to only resolve type names and not attempt to
20888         resolve anything else.
20889
20890         * expression.cs (Cast): Set the flag.
20891
20892         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20893
20894         * class.cs: Only report 108 if there is no `new' modifier.
20895
20896         * cs-parser.jay: rework foreach statement to work with the new
20897         changes to the policy on SimpleNames.
20898
20899         * report.cs: support Stacktrace on warnings as well.
20900
20901         * makefile: drop --unsafe and /unsafe from the compile.
20902
20903 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20904
20905         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20906         lookups here, instead of doing that at parse time.  This means
20907         that our grammar will not introduce `LocalVariableReferences' as
20908         expressions at this point.  That solves the problem of code like
20909         this:
20910
20911         class X {
20912            static void Main ()
20913            { int X = 1;
20914             { X x = null }}}
20915
20916         This is only half the fix.  The full fix requires parameters to
20917         also be handled in this way.
20918
20919         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20920         makes the use more obvious of the DeclSpace.  The
20921         ec.TypeContainer.TypeBuilder is now only used to pull the
20922         TypeBuilder for it.
20923
20924         My theory is that I can get rid of the TypeBuilder completely from
20925         the EmitContext, and have typecasts where it is used (from
20926         DeclSpace to where it matters).  
20927
20928         The only pending problem is that the code that implements Aliases
20929         is on TypeContainer, and probably should go in DeclSpace.
20930
20931         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20932         lookups here, instead of doing that at parse time.  This means
20933         that our grammar will not introduce `LocalVariableReferences' as
20934         expressions at this point.  That solves the problem of code like
20935         this:
20936
20937         class X {
20938            static void Main ()
20939            { int X = 1;
20940             { X x = null }}}
20941
20942         This is only half the fix.  The full fix requires parameters to
20943         also be handled in this way.
20944
20945         * class.cs (Property.DefineMethod): When implementing an interface
20946         method, set newslot, when implementing an abstract method, do not
20947         set the flag (before we tried never setting it, or always setting
20948         it, which is the difference).
20949         (Indexer.DefineMethod): same.
20950         (Method.DefineMethod): same.
20951
20952         * ecore.cs: Only set the status used flag if we get back a Field.
20953
20954         * attribute.cs: Temporary hack, so Paolo can keep working.
20955
20956 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20957
20958         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20959         the unmanaged type in the case we have a MarshalAs attribute.
20960
20961         (Resolve): Handle the case when we are parsing the special MarshalAs
20962         attribute [we need to store the unmanaged type to use later]
20963
20964         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20965         MarshalAs Attribute.
20966
20967         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20968         on parameters and accordingly set the marshalling info.
20969
20970 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20971
20972         * class.cs: Optimizing slightly by removing redundant code after
20973         we switched to the `NoTypes' return value.
20974         (Property.DefineMethod): use NoTypes here too.
20975
20976         This fixes the bug I introduced in my last batch of changes.
20977
20978 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20979
20980         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20981
20982         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20983         Enums since those are types too. 
20984
20985         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20986
20987         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20988         thanks to a call during the lookup process.
20989
20990 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20991
20992         * statement.cs (Foreach): Lots of work to accomodate a particular
20993         kind of foreach statement that I had not kept in mind.  It is
20994         possible to have foreachs on classes that provide a GetEnumerator
20995         method that return objects that implement the "pattern" for using
20996         a foreach, there is no need to support GetEnumerator
20997         specifically. 
20998
20999         This is needed to compile nant.
21000
21001         * decl.cs: Only report 114 if the member is not `Finalize' and if
21002         the warning level is at least 2.
21003
21004         * class.cs: Moved the compare function from Method to
21005         MethodSignature. 
21006
21007         (MethodSignature.InheritableMemberSignatureCompare): Add new
21008         filter function that is used to extract inheritable methods from a
21009         class. 
21010
21011         (Method.Define): Use the new `inheritable_method_signature_filter'
21012         delegate
21013
21014         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
21015         command. 
21016
21017 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
21018
21019         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
21020
21021         * cs-parser.jay: Add opt_semicolon to the interface declaration.
21022
21023         * expression.cs: Pass location information to
21024         ConvertImplicitStandard. 
21025
21026         * class.cs: Added debugging code to track return values from
21027         interfaces. 
21028
21029 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
21030
21031         * expression.cs (Is.DoResolve): If either side of the `is' is an
21032         interface, do not flag the warning.
21033
21034         * ecore.cs (ImplicitReferenceConversion): We need a separate test
21035         for interfaces
21036
21037         * report.cs: Allow for --fatal to be used with --probe.
21038
21039         * typemanager.cs (NoTypes): Move the definition for the empty Type
21040         array here. 
21041
21042         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
21043         properties. 
21044         (TypeContainer.DefineProxy): New function used to proxy to parent
21045         implementations when implementing interfaces.
21046         (TypeContainer.ParentImplements): used to lookup if our parent
21047         implements a public function that is required by an interface.
21048         (TypeContainer.VerifyPendingMethods): Hook this up.
21049
21050         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
21051         `modules' and `assemblies' arraylists into arrays.  We only grow
21052         these are the very early start up of the program, so this improves
21053         the speedof LookupType (nicely measured).
21054
21055         * expression.cs (MakeByteBlob): Replaced unsafe code with
21056         BitConverter, as suggested by Paolo.
21057
21058         * cfold.cs (ConstantFold.Binary): Special case: perform constant
21059         folding of string concatenation, but if either side is a string,
21060         and the other is not, then return null, and let the runtime use
21061         the concatenation on the string plus the object (using
21062         `Object.ToString'). 
21063
21064 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
21065
21066         Constant Folding has been implemented now.
21067
21068         * expression.cs (Unary.Reduce): Do not throw an exception, catch
21069         the error instead on types that are not supported in one's
21070         complement. 
21071
21072         * constant.cs (Constant and all children): New set of functions to
21073         perform implict and explicit conversions.
21074
21075         * ecore.cs (EnumConstant): Implement the new functions to perform
21076         conversion by proxying to the child expression.
21077
21078         * codegen.cs: (ConstantCheckState): Constant evaluation has its
21079         own separate setting that can not be turned off from the command
21080         line using --unchecked or --checked and is only controlled using
21081         the checked/unchecked statements and expressions.  This setting is
21082         used by the constant folder to flag errors.
21083
21084         * expression.cs (CheckedExpr, UncheckedExpr): Set the
21085         ConstantCheckState as well.   
21086
21087         During Resolve, they also have to flag the state, because the
21088         constant folder runs completely in the Resolve phase.
21089
21090         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
21091         well.
21092
21093 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21094
21095         * cfold.cs: New file, this file contains the constant folder.
21096
21097         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21098         argument to track whether we are using the resulting address to
21099         load or store a value and provide better error messages. 
21100
21101         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21102         new AddressOf arguments.
21103
21104         * statement.cs (Foreach.EmitCollectionForeach): Update
21105
21106         * expression.cs (Argument.Emit): Call AddressOf with proper
21107         arguments to track usage.
21108
21109         (New.DoEmit): Call AddressOf with new arguments.
21110
21111         (Unary.Emit): Adjust AddressOf call.
21112
21113 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21114
21115         * cs-parser.jay (member_access): Change the case for pre-defined types
21116         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21117         this suggestion.
21118
21119         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21120         a method body.
21121
21122         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21123         essentially like methods and apply attributes like MethodImplOptions to them too.
21124
21125         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21126         not being null.
21127
21128         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21129         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21130         is the DeclSpace.
21131
21132         * Update code everywhere accordingly.
21133
21134         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21135
21136         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21137
21138 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21139
21140         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21141         try performing lookups against those instead of jumping straight into using
21142         the 'using' clauses.
21143
21144         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21145
21146         (LookupType): Perform lookups in implicit parents too.
21147
21148         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21149         sequence as RootContext.LookupType. 
21150
21151         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21152         the various cases of namespace lookups into this method.
21153
21154 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21155
21156         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21157         in positional arguments)
21158
21159         * class.cs (Operator): Update the AllowedModifiers to contain
21160         extern. 
21161
21162         * cs-parser.jay: Update operator declaration to allow for the
21163         operator body to be empty.
21164
21165         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21166         values. 
21167
21168 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21169
21170         * class.cs (Method.Emit): Label parameters.
21171
21172         * driver.cs: Return 1 or 0 as the program exit code.
21173
21174 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21175
21176         * expression.cs: Special case the `null' object when trying to
21177         auto-compute the type, as anything can be explicitly converted to
21178         that. 
21179
21180         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21181         spotting this Paolo.
21182
21183         (Expression.ImplicitNumericConversion): Perform comparissions of
21184         the type using the underlying type in the case of an enumeration
21185         rather than using the enumeration type for the compare.
21186
21187         Cope with the underlying == type case, which is not possible to
21188         catch before. 
21189
21190         (Expression.ConvertNumericExplicit): Perform comparissions of
21191         the type using the underlying type in the case of an enumeration
21192         rather than using the enumeration type for the compare.
21193
21194         * driver.cs: If the user does not supply an extension, assume .exe
21195
21196         * cs-parser.jay (if_statement): Rewrote so that we can track the
21197         location for the if statement.
21198
21199         * expression.cs (Binary.ConstantFold): Only concat strings when
21200         the operation is "+", not everything ;-)
21201
21202         * statement.cs (Statement.EmitBoolExpression): Take a location
21203         argument. 
21204         (If, While, Do): Track location.
21205
21206         * expression.cs (Binary.ResolveOperator): In the object + string
21207         case, I was missing a call to ConvertImplicit
21208
21209 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21210
21211         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21212         Location arguments. Ensure we use RootContext.LookupType to do our work
21213         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21214
21215         * interface.cs (PopulateMethod): Handle the type of the parameter being
21216         null gracefully.
21217
21218         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21219         have a params method with no fixed arguments and a call is made with no
21220         arguments.
21221
21222 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21223
21224         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21225         the verbatim-string-literal
21226
21227         * support.cs (InternalParameters.ParameterModifier): handle null
21228         fixed parameters.
21229         (InternalParameters.ParameterType): ditto.
21230
21231         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21232         duplicating the name of the variable parameter.
21233         (GetParameterByName): Fix bug where we were not looking up array
21234         paramters if they were the only present (thanks Paolo!).
21235         (GetParameterInfo): We only have an empty set of types if both
21236         fixed and array are set to null.
21237         (GetParameterInfo-idx): Handle FixedParameter == null
21238
21239         * cs-parser.jay: Handle the case where there is no catch
21240         statements (missing null test).
21241
21242 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21243
21244         * driver.cs (MainDriver): Be conservative on our command line
21245         handling.
21246
21247         Catch DirectoryNotFoundException when calling GetFiles.
21248
21249         (SplitPathAndPattern): Used to split the input specification into
21250         a path and a pattern that we can feed to Directory.GetFiles.
21251
21252 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21253
21254         * statement.cs (Fixed): Implement the last case of the Fixed
21255         statement (string handling).
21256
21257         * expression.cs (StringPtr): New class used to return a char * to
21258         a string;  Used by the Fixed statement.
21259
21260         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21261
21262         * expression.cs (Binary.ResolveOperator): Remove redundant
21263         MemberLookup pn parent type.
21264         Optimize union call, we do not need a union if the types are the same.
21265         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21266         type.
21267
21268         Specialize the use of MemberLookup everywhere, instead of using
21269         the default settings. 
21270
21271         (StackAlloc): Implement stackalloc keyword.
21272
21273         * cs-parser.jay: Add rule to parse stackalloc.
21274
21275         * driver.cs: Handle /h, /help, /?
21276
21277         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21278         before we supported unsafe code.
21279
21280         * makefile: add --unsafe to the self compilation of mcs.
21281
21282 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21283
21284         * expression.cs (PointerArithmetic): New class that is used to
21285         perform pointer arithmetic.
21286         (Binary.Resolve): Handle pointer arithmetic
21287         Handle pointer comparission.
21288         (ArrayPtr): Utility expression class that is used to take the
21289         address of an array.
21290
21291         (ElementAccess): Implement array access for pointers
21292
21293         * statement.cs (Fixed): Implement fixed statement for arrays, we
21294         are missing one more case before we are done.
21295
21296         * expression.cs (Indirection): Implement EmitAssign and set the
21297         ExprClass to Variable.  This allows pointer dereferences to be
21298         treated as variables, and to have values assigned to them.
21299
21300         * ecore.cs (Expression.StoreFromPtr): New utility function to
21301         store values dereferencing.
21302
21303 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21304
21305         * expression.cs (Binary.ResolveOperator): Ensure that we are
21306         not trying to operate on a void type - this fixes the reported
21307         bug.
21308
21309         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21310         the parent implementation is sealed.
21311
21312         * ../errors/cs0239.cs : Add.
21313
21314         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21315
21316         * typemanager.cs (unverifiable_code_type): Corresponds to 
21317         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21318         which have unsafe code in them.
21319
21320         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21321         unsafe context.
21322
21323 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21324
21325         * cs-tokenizer.cs: Add support for @"litreal strings"
21326
21327         Make tokenizer accept pre-processor directives
21328         on any column (remove the old C-like limitation). 
21329
21330         * rootcontext.cs (EmitCode): Emit any global attributes.
21331         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21332
21333         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21334
21335         * cs-parser.jay: Add support for global attributes.  
21336
21337 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21338
21339         * expression.cs (Indirection): New helper class.  Unary will
21340         create Indirection classes to be able to implement the
21341         IMemoryLocation interface on it.
21342
21343 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21344
21345         * cs-parser.jay (fixed_statement): reference the right statement.
21346
21347         * statement.cs (Fixed.Emit): Finish implementing the fixed
21348         statement for the &x case.
21349
21350 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21351
21352         * class.cs (Property.Define, Method.Define): Remove newslot when
21353         `implementing'.  
21354
21355         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21356         wrong.  NewSlot should only be used if the `new' keyword is present.
21357
21358         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21359         locating our system dir.  Sorry about this.
21360
21361 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21362
21363         * driver.cs (GetSystemDir): Compute correctly the location of our
21364         system assemblies.  I was using the compiler directory instead of
21365         the library directory.
21366
21367 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21368
21369         * expression.cs (BetterFunction): Put back in what Miguel commented out
21370         since it is the correct fix. The problem is elsewhere ;-)
21371
21372         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21373         parameters of the parms method are themselves compatible or not !
21374
21375         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21376         to check that a class implements an interface before saying that an implicit
21377         conversion was allowed. Use ImplementsInterface to do the checking.
21378
21379 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21380
21381         * class.cs (Method.Define): Track whether we are an explicit
21382         implementation or not.  And only call DefineMethodOverride if we
21383         are an explicit implementation.
21384
21385         (Property.DefineMethod): Ditto.
21386
21387 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21388
21389         * expression.cs (BetterFunction): Catch hideous bug which was
21390          preventing us from detecting ambiguous calls due to implicit casts i.e
21391         cs0121.
21392
21393 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21394
21395         * support.cs (Pair): Remove un-needed method.  I figured why I was
21396         getting the error in cs-parser.jay, the variable in a foreach loop
21397         is readonly, and the compiler does not really treat this as a variable.
21398
21399         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21400         instead of EQUALS in grammar.  
21401
21402         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21403
21404         * expression.cs (Unary.DoResolve): Check whether the argument is
21405         managed or not.
21406
21407 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21408
21409         * support.cs: Api for Pair to set a value.  Despite the fact that
21410         the variables are public the MS C# compiler refuses to compile
21411         code that accesses the field if the variable is part of a foreach
21412         statement. 
21413
21414         * statement.cs (Fixed): Begin implementation of the fixed
21415         statement.
21416
21417         (Block.AddVariable): Return the VariableInfo on success and null
21418         on failure instead of true/false. 
21419
21420         * cs-parser.jay (foreach): Catch errors on variables already
21421         defined (we were ignoring this value before) and properly unwind
21422         the block hierarchy
21423
21424         (fixed_statement): grammar for the fixed statement.
21425
21426 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21429         pointer types to be incretemented.
21430
21431         (SizeOf): Implement.
21432
21433         * cs-parser.jay (pointer_member_access): Implement
21434         expr->IDENTIFIER production.
21435
21436         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21437         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21438         on safe contexts.
21439
21440         (Unary): Implement indirection.
21441
21442         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21443         use in non-unsafe context).
21444
21445         (SimpleName.DoResolve): Check for pointers in field access on safe
21446         contexts. 
21447
21448         (Expression.LoadFromPtr): Factor the load-indirect code in this
21449         function.  This was duplicated in UnboxCast and ParameterReference
21450
21451 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * expression.cs (ComposedCast): report an error if a pointer cast
21454         is used in a safe region.
21455
21456         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21457         pointer type casts in unsafe context.
21458
21459         * codegen.cs (EmitContext): Set up IsUnsafe.
21460
21461         * cs-parser.jay (non_expression_type): Add productions for pointer
21462         casts. 
21463
21464         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21465         code.  We should not use force into static mode if the method is
21466         not virtual.  Fixes bug in MIS
21467
21468         * statement.cs (Do.Emit, While.Emit, For.Emit,
21469         Statement.EmitBoolExpression): Add support to Do and While to
21470         propagate infinite loop as `I do return' semantics.
21471
21472         Improve the For case to also test for boolean constants.
21473
21474         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21475         to the list of attributes we can add.
21476
21477         Remove `EmitContext' argument.
21478
21479         * class.cs (Method.Define): Apply parameter attributes.
21480         (Constructor.Define): Apply parameter attributes.
21481         (MethodCore.LabelParameters): Move here the core of labeling
21482         parameters. 
21483
21484         * support.cs (ReflectionParameters.ParameterModifier,
21485         InternalParameters.ParameterModifier): Use IsByRef on the type and
21486         only return the OUT bit for these parameters instead of in/out/ref
21487         flags.
21488
21489         This is because I miss-understood things.  The ParameterInfo.IsIn
21490         and IsOut represent whether the parameter has the [In] and [Out]
21491         attributes set.  
21492
21493 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21494
21495         * ecore.cs (FieldExpr.Emit): Release temporaries.
21496
21497         * assign.cs (LocalTemporary.Release): new function.
21498
21499         * codegen.cs (EmitContext.GetTemporaryStorage,
21500         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21501         temporary storage.  Now we can "put back" localbuilders when we
21502         are done with them
21503
21504 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21505
21506         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21507         need to make a copy of the variable to generate verifiable code.
21508
21509 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21510
21511         * driver.cs: Compute dynamically the system directory.
21512
21513         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21514         Slower, but more generally useful.  Used by the abstract
21515         registering implementation. 
21516
21517         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21518         the rules for the special rule on Type/instances.  First check if
21519         we have the same name, and if so, try that special static path
21520         rather than the instance path.
21521
21522 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21523
21524         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21525         for, while and if.
21526
21527         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21528         Enum, ValueType, Delegate or Array for non-corlib compiles.
21529
21530         * cs-tokenizer.cs: Catch long identifiers (645)
21531
21532         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21533         piece of code.
21534
21535         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21536         fix, we were returning too early, so we were not registering
21537         pending methods from abstract classes.
21538
21539         Do not register pending methods if the class is abstract.
21540
21541         * expression.cs (Conditional.DoResolve): Report circular implicit
21542         conversions when we neecd to compute it for conditional
21543         expressions. 
21544
21545         (Is.DoResolve): If the expression is always of the provided type,
21546         flag warning 183.  If the expression can not ever be of the
21547         provided type flag warning 184.
21548
21549         * class.cs: Catch 169 as well.
21550
21551         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21552         read. 
21553
21554 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21555
21556         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21557
21558 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21559
21560         * interface.cs: (PopulateMethod): Check for pointers being defined
21561         only if the unsafe context is active.
21562         (PopulateProperty): ditto.
21563         (PopulateIndexer): ditto.
21564
21565         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21566         specified.  If pointers are present, make sure that they are
21567         present in an unsafe context.
21568         (Constructor, Constructor.Define): ditto.
21569         (Field, Field.Define): ditto.
21570         (Property, Property.Define): ditto.
21571         (Event, Event.Define): ditto.
21572
21573         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21574         hashtable if there are classes or structs defined.
21575
21576         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21577         code, as the constant resolution moved.
21578
21579         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21580         the metadata, so we can flag error 133. 
21581
21582         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21583         pointer is being declared in an unsafe context.
21584
21585 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21586
21587         * modifiers.cs (Modifiers.Check): Require a Location argument.
21588         Report error 227 for Unsafe use.
21589
21590         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21591
21592         * statement.cs (For.Emit): If the test is null, then report that
21593         we do `return', as we wont reach anything afterwards.
21594
21595         (Switch.SwitchGoverningType): Track the expression that matched
21596         the conversion.
21597
21598         * driver.cs: Allow negative numbers as an error code to flag.
21599
21600         * cs-parser.jay: Handle 1551.
21601
21602         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21603
21604 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21605
21606         * cs-parser.jay: Report 1518 (type declaration can only contain
21607         class, struct, interface, enum or delegate)
21608
21609         (switch_label): Report 1523 (keywords `case' or `default' must
21610         preced code)
21611
21612         (opt_switch_sections): Report 1522 (empty switch)
21613
21614         * driver.cs: Report 1515 (response file specified multiple times)
21615         Report 1516 (Source file specified multiple times).
21616
21617         * expression.cs (Argument.Resolve): Signal 1510
21618
21619         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21620         access not allowed in static code)
21621
21622 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21623
21624         * typemanager.cs (IsPointerType): Utility method which we are going
21625         to need a lot.
21626
21627         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21628         the object type, so we take care of that.
21629
21630         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21631
21632         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21633         added to non-params parameters :-)
21634
21635         * typemanager.cs (CSharpName): Include 'void' type too. 
21636
21637         (void_ptr_type): Include in the set of core types.
21638
21639         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21640         duplicating code.
21641
21642         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21643         an unsafe context.
21644
21645         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21646         completely forgotten about it.
21647
21648 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21649
21650         * cs-parser.jay (pointer_type): Add. This begins our implementation
21651         of parsing rules for unsafe code.
21652
21653         (unsafe_statement): Implement.
21654
21655         (embedded_statement): Modify to include the above.
21656
21657         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21658
21659         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21660         if the current context is an unsafe one.
21661
21662         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21663         are handled differently, we need separate rules for them.
21664
21665         (local_variable_declaration): Update to use local_variable_pointer_type
21666         to allow variable declarations of unmanaged pointer types.
21667
21668         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21669         in unsafe contexts.
21670
21671         * ../errors/cs0214.cs : Add.
21672
21673 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21674
21675         * makefile: remove 'response' file when cleaning.
21676
21677 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21678
21679         * cs-parser.jay: Report 1524.
21680
21681 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21682
21683         * typemanager.cs (RegisterMethod): drop checking if we have
21684         registered this from here
21685
21686 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21687
21688         * class.cs (Method.EmitDestructor): Implement calling our base
21689         destructor. 
21690
21691         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21692         value of InFinally.
21693
21694         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21695         this routine and will wrap the call in a try/catch block.  Deal
21696         with the case.
21697
21698 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21699
21700         * ecore.cs (Expression.MemberLookup): instead of taking a
21701         parameter `same_type' that was used to tell whether we could
21702         access private members we compute our containing type from the
21703         EmitContext.
21704
21705         (FieldExpr): Added partial support for volatile fields.  This does
21706         not work for volatile fields exposed from assemblies, as I can not
21707         figure out how to extract the modreq from it.
21708
21709         Updated all the source files to use this.
21710
21711         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21712         because it is referenced by MemberLookup very often. 
21713
21714 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21715
21716         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21717         TypeBuilder.GetCustomAttributes to retrieve what we need.
21718
21719         Get rid of redundant default_member_attr_type as this is the same as
21720         default_member_type which already exists.
21721
21722         * interface.cs, attribute.cs : Update accordingly.
21723
21724 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21725
21726         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21727         work for TYpeBuilders though.  Ravi, can you please fix this?
21728
21729         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21730
21731         * expression.cs (Argument.Emit): Handle the case of ref objects
21732         being passed to ref functions;  
21733
21734         (ParameterReference.EmitLoad): Loads the content of the pointer
21735         without dereferencing.
21736
21737 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21738
21739         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21740
21741 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21742
21743         * class.cs (Indexer.DefineMethod): Incorporate the interface
21744         type in the name of the method if we are doing explicit interface
21745         implementation.
21746
21747         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21748
21749         (BetterConversion): Fix extremely trivial bug where we were referring to
21750         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21751         again !
21752
21753         * ../errors/bug16.cs : Add although we have fixed it.
21754
21755 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21756
21757         * expression.cs (BaseIndexer): Begin implementation.
21758
21759         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21760
21761         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21762         production directly to remove a shift/reduce, and implement
21763         explicit interface implementation.
21764
21765         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21766         after a floating point suffix.
21767
21768         * expression.cs (DoNumericPromotions): Improved the conversion for
21769         uint/uint.  If we have a constant, we avoid doing a typecast to a
21770         larger type.
21771
21772         * class.cs (Indexer): Implement explicit interface implementation
21773         for indexers.
21774
21775 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21776
21777         * class.cs: make the default instance constructor public and hidebysig.
21778
21779 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21780
21781         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21782         so we can call it from elsewhere.
21783
21784         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21785         we emit it internally if the class has a defined indexer; otherwise the user
21786         emits it by decorating the class definition with the DefaultMemberAttribute.
21787
21788         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21789         attribute is not used on a type which defines an indexer.
21790
21791         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21792         character when we skip whitespace.
21793
21794         * ../errors/cs0646.cs : Add.
21795
21796 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21797
21798         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21799         again. 
21800
21801         * makefile: Add practical target `mcs3.exe' which builds the third
21802         generation compiler. 
21803
21804         * expression.cs (New): Fix structures constructor calling.
21805
21806         * class.cs (Property, Method, Indexer): Emit Final flag on the
21807         method if we are an interface implementation and we are not
21808         abstract. 
21809
21810         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21811         whether this property is referencing a `base' method.
21812
21813         * expression.cs (Invocation.EmitCall): take an extra argument:
21814         is_base, this is used to determine whether the `call' or
21815         `callvirt' opcode should be used.
21816
21817
21818         * delegate.cs: update EmitCall.
21819
21820         * class.cs (Method.Define): Set NewSlot for the cases where we are
21821         not implementing an interface method.
21822
21823         (Property.Define): ditto.
21824
21825 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21826
21827         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21828         'r'.  Allows mcs to parse itself fully.
21829
21830 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21831
21832         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21833         of the number of initializers that require the InitializeArray method.
21834
21835         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21836         update the above field where necessary.
21837
21838         (MakeByteBlob): Update accordingly.
21839
21840         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21841         greater than 2.
21842
21843         (EmitDynamicInitializers): Update in accordance with the new optimization.
21844
21845         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21846         same OpCode applies.
21847
21848         * cs-parser.jay : Fix some glaring errors I introduced.
21849
21850 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21851
21852         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21853         so that we can check for name clashes there too.
21854
21855         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21856         for interface indexers.
21857
21858         * interfaces.cs (Define): Emit the default member attribute.
21859
21860         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21861         variable was being referred to while setting the value ;-)
21862
21863 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21864
21865         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21866         byte-by-byte information when we know the data is zero.
21867
21868         Make the block always a multiple of 4, because
21869         DefineInitializedData has a bug.
21870
21871         * assign.cs: Fix, we should assign from the temporary, not from
21872         the source. 
21873
21874         * expression.cs (MakeByteBlob): Fix my incorrect code.
21875
21876 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21877
21878         * typemanager.cs (EnumToUnderlying): This function is used to get
21879         the underlying type from an enumeration, because it does not
21880         always work. 
21881
21882         * constant.cs: Use the I4_S form for values between -128 and 127.
21883
21884         * statement.cs (Block.LookupLabel): Looks up a label.
21885         (Block): Drop support for labeled blocks.
21886
21887         (LabeledStatement): New kind of statement that represents a label
21888         only.
21889
21890         (Goto): Finally implement this bad boy.
21891
21892         * cs-parser.jay: Update to reflect new mechanism to implement
21893         labels.
21894
21895 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21896
21897         * codegen.cs (EmitContext.This): a codegen property that keeps the
21898         a single instance of this instead of creating many different this
21899         instances. 
21900
21901         * delegate.cs (Delegate.DoResolve): Update to use the property;
21902
21903         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21904
21905         * expression.cs (BaseAccess.DoResolve): Ditto.
21906
21907 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21908
21909         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21910         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21911
21912         (InitCoreTypes): Update accordingly.
21913
21914         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21915         so we can quickly store the state.
21916
21917         (ApplyAttributes): Set the correct implementation flags
21918         for InternalCall methods.
21919
21920 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21921
21922         * expression.cs (EmitCall): if a method is not virtual, then do
21923         not use callvirt on it.
21924
21925         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21926         user defined stuff) requires the use of stobj, which takes an
21927         address on the stack instead of an array and an index.  So emit
21928         the Ldelema operation for it.
21929
21930         (EmitStoreOpcode): Use stobj for valuetypes.
21931
21932         (UnaryMutator.EmitCode): Use the right 1 value depending on
21933         whether we are dealing with int64/uint64, float or doubles.
21934
21935         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21936         constructors that I implemented last night.
21937
21938         (Constructor.IsDefault): Fix to work properly for static
21939         constructors.
21940
21941         * cs-parser.jay (CheckDef): report method signature errors.
21942         Update error number 103 to be 132.
21943
21944         * decl.cs: New AdditionResult enumeration value: MethodExists.
21945         Although we do this check for methods later on in the semantic
21946         analysis, catching repeated default constructors is so easy that
21947         we catch these here. 
21948
21949         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21950         promotions code.
21951
21952         (ParameterReference.EmitAssign, Emit): handle
21953         bools as bytes.
21954
21955         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21956         (ArrayAccess.EmitStoreOpcode): ditto.
21957
21958         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21959
21960         * expression.cs (MakeByteBlob): Complete all the missing types
21961         (uint, short, ushort, byte, sbyte)
21962
21963         * class.cs: Only init instance field initializers on instance
21964         constructors. 
21965
21966         Rename `constructors' to instance_constructors. 
21967
21968         (TypeContainer.AddConstructor): Only add constructors to the list
21969         if it is not static.
21970
21971         Make sure that we handle default_static_constructor independently
21972         everywhere where we handle instance_constructors
21973
21974 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21975
21976         * class.cs: Do not lookup or create a base initializer for a
21977         static constructor.
21978
21979         (ConstructorInitializer.Resolve): use the proper type to lookup
21980         for constructors.
21981
21982         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21983
21984         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21985         in DeclSpace. 
21986
21987         * decl.cs: CloseType is now an virtual method, the default
21988         implementation just closes this type.
21989
21990 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21991
21992         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21993         to PreserveSig by default. Also emit HideBySig on such methods.
21994
21995         Basically, set the defaults to standard values.
21996
21997         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21998         argument, if candidate is better, it can't be worse than the best !
21999
22000         (Invocation): Re-write bits to differentiate between methods being
22001         applicable in their expanded form and their normal form - for params
22002         methods of course.
22003
22004         Get rid of use_standard everywhere as only standard conversions are allowed
22005         in overload resolution. 
22006
22007         More spec conformance.
22008
22009 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22010
22011         * driver.cs: Add --timestamp, to see where the compiler spends
22012         most of its time.
22013
22014         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
22015         `this' in static code.
22016
22017         (SimpleName.DoResolve): Implement in terms of a helper function
22018         that allows static-references to be passed upstream to
22019         MemberAccess.
22020
22021         (Expression.ResolveWithSimpleName): Resolve specially simple
22022         names when called by MemberAccess to implement the special
22023         semantics. 
22024
22025         (Expression.ImplicitReferenceConversion): Handle conversions from
22026         Null to reference types before others, as Null's type is
22027         System.Object. 
22028
22029         * expression.cs (Invocation.EmitCall): Handle the special case of
22030         calling methods declared on a reference type from a ValueType
22031         (Base classes System.Object and System.Enum)
22032
22033         (MemberAccess.Resolve): Only perform lookups on Enumerations if
22034         the left hand side is a TypeExpr, not on every enumeration. 
22035
22036         (Binary.Resolve): If types are reference types, then do a cast to
22037         object on operators != and == of both arguments.
22038
22039         * typemanager.cs (FindMembers): Extract instance and static
22040         members if requested.
22041
22042         * interface.cs (PopulateProperty): Use void_type instead of null
22043         as the return type for the setter method.
22044
22045         (PopulateIndexer): ditto.
22046
22047 2001-12-27  Ravi Pratap  <ravi@ximian.com>
22048
22049         * support.cs (ReflectionParameters): Fix minor bug where we
22050         were examining the wrong parameter for the ParamArray attribute.
22051
22052         Cope with requests for the type of the parameter at position
22053         greater than the params parameter's. We now return the element
22054         type of the params array as that makes more sense.
22055
22056         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
22057         accordingly as we no longer have to extract the element type
22058         ourselves.
22059
22060         (Invocation.OverloadResolve): Update.
22061
22062 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
22063
22064         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
22065         against IEnumerator, test whether the return value is a descendant
22066         of the IEnumerator interface.
22067
22068         * class.cs (Indexer.Define): Use an auxiliary method to implement
22069         the other bits of the method definition.  Begin support for
22070         explicit interface implementation.
22071
22072         (Property.DefineMethod): Use TypeManager.void_type instead of null
22073         for an empty return value.
22074
22075 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
22076
22077         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
22078         dealing with a FieldExpr which is composed of a FieldBuilder, in
22079         the code path we did extract the constant, but we should have
22080         obtained the underlying value to be able to cast it (otherwise we
22081         end up in an infinite loop, this is what Ravi was running into).
22082
22083         (ArrayCreation.UpdateIndices): Arrays might be empty.
22084
22085         (MemberAccess.ResolveMemberAccess): Add support for section
22086         14.5.4.1 that deals with the special case of E.I when E is a type
22087         and something else, that I can be a reference to a static member.
22088
22089         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
22090         handle a particular array type to create byte blobs, it is just
22091         something we dont generate byteblobs for.
22092
22093         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
22094         arguments. 
22095
22096         * location.cs (Push): remove the key from the hashtable that we
22097         are about to add.   This happens for empty files.
22098
22099         * driver.cs: Dispose files after we have parsed them.
22100
22101         (tokenize): new function that only runs the tokenizer on its
22102         input, for speed testing.
22103
22104 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22105
22106         * class.cs (Event.Define): Define the private field only if there
22107         are no accessors defined.
22108
22109         * expression.cs (ResolveMemberAccess): If there is no associated
22110         field with the event, that means we have an event defined with its
22111         own accessors and we should flag error cs0070 since transforming
22112         ourselves into a field is not valid in that case.
22113
22114         * ecore.cs (SimpleName.DoResolve): Same as above.
22115
22116         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22117         and charset to sane values.
22118
22119 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22120
22121         * assign.cs (DoResolve): Perform check on events only if they 
22122         are being accessed outside the declaring type.
22123
22124         * cs-parser.jay (event_declarations): Update rules to correctly
22125         set the type of the implicit parameter etc.
22126
22127         (add_accessor, remove_accessor): Set current local parameters.
22128
22129         * expression.cs (Binary): For delegate addition and subtraction,
22130         cast the return value from the method into the appropriate delegate
22131         type.
22132
22133 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22134
22135         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22136         of these as the workaround is unnecessary.
22137
22138         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22139         delegate data - none of that is needed at all.
22140
22141         Re-write bits to extract the instance expression and the delegate method
22142         correctly.
22143
22144         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22145         on delegates too.
22146
22147         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22148         of attaching attributes instead of duplicating code everywhere.
22149
22150         * everywhere : Update code to do attribute emission using the above method.
22151
22152 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22153
22154         * expression.cs (IsParamsMethodApplicable): if there are not
22155         parameters, return immediately.
22156
22157         * ecore.cs: The 0 literal can be implicity converted to an enum
22158         type. 
22159
22160         (SimpleName.DoResolve): First lookup the type, then lookup the
22161         members. 
22162
22163         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22164         want to get its address.  If the InstanceExpression is not
22165         addressable, store the result in a temporary variable, then get
22166         the address of it.
22167
22168         * codegen.cs: Only display 219 errors on warning level or above. 
22169
22170         * expression.cs (ArrayAccess): Make it implement the
22171         IMemoryLocation interface.
22172
22173         (Binary.DoResolve): handle the operator == (object a, object b)
22174         and operator != (object a, object b) without incurring into a
22175         BoxedCast (because 5 != o should never be performed).
22176
22177         Handle binary enumerator operators.
22178
22179         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22180         value type, otherwise use Ldelem_ref.
22181
22182         Use precomputed names;
22183
22184         (AddressOf): Implement address of
22185
22186         * cs-parser.jay (labeled_statement): Fix recursive block
22187         addition by reworking the production.
22188
22189         * expression.cs (New.DoEmit): New has a special case:
22190                 
22191                  If we are dealing with a ValueType, we have a few
22192                  situations to deal with:
22193                 
22194                     * The target of New is a ValueType variable, that is
22195                       easy, we just pass this as the variable reference
22196                 
22197                     * The target of New is being passed as an argument,
22198                       to a boxing operation or a function that takes a
22199                       ValueType.
22200                 
22201                       In this case, we need to create a temporary variable
22202                       that is the argument of New.
22203
22204
22205 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22206
22207         * rootcontext.cs (LookupType): Check that current_type is not null before
22208         going about looking at nested types.
22209
22210         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22211         not implement the IAssignMethod interface any more.
22212
22213         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22214         where we tranform them into FieldExprs if they are being resolved from within
22215         the declaring type.
22216
22217         * ecore.cs (SimpleName.DoResolve): Do the same here.
22218
22219         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22220
22221         * ../errors/bug10.cs : Add.
22222
22223         * ../errors/cs0070.cs : Add.
22224
22225         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22226
22227         * assign.cs : Get rid of EventIsLocal everywhere.
22228
22229 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22230
22231         * ecore.cs (ConvertIntLiteral): finished the implementation.
22232
22233         * statement.cs (SwitchLabel): Convert the value we are using as a
22234         key before looking up the table.
22235
22236 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22237
22238         * codegen.cs (EmitTopBlock): Require a Location argument now.
22239
22240         * cs-parser.jay (constructor_declarator): We need to setup
22241         current_local_parameters before we parse the
22242         opt_constructor_initializer, to allow the variables to be bound
22243         to the constructor arguments.
22244
22245         * rootcontext.cs (LookupType): First lookup nested classes in our
22246         class and our parents before we go looking outside our class.
22247
22248         * expression.cs (ConstantFold): Extract/debox the values at the
22249         beginnning. 
22250
22251         * rootcontext.cs (EmitCode): Resolve the constants first before we
22252         resolve the types.  This is not really needed, but it helps debugging.
22253
22254         * statement.cs: report location.
22255
22256         * cs-parser.jay: pass location to throw statement.
22257
22258         * driver.cs: Small bug fix.
22259
22260         * report.cs: Updated format to be 4-zero filled digits.
22261
22262 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22263
22264         * expression.cs (CheckIndices): Fix minor bug where the wrong
22265         variable was being referred to ;-)
22266
22267         (DoEmit): Do not call EmitStaticInitializers when the 
22268         underlying type is System.Object.
22269
22270 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22271
22272         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22273         and do the usual workaround for SRE.
22274
22275         * class.cs (MyEventBuilder.EventType): New member to get at the type
22276         of the event, quickly.
22277
22278         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22279
22280         * assign.cs (Assign.DoResolve): Handle the case when the target
22281         is an EventExpr and perform the necessary checks.
22282
22283         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22284         interface.
22285
22286         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22287
22288         (EventExpr): Set the type in the constructor itself since we 
22289         are meant to be born fully resolved.
22290
22291         (EventExpr.Define): Revert code I wrote earlier.
22292                 
22293         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22294         instance expression is null. The instance expression is a This in that case
22295         or a null, depending on whether it is a static method or not.
22296
22297         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22298         refers to more than one method.
22299
22300         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22301         and accordingly flag errors.
22302
22303 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22304
22305         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22306
22307 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22308
22309         * location.cs (ToString): Provide useful rutine.
22310
22311 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22312
22313         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22314         objects, return the actual integral boxed.
22315
22316         * statement.cs (SwitchLabel): define an ILLabel for each
22317         SwitchLabel. 
22318
22319         (Switch.CheckSwitch): If the value is a Literal, extract
22320         the underlying literal.
22321
22322         Also in the unused hashtable we had, add the SwitchLabel so we can
22323         quickly look this value up.
22324
22325         * constant.cs: Implement a bunch of new constants.  Rewrite
22326         Literal based on this.  Made changes everywhere to adapt to this.
22327
22328         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22329         dereferencing array only once, and also copes with enumrations.
22330
22331         bytes are two bytes wide, not one.
22332
22333         (Cast): Perform constant conversions.
22334
22335         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22336         wrappers to the literals here.
22337
22338         * expression.cs (DoNumericPromotions): long literals can converted
22339         to ulong implicity (this is taken care of elsewhere, but I was
22340         missing this spot).
22341
22342         * ecore.cs (Expression.Literalize): Make the return type Literal,
22343         to improve type checking.
22344
22345         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22346
22347 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22348
22349         * literal.cs: Revert code from ravi that checked the bounds.  The
22350         bounds are sane by the definition of the type itself. 
22351
22352         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22353         need to actually look up in our parent hierarchy for interfaces
22354         implemented. 
22355
22356         * const.cs: Use the underlying type for enumerations
22357
22358         * delegate.cs: Compute the basename for the delegate creation,
22359         that should fix the delegate test case, and restore the correct
22360         Type Lookup semantics in rootcontext
22361
22362         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22363         referencing a nested type with the Reflection API is using the "+"
22364         sign. 
22365
22366         * cs-parser.jay: Do not require EOF token at the end.
22367
22368 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22369
22370         * rootcontext.cs (LookupType): Concatenate type names with
22371         a '.' instead of a '+' The test suite passes again.
22372
22373         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22374         field of the enumeration.
22375
22376         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22377         the case when the member is an EventExpr.
22378
22379         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22380         static has an associated instance expression.
22381
22382         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22383
22384         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22385
22386         * class.cs (Event.Define): Register event and perform appropriate checks
22387         for error #111.
22388
22389         We define the Add and Remove methods even if the use provides none because
22390         in that case, we provide default implementations ourselves.
22391
22392         Define a private field of the type of the event. This is done by the CSC compiler
22393         and we should be doing it too ;-)
22394
22395         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22396         More methods we use in code we generate.
22397
22398         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22399         is important.
22400
22401         (InitCoreTypes): Update accordingly for the above.
22402
22403         * class.cs (Event.Emit): Generate code for default accessors that we provide
22404
22405         (EmitDefaultMethod): Do the job in the above.
22406
22407         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22408         appropriate place.
22409
22410 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22413         builders even if we were missing one.
22414
22415         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22416         pass the Basename as our class name instead of the Name.  The
22417         basename will be correctly composed for us.
22418
22419         * parameter.cs (Paramters): Now takes a Location argument.
22420
22421         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22422         make all the code call directly LookupType in RootContext and take
22423         this chance to pass the Location information everywhere.
22424
22425         * Everywhere: pass Location information.
22426
22427 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22428
22429         * class.cs (Constructor.Define): Updated way of detecting the
22430         length of the parameters.
22431
22432         (TypeContainer.DefineType): Use basename as the type name for
22433         nested types.
22434
22435         (TypeContainer.Define): Do not recursively define types here, as
22436         definition is taken care in order by the RootContext.
22437
22438         * tree.cs: Keep track of namespaces in a per-file basis.
22439
22440         * parameter.cs (Parameter.ComputeSignature): Update to use
22441         DeclSpace. 
22442
22443         (Parameters.GetSignature): ditto.
22444
22445         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22446         instead of a TypeContainer.
22447
22448         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22449         resolve names.  Because we need to be resolve in our context, not
22450         our parents.
22451
22452         * driver.cs: Implement response files.
22453
22454         * class.cs (TypeContainer.DefineType): If we are defined, do not
22455         redefine ourselves.
22456
22457         (Event.Emit): Emit the code for add/remove handlers.
22458         (Event.Define): Save the MethodBuilders for add/remove.
22459
22460         * typemanager.cs: Use pair here too.
22461
22462         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22463         DictionaryEntry requires the first argument to be non-null.  
22464
22465         (enum_declaration): Compute full name for registering the
22466         enumeration.
22467
22468         (delegate_declaration): Instead of using
22469         formal_parameter_list, use opt_formal_parameter_list as the list
22470         can be empty.
22471
22472         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22473         (EventParsing): New property that controls whether `add' and
22474         `remove' are returned as tokens or identifiers (for events);
22475
22476 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22477
22478         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22479         use MyEventBuilder only and let it wrap the real builder for us.
22480
22481         (MyEventBuilder): Revamp constructor etc.
22482
22483         Implement all operations that we perform on EventBuilder in precisely the same
22484         way here too.
22485
22486         (FindMembers): Update to use the EventBuilder member.
22487
22488         (Event.Emit): Update accordingly.
22489
22490 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22491
22492         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22493         by calling the appropriate methods.
22494
22495         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22496         useful.
22497
22498         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22499
22500 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22501
22502         * delegate.cs (Delegate.Populate): Check that the return type
22503         and various parameters types are indeed accessible.
22504
22505         * class.cs (Constructor.Define): Same here.
22506
22507         (Field.Define): Ditto.
22508
22509         (Event.Define): Ditto.
22510
22511         (Operator.Define): Check that the underlying Method defined itself
22512         correctly - so it's MethodBuilder should not be null.
22513
22514         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22515         expression happens to be null.
22516
22517         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22518         members but as of now we don't seem to be able to do anything really useful with it.
22519
22520         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22521         not the EventBuilder.
22522
22523 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22524
22525         * cs-tokenizer.cs: Add support for defines.
22526         Add support for #if, #elif, #else, #endif
22527
22528         (eval_var): evaluates a variable.
22529         (eval): stubbed for evaluating functions.
22530
22531         * cs-parser.jay: Pass the defines information
22532
22533         * driver.cs: Add --define command line option.
22534
22535         * decl.cs: Move MemberCore here.
22536
22537         Make it the base class for DeclSpace.  This allows us to catch and
22538         report 108 and 109 for everything now.
22539
22540         * class.cs (TypeContainer.Define): Extract all the members
22541         before populating and emit the warning 108 (new keyword required
22542         to override) instead of having each member implement this.
22543
22544         (MemberCore.Define): New abstract method, we will be using this in
22545         the warning reporting engine in Populate.
22546
22547         (Operator.Define): Adjust to new MemberCore protocol. 
22548
22549         * const.cs (Const): This does not derive from Expression, it is a
22550         temporary object we use to create fields, it is a MemberCore. 
22551
22552         * class.cs (Method.Define): Allow the entry point to be in a
22553         specific class.
22554
22555         * driver.cs: Rewrite the argument handler to clean it up a bit.
22556
22557         * rootcontext.cs: Made it just an auxiliary namespace feature by
22558         making everything static.
22559
22560         * driver.cs: Adapt code to use RootContext type name instead of
22561         instance variable.
22562
22563         * delegate.cs: Remove RootContext argument.
22564
22565         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22566         argument. 
22567
22568         * class.cs (Event.Define): The lookup can fail.
22569
22570         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22571
22572         * expression.cs: Resolve the this instance before invoking the code.
22573
22574 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22575
22576         * cs-parser.jay: Add a production in element_access that allows
22577         the thing to become a "type" reference.  This way we can parse
22578         things like "(string [])" as a type.
22579
22580         Note that this still does not handle the more complex rules of
22581         casts. 
22582
22583
22584         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22585
22586         * ecore.cs: (CopyNewMethods): new utility function used to
22587         assemble the list of methods from running FindMembers.
22588
22589         (MemberLookup): Rework FindMembers so that 
22590
22591 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22592
22593         * class.cs (TypeContainer): Remove Delegates who fail to be
22594         defined.
22595
22596         * delegate.cs (Populate): Verify that we dont get null return
22597         values.   TODO: Check for AsAccessible.
22598
22599         * cs-parser.jay: Use basename to emit error 574 (destructor should
22600         have the same name as container class), not the full name.
22601
22602         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22603         possible representation.  
22604
22605         Also implements integer type suffixes U and L.
22606
22607 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22608
22609         * expression.cs (ArrayCreation.DoResolve): We need to do the
22610         argument resolution *always*.
22611
22612         * decl.cs: Make this hold the namespace.  Hold the root context as
22613         well.
22614         (LookupType): Move here.
22615
22616         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22617
22618         * location.cs (Row, Name): Fixed the code, it was always returning
22619         references to the first file.
22620
22621         * interface.cs: Register properties defined through interfaces.
22622
22623         * driver.cs: Add support for globbing on the command line
22624
22625         * class.cs (Field): Make it derive from MemberCore as well.
22626         (Event): ditto.
22627
22628 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22629
22630         * class.cs (Event::Define): Check that the type of the event is a delegate
22631         type else flag error #66.
22632
22633         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22634         same.
22635
22636         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22637         values of EntryPoint, CharSet etc etc.
22638
22639         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22640
22641         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22642         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22643         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22644         which needs this to do its work.
22645
22646         * ../errors/cs0066.cs : Add.
22647
22648 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22649
22650         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22651         helper functions.
22652
22653         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22654         clears out the parameters field.
22655         (MemberSignatureCompare): Cleanup
22656
22657         (MemberCore): New base class used to share code between MethodCore
22658         and Property.
22659
22660         (RegisterRequiredImplementations) BindingFlags.Public requires
22661         either BindingFlags.Instace or Static.  Use instance here.
22662
22663         (Property): Refactored code to cope better with the full spec.
22664
22665         * parameter.cs (GetParameterInfo): Return an empty array instead
22666         of null on error.
22667
22668         * class.cs (Property): Abstract or extern properties have no bodies.
22669
22670         * parameter.cs (GetParameterInfo): return a zero-sized array.
22671
22672         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22673         method modifier validation to the typecontainer so we can reuse
22674         this on properties.
22675
22676         (MethodCore.ParameterTypes): return an empty sized array of types.
22677
22678         (Property.Define): Test property modifier validity.
22679
22680         Add tests for sealed/override too.
22681
22682         (Method.Emit): abstract or extern methods have no bodies.
22683
22684 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22685
22686         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22687         thing.
22688
22689         (Method::Define, ::Emit): Modify accordingly.
22690
22691         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22692
22693         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22694
22695         * makefile: Pass in /unsafe.
22696
22697 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22698
22699         * class.cs (MakeKey): Kill routine.
22700
22701         * class.cs (TypeContainer.Define): Correctly define explicit
22702         method implementations (they require the full interface name plus
22703         the method name).
22704
22705         * typemanager.cs: Deply the PtrHashtable here and stop using the
22706         lame keys.  Things work so much better.
22707
22708         This of course broke everyone who depended on `RegisterMethod' to
22709         do the `test for existance' test.  This has to be done elsewhere.
22710
22711         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22712         the object stupid Equals method (because, that like fails all over
22713         the place).  We still do not use it.
22714
22715         * class.cs (TypeContainer.SetRequiredInterface,
22716         TypeContainer.RequireMethods): Killed these two routines and moved
22717         all the functionality to RegisterRequiredImplementations.
22718
22719         (TypeContainer.RegisterRequiredImplementations): This routine now
22720         registers all the implementations required in an array for the
22721         interfaces and abstract methods.  We use an array of structures
22722         which can be computed ahead of time to reduce memory usage and we
22723         also assume that lookups are cheap as most classes will not
22724         implement too many interfaces.
22725
22726         We also avoid creating too many MethodSignatures.
22727
22728         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22729         clear the "pending" bit if we find that there are problems with
22730         the declaration.
22731
22732         (TypeContainer.VerifyPendingMethods): Update to report errors of
22733         methods that look like implementations but are not.
22734
22735         (TypeContainer.Define): Add support for explicit interface method
22736         implementation. 
22737
22738 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22739
22740         * typemanager.cs: Keep track of the parameters here instead of
22741         being a feature of the TypeContainer.
22742
22743         * class.cs: Drop the registration of parameters here, as
22744         InterfaceMethods are also interface declarations.
22745
22746         * delegate.cs: Register methods with the TypeManager not only with
22747         the TypeContainer.  This code was buggy.
22748
22749         * interface.cs: Full registation here.
22750
22751 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22752
22753         * expression.cs: Remove reducer for binary expressions, it can not
22754         be done this way.
22755
22756         * const.cs: Put here the code that used to go into constant.cs
22757
22758         * constant.cs: Put here the code for constants, this is a new base
22759         class for Literals.
22760
22761         * literal.cs: Make Literal derive from Constant.
22762
22763 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22764
22765         * statement.cs (Return.Emit): Report error 157 if the user
22766         attempts to return from a finally block.
22767
22768         (Return.Emit): Instead of emitting a return, jump to the end of
22769         the function.
22770
22771         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22772         LocalBuilder to store the result of the function.  ReturnLabel is
22773         the target where we jump.
22774
22775
22776 2001-12-09  Radek Doulik  <rodo@ximian.com>
22777
22778         * cs-parser.jay: remember alias in current namespace
22779
22780         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22781         namespaces
22782
22783         * class.cs (LookupAlias): lookup alias in my_namespace
22784
22785         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22786         aliases hashtable
22787         (LookupAlias): lookup alias in this and if needed in parent
22788         namespaces
22789
22790 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22791
22792         * support.cs: 
22793
22794         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22795         making things static.  I need this to avoid passing the
22796         TypeContainer when calling ParameterType.
22797
22798         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22799         that did string manipulation to compute the type and then call
22800         GetType.  Use Parameter.ParameterType instead.
22801
22802         * cs-tokenizer.cs: Consume the suffix for floating values.
22803
22804         * expression.cs (ParameterReference): figure out whether this is a
22805         reference parameter or not.  Kill an extra variable by computing
22806         the arg_idx during emission.
22807
22808         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22809         function that returns whether a parameter is an out/ref value or not.
22810
22811         (Parameter.ParameterType): The type of the parameter (base,
22812         without ref/out applied).
22813
22814         (Parameter.Resolve): Perform resolution here.
22815         (Parameter.ExternalType): The full type (with ref/out applied).
22816
22817         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22818         support for expressions on the using statement.
22819
22820 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22821
22822         * statement.cs (Using.EmitLocalVariableDecls): Split the
22823         localvariable handling of the using statement.
22824
22825         (Block.EmitMeta): Keep track of variable count across blocks.  We
22826         were reusing slots on separate branches of blocks.
22827
22828         (Try.Emit): Emit the general code block, we were not emitting it. 
22829
22830         Check the type of the declaration to be an IDisposable or
22831         something that can be implicity converted to it. 
22832
22833         Emit conversions if required.
22834
22835         * ecore.cs (EmptyExpression): New utility class.
22836         (Expression.ImplicitConversionExists): New utility function.
22837
22838 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * statement.cs (Using): Implement.
22841
22842         * expression.cs (LocalVariableReference): Support read only variables.
22843
22844         * statement.cs: Remove the explicit emit for the Leave opcode.
22845         (VariableInfo): Add a readonly field.
22846
22847 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22848
22849         * ecore.cs (ConvCast): new class used to encapsulate the various
22850         explicit integer conversions that works in both checked and
22851         unchecked contexts.
22852
22853         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22854         properly generate the overflow opcodes.
22855
22856 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22857
22858         * statement.cs: The correct type for the EmptyExpression is the
22859         element_type, not the variable type.  Ravi pointed this out.
22860
22861 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22862
22863         * class.cs (Method::Define): Handle PInvoke methods specially
22864         by using DefinePInvokeMethod instead of the usual one.
22865
22866         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22867         above to do the task of extracting information and defining the method.
22868
22869 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22870
22871         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22872         of the condition for string type.
22873
22874         (Emit): Move that here. 
22875
22876         (ArrayCreation::CheckIndices): Keep string literals in their expression
22877         form.
22878
22879         (EmitDynamicInitializers): Handle strings appropriately.
22880
22881 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22882
22883         * codegen.cs (EmitContext): Replace multiple variables with a
22884         single pointer to the current Switch statement.
22885
22886         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22887         EmitContext.
22888
22889 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22890
22891         * statement.cs 
22892
22893         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22894         default'.
22895
22896         (Foreach.Emit): Foreach on arrays was not setting
22897         up the loop variables (for break/continue).
22898
22899         (GotoCase): Semi-implented.
22900
22901 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22902
22903         * attribute.cs (CheckAttribute): Handle system attributes by using
22904         Attribute.GetAttributes to examine information we need.
22905
22906         (GetValidPlaces): Same here.
22907
22908         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22909
22910         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22911
22912         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22913
22914         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22915
22916         (Method::Emit): Handle the case when we are a PInvoke method.
22917
22918 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22919
22920         * expression.cs: Use ResolveWithSimpleName on compound names.
22921
22922 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22923
22924         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22925         before trying to reduce it.
22926
22927         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22928
22929         * constant.cs (LookupConstantValue): Implement.
22930
22931         (EmitConstant): Use the above in emitting the constant.
22932
22933         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22934         that are user-defined by doing a LookupConstantValue on them.
22935
22936         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22937         too, like above.
22938
22939 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22940
22941         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22942
22943         (BaseAccess.DoResolve): Implement.
22944
22945         (MemberAccess.DoResolve): Split this routine into a
22946         ResolveMemberAccess routine that can be used independently
22947
22948 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22949
22950         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22951         As that share bits of the implementation.  Is returns a boolean,
22952         while As returns the Type that is being probed.
22953
22954 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22955
22956         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22957         instead of a Literal - much easier.
22958
22959         (EnumInTransit): Remove - utterly useless :-)
22960
22961         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22962
22963         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22964
22965         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22966         chain when we have no associated expression.
22967
22968 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22969
22970         * constant.cs (Define): Use Location while reporting the errror.
22971
22972         Also emit a warning when 'new' is used and there is no inherited
22973         member to hide.
22974
22975         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22976         populated.
22977
22978         (LookupEnumValue): Implement to lookup an enum member's value and define it
22979         if necessary.
22980
22981         (Populate): Re-write accordingly to use the above routine.
22982
22983 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22984
22985         * expression.cs (This): Fix prototype for DoResolveLValue to
22986         override the base class DoResolveLValue.
22987
22988         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22989         declarations) 
22990
22991         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22992         (we need to load the address of the field here).  This fixes
22993         test-22. 
22994
22995         (FieldExpr.DoResolveLValue): Call the DoResolve
22996         function to initialize the Instance expression.
22997
22998         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22999         correctly the GetEnumerator operation on a value type.
23000
23001         * cs-parser.jay: Add more simple parsing error catches.
23002
23003         * statement.cs (Switch): Add support for string switches.
23004         Handle null specially.
23005
23006         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
23007
23008 2001-11-28  Ravi Pratap  <ravi@ximian.com>
23009
23010         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
23011
23012         (declare_local_constant): New helper function.
23013
23014         * statement.cs (AddConstant): Keep a separate record of constants
23015
23016         (IsConstant): Implement to determine if a variable is a constant.
23017
23018         (GetConstantExpression): Implement.
23019
23020         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
23021
23022         * statement.cs (IsVariableDefined): Re-write.
23023
23024 2001-11-27  Ravi Pratap  <ravi@ximian.com>
23025
23026         * class.cs (TypeContainer::FindMembers): Look for constants
23027         in the case when we are looking for MemberTypes.Field
23028
23029         * expression.cs (MemberAccess::DoResolve): Check that in the
23030         case we are a FieldExpr and a Literal, we are not being accessed
23031         by an instance reference.
23032
23033         * cs-parser.jay (local_constant_declaration): Implement.
23034
23035         (declaration_statement): Implement for constant declarations.
23036
23037 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
23038
23039         * statement.cs (Switch): Catch double defaults.
23040
23041         (Switch): More work on the switch() statement
23042         implementation.  It works for integral values now, need to finish
23043         string support.
23044
23045
23046 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23047
23048         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
23049         integer literals into other integer literals.  To be used by
23050         switch. 
23051
23052 2001-11-24  Ravi Pratap  <ravi@ximian.com>
23053
23054         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
23055         some memory.
23056
23057         (EmitDynamicInitializers): Cope with the above since we extract data
23058         directly from ArrayData now.
23059
23060         (ExpectInitializers): Keep track of whether initializers are mandatory
23061         or not.
23062
23063         (Bounds): Make it a hashtable to prevent the same dimension being 
23064         recorded for every element in that dimension.
23065
23066         (EmitDynamicInitializers): Fix bug which prevented the Set array method
23067         from being found.
23068
23069         Also fix bug which was causing the indices to be emitted in the reverse
23070         order.
23071
23072 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
23073
23074         * expression.cs (ArrayCreation): Implement the bits that Ravi left
23075         unfinished.  They do not work, because the underlying code is
23076         sloppy.
23077
23078 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23079
23080         * cs-parser.jay: Remove bogus fixme.
23081
23082         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
23083         on Switch statement.
23084
23085 2001-11-23  Ravi Pratap  <ravi@ximian.com>
23086
23087         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
23088         the same. 
23089
23090         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
23091         parameter. Apparently, any expression is allowed. 
23092
23093         (ValidateInitializers): Update accordingly.
23094
23095         (CheckIndices): Fix some tricky bugs thanks to recursion.
23096
23097         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23098         I was being completely brain-dead.
23099
23100         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23101         and re-write acordingly.
23102
23103         (DelegateInvocation): Re-write accordingly.
23104
23105         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23106
23107         (MakeByteBlob): Handle types more correctly.
23108
23109         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23110         initialization from expressions but it is incomplete because I am a complete
23111         Dodo :-|
23112
23113 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23114
23115         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23116         on If.  Basically, we have to return `true' (ie, we do return to
23117         our caller) only if both branches of the if return.
23118
23119         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23120         short-circuit operators, handle them as short circuit operators. 
23121
23122         (Cast.DoResolve): Resolve type.
23123         (Cast.Cast): Take an expression as the target type.
23124
23125         * cs-parser.jay (cast_expression): Remove old hack that only
23126         allowed a limited set of types to be handled.  Now we take a
23127         unary_expression and we resolve to a type during semantic
23128         analysis.
23129
23130         Use the grammar productions from Rhys to handle casts (this is
23131         not complete like Rhys syntax yet, we fail to handle that corner
23132         case that C# has regarding (-x), but we will get there.
23133
23134 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23135
23136         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23137         field which is an array type.
23138
23139         * cs-parser.jay (declare_local_variables): Support array initialization too.
23140
23141         * typemanager.cs (MakeKey): Implement.
23142
23143         (everywhere): Use the above appropriately.
23144
23145         * cs-parser.jay (for_statement): Update for array initialization while
23146         declaring variables.
23147
23148         * ecore.cs : The error message was correct, it's the variable's names that
23149         were misleading ;-) Make the code more readable.
23150
23151         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23152         the correct type etc.
23153
23154         (ConvertExplicit): Handle Enum types by examining the underlying type.
23155
23156 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23157
23158         * parameter.cs (GetCallingConvention): Always return
23159         CallingConventions.Standard for now.
23160
23161 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23162
23163         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23164         and `r' after calling DoNumericPromotions.
23165
23166         * ecore.cs: Fix error message (the types were in the wrong order).
23167
23168         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23169         BindingFlags.Instance as well 
23170
23171         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23172         implicit int literal conversion in an empty cast so that we
23173         propagate the right type upstream.
23174
23175         (UnboxCast): new class used to unbox value types.
23176         (Expression.ConvertExplicit): Add explicit type conversions done
23177         by unboxing.
23178
23179         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23180         the target type before applying the implicit LongLiterals to ULong
23181         literal cast.
23182
23183 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23184
23185         * cs-parser.jay (for_statement): Reworked the way For works: now
23186         we declare manually any variables that are introduced in
23187         for_initializer to solve the problem of having out-of-band code
23188         emition (that is what got for broken).
23189
23190         (declaration_statement): Perform the actual variable declaration
23191         that used to be done in local_variable_declaration here.
23192
23193         (local_variable_declaration): Do not declare anything, just pass
23194         the information on a DictionaryEntry
23195
23196 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23197
23198         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23199         re-write of the logic to now make it recursive.
23200
23201         (UpdateIndices): Re-write accordingly.
23202
23203         Store element data in a separate ArrayData list in the above methods.
23204
23205         (MakeByteBlob): Implement to dump the array data into a byte array.
23206
23207 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23208
23209         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23210         into CheckIndices.
23211
23212         * constant.cs (Define): Implement.
23213
23214         (EmitConstant): Re-write fully.
23215
23216         Pass in location info.
23217
23218         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23219         respectively.
23220
23221         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23222         DictionaryEntry since we need location info too.
23223
23224         (constant_declaration): Update accordingly.
23225
23226         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23227         code into another method : UpdateIndices.
23228
23229 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23230
23231         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23232         some type checking etc.
23233
23234 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23235
23236         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23237         bits to provide dimension info if the user skips doing that.
23238
23239         Update second constructor to store the rank correctly.
23240
23241 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23242
23243         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23244         and try to implement.
23245
23246         * ../errors/cs0150.cs : Add.
23247
23248         * ../errors/cs0178.cs : Add.
23249
23250 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23251
23252         * statement.cs: Implement foreach on multi-dimensional arrays. 
23253
23254         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23255         name of the params argument.
23256
23257         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23258         initializing the array.
23259
23260         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23261         we can use this elsewhere.
23262
23263         * statement.cs: Finish implementation of foreach for single
23264         dimension arrays.
23265
23266         * cs-parser.jay: Use an out-of-band stack to pass information
23267         around, I wonder why I need this.
23268
23269         foreach_block: Make the new foreach_block the current_block.
23270
23271         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23272         function used to return a static Parameters structure.  Used for
23273         empty parameters, as those are created very frequently.
23274
23275         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23276
23277 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23278
23279         * interface.cs : Default modifier is private, not public. The
23280         make verify test passes again.
23281
23282 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23283
23284         * support.cs (ReflectionParameters): Fix logic to determine
23285         whether the last parameter is a params one. Test 9 passes again.
23286
23287         * delegate.cs (Populate): Register the builders we define with
23288         RegisterParameterForBuilder. Test 19 passes again.
23289
23290         * cs-parser.jay (property_declaration): Reference $6 instead
23291         of $$ to get at the location.
23292
23293         (indexer_declaration): Similar stuff.
23294
23295         (attribute): Ditto.
23296
23297         * class.cs (Property): Register parameters for the Get and Set methods
23298         if they exist. Test 23 passes again.
23299
23300         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23301         call to EmitArguments as we are sure there aren't any params arguments. 
23302         Test 32 passes again.
23303
23304         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23305         IndexOutOfRangeException. 
23306
23307         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23308         Test 33 now passes again.
23309
23310 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23311
23312         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23313         broke a bunch of things.  Will have to come up with a better way
23314         of tracking locations.
23315
23316         * statement.cs: Implemented foreach for single dimension arrays.
23317
23318 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23319
23320         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23321         an error.  This removes the lookup from the critical path.
23322
23323         * cs-parser.jay: Removed use of temporary_loc, which is completely
23324         broken. 
23325
23326 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23327
23328         * support.cs (ReflectionParameters.ParameterModifier): Report
23329         whether the argument is a PARAMS argument or not.
23330
23331         * class.cs: Set the attribute `ParamArrayAttribute' on the
23332         parameter argument.
23333
23334         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23335         and cons_param_array_attribute (ConstructorInfo for
23336         ParamArrayAttribute)., 
23337
23338         * codegen.cs: Emit the return using the `Return' statement, that
23339         way we can report the error correctly for missing return values. 
23340
23341         * class.cs (Method.Emit): Clean up.
23342
23343         * expression.cs (Argument.Resolve): Take another argument: the
23344         location where this argument is used.  Notice that this is not
23345         part of the "Argument" class as to reduce the size of the
23346         structure (we know the approximate location anyways).
23347
23348         Test if the argument is a variable-reference, if not, then
23349         complain with a 206.
23350
23351         (Argument.Emit): Emit addresses of variables.
23352
23353         (Argument.FullDesc): Simplify.
23354
23355         (Invocation.DoResolve): Update for Argument.Resolve.
23356
23357         (ElementAccess.DoResolve): ditto.
23358
23359         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23360         method should be virtual, as this method is always virtual.
23361
23362         (NewDelegate.DoResolve): Update for Argument.Resolve.
23363
23364         * class.cs (ConstructorInitializer.DoResolve): ditto.
23365
23366         * attribute.cs (Attribute.Resolve): ditto.
23367
23368 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23369
23370         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23371
23372         * expression.cs (ParameterReference): Drop IStackStorage and implement
23373         IAssignMethod instead. 
23374
23375         (LocalVariableReference): ditto.
23376
23377         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23378         IAssignMethod instead. 
23379
23380 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23381
23382         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23383         enumerations that are used in heavily used structures derive from
23384         byte in a laughable and pathetic attempt to reduce memory usage.
23385         This is the kind of pre-optimzations that you should not do at
23386         home without adult supervision.
23387
23388         * expression.cs (UnaryMutator): New class, used to handle ++ and
23389         -- separatedly from the other unary operators.  Cleans up the
23390         code, and kills the ExpressionStatement dependency in Unary.
23391
23392         (Unary): Removed `method' and `Arguments' from this class, making
23393         it smaller, and moving it all to SimpleCall, so I can reuse this
23394         code in other locations and avoid creating a lot of transient data
23395         strucutres when not required.
23396
23397         * cs-parser.jay: Adjust for new changes.
23398
23399 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23400
23401         * enum.cs (Enum.Populate): If there is a failure during
23402         definition, return
23403
23404         * cs-parser.jay (opt_enum_base): we used to catch type errors
23405         here, but this is really incorrect.  The type error should be
23406         catched during semantic analysis.
23407
23408 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23409
23410         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23411         current_local_parameters as expected since I, in my stupidity, had forgotten
23412         to do this :-)
23413
23414         * attribute.cs (GetValidPlaces): Fix stupid bug.
23415
23416         * class.cs (Method::Emit): Perform check on applicability of attributes.
23417
23418         (Constructor::Emit): Ditto.
23419
23420         (Field::Emit): Ditto.
23421
23422         (Field.Location): Store location information.
23423
23424         (Property, Event, Indexer, Operator): Ditto.
23425
23426         * cs-parser.jay (field_declaration): Pass in location for each field.
23427
23428         * ../errors/cs0592.cs : Add.
23429
23430 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23431
23432         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23433
23434         (InitCoreTypes): Update accordingly.
23435
23436         (RegisterAttrType, LookupAttr): Implement.
23437
23438         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23439         info about the same.
23440
23441         (Resolve): Update to populate the above as necessary.
23442
23443         (Error592): Helper.
23444
23445         (GetValidPlaces): Helper to the above.
23446
23447         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23448
23449         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23450
23451 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23452
23453         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23454
23455         * ../errors/cs0617.cs : Add.
23456
23457 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23458
23459         * enum.cs (Emit): Rename to Populate to be more consistent with what
23460         we expect it to do and when exactly it is called.
23461
23462         * class.cs, rootcontext.cs : Update accordingly.
23463
23464         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23465         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23466
23467         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23468
23469         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23470         of a fieldinfo using the above, when dealing with a FieldBuilder.
23471
23472 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23473
23474         * ../errors/cs0031.cs : Add.
23475
23476         * ../errors/cs1008.cs : Add.
23477
23478         * ../errrors/cs0543.cs : Add.
23479
23480         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23481         enum type.
23482
23483         (FindMembers): Implement.
23484
23485         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23486         enums and delegates too.
23487
23488         (enum_types): Rename to builder_to_enum.
23489
23490         (delegate_types): Rename to builder_to_delegate.
23491
23492         * delegate.cs (FindMembers): Implement.
23493
23494 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23495
23496         * typemanager.cs (IsEnumType): Implement.
23497
23498         * enum.cs (Emit): Re-write parts to account for the underlying type
23499         better and perform checking etc.
23500
23501         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23502         of the underlying type.
23503
23504         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23505         value
23506
23507         * enum.cs (error31): Helper to report error #31.
23508
23509         * cs-parser.jay (enum_declaration): Store location of each member too.
23510
23511         * enum.cs (member_to_location): New hashtable. 
23512
23513         (AddEnumMember): Update location hashtable.
23514
23515         (Emit): Use the location of each member while reporting errors.
23516
23517 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23518
23519         * cs-parser.jay: A for_initializer if is a
23520         local_variable_declaration really ammount to have an implicit
23521         block with the variable declaration and no initializer for for.
23522
23523         * statement.cs (For.Emit): Cope with null initializers.
23524
23525         This fixes the infinite loop on for initializers.
23526
23527 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23528
23529         * enum.cs: More cleanup.
23530
23531         * ecore.cs: Remove dead code.
23532
23533         * class.cs (Property.Emit): More simplification.
23534         (Event.Emit): ditto.
23535
23536         Reworked to have less levels of indentation.
23537
23538 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23539
23540         * class.cs (Property): Emit attributes.
23541
23542         (Field): Ditto.
23543
23544         (Event): Ditto.
23545
23546         (Indexer): Ditto.
23547
23548         (Operator): Ditto.
23549
23550         * enum.cs (Emit): Ditto.
23551
23552         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23553         Enums too.
23554
23555         * class.cs (Field, Event, etc.): Move attribute generation into the
23556         Emit method everywhere.
23557
23558         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23559         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23560         as we had no way of defining nested enums !
23561
23562         * rootcontext.cs : Adjust code accordingly.
23563
23564         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23565
23566 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23567
23568         * expression.cs (EvalConstantExpression): Move into ecore.cs
23569
23570         * enum.cs (Enum): Rename some members and make them public and readonly
23571         according to our convention.
23572
23573         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23574         nothing else.
23575
23576         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23577
23578         (Enum::Emit): Write a simple version for now which doesn't try to compute
23579         expressions. I shall modify this to be more robust in just a while.
23580
23581         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23582
23583         (TypeContainer::CloseType): Create the Enum types too.
23584
23585         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23586
23587         * expression.cs (EvalConstantExpression): Get rid of completely.
23588
23589         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23590         user-defined values and other cases.
23591
23592         (IsValidEnumLiteral): Helper function.
23593
23594         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23595         out there in the case we had a literal FieldExpr.
23596
23597         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23598
23599         (Literalize): Revamp a bit to take two arguments.
23600
23601         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23602
23603 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23604
23605         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23606
23607         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23608
23609         (Resolve): Use the above to ensure we have proper initializers.
23610
23611 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23612
23613         * expression.cs (Expression::EvalConstantExpression): New method to 
23614         evaluate constant expressions.
23615
23616         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23617
23618 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23619
23620         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23621         in an array.
23622
23623         (Binary.ResolveOperator): Handle operator != (object a, object b)
23624         and operator == (object a, object b);
23625
23626         (Binary.DoNumericPromotions): Indicate whether the numeric
23627         promotion was possible.
23628
23629         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23630         Implement.  
23631
23632         Made the ArrayAccess implement interface IAssignMethod instead of
23633         IStackStore as the order in which arguments are passed reflects
23634         this.
23635
23636         * assign.cs: Instead of using expr.ExprClass to select the way of
23637         assinging, probe for the IStackStore/IAssignMethod interfaces.
23638
23639         * typemanager.cs: Load InitializeArray definition.
23640
23641         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23642         static data that can be used to initialize arrays. 
23643
23644 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23645
23646         * expression.cs: Handle operator== and operator!= for booleans.
23647
23648         (Conditioal.Reduce): Implement reducer for the ?: operator.
23649
23650         (Conditional.Resolve): Implement dead code elimination.
23651
23652         (Binary.Resolve): Catch string literals and return a new
23653         concatenated string.
23654
23655         (Unary.Reduce): Implement reduction of unary expressions.
23656
23657         * ecore.cs: Split out the expression core handling here.
23658
23659         (Expression.Reduce): New method used to perform constant folding
23660         and CSE.  This is needed to support constant-expressions. 
23661
23662         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23663         targets, and optimize for !x.
23664
23665 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23666
23667         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23668         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23669         set custom atttributes.
23670
23671         * literal.cs (Literal::GetValue): New abstract method to return the actual
23672         value of the literal, cast as an object.
23673
23674         (*Literal): Implement GetValue method.
23675
23676         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23677         expressions to the arraylist but objects of type Argument.
23678
23679         * class.cs (TypeContainer::Emit): Emit our attributes too.
23680
23681         (Method::Emit, Constructor::Emit): Ditto.
23682
23683         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23684         to be ignoring earlier.
23685
23686 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23687
23688         * attribute.cs (AttributeSection::Define): Implement to do the business
23689         of constructing a CustomAttributeBuilder.
23690
23691         (Attribute): New trivial class. Increases readability of code.  
23692
23693         * cs-parser.jay : Update accordingly.
23694
23695         (positional_argument_list, named_argument_list, named_argument): New rules
23696
23697         (attribute_arguments): Use the above so that we are more correct.
23698
23699 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23700
23701         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23702         to perform all checks for a method with a params parameter.
23703
23704         (Invocation::OverloadResolve): Update to use the above method and therefore
23705         cope correctly with params method invocations.
23706
23707         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23708         params too.
23709
23710         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23711         constructors in our parent too because we can't afford to miss out on 
23712         protected ones ;-)
23713
23714         * attribute.cs (AttributeSection): New name for the class Attribute
23715
23716         Other trivial changes to improve readability.
23717
23718         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23719         use the new class names.
23720
23721 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23722
23723         * class.cs (Method::Define): Complete definition for params types too
23724
23725         (Indexer::Define): Ditto.
23726
23727         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23728         Cope everywhere with a request for info about the array parameter.
23729
23730 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23731
23732         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23733
23734         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23735         local_variable_type to extract the string corresponding to the type.
23736
23737         (local_variable_type): Fixup the action to use the new helper method.
23738
23739         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23740         go.
23741
23742         * expression.cs : Clean out code which uses the above.
23743
23744 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23745
23746         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23747         and bale out if necessary by returning a false.
23748
23749         (RegisterProperty): Ditto.
23750
23751         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23752         and print out appropriate error messages.
23753
23754         * interface.cs (everywhere): Ditto.
23755
23756         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23757         location to constructor.
23758
23759         * class.cs (Property, Event, Indexer): Update accordingly.
23760
23761         * ../errors/cs111.cs : Added.
23762
23763         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23764         of a method, as laid down by the spec.
23765
23766         (Invocation::OverloadResolve): Use the above method.
23767
23768 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23769
23770         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23771         now take a TypeContainer and a Parameters object.
23772
23773         (ParameterData): Modify return type of ParameterModifier method to be 
23774         Parameter.Modifier and not a string.
23775
23776         (ReflectionParameters, InternalParameters): Update accordingly.
23777
23778         * expression.cs (Argument::GetParameterModifier): Same here.
23779
23780         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23781         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23782         symbol in it at all so maybe this is only for now.
23783
23784 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23785
23786         * support.cs (InternalParameters): Constructor now takes an extra argument 
23787         which is the actual Parameters class.
23788
23789         (ParameterDesc): Update to provide info on ref/out modifiers.
23790
23791         * class.cs (everywhere): Update call to InternalParameters to pass in
23792         the second argument too.
23793
23794         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23795         to return the modifier info [ref/out etc]
23796
23797         (InternalParameters, ReflectionParameters): Implement the above.
23798
23799         * expression.cs (Argument::ParameterModifier): Similar function to return
23800         info about the argument's modifiers.
23801
23802         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23803         too.
23804
23805         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23806         a new SetFormalParameters object which we pass to InternalParameters.
23807
23808 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23809
23810         * expression.cs (NewArray): Merge into the ArrayCreation class.
23811
23812 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23813
23814         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23815         NewUserdefinedArray into one as there wasn't much of a use in having
23816         two separate ones.
23817
23818         * expression.cs (Argument): Change field's name to ArgType from Type.
23819
23820         (Type): New readonly property which returns the proper type, taking into 
23821         account ref/out modifiers.
23822
23823         (everywhere): Adjust code accordingly for the above.
23824
23825         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23826         whether we are emitting for a ref or out parameter.
23827
23828         * expression.cs (Argument::Emit): Use the above field to set the state.
23829
23830         (LocalVariableReference::Emit): Update to honour the flag and emit the
23831         right stuff.
23832
23833         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23834
23835         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23836
23837         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23838
23839         (ReflectionParameters, InternalParameters): Implement the above method.
23840
23841         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23842         reporting errors.
23843
23844         (Invocation::FullMethodDesc): Ditto. 
23845
23846 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23847
23848         * cs-parser.jay: Add extra production for the second form of array
23849         creation. 
23850
23851         * expression.cs (ArrayCreation): Update to reflect the above
23852         change. 
23853
23854         * Small changes to prepare for Array initialization.
23855
23856 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23857
23858         * typemanager.cs (ImplementsInterface): interface might be null;
23859         Deal with this problem;
23860
23861         Also, we do store negative hits on the cache (null values), so use
23862         this instead of calling t.GetInterfaces on the type everytime.
23863
23864 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23865
23866         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23867
23868         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23869         split functionality out into different classes.
23870
23871         (New::FormArrayType): Move into NewBuiltinArray.
23872
23873         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23874         quite useless.
23875
23876         (NewBuiltinArray): New class to handle creation of built-in arrays.
23877
23878         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23879         account creation of one-dimensional arrays.
23880
23881         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23882
23883         (NewUserdefinedArray::DoResolve): Implement.
23884
23885         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23886
23887         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23888         we maintain inside the TypeManager. This is necessary to perform lookups on the
23889         module builder.
23890
23891         (LookupType): Update to perform GetType on the module builders too.     
23892
23893         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23894
23895         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23896
23897 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23898
23899         * expression.cs (New::DoResolve): Implement guts of array creation.
23900
23901         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23902
23903 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23904
23905         * expression.cs: Fix bug I introduced lsat night that broke
23906         Delegates. 
23907
23908         (Expression.Resolve): Report a 246 error (can not resolve name)
23909         if we find a SimpleName in the stream.
23910
23911         (Expression.ResolveLValue): Ditto.
23912
23913         (Expression.ResolveWithSimpleName): This function is a variant of
23914         ResolveName, this one allows SimpleNames to be returned without a
23915         warning.  The only consumer of SimpleNames is MemberAccess
23916
23917 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23918
23919         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23920         might arrive here.  I have my doubts that this is correct.
23921
23922         * statement.cs (Lock): Implement lock statement.
23923
23924         * cs-parser.jay: Small fixes to support `lock' and `using'
23925
23926         * cs-tokenizer.cs: Remove extra space
23927
23928         * driver.cs: New flag --checked, allows to turn on integer math
23929         checking. 
23930
23931         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23932         Threading.Monitor.Exit 
23933
23934 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23935
23936         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23937         Expression Class to be IndexerAccess.
23938
23939         Notice that Indexer::DoResolve sets the eclass to Value.
23940
23941 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23942
23943         * class.cs (TypeContainer::Emit): Emit code for indexers.
23944
23945         * assign.cs (IAssignMethod): New interface implemented by Indexers
23946         and Properties for handling assignment.
23947
23948         (Assign::Emit): Simplify and reuse code. 
23949
23950         * expression.cs (IndexerAccess, PropertyExpr): Implement
23951         IAssignMethod, clean up old code. 
23952
23953 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23954
23955         * typemanager.cs (ImplementsInterface): New method to determine if a type
23956         implements a given interface. Provides a nice cache too.
23957
23958         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23959         method.
23960
23961         (ConvertReferenceExplicit): Ditto.
23962
23963         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23964         various methods, with correct names etc.
23965
23966         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23967         Operator.UnaryNegation.
23968
23969         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23970         we have a unary plus or minus operator.
23971
23972         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23973         UnaryMinus.
23974
23975         * everywhere : update accordingly.
23976
23977         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23978         respectively.
23979
23980         * class.cs (Method::Define): For the case where we are implementing a method
23981         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23982         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23983
23984 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23985
23986         * interface.cs (FindMembers): Implement to work around S.R.E
23987         lameness.
23988
23989         * typemanager.cs (IsInterfaceType): Implement.
23990
23991         (FindMembers): Update to handle interface types too.
23992
23993         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23994         use IsAssignableFrom as that is not correct - it doesn't work.
23995
23996         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23997         and accordingly override EmitStatement.
23998
23999         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
24000         using the correct logic :-)
24001
24002 2001-10-19  Ravi Pratap  <ravi@ximian.com>
24003
24004         * ../errors/cs-11.cs : Add to demonstrate error -11 
24005
24006 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * assign.cs (Assign::Resolve): Resolve right hand side first, and
24009         then pass this as a hint to ResolveLValue.
24010
24011         * expression.cs (FieldExpr): Add Location information
24012
24013         (FieldExpr::LValueResolve): Report assignment to readonly
24014         variable. 
24015
24016         (Expression::ExprClassFromMemberInfo): Pass location information.
24017
24018         (Expression::ResolveLValue): Add new method that resolves an
24019         LValue. 
24020
24021         (Expression::DoResolveLValue): Default invocation calls
24022         DoResolve. 
24023
24024         (Indexers): New class used to keep track of indexers in a given
24025         Type. 
24026
24027         (IStackStore): Renamed from LValue, as it did not really describe
24028         what this did.  Also ResolveLValue is gone from this interface and
24029         now is part of Expression.
24030
24031         (ElementAccess): Depending on the element access type
24032
24033         * typemanager.cs: Add `indexer_name_type' as a Core type
24034         (System.Runtime.CompilerServices.IndexerNameAttribute)
24035
24036         * statement.cs (Goto): Take a location.
24037
24038 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24039
24040         * delegate.cs (Delegate::VerifyDelegate): New method to verify
24041         if two delegates are compatible.
24042
24043         (NewDelegate::DoResolve): Update to take care of the case when
24044         we instantiate a delegate from another delegate.
24045
24046         * typemanager.cs (FindMembers): Don't even try to look up members
24047         of Delegate types for now.
24048
24049 2001-10-18  Ravi Pratap  <ravi@ximian.com>
24050
24051         * delegate.cs (NewDelegate): New class to take care of delegate
24052         instantiation.
24053
24054         * expression.cs (New): Split the delegate related code out into 
24055         the NewDelegate class.
24056
24057         * delegate.cs (DelegateInvocation): New class to handle delegate 
24058         invocation.
24059
24060         * expression.cs (Invocation): Split out delegate related code into
24061         the DelegateInvocation class.
24062
24063 2001-10-17  Ravi Pratap  <ravi@ximian.com>
24064
24065         * expression.cs (New::DoResolve): Implement delegate creation fully
24066         and according to the spec.
24067
24068         (New::DoEmit): Update to handle delegates differently.
24069
24070         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
24071         because of which we were printing out arguments in reverse order !
24072
24073         * delegate.cs (VerifyMethod): Implement to check if the given method
24074         matches the delegate.
24075
24076         (FullDelegateDesc): Implement.
24077
24078         (VerifyApplicability): Implement.
24079
24080         * expression.cs (Invocation::DoResolve): Update to accordingly handle
24081         delegate invocations too.
24082
24083         (Invocation::Emit): Ditto.
24084
24085         * ../errors/cs1593.cs : Added.
24086
24087         * ../errors/cs1594.cs : Added.
24088
24089         * delegate.cs (InstanceExpression, TargetMethod): New properties.
24090
24091 2001-10-16  Ravi Pratap  <ravi@ximian.com>
24092
24093         * typemanager.cs (intptr_type): Core type for System.IntPtr
24094
24095         (InitCoreTypes): Update for the same.
24096
24097         (iasyncresult_type, asynccallback_type): Ditto.
24098
24099         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24100         correct.
24101
24102         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24103         too.
24104
24105         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24106         the builders for the 4 members of a delegate type :-)
24107
24108         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24109         type.
24110
24111         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24112
24113         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24114
24115 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24116
24117         * statement.cs (Break::Emit): Implement.   
24118         (Continue::Emit): Implement.
24119
24120         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24121         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24122         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24123         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24124         end loop
24125
24126         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24127         properties that track the label for the current loop (begin of the
24128         loop and end of the loop).
24129
24130 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24131
24132         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24133         use of emitting anything at all.
24134
24135         * class.cs, rootcontext.cs : Get rid of calls to the same.
24136
24137         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24138
24139         (Populate): Define the constructor correctly and set the implementation
24140         attributes.
24141
24142         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24143         have been defined.
24144
24145         (AddDelegateType): Implement.
24146
24147         (IsDelegateType): Implement helper method.
24148
24149         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24150
24151         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24152         and accordingly handle it.
24153
24154         * delegate.cs (Populate): Take TypeContainer argument.
24155         Implement bits to define the Invoke method. However, I still haven't figured out
24156         how to take care of the native int bit :-(
24157
24158         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24159         Qualify the name of the delegate, not its return type !
24160
24161         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24162         conversion.
24163
24164         (StandardConversionExists): Checking for array types turns out to be recursive.
24165
24166         (ConvertReferenceExplicit): Implement array conversion.
24167
24168         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24169
24170 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24171
24172         * cs-parser.jay (delegate_declaration): Store the fully qualified
24173         name as it is a type declaration.
24174
24175         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24176         readonly.
24177
24178         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24179         as TypeContainer::DefineType.
24180
24181         (Populate): Method in which all the definition of the various methods (Invoke)
24182         etc is done.
24183
24184         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24185         see.
24186
24187         (CloseDelegate): Finally creates the delegate.
24188
24189         * class.cs (TypeContainer::DefineType): Update to define delegates.
24190         (Populate, Emit and CloseType): Do the same thing here too.
24191
24192         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24193         delegates in all these operations.
24194
24195 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24196
24197         * expression.cs: LocalTemporary: a new expression used to
24198         reference a temporary that has been created.
24199
24200         * assign.cs: Handle PropertyAccess back here, so that we can
24201         provide the proper semantic access to properties.
24202
24203         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24204         a few more explicit conversions. 
24205
24206         * modifiers.cs: `NEW' modifier maps to HideBySig.
24207
24208         * expression.cs (PropertyExpr): Make this into an
24209         ExpressionStatement, and support the EmitStatement code path. 
24210
24211         Perform get/set error checking, clean up the interface.
24212
24213         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24214         them into toplevel access objects.
24215
24216 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24217
24218         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24219         SRE.
24220
24221         * typemanager.cs: Keep track here of our PropertyBuilders again to
24222         work around lameness in SRE.
24223
24224 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24225
24226         * expression.cs (LValue::LValueResolve): New method in the
24227         interface, used to perform a second resolution pass for LValues. 
24228
24229         (This::DoResolve): Catch the use of this in static methods.
24230
24231         (This::LValueResolve): Implement.
24232
24233         (This::Store): Remove warning, assigning to `this' in structures
24234         is 
24235
24236         (Invocation::Emit): Deal with invocation of
24237         methods on value types.  We need to pass the address to structure
24238         methods rather than the object itself.  (The equivalent code to
24239         emit "this" for structures leaves the entire structure on the
24240         stack instead of a pointer to it). 
24241
24242         (ParameterReference::DoResolve): Compute the real index for the
24243         argument based on whether the method takes or not a `this' pointer
24244         (ie, the method is static).
24245
24246         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24247         value types returned from functions when we need to invoke a
24248         method on the sturcture.
24249
24250
24251 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24252
24253         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24254         defining the type in the Modulebuilder or Typebuilder. This is to take
24255         care of nested types which need to be defined on the TypeBuilder using
24256         DefineNestedMethod.
24257
24258         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24259         methods in RootContext, only ported to be part of TypeContainer.
24260
24261         (TypeContainer::GetInterfaceOrClass): Ditto.
24262
24263         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24264
24265         * interface.cs (Interface::DefineInterface): New method. Does exactly
24266         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24267         too.
24268
24269         (Interface::GetInterfaces): Move from RootContext here and port.
24270
24271         (Interface::GetInterfaceByName): Same here.
24272
24273         * rootcontext.cs (ResolveTree): Re-write.
24274
24275         (PopulateTypes): Re-write.
24276
24277         * class.cs (TypeContainer::Populate): Populate nested types too.
24278         (TypeContainer::Emit): Emit nested members too.
24279
24280         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24281         instead just use the name argument passed in as it is already fully
24282         qualified.
24283
24284         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24285         to TypeContainer mapping to see if a type is user-defined.
24286
24287         * class.cs (TypeContainer::CloseType): Implement. 
24288
24289         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24290         the default constructor.
24291
24292         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24293         twice.
24294
24295         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24296
24297         * interface.cs (CloseType): Create the type here.
24298
24299         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24300         the hierarchy.
24301
24302         Remove all the methods which are now in TypeContainer.
24303
24304 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24305
24306         * delegate.cs (Define): Re-write bits to define the delegate
24307         correctly.
24308
24309 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24310
24311         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24312
24313         * expression.cs (ImplicitReferenceConversion): handle null as well
24314         as a source to convert to any reference type.
24315
24316         * statement.cs (Return): Perform any implicit conversions to
24317         expected return type.  
24318
24319         Validate use of return statement.  
24320
24321         * codegen.cs (EmitContext): Pass the expected return type here.
24322
24323         * class.cs (Method, Constructor, Property): Pass expected return
24324         type to EmitContext.
24325
24326 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24327
24328         * expression.cs: Make DoResolve take an EmitContext instead of a
24329         TypeContainer.
24330
24331         Replaced `l' and `location' for `loc', for consistency.
24332
24333         (Error, Warning): Remove unneeded Tc argument.
24334
24335         * assign.cs, literal.cs, constant.cs: Update to new calling
24336         convention. 
24337
24338         * codegen.cs: EmitContext now contains a flag indicating whether
24339         code is being generated in a static method or not.
24340
24341         * cs-parser.jay: DecomposeQI, new function that replaces the old
24342         QualifiedIdentifier.  Now we always decompose the assembled
24343         strings from qualified_identifier productions into a group of
24344         memberaccesses.
24345
24346 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24347
24348         * rootcontext.cs: Deal with field-less struct types correctly now
24349         by passing the size option to Define Type.
24350
24351         * class.cs: Removed hack that created one static field. 
24352
24353 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24354
24355         * statement.cs: Moved most of the code generation here. 
24356
24357 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24358
24359         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24360         seem very right.
24361
24362         (ElementAccess): Remove useless bits for now - keep checks as the spec
24363         says.
24364
24365 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24366
24367         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24368         and start performing checks according to the spec.
24369
24370 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24371
24372         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24373         rank_specifiers instead.
24374
24375         (rank_specifiers): Change the order in which the rank specifiers are stored
24376
24377         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24378
24379         * expression.cs (ElementAccess): Implement the LValue interface too.
24380
24381 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24382
24383         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24384         except that user defined conversions are not included.
24385
24386         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24387         perform the conversion of the return type, if necessary.
24388
24389         (New::DoResolve): Check whether we are creating an array or an object
24390         and accordingly do the needful.
24391
24392         (New::Emit): Same here.
24393
24394         (New::DoResolve): Implement guts of array creation.
24395
24396         (New::FormLookupType): Helper function.
24397
24398 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24399
24400         * codegen.cs: Removed most of the code generation here, and move the
24401         corresponding code generation bits to the statement classes. 
24402
24403         Added support for try/catch/finalize and throw.
24404
24405         * cs-parser.jay: Added support for try/catch/finalize.
24406
24407         * class.cs: Catch static methods having the flags override,
24408         virtual or abstract.
24409
24410         * expression.cs (UserCast): This user cast was not really doing
24411         what it was supposed to do.  Which is to be born in fully resolved
24412         state.  Parts of the resolution were being performed at Emit time! 
24413
24414         Fixed this code.
24415
24416 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24417
24418         * expression.cs: Implicity convert the result from UserCast.
24419
24420 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24421
24422         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24423         prevented it from working correctly. 
24424
24425         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24426         merely ConvertImplicit.
24427
24428 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24429
24430         * typemanager.cs: Make the LookupTypeContainer function static,
24431         and not per-instance.  
24432
24433         * class.cs: Make static FindMembers (the one that takes a Type
24434         argument). 
24435
24436         * codegen.cs: Add EmitForeach here.
24437
24438         * cs-parser.jay: Make foreach a toplevel object instead of the
24439         inline expansion, as we need to perform semantic analysis on it. 
24440
24441 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24442
24443         * expression.cs (Expression::ImplicitUserConversion): Rename to
24444         UserDefinedConversion.
24445
24446         (Expression::UserDefinedConversion): Take an extra argument specifying 
24447         whether we look for explicit user conversions too.
24448
24449         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24450
24451         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24452
24453         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24454         with the appropriate arguments.
24455
24456         * cs-parser.jay (cast_expression): Record location too.
24457
24458         * expression.cs (Cast): Record location info.
24459
24460         (Expression::ConvertExplicit): Take location argument.
24461
24462         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24463         to determine if we are doing explicit conversions.
24464
24465         (UserCast::Emit): Update accordingly.
24466
24467         (Expression::ConvertExplicit): Report an error if everything fails.
24468
24469         * ../errors/cs0030.cs : Add.
24470
24471 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24472
24473         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24474         virtual and newslot bits. 
24475
24476         * class.cs (TypeContainer::RegisterRequiredImplementations):
24477         Record methods we need.
24478
24479         (TypeContainer::MakeKey): Helper function to make keys for
24480         MethodBases, since the Methodbase key is useless.
24481
24482         (TypeContainer::Populate): Call RegisterRequiredImplementations
24483         before defining the methods.   
24484
24485         Create a mapping for method_builders_to_methods ahead of time
24486         instead of inside a tight loop.
24487
24488         (::RequireMethods):  Accept an object as the data to set into the
24489         hashtable so we can report interface vs abstract method mismatch.
24490
24491 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24492
24493         * report.cs: Make all of it static.
24494
24495         * rootcontext.cs: Drop object_type and value_type computations, as
24496         we have those in the TypeManager anyways.
24497
24498         Drop report instance variable too, now it is a global.
24499
24500         * driver.cs: Use try/catch on command line handling.
24501
24502         Add --probe option to debug the error reporting system with a test
24503         suite. 
24504
24505         * report.cs: Add support for exiting program when a probe
24506         condition is reached.
24507
24508 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24509
24510         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24511         we do a forcible conversion regardless of type, to check if 
24512         ForceConversion returns a null.
24513
24514         (Binary::error19): Use location to report error.
24515
24516         (Unary::error23): Use location here too.
24517
24518         * ../errors/cs0019.cs : Check in.
24519
24520         * ../errors/cs0023.cs : Check in.
24521
24522         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24523         case of a non-null MethodInfo object with a length of 0 !
24524
24525         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24526         an applicable member - according to the spec :-)
24527         Also fix logic to find members in base types.
24528
24529         (Unary::ResolveOperator): Same here.
24530
24531         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24532         as I was getting thoroughly confused between this and error19 :-)
24533
24534         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24535         (::FindMostEncompassedType): Implement.
24536         (::FindMostEncompassingType): Implement.
24537         (::StandardConversionExists): Implement.
24538
24539         (UserImplicitCast): Re-vamp. We now need info about most specific
24540         source and target types so that we can do the necessary conversions.
24541
24542         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24543         mathematical union with no duplicates.
24544
24545 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24546
24547         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24548         in order from base classes to child classes, so that we can in
24549         child classes look up in our parent for method names and
24550         attributes (required for handling abstract, virtual, new, override
24551         constructs: we need to instrospect our base class, and if we dont
24552         populate the classes in order, the introspection might be
24553         incorrect.  For example, a method could query its parent before
24554         the parent has any methods and would determine that the parent has
24555         no abstract methods (while it could have had them)).
24556
24557         (RootContext::CreateType): Record the order in which we define the
24558         classes.
24559
24560 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24561
24562         * class.cs (TypeContainer::Populate): Also method definitions can
24563         fail now, keep track of this.
24564
24565         (TypeContainer::FindMembers): Implement support for
24566         DeclaredOnly/noDeclaredOnly flag.
24567
24568         (Constructor::Emit) Return the ConstructorBuilder.
24569
24570         (Method::Emit) Return the MethodBuilder. 
24571         Check for abstract or virtual methods to be public.
24572
24573         * rootcontext.cs (RootContext::CreateType): Register all the
24574         abstract methods required for the class to be complete and the
24575         interface methods that must be implemented. 
24576
24577         * cs-parser.jay: Report error 501 (method requires body if it is
24578         not marked abstract or extern).
24579
24580         * expression.cs (TypeOf::Emit): Implement.
24581
24582         * typemanager.cs: runtime_handle_type, new global type.
24583
24584         * class.cs (Property::Emit): Generate code for properties.
24585
24586 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24587
24588         * expression.cs (Unary::ResolveOperator): Find operators on base type
24589         too - we now conform exactly to the spec.
24590
24591         (Binary::ResolveOperator): Same here.
24592
24593         * class.cs (Operator::Define): Fix minor quirk in the tests.
24594
24595         * ../errors/cs0215.cs : Added.
24596
24597         * ../errors/cs0556.cs : Added.
24598
24599         * ../errors/cs0555.cs : Added.
24600
24601 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24602
24603         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24604         single integer which is really efficient
24605
24606 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24607
24608         *  expression.cs (Expression::ImplicitUserConversion): Use location
24609         even in the case when we are examining True operators.
24610  
24611         * class.cs (Operator::Define): Perform extensive checks to conform
24612         with the rules for operator overloading in the spec.
24613
24614         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24615         some of the other conversions mentioned in the spec.
24616
24617         * typemanager.cs (array_type): New static member for the System.Array built-in
24618         type.
24619
24620         (cloneable_interface): For System.ICloneable interface.
24621
24622         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24623         we start resolving the tree and populating types.
24624
24625         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24626  
24627 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24628
24629         * expression.cs (Expression::ExprClassFromMemberInfo,
24630         Expression::Literalize): Create literal expressions from
24631         FieldInfos which are literals.
24632
24633         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24634         type casts, because they were wrong.  The test suite in tests
24635         caught these ones.
24636
24637         (ImplicitNumericConversion): ushort to ulong requires a widening
24638         cast. 
24639
24640         Int32 constant to long requires widening cast as well.
24641
24642         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24643         for integers because the type on the stack is not i4.
24644
24645 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24646
24647         * expression.cs (report118): require location argument. 
24648
24649         * parameter.cs: Do not dereference potential null value.
24650
24651         * class.cs: Catch methods that lack the `new' keyword when
24652         overriding a name.  Report warnings when `new' is used without
24653         anything being there to override.
24654
24655         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24656
24657         * class.cs: Only add constructor to hashtable if it is non-null
24658         (as now constructors can fail on define).
24659
24660         (TypeManager, Class, Struct): Take location arguments.
24661
24662         Catch field instance initialization in structs as errors.
24663
24664         accepting_filter: a new filter for FindMembers that is static so
24665         that we dont create an instance per invocation.
24666
24667         (Constructor::Define): Catch errors where a struct constructor is
24668         parameterless 
24669
24670         * cs-parser.jay: Pass location information for various new
24671         constructs. 
24672
24673         * delegate.cs (Delegate): take a location argument.
24674
24675         * driver.cs: Do not call EmitCode if there were problesm in the
24676         Definition of the types, as many Builders wont be there. 
24677
24678         * decl.cs (Decl::Decl): Require a location argument.
24679
24680         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24681         into integers, and find the most appropiate integer for it.
24682
24683         * literal.cs: Implement ULongLiteral.
24684
24685         * rootcontext.cs: Provide better information about the location of
24686         failure when CreateType fails.
24687
24688 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24689
24690         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24691         as well.
24692
24693         * expression.cs (Binary::CheckShiftArguments): Add missing type
24694         computation.
24695         (Binary::ResolveOperator): Add type to the logical and and logical
24696         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24697         before.
24698
24699         (Binary::DoNumericPromotions): In the case where either argument
24700         is ulong (and most signed types combined with ulong cause an
24701         error) perform implicit integer constant conversions as well.
24702
24703 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24704
24705         * expression.cs (UserImplicitCast): Method should always be
24706         non-null. 
24707         (Invocation::BetterConversion): Simplified test for IntLiteral.
24708
24709         (Expression::ImplicitNumericConversion): Split this routine out.
24710         Put the code that performs implicit constant integer conversions
24711         here. 
24712
24713         (Expression::Resolve): Become a wrapper around DoResolve so we can
24714         check eclass and type being set after resolve.
24715
24716         (Invocation::Badness): Remove this dead function
24717
24718         (Binary::ResolveOperator): Do not compute the expensive argumnets
24719         unless we have a union for it.
24720
24721         (Probe::Emit): Is needs to do an isinst and then
24722         compare against null.
24723
24724         (::CanConvert): Added Location argument.  If the Location argument
24725         is null (Location.Null), then we do not report errors.  This is
24726         used by the `probe' mechanism of the Explicit conversion.  We do
24727         not want to generate an error for something that the user
24728         explicitly requested to be casted.  But the pipeline for an
24729         explicit cast first tests for potential implicit casts.
24730
24731         So for now, if the Location is null, it means `Probe only' to
24732         avoid adding another argument.   Might have to revise this
24733         strategy later.
24734
24735         (ClassCast): New class used to type cast objects into arbitrary
24736         classes (used in Explicit Reference Conversions).
24737
24738         Implement `as' as well.
24739
24740         Reverted all the patches from Ravi below: they were broken:
24741
24742                 * The use of `level' as a mechanism to stop recursive
24743                   invocations is wrong.  That was there just to catch the
24744                   bug with a strack trace but not as a way of addressing
24745                   the problem.
24746
24747                   To fix the problem we have to *understand* what is going
24748                   on and the interactions and come up with a plan, not
24749                   just get things going.
24750
24751                 * The use of the type conversion cache that I proposed
24752                   last night had an open topic: How does this work across
24753                   protection domains.  A user defined conversion might not
24754                   be public in the location where we are applying the
24755                   conversion, a different conversion might be selected
24756                   (ie, private A->B (better) but public B->A (worse),
24757                   inside A, A->B applies, but outside it, B->A will
24758                   apply).
24759
24760                 * On top of that (ie, even if the above is solved),
24761                   conversions in a cache need to be abstract.  Ie, `To
24762                   convert from an Int to a Short use an OpcodeCast', not
24763                   `To convert from an Int to a Short use the OpcodeCast on
24764                   the variable 5' (which is what this patch was doing).
24765
24766 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24767
24768         * expression.cs (Invocation::ConversionExists): Re-write to use
24769         the conversion cache
24770
24771         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24772         cache all conversions done, not just user-defined ones.
24773
24774         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24775         to determine if a conversion exists instead of acutually trying to 
24776         perform the conversion. It's faster too.
24777
24778         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24779         and only then attempt the implicit conversion.
24780
24781 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24782
24783         * expression.cs (ConvertImplicit): Use a cache for conversions
24784         already found. Check level of recursion and bail out if necessary.
24785
24786 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24787
24788         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24789         Export standard methods that we expect for string operations.
24790
24791         * statement.cs (Block::UsageWarning): Track usage of variables and
24792         report the errors for not used variables.
24793
24794         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24795         operator. 
24796
24797 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24798
24799         * codegen.cs: remove unnneded code 
24800
24801         * expression.cs: Removed BuiltinTypeAccess class
24802
24803         Fix the order in which implicit conversions are
24804         done.  
24805
24806         The previous fixed dropped support for boxed conversions (adding a
24807         test to the test suite now)
24808
24809         (UserImplicitCast::CanConvert): Remove test for source being null,
24810         that code is broken.  We should not feed a null to begin with, if
24811         we do, then we should track the bug where the problem originates
24812         and not try to cover it up here.
24813
24814         Return a resolved expression of type UserImplicitCast on success
24815         rather than true/false.  Ravi: this is what I was talking about,
24816         the pattern is to use a static method as a "constructor" for
24817         objects. 
24818
24819         Also, do not create arguments until the very last minute,
24820         otherwise we always create the arguments even for lookups that
24821         will never be performed. 
24822
24823         (UserImplicitCast::Resolve): Eliminate, objects of type
24824         UserImplicitCast are born in a fully resolved state. 
24825
24826         * typemanager.cs (InitCoreTypes): Init also value_type
24827         (System.ValueType). 
24828
24829         * expression.cs (Cast::Resolve): First resolve the child expression.
24830
24831         (LValue): Add new method AddressOf to be used by
24832         the `&' operator.  
24833
24834         Change the argument of Store to take an EmitContext instead of an
24835         ILGenerator, because things like FieldExpr need to be able to call
24836         their children expression to generate the instance code. 
24837
24838         (Expression::Error, Expression::Warning): Sugar functions for
24839         reporting errors.
24840
24841         (Expression::MemberLookup): Accept a TypeContainer instead of a
24842         Report as the first argument.
24843
24844         (Expression::ResolvePrimary): Killed.  I still want to improve
24845         this as currently the code is just not right.
24846
24847         (Expression::ResolveMemberAccess): Simplify, but it is still
24848         wrong. 
24849
24850         (Unary::Resolve): Catch errors in AddressOf operators.
24851
24852         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24853         index to a byte for the short-version, or the compiler will choose
24854         the wrong Emit call, which generates the wrong data.
24855
24856         (ParameterReference::Emit, ::Store): same.
24857
24858         (FieldExpr::AddressOf): Implement.
24859
24860         * typemanager.cs: TypeManager: made public variable instead of
24861         property.
24862
24863         * driver.cs: document --fatal.
24864
24865         * report.cs (ErrorMessage, WarningMessage): new names for the old
24866         Error and Warning classes.
24867
24868         * cs-parser.jay (member_access): Turn built-in access to types
24869         into a normal simplename
24870
24871 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24872
24873         * expression.cs (Invocation::BetterConversion): Fix to cope
24874         with q being null, since this was introducing a bug.
24875
24876         * expression.cs (ConvertImplicit): Do built-in conversions first.
24877
24878 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24879
24880         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24881
24882 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24883
24884         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24885         I had introduced long ago (what's new ?).
24886
24887         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24888         the work of all the checking. 
24889         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24890         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24891
24892         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24893         that is the right way. 
24894
24895         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24896         overloading resolution. Use everywhere instead of cutting and pasting code.
24897
24898         (Binary::ResolveOperator): Use MakeUnionSet.
24899
24900         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24901         we have to convert to bool types. Not complete yet.
24902
24903 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24904
24905         * typemanager.cs (TypeManager::CSharpName): support ushort.
24906
24907         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24908         to provide an expression that performsn an implicit constant int
24909         conversion (section 6.1.6).
24910         (Expression::ConvertImplicitRequired): Reworked to include
24911         implicit constant expression conversions.
24912
24913         (Expression::ConvertNumericExplicit): Finished.
24914
24915         (Invocation::Emit): If InstanceExpression is null, then it means
24916         that we perform a call on this.
24917
24918 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24919
24920         * expression.cs (Unary::Emit): Remove some dead code.
24921         (Probe): Implement Resolve and Emit for `is'.
24922         (Expression::ConvertImplicitRequired): Attempt to do constant
24923         expression conversions here.  Maybe should be moved to
24924         ConvertImplicit, but I am not sure.
24925         (Expression::ImplicitLongConstantConversionPossible,
24926         Expression::ImplicitIntConstantConversionPossible): New functions
24927         that tell whether is it possible to apply an implicit constant
24928         expression conversion.
24929
24930         (ConvertNumericExplicit): Started work on explicit numeric
24931         conversions.
24932
24933         * cs-parser.jay: Update operator constants.
24934
24935         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24936         (Parameters::GetSignature): Hook up VerifyArgs here.
24937         (Parameters::VerifyArgs): Verifies that no two arguments have the
24938         same name. 
24939
24940         * class.cs (Operator): Update the operator names to reflect the
24941         ones that the spec expects (as we are just stringizing the
24942         operator names).
24943
24944         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24945         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24946         previous usage did only work for our methods.
24947         (Expression::ConvertImplicit): Handle decimal implicit numeric
24948         conversions as well.
24949         (Expression::InternalTypeConstructor): Used to invoke constructors
24950         on internal types for default promotions.
24951
24952         (Unary::Emit): Implement special handling for the pre/post
24953         increment/decrement for overloaded operators, as they need to have
24954         the same semantics as the other operators.
24955
24956         (Binary::ResolveOperator): ditto.
24957         (Invocation::ConversionExists): ditto.
24958         (UserImplicitCast::Resolve): ditto.
24959
24960 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24961
24962         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24963         operator, return after emitting body. Regression tests pass again !
24964
24965         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24966         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24967         (Invocation::OverloadResolve): Ditto.
24968         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24969
24970         * everywhere : update calls to the above methods accordingly.
24971
24972 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24973
24974         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24975
24976         * expression.cs (ExpressionStatement): New base class used for
24977         expressions that can appear in statements, so that we can provide
24978         an alternate path to generate expression that do not leave a value
24979         on the stack.
24980
24981         (Expression::Emit, and all the derivatives): We no longer return
24982         whether a value is left on the stack or not.  Every expression
24983         after being emitted leaves a single value on the stack.
24984
24985         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24986         facilties of ExpressionStatement if possible.
24987
24988         * cs-parser.jay: Update statement_expression.
24989
24990 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24991
24992         * driver.cs: Change the wording of message
24993
24994 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24995
24996         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24997         the type of the expression to the return type of the method if
24998         we have an overloaded operator match ! The regression tests pass again !
24999         (Unary::ResolveOperator): Ditto.
25000
25001         * expression.cs (Invocation::ConversionExists): Correct the member lookup
25002         to find "op_Implicit", not "implicit" ;-)
25003         (UserImplicitCast): New class to take care of user-defined implicit conversions.
25004         (ConvertImplicit, ForceConversion): Take TypeContainer argument
25005
25006         * everywhere : Correct calls to the above accordingly.
25007
25008         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
25009         (ConvertImplicit): Do user-defined conversion if it exists.
25010
25011 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
25012
25013         * assign.cs: track location.
25014         (Resolve): Use implicit conversions on assignment.
25015
25016         * literal.cs: Oops.  Not good, Emit of short access values should
25017         pass (Bytes) or the wrong argument will be selected.
25018
25019         * expression.cs (Unary::Emit): Emit code for -expr.
25020
25021         (Unary::ResolveOperator): Handle `Substract' for non-constants
25022         (substract from zero from the non-constants).
25023         Deal with Doubles as well. 
25024
25025         (Expression::ConvertImplicitRequired): New routine that reports an
25026         error if no implicit conversion exists. 
25027
25028         (Invocation::OverloadResolve): Store the converted implicit
25029         expressions if we make them
25030
25031 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25032
25033         * class.cs (ConstructorInitializer): Take a Location argument.
25034         (ConstructorBaseInitializer): Same here.
25035         (ConstructorThisInitializer): Same here.
25036
25037         * cs-parser.jay : Update all calls accordingly.
25038
25039         * expression.cs (Unary, Binary, New): Take location argument.
25040         Update accordingly everywhere.
25041
25042         * cs-parser.jay : Update all calls to the above to take a location
25043         argument.
25044
25045         * class.cs : Ditto.
25046
25047 2001-09-24  Ravi Pratap  <ravi@ximian.com>
25048
25049         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
25050         (Invocation::BetterConversion): Same here
25051         (Invocation::ConversionExists): Ditto.
25052
25053         (Invocation::ConversionExists): Implement.
25054
25055 2001-09-22  Ravi Pratap  <ravi@ximian.com>
25056
25057         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
25058         Also take an additional TypeContainer argument.
25059
25060         * All over : Pass in TypeContainer as argument to OverloadResolve.
25061
25062         * typemanager.cs (CSharpName): Update to check for the string type and return
25063         that too.
25064
25065         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
25066         a given method.
25067
25068 2001-09-21  Ravi Pratap  <ravi@ximian.com>
25069
25070         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
25071         (Invocation::BetterFunction): Implement.
25072         (Invocation::BetterConversion): Implement.
25073         (Invocation::ConversionExists): Skeleton, no implementation yet.
25074
25075         Okay, things work fine !
25076
25077 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
25078
25079         * typemanager.cs: declare and load enum_type, delegate_type and
25080         void_type. 
25081
25082         * expression.cs (Expression::Emit): Now emit returns a value that
25083         tells whether a value is left on the stack or not.  This strategy
25084         might be reveted tomorrow with a mechanism that would address
25085         multiple assignments.
25086         (Expression::report118): Utility routine to report mismatches on
25087         the ExprClass.
25088
25089         (Unary::Report23): Report impossible type/operator combination
25090         utility function.
25091
25092         (Unary::IsIncrementableNumber): Whether the type can be
25093         incremented or decremented with add.
25094         (Unary::ResolveOperator): Also allow enumerations to be bitwise
25095         complemented. 
25096         (Unary::ResolveOperator): Implement ++, !, ~,
25097
25098         (Invocation::Emit): Deal with new Emit convetion.
25099
25100         * All Expression derivatives: Updated their Emit method to return
25101         whether they leave values on the stack or not.
25102
25103         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25104         stack for expressions that are statements. 
25105
25106 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25107
25108         * expression.cs (LValue): New interface.  Must be implemented by
25109         LValue objects.
25110         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25111         LValue interface.
25112
25113         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25114         interface for generating code, simplifies the code.
25115
25116 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25117
25118         * expression.cs (everywhere): Comment out return statements in ::Resolve
25119         methods to avoid the warnings.
25120
25121 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25122
25123         * driver.cs (parse): Report error 2001 if we can not open the
25124         source file.
25125
25126         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25127         not resolve it.
25128
25129         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25130         object. 
25131
25132         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25133         otherwise nested blocks end up with the same index.
25134
25135         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25136
25137         * expression.cs:  Instead of having FIXMEs in the Resolve
25138         functions, throw exceptions so it is obvious that we are facing a
25139         bug. 
25140
25141         * cs-parser.jay (invocation_expression): Pass Location information.
25142
25143         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25144         Use a basename for those routines because .NET does not like paths
25145         on them. 
25146
25147         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25148         already defined.
25149
25150 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25151
25152         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25153         are loading the correct data types (throws an exception if not).
25154         (TypeManager::InitCoreTypes): Use CoreLookupType
25155
25156         * expression.cs (Unary::ResolveOperator): return the child
25157         expression for expressions which are just +expr.
25158         (Unary::ResolveOperator): Return negative literals for -LITERAL
25159         expressions (otherwise they are Unary {Literal}).
25160         (Invocation::Badness): Take into account `Implicit constant
25161         expression conversions'.
25162
25163         * literal.cs (LongLiteral): Implement long literal class.
25164         (IntLiteral): export the `Value' of the intliteral. 
25165
25166 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25167
25168         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25169
25170         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25171         instead of 'Operator'
25172
25173         * expression.cs (Binary::ResolveOperator): Update accordingly.
25174         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25175         and 'Minus'
25176
25177         * cs-parser.jay (unary_expression): Update to use the new names.
25178
25179         * gen-treedump.cs (GetUnary): Same here.
25180
25181         * expression.cs (Unary::Resolve): Implement.
25182         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25183         operators are found instead of making noise ;-)
25184         (Unary::ResolveOperator): New method to do precisely the same thing which
25185         Binary::ResolveOperator does for Binary expressions.
25186         (Unary.method, .Arguments): Add.
25187         (Unary::OperName): Implement.   
25188         (Unary::ForceConversion): Copy and Paste !
25189
25190         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25191         a unary operator.
25192
25193         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25194         for the inbuilt operators. Only overloading works for now ;-)
25195
25196 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25197
25198         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25199         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25200
25201         * expression.cs (This::Emit): Implement. 
25202         (This::Resolve): Implement.
25203         (TypeOf:Resolve): Implement.
25204         (Expression::ResolveSimpleName): Add an implicit this to instance
25205         field references. 
25206         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25207         Bind instance variable to Field expressions.
25208         (FieldExpr::Instance): New field used to track the expression that
25209         represents the object instance.
25210         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25211         binding 
25212         (FieldExpr::Emit): Implement.
25213
25214         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25215         the last instruction contains a return opcode to avoid generating
25216         the last `ret' instruction (this generates correct code, and it is
25217         nice to pass the peverify output).
25218
25219         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25220         initializer for static and instance variables.
25221         (Constructor::Emit): Allow initializer to be null in the case of
25222         static constructors.  Only emit initializer for instance
25223         constructors. 
25224
25225         (TypeContainer::FindMembers): Return a null array if there are no
25226         matches.
25227
25228         Also fix the code for the MemberTypes.Method branch, as it was not
25229         scanning that for operators (or tried to access null variables before).
25230
25231         * assign.cs (Assign::Emit): Handle instance and static fields. 
25232
25233         * TODO: Updated.
25234
25235         * driver.cs: Stop compilation if there are parse errors.
25236
25237         * cs-parser.jay (constructor_declaration): Provide default base
25238         initializer for non-static constructors.
25239         (constructor_declarator): Do not provide a default base
25240         initializers if none was specified.
25241         Catch the fact that constructors should not have parameters.
25242
25243         * class.cs: Do not emit parent class initializers for static
25244         constructors, that should be flagged as an error.
25245
25246 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25247
25248         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25249         Move back code into TypeContainer::Populate.
25250
25251 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25252
25253         * class.cs (TypeContainer::AddConstructor): Fix the check to
25254         compare against Name, not Basename. 
25255         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25256
25257         * cs-parser.jay : Update accordingly.
25258
25259         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25260         for methods, don't forget to look into the operators too.
25261         (RegisterMethodBuilder): Helper method to take care of this for
25262         methods, constructors and operators.
25263         (Operator::Define): Completely revamp.
25264         (Operator.OperatorMethod, MethodName): New fields.
25265         (TypeContainer::Populate): Move the registering of builders into
25266         RegisterMethodBuilder.
25267         (Operator::Emit): Re-write.
25268
25269         * expression.cs (Binary::Emit): Comment out code path to emit method
25270         invocation stuff for the case when we have a user defined operator. I am
25271         just not able to get it right !
25272
25273 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25274
25275         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25276         argument. 
25277
25278         (Expression::MemberLookup): Provide a version that allows to
25279         specify the MemberTypes and BindingFlags. 
25280
25281         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25282         so it was not fetching variable information from outer blocks.
25283
25284         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25285         Beforefieldinit as it was buggy.
25286
25287         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25288         that Ravi put here.  
25289
25290         * class.cs (Constructor::Emit): Only emit if block is not null.
25291         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25292         deal with this by semantically definining it as if the user had
25293         done it.
25294
25295         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25296         constructors as we now "emit" them at a higher level.
25297
25298         (TypeContainer::DefineDefaultConstructor): Used to define the
25299         default constructors if none was provided.
25300
25301         (ConstructorInitializer): Add methods Resolve and Emit. 
25302
25303         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25304
25305 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25306
25307         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25308         the default constructor builder with our hashtable for methodbuilders
25309         to methodcores.
25310
25311         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25312         and argument_count is 0 in which case we have a match.
25313         (Binary::ResolveOperator): More null checking and miscellaneous coding
25314         style cleanup.
25315
25316 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25317
25318         * rootcontext.cs (IsNameSpace): Compare against null.
25319
25320         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25321
25322         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25323         and Unary::Operator.
25324
25325         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25326         accordingly.
25327
25328         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25329         we have overloaded operators.
25330         (Binary::ResolveOperator): Implement the part which does the operator overload
25331         resolution.
25332
25333         * class.cs (Operator::Emit): Implement.
25334         (TypeContainer::Emit): Emit the operators we have too.
25335
25336         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25337         the case when we have a user-defined operator.
25338
25339 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25340
25341         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25342
25343 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25344
25345         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25346         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25347         (Constructor::Emit): Implement.
25348         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25349         if we have no work to do. 
25350         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25351         Emit method.
25352
25353         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25354         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25355
25356         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25357         of parent.parent.
25358
25359 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25360
25361         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25362         in the source.
25363         (Tree::RecordNamespace): Method to do what the name says ;-)
25364         (Tree::Namespaces): Property to get at the namespaces hashtable.
25365
25366         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25367         keep track.
25368
25369         * rootcontext.cs (IsNamespace): Fixed it :-)
25370
25371 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25372
25373         * class.cs (TypeContainer::FindMembers): Add support for
25374         constructors. 
25375         (MethodCore): New class that encapsulates both the shared aspects
25376         of a Constructor and a Method.  
25377         (Method, Constructor): Factored pieces into MethodCore.
25378
25379         * driver.cs: Added --fatal which makes errors throw exceptions.
25380         Load System assembly as well as part of the standard library.
25381
25382         * report.cs: Allow throwing exceptions on errors for debugging.
25383
25384         * modifiers.cs: Do not use `parent', instead use the real type
25385         container to evaluate permission settings.
25386
25387         * class.cs: Put Ravi's patch back in.  He is right, and we will
25388         have to cope with the
25389
25390 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25391
25392         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25393         FamORAssem, not FamANDAssem.
25394
25395 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25396
25397         * driver.cs: Added --parse option that only parses its input files
25398         and terminates.
25399
25400         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25401         incorrect.  IsTopLevel is not used to tell whether an object is
25402         root_types or not (that can be achieved by testing this ==
25403         root_types).  But to see if this is a top-level *class* (not
25404         necessarly our "toplevel" container). 
25405
25406 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25407
25408         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25409         parent instead of a direct call to GetType.
25410
25411 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25412
25413         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25414         Modifiers.TypeAttr. This should just be a call to that method.
25415
25416         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25417         object so that we can determine if we are top-level or not.
25418
25419         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25420         TypeContainer too.
25421
25422         * enum.cs (Enum::Define): Ditto.
25423
25424         * modifiers.cs (FieldAttr): Re-write.
25425
25426         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25427         (TypeContainer::HaveStaticConstructor): New property to provide access
25428         to precisely that info.
25429
25430         * modifiers.cs (MethodAttr): Re-write.
25431         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25432
25433         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25434         of top-level types as claimed.
25435
25436 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25437
25438         * expression.cs (MemberLookup): Fruitless attempt to lookup
25439         constructors.  Maybe I need to emit default constructors?  That
25440         might be it (currently .NET emits this for me automatically).
25441         (Invocation::OverloadResolve): Cope with Arguments == null.
25442         (Invocation::EmitArguments): new function, shared by the new
25443         constructor and us.
25444         (Invocation::Emit): Handle static and instance methods.  Emit
25445         proper call instruction for virtual or non-virtual invocations.
25446         (New::Emit): Implement.
25447         (New::Resolve): Implement.
25448         (MemberAccess:Resolve): Implement.
25449         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25450         to track instances.
25451         (FieldExpr::Resolve): Set type.
25452
25453         * support.cs: Handle empty arguments.
25454                 
25455         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25456         SimpleLookup): Auxiliary routines to help parse a qualifier
25457         identifier.  
25458
25459         Update qualifier_identifier rule.
25460
25461         * codegen.cs: Removed debugging messages.
25462
25463         * class.cs: Make this a global thing, this acts just as a "key" to
25464         objects that we might have around.
25465
25466         (Populate): Only initialize method_builders_to_methods once.
25467
25468         * expression.cs (PropertyExpr): Initialize type from the
25469         PropertyType. 
25470
25471         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25472         Resolve pattern.  Attempt to implicitly convert value to boolean.
25473         Emit code.
25474
25475         * expression.cs: Set the type for the int32/int32 argument case.
25476         (Binary::ResolveOperator): Set the return type to boolean for
25477         comparission operators
25478
25479         * typemanager.cs: Remove debugging print code.
25480
25481         (Invocation::Resolve): resolve type.
25482
25483         * class.cs: Allocate a MemberInfo of the correct size, as the code
25484         elsewhere depends on the test to reflect the correct contents.
25485
25486         (Method::) Keep track of parameters, due to System.Reflection holes
25487
25488         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25489         mapping here.
25490
25491         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25492         of the exact size and return that.
25493
25494         (Class::LookupMethodByBuilder): New function that maps
25495         MethodBuilders to its methods.  Required to locate the information
25496         on methods because System.Reflection bit us again.
25497
25498         * support.cs: New file, contains an interface ParameterData and
25499         two implementations: ReflectionParameters and InternalParameters
25500         used to access Parameter information.  We will need to grow this
25501         as required.
25502
25503         * expression.cs (Invocation::GetParameterData): implement a cache
25504         and a wrapper around the ParameterData creation for methods. 
25505         (Invocation::OverloadResolve): Use new code.
25506
25507 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25508
25509         * class.cs (TypeContainer::EmitField): Remove and move into 
25510         (Field::Define): here and modify accordingly.
25511         (Field.FieldBuilder): New member.
25512         (TypeContainer::Populate): Update accordingly.
25513         (TypeContainer::FindMembers): Implement.
25514
25515 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25516
25517         * statement.cs: (VariableInfo::VariableType): New field to be
25518         initialized with the full type once it is resolved. 
25519
25520 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25521
25522         * parameter.cs (GetParameterInfo): Use a type cache to compute
25523         things only once, and to reuse this information
25524
25525         * expression.cs (LocalVariableReference::Emit): Implement.
25526         (OpcodeCast::Emit): fix.
25527
25528         (ParameterReference::Resolve): Implement.
25529         (ParameterReference::Emit): Implement.
25530
25531         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25532         that are expressions need to stay as Expressions.
25533
25534         * typemanager.cs (CSharpName): Returns the C# name of a type if
25535         possible. 
25536
25537         * expression.cs (Expression::ConvertImplicit): New function that
25538         implements implicit type conversions.
25539
25540         (Expression::ImplicitReferenceConversion): Implements implicit
25541         reference conversions.
25542
25543         (EmptyCast): New type for transparent casts.
25544
25545         (OpcodeCast): New type for casts of types that are performed with
25546         a sequence of bytecodes.
25547
25548         (BoxedCast): New type used for casting value types into reference
25549         types.  Emits a box opcode.
25550
25551         (Binary::DoNumericPromotions): Implements numeric promotions of
25552         and computation of the Binary::Type.
25553
25554         (Binary::EmitBranchable): Optimization.
25555
25556         (Binary::Emit): Implement code emission for expressions.
25557
25558         * typemanager.cs (TypeManager): Added two new core types: sbyte
25559         and byte.
25560
25561 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25562
25563         * class.cs (TypeContainer::FindMembers): Method which does exactly
25564         what Type.FindMembers does, only we don't have to use reflection. No
25565         implementation yet.
25566
25567         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25568         typecontainer objects as we need to get at them.
25569         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25570
25571         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25572         typecontainer object.
25573
25574         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25575         of just a Report object.
25576
25577 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25578
25579         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25580         "remove_"
25581         (TypeContainer::Populate): Now define the delegates of the type too.
25582         (TypeContainer.Delegates): Property to access the list of delegates defined
25583         in the type.
25584
25585         * delegates.cs (Delegate::Define): Implement partially.
25586
25587         * modifiers.cs (TypeAttr): Handle more flags.
25588
25589 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25590
25591         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25592         and not <=
25593         (Operator::Define): Re-write logic to get types by using the LookupType method
25594         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25595         (Indexer::Define): Ditto.
25596         (Event::Define): Ditto.
25597         (Property::Define): Ditto.
25598
25599 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25600
25601         * class.cs (TypeContainer::Populate): Now define operators too. 
25602         (TypeContainer.Operators): New property to access the list of operators
25603         in a type.
25604         (Operator.OperatorMethodBuilder): New member to hold the method builder
25605         for the operator we are defining.
25606         (Operator::Define): Implement.
25607
25608 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25609
25610         * class.cs (Event::Define): Make the prefixes of the accessor methods
25611         addOn_ and removeOn_ 
25612
25613         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25614         of the location being passed in too. Ideally, this should go later since all
25615         error reporting should be done through the Report object.
25616
25617         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25618         (Populate): Iterate thru the indexers we have and define them too.
25619         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25620         for the get and set accessors.
25621         (Indexer::Define): Implement.
25622
25623 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25624
25625         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25626         my previous implementation, did not work.
25627
25628         * typemanager.cs: Add a couple of missing types (the longs).
25629
25630         * literal.cs: Use TypeManager.bool_type instead of getting it.
25631
25632         * expression.cs (EventExpr): New kind of expressions.
25633         (Expressio::ExprClassFromMemberInfo): finish
25634
25635 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25636
25637         * assign.cs: Emit stores to static fields differently.
25638
25639 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25640
25641         * Merge in changes and adjust code to tackle conflicts. Backed out my
25642         code in Assign::Resolve ;-) 
25643
25644 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25645
25646         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25647         instead Report.Error and also pass in the location.
25648         (CSharpParser::Lexer): New readonly property to return the reference
25649         to the Tokenizer object.
25650         (declare_local_variables): Use Report.Error with location instead of plain 
25651         old error.
25652         (CheckDef): Ditto.
25653
25654         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25655         (Operator.CheckBinaryOperator): Ditto.
25656
25657         * cs-parser.jay (operator_declarator): Update accordingly.
25658
25659         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25660         (CheckBinaryOperator): Same here.
25661
25662         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25663         on the name without any prefixes of namespace names etc. This is because we
25664         already might have something already fully qualified like 
25665         'System.Console.WriteLine'
25666
25667         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25668
25669 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25670
25671         * cs-tokenizer.cs (location): Return a string which also contains
25672         the file name.
25673
25674         * expression.cs (ElementAccess): New class for expressions of the
25675         type 'element access.'
25676         (BaseAccess): New class for expressions of the type 'base access.'
25677         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25678         respectively.
25679
25680         * cs-parser.jay (element_access): Implement action.
25681         (base_access): Implement actions.
25682         (checked_expression, unchecked_expression): Implement.
25683
25684         * cs-parser.jay (local_variable_type): Correct and implement.
25685         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25686
25687         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25688
25689         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25690         name and the specifiers.
25691
25692         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25693
25694         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25695         making them all public ;-)
25696
25697         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25698         class anyways.
25699
25700 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25701
25702         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25703         PropertyExprs.
25704         (FieldExpr, PropertyExprs): New resolved expressions.
25705         (SimpleName::MemberStaticCheck): Perform static checks for access
25706         to non-static fields on static methods. Maybe this should be
25707         generalized for MemberAccesses. 
25708         (SimpleName::ResolveSimpleName): More work on simple name
25709         resolution. 
25710
25711         * cs-parser.jay (primary_expression/qualified_identifier): track
25712         the parameter index.
25713
25714         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25715         (EmitContext::EmitBoolExpression): Chain to expression generation
25716         instead of temporary hack.
25717         (::EmitStatementExpression): Put generic expression code generation.
25718
25719         * assign.cs (Assign::Emit): Implement variable assignments to
25720         local variables, parameters and fields.
25721
25722 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25723
25724         * statement.cs (Block::GetVariableInfo): New method, returns the
25725         VariableInfo for a variable name in a block.
25726         (Block::GetVariableType): Implement in terms of GetVariableInfo
25727
25728         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25729         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25730
25731 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25732
25733         * cs-parser.jay (operator_declaration): Continue on my quest : update
25734         to take attributes argument.
25735         (event_declaration): Ditto.
25736         (enum_declaration): Ditto.
25737         (indexer_declaration): Ditto.
25738
25739         * class.cs (Operator::Operator): Update constructor accordingly.
25740         (Event::Event): Ditto.
25741
25742         * delegate.cs (Delegate::Delegate): Same here.
25743
25744         * enum.cs (Enum::Enum): Same here.
25745
25746 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25747
25748         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25749
25750         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25751
25752         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25753         being passed around as an arraylist.
25754         (Attributes::AddAttribute): Method to add attribute sections.
25755
25756         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25757         (struct_declaration): Update accordingly.
25758         (constant_declaration): Update.
25759         (field_declaration): Update.
25760         (method_header): Update.
25761         (fixed_parameter): Update.
25762         (parameter_array): Ditto.
25763         (property_declaration): Ditto.
25764         (destructor_declaration): Ditto.
25765
25766         * class.cs (Struct::Struct): Update constructors accordingly.
25767         (Class::Class): Ditto.
25768         (Field::Field): Ditto.
25769         (Method::Method): Ditto.
25770         (Property::Property): Ditto.
25771         (TypeContainer::OptAttribute): update property's return type.
25772
25773         * interface.cs (Interface.opt_attributes): New member.
25774         (Interface::Interface): Update to take the extra Attributes argument.
25775
25776         * parameter.cs (Parameter::Parameter): Ditto.
25777
25778         * constant.cs (Constant::Constant): Ditto.
25779
25780         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25781         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25782         the attributes as a parameter.
25783         (InterfaceProperty): Update constructor call.
25784         (InterfaceEvent): Ditto.
25785         (InterfaceMethod): Ditto.
25786         (InterfaceIndexer): Ditto.
25787
25788         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25789         pass the attributes too.
25790         (interface_event_declaration): Ditto.
25791         (interface_property_declaration): Ditto.
25792         (interface_method_declaration): Ditto.
25793         (interface_declaration): Ditto.
25794
25795 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25796
25797         * class.cs (Method::Define): Track the "static Main" definition to
25798         create an entry point. 
25799
25800         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25801         EntryPoint if we find it. 
25802
25803         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25804         (EmitContext::ig): Make this variable public.
25805
25806         * driver.cs: Make the default output file be the first file name
25807         with the .exe extension.  
25808
25809         Detect empty compilations
25810
25811         Handle various kinds of output targets.  Handle --target and
25812         rename -t to --dumper.
25813
25814         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25815         methods inherited from Expression return now an Expression.  This
25816         will is used during the tree rewriting as we resolve them during
25817         semantic analysis.
25818
25819         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25820         the spec.  Missing entirely is the information about
25821         accessability of elements of it.
25822
25823         (Expression::ExprClassFromMemberInfo): New constructor for
25824         Expressions that creates a fully initialized Expression based on
25825         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25826         a Type.
25827
25828         (Invocation::Resolve): Begin implementing resolution of invocations.
25829
25830         * literal.cs (StringLiteral):  Implement Emit.
25831
25832 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25833
25834         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25835         member.
25836
25837 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25838
25839         * cs-parser.jay (attribute_arguments): Implement actions.
25840         (attribute): Fix bug in production. Implement action.
25841         (attribute_list): Implement.
25842         (attribute_target): Implement.
25843         (attribute_target_specifier, opt_target_specifier): Implement
25844         (CheckAttributeTarget): New method to check if the attribute target
25845         is valid.
25846         (attribute_section): Implement.
25847         (opt_attributes): Implement.
25848
25849         * attribute.cs : New file to handle attributes.
25850         (Attribute): Class to hold attribute info.
25851
25852         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25853         (attribute_section): Modify production to use 2 different rules to 
25854         achieve the same thing. 1 s/r conflict down !
25855         Clean out commented, useless, non-reducing dimension_separator rules.
25856
25857         * class.cs (TypeContainer.attributes): New member to hold list
25858         of attributes for a type.
25859         (Struct::Struct): Modify to take one more argument, the attribute list.
25860         (Class::Class): Ditto.
25861         (Field::Field): Ditto.
25862         (Method::Method): Ditto.
25863         (Property::Property): Ditto.
25864
25865         * cs-parser.jay (struct_declaration): Update constructor call to
25866         pass in the attributes too.
25867         (class_declaration): Ditto.
25868         (constant_declaration): Ditto.
25869         (field_declaration): Ditto.
25870         (method_header): Ditto.
25871         (fixed_parameter): Ditto.
25872         (parameter_array): Ditto.
25873         (property_declaration): Ditto.
25874
25875         * constant.cs (Constant::Constant): Update constructor similarly.
25876         Use System.Collections.
25877
25878         * parameter.cs (Parameter::Parameter): Update as above.
25879
25880 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25881
25882         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25883         (TypeContainer.delegates): New member to hold list of delegates.
25884
25885         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25886         this time as I seem to be on crack ;-)
25887
25888 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25889
25890         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25891         tell whether an identifier represents a namespace.
25892
25893         * expression.cs (NamespaceExpr): A namespace expression, used only
25894         temporarly during expression resolution.
25895         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25896         utility functions to resolve names on expressions.
25897
25898 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25899
25900         * codegen.cs: Add hook for StatementExpressions. 
25901
25902         * class.cs: Fix inverted test for static flag in methods.
25903
25904 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25905
25906         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25907         to make it coincide with MS' number.
25908         (Operator::CheckBinaryOperator): Ditto.
25909
25910         * ../errors/errors.txt : Remove error numbers added earlier.
25911
25912         * ../errors/cs1019.cs : Test case for error # 1019
25913
25914         * ../errros/cs1020.cs : Test case for error # 1020
25915
25916         * cs-parser.jay : Clean out commented cruft.
25917         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25918         used anywhere - non-reducing rule.
25919         (namespace_declarations): Non-reducing rule - comment out.
25920
25921         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25922         with TypeContainer::AddEnum.
25923
25924         * delegate.cs : New file for delegate handling classes.
25925         (Delegate): Class for declaring delegates.
25926
25927         * makefile : Update.
25928
25929         * cs-parser.jay (delegate_declaration): Implement.
25930
25931 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25932
25933         * class.cs (Event::Define): Implement.
25934         (Event.EventBuilder): New member.
25935
25936         * class.cs (TypeContainer::Populate): Update to define all enums and events
25937         we have.
25938         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25939         readonly fields for all these cases ?
25940
25941 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25942
25943         * class.cs (Property): Revamp to use the convention of making fields readonly.
25944         Accordingly modify code elsewhere.
25945
25946         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25947         the Define method of the Property class.
25948
25949         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25950         trivial bug.
25951         (TypeContainer::Populate): Update to define all the properties we have. Also
25952         define all enumerations.
25953
25954         * enum.cs (Define): Implement.
25955
25956 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25957
25958         * cs-parser.jay (overloadable_operator): The semantic value is an
25959         enum of the Operator class.
25960         (operator_declarator): Implement actions.
25961         (operator_declaration): Implement.
25962
25963         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25964         validity of definitions.
25965         (Operator::CheckBinaryOperator): Static method to check for binary operators
25966         (TypeContainer::AddOperator): New method to add an operator to a type.
25967
25968         * cs-parser.jay (indexer_declaration): Added line to actually call the
25969         AddIndexer method so it gets added ;-)
25970
25971         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25972         already taken care of by the MS compiler ?  
25973
25974 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25975
25976         * class.cs (Operator): New class for operator declarations.
25977         (Operator::OpType): Enum for the various operators.
25978
25979 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25980
25981         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25982         ostensibly handle this in semantic analysis.
25983
25984         * cs-parser.jay (general_catch_clause): Comment out
25985         (specific_catch_clauses, specific_catch_clause): Ditto.
25986         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25987         (catch_args, opt_catch_args): New productions.
25988         (catch_clause): Rewrite to use the new productions above
25989         (catch_clauses): Modify accordingly.
25990         (opt_catch_clauses): New production to use in try_statement
25991         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25992         and re-write the code in the actions to extract the specific and
25993         general catch clauses by being a little smart ;-)
25994
25995         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25996         Hooray, try and catch statements parse fine !
25997
25998 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25999
26000         * statement.cs (Block::GetVariableType): Fix logic to extract the type
26001         string from the hashtable of variables.
26002
26003         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
26004         I end up making that mistake ;-)
26005         (catch_clauses): Fixed gross error which made Key and Value of the 
26006         DictionaryEntry the same : $1 !!
26007
26008 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26009
26010         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
26011
26012         * cs-parser.jay (event_declaration): Correct to remove the semicolon
26013         when the add and remove accessors are specified. 
26014
26015 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
26016
26017         * cs-parser.jay (IndexerDeclaration): New helper class to hold
26018         information about indexer_declarator.
26019         (indexer_declarator): Implement actions.
26020         (parsing_indexer): New local boolean used to keep track of whether
26021         we are parsing indexers or properties. This is necessary because 
26022         implicit_parameters come into picture even for the get accessor in the 
26023         case of an indexer.
26024         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
26025
26026         * class.cs (Indexer): New class for indexer declarations.
26027         (TypeContainer::AddIndexer): New method to add an indexer to a type.
26028         (TypeContainer::indexers): New member to hold list of indexers for the
26029         type.
26030
26031 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26032
26033         * cs-parser.jay (add_accessor_declaration): Implement action.
26034         (remove_accessor_declaration): Implement action.
26035         (event_accessors_declaration): Implement
26036         (variable_declarators): swap statements for first rule - trivial.
26037
26038         * class.cs (Event): New class to hold information about event
26039         declarations.
26040         (TypeContainer::AddEvent): New method to add an event to a type
26041         (TypeContainer::events): New member to hold list of events.
26042
26043         * cs-parser.jay (event_declaration): Implement actions.
26044
26045 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
26046
26047         * cs-parser.jay (dim_separators): Implement. Make it a string
26048         concatenating all the commas together, just as they appear.
26049         (opt_dim_separators): Modify accordingly
26050         (rank_specifiers): Update accordingly. Basically do the same
26051         thing - instead, collect the brackets here.
26052         (opt_rank_sepcifiers): Modify accordingly.
26053         (array_type): Modify to actually return the complete type string
26054         instead of ignoring the rank_specifiers.
26055         (expression_list): Implement to collect the expressions
26056         (variable_initializer): Implement. We make it a list of expressions
26057         essentially so that we can handle the array_initializer case neatly too.
26058         (variable_initializer_list): Implement.
26059         (array_initializer): Make it a list of variable_initializers
26060         (opt_array_initializer): Modify accordingly.
26061
26062         * expression.cs (New::NType): Add enumeration to help us
26063         keep track of whether we have an object/delegate creation
26064         or an array creation.
26065         (New:NewType, New::Rank, New::Indices, New::Initializers): New
26066         members to hold data about array creation.
26067         (New:New): Modify to update NewType
26068         (New:New): New Overloaded contructor for the array creation
26069         case.
26070
26071         * cs-parser.jay (array_creation_expression): Implement to call
26072         the overloaded New constructor.
26073
26074 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
26075
26076         * class.cs (TypeContainer::Constructors): Return member
26077         constructors instead of returning null.
26078
26079 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
26080
26081         * typemanager.cs (InitCoreTypes): Initialize the various core
26082         types after we have populated the type manager with the user
26083         defined types (this distinction will be important later while
26084         compiling corlib.dll)
26085
26086         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
26087         on Expression Classification.  Now all expressions have a method
26088         `Resolve' and a method `Emit'.
26089
26090         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
26091         generation from working.     Also add some temporary debugging
26092         code. 
26093
26094 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
26095
26096         * codegen.cs: Lots of code generation pieces.  This is only the
26097         beginning, will continue tomorrow with more touches of polish.  We
26098         handle the fundamentals of if, while, do, for, return.  Others are
26099         trickier and I need to start working on invocations soon.
26100
26101         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26102         s.InitStatement. 
26103
26104         * codegen.cs (EmitContext): New struct, used during code
26105         emission to keep a context.   Most of the code generation will be
26106         here. 
26107
26108         * cs-parser.jay: Add embedded blocks to the list of statements of
26109         this block.  So code generation proceeds in a top down fashion.
26110
26111 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26112
26113         * statement.cs: Add support for multiple child blocks.
26114
26115 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26116
26117         * codegen.cs (EmitCode): New function, will emit the code for a
26118         Block of code given a TypeContainer and its ILGenerator. 
26119
26120         * statement.cs (Block): Standard public readonly optimization.
26121         (Block::Block constructors): Link children. 
26122         (Block::Child): Child Linker.
26123         (Block::EmitVariables): Emits IL variable declarations.
26124
26125         * class.cs: Drop support for MethodGroups here, delay until
26126         Semantic Analysis.
26127         (Method::): Applied the same simplification that I did before, and
26128         move from Properties to public readonly fields.
26129         (Method::ParameterTypes): Returns the parameter types for the
26130         function, and implements a cache that will be useful later when I
26131         do error checking and the semantic analysis on the methods is
26132         performed.
26133         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26134         and made a method, optional argument tells whether this is a class
26135         or a structure to apply the `has-this' bit.
26136         (Method::GetCallingConvention): Implement, returns the calling
26137         convention. 
26138         (Method::Define): Defines the type, a second pass is performed
26139         later to populate the methods.
26140
26141         (Constructor::ParameterTypes): implement a cache similar to the
26142         one on Method::ParameterTypes, useful later when we do semantic
26143         analysis. 
26144
26145         (TypeContainer::EmitMethod):  New method.  Emits methods.
26146
26147         * expression.cs: Removed MethodGroup class from here.
26148
26149         * parameter.cs (Parameters::GetCallingConvention): new method.
26150
26151 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26152
26153         * class.cs (TypeContainer::Populate): Drop RootContext from the
26154         argument. 
26155
26156         (Constructor::CallingConvention): Returns the calling convention.
26157         (Constructor::ParameterTypes): Returns the constructor parameter
26158         types. 
26159
26160         (TypeContainer::AddConstructor): Keep track of default constructor
26161         and the default static constructor.
26162
26163         (Constructor::) Another class that starts using `public readonly'
26164         instead of properties. 
26165
26166         (Constructor::IsDefault): Whether this is a default constructor. 
26167
26168         (Field::) use readonly public fields instead of properties also.
26169
26170         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26171         track of static constructors;  If none is used, turn on
26172         BeforeFieldInit in the TypeAttributes. 
26173
26174         * cs-parser.jay (opt_argument_list): now the return can be null
26175         for the cases where there are no arguments. 
26176
26177         (constructor_declarator): If there is no implicit `base' or
26178         `this', then invoke the default parent constructor. 
26179
26180         * modifiers.cs (MethodAttr): New static function maps a set of
26181         modifiers flags into a MethodAttributes enum
26182         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26183         MethodAttr, TypeAttr to represent the various mappings where the
26184         modifiers are used.
26185         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26186
26187 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26188
26189         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26190         method arguments.
26191
26192         * interface.cs (PopulateIndexer): Implemented the code generator
26193         for interface indexers.
26194
26195 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26196
26197         * interface.cs (InterfaceMemberBase): Now we track the new status
26198         here.  
26199
26200         (PopulateProperty): Implement property population.  Woohoo!  Got
26201         Methods and Properties going today. 
26202
26203         Removed all the properties for interfaces, and replaced them with
26204         `public readonly' fields. 
26205
26206 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26207
26208         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26209         initialize their hashtables/arraylists only when they are needed
26210         instead of doing this always.
26211
26212         * parameter.cs: Handle refs and out parameters.
26213
26214         * cs-parser.jay: Use an ArrayList to construct the arguments
26215         instead of the ParameterCollection, and then cast that to a
26216         Parameter[] array.
26217
26218         * parameter.cs: Drop the use of ParameterCollection and use
26219         instead arrays of Parameters.
26220
26221         (GetParameterInfo): Use the Type, not the Name when resolving
26222         types. 
26223
26224 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26225
26226         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26227         and instead use public readonly fields.
26228
26229         * class.cs: Put back walking code for type containers.
26230
26231 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26232
26233         * class.cs (MakeConstant): Code to define constants.
26234
26235         * rootcontext.cs (LookupType): New function.  Used to locate types 
26236
26237
26238 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26239
26240         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26241         this System.Reflection code is.  Kudos to Microsoft
26242
26243         * typemanager.cs: Implement a type cache and avoid loading all
26244         types at boot time.  Wrap in LookupType the internals.  This made
26245         the compiler so much faster.  Wow.  I rule!
26246
26247         * driver.cs: Make sure we always load mscorlib first (for
26248         debugging purposes, nothing really important).
26249
26250         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26251         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26252
26253         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26254         on namespaces that have been imported using the `using' keyword.
26255
26256         * class.cs (TypeContainer::TypeAttr): Virtualize.
26257         (Class::TypeAttr): Return attributes suitable for this bad boy.
26258         (Struct::TypeAttr): ditto.
26259         Handle nested classes.
26260         (TypeContainer::) Remove all the type visiting code, it is now
26261         replaced with the rootcontext.cs code
26262
26263         * rootcontext.cs (GetClassBases): Added support for structs. 
26264
26265 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26266
26267         * interface.cs, statement.cs, class.cs, parameter.cs,
26268         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26269         Drop use of TypeRefs, and use strings instead.
26270
26271 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26272
26273         * rootcontext.cs: 
26274
26275         * class.cs (Struct::Struct): set the SEALED flags after
26276         checking the modifiers.
26277         (TypeContainer::TypeAttr): new property, returns the
26278         TypeAttributes for a class.  
26279
26280         * cs-parser.jay (type_list): Oops, list production was creating a
26281         new list of base types.
26282
26283         * rootcontext.cs (StdLib): New property.
26284         (GetInterfaceTypeByName): returns an interface by type name, and
26285         encapsulates error handling here.
26286         (GetInterfaces): simplified.
26287         (ResolveTree): Encapsulated all the tree resolution here.
26288         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26289         types. 
26290
26291         * driver.cs: Add support for --nostdlib, to avoid loading the
26292         default assemblies.
26293         (Main): Do not put tree resolution here. 
26294
26295         * rootcontext.cs: Beginning of the class resolution.
26296
26297 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26298
26299         * rootcontext.cs: Provide better error reporting. 
26300
26301         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26302
26303         * rootcontext.cs (CreateInterface): Handle the case where there
26304         are no parent interfaces.
26305
26306         (CloseTypes): Routine to flush types at the end.
26307         (CreateInterface): Track types.
26308         (GetInterfaces): Returns an array of Types from the list of
26309         defined interfaces.
26310
26311         * typemanager.c (AddUserType): Mechanism to track user types (puts
26312         the type on the global type hash, and allows us to close it at the
26313         end). 
26314
26315 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26316
26317         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26318         RecordInterface instead.
26319
26320         * cs-parser.jay: Updated to reflect changes above.
26321
26322         * decl.cs (Definition): Keep track of the TypeBuilder type that
26323         represents this type here.  Not sure we will use it in the long
26324         run, but wont hurt for now.
26325
26326         * driver.cs: Smaller changes to accomodate the new code.
26327
26328         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26329         when done. 
26330
26331         * rootcontext.cs (CreateInterface):  New method, used to create
26332         the System.TypeBuilder type for interfaces.
26333         (ResolveInterfaces): new entry point to resolve the interface
26334         hierarchy. 
26335         (CodeGen): Property, used to keep track of the code generator.
26336
26337 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26338
26339         * cs-parser.jay: Add a second production for delegate_declaration
26340         with `VOID'.
26341
26342         (enum_body): Put an opt_comma here instead of putting it on
26343         enum_body or enum_member_declarations so we can handle trailing
26344         commas on enumeration members.  Gets rid of a shift/reduce.
26345
26346         (type_list): Need a COMMA in the middle.
26347
26348         (indexer_declaration): Tell tokenizer to recognize get/set
26349
26350         * Remove old targets.
26351
26352         * Re-add the parser target.
26353
26354 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26355
26356         * cs-parser.jay: Add precendence rules for a number of operators
26357         ot reduce the number of shift/reduce conflicts in the grammar.
26358
26359 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26360
26361         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26362         and put it here.
26363
26364         Get rid of old crufty code.
26365
26366         * rootcontext.cs: Use this to keep track of the parsed
26367         representation and the defined types available to the program. 
26368
26369         * gen-treedump.cs: adjust for new convention.
26370
26371         * type.cs: Split out the type manager, and the assembly builder
26372         from here. 
26373
26374         * typemanager.cs: the type manager will live here now.
26375
26376         * cil-codegen.cs: And the code generator here. 
26377
26378 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26379
26380         * makefile: Fixed up for easy making.
26381
26382 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26383
26384         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26385         the 
26386
26387         (unary_expression): Expand pre_increment_expression and
26388         post_decrement_expression to reduce a shift/reduce.
26389
26390 2001-07-11  Simon Cozens
26391
26392         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26393
26394         Improve allow_keyword_as_indent name.
26395
26396 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26397
26398         * Adjustments for Beta2. 
26399
26400 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26401
26402         * decl.cs: Added `Define' abstract method.
26403         (InTransit): new property, used to catch recursive definitions. 
26404
26405         * interface.cs: Implement `Define'. 
26406
26407         * modifiers.cs: Map Modifiers.constants to
26408         System.Reflection.TypeAttribute flags.
26409
26410         * class.cs: Keep track of types and user-defined types.
26411         (BuilderInit): New method for creating an assembly
26412         (ResolveType): New function to launch the resolution process, only
26413         used by interfaces for now.
26414
26415         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26416         that are inserted into the name space. 
26417
26418 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26419
26420         * ARGH.  I have screwed up my tree so many times due to the use of
26421         rsync rather than using CVS.  Going to fix this at once. 
26422
26423         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26424         load types.
26425
26426 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26427
26428         * Experiment successful: Use System.Type rather that our own
26429         version of Type.  
26430
26431 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26432
26433         * cs-parser.jay: Removed nsAliases from here.
26434
26435         Use new namespaces, handle `using XXX;' 
26436
26437         * namespace.cs: Reimplemented namespace handling, use a recursive
26438         definition of the class.  Now we can keep track of using clauses
26439         and catch invalid using clauses.
26440
26441 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26442
26443         * gen-treedump.cs: Adapted for all the renaming.
26444
26445         * expression.cs (Expression): this class now has a Type property
26446         which returns an expression Type.
26447
26448         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26449         `Type', as this has a different meaning now in the base
26450
26451 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26452
26453         * interface.cs, class.cs: Removed from all the sources the
26454         references to signature computation, as we can not do method
26455         signature computation during the parsing time, as we are not
26456         trying to solve at that point distinguishing:
26457
26458         class X {
26459                 void a (Blah x) {}
26460                 void a (NS.Blah x) {}
26461         }
26462
26463         Which depending on the context might be valid or not, as we do not
26464         know if Blah is the same thing as NS.Blah at that point.
26465
26466         * Redid everything so the code uses TypeRefs now instead of
26467         Types.  TypeRefs are just temporary type placeholders, that need
26468         to be resolved.  They initially have a pointer to a string and the
26469         current scope in which they are used.  This is used later by the
26470         compiler to resolve the reference to an actual Type. 
26471
26472         * DeclSpace is no longer a CIR.Type, and neither are
26473         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26474         are all DeclSpaces, but no Types. 
26475
26476         * type.cs (TypeRefManager): This implements the TypeRef manager,
26477         which keeps track of all the types that need to be resolved after
26478         the parsing has finished. 
26479
26480 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26481
26482         * ARGH.  We are going to have to store `foreach' as a class rather
26483         than resolving it, as we need to verify error 1579 after name
26484         resolution.   *OR* we could keep a flag that says `This request to
26485         IEnumerator comes from a foreach statement' which we can then use
26486         to generate the error.
26487
26488 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26489
26490         * class.cs (TypeContainer.AddMethod): we now add methods to the
26491         MethodGroup instead of the method hashtable.  
26492
26493         * expression.cs: Add MethodGroup abstraction, which gets us one
26494         step closer to the specification in the way we handle method
26495         declarations.  
26496
26497         * cs-parser.jay (primary_expression): qualified_identifier now
26498         tried to match up an identifier to a local variable reference or
26499         to a parameter reference.
26500
26501         current_local_parameters is now a parser global variable that
26502         points to the current parameters for the block, used during name
26503         lookup.
26504
26505         (property_declaration): Now creates an implicit `value' argument to
26506         the set accessor.
26507
26508 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26509
26510         * parameter.cs: Do not use `param' arguments as part of the
26511         signature, per the spec.
26512
26513 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26514
26515         * decl.cs: Base class for classes, structs and interfaces.  This
26516         is the "Declaration Space" 
26517
26518         * cs-parser.jay: Use CheckDef for checking declaration errors
26519         instead of having one on each function.
26520
26521         * class.cs: Factor out some code for handling error handling in
26522         accordance to the "Declarations" section in the "Basic Concepts"
26523         chapter in the ECMA C# spec.
26524
26525         * interface.cs: Make all interface member classes derive from
26526         InterfaceMemberBase.
26527
26528 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26529
26530         * Many things: all interfaces are parsed and generated in
26531         gen-treedump.  Support for member variables, constructors,
26532         destructors, properties, constants is there.
26533
26534         Beginning of the IL backend, but very little done, just there for
26535         testing purposes. 
26536
26537 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26538
26539         * cs-parser.jay: Fix labeled statement.
26540
26541         * cs-tokenizer.cs (escape): Escape " and ' always.
26542         ref_line, ref_name: keep track of the line/filename as instructed
26543         by #line by the compiler.
26544         Parse #line.
26545
26546 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26547
26548         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26549         to match the values in System.CodeDOM.
26550
26551         Divid renamed to Divide.
26552
26553         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26554         statements. 
26555         (Statements.set): remove.
26556
26557         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26558         statements. 
26559
26560         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26561         falseStatements always have valid values. 
26562
26563         * cs-parser.jay: Use System.CodeDOM now.
26564