2003-08-28 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / gmcs / ChangeLog
1 2003-08-28  Martin Baulig  <martin@ximian.com>
2
3         * sample-stack.il: Compile this with ilasm: "ilasm /dll
4         sample-stack.il".
5
6         * sample-hello.cs: Compile this with gmcs: "gmcs
7         /r:sample-stack.dll sample-hello.cs".
8
9 2003-08-28  Martin Baulig  <martin@ximian.com>
10
11         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12         the parameters to the generic type.
13
14 2003-08-28  Martin Baulig  <martin@ximian.com>
15
16         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
17
18 2003-08-28  Martin Baulig  <martin@ximian.com>
19
20         * cs-parser.jay (opt_type_argument_list): Use
21         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
22         (primary_expression): Replace `qualified_identifier' with `type_name'.
23         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
24
25         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
26         parser to check whether it is syntactically a type parameter list;
27         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
28         this case.
29
30 2003-08-26  Martin Baulig  <martin@ximian.com>
31
32         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
33         resolving aliases; fixes #47927.
34
35 2003-08-26  Martin Baulig  <martin@ximian.com>
36
37         * statement.cs (Using.DoResolve): This is internally emitting a
38         try/finally clause, so we need to set ec.NeedExplicitReturn if we
39         do not always return.  Fixes #47681.
40
41 2003-08-26  Martin Baulig  <martin@ximian.com>
42
43         * decl.cs (MemberCore): Moved WarningNotHiding(),
44         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
45         into MemberBase.
46         (AdditionResult): Make this nested in DeclSpace.
47         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
48         argument; call NamespaceEntry.Define() unless we're nested in a
49         class or struct.
50
51         * namespace.cs (Namespace.DefineName): New public function.  This
52         is called from DeclSpace's .ctor to add 
53         (Namespace.Lookup): Include DeclSpaces in the lookup.
54
55         * class.cs (Operator): Derive from MemberBase, not MemberCore.
56
57         * const.cs (Const): Derive from MemberBase, not MemberCore.     
58
59 2003-08-25  Martin Baulig  <martin@ximian.com>
60
61         * convert.cs (Convert.ExplicitReferenceConversion): When
62         converting from an interface type to a class, unbox if the target
63         type is a struct type.  Fixes #47822.
64
65 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
66
67         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
68         #47854.
69
70 2003-08-22  Martin Baulig  <martin@ximian.com>
71
72         * class.cs (TypeManager.DefineType): When defining a nested type,
73         call DefineType() on our parent; fixes #47801.
74
75 2003-08-22  Martin Baulig  <martin@ximian.com>
76
77         * class.cs (MethodData.Define): While checking if a method is an
78         interface implementation, improve the test a bit more to fix #47654.
79
80 2003-08-22  Martin Baulig  <martin@ximian.com>
81
82         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
83         correctly; fixes #47722.
84
85 2003-08-22  Martin Baulig  <martin@ximian.com>
86
87         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
88         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
89
90         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
91
92 2003-08-22  Martin Baulig  <martin@ximian.com>
93
94         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
95         can only be assigned in static constructors.  Fixes #47161.
96
97 2003-08-22  Martin Baulig  <martin@ximian.com>
98
99         Rewrote and improved the flow analysis code.
100
101         * flowbranching.cs (FlowBranching): Make this class abstract.
102         (FlowBranching.CreateBranching): New static function to create a
103         new flow branching.
104         (FlowBranchingBlock, FlowBranchingException): New classes.
105         (FlowBranching.UsageVector.Type): New public readonly field.
106         (FlowBranching.UsageVector.Breaks): Removed the setter.
107         (FlowBranching.UsageVector.Returns): Removed the setter.
108         (FlowBranching.UsageVector): Added Break(), Return(),
109         NeverReachable() and Throw() methods to modify the reachability.
110         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
111         done by FlowBranching.Merge().
112         (FlowBranching.UsageVector.MergeChild): New method; merges the
113         merge result into the current vector.
114         (FlowBranching.Merge): New abstract method to merge a branching.
115
116 2003-08-12  Martin Baulig  <martin@ximian.com>
117
118         * expression.cs (Indirection.CacheTemporaries): Create the
119         LocalTemporary with the pointer type, not its element type.
120
121 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
122
123         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
124         token was a keyword or not.
125
126         Add `error' options where an IDENTIFIER was expected;  Provide
127         CheckToken and CheckIdentifierToken convenience error reporting
128         functions. 
129
130         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
131
132         * decl.cs: Rename `NamespaceEntry Namespace' public field into
133         NameSpaceEntry NameSpaceEntry.
134
135         (LookupInterfaceOrClass): Avoid creating a full qualified name
136         from namespace and name: avoid doing lookups when we know the
137         namespace is non-existant.   Use new Tree.LookupByNamespace which
138         looks up DeclSpaces based on their namespace, name pair.
139
140         * driver.cs: Provide a new `parser verbose' to display the
141         exception thrown during parsing.  This is turned off by default
142         now, so the output of a failure from mcs is more graceful.
143
144         * namespace.cs: Track all the namespaces defined in a hashtable
145         for quick lookup.
146         
147         (IsNamespace): New method
148
149 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
150
151         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
152         we know that we need to concatenate (full typename can never be
153         null). 
154
155         * class.cs: ditto.
156
157         * statement.cs: Use a bitfield;  Do not initialize to null things
158         which are done by the constructor by default.
159
160         * cs-parser.jay: bug fix, parameter was 4, not 3.
161
162         * expression.cs: Just use the property;
163
164         * statement.cs: No need for GetVariableInfo method.
165
166 2003-08-08  Martin Baulig  <martin@ximian.com>
167
168         * flowanalysis.cs (FlowReturns): This is now nested in the
169         `FlowBranching' class.
170         (MyBitVector): Moved this here from statement.cs.
171         (FlowBranching.SiblingType): New enum type.
172         (FlowBranching.CreateSibling): Added `SiblingType' argument.
173
174 2003-08-07  Martin Baulig  <martin@ximian.com>
175
176         * flowanalysis.cs (FlowBranchingType): This is now nested in the
177         `FlowBranching' class and called `BranchingType'.
178
179 2003-08-07  Martin Baulig  <martin@ximian.com>
180
181         * flowanalysis.cs: Moved all the control flow analysis code into
182         its own file.
183
184 2003-08-07  Martin Baulig  <martin@ximian.com>
185
186         * assign.cs (Assign.DoResolve): `target' must either be an
187         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
188         #37319.
189
190 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
191
192         * expression.cs (BinaryMethod): This kind of expression is created by the
193         Binary class if it determines that the operator has to be handled
194         by a method.
195
196         (BinaryDelegate): This kind of expression is created if we are
197         dealing with a + or - operator on delegates.
198
199         (Binary): remove method, argumetns, and DelegateOperator: when
200         dealing with methods, 
201         
202         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
203
204         * statement.cs (Block): use bitfields for the three extra booleans
205         we had in use.   Remove unused topblock parameter.
206
207         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
208
209         * assign.cs: Drop extra unneeded tests.
210
211 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
212
213         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
214
215         * statement.cs (Foreach): Use VariableStorage instead of
216         LocalBuilders.   
217
218         * codegen.cs (VariableStorage): New class used by clients that
219         require a variable stored: locals or fields for variables that
220         need to live across yield.
221
222         Maybe provide a convenience api for EmitThis+EmitLoad?
223
224         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
225         these bad boys.
226
227 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
228
229         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
230         RemapParameterLValue): New methods that are used to turn a
231         precomputed FieldInfo into an expression like this:
232
233                 instance.FieldInfo
234
235         The idea is to use this instead of making LocalVariableReference
236         have more than one meaning.
237
238         * cs-parser.jay: Add error production to BASE.
239
240         * ecore.cs: Deal with TypeManager.GetField returning null, which
241         is now a valid return value.
242
243         (FieldExprNoAddress): New expression for Fields whose address can
244         not be taken.
245
246         * expression.cs (LocalVariableReference): During the resolve
247         phases, create new expressions if we are in a remapping context.
248         Remove code that dealt with remapping here.
249
250         (ParameterReference): same.
251
252         (ProxyInstance): New expression, like the `This' expression, but
253         it is born fully resolved.  We know what we are doing, so remove
254         the errors that are targeted to user-provided uses of `this'.
255
256         * statement.cs (Foreach): our variable is now stored as an
257         Expression;  During resolution, follow the protocol, dont just
258         assume it will return this.
259         
260 2003-08-06  Martin Baulig  <martin@ximian.com>
261
262         * support.cs (SeekableStreamReader.cs): New public class.
263
264         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
265         SeekableStreamReader instead of the normal StreamReader.
266
267 2003-08-04  Martin Baulig  <martin@ximian.com>
268
269         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
270         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
271         deambiguate casts and delegate invocations.
272         (parenthesized_expression): Use the new tokens to ensure this is
273         not a cast of method invocation.
274
275         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
276         when reading a `)' and Deambiguate_CloseParens () was previously
277         called.
278
279         * expression.cs (ParenthesizedExpression): New class.  This is
280         just used for the CS0075 test.
281         (Binary.DoResolve): Check for CS0075.   
282
283 2003-07-29  Ravi Pratap  <ravi@ximian.com>
284
285         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
286         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
287         reference comparison.
288
289         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
290         examine the ReturnType for equality - this is necessary in the
291         cases of implicit and explicit operators whose signature also
292         includes the return type.
293
294 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
295
296         * namespace.cs: Cache the result of the namespace computation,
297         instead of computing it every time.
298
299 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
300
301         * decl.cs: Use a global arraylist that we reuse over invocations
302         to avoid excesive memory consumption.  Reduces memory usage on an
303         mcs compile by one meg (45 average).
304
305         * typemanager.cs (LookupTypeReflection): In .NET pointers are
306         private, work around that.
307
308 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
309
310         * literal.cs (IntLiteral): Define Zero and One static literals. 
311
312         * cs-parser.jay (integer_literal): use static literals to reduce
313         memory usage for the most used literals (0, 1 and -1).  211kb
314         reduced in memory usage.
315
316         Replace all calls to `new ArrayList' with `new
317         ArrayList(4)' which is a good average number for most allocations,
318         and also requires only 16 bytes of memory for its buffer by
319         default. 
320
321         This reduced MCS memory usage in seven megabytes for the RSS after
322         bootstrapping.
323
324 2003-07-28  Ravi Pratap  <ravi@ximian.com>
325
326         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
327         handle params methods the correct way by forming only one
328         applicable set with params and normal methods in them. Earlier we
329         were looking at params methods only if we found no normal methods
330         which was not the correct thing to do.
331
332         (Invocation.BetterFunction): Take separate arguments indicating
333         when candidate and the best method are params methods in their
334         expanded form.
335
336         This fixes bugs #43367 and #46199.
337
338         * attribute.cs: Documentation updates.
339
340         (CheckAttribute): Rename to CheckAttributeTarget.
341         (GetValidPlaces): Rename to GetValidTargets.
342
343         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
344         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
345
346         Fixes bug #44468.
347
348 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
349
350         * codegen.cs: Compute IsGeneric correctly.
351
352         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
353         resolution. 
354
355         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
356         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
357         regressions, and I was chasing more bugs than I required.
358
359         * interface.cs: Use expressions for base type names (like classes
360         and structs have been doing for a while now), and resolve that.
361         This patch should probably go into head as well.
362
363         This makes it one less user of FindType.
364
365 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
366
367         This compiler can not self host currently.  Need to fix that.
368         
369         * Makefile: compile to `gmcs.exe'
370
371         * driver.cs: Turn on v2 by default on gmcs.
372
373         * generic.cs (ConstructedType): Does no longer take a container
374         type argument;  That will be taken care of later.
375
376         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
377         Use SimpleName to resolve for now, so we can continue the work on
378         the parser, until we get Type.GetType that understands generics.
379
380         (ConstructedType.ToString): Implement
381
382         (TypeArguments.Resolve): Resolve the child expressions as types. 
383         
384         * cs-parser.jay: Rename interface_constraints to
385         type_parameter_constraints
386
387         (namespace_or_type_name): Only use constructed types for the basic
388         construction, we will deal with identifier<...> later.
389
390         (type/type_name): No longer call DecomposeQI, as
391         namespace_or_type_name is always decoded now.
392         
393 2003-07-22  Ravi Pratap  <ravi@ximian.com>
394
395         * expression.cs (Invocation.OverloadResolve): Follow the spec more
396         closely: we eliminate methods in base types when we have an
397         applicable method in a top-level type.
398
399         Please see section 14.5.5.1 for an exact description of what goes
400         on. 
401
402         This fixes bug #45127 and a host of other related to corlib compilation.
403
404         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
405         array is the method corresponding to the top-level type (this is
406         because of the changes made to icall.c) so we change this
407         accordingly.
408
409         (MethodGroupExpr.Name): This too.
410
411         * typemanager.cs (GetElementType): New method which does the right
412         thing when compiling corlib. 
413
414         * everywhere: Make use of the above in the relevant places.
415
416 2003-07-22  Martin Baulig  <martin@ximian.com>
417
418         * cs-parser.jay (invocation_expression): Moved
419         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
420         `cast_expression', but create a InvocationOrCast which later
421         resolves to either an Invocation or a Cast.
422
423         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
424         method; call this before EmitStatement() to make sure that this
425         expression can be used as a statement.
426
427         * expression.cs (InvocationOrCast): New class; resolves to either
428         an Invocation or a Cast.
429
430         * statement.cs (StatementExpression): Call ResolveStatement() on
431         the ExpressionStatement before emitting it.
432
433 2003-07-21  Martin Baulig  <martin@ximian.com>
434
435         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
436         `ref' and `out' attributes match; fixes #46220.
437         (MemberAccess.ResolveMemberAccess): You can't reference a type
438         through an expression; fixes #33180.
439         (Indexers.GetIndexersForType): Don't return the indexers from
440         interfaces the class implements; fixes #46502.
441
442 2003-07-21  Martin Baulig  <martin@ximian.com>
443
444         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
445         CS0661 checks; fixes bug #30442.
446
447 2003-07-21  Martin Baulig  <martin@ximian.com>
448
449         * decl.cs (AdditionResult): Added `Error'.
450
451         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
452
453         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
454         cs0031.cs actually work.
455
456  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
457  
458         * cs-parser.jay (namespace_name): do not use
459         namespace_or_type_name, use qualified_identifier, because
460         namespace_or_type_name will soon return a composed expression
461         instead of a string.
462  
463         (namespace_or_type_name): Instead of returning a string, now this
464         production returns an expression.
465  
466         * codegen.cs (EmitContext): Setup IsGeneric property based on
467         whether our DeclSpace is generic, our the method is generic.
468  
469         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
470         the method is generic.
471  
472         * cs-parser.jay (type_arguments, opt_type_argument_list,
473         type_parameters, type_parameter_list, opt_type_parameter_list,
474         type_parameter,, opt_type_parameter_constraints_clauses,
475         type_parameter_constraints_clauses,
476         type_parameter_constraint_clause, type_parameter_constraint,
477         interface_constraints): Add new production
478  
479         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
480         DeclSpace is generic or not.
481  
482         (DeclSpace.SetParameterInfo): New routine, used to set the
483         parameter info for a type.
484  
485         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
486         returns a GenericTypeExpr
487  
488         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
489         generic, lookup the generic argument.
490  
491         * attribute.cs: Do not allow TypeParameterExpressions in
492         Attributes.
493  
494         * class.cs: Do not allow the Main method to be defined in a
495         Generic container.
496  
497         * expression.cs (SizeOf): Do not allow generic types to be used as
498         arguments to sizeof.
499  
500         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
501         it: whether a type is generic or not.  Only works for types we are
502         currently building for now.
503         
504 2003-07-20  Martin Baulig  <martin@ximian.com>
505
506         * namespace.cs: Fixed that bug which caused a crash when compiling
507         the debugger's GUI.
508
509 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
510
511         * typemanager.cs (LookupTypeReflection): Never expose types which
512         are NotPublic, NestedPrivate, NestedAssembly, or
513         NestedFamANDAssem.  We used to return these, and later do a check
514         that would report a meaningful error, but the problem is that we
515         would not get the real match, if there was a name override.
516
517 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
518
519         * namespace.cs (Namespace, Name): Do not compute the namespace
520         name dynamically, compute it in the constructor.  This reduced
521         memory usage by 1697 KB.
522
523         * driver.cs: Use --pause to pause at the end.
524
525 2003-07-17  Peter Williams  <peter@newton.cx>
526
527         * Makefile: Change the name of the test target so that it doesn't
528         conflict with the recursive test target.
529
530 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
531
532         * expression.cs (LocalVariableReference.Emit, EmitAssign,
533         AddressOf): Do not use EmitThis, that was wrong, use the actual
534         this pointer.
535
536 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
537
538         * class.cs (MethodData.Define): While checking if a method is an
539         interface implementation, improve the test: If we are not public
540         (use new test here: use the computed MethodAttributes directly,
541         instead of the parsed modifier flags) check if the `implementing'
542         method comes from an interface or not.
543
544         * pending.cs (VerifyPendingMethods): Slightly better error
545         message.
546
547         * makefile: add test target that does the mcs bootstrap.
548
549 2003-07-16  Ravi Pratap  <ravi@ximian.com>
550
551         * interface.cs (Define): Do nothing here since there are no
552         members to populate etc. Move the attribute emission out of here
553         since this was just totally the wrong place to put it. Attribute
554         application happens during the 'Emit' phase, not in the 'Define'
555         phase.
556
557         (Emit): Add this method and move the attribute emission here
558
559         * rootcontext.cs (EmitCode): Call the Emit method on interface
560         types too.
561
562 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
563
564         * expression.cs (OverloadResolve): Report error only if Location
565         is not 'Null' which means that there was a probe going on.
566
567 2003-07-14  Martin Baulig  <martin@ximian.com>
568
569         * expression.cs (ConditionalLogicalOperator): New public class to
570         implement user defined conditional logical operators.
571         This is section 14.11.2 in the spec and bug #40505.
572
573 2003-07-14  Martin Baulig  <martin@ximian.com>
574
575         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
576
577 2003-07-14  Martin Baulig  <martin@ximian.com>
578
579         * codegen.cs (EmitContext.InFixedInitializer): New public field.
580
581         * ecore.cs (IVariable.VerifyFixed): New interface method.
582
583         * expression.cs (Unary.ResolveOperator): When resolving the `&'
584         operator, check whether the variable is actually fixed.  Fixes bug
585         #36055.  Set a variable definitely assigned when taking its
586         address as required by the spec.
587
588         * statement.cs (LocalInfo.IsFixed): New field.
589         (LocalInfo.MakePinned): Set `IsFixed' to true.
590
591 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
592
593         * attribute.cs (Attribute.Resolve): While doing a Member lookup
594         for .ctors, ensure that we only ask for members declared in the
595         attribute type (BindingFlags.DeclaredOnly).
596
597         Fixes bug #43632.
598
599         * expression.cs (Error_WrongNumArguments): Report error 1501
600         correctly the way CSC does.
601
602 2003-07-13  Martin Baulig  <martin@ximian.com>
603
604         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
605         lookup on the fully qualified name, to make things like "X.X" work
606         where "X.X" is a fully qualified type name, but we also have a
607         namespace "X" in the using list.  Fixes #41975.
608
609 2003-07-13  Martin Baulig  <martin@ximian.com>
610
611         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
612         function. If we're a CompoundAssign, we need to create an embedded
613         CompoundAssign, not an embedded Assign.
614         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
615         Fixes #45854.
616
617 2003-07-13  Martin Baulig  <martin@ximian.com>
618
619         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
620         work to fix bug #46088.
621
622 2003-07-13  Ravi Pratap <ravi@ximian.com>
623
624         * class.cs (Operator.Emit): Do not emit attributes here - it is
625         taken care of by the Method class that we delegate too. This takes
626         care of bug #45876.
627         
628 2003-07-10  Martin Baulig  <martin@ximian.com>
629
630         * expression.cs (TypeOfVoid): New class.
631         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
632
633 2003-07-10  Martin Baulig  <martin@ximian.com>
634
635         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
636         bug #35957.
637
638 2003-07-10  Martin Baulig  <martin@ximian.com>
639
640         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
641         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
642
643         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
644
645         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
646
647 2003-07-10  Martin Baulig  <martin@ximian.com>
648
649         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
650         of decimal.  Fixes #42850.
651
652         NOTE: I also fixed the created byte blob, but this doesn't work on
653         the MS runtime and csc never produces any byte blobs for decimal
654         arrays.
655
656 2003-07-10  Martin Baulig  <martin@ximian.com>
657
658         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
659         structs; fixes #32068.
660         (Block.AddChildVariableNames): Fixed #44302.
661
662 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
663
664         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
665         
666 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
667
668         * attribute.cs: And this test is onger needed.
669
670 2003-07-08  Martin Baulig  <martin@ximian.com>
671
672         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
673         inaccessible types.  Fixes #36313.
674
675         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
676
677         * namespace.cs (NamespaceEntry): Create implicit entries for all
678         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
679         implicit entries for N1.N2 and N1.
680
681 2003-07-08  Martin Baulig  <martin@ximian.com>
682
683         Rewrote the handling of namespaces to fix a lot of the issues
684         wrt. `using' aliases etc.
685
686         * namespace.cs (Namespace): Splitted this class into a
687         per-assembly `Namespace' and a per-file `NamespaceEntry'.
688
689         * typemanager.cs (TypeManager.IsNamespace): Removed.
690         (TypeManager.ComputeNamespaces): Only compute namespaces from
691         loaded assemblies here, not the namespaces from the assembly we're
692         currently compiling.
693
694 2003-07-08  Martin Baulig  <martin@ximian.com>
695
696         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
697
698 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
699
700         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
701         already fixed it.  
702
703         I thought about the memory savings here, but LookupTypeReflection
704         is used under already very constrained scenarios.  Compiling
705         corlib or mcs only exposes one hit, so it would not really reduce
706         any memory consumption.
707
708 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
709
710         * typemanager.cs: fixes bug #45889 by only adding public types from
711         other assemblies to the list of known types.
712
713 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
714
715         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
716         on the type we resolved.
717
718 2003-07-05  Martin Baulig  <martin@ximian.com>
719
720         * pending.cs (PendingImplementation.ParentImplements): Don't
721         create the proxy if the parent is abstract.
722
723         * class.cs (TypeContainer.DefineIndexers): Process explicit
724         interface implementations first.  Fixes #37714.
725
726 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
727
728         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
729         defined recursively;  but since we modify the input parameters
730         (left is set to `this' temporarily), we reset this value if the
731         left_is_explicit is false, which gives the original semantics to
732         the code.  
733
734         * literal.cs (NullPointer): new class used to represent a null
735         literal in a pointer context.
736
737         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
738         type is a pointer, use a NullPointer object instead of a
739         NullLiteral.   Closes 43687
740
741         (ExplicitConversion): Convert pointer values using
742         the conv opcode to the proper type.
743
744         * ecore.cs (New): change ValueTypeVariable property into a method,
745         that returns whether the valuetype is suitable for being used.
746
747         * expression.cs (Binary.DoNumericPromotions): Only return if we
748         the int constant was a valid uint, and we can return both left and
749         right as uints.  If not, we continue processing, to trigger the
750         type conversion.  This fixes 39018.
751
752         * statement.cs (Block.EmitMeta): During constant resolution, set
753         the CurrentBlock property on the emitcontext, so that we resolve
754         constants propertly.
755
756 2003-07-02  Martin Baulig  <martin@ximian.com>
757
758         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
759         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
760
761         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
762         than emitting it here.
763
764         * statement.cs: Fixed some more flow analysis bugs.
765
766 2003-07-02  Martin Baulig  <martin@ximian.com>
767
768         * class.cs (MethodData.Define): When implementing interface
769         methods, set Final unless we're Virtual.
770
771         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
772         check work for interface methods.
773
774 2003-07-01  Martin Baulig  <martin@ximian.com>
775
776         * ecore.cs (EmitContext.This): Replaced this property with a
777         GetThis() method which takes a Location argument.  This ensures
778         that we get the correct error location for a CS0188.
779
780 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
781
782         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
783         ImplicitStandardConversion.
784
785         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
786
787 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
788
789         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
790         optimization.
791
792 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
793
794         * class.cs (Constructor.Define): Turn off initlocals for unsafe
795         constructors.
796
797         (MethodData.Define): Turn off initlocals for unsafe methods.
798
799 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
800
801         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
802         complete;  Fixes #37521.
803
804         * delegate.cs: Use Modifiers.TypeAttr to compute the
805         TypeAttributes, instead of rolling our own.  This makes the flags
806         correct for the delegates.
807
808 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
809
810         * class.cs (Constructor.Define): Set the private flag for static
811         constructors as well.
812
813         * cs-parser.jay (statement_expression): Set the return value to
814         null, to avoid a crash when we catch an error.
815
816 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
817
818         * cs-parser.jay: Applied patch from Jackson that adds support for
819         extern and unsafe modifiers to destructor declarations.
820
821         * expression.cs: Report error 21 if the user is trying to index a
822         System.Array.
823
824         * driver.cs: Add an error message, suggested by the bug report.
825
826         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
827         if we do not have a ": this ()" constructor initializer.  Fixes 45149
828
829 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
830
831         * namespace.cs: Add some information to reduce FAQs.
832
833 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
834
835         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
836         underlying enumeration types.  Fixes #43915.
837
838         * expression.cs: Treat ushort/short as legal values to be used in
839         bitwise operations.
840
841 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
842
843         * delegate.cs: transfer custom attributes for paramenters from
844         the delegate declaration to Invoke and BeginInvoke.
845
846 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
847
848         * attribute.cs: handle custom marshalers and emit marshal info
849         for fields, too.
850
851 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
852
853         * makefile.gnu: Added anonymous.cs to the compiler sources.
854
855 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
856
857         * iterators.cs: Change the name of the proxy class to include two
858         underscores.
859
860         * cs-parser.jay: Update grammar to include anonymous methods.
861         
862         * anonymous.cs: new file.
863
864 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
865
866         * class.cs (Field.Define): Add missing test for pointers and
867         safety. 
868
869 2003-05-27  Ravi Pratap  <ravi@ximian.com>
870
871         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
872         we use the stobj opcode.
873
874         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
875         since it wasn't the correct fix. 
876
877         It still is puzzling that we are required to use stobj for IntPtr
878         which seems to be a ValueType.
879
880 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
881
882         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
883         during regular simple name resolution.   Now, the trick is that
884         instead of returning for processing the simplename, we do a
885         TypeManager.LookupType (ie, a rooted lookup as opposed to a
886         contextual lookup type).   If a match is found, return that, if
887         not, return for further composition.
888
889         This fixes long-standing 30485.
890
891         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
892         using the address to initialize an object, do an Stobj instead of
893         using the regular Stelem.
894
895         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
896         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
897         Because if we are a BaseIndexerAccess that value will be true.
898         Fixes 43643.
899
900         * statement.cs (GotoCase.Resolve): Return after reporting an
901         error, do not attempt to continue. 
902
903         * expression.cs (PointerArithmetic.Emit): If our operand is a
904         long, convert our constants to match the operand before
905         multiplying.  Convert to I type before adding.   Fixes 43670.
906         
907 2003-05-14  Ravi Pratap  <ravi@ximian.com>
908
909         * enum.cs (ImplicitConversionExists) : Rename to
910         ImplicitEnumConversionExists to remove ambiguity. 
911
912         * ecore.cs (NullCast): New type of cast expression class which
913         basically is very similar to EmptyCast with the difference being
914         it still is a constant since it is used only to cast a null to
915         something else
916         (eg. (string) null)
917
918         * convert.cs (ImplicitReferenceConversion): When casting a null
919         literal, we return a NullCast.
920
921         * literal.cs (NullLiteralTyped): Remove - I don't see why this
922         should be around anymore.
923
924         The renaming (reported was slightly wrong). Corrections:
925
926         ConvertImplicitStandard -> ImplicitConversionStandard
927         ConvertExplicitStandard -> ExplicitConversionStandard
928
929         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
930         before passing them in !
931
932         * convert.cs (ImplicitConversionStandard): When comparing for
933         equal expr and target types, ensure that expr is not a
934         NullLiteral.
935
936         In general, we must not be checking (expr_type ==
937         target_type) in the top level conversion methods
938         (ImplicitConversion, ExplicitConversion etc). This checking is
939         done in the methods that they delegate to.
940
941 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
942
943         * convert.cs: Move Error_CannotConvertType,
944         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
945         ImplicitNumericConversion, ImplicitConversionExists,
946         ImplicitUserConversionExists, StandardConversionExists,
947         FindMostEncompassedType, FindMostSpecificSource,
948         FindMostSpecificTarget, ImplicitUserConversion,
949         ExplicitUserConversion, GetConversionOperators,
950         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
951         TryImplicitIntConversion, Error_CannotConvertImplicit,
952         ConvertImplicitRequired, ConvertNumericExplicit,
953         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
954         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
955         its own file.
956
957         Perform the following renames:
958         
959         StandardConversionExists -> ImplicitStandardConversionExists
960         ConvertImplicit -> ImplicitConversion
961         ConvertImplicitStandard -> ImplicitStandardConversion
962         TryImplicitIntConversion -> ImplicitIntConversion
963         ConvertImplicitRequired -> ImplicitConversionRequired
964         ConvertNumericExplicit -> ExplicitNumericConversion
965         ConvertReferenceExplicit -> ExplicitReferenceConversion
966         ConvertExplicit -> ExplicitConversion
967         ConvertExplicitStandard -> ExplicitStandardConversion
968
969 2003-05-19  Martin Baulig  <martin@ximian.com>
970
971         * statement.cs (TypeInfo.StructInfo): Made this type protected.
972         (TypeInfo): Added support for structs having structs as fields.
973
974         * ecore.cs (FieldExpr): Implement IVariable.
975         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
976         VariableInfo for the field.
977
978 2003-05-18  Martin Baulig  <martin@ximian.com>
979
980         * expression.cs (This.DoResolve): Report a CS0027 if we're
981         emitting a field initializer.
982
983 2003-05-18  Martin Baulig  <martin@ximian.com>
984
985         * expression.cs (This.ResolveBase): New public function.
986         (This.DoResolve): Check for CS0188.
987
988         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
989         This.Resolve().
990
991         * ecore.cs (MethodGroupExpr.DoResolve): Set the
992         `instance_expression' to null if we don't have any non-static
993         methods.
994
995 2003-05-18  Martin Baulig  <martin@ximian.com>
996
997         Reworked the way how local variables and parameters are handled by
998         the flow analysis code.
999
1000         * statement.cs (TypeInfo, VariableMap): New public classes.
1001         (VariableInfo): New public class.  This is now responsible for
1002         checking whether a variable has been assigned.  It is used for
1003         parameters and local variables.
1004         (Block.EmitMeta): Take the InternalParameters as argument; compute
1005         the layout of the flow vectors here.
1006         (Block.LocalMap, Block.ParameterMap): New public properties.
1007         (FlowBranching): The .ctor doesn't get the InternalParameters
1008         anymore since Block.EmitMeta() now computes the layout of the flow
1009         vector.
1010         (MyStructInfo): This class is now known as `StructInfo' and nested
1011         in `TypeInfo'; we don't access this directly anymore.
1012
1013         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
1014         property and removed IsAssigned(), IsFieldAssigned(),
1015         SetAssigned() and SetFieldAssigned(); we now call them on the
1016         VariableInfo so we don't need to duplicate this code everywhere.
1017
1018         * expression.cs (ParameterReference): Added `Block block' argument
1019         to the .ctor.
1020         (LocalVariableReference, ParameterReference, This): The new
1021         VariableInfo class is now responsible for all the definite
1022         assignment stuff.
1023
1024         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
1025         IsParameterAssigned, SetParameterAssigned): Removed.
1026
1027 2003-05-18  Martin Baulig  <martin@ximian.com>
1028
1029         * typemanager.cs (InitCoreTypes): Try calling
1030         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
1031         the 3-args-version.  Corlib now also needs our `void_type'.
1032         (GetMethod): Added overloaded version which takes an optional
1033         `bool report_errors' to allow lookups of optional methods.
1034
1035 2003-05-12  Martin Baulig  <martin@ximian.com>
1036
1037         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
1038         only used for locals and not for parameters.
1039
1040 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
1041
1042         * support.cs (InternalParameters.ParameterType): Return the
1043         ExternalType of the parameter.
1044
1045         * parameter.cs (Parameter.ExternalType): drop the two arguments,
1046         they were unused.
1047
1048 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
1049
1050         * class.cs (MethodData.Define): Do not set the `newslot' on
1051         interface members, if they are also flagged as "override".
1052
1053         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
1054         better code for ++i and i++.  This only works for static fields
1055         and local variables.
1056
1057         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
1058         want to pull the DeclSpace out of the builder_to_declspace instead
1059         of the TypeBuilder (like in TypeContainer.FindMembers).
1060
1061         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
1062         instead of LookupTypeContainer.  Fixes the crash on .NET for
1063         looking up interface members.
1064
1065         * const.cs: Create our own emit context during the Definition
1066         stage, so that constants are evaluated in the proper context, when
1067         a recursive definition happens.
1068
1069 2003-05-11  Martin Baulig  <martin@ximian.com>
1070
1071         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
1072         new block for a switch section.
1073         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
1074         the adding/lookup in the switch block.  Fixes #39828.
1075
1076 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
1077
1078         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
1079         functionality: I needed to convert the data after I had performed
1080         the add/sub operation into the operands type size.
1081
1082         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
1083         pass the type for the box operation, otherwise the resulting
1084         object would have been of type object.
1085
1086         (BoxedCast): Add constructor to specify the type to box as.
1087
1088 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
1089
1090         * iterators.cs: I was reusing the `count' variable inadvertently,
1091         take steps to not allow this to happen.
1092
1093 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
1094
1095         * attribute.cs (Attribute.Resolve): Params attributes are encoded
1096         by creating an array at the point where the params starts and
1097         putting all those arguments there, then adjusting the size of the
1098         array.
1099
1100 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
1101
1102         * expression.cs (New.AddressOf): Implement interface
1103         IMemoryLocation.  This is used when the `new' operator is used in
1104         the context of an invocation to a method on a value type.
1105
1106         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
1107         example. 
1108
1109         * namespace.cs: Also check the using aliases here.
1110
1111         * driver.cs: Move the test for using validity after the types have
1112         been entered, so we do a single pass that also includes the using
1113         aliases. 
1114
1115         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
1116         in the regular case.   CreateSiblingForFinally is doing extra
1117         error checking.
1118
1119         * attribute.cs (GetAttributeArgumentExpression): Store the result
1120         on an out value, and use the return value to indicate failure
1121         instead of using null (which is a valid return for Constant.GetValue).
1122
1123         * statement.cs: Perform the analysis flow for the increment
1124         portion after the statement, because this will be the real flow of
1125         execution.  Fixes #42385
1126
1127         * codegen.cs (EmitContext.EmitArgument,
1128         EmitContext.EmitStoreArgument): New helper functions when the
1129         RemapToProxy flag is set.
1130
1131         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
1132         function.
1133
1134         Add support for remapping parameters. 
1135
1136         * iterators.cs: Propagate parameter values;  Store parameter
1137         values in the proxy classes.
1138         
1139 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
1140
1141         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
1142         need a proxy reference;  I do not know what I was thinking
1143
1144         * cs-parser.jay (constructor_initializer): catch another error,
1145         and display nice message.
1146         
1147         (field_declaration): catch void field declaration
1148         to flag a better error. 
1149
1150         * class.cs (MemberBase.CheckBase): Report an error instead of a
1151         warning if a new protected member is declared in a struct. 
1152         (Field.Define): catch the error of readonly/volatile.
1153
1154         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
1155
1156         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
1157         volatile variable is taken
1158
1159 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
1160
1161         * statement.cs (Fixed.Resolve): Report an error if we are not in
1162         an unsafe context.
1163
1164 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
1165
1166         * typemanager.cs: reuse the code that handles type clashes for
1167         delegates and enumerations.
1168
1169         * class.cs (Report28): Always report.
1170
1171         * expression.cs (EncodeAsAttribute): Allow nulls here.
1172
1173 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
1174
1175         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
1176         the functionality for testing whether an expression is valid for
1177         an attribute here.  Also handle the case of arrays of elements
1178         being stored. 
1179
1180         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
1181         encoding a linear array into an array of objects that are suitable
1182         to be passed to an CustomAttributeBuilder.
1183
1184         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
1185
1186         * ecore.cs: (FieldExpr): Handle field remapping here.
1187
1188         * iteratators.cs: Pass the instance variable (if the method is an
1189         instance method) to the constructors, so we can access the field
1190         variables on the class.
1191
1192         TODO: Test this with structs.  I think the THIS variable on
1193         structs might have to be a pointer, and not a refenrece
1194
1195 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
1196
1197         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
1198         local variables to fields in a proxy class.
1199
1200         * iterators.cs (PopulateProxy): Rename our internal fields to
1201         <XXX>.  
1202         Create a <THIS> field if we are an instance method, so we can
1203         reference our parent container variables.
1204         (MapVariable): Called back from the EmitContext code to enter a
1205         new variable to field mapping into the proxy class (we just create
1206         a FieldBuilder).
1207
1208         * expression.cs
1209         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
1210         for using the remapped locals to fields.
1211
1212         I placed the code here, because that gives the same semantics to
1213         local variables, and only changes the Emit code.
1214
1215         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
1216         statements inside iterators.
1217         (VariableInfo): Add a FieldBuilder for the cases when we are
1218         remapping local variables to fields in a proxy class
1219
1220         * ecore.cs (SimpleNameResolve): Avoid testing two times for
1221         current_block != null.
1222
1223         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
1224         not cope with strings, as it has been moved to the
1225         TableSwitchEmit.  Fixed bug in switch generation.
1226
1227         * expression.cs (New.DoResolve): Provide more context for the user
1228         when reporting an error.
1229
1230         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
1231         pointers. 
1232
1233         * expression.cs (MemberAccess.DoResolve): When we get a type back,
1234         check the permissions for it.  Note than in a type-resolution
1235         context the check was already present in DeclSpace.ResolveType,
1236         but was missing from the MemberAccess.
1237
1238         (ArrayCreation.CheckIndices): warn if the user has
1239         more nested levels of expressions, but there are no more
1240         dimensions specified.  Avoids crash on bug 41906.
1241
1242 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
1243
1244         * statement.cs (Block): replace Implicit bool, for a generic
1245         flags.   
1246         New flag: `Unchecked'.  This is used during the EmitMeta phase
1247         (which is out-of-line with the regular Resolve/Emit process for a
1248         statement, as this is done ahead of time, but still gets a chance
1249         to call constant resolve).
1250         
1251         (Block.Flags): new enum for adding a new flag.
1252
1253         (Block.EmitMeta): track the state of unchecked.
1254         
1255         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
1256         to enable constant resolution to work there as well.
1257
1258 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
1259
1260         * typemanager.cs (ienumerable_type): Also look up
1261         System.Collections.IEnumerable. 
1262
1263 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
1264
1265         TODO: Test more than one conditional per method.
1266         
1267         * class.cs (Indexer.Define): Report the location where the user is
1268         referencing the unsupported feature.
1269
1270         (MethodData): Overload the use of `conditionals' to
1271         minimize the creation of needless ArrayLists.   This saves roughly
1272         212kb on my machine.
1273
1274         (Method): Implement the new IIteratorContainer interface.
1275         (Method.SetYields): Implement the method by setting the ModFlags
1276         to contain METHOD_YIELDS.
1277         
1278         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
1279         which just got set to null.
1280
1281         * iterators.cs: New file.
1282
1283         (Yield, YieldBreak): New statements.
1284
1285         * statement.cs (Return.Resolve): Flag an error if we are used in
1286         an iterator method.
1287
1288         * codegen.cs (InIterator): New flag set if the code is being
1289         compiled in an iterator method.
1290
1291         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
1292         internal modifier, and we just use it to avoid adding extra
1293         fields, as this is seldom used.  
1294
1295         * cs-parser.jay: Add yield_statement (yield and yield break).
1296
1297         * driver.cs: New flag -v2 to turn on version 2 features. 
1298
1299         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
1300         hashtable when v2 is enabled.
1301
1302 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
1303
1304         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
1305         there is already a namespace defined with this name.
1306
1307         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
1308         people upgraded their corlibs.
1309
1310         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
1311         always use fully qualified types, no need to use the compiler
1312         front end.
1313
1314         (TypeManager.IsNamespace): Use binarysearch.
1315         
1316         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
1317         AddDelegate): I did not quite use the new IsValid API properly: I
1318         have to pass the short-name and the fullname.  I was passing only
1319         the basename instead of the fullname sometimes. 
1320
1321         (TypeContainer.DefineType): call NamespaceClash.
1322
1323         * interface.cs (Interface.DefineType): use NamespaceClash before
1324         defining the type.
1325
1326         * delegate.cs (Delegate.DefineType): use NamespaceClash before
1327         defining the type.
1328
1329         * enum.cs: (Enum.DefineType): use NamespaceClash before
1330         defining the type.
1331
1332         * typemanager.cs (: 3-line patch that gives us some tasty 11%
1333         speed increase.  First, use the negative_hits cache when we get a
1334         negative.  Second, add the type with its full original name
1335         instead of the new . and + encoded name (reflection uses + to
1336         separate type from a nested type).  Use LookupTypeReflection
1337         directly which bypasses the type->name hashtable (that we already
1338         know does not contain the type.
1339         
1340         * decl.cs (DeclSpace.ResolveTypeExpr): track the
1341         location/container type. 
1342
1343         * driver.cs: When passing utf8, use directly the UTF8Encoding.
1344
1345 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
1346
1347         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
1348
1349         * delegate.cs (NewDelegate.Resolve): Test whether an instance
1350         method is being referenced in the method group from a static
1351         context, and report error 120 if so.
1352
1353         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
1354         Error118. 
1355
1356         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
1357         is created, we create the A namespace).
1358
1359         * cs-parser.jay: A namespace also introduces a DeclarationFound.
1360         Fixes #41591
1361
1362 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
1363
1364         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
1365         invocation to ModuleBuilder.GetType with the same values will
1366         return a new type instance, so we need to cache its return
1367         values. 
1368
1369         * expression.cs (Binary.ResolveOperator): Only allow the compare
1370         operators on enums if they are of the same type.
1371
1372         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
1373         types of ValueType on their own case.  Before we were giving them
1374         the same treatment as objects.
1375
1376         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
1377         fullname.  Short name is used to compare against container name.
1378         Fullname is used to check against defined namespace names.
1379         
1380         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
1381         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
1382
1383         (Method.CheckBase): Call parent.
1384         (MemberBase.CheckBase): Check for protected members on sealed
1385         classes.
1386         (PropertyBase.CheckBase): Call parent.
1387         (Field.Define): Call parent.
1388
1389         * report.cs: Negative error codes are now mapped to 8000 - code,
1390         so that the display is render more nicely.
1391
1392         * typemanager.cs: Do not use try/catch, instead report a regular
1393         error. 
1394
1395         (GetPointerType, GetReferenceType): These methods provide
1396         mechanisms to obtain the T* and T& from a T.  We had the code
1397         previously scattered around the code base, and it also used
1398         TypeManager.LookupType that would go through plenty of caches.
1399         This one goes directly to the type source.
1400
1401         In some places we did the Type.GetType followed by
1402         ModuleBuilder.GetType, but not in others, so this unifies the
1403         processing as well.
1404
1405         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
1406         statements now that we have namespace information.
1407
1408         * typemanager.cs (IsNamespace): New method, returns whether the
1409         string presented is a namespace or not.
1410
1411         (ComputeNamespaces): New public entry point, computes the list of
1412         available namespaces, using the GetNamespaces API call in Mono, or
1413         the slower version in MS.NET.   
1414
1415         Now before we start the semantic analysis phase, we have a
1416         complete list of namespaces including everything that the user has
1417         provided.
1418
1419         Deleted old code to cache namespaces in .nsc files.
1420
1421 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
1422
1423         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
1424         class/struct location definition Location for the implicit
1425         constructor location.
1426
1427         (Operator.Define): Use the location of the operator for the
1428         implicit Method definition.
1429
1430         (Constructor.Emit): use the constructor location for the implicit
1431         base initializer constructor.
1432
1433         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
1434         and the Expression class now contains two new methods:
1435
1436         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
1437         isolate type lookup from the rest of the resolution process.
1438
1439         Since we use Expressions to hold type definitions due to the way
1440         we parse the input we have historically overloaded Resolve to
1441         perform the Type lookups if a special flag is passed.  Now this is
1442         eliminated and two methods take their place. 
1443         
1444         The differences in the two methods between xStep and xTerminal is
1445         that xStep is involved in our current lookup system that uses
1446         SimpleNames to compose a name, while xTerminal is used just to
1447         catch the case where the simplename lookup failed.
1448         
1449 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
1450
1451         * expression.cs (ResolveMemberAccess): Remove redundant code.
1452         TypeExpr expressions are always born fully resolved.
1453
1454         * interface.cs (PopulateMethod): Do not lookup the types twice.
1455         We were doing it once during SemanticAnalysis and once during
1456         PopulateMethod.
1457
1458         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
1459         in local variable type definitions, were being returned as a
1460         SimpleName (we decomposed everything into a string), that is
1461         because primary_expression was being used instead of a type in the
1462         grammar (reduce/reduce conflicts).
1463
1464         The part that was wrong is that we converted the expression into a
1465         string (an oversimplification in one hand, compounded with primary
1466         expressions doing string concatenation).
1467
1468         So things like:
1469
1470         A.B.C [] x;
1471
1472         Would return "A.B.C[]" as a SimpleName.  This stopped things like
1473         using clauses from working on this particular context.  And a type
1474         was being matched directly against "A.B.C[]".
1475
1476         We now use the correct approach, and allow for ComposedCast to be
1477         part of the unary expression.  So the "A.B.C []" become a composed
1478         cast of "A.B.C" (as a nested group of MemberAccess with a
1479         SimpleName at the end) plus the rank composition "[]". 
1480
1481         Also fixes 35567
1482         
1483 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
1484
1485         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
1486         for the access level checking.
1487
1488         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
1489         `TypeContainer container', because I kept getting confused when I
1490         was debugging this code.
1491
1492         * expression.cs (Indexers): Instead of tracking getters/setters,
1493         we now track them in parallel.  We create one arraylist less, but
1494         most importantly it is possible now for the LValue code to find a
1495         matching get for a set.
1496
1497         (IndexerAccess.DoResolveLValue): Update the code.
1498         GetIndexersForType has been modified already to extract all the
1499         indexers from a type.  The code assumed it did not.
1500
1501         Also make the code set the correct return type for the indexer.
1502         This was fixed a long time ago for properties, but was missing for
1503         indexers.  It used to be void_type.
1504
1505         (Binary.Emit): Test first for doubles instead of
1506         floats, as they are more common.
1507
1508         (Binary.EmitBranchable): Use the .un version of the branch opcodes
1509         when dealing with floats and the <=, >= operators.  This fixes bug
1510         #39314 
1511
1512         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
1513         to load the array value by emitting a load on the foreach variable
1514         type.  This was incorrect.  
1515
1516         We now emit the code to load an element using the the array
1517         variable type, and then we emit the conversion operator.
1518
1519         Fixed #40176
1520
1521 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
1522
1523         * attribute.cs: Avoid allocation of ArrayLists in the common case.
1524
1525 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
1526
1527         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
1528         test for protection before we test for signatures. 
1529
1530         (MethodSignature.ToString): implement.
1531
1532         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
1533         to the case where we reduced into a LongConstant.
1534
1535         * decl.cs (CheckAccessLevel): If the type is an array, we can not
1536         depend on whether the information is acurrate, because the
1537         Microsoft runtime will always claim that the array type is public,
1538         regardless of the real state.
1539
1540         If the type is a pointer, another problem happens: the type is
1541         reported as non-public in Microsoft.  
1542
1543         In both cases we have to call CheckAccessLevel recursively with
1544         the underlying type as the argument to be tested.
1545
1546 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
1547
1548         * assign.cs (Assign.Emit): If we are dealing with a compound
1549         assignment expression, we should use the code path that stores the
1550         intermediate result in a temporary value.  This fixes #40903.
1551
1552         *expression.cs (Indirection.ToString): Provide ToString method for
1553         debugging. 
1554         
1555 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
1556
1557         * class.cs: Null out fields holding references to Block objects so
1558         they can be garbage collected.
1559
1560         * expression.cs (OverloadResolve): Remove unused local.
1561
1562 2003-04-07  Martin Baulig  <martin@ximian.com>
1563
1564         * codegen.cs (EmitContext.CurrentFile): New public field.
1565         (EmitContext.Mark): Use the CurrentFile to check whether the
1566         location is in the correct file.
1567         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
1568
1569 2003-04-07  Martin Baulig  <martin@ximian.com>
1570
1571         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
1572
1573         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
1574         location.  [FIXME: The location argument which gets passed to this
1575         method is sometimes wrong!]
1576
1577 2003-04-07  Nick Drochak <ndrochak@gol.com>
1578
1579         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
1580
1581 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
1582
1583         * expression.cs (Indirection.EmitAssign): We were using the
1584         temporary, but returning immediately instead of continuing the
1585         EmitAssing flow.
1586
1587 2003-04-06  Martin Baulig  <martin@ximian.com>
1588
1589         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
1590         if it's a nested child, but also deriving from the outer class.
1591         See test 190.cs.
1592
1593         * typemanager.cs (IsNestedChildOf): Make this work if it's a
1594         nested child, but also deriving from the outer class.  See
1595         test-190.cs.
1596         (FilterWithClosure): We may access private members of the outer
1597         class if we're a nested child and deriving from the outer class.
1598         (RealMemberLookup): Only set `closure_private_ok' if the
1599         `original_bf' contained BindingFlags.NonPublic.
1600
1601 2003-04-05  Martin Baulig  <martin@ximian.com>
1602
1603         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
1604         probe if its a type parameter, and if so, flag an error.
1605
1606         * decl.cs: Move here the SetParameterInfo code from class.cs.
1607         Handle IsGeneric here.
1608
1609         Handle a variety of errors in the parameter info definition.
1610
1611         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
1612         type parameters here.
1613
1614         * cs-parser.jay (class_declaration): report errors for parameters
1615         here as well.
1616
1617 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
1618
1619         * generic.cs: New file, contains support code for generics.
1620
1621         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
1622         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
1623
1624         Update parser for the above removals.
1625
1626         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
1627         now taken care of in the parser.
1628
1629 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
1630
1631         * class.cs (Event.Define): Do not allow abstract events to have
1632         initializers. 
1633
1634 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
1635
1636         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
1637         block in event declarations.
1638
1639         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
1640         value type, get its address.
1641
1642         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
1643         leaving a class on the stack instead of a boolean value (int
1644         0/1).  Change the code so we compare against null, and then the
1645         result against zero.
1646
1647         * class.cs (TypeContainer.GetClassBases): We were checking for the
1648         parent class being sealed too late.
1649
1650         * expression.cs (Binary.Emit): For <= and >= when dealing with
1651         floating point values, use cgt.un and clt.un instead of cgt and
1652         clt alone.
1653
1654 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
1655
1656         * statement.cs: Apply the same optimization as MS: skip the 
1657         GetEnumerator returning an IEnumerator, and use the one returning a 
1658         CharEnumerator instead. This allows us to avoid the try-finally block 
1659         and the boxing.
1660
1661 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
1662
1663         * cs-parser.jay: Attributes cannot be applied to
1664                          namespaces. Fixes #40473
1665
1666 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1667
1668         * class.cs:
1669         (Add*): check if the name is valid using the full name for constants,
1670         fields, properties and events.
1671
1672 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
1673
1674         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
1675         char constants to be part of the enumeration.
1676
1677         * expression.cs (Conditional.DoResolve): Add support for operator
1678         true. Implements the missing functionality from 14.12
1679
1680         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
1681         operator true/false as required by the spec.
1682
1683         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
1684         implicit conversion to boolean.
1685
1686         * statement.cs (Statement.ResolveBoolean): A boolean expression is
1687         also one where the type implements `operator true'. 
1688
1689         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
1690         get an expression that will invoke operator true based on an
1691         expression.  
1692
1693         (GetConversionOperators): Removed the hack that called op_True
1694         here.  
1695
1696         (Expression.ResolveBoolean): Move this from Statement.
1697
1698 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
1699
1700         * ecore.cs (FieldExpr): do not allow initialization of initonly
1701         fields on derived classes
1702
1703 2003-03-13  Martin Baulig  <martin@ximian.com>
1704
1705         * statement.cs (Block.Emit): Call ig.BeginScope() and
1706         ig.EndScope() when compiling with debugging info; call
1707         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
1708
1709 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
1710
1711         * expression.cs (Indexers): Do not construct immediately, allow
1712         for new members to be appended as we go.  Fixes 38143
1713
1714 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1715
1716         * expression.cs: save/restore context when resolving an unchecked
1717         expression.
1718
1719 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
1720
1721         * cfold.cs: Catch division by zero in modulus operator during
1722         constant folding.
1723
1724 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
1725
1726         * interface.cs (Interface.DefineMembers): Avoid defining members
1727         twice. 
1728
1729 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
1730
1731         * driver.cs: handle the +/- options for -noconfig
1732
1733         * statement.cs (Unckeched.Resolve): Also track the state of
1734         unchecked in the Resolve phase.
1735
1736 2003-02-27  Martin Baulig  <martin@ximian.com>
1737
1738         * ecore.cs (Expression.MemberLookup): Don't create a
1739         MethodGroupExpr for something which is not a method.  Fixes #38291.
1740
1741 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
1742
1743         * class.cs (MemberBase.CheckParameters): Also check that the type
1744         is unmanaged if it is a pointer.
1745
1746         * expression.cs (SizeOf.Resolve): Add location information.
1747
1748         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
1749         a managed type is declared.
1750
1751         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
1752         parameter modifiers as well.  Fixes bug 38606
1753
1754         * class.cs: Very sad.  Am backing out the speed up changes
1755         introduced by the ArrayList -> Array in the TypeContainer, as they
1756         were not actually that much faster, and introduced a bug (no error
1757         reports on duplicated methods).
1758
1759         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
1760         source first, this will guarantee that we have a valid expression
1761         before calling in lower levels functions that will require a
1762         resolved object.  Then use this original_source in the
1763         target.ResolveLValue instead of the original source that was
1764         passed to us.
1765
1766         Another change.  Use target.Resolve instead of LValueResolve.
1767         Although we are resolving for LValues, we will let the Assign code
1768         take care of that (it will be called again from Resolve).  This
1769         basically allows code like this:
1770
1771         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
1772         class Y { void A (X x) { x [0] += o; }
1773
1774         The problem was that the indexer was trying to resolve for
1775         set_Item (idx, object o) and never finding one.  The real set_Item
1776         was set_Item (idx, X).  By delaying the process we get the right
1777         semantics. 
1778
1779         Fixes bug 36505
1780         
1781 2003-02-23  Martin Baulig  <martin@ximian.com>
1782
1783         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
1784         while calling DoEmit ().
1785
1786         * codegen.cs (EmitContext.Mark): Don't mark locations in other
1787         source files; if you use the #line directive inside a method, the
1788         compiler stops emitting line numbers for the debugger until it
1789         reaches the end of the method or another #line directive which
1790         restores the original file.
1791
1792 2003-02-23  Martin Baulig  <martin@ximian.com>
1793
1794         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
1795
1796 2003-02-23  Martin Baulig  <martin@ximian.com>
1797
1798         * statement.cs (Block.AddChildVariableNames): We need to call this
1799         recursively, not just for our immediate children.
1800
1801 2003-02-23  Martin Baulig  <martin@ximian.com>
1802
1803         * class.cs (Event.Define): Always make the field private, like csc does.
1804
1805         * typemanager.cs (TypeManager.RealMemberLookup): Make events
1806         actually work, fixes bug #37521.
1807
1808 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
1809
1810         * delegate.cs: When creating the various temporary "Parameters"
1811         classes, make sure that we call the ComputeAndDefineParameterTypes
1812         on those new parameters (just like we do with the formal ones), to
1813         allow them to be resolved in the context of the DeclSpace.
1814
1815         This fixes the bug that Dick observed in Bugzilla #38530.
1816
1817 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
1818
1819         * expression.cs (ResolveMemberAccess): When resolving a constant,
1820         do not attempt to pull a constant if the value was not able to
1821         generate a valid constant.
1822
1823         * const.cs (LookupConstantValue): Do not report more errors than required.
1824
1825 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1826
1827         * expression.cs: fixes bug #38328.
1828
1829 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1830
1831         * class.cs: Changed all the various members that can be part of a
1832         class from being an ArrayList to be an Array of the right type.
1833         During the DefineType type_list, interface_list, delegate_list and
1834         enum_list are turned into types, interfaces, delegates and enums
1835         arrays.  
1836
1837         And during the member population, indexer_list, event_list,
1838         constant_list, field_list, instance_constructor_list, method_list,
1839         operator_list and property_list are turned into their real arrays.
1840
1841         Although we could probably perform this operation earlier, for
1842         good error reporting we need to keep the lists and remove the
1843         lists for longer than required.
1844
1845         This optimization was triggered by Paolo profiling the compiler
1846         speed on the output of `gen-sample-program.pl' perl script. 
1847
1848         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
1849         not crash in methods like MemberLookupFailed that use this field.  
1850
1851         This problem arises when the compiler fails to resolve a type
1852         during interface type definition for example.
1853
1854 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
1855
1856         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
1857         inherit from System.Object, so we have to stop at null, not only
1858         when reaching System.Object.
1859
1860 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
1861
1862         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
1863         DeclaredOnly because the parent indexer might have had a different
1864         name, but did not loop until the top of the hierarchy was reached.
1865
1866         The problem this one fixes is 35492: when a class implemented an
1867         indexer from an interface, we were getting the interface method
1868         (which was abstract) and we were flagging an error (can not invoke
1869         abstract method).
1870
1871         This also keeps bug 33089 functioning, and test-148 functioning.
1872
1873         * typemanager.cs (IsSpecialMethod): The correct way of figuring
1874         out if a method is special is to see if it is declared in a
1875         property or event, or whether it is one of the predefined operator
1876         names.   This should fix correctly #36804.
1877
1878 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
1879
1880         The goal here is to remove the dependency on EmptyCast.Peel ().
1881         Killing it completely.
1882         
1883         The problem is that currently in a number of places where
1884         constants are expected, we have to "probe" for an EmptyCast, and
1885         Peel, which is not the correct thing to do, as this will be
1886         repetitive and will likely lead to errors. 
1887
1888         The idea is to remove any EmptyCasts that are used in casts that
1889         can be reduced to constants, so we only have to cope with
1890         constants. 
1891
1892         This bug hunt was triggered by Bug 37363 and the desire to remove
1893         the duplicate pattern where we were "peeling" emptycasts to check
1894         whether they were constants.  Now constants will always be
1895         constants.
1896         
1897         * ecore.cs: Use an enumconstant here instead of wrapping with
1898         EmptyCast.  
1899
1900         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
1901         throwing me off.  By handling this we can get rid of a few hacks.
1902         
1903         * statement.cs (Switch): Removed Peel() code.
1904
1905 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
1906
1907         * class.cs: Location information for error 508
1908
1909         * expression.cs (New.DoResolve): Add a guard against double
1910         resolution of an expression.  
1911
1912         The New DoResolve might be called twice when initializing field
1913         expressions (see EmitFieldInitializers, the call to
1914         GetInitializerExpression will perform a resolve on the expression,
1915         and later the assign will trigger another resolution
1916
1917         This leads to bugs (#37014)
1918
1919         * delegate.cs: The signature for EndInvoke should contain any ref
1920         or out parameters as well.  We were not doing this in the past. 
1921
1922         * class.cs (Field.Define): Do not overwrite the type definition
1923         inside the `volatile' group.  Turns out that volatile enumerations
1924         were changing the type here to perform a validity test, which
1925         broke conversions. 
1926
1927 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
1928
1929         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
1930         and structs, we do not want to load the instance variable
1931
1932         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
1933         enum_type has to be handled like an object reference (implicit
1934         conversions exists from this to object), but the regular IsClass
1935         and IsValueType tests will never return true for this one.
1936
1937         Also we use TypeManager.IsValueType instead of type.IsValueType,
1938         just for consistency with the rest of the code (this is only
1939         needed if we ever use the construct exposed by test-180.cs inside
1940         corlib, which we dont today).
1941
1942 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
1943
1944         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
1945         just InternalCall.
1946
1947 2003-02-09  Martin Baulig  <martin@ximian.com>
1948
1949         * namespace.cs (Namespace..ctor): Added SourceFile argument.
1950         (Namespace.DefineNamespaces): New static public method; this is
1951         called when we're compiling with debugging to add all namespaces
1952         to the symbol file.
1953
1954         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
1955         pass it to the Namespace's .ctor.
1956
1957         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
1958         and MethodBase arguments; pass the namespace ID to the symwriter;
1959         pass the MethodBase instead of the token to the symwriter.
1960         (SymbolWriter.DefineNamespace): New method to add a namespace to
1961         the symbol file.
1962
1963 2003-02-09  Martin Baulig  <martin@ximian.com>
1964
1965         * symbolwriter.cs: New file.  This is a wrapper around
1966         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
1967         methods here in near future.
1968
1969 2003-02-09  Martin Baulig  <martin@ximian.com>
1970
1971         * codegen.cs (EmitContext.Mark): Just pass the arguments to
1972         ILGenerator.MarkSequencePoint() which are actually used by the
1973         symbol writer.
1974
1975 2003-02-09  Martin Baulig  <martin@ximian.com>
1976
1977         * location.cs (SourceFile): New public sealed class.  This
1978         contains the name and an index which is used in the location's token.
1979         (Location): Reserve an appropriate number of bits in the token for
1980         the source file instead of walking over that list, this gives us a
1981         really huge performance improvement when compiling with debugging.
1982
1983         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
1984         `SourceFile' argument instead of a string.
1985         (Driver.ProcessFile): Add all the files via Location.AddFile(),
1986         but don't parse/tokenize here, we need to generate the list of all
1987         source files before we do that.
1988         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
1989         the files.
1990
1991         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
1992         instead of a string.
1993
1994         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
1995         of a string.
1996
1997 2003-02-09  Martin Baulig  <martin@ximian.com>
1998
1999         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
2000         filename on `#line default'.
2001
2002 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
2003
2004         * statement.cs: don't clear the pinned var when the fixed statement
2005         returns from the method (fixes bug#37752).
2006
2007 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
2008
2009         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
2010         to IsValueType.
2011
2012 2003-02-07  Martin Baulig  <martin@ximian.com>
2013
2014         * driver.cs: Removed the `--debug-args' command line argument.
2015
2016         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
2017         automatically by the AsssemblyBuilder.
2018         (CodeGen.InitializeSymbolWriter): We don't need to call any
2019         initialization function on the symbol writer anymore.  This method
2020         doesn't take any arguments.
2021
2022 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
2023
2024         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
2025         from referenced assemblies as well.
2026
2027 2003-02-02  Martin Baulig  <martin@ximian.com>
2028
2029         * class.cs (MethodData.Emit): Generate debugging info for external methods.
2030
2031 2003-02-02  Martin Baulig  <martin@ximian.com>
2032
2033         * class.cs (Constructor.Emit): Open the symbol writer before
2034         emitting the constructor initializer.
2035         (ConstructorInitializer.Emit): Call ec.Mark() to allow
2036         single-stepping through constructor initializers.
2037
2038 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
2039
2040         * class.cs: Handle error 549: do not allow virtual methods in
2041         sealed classes. 
2042
2043 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
2044
2045         * decl.cs: Check access levels when resolving types
2046         
2047 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
2048
2049         * statement.cs: Add parameters and locals set in catch blocks that might 
2050         return to set vector
2051
2052 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
2053
2054         * class.cs (Operator): Set the SpecialName flags for operators.
2055         
2056         * expression.cs (Invocation.DoResolve): Only block calls to
2057         accessors and operators on SpecialName methods.
2058
2059         (Cast.TryReduce): Handle conversions from char constants.
2060
2061
2062 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
2063
2064         * statement.cs: small memory and time optimization in FlowBranching.
2065         
2066 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
2067
2068         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
2069         problem that the last fix but in the other sid (Set).
2070
2071         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
2072         access when there is no indexer in the hierarchy.
2073         
2074 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
2075
2076         * class.cs: Combine some if statements.
2077
2078 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2079
2080         * driver.cs: fixed bug #37187.
2081
2082 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
2083
2084         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
2085         any indexer, it's needed to build a list with all the indexers in the
2086         hierarchy (AllGetters), else we have problems. Fixes #35653.
2087
2088 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
2089
2090         * class.cs (MethodData.Define): It is wrong for an interface
2091         implementation to be static in both cases: explicit and implicit.
2092         We were only handling this in one case.
2093
2094         Improve the if situation there to not have negations.
2095         
2096         * class.cs (Field.Define): Turns out that we do not need to check
2097         the unsafe bit on field definition, only on usage.  Remove the test.
2098
2099 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2100
2101         * driver.cs: use assembly.Location instead of Codebase (the latest
2102         patch made mcs fail when using MS assemblies).
2103
2104 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
2105
2106         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
2107         get the path to *corlib.dll.
2108
2109 2003-01-21  Nick Drochak <ndrochak@gol.com>
2110
2111         * cs-tokenizer.cs:
2112         * pending.cs:
2113         * typemanager.cs: Remove compiler warnings
2114
2115 2003-01-20  Duncan Mak  <duncan@ximian.com>
2116
2117         * AssemblyInfo.cs: Bump the version number to 0.19.
2118         
2119 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2120
2121         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
2122
2123 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
2124
2125         * class.cs (Constructor::Emit): Emit debugging info for constructors.
2126
2127 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
2128
2129         * cs-parser.jay: Small fix: we were not comparing the constructor
2130         name correctly.   Thanks to Zoltan for the initial pointer.
2131
2132 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
2133
2134         * cs-tokenizer.cs: Set file name when specified with #line
2135
2136 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
2137
2138         * cs-parser.jay: Only perform the constructor checks here if we
2139         are named like the class;  This will help provider a better
2140         error.  The constructor path is taken when a type definition is
2141         not found, but most likely the user forgot to add the type, so
2142         report that rather than the constructor error.
2143
2144 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
2145
2146         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
2147         allocations.
2148
2149 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2150
2151         * cs-parser.jay: Add cleanup call.
2152
2153 2003-01-13  Duncan Mak  <duncan@ximian.com>
2154
2155         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
2156         consistent with other methods.
2157
2158 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
2159
2160         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
2161         
2162 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
2163
2164         * attribute.cs: only set GuidAttr to true when we have a
2165         GuidAttribute.
2166
2167 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2168
2169         * ecore.cs:
2170         * expression.cs:
2171         * typemanager.cs: fixes to allow mcs compile corlib with the new
2172         Type.IsSubclassOf fix.
2173
2174 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
2175
2176         * expression.cs (LocalVariableReference.DoResolve): Classify a
2177         constant as a value, not as a variable.   Also, set the type for
2178         the variable.
2179
2180         * cs-parser.jay (fixed_statement): take a type instead of a
2181         pointer_type, so we can produce a better error message later.
2182         
2183         * statement.cs (Fixed.Resolve): Flag types that are not pointers
2184         as an error.  
2185         
2186         (For.DoEmit): Make inifinite loops have a
2187         non-conditional branch back.
2188
2189         (Fixed.DoEmit): First populate the pinned variables, then emit the
2190         statement, then clear the variables.  Before I was emitting the
2191         code once for each fixed piece.
2192
2193
2194 2003-01-08  Martin Baulig  <martin@ximian.com>
2195
2196         * statement.cs (FlowBranching.MergeChild): A break in a
2197         SWITCH_SECTION does not leave a loop.  Fixes #36155.
2198
2199 2003-01-08  Martin Baulig  <martin@ximian.com>
2200
2201         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
2202         lives in the same number space than `param_map'.  Fixes #36154.
2203
2204 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
2205
2206         * cs-parser.jay (constructor_declaration): Set the
2207         Constructor.ModFlags before probing for it.  This makes the
2208         compiler report 514, 515 and 132 (the code was there, but got
2209         broken). 
2210
2211         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
2212         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
2213         (GotoCase.Resolve): Set `Returns' to ALWAYS.
2214
2215 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
2216
2217         * enum.cs: create the enum static fields using the enum type.
2218
2219 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
2220
2221         * class.cs: don't try to create the ParamBuilder for the return
2222         type if it's not needed (and handle it breaking for the ms runtime
2223         anyway).
2224
2225 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
2226
2227         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
2228
2229 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
2230
2231         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
2232         the command.   This showed up while compiling the JANET source
2233         code, which used \r as its only newline separator.
2234
2235 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
2236
2237         * class.cs (Method.Define): If we are an operator (because it
2238         reuses our code), then set the SpecialName and HideBySig.  #36128
2239
2240 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
2241
2242         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
2243         exception, report error 120 `object reference required'.
2244
2245         * driver.cs: Add --pause option, used during to measure the size
2246         of the process as it goes with --timestamp.
2247
2248         * expression.cs (Invocation.DoResolve): Do not allow methods with
2249         SpecialName to be invoked.
2250
2251 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
2252
2253         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
2254         number before adding it.
2255
2256 2002-12-21  Ravi Pratap  <ravi@ximian.com>
2257
2258         * ecore.cs (StandardImplicitConversion): When in an unsafe
2259         context, we allow conversion between void * to any other pointer
2260         type. This fixes bug #35973.
2261
2262 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
2263
2264         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
2265         is not thrown when extensionless outputs are used 
2266
2267 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2268
2269         * rootcontext.cs: fixed compilation of corlib.
2270
2271 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
2272
2273         * attribute.cs (Attributes.Contains): Add new method.
2274
2275         * class.cs (MethodCore.LabelParameters): if the parameter is an
2276         `out' parameter, check that no attribute `[In]' has been passed.
2277
2278         * enum.cs: Handle the `value__' name in an enumeration.
2279
2280 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
2281
2282         * decl.cs: Added special case to allow overrides on "protected
2283         internal" methods
2284         
2285 2002-12-18  Ravi Pratap  <ravi@ximian.com>
2286
2287         * attribute.cs (Attributes.AddAttributeSection): Rename to this
2288         since it makes much more sense.
2289
2290         (Attributes.ctor): Don't require a Location parameter.
2291         
2292         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
2293
2294         * attribute.cs (ApplyAttributes): Remove extra Location parameters
2295         since we already have that information per attribute.
2296
2297         * everywhere : make appropriate changes.
2298
2299         * class.cs (LabelParameters): Write the code which actually
2300         applies attributes to the return type. We can't do this on the MS
2301         .NET runtime so we flag a warning in the case an exception is
2302         thrown.
2303
2304 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
2305
2306         * const.cs: Handle implicit null conversions here too.
2307
2308 2002-12-17  Ravi Pratap  <ravi@ximian.com>
2309
2310         * class.cs (MethodCore.LabelParameters): Remove the extra
2311         Type [] parameter since it is completely unnecessary. Instead
2312         pass in the method's attributes so that we can extract
2313         the "return" attribute.
2314
2315 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
2316
2317         * cs-parser.jay (parse): Use Report.Error to flag errors instead
2318         of ignoring it and letting the compile continue.
2319
2320         * typemanager.cs (ChangeType): use an extra argument to return an
2321         error condition instead of throwing an exception.
2322
2323 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
2324
2325         * expression.cs (Unary.TryReduce): mimic the code for the regular
2326         code path.  Perform an implicit cast in the cases where we can
2327         implicitly convert to one of the integral types, and then reduce
2328         based on that constant.   This fixes bug #35483.
2329
2330 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2331
2332         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
2333
2334 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2335
2336         * namespace.cs: fixed bug #35489.
2337
2338 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
2339
2340         * class.cs: Remove some dead code.
2341
2342         * cs-parser.jay: Estimate the number of methods needed
2343         (RootContext.MethodCount);
2344
2345         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
2346         numbers instead of StringBuilders.
2347
2348         * support.cs (PtrHashtable): Add constructor with initial size;
2349         We can now reduce reallocations of the method table.
2350
2351 2002-12-10  Ravi Pratap  <ravi@ximian.com>
2352
2353         * attribute.cs (ApplyAttributes): Keep track of the emitted
2354         attributes on a per-target basis. This fixes bug #35413.
2355
2356 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
2357
2358         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
2359         default to the Windows 1252 encoding.
2360
2361         (UnixParseOption): Support version, thanks to Alp for the missing
2362         pointer. 
2363
2364         * AssemblyInfo.cs: Add nice assembly information.
2365
2366         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
2367         (bug 35169).
2368
2369         * cs-parser.jay: Allow a trailing comma before the close bracked
2370         in the attribute_section production.
2371
2372         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
2373         address of the instance was being taken, I will take this out,
2374         because we take the address of the object immediately here.
2375
2376 2002-12-09  Ravi Pratap  <ravi@ximian.com>
2377
2378         * typemanager.cs (AreMultipleAllowed): Take care of the most
2379         obvious case where attribute type is not in the current assembly -
2380         stupid me ;-)
2381
2382 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
2383
2384         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
2385         definitions, instead of doing that afterwards.  
2386
2387         Also we use a nice little hack, depending on the constructor, we
2388         know if we are a "composed" name or a simple name.  Hence, we
2389         avoid the IndexOf test, and we avoid 
2390
2391         * codegen.cs: Add code to assist in a bug reporter to track down
2392         the source of a compiler crash. 
2393
2394 2002-12-07  Ravi Pratap  <ravi@ximian.com>
2395
2396         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
2397         types have been emitted for a given element and flag an error
2398         if something which does not have AllowMultiple set is used more
2399         than once.
2400
2401         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
2402         attribute types and their corresponding AllowMultiple properties
2403
2404         (AreMultipleAllowed): Check the property for a given type.
2405
2406         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
2407         property in the case we have a TypeContainer.
2408
2409         (Attributes.AddAttribute): Detect duplicates and just skip on
2410         adding them. This trivial fix catches a pretty gross error in our
2411         attribute emission - global attributes were being emitted twice!
2412
2413         Bugzilla bug #33187 is now fixed.
2414
2415 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
2416
2417         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
2418         instead of pp_and).
2419
2420         * expression.cs (Binary.ResolveOperator): I can only use the
2421         Concat (string, string, string) and Concat (string, string,
2422         string, string) if the child is actually a concatenation of
2423         strings. 
2424
2425 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
2426
2427         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
2428         context where we need a 2-character lookahead.
2429
2430         * pending.cs (PendingImplementation): Rework so we can keep track
2431         of interface types all the time, and flag those which were
2432         implemented by parents as optional.
2433
2434 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
2435
2436         * expression.cs (Binary.ResolveOperator): Use
2437         String.Concat(string,string,string) or
2438         String.Concat(string,string,string,string) when possible. 
2439
2440         * typemanager: More helper methods.
2441
2442
2443 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
2444
2445         * pending.cs: remove the bogus return from GetMissingInterfaces()
2446         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
2447
2448 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2449
2450         * namespace.cs: avoid duplicated 'using xxx' being added to
2451         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
2452         when we get more than one 'using' statement for the same namespace.
2453         Report a CS0105 warning for it.
2454
2455 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
2456
2457         * cs-tokenizer.cs (consume_identifier): use read directly, instead
2458         of calling getChar/putback, uses internal knowledge of it.    
2459
2460         (xtoken): Reorder tokenizer so most common patterns are checked
2461         first.  This reduces the compilation time in another 5% (from 8.11s
2462         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
2463
2464         The parsing time is 22% of the compilation in mcs, and from that
2465         64% is spent on the tokenization process.  
2466
2467         I tried using a binary search for keywords, but this is slower
2468         than the hashtable.  Another option would be to do a couple of
2469         things:
2470
2471                 * Not use a StringBuilder, instead use an array of chars,
2472                   with a set value.  Notice that this way we could catch
2473                   the 645 error without having to do it *afterwards*.
2474
2475                 * We could write a hand-parser to avoid the hashtable
2476                   compares altogether.
2477
2478         The identifier consumption process takes 37% of the tokenization
2479         time.  Another 15% is spent on is_number.  56% of the time spent
2480         on is_number is spent on Int64.Parse:
2481
2482                 * We could probably choose based on the string length to
2483                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
2484                   computations. 
2485
2486         Another 3% is spend on wrapping `xtoken' in the `token' function.
2487
2488         Handle 0xa0 as whitespace (#34752)
2489         
2490 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
2491
2492         * typemanager.cs (IsCLRType): New routine to tell whether a type
2493         is one of the builtin types.  
2494
2495         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
2496         typecode in more places instead of doing pointer comparissions.
2497         We could leverage some knowledge about the way the typecodes are
2498         laid out.
2499
2500         New code to cache namespaces in assemblies, it is currently not
2501         invoked, to be used soon.
2502
2503         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
2504
2505         * expression.cs (Binary.ResolveOperator): specially handle
2506         strings, and do not perform user-defined operator overloading for
2507         built-in types.
2508
2509 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
2510
2511         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
2512         internalcall as it is a pretty simple operation;  Avoid whenever
2513         possible to call Char.IsLetter.
2514
2515         (consume_identifier): Cut by half the number of
2516         hashtable calls by merging the is_keyword and GetKeyword behavior.
2517
2518         Do not short-circuit, because if we do, we
2519         report errors (ie, #if false && true would produce an invalid
2520         directive error);
2521         
2522
2523 2002-11-24  Martin Baulig  <martin@ximian.com>
2524
2525         * expression.cs (Cast.TryReduce): If we're in checked syntax,
2526         check constant ranges and report a CS0221.  Fixes #33186.
2527
2528 2002-11-24  Martin Baulig  <martin@ximian.com>
2529
2530         * cs-parser.jay: Make this work for uninitialized variable
2531         declarations in the `for' initializer.  Fixes #32416.
2532
2533 2002-11-24  Martin Baulig  <martin@ximian.com>
2534
2535         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
2536         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
2537
2538 2002-11-24  Martin Baulig  <martin@ximian.com>
2539
2540         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
2541         argument; if true, we also check for user-defined conversions.
2542         This is only needed if both arguments are of a user-defined type.
2543         Fixes #30443, added test-175.cs.
2544         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
2545
2546         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
2547
2548 2002-11-24  Martin Baulig  <martin@ximian.com>
2549
2550         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
2551         function to get the store opcode.
2552         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
2553         only emit the Ldelema if the store opcode is Stobj.  You must run
2554         both test-34 and test-167 to test this.  Fixes #34529.
2555
2556 2002-11-23  Martin Baulig  <martin@ximian.com>
2557
2558         * ecore.cs (Expression.MemberLookup): Added additional
2559         `qualifier_type' argument which is used when we're being called
2560         from MemberAccess.DoResolve() and null if we're called from a
2561         SimpleName lookup.
2562         (Expression.MemberLookupFailed): New method to report errors; this
2563         does the CS1540 check and reports the correct error message.
2564
2565         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
2566         argument for the CS1540 check and redone the way how we're dealing
2567         with private members.  See the comment in the source code for details.
2568         (FilterWithClosure): Reverted this back to revision 1.197; renamed
2569         `closure_start_type' to `closure_qualifier_type' and check whether
2570         it's not null.  It was not this filter being broken, it was just
2571         being called with the wrong arguments.
2572
2573         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
2574         and pass it the correct `qualifier_type'; this also does the error
2575         handling for us.
2576
2577 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
2578
2579         * expression.cs (Invocation.EmitParams): If the we are dealing
2580         with a non-built-in value type, load its address as well.
2581
2582         (ArrayCreation): Use a a pretty constant instead
2583         of the hardcoded value 2.   Use 6 instead of 2 for the number of
2584         static initializers.  
2585
2586         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
2587         because they are not really value types, just glorified integers. 
2588
2589         * driver.cs: Do not append .exe, the CSC compiler does not do it.
2590
2591         * ecore.cs: Remove redundant code for enumerations, make them use
2592         the same code path as everything else, fixes the casting issue
2593         with enumerations in Windows.Forms.
2594
2595         * attribute.cs: Do only cast to string if it is a string, the
2596         validation happens later.
2597
2598         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
2599         people upgrade their corlibs.
2600
2601         * ecore.cs: Oops, enumerations were not following the entire code path
2602
2603 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
2604
2605         * typemanager.cs (FilterWithClosure): Commented out the test for
2606         1540 in typemanager.cs, as it has problems when accessing
2607         protected methods from a parent class (see test-174.cs). 
2608
2609         * attribute.cs (Attribute.ValidateGuid): new method.
2610         (Attribute.Resolve): Use above.
2611
2612 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
2613
2614         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
2615
2616         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
2617         handling for enumerations, as we only needed the TypeContainer
2618         functionality to begin with (this is required for the fix below to
2619         work for enums that reference constants in a container class for
2620         example). 
2621
2622         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
2623
2624         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
2625         a valid TypeBuilder to perform lookups on.o
2626
2627         * class.cs (InheritableMemberSignatureCompare): Use true in the
2628         call to GetGetMethod and GetSetMethod, because we are comparing
2629         the signature, and we need to get the methods *even* if they are
2630         private. 
2631
2632         (PropertyBase.CheckBase): ditto.
2633
2634         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
2635         GotoCase.Resolve): Use Peel on EmpytCasts.
2636
2637         * ecore.cs (EmptyCast): drop child, add Peel method.
2638
2639 2002-11-17  Martin Baulig  <martin@ximian.com>
2640
2641         * ecore.cs (EmptyCast.Child): New public property.
2642
2643         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
2644         label resolved to an EmptyCast.  Fixes #34162.
2645         (GotoCase.Resolve): Likewise.
2646         (Block.EmitMeta): Likewise.
2647
2648 2002-11-17  Martin Baulig  <martin@ximian.com>
2649
2650         * expression.cs (Invocation.BetterConversion): Prefer int over
2651         uint; short over ushort; long over ulong for integer literals.
2652         Use ImplicitConversionExists instead of StandardConversionExists
2653         since we also need to check for user-defined implicit conversions.
2654         Fixes #34165.  Added test-173.cs.
2655
2656 2002-11-16  Martin Baulig  <martin@ximian.com>
2657
2658         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
2659         with the `true' and `false' literals.  Fixes #33151.
2660
2661 2002-11-16  Martin Baulig  <martin@ximian.com>
2662
2663         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
2664         October 22nd; don't do the cs1540 check for static members.
2665
2666         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
2667         now using our own filter here and doing the cs1540 check again.
2668
2669 2002-11-16  Martin Baulig  <martin@ximian.com>
2670
2671         * support.cs (InternalParameters): Don't crash if we don't have
2672         any fixed parameters.  Fixes #33532.
2673
2674 2002-11-16  Martin Baulig  <martin@ximian.com>
2675
2676         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
2677         when looking up static methods to make this work on Windows.
2678         Fixes #33773.
2679
2680 2002-11-16  Martin Baulig  <martin@ximian.com>
2681
2682         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
2683         a setter rather than using PropertyInfo.CanWrite.
2684
2685 2002-11-15  Nick Drochak  <ndrochak@gol.com>
2686
2687         * class.cs: Allow acces to block member by subclasses. Fixes build
2688         breaker.
2689
2690 2002-11-14  Martin Baulig  <martin@ximian.com>
2691
2692         * class.cs (Constructor.Emit): Added the extern/block check.
2693         Fixes bug #33678.
2694
2695 2002-11-14  Martin Baulig  <martin@ximian.com>
2696
2697         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
2698         iteration while looking for indexers, this is needed because the
2699         indexer may have a different name in our base classes.  Fixed the
2700         error reporting (no indexers at all, not get accessor, no
2701         overloaded match).  Fixes bug #33089.
2702         (IndexerAccess.DoResolveLValue): Likewise.
2703
2704 2002-11-14  Martin Baulig  <martin@ximian.com>
2705
2706         * class.cs (PropertyBase.CheckBase): Make this work for multiple
2707         indexers.  Fixes the first part of bug #33089.
2708         (MethodSignature.InheritableMemberSignatureCompare): Added support
2709         for properties.
2710
2711 2002-11-13  Ravi Pratap  <ravi@ximian.com>
2712
2713         * attribute.cs (Attribute.Resolve): Catch the
2714         NullReferenceException and report it since it isn't supposed to
2715         happen. 
2716         
2717 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
2718
2719         * expression.cs (Binary.EmitBranchable): Also handle the cases for
2720         LogicalOr and LogicalAnd that can benefit from recursively
2721         handling EmitBranchable.  The code now should be nice for Paolo.
2722
2723 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
2724
2725         * typemanager.cs (LookupType): Added a negative-hit hashtable for
2726         the Type lookups, as we perform quite a number of lookups on
2727         non-Types.  This can be removed once we can deterministically tell
2728         whether we have a type or a namespace in advance.
2729
2730         But this might require special hacks from our corlib.
2731
2732         * TODO: updated.
2733
2734         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
2735         and double which avoids a conversion from an integer to a double.
2736
2737         * expression.cs: tiny optimization, avoid calling IsConstant,
2738         because it effectively performs the lookup twice.
2739
2740 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
2741
2742         But a bogus return here to keep the semantics of the old code
2743         until the Mono runtime is fixed.
2744         
2745         * pending.cs (GetMissingInterfaces): New method used to remove all
2746         the interfaces that are already implemented by our parent
2747         classes from the list of pending methods. 
2748
2749         * interface.cs: Add checks for calls after ResolveTypeExpr.
2750
2751 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
2752
2753         * class.cs (Class.Emit): Report warning 67: event not used if the
2754         warning level is beyond 3.
2755
2756         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
2757         being a NullLiteral.
2758
2759         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
2760         specifiers. 
2761
2762         * class.cs (TypeContainer.GetClassBases): Cover a missing code
2763         path that might fail if a type can not be resolved.
2764
2765         * expression.cs (Binary.Emit): Emit unsigned versions of the
2766         operators. 
2767
2768         * driver.cs: use error 5.
2769         
2770 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
2771
2772         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
2773
2774 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
2775
2776         * cs-parser.jay (switch_section): A beautiful patch from Martin
2777         Baulig that fixed 33094.
2778
2779 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
2780
2781         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
2782         Check whether the base is abstract and report an error if so.
2783
2784         * expression.cs (IndexerAccess.DoResolveLValue,
2785         IndexerAccess.DoResolve): ditto. 
2786
2787         (Invocation.DoResolve): ditto.
2788         
2789         (Invocation.FullMethodDesc): Improve the report string.
2790
2791         * statement.cs (Block): Eliminate IsVariableDefined as it is
2792         basically just a wrapper for GetVariableInfo.
2793
2794         * ecore.cs (SimpleName): Use new 
2795
2796         * support.cs (ReflectionParamter.ParameterType): We unwrap the
2797         type, as we return the actual parameter ref/unref state on a
2798         different call.
2799
2800 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
2801
2802         * support.cs: Return proper flags REF/OUT fixing the previous
2803         commit.  
2804
2805         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
2806         not used to mean `ref' but `ref or out' in ParameterReference
2807         
2808         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
2809         full type signature instead of calling TypeManger.CSharpName
2810         ourselves. 
2811
2812         * support.cs (InternalParameters.ParameterDesc): Do not compare
2813         directly to the modflags, because REF/OUT will actually be bitsets
2814         if set. 
2815
2816         * delegate.cs (VerifyMethod): Check also the modifiers.
2817
2818         * cs-tokenizer.cs: Fix bug where floating point values with an
2819         exponent where a sign was missing was ignored.
2820
2821         * driver.cs: Allow multiple assemblies to be specified in a single
2822         /r: argument
2823
2824 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
2825
2826         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
2827         because identifiers after a parenthesis would end up in this kind
2828         of production, and we needed to desamiguate it for having casts
2829         like:
2830
2831                 (UserDefinedType *) xxx
2832
2833 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
2834
2835         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
2836         we should set on the Bindingflags.NonPublic, but not turn on
2837         private_ok.  private_ok controls whether a Private member is
2838         returned (this is chekced on the filter routine), while the
2839         BindingFlags.NonPublic just controls whether private/protected
2840         will be allowed.   This fixes the problem part of the problem of
2841         private properties being allowed to be used in derived classes.
2842
2843         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
2844         so we can call the children DoResolveLValue method (this will
2845         properly signal errors on lvalue assignments to base properties)
2846         
2847         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
2848         getter are null, and we have a property info, we know that this
2849         happened because the lookup failed, so we report an error 122 for
2850         protection level violation.
2851
2852         We also silently return if setter and getter are null in the
2853         resolve functions, this condition only happens if we have flagged
2854         the error before.  This is the other half of the problem. 
2855
2856         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
2857         not have accessibility information, that is why we were returning
2858         true in the filter function in typemanager.cs.
2859
2860         To properly report 122 (property is inaccessible because of its
2861         protection level) correctly, we report this error in ResolveAccess
2862         by failing if both the setter and the getter are lacking (ie, the
2863         lookup failed). 
2864
2865         DoResolve and DoLResolve have been modified to check for both
2866         setter/getter being null and returning silently, the reason being
2867         that I did not want to put the knowledge about this error in upper
2868         layers, like:
2869
2870         int old = Report.Errors;
2871         x = new PropertyExpr (...);
2872         if (old != Report.Errors)
2873                 return null;
2874         else
2875                 return x;
2876
2877         So the property expr is returned, but it is invalid, so the error
2878         will be flagged during the resolve process. 
2879
2880         * class.cs: Remove InheritablePropertySignatureCompare from the
2881         class, as we no longer depend on the property signature to compute
2882         whether it is possible to implement a method or not.
2883
2884         The reason is that calling PropertyInfo.GetGetMethod will return
2885         null (in .NET, in Mono it works, and we should change this), in
2886         cases where the Get Method does not exist in that particular
2887         class.
2888
2889         So this code:
2890
2891         class X { public virtual int A { get { return 1; } } }
2892         class Y : X { }
2893         class Z : Y { public override int A { get { return 2; } } }
2894
2895         Would fail in Z because the parent (Y) would not have the property
2896         defined.  So we avoid this completely now (because the alternative
2897         fix was ugly and slow), and we now depend exclusively on the
2898         method names.
2899
2900         (PropertyBase.CheckBase): Use a method-base mechanism to find our
2901         reference method, instead of using the property.
2902
2903         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
2904         routines are gone now.
2905
2906         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
2907         names, they were incorrectly named.
2908
2909         * cs-tokenizer.cs: Return are more gentle token on failure. 
2910
2911         * pending.cs (PendingImplementation.InterfaceMethod): This routine
2912         had an out-of-sync index variable, which caused it to remove from
2913         the list of pending methods the wrong method sometimes.
2914
2915 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
2916
2917         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
2918         CanWrite, because those refer to this particular instance of the
2919         property, and do not take into account the fact that we can
2920         override single members of a property.
2921
2922         Constructor requires an EmitContext.  The resolution process does
2923         not happen here, but we need to compute the accessors before,
2924         because the resolution does not always happen for properties.
2925         
2926         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
2927         subclass, before we did not update this flag, but we did update
2928         bindingflags. 
2929
2930         (GetAccessors): Drop this routine, as it did not work in the
2931         presence of partially overwritten set/get methods. 
2932
2933         Notice that this broke the cs1540 detection, but that will require
2934         more thinking. 
2935         
2936 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2937
2938         * class.cs:
2939         * codegen.cs:
2940         * driver.cs: issue a warning instead of an error if we don't support
2941         debugging for the platform. Also ignore a couple of errors that may
2942         arise when trying to write the symbols. Undo my previous patch.
2943
2944 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2945
2946         * driver.cs: ignore /debug switch except for Unix platforms.
2947
2948 2002-10-23  Nick Drochak  <ndrochak@gol.com>
2949
2950         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
2951
2952 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
2953
2954         * driver.cs: Do not make mcs-debug conditional, so we do not break
2955         builds that use it.
2956
2957         * statement.cs (UsageVector.MergeChildren): I would like Martin to
2958         review this patch.  But basically after all the children variables
2959         have been merged, the value of "Breaks" was not being set to
2960         new_breaks for Switch blocks.  I think that it should be set after
2961         it has executed.  Currently I set this to the value of new_breaks,
2962         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
2963         conservative, but I do not understand this code very well.
2964
2965         I did not break anything in the build, so that is good ;-)
2966
2967         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
2968
2969 2002-10-20  Mark Crichton  <crichton@gimp.org>
2970
2971         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
2972
2973 2002-10-20  Nick Drochak  <ndrochak@gol.com>
2974
2975         * cfold.cs: Fixed compile blocker.
2976
2977 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
2978
2979         * driver.cs: I was chekcing the key, not the file.
2980
2981 2002-10-19  Ravi Pratap  <ravi@ximian.com>
2982
2983         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
2984         message that we were generating - we just need to silently return
2985         a null.
2986
2987 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
2988
2989         * class.cs (Event.Define): Change my previous commit, as this
2990         breaks the debugger.  This is a temporary hack, as it seems like
2991         the compiler is generating events incorrectly to begin with.
2992
2993         * expression.cs (Binary.ResolveOperator): Added support for 
2994         "U operator - (E x, E y)"
2995
2996         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
2997         y)".
2998
2999         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
3000         init-only variables, but this path did not take into account that
3001         there might be also instance readonly variables.  Correct this
3002         problem. 
3003
3004         This fixes bug 32253
3005
3006         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
3007         delegates as well.
3008
3009         * driver.cs: Change the extension for modules to `netmodule'
3010
3011         * cs-parser.jay: Improved slightly the location tracking for
3012         the debugger symbols.
3013
3014         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
3015         modifiers that were specified instead of the hardcoded value
3016         (FamAndAssem).  This was basically ignoring the static modifier,
3017         and others.  Fixes 32429.
3018
3019         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
3020         fixed a bug in the process (32476)
3021
3022         * expression.cs (ArrayAccess.EmitAssign): Patch from
3023         hwang_rob@yahoo.ca that fixes bug 31834.3
3024
3025 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
3026
3027         * driver.cs: Make the module extension .netmodule.
3028
3029 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
3030
3031         * driver.cs: Report an error if the resource file is not found
3032         instead of crashing.
3033
3034         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
3035         false, like Emit does.
3036
3037 2002-10-16  Nick Drochak  <ndrochak@gol.com>
3038
3039         * typemanager.cs: Remove unused private member.  Also reported mcs
3040         bug to report this as a warning like csc.
3041
3042 2002-10-15  Martin Baulig  <martin@gnome.org>
3043
3044         * statement.cs (Statement.Emit): Made this a virtual method; emits
3045         the line number info and calls DoEmit().
3046         (Statement.DoEmit): New protected abstract method, formerly knows
3047         as Statement.Emit().
3048
3049         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
3050
3051 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
3052
3053         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
3054         have fixed a remaining problem: not every AddXXXX was adding a
3055         fully qualified name.  
3056
3057         Now everyone registers a fully qualified name in the DeclSpace as
3058         being defined instead of the partial name.  
3059
3060         Downsides: we are slower than we need to be due to the excess
3061         copies and the names being registered this way.  
3062
3063         The reason for this is that we currently depend (on the corlib
3064         bootstrap for instance) that types are fully qualified, because
3065         we dump all the types in the namespace, and we should really have
3066         types inserted into the proper namespace, so we can only store the
3067         basenames in the defined_names array.
3068
3069 2002-10-10  Martin Baulig  <martin@gnome.org>
3070
3071         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
3072         from bug #31834, see the bug report for a testcase which is
3073         miscompiled.
3074
3075 2002-10-10  Martin Baulig  <martin@gnome.org>
3076
3077         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
3078         flow analysis code for this.
3079
3080         * statement.cs (Do, While, For): Tell the flow analysis code about
3081         infinite loops.
3082         (FlowBranching.UsageVector): Added support for infinite loops.
3083         (Block.Resolve): Moved the dead code elimination here and use flow
3084         analysis to do it.
3085
3086 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
3087
3088         * class.cs (Field.Define): Catch cycles on struct type
3089         definitions. 
3090
3091         * typemanager.cs (IsUnmanagedtype): Do not recursively check
3092         fields if the fields are static.  We only need to check instance
3093         fields. 
3094
3095         * expression.cs (As.DoResolve): Test for reference type.
3096
3097         * statement.cs (Using.ResolveExpression): Use
3098         ConvertImplicitRequired, not ConvertImplicit which reports an
3099         error on failture
3100         (Using.ResolveLocalVariableDecls): ditto.
3101
3102         * expression.cs (Binary.ResolveOperator): Report errors in a few
3103         places where we had to.
3104
3105         * typemanager.cs (IsUnmanagedtype): Finish implementation.
3106
3107 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
3108
3109         * expression.cs: Use StoreFromPtr instead of extracting the type
3110         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
3111
3112         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
3113         an enumeration value to a System.Enum, but System.Enum is not a
3114         value type, but an class type, so we need to box.
3115
3116         (Expression.ConvertExplicit): One codepath could return
3117         errors but not flag them.  Fix this.  Fixes #31853
3118
3119         * parameter.cs (Resolve): Do not allow void as a parameter type.
3120
3121 2002-10-06  Martin Baulig  <martin@gnome.org>
3122
3123         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
3124         if it's a class type and not a struct.  Fixes #31815.
3125
3126 2002-10-06  Martin Baulig  <martin@gnome.org>
3127
3128         * statement.cs: Reworked the flow analysis code a bit to make it
3129         usable for dead code elimination.
3130
3131 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3132
3133         * cs-parser.jay: allow empty source files. Fixes bug #31781.
3134
3135 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3136
3137         * expression.cs (ComposedCast.DoResolveType): A quick workaround
3138         to fix the test 165, will investigate deeper.
3139
3140 2002-10-04  Martin Baulig  <martin@gnome.org>
3141
3142         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
3143         finally blocks actually work.
3144         (Try.Resolve): We don't need to create a sibling for `finally' if
3145         there is no finally block.
3146
3147 2002-10-04  Martin Baulig  <martin@gnome.org>
3148
3149         * class.cs (Constructor.Define): The default accessibility for a
3150         non-default constructor is private, not public.
3151
3152 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
3153
3154         * class.cs (Constructor): Make AllowedModifiers public, add
3155         EXTERN.
3156
3157         * cs-parser.jay: Perform the modifiers test here, as the
3158         constructor for the Constructor class usually receives a zero
3159         because of the way we create it (first we create, later we
3160         customize, and we were never checking the modifiers).
3161
3162         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
3163         is a version of LookupTypeReflection that includes the type-name
3164         cache.  This can be used as a fast path for functions that know
3165         the fully qualified name and are only calling into *.GetType() to
3166         obtain a composed type.
3167
3168         This is also used by TypeManager.LookupType during its type
3169         composition.
3170
3171         (LookupType): We now also track the real type name, as sometimes
3172         we can get a quey for the real type name from things like
3173         ComposedCast.  This fixes bug 31422.
3174         
3175         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
3176         complete type fullname, it does not have to go through the type
3177         resolution system to obtain the composed version of the type (for
3178         obtaining arrays or pointers).
3179         
3180         (Conditional.Emit): Use the EmitBoolExpression to
3181         generate nicer code, as requested by Paolo.
3182
3183         (ArrayCreation.CheckIndices): Use the patch from
3184         hwang_rob@yahoo.ca to validate the array initializers. 
3185
3186 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
3187
3188         * class.cs (ConstructorInitializer.Emit): simplify code by using
3189         Invocation.EmitCall, and at the same time, fix the bugs in calling
3190         parent constructors that took variable arguments. 
3191
3192         * ecore.cs (Expression.ConvertNumericExplicit,
3193         Expression.ImplicitNumericConversion): Remove the code that
3194         manually wrapped decimal (InternalTypeConstructor call is now gone
3195         as well).
3196
3197         * expression.cs (Cast.TryReduce): Also handle decimal types when
3198         trying to perform a constant fold on the type.
3199
3200         * typemanager.cs (IsUnmanagedtype): Partially implemented.
3201
3202         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
3203         that only turned off an error report, and did nothing else. 
3204
3205 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
3206
3207         * driver.cs: Handle and ignore /fullpaths
3208
3209 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
3210
3211         * expression.cs (Binary.ResolveOperator): Catch the case where
3212         DoNumericPromotions returns true, 
3213
3214         (Binary.DoNumericPromotions): Simplify the code, and the tests.
3215
3216 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
3217
3218         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
3219         report error 70.
3220
3221 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
3222
3223         * ecore.cs (ConvertNumericExplicit): It is not enough that the
3224         conversion exists, but it is also required that the conversion be
3225         performed.  This manifested in "(Type64Enum) 2".  
3226
3227         * class.cs (TypeManager.AddMethod): The fix is not to change
3228         AddEnum, because that one was using a fully qualified name (every
3229         DeclSpace derivative does), but to change the AddMethod routine
3230         that was using an un-namespaced name.  This now correctly reports
3231         the duplicated name.
3232
3233         Revert patch until I can properly fix it.  The issue
3234         is that we have a shared Type space across all namespaces
3235         currently, which is wrong.
3236
3237         Options include making the Namespace a DeclSpace, and merge
3238         current_namespace/current_container in the parser.
3239
3240 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
3241
3242         * cs-parser.jay: Improve error reporting when we get a different
3243         kind of expression in local_variable_type and
3244         local_variable_pointer_type. 
3245
3246         Propagate this to avoid missleading errors being reported.
3247
3248         * ecore.cs (ImplicitReferenceConversion): treat
3249         TypeManager.value_type as a target just like object_type.   As
3250         code like this:
3251
3252         ValueType v = 1;
3253
3254         Is valid, and needs to result in the int 1 being boxed before it
3255         is assigned to the value type v.
3256
3257         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
3258         to validate the enumeration name.
3259
3260         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
3261         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
3262         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
3263
3264         * ecore.cs (TryImplicitIntConversion): When doing an
3265         implicit-enumeration-conversion, check if the type is 64-bits and
3266         perform a conversion before passing to EnumConstant.
3267
3268 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
3269
3270         * decl.cs (Error_AmbiguousTypeReference); New routine used to
3271         report ambiguous type references.  Unlike the MS version, we
3272         report what the ambiguity is.   Innovation at work ;-)
3273
3274         (DeclSpace.FindType): Require a location argument to
3275         display when we display an ambiguous error.
3276
3277         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
3278
3279         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
3280
3281         * expression.cs (EmitDynamicInitializers): Apply patch from
3282         hwang_rob@yahoo.ca that fixes the order in which we emit our
3283         initializers. 
3284
3285 2002-09-21  Martin Baulig  <martin@gnome.org>
3286
3287         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
3288         delegate takes no arguments.
3289
3290 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
3291
3292         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
3293         from integers.
3294
3295         * expression.cs: Extract the underlying type.
3296
3297         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
3298
3299         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
3300
3301 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
3302
3303         * class.cs (TypeContainer.DefineType): We can not use the nice
3304         PackingSize with the size set to 1 DefineType method, because it
3305         will not allow us to define the interfaces that the struct
3306         implements.
3307
3308         This completes the fixing of bug 27287
3309
3310         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
3311         means also structs.  This fixes part of the problem. 
3312         (Expresion.ImplicitReferenceConversionExists): ditto.
3313
3314         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
3315         error if there were no errors reported during the type lookup
3316         process, to avoid duplicates or redundant errors.  Without this
3317         you would get an ambiguous errors plus a type not found.  We have
3318         beaten the user enough with the first error.  
3319
3320         (DeclSparce.FindType): Emit a warning if we have an ambiguous
3321         reference. 
3322
3323         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
3324         during the resolution process, stop the lookup, this avoids
3325         repeated error reports (same error twice).
3326
3327         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
3328
3329         * typemanager.cs (LookupType): Redo the type lookup code to match
3330         the needs of System.Reflection.  
3331
3332         The issue is that System.Reflection requires references to nested
3333         types to begin with a "+" sign instead of a dot.  So toplevel
3334         types look like: "NameSpace.TopLevelClass", and nested ones look
3335         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
3336         levels. 
3337
3338 2002-09-19  Martin Baulig  <martin@gnome.org>
3339
3340         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
3341         says that a method always returns or always throws an exception,
3342         don't report the CS0161.
3343
3344         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
3345         set `Returns = new_returns'.
3346
3347 2002-09-19  Martin Baulig  <martin@gnome.org>
3348
3349         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
3350         to an enum constant, check for a CS0176.
3351
3352 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
3353
3354         * class.cs (TypeContainer.CheckPairedOperators): Now we check
3355         for operators that must be in pairs and report errors.
3356
3357         * ecore.cs (SimpleName.DoResolveType): During the initial type
3358         resolution process, when we define types recursively, we must
3359         check first for types in our current scope before we perform
3360         lookups in the enclosing scopes.
3361
3362         * expression.cs (MakeByteBlob): Handle Decimal blobs.
3363
3364         (Invocation.VerifyArgumentsCompat): Call
3365         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
3366         I thought we were supposed to always call this, but there are a
3367         few places in the code where we dont do it.
3368
3369 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
3370
3371         * driver.cs: Add support in -linkres and -resource to specify the
3372         name of the identifier.
3373
3374 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3375
3376         * ecore.cs (StandardConversionExists): Sync with the conversion
3377         code: allow anything-* to void* conversions.
3378
3379         (FindMostSpecificSource): Use an Expression argument
3380         instead of a Type, because we might be handed over a Literal which
3381         gets a few more implicit conversions that plain types do not.  So
3382         this information was being lost.
3383
3384         Also, we drop the temporary type-holder expression when not
3385         required.
3386
3387 2002-09-17  Martin Baulig  <martin@gnome.org>
3388
3389         * class.cs (PropertyBase.CheckBase): Don't check the base class if
3390         this is an explicit interface implementation.
3391
3392 2002-09-17  Martin Baulig  <martin@gnome.org>
3393
3394         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
3395         different `IndexerName' attributes.
3396
3397         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
3398         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
3399         virtual CommonResolve().
3400
3401 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
3402
3403         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
3404         and convert that to the UnderlyingType.
3405
3406         * statement.cs (Foreach.Resolve): Indexers are just like variables
3407         or PropertyAccesses.
3408
3409         * cs-tokenizer.cs (consume_string): Track line numbers and columns
3410         inside quoted strings, we were not doing this before.
3411
3412 2002-09-16  Martin Baulig  <martin@gnome.org>
3413
3414         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
3415         resolve it.  This is needed for the definite assignment check of the
3416         instance expression, fixes bug #29846.
3417         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
3418
3419 2002-09-16  Nick Drochak  <ndrochak@gol.com>
3420
3421         * parameter.cs: Fix compile error.  Cannot reference static member
3422         from an instance object.  Is this an mcs bug?
3423
3424 2002-09-14  Martin Baulig  <martin@gnome.org>
3425
3426         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
3427         multiple times.  Fixes bug #30295, added test-166.cs.
3428
3429 2002-09-14  Martin Baulig  <martin@gnome.org>
3430
3431         * statement.cs (Block.Emit): Don't emit unreachable code.
3432         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
3433         `break' statements.
3434         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
3435
3436 2002-09-14  Martin Baulig  <martin@gnome.org>
3437
3438         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
3439         is set.
3440
3441 2002-09-14  Martin Baulig  <martin@gnome.org>
3442
3443         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
3444         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
3445         be false on the ms runtime.
3446
3447 2002-09-13  Martin Baulig  <martin@gnome.org>
3448
3449         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
3450         the CS0038 error message.
3451
3452 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
3453
3454         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
3455         constant inside, return it.
3456
3457 2002-09-12  Martin Baulig  <martin@gnome.org>
3458
3459         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
3460         implicit conversion can be done between enum types.
3461
3462         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
3463         check whether an implicit conversion to the current enum's UnderlyingType
3464         exists and report an error if not.
3465
3466         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
3467         without debugging support.
3468
3469         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
3470         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
3471
3472 2002-09-12  Martin Baulig  <martin@gnome.org>
3473
3474         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
3475
3476         * ecore.cs (IMemberExpr.DeclaringType): New property.
3477         (SimpleName.SimpleNameResolve): Check whether we're accessing a
3478         nonstatic member of an outer type (CS0038).
3479
3480 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
3481
3482         * driver.cs: Activate the using-error detector at warning level
3483         4 (at least for MS-compatible APIs).
3484
3485         * namespace.cs (VerifyUsing): Small buglett fix.
3486
3487         * pending.cs (PendingImplementation): pass the container pointer. 
3488
3489         * interface.cs (GetMethods): Allow for recursive definition.  Long
3490         term, I would like to move every type to support recursive
3491         definitions, not the current ordering mechanism that we have right
3492         now.
3493
3494         The situation is this: Attributes are handled before interfaces,
3495         so we can apply attributes to interfaces.  But some attributes
3496         implement interfaces, we will now handle the simple cases
3497         (recursive definitions will just get an error).  
3498
3499         * parameter.cs: Only invalidate types at the end if we fail to
3500         lookup all types.  
3501
3502 2002-09-09  Martin Baulig  <martin@gnome.org>
3503
3504         * ecore.cs (PropertyExpr.Emit): Also check for
3505         TypeManager.system_int_array_get_length so this'll also work when
3506         compiling corlib.  Fixes #30003.
3507
3508 2002-09-09  Martin Baulig  <martin@gnome.org>
3509
3510         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
3511         and throw an exception if we can't get the type's size.  Fixed #30040,
3512         added test-165.cs.
3513
3514 2002-09-09  Martin Baulig  <martin@gnome.org>
3515
3516         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
3517
3518         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
3519         context.  Fixes bug #30027.
3520
3521         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
3522         virtual functions.  Fixes bug #30043, added test-164.cs.
3523
3524 2002-09-08  Ravi Pratap  <ravi@ximian.com>
3525
3526         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
3527
3528 2002-09-08  Nick Drochak  <ndrochak@gol.com>
3529
3530         * driver.cs: Use an object to get the windows codepage since it's not a
3531         static property.
3532
3533 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
3534
3535         * statement.cs (For.Emit): for infinite loops (test == null)
3536         return whether there is a break inside, not always "true".
3537
3538         * namespace.cs (UsingEntry): New struct to hold the name of the
3539         using definition, the location where it is defined, and whether it
3540         has been used in a successful type lookup.
3541         
3542         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
3543         strings.
3544
3545         * decl.cs: ditto.
3546
3547 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3548
3549         * attribute.cs : Fix incorrect code which relied on catching
3550         a NullReferenceException to detect a null being passed in
3551         where an object was expected.
3552
3553 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
3554
3555         * statement.cs (Try): flag the catch variable as assigned
3556
3557         * expression.cs (Cast): Simplified by using ResolveType instead of
3558         manually resolving.
3559
3560         * statement.cs (Catch): Fix bug by using ResolveType.
3561
3562 2002-09-06  Ravi Pratap  <ravi@ximian.com>
3563
3564         * expression.cs (BetterConversion): Special case for when we have
3565         a NullLiteral as the argument and we have to choose between string
3566         and object types - we choose string the way csc does.
3567
3568         * attribute.cs (Attribute.Resolve): Catch the
3569         NullReferenceException and report error #182 since the Mono
3570         runtime no more has the bug and having this exception raised means
3571         we tried to select a constructor which takes an object and is
3572         passed a null.
3573
3574 2002-09-05  Ravi Pratap  <ravi@ximian.com>
3575
3576         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
3577         message (1502, 1503) when we can't locate a method after overload
3578         resolution. This is much more informative and closes the bug
3579         Miguel reported.
3580
3581         * interface.cs (PopulateMethod): Return if there are no argument
3582         types. Fixes a NullReferenceException bug.
3583
3584         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
3585         expressions too. Previously we were checking only in one place for
3586         positional arguments leaving out named arguments.
3587
3588         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
3589         type to the enum type is not allowed. Remove code corresponding to
3590         that.
3591
3592         (ConvertNumericExplicit): Allow explicit conversions from
3593         the underlying type to enum type. This precisely follows the spec
3594         and closes a bug filed by Gonzalo.
3595         
3596 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3597
3598         * compiler.csproj:
3599         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
3600
3601 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
3602
3603         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
3604         it was important that we stored the right value after the
3605         reduction in `converted'.
3606
3607 2002-09-04  Martin Baulig  <martin@gnome.org>
3608
3609         * location.cs (Location.SymbolDocument): Use full pathnames for the
3610         source files.
3611
3612 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
3613
3614         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
3615         of the expression resolve mechanism, because that will catch the
3616         SimpleName error failures.
3617
3618         (Conditional): If we can not resolve the
3619         expression, return, do not crash.
3620
3621 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3622
3623         * cs-tokenizer.cs:
3624         (location): display token name instead of its number.
3625
3626 2002-08-28  Martin Baulig  <martin@gnome.org>
3627
3628         * expression.cs (Binary.ResolveOperator): Don't silently return
3629         but return an error if an operator cannot be applied between two
3630         enum types.
3631
3632 2002-08-28  Martin Baulig  <martin@gnome.org>
3633
3634         * class.cs (Constructor.Define): Set the permission attributes
3635         correctly instead of making all constructors public.
3636
3637 2002-08-28  Martin Baulig  <martin@gnome.org>
3638
3639         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
3640         for private members before reporting a CS0103; if we find anything,
3641         it's a CS0122.
3642
3643 2002-08-28  Martin Baulig  <martin@gnome.org>
3644
3645         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
3646         to check whether `closure_start_type == closure_invocation_type',
3647         we also need to check whether `m.DeclaringType == closure_invocation_type'
3648         before bypassing the permission checks.  We might be accessing
3649         protected/private members from the base class.
3650         (TypeManager.RealMemberLookup): Only set private_ok if private
3651         members were requested via BindingFlags.NonPublic.
3652
3653         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
3654
3655         * expression.cs (MemberAccess.ResolveMemberAccess): Set
3656         MethodGroupExpr.IsExplicitImpl if appropriate.
3657         (Invocation.DoResolve): Don't report the CS0120 for explicit
3658         interface implementations.
3659
3660 2002-08-27  Martin Baulig  <martin@gnome.org>
3661
3662         * expression.cs (Invocation.DoResolve): If this is a static
3663         method and we don't have an InstanceExpression, we must report
3664         a CS0120.
3665
3666 2002-08-25  Martin Baulig  <martin@gnome.org>
3667
3668         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
3669         `==' between a valuetype and an object.
3670
3671 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
3672
3673         * ecore.cs (TypeExpr): Provide a ToString method.
3674
3675 2002-08-24  Martin Baulig  <martin@gnome.org>
3676
3677         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
3678         now called proggie.dbg and it's a binary file.
3679
3680 2002-08-23  Martin Baulig  <martin@gnome.org>
3681
3682         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
3683
3684 2002-08-23  Martin Baulig  <martin@gnome.org>
3685
3686         * struct.cs (MyStructInfo.ctor): Make this work with empty
3687         structs; it's not allowed to use foreach() on null.
3688
3689 2002-08-23  Martin Baulig  <martin@gnome.org>
3690
3691         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
3692         writer the full pathname of the generated assembly.
3693
3694 2002-08-23  Martin Baulig  <martin@gnome.org>
3695
3696         * statements.cs (FlowBranching.UsageVector.MergeChildren):
3697         A `finally' block never returns or breaks; improved handling of
3698         unreachable code.
3699
3700 2002-08-23  Martin Baulig  <martin@gnome.org>
3701
3702         * statement.cs (Throw.Resolve): Allow `throw null'.
3703
3704 2002-08-23  Martin Baulig  <martin@gnome.org>
3705
3706         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
3707         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
3708         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
3709         MemberLookup would return a wrong event if this is an explicit
3710         interface implementation and the class has an event with the same
3711         name.
3712
3713 2002-08-23  Martin Baulig  <martin@gnome.org>
3714
3715         * statement.cs (Block.AddChildVariableNames): New public method.
3716         (Block.AddChildVariableName): Likewise.
3717         (Block.IsVariableNameUsedInChildBlock): Likewise.
3718         (Block.AddVariable): Check whether a variable name has already
3719         been used in a child block.
3720
3721         * cs-parser.jay (declare_local_variables): Mark all variable names
3722         from the current block as being used in a child block in the
3723         implicit block.
3724
3725 2002-08-23  Martin Baulig  <martin@gnome.org>
3726
3727         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
3728         find the symbol writer.
3729
3730         * driver.cs: csc also allows the arguments to /define being
3731         separated by commas, not only by semicolons.
3732
3733 2002-08-23  Martin Baulig  <martin@gnome.org>
3734
3735         * interface.cs (Interface.GetMembers): Added static check for events.
3736
3737 2002-08-15  Martin Baulig  <martin@gnome.org>
3738
3739         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
3740         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
3741
3742         * ecore.cs (Expression.MemberLookup): Added documentation and explained
3743         why the MethodData.EmitDestructor() change was necessary.
3744
3745 2002-08-20  Martin Baulig  <martin@gnome.org>
3746
3747         * class.cs (TypeContainer.FindMembers): Added static check for events.
3748
3749         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
3750
3751         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
3752         use Type.GetEvents(), not Type.FindMembers().
3753
3754 2002-08-20  Martin Baulig  <martin@gnome.org>
3755
3756         * decl.cs (MemberCache): Added a special method cache which will
3757         be used for method-only searched.  This ensures that a method
3758         search will return a MethodInfo with the correct ReflectedType for
3759         inherited methods.      
3760
3761 2002-08-20  Martin Baulig  <martin@gnome.org>
3762
3763         * decl.cs (DeclSpace.FindMembers): Made this public.
3764
3765 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3766
3767         * delegate.cs: fixed build on windows.
3768         [FIXME:  Filed as bug #29150: MCS must report these errors.]
3769
3770 2002-08-19  Ravi Pratap  <ravi@ximian.com>
3771
3772         * ecore.cs (StandardConversionExists): Return a false
3773         if we are trying to convert the void type to anything else
3774         since that is not allowed.
3775
3776         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
3777         we flag error 70 in the event an event is trying to be accessed
3778         directly from outside the declaring type.
3779
3780 2002-08-20  Martin Baulig  <martin@gnome.org>
3781
3782         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
3783         MemberCache from typemanager.cs to decl.cs.
3784
3785 2002-08-19  Martin Baulig  <martin@gnome.org>
3786
3787         * class.cs (TypeContainer): Implement IMemberContainer.
3788         (TypeContainer.DefineMembers): Create the MemberCache.
3789         (TypeContainer.FindMembers): Do better BindingFlags checking; only
3790         return public members if BindingFlags.Public was given, check
3791         whether members are static.
3792
3793 2002-08-16  Martin Baulig  <martin@gnome.org>
3794
3795         * decl.cs (DeclSpace.Define): Splitted this in Define and
3796         DefineMembers.  DefineMembers is called first and initializes the
3797         MemberCache.
3798
3799         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
3800         DefineMembers() on all our DeclSpaces.
3801
3802         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
3803         but call DefineMembers() on all nested interfaces.  We call their
3804         Define() in our new Define() function.
3805
3806         * interface.cs (Interface): Implement IMemberContainer.
3807         (Interface.Define): Moved all code except the attribute stuf to
3808         DefineMembers().
3809         (Interface.DefineMembers): Initialize the member cache.
3810
3811         * typemanager.cs (IMemberFinder): Removed this interface, we don't
3812         need this anymore since we can use MemberCache.FindMembers directly.
3813
3814 2002-08-19  Martin Baulig  <martin@gnome.org>
3815
3816         * typemanager.cs (MemberCache): When creating the cache for an
3817         interface type, add all inherited members.
3818         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
3819         to `out bool used_cache' and documented it.
3820         (TypeManager.MemberLookup): If we already used the cache in the first
3821         iteration, we don't need to do the interfaces check.
3822
3823 2002-08-19  Martin Baulig  <martin@gnome.org>
3824
3825         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
3826         here from IMemberFinder and don't implement this interface anymore.
3827         (DeclSpace.MemberCache): Moved here from IMemberFinder.
3828
3829         * typemanager.cs (IMemberFinder): This interface is now only used by
3830         classes which actually support the member cache.
3831         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
3832         since we only put DeclSpaces into this Hashtable.
3833         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
3834         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
3835
3836 2002-08-16  Martin Baulig  <martin@gnome.org>
3837
3838         * typemanager.cs (ICachingMemberFinder): Removed.
3839         (IMemberFinder.MemberCache): New property.
3840         (TypeManager.FindMembers): Merged this with RealFindMembers().
3841         This function will never be called from TypeManager.MemberLookup()
3842         so we can't use the cache here, just the IMemberFinder.
3843         (TypeManager.MemberLookup_FindMembers): Check whether the
3844         IMemberFinder has a MemberCache and call the cache's FindMembers
3845         function.
3846         (MemberCache): Rewrote larger parts of this yet another time and
3847         cleaned it up a bit.
3848
3849 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
3850
3851         * driver.cs (LoadArgs): Support quoting.
3852
3853         (Usage): Show the CSC-like command line arguments.
3854
3855         Improved a few error messages.
3856
3857 2002-08-15  Martin Baulig  <martin@gnome.org>
3858
3859         * typemanager.cs (IMemberContainer.Type): New property.
3860         (IMemberContainer.IsInterface): New property.
3861
3862         The following changes are conditional to BROKEN_RUNTIME, which is
3863         defined at the top of the file.
3864
3865         * typemanager.cs (MemberCache.MemberCache): Don't add the base
3866         class'es members, but add all members from TypeHandle.ObjectType
3867         if we're an interface.
3868         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
3869         is the current type.
3870         (MemberCache.CacheEntry.Container): Removed this field.
3871         (TypeHandle.GetMembers): Include inherited members.
3872
3873 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3874
3875         * typemanager.cs: fixed compilation and added a comment on a field that
3876         is never used.
3877
3878 2002-08-15  Martin Baulig  <martin@gnome.org>
3879
3880         * class.cs (ConstructorInitializer.Resolve): In the
3881         Expression.MemberLookup call, use the queried_type as
3882         invocation_type.
3883
3884         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
3885         declared' attribute, it's always true.
3886         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
3887         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
3888         temporary wrapper for FindMembers which tells MemberLookup whether
3889         members from the base classes are included in the return value.
3890         This will go away soon.
3891         (TypeManager.MemberLookup): Use this temporary hack here; once the
3892         new MemberCache is completed, we don't need to do the DeclaredOnly
3893         looping here anymore since the MemberCache will take care of this.
3894         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
3895         (MemberCache): When creating the MemberCache for a class, get
3896         members from the current class and all its base classes.
3897         (MemberCache.CacheEntry.Container): New field.  This is a
3898         temporary hack until the Mono runtime is fixed to distinguish
3899         between ReflectedType and DeclaringType.  It allows us to use MCS
3900         with both the MS runtime and the unfixed Mono runtime without
3901         problems and without accecting performance.
3902         (MemberCache.SearchMembers): The DeclaredOnly looping from
3903         TypeManager.MemberLookup is now done here.      
3904
3905 2002-08-14  Martin Baulig  <martin@gnome.org>
3906
3907         * statement.cs (MyStructInfo.MyStructInfo): Don't call
3908         Type.GetFields on dynamic types but get the fields from the
3909         corresponding TypeContainer.
3910         (MyStructInfo.GetStructInfo): Added check for enum types.
3911
3912         * typemanager.cs (MemberList.IsSynchronized): Implemented.
3913         (MemberList.SyncRoot): Implemented.
3914         (TypeManager.FilterWithClosure): No need to check permissions if
3915         closure_start_type == closure_invocation_type, don't crash if
3916         closure_invocation_type is null.
3917
3918 2002-08-13  Martin Baulig  <martin@gnome.org>
3919
3920         Rewrote TypeContainer.FindMembers to use a member cache.  This
3921         gives us a speed increase of about 35% for the self-hosting MCS
3922         build and of about 15-20% for the class libs (both on GNU/Linux).
3923
3924         * report.cs (Timer): New class to get enhanced profiling.  This
3925         whole class is "TIMER" conditional since it remarkably slows down
3926         compilation speed.
3927
3928         * class.cs (MemberList): New class.  This is an IList wrapper
3929         which we're now using instead of passing MemberInfo[]'s around to
3930         avoid copying this array unnecessarily.
3931         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
3932         (ICachingMemberFinder, IMemberContainer): New interface.
3933         (TypeManager.FilterWithClosure): If `criteria' is null, the name
3934         has already been checked, otherwise use it for the name comparision.
3935         (TypeManager.FindMembers): Renamed to RealMemberFinder and
3936         provided wrapper which tries to use ICachingMemberFinder.FindMembers
3937         if possible.  Returns a MemberList, not a MemberInfo [].
3938         (TypeHandle): New class, implements IMemberContainer.  We create
3939         one instance of this class per type, it contains a MemberCache
3940         which is used to do the member lookups.
3941         (MemberCache): New class.  Each instance of this class contains
3942         all members of a type and a name-based hash table.
3943         (MemberCache.FindMembers): This is our new member lookup
3944         function.  First, it looks up all members of the requested name in
3945         the hash table.  Then, it walks this list and sorts out all
3946         applicable members and returns them.
3947
3948 2002-08-13  Martin Baulig  <martin@gnome.org>
3949
3950         In addition to a nice code cleanup, this gives us a performance
3951         increase of about 1.4% on GNU/Linux - not much, but it's already
3952         half a second for the self-hosting MCS compilation.
3953
3954         * typemanager.cs (IMemberFinder): New interface.  It is used by
3955         TypeManager.FindMembers to call FindMembers on a TypeContainer,
3956         Enum, Delegate or Interface.
3957         (TypeManager.finder_to_member_finder): New PtrHashtable.
3958         (TypeManager.finder_to_container): Removed.
3959         (TypeManager.finder_to_delegate): Removed.
3960         (TypeManager.finder_to_interface): Removed.
3961         (TypeManager.finder_to_enum): Removed.
3962
3963         * interface.cs (Interface): Implement IMemberFinder.
3964
3965         * delegate.cs (Delegate): Implement IMemberFinder.
3966
3967         * enum.cs (Enum): Implement IMemberFinder.
3968
3969         * class.cs (TypeContainer): Implement IMemberFinder.
3970
3971 2002-08-12  Martin Baulig  <martin@gnome.org>
3972
3973         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
3974
3975 2002-08-12  Martin Baulig  <martin@gnome.org>
3976
3977         * ecore.cs (ITypeExpression): New interface for expressions which
3978         resolve to a type.
3979         (TypeExpression): Renamed to TypeLookupExpression.
3980         (Expression.DoResolve): If we're doing a types-only lookup, the
3981         expression must implement the ITypeExpression interface and we
3982         call DoResolveType() on it.
3983         (SimpleName): Implement the new ITypeExpression interface.
3984         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
3985         hack, the situation that we're only looking up types can't happen
3986         anymore when this method is called.  Moved the type lookup code to
3987         DoResolveType() and call it.
3988         (SimpleName.DoResolveType): This ITypeExpression interface method
3989         is now doing the types-only lookup.
3990         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
3991         (ResolveFlags): Added MaskExprClass.
3992
3993         * expression.cs (MemberAccess): Implement the ITypeExpression
3994         interface.
3995         (MemberAccess.DoResolve): Added support for a types-only lookup
3996         when we're called via ITypeExpression.DoResolveType().
3997         (ComposedCast): Implement the ITypeExpression interface.
3998
3999         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
4000         Expression.Resolve() with ResolveFlags.Type instead.
4001
4002 2002-08-12  Martin Baulig  <martin@gnome.org>
4003
4004         * interface.cs (Interface.Define): Apply attributes.
4005
4006         * attribute.cs (Attribute.ApplyAttributes): Added support for
4007         interface attributes.
4008
4009 2002-08-11  Martin Baulig  <martin@gnome.org>
4010
4011         * statement.cs (Block.Emit): Only check the "this" variable if we
4012         do not always throw an exception.
4013
4014         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
4015         whether the property has a set accessor.
4016
4017 2002-08-11  Martin Baulig  <martin@gnome.org>
4018
4019         Added control flow analysis support for structs.
4020
4021         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
4022         with control flow analysis turned off.
4023         (IVariable): New interface.
4024         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
4025         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
4026         (FieldExpr.DoResolve): Resolve the instance expression with flow
4027         analysis turned off and do the definite assignment check after the
4028         resolving when we know what the expression will resolve to.
4029
4030         * expression.cs (LocalVariableReference, ParameterReference):
4031         Implement the new IVariable interface, only call the flow analysis
4032         code if ec.DoFlowAnalysis is true.
4033         (This): Added constructor which takes a Block argument.  Implement
4034         the new IVariable interface.
4035         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
4036         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
4037         This does the definite assignment checks for struct members.
4038
4039         * class.cs (Constructor.Emit): If this is a non-static `struct'
4040         constructor which doesn't have any initializer, call
4041         Block.AddThisVariable() to tell the flow analysis code that all
4042         struct elements must be initialized before control returns from
4043         the constructor.
4044
4045         * statement.cs (MyStructInfo): New public class.
4046         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
4047         argument to this indexer.  If non-zero, check an individual struct
4048         member, not the whole struct.
4049         (FlowBranching.CheckOutParameters): Check struct members.
4050         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
4051         overloaded versions of these methods which take an additional
4052         `int field_idx' argument to check struct members.
4053         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
4054         overloaded versions of these methods which take an additional
4055         `string field_name' argument to check struct member.s
4056         (VariableInfo): Implement the IVariable interface.
4057         (VariableInfo.StructInfo): New public property.  Returns the
4058         MyStructInfo instance of the variable if it's a struct or null.
4059         (Block.AddThisVariable): New public method.  This is called from
4060         Constructor.Emit() for non-static `struct' constructor which do
4061         not have any initializer.  It creates a special variable for the
4062         "this" instance variable which will be checked by the flow
4063         analysis code to ensure that all of the struct's fields are
4064         initialized before control returns from the constructor.
4065         (UsageVector): Added support for struct members.  If a
4066         variable/parameter is a struct with N members, we reserve a slot
4067         in the usage vector for each member.  A struct is considered fully
4068         initialized if either the struct itself (slot 0) or all its
4069         members are initialized.
4070
4071 2002-08-08  Martin Baulig  <martin@gnome.org>
4072
4073         * driver.cs (Driver.MainDriver): Only report an error CS5001
4074         if there were no compilation errors.
4075
4076         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
4077         `UnsafeContext' property to determine whether the parent is in
4078         unsafe context rather than checking the parent's ModFlags:
4079         classes nested in an unsafe class are unsafe as well.
4080
4081 2002-08-08  Martin Baulig  <martin@gnome.org>
4082
4083         * statement.cs (UsageVector.MergeChildren): Distinguish between
4084         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
4085         we return.  Added test17() and test18() to test-154.cs.
4086
4087 2002-08-08  Martin Baulig  <martin@gnome.org>
4088
4089         * typemanager.cs (TypeManager.FilterWithClosure): If we have
4090         Family access, make sure the invoking type isn't a subclass of the
4091         queried type (that'd be a CS1540).
4092
4093         * ecore.cs (Expression.MemberLookup): Added overloaded version of
4094         this method which takes an additional `Type invocation_type'.
4095
4096         * expression.cs (BaseAccess.DoResolve): Use the base type as
4097         invocation and query type.
4098         (MemberAccess.DoResolve): If the lookup failed and we're about to
4099         report a CS0122, try a lookup with the ec.ContainerType - if this
4100         succeeds, we must report a CS1540.
4101
4102 2002-08-08  Martin Baulig  <martin@gnome.org>
4103
4104         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
4105         (MethodGroupExpr): Implement the IMemberExpr interface.
4106
4107         * expression (MemberAccess.ResolveMemberAccess): No need to have
4108         any special code for MethodGroupExprs anymore, they're now
4109         IMemberExprs.   
4110
4111 2002-08-08  Martin Baulig  <martin@gnome.org>
4112
4113         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
4114         Family, FamANDAssem and FamORAssem permissions.
4115         (TypeManager.IsSubclassOrNestedChildOf): New public method.
4116
4117 2002-08-08  Martin Baulig  <martin@gnome.org>
4118
4119         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
4120         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
4121         or loop block.
4122
4123 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
4124
4125         * driver.cs: implemented /resource option to embed managed resources.
4126
4127 2002-08-07  Martin Baulig  <martin@gnome.org>
4128
4129         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
4130         (FieldBase.HasFieldInitializer): New public property.
4131         (FieldBase.GetInitializerExpression): New public method.  Resolves and
4132         returns the field initializer and makes sure it is only resolved once.
4133         (TypeContainer.EmitFieldInitializers): Call
4134         FieldBase.GetInitializerExpression to get the initializer, this ensures
4135         that it isn't resolved multiple times.
4136
4137         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
4138         the resolving process (SimpleName/MemberLookup) that we're currently
4139         emitting a field initializer (which must not access any instance members,
4140         this is an error CS0236).
4141
4142         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
4143         argument, if the `IsFieldInitializer' flag is set, we must report and
4144         error CS0236 and not an error CS0120.   
4145
4146 2002-08-07  Martin Baulig  <martin@gnome.org>
4147
4148         * ecore.cs (IMemberExpr): New public interface.
4149         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
4150         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
4151         if the expression is an IMemberExpr.
4152
4153         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
4154         to be null, implicitly default to `this' if we're non-static in
4155         this case.  Simplified the code a lot by using the new IMemberExpr
4156         interface.  Also fixed bug #28176 here.
4157
4158 2002-08-06  Martin Baulig  <martin@gnome.org>
4159
4160         * cs-parser.jay (SimpleLookup): Removed.  We need to create
4161         ParameterReferences during semantic analysis so that we can do a
4162         type-only search when resolving Cast, TypeOf and SizeOf.
4163         (block): Pass the `current_local_parameters' to the Block's
4164         constructor.
4165
4166         * class.cs (ConstructorInitializer): Added `Parameters parameters'
4167         argument to the constructor.
4168         (ConstructorInitializer.Resolve): Create a temporary implicit
4169         block with the parameters.
4170
4171         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
4172         references here if we aren't doing a type-only search.
4173
4174         * statement.cs (Block): Added constructor which takes a
4175         `Parameters parameters' argument.
4176         (Block.Parameters): New public property.
4177
4178         * support.cs (InternalParameters.Parameters): Renamed `parameters'
4179         to `Parameters' and made it public readonly.
4180
4181 2002-08-06  Martin Baulig  <martin@gnome.org>
4182
4183         * ecore.cs (Expression.Warning): Made this public as well.
4184
4185         * report.cs (Report.Debug): Print the contents of collections.
4186
4187 2002-08-06  Martin Baulig  <martin@gnome.org>
4188
4189         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
4190         used to tell Resolve() which kinds of expressions it may return.
4191         (Expression.Resolve): Added overloaded version of this method which
4192         takes a `ResolveFlags flags' argument.  This can be used to tell
4193         Resolve() which kinds of expressions it may return.  Reports a
4194         CS0118 on error.
4195         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
4196         ResolveFlags.SimpleName.
4197         (Expression.Error118): Added overloaded version of this method which
4198         takes a `ResolveFlags flags' argument.  It uses the flags to determine
4199         which kinds of expressions are allowed.
4200
4201         * expression.cs (Argument.ResolveMethodGroup): New public method.
4202         Resolves an argument, but allows a MethodGroup to be returned.
4203         This is used when invoking a delegate.
4204
4205         * TODO: Updated a bit.
4206
4207 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4208
4209         Fixed compilation with csc.
4210
4211         * ecore.cs: Expression.Error made public. Is this correct? Should
4212         Warning be made public too?
4213
4214         * expression.cs: use ea.Location instead of ea.loc.
4215         [FIXME:  Filed as bug #28607: MCS must report these errors.]
4216
4217 2002-08-06  Martin Baulig  <martin@gnome.org>
4218
4219         * ecore.cs (Expression.loc): Moved the location here instead of
4220         duplicating it in all derived classes.
4221         (Expression.Location): New public property.
4222         (Expression.Error, Expression.Warning): Made them non-static and
4223         removed the location argument.
4224         (Expression.Warning): Added overloaded version which takes an
4225         `int level' argument.
4226         (Expression.Error118): Make this non-static and removed the
4227         expression and location arguments.
4228         (TypeExpr): Added location argument to the constructor.
4229
4230         * expression.cs (StaticCallExpr): Added location argument to
4231         the constructor.
4232         (Indirection, PointerArithmetic): Likewise.
4233         (CheckedExpr, UnCheckedExpr): Likewise.
4234         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
4235         (StringPtr): Likewise.
4236
4237
4238 2002-08-05  Martin Baulig  <martin@gnome.org>
4239
4240         * expression.cs (BaseAccess.DoResolve): Actually report errors.
4241
4242         * assign.cs (Assign.DoResolve): Check whether the source
4243         expression is a value or variable.
4244
4245         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
4246         while resolving the corresponding blocks.
4247
4248         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
4249         an error, don't silently return null.
4250
4251         * statement.cs (Block.AddVariable): Do the error reporting here
4252         and distinguish between CS0128 and CS0136.
4253         (Block.DoResolve): Report all unused labels (warning CS0164).
4254         (LabeledStatement): Pass the location to the constructor.
4255         (LabeledStatement.HasBeenReferenced): New property.
4256         (LabeledStatement.Resolve): Set it to true here.
4257
4258         * statement.cs (Return.Emit): Return success even after reporting
4259         a type mismatch error (CS0126 or CS0127), this is what csc does and
4260         it avoids confusing the users with any consecutive errors.
4261
4262 2002-08-05  Martin Baulig  <martin@gnome.org>
4263
4264         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
4265
4266         * const.cs (Const.LookupConstantValue): Catch circular definitions.
4267
4268         * expression.cs (MemberAccess.DoResolve): Silently return if an
4269         error has already been reported.
4270
4271         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
4272         error has already been reported.
4273
4274 2002-08-05  Martin Baulig  <martin@gnome.org>
4275
4276         * statement.cs (UsageVector): Only initialize the `parameters'
4277         vector if we actually have any "out" parameters.
4278
4279 2002-08-05  Martin Baulig  <martin@gnome.org>
4280
4281         * expression.cs (Binary.ResolveOperator): When combining delegates,
4282         they must have the same type.
4283
4284 2002-08-05  Martin Baulig  <martin@gnome.org>
4285
4286         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
4287         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
4288         work with the ms runtime and we also don't need it: if we're a
4289         PropertyBuilder and not in the `indexer_arguments' hash, then we
4290         are a property and not an indexer.
4291
4292         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
4293         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
4294         since the latter one doesn't work with the ms runtime.
4295
4296 2002-08-03  Martin Baulig  <martin@gnome.org>
4297
4298         Fixed bugs #27998 and #22735.
4299
4300         * class.cs (Method.IsOperator): New public field.
4301         (Method.CheckBase): Report CS0111 if there's already a method
4302         with the same parameters in the current class.  Report CS0508 when
4303         attempting to change the return type of an inherited method.
4304         (MethodData.Emit): Report CS0179 if a method doesn't have a body
4305         and it's not marked abstract or extern.
4306         (PropertyBase): New abstract base class for Property and Indexer.
4307         (PropertyBase.CheckBase): Moved here from Property and made it work
4308         for indexers.
4309         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
4310         the same so we can reuse it there.
4311         (Property, Indexer): Derive from PropertyBase.
4312         (MethodSignature.inheritable_property_signature_filter): New delegate
4313         to find properties and indexers.
4314
4315         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
4316         argument and improved error reporting.
4317
4318         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
4319         EmptyReadOnlyParameters and made it a property.
4320
4321         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
4322         version of this method which takes a `PropertyInfo indexer'.
4323         (TypeManager.RegisterIndexer): New method.
4324
4325         * class.cs: Added myself as author of this file :-)
4326
4327 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4328
4329         * class.cs: fixed compilation on windoze.
4330
4331 2002-08-03  Martin Baulig  <martin@gnome.org>
4332
4333         * interface.cs (Interface.GetInterfaceBases): Check whether all
4334         base interfaces are at least as accessible than the current one.
4335
4336         * class.cs (TypeContainer.GetClassBases): Check whether base types
4337         are at least as accessible than the current type.
4338         (TypeContainer.AsAccessible): Implemented and made non-static.
4339         (MemberBase.CheckParameters): Report errors if the accessibility
4340         checks fail.
4341
4342         * delegate.cs (Delegate.Delegate): The default visibility is
4343         internal for top-level types and private for nested types.
4344         (Delegate.Define): Report errors if the accessibility checks fail.
4345
4346         * enum.cs (Enum.Enum): The default visibility is internal for
4347         top-level types and private for nested types.
4348         (Enum.DefineType): Compute the correct visibility.
4349
4350         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
4351         function which takes a `bool is_toplevel' instead of a TypeContainer.
4352
4353         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
4354         builtin type.
4355
4356 2002-08-02  Martin Baulig  <martin@gnome.org>
4357
4358         * expression.cs (LocalVariableReferenc): Added constructor which
4359         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
4360         (LocalVariableReference.IsReadOnly): New property.
4361         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
4362         variable is readonly, use our own readonly flag to do this; you can
4363         use the new constructor to get a writable reference to a read-only
4364         variable.
4365
4366         * cs-parser.jay (foreach_statement, using_statement): Get a writable
4367         reference to the local variable.
4368
4369 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
4370
4371         * rootcontext.cs (ResolveCore): Also include System.Exception
4372
4373         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
4374         we reach an EmptyStatement.
4375
4376         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
4377         is also fine.
4378
4379         * expression.cs (Binary.ResolveOperator): Check error result in
4380         two places.
4381
4382         use brtrue/brfalse directly and avoid compares to null.
4383
4384 2002-08-02  Martin Baulig  <martin@gnome.org>
4385
4386         * class.cs (TypeContainer.Define): Define all nested interfaces here.
4387         Fixes bug #28407, added test-155.cs.
4388
4389 2002-08-01  Martin Baulig  <martin@gnome.org>
4390
4391         * class.cs (Event.EmitDefaultMethod): Make this work with static
4392         events.  Fixes #28311, added verify-3.cs.
4393
4394 2002-08-01  Martin Baulig  <martin@gnome.org>
4395
4396         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
4397         `is_disposable' fields.
4398         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
4399         `hm.is_disposable' if we're using the collection pattern.
4400         (Foreach.EmitCollectionForeach): Use the correct type for the
4401         enumerator's local variable, only emit the try/finally block if
4402         necessary (fixes #27713).
4403
4404 2002-08-01  Martin Baulig  <martin@gnome.org>
4405
4406         * ecore.cs (Expression.report118): Renamed to Error118 and made
4407         it public static.
4408
4409         * statement.cs (Throw.Resolve): Check whether the expression is of
4410         the correct type (CS0118) and whether the type derives from
4411         System.Exception (CS0155).
4412         (Catch.Resolve): New method.  Do the type lookup here and check
4413         whether it derives from System.Exception (CS0155).
4414         (Catch.CatchType, Catch.IsGeneral): New public properties.
4415
4416         * typemanager.cs (TypeManager.exception_type): Added.
4417
4418 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
4419
4420         * driver.cs: Updated About function.
4421
4422 2002-07-31  Martin Baulig  <martin@gnome.org>
4423
4424         Implemented Control Flow Analysis.
4425
4426         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
4427         (EmitContext.CurrentBranching): Added.
4428         (EmitContext.StartFlowBranching): Added.
4429         (EmitContext.EndFlowBranching): Added.
4430         (EmitContext.KillFlowBranching): Added.
4431         (EmitContext.IsVariableAssigned): Added.
4432         (EmitContext.SetVariableAssigned): Added.
4433         (EmitContext.IsParameterAssigned): Added.
4434         (EmitContext.SetParameterAssigned): Added.
4435         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
4436         Added control flow analysis stuff here.
4437
4438         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
4439         resolve the expression as lvalue.
4440         (LocalVariableReference.DoResolve): Check whether the variable has
4441         already been assigned.
4442         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
4443         the parameter as assigned here.
4444         (ParameterReference.DoResolve): Check whether the parameter has already
4445         been assigned.
4446         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
4447         expression as lvalue.
4448
4449         * statement.cs (FlowBranching): New class for the flow analysis code.
4450         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
4451         (LabeledStatement.IsDefined): New public property.
4452         (LabeledStatement.AddUsageVector): New public method to tell flow
4453         analyis that the label may be reached via a forward jump.
4454         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
4455         flow analysis.
4456         (VariableInfo.Number): New public field.  This is used by flow analysis
4457         to number all locals of a block.
4458         (Block.CountVariables): New public property.  This is the number of
4459         local variables in this block (including the locals from all parent
4460         blocks).
4461         (Block.EmitMeta): Number all the variables.
4462
4463         * statement.cs: Added flow analysis support to all classes.
4464
4465 2002-07-31  Martin Baulig  <martin@gnome.org>
4466
4467         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
4468         To get debugging messages, compile mcs with /define:MCS_DEBUG and
4469         then use this argument.
4470
4471         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
4472
4473         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
4474         use this to specify /define options.
4475
4476 2002-07-29  Martin Baulig  <martin@gnome.org>
4477
4478         * statement.cs (Fixed): Moved all code that does variable lookups
4479         and resolvings from Emit to Resolve.
4480
4481         * statement.cs (For): Moved all code that does variable lookups
4482         and resolvings from Emit to Resolve.
4483
4484         * statement.cs (Using): Moved all code that does variable lookups
4485         and resolvings from Emit to Resolve.
4486
4487 2002-07-29  Martin Baulig  <martin@gnome.org>
4488
4489         * attribute.cs (Attribute.Resolve): Explicitly catch a
4490         System.NullReferenceException when creating the
4491         CustromAttributeBuilder and report a different warning message.
4492
4493 2002-07-29  Martin Baulig  <martin@gnome.org>
4494
4495         * support.cs (ParameterData.ParameterName): Added method to
4496         get the name of a parameter.
4497
4498         * typemanager.cs (TypeManager.IsValueType): New public method.
4499
4500 2002-07-29  Martin Baulig  <martin@gnome.org>
4501
4502         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
4503         is a flag which specifies that it's either ref or out.
4504         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
4505         the out parameter to `out Parameter.Modifier mod', also set the
4506         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
4507
4508         * support.cs (InternalParameters.ParameterModifier): Distinguish
4509         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4510         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4511
4512         * expression.cs (Argument.GetParameterModifier): Distinguish
4513         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
4514         Parameter.Modifier.ISBYREF flag if it's either ref or out.
4515
4516 2002-07-29  Martin Baulig  <martin@gnome.org>
4517
4518         * expression.cs (ParameterReference.ParameterReference): Added
4519         `Location loc' argument to the constructor.
4520
4521         * cs-parser.jay: Pass location to ParameterReference.
4522
4523 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
4524
4525         * statement.cs (Try): Initialize the location.
4526
4527         * cs-parser.jay: pass location to Try.
4528
4529         * expression.cs (Unary.Reduce): Change the prototype to return
4530         whether a constant fold could be performed or not.  The result is
4531         returned in an out parameters.  In the case of Indirection and
4532         AddressOf, we want to perform the full tests.
4533
4534 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
4535
4536         * statement.cs (Statement.Emit): Flag dead code.
4537
4538 2002-07-27  Andrew Birkett  <andy@nobugs.org>
4539
4540         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
4541
4542 2002-07-27  Martin Baulig  <martin@gnome.org>
4543
4544         * class.cs (MethodData.Define): Put back call to
4545         TypeManager.AddMethod(), accidentally commented this out.
4546
4547         * report.cs (Debug): New public method to print debugging information,
4548         this is `[Conditional ("DEBUG")]'.
4549
4550 2002-07-26  Martin Baulig  <martin@gnome.org>
4551
4552         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
4553         (switch_statement): Push the current_block to the switch_stack and
4554         pop it again when we're done with the switch.
4555         (switch_section): The new block is a child of the current_block.
4556         Fixes bug #24007, added test-152.cs.
4557
4558 2002-07-27  Martin Baulig  <martin@gnome.org>
4559
4560         * expression.cs (Invocation.EmitArguments): When calling a varargs
4561         function with only its fixed arguments, we need to pass an empty
4562         array.
4563
4564 2002-07-27  Martin Baulig  <martin@gnome.org>
4565
4566         Mono 0.13 has been released.
4567
4568 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
4569
4570         * driver.cs: Rename --resource to --linkres, because that is what
4571         we do currently, we dont support --resource yet.
4572
4573         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
4574
4575 2002-07-25  Martin Baulig  <martin@gnome.org>
4576
4577         * class.cs (MethodData): New public class.  This is a `method builder'
4578         class for a method or one accessor of a Property/Indexer/Event.
4579         (MethodData.GetMethodFlags): Moved here from MemberBase.
4580         (MethodData.ApplyAttributes): Likewise.
4581         (MethodData.ApplyObsoleteAttribute): Likewise.
4582         (MethodData.ApplyConditionalAttribute): Likewise.
4583         (MethodData.ApplyDllImportAttribute): Likewise.
4584         (MethodData.CheckAbstractAndExternal): Likewise.
4585         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
4586         (MethodData.Emit): Formerly known as Method.Emit().
4587         (MemberBase): Moved everything which was specific to a single
4588         accessor/method to MethodData.
4589         (Method): Create a new MethodData and call Define() and Emit() on it.
4590         (Property, Indexer, Event): Create a new MethodData objects for each
4591         accessor and call Define() and Emit() on them.
4592
4593 2002-07-25  Martin Baulig  <martin@gnome.org>
4594
4595         Made MethodCore derive from MemberBase to reuse the code from there.
4596         MemberBase now also checks for attributes.
4597
4598         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
4599         (MemberBase.GetMethodFlags): Moved here from class Method and marked
4600         as virtual.
4601         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
4602         `CallingConventions cc' and `Attributes opt_attrs' arguments.
4603         (MemberBase.ApplyAttributes): New virtual method; applies the
4604         attributes to a method or accessor.
4605         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
4606         (MemberBase.ApplyConditionalAttribute): Likewise.
4607         (MemberBase.ApplyDllImportAttribute): Likewise.
4608         (MemberBase.CheckAbstractAndExternal): Likewise.
4609         (MethodCore.ParameterTypes): This is now a property instead of a
4610         method, it's initialized from DoDefineParameters().
4611         (MethodCore.ParameterInfo): Removed the set accessor.
4612         (MethodCore.DoDefineParameters): New protected virtual method to
4613         initialize ParameterTypes and ParameterInfo.
4614         (Method.GetReturnType): We can now simply return the MemberType.
4615         (Method.GetMethodFlags): Override the MemberBase version and add
4616         the conditional flags.
4617         (Method.CheckBase): Moved some code from Define() here, call
4618         DoDefineParameters() here.
4619         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
4620         here to avoid some larger code duplication.
4621         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
4622         ensure that abstract and external accessors don't declare a body.
4623
4624         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
4625         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
4626         lookup in the attribute's parent classes, so we need to abort as soon
4627         as we found the first match.
4628         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
4629         the attribute has no arguments.
4630
4631         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
4632         of a Method.
4633
4634 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4635
4636         * cs-parser.jay: reverted previous patch.
4637
4638 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4639
4640         * cs-parser.jay: fixed bug #22119.
4641
4642 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4643
4644         * attribute.cs: fixed compilation. The error was:
4645         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
4646         be assigned to before control leaves the current method."
4647         [FIXME:  Filed as bug #28186: MCS must report this error.]
4648
4649 2002-07-25  Martin Baulig  <martin@gnome.org>
4650
4651         * attribute.cs (Attribute.Conditional_GetConditionName): New static
4652         method to pull the condition name ouf of a Conditional attribute.
4653         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
4654         the obsolete message and error flag out of an Obsolete attribute.
4655
4656         * class.cs (Method.GetMethodFlags): New public method to get the
4657         TypeManager.MethodFlags for this method.
4658         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
4659         private methods.
4660         (Method.Define): Get and apply the Obsolete and Conditional attributes;
4661         if we're overriding a virtual function, set the new private variable
4662         `parent_method'; call the new TypeManager.AddMethod().
4663
4664         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
4665         the MethodBuilder and the Method in a PtrHashtable.
4666         (TypeManager.builder_to_method): Added for this purpose.
4667         (TypeManager.MethodFlags): Added IsObsoleteError.
4668         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
4669         Obsolete and Conditional arguments in MethodBuilders.  If we discover
4670         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
4671         the message from the attribute.
4672
4673 2002-07-24  Martin Baulig  <martin@gnome.org>
4674
4675         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
4676         preprocessor directives, ensure that the argument to #define/#undef is
4677         exactly one identifier and that it's actually an identifier.
4678
4679         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
4680         did not work ....
4681
4682 2002-07-24  Martin Baulig  <martin@gnome.org>
4683
4684         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
4685         initialize it to TypeManager.object_type in the constructor.
4686         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
4687         of the `hm.get_current' method if we're using the collection pattern.
4688         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
4689         for the explicit conversion to make it work when we're using the collection
4690         pattern and the `Current' property has a different return type than `object'.
4691         Fixes #27713.
4692
4693 2002-07-24  Martin Baulig  <martin@gnome.org>
4694
4695         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
4696         does not match, but don't report any errors.  This method is called in
4697         order for all methods in a MethodGroupExpr until a matching method is
4698         found, so we don't want to bail out if the first method doesn't match.
4699         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
4700         matches, report the 123.  Fixes #28070.
4701
4702 2002-07-24  Martin Baulig  <martin@gnome.org>
4703
4704         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
4705         TypeManager.TypeToCoreType() to the top of the method so the
4706         following equality checks will work.  Fixes #28107.
4707
4708 2002-07-24  Martin Baulig  <martin@gnome.org>
4709
4710         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
4711         operand is of type uint, and the other operand is of type sbyte,
4712         short or int, the operands are converted to type long." -
4713         Actually do what this comment already told us.  Fixes bug #28106,
4714         added test-150.cs.
4715
4716 2002-07-24  Martin Baulig  <martin@gnome.org>
4717
4718         * class.cs (MethodBase): New abstract class.  This is now a base
4719         class for Property, Indexer and Event to avoid some code duplication
4720         in their Define() and DefineMethods() methods.
4721         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
4722         generic methods for Define() and DefineMethods().
4723         (FieldBase): Derive from MemberBase, not MemberCore.
4724         (Property): Derive from MemberBase, not MemberCore.
4725         (Property.DefineMethod): Moved all the code from this method to the
4726         new MethodBase.DefineAccessor(), just call it with appropriate
4727         argumetnts.
4728         (Property.Define): Call the new Property.DoDefine(), this does some
4729         sanity checks and we don't need to duplicate the code everywhere.
4730         (Event): Derive from MemberBase, not MemberCore.
4731         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
4732         accessors, this will also make them work with interface events.
4733         (Indexer): Derive from MemberBase, not MemberCore.
4734         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
4735         (Indexer.Define): Use the new MethodBase functions.
4736
4737         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
4738         argument to the constructor.
4739         (Interface.FindMembers): Added support for interface events.
4740         (Interface.PopluateEvent): Implemented.
4741
4742         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
4743
4744 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
4745
4746         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
4747         but this is required to check for a method name being the same as
4748         the containing class.  
4749
4750         Handle this now.
4751
4752 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4753
4754         * interface.cs: initialize variable.
4755
4756 2002-07-23  Martin Baulig  <martin@gnome.org>
4757
4758         Implemented the IndexerName attribute in interfaces.
4759
4760         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
4761         name if this is an explicit interface implementation.
4762         (Indexer.InterfaceIndexerName): New public variable.  If we're
4763         implementing an interface indexer, this is the IndexerName in that
4764         interface.  Otherwise, it's the IndexerName.
4765         (Indexer.DefineMethod): If we're implementing interface indexer,
4766         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
4767         and Pending.ImplementIndexer methods.
4768         (Indexer.Define): Also define the PropertyBuilder if we're
4769         implementing an interface indexer and this is neither an explicit
4770         interface implementation nor do the IndexerName match the one in
4771         the interface.
4772
4773         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
4774         If a method is defined here, then we always need to create a proxy
4775         for it.  This is used when implementing interface indexers.
4776         (Pending.IsInterfaceIndexer): New public method.
4777         (Pending.ImplementIndexer): New public method.
4778         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
4779         This is used when implementing interface indexers to define a proxy
4780         if necessary.
4781         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
4782         define a proxy if necessary.
4783
4784         * interface.cs (Interface.IndexerName): New public variable.
4785         (Interface.PopulateIndexer): Set the IndexerName.
4786         (Interface.DefineIndexers): New private method.  Populate all the
4787         indexers and make sure their IndexerNames match.
4788
4789         * typemanager.cs (IndexerPropertyName): Added support for interface
4790         indexers.
4791
4792 2002-07-22  Martin Baulig  <martin@gnome.org>
4793
4794         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
4795         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
4796         ret if HasReturnLabel.
4797         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
4798         variables.
4799
4800         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
4801         and set the ec.LoopBeginTryCatchLevel.
4802         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
4803         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
4804         the current ec.TryCatchLevel, the branch goes out of an exception
4805         block.  In this case, we need to use Leave and not Br.
4806
4807 2002-07-22  Martin Baulig  <martin@gnome.org>
4808
4809         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
4810         block unless the block does not always return or it is contained in
4811         another try { ... } catch { ... } block.  Fixes bug #26506.
4812         Added verify-1.cs to the test suite.
4813
4814 2002-07-22  Martin Baulig  <martin@gnome.org>
4815
4816         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
4817         then we do not always return.  Fixes bug #24985.
4818
4819 2002-07-22  Martin Baulig  <martin@gnome.org>
4820
4821         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
4822         lookup on a per-class level; ie. walk up the class hierarchy until we
4823         found at least one applicable method, then choose the best among them.
4824         Fixes bug #24463 and test-29.cs.
4825
4826 2002-07-22  Martin Baulig  <martin@gnome.org>
4827
4828         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
4829         return types of the methods.  The return type is not part of the
4830         signature and we must not check it to make the `new' modifier work.
4831         Fixes bug #27999, also added test-147.cs.
4832         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
4833
4834         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
4835         on the method's return type.
4836
4837 2002-07-21  Martin Baulig  <martin@gnome.org>
4838
4839         * assign.cs: Make this work if the rightmost source is a constant and
4840         we need to do an implicit type conversion.  Also adding a few more tests
4841         to test-38.cs which should have caught this.
4842
4843         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
4844         target in the makefile for this.  The makefile.gnu is primarily intended
4845         for end-users who don't want to debug the compiler.
4846
4847 2002-07-21  Martin Baulig  <martin@gnome.org>
4848
4849         * assign.cs: Improved the Assign class so it can now handle embedded
4850         assignments (X = Y = Z = something).  As a side-effect this'll now also
4851         consume less local variables.  test-38.cs now passes with MCS, added
4852         a few new test cases to that test.
4853
4854 2002-07-20  Martin Baulig  <martin@gnome.org>
4855
4856         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
4857         instructions.  Fixes bug #27977, also added test-146.cs.
4858
4859 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4860
4861         * cs-tokenizer.cs: fixed getHex ().
4862
4863 2002-07-19  Martin Baulig  <martin@gnome.org>
4864
4865         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
4866         not Type.GetType() to lookup the array type.  This is needed when
4867         we're constructing an array of a user-defined type.
4868         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
4869         single-dimensional arrays, but also for single-dimensial arrays of
4870         type decimal.
4871
4872 2002-07-19  Martin Baulig  <martin@gnome.org>
4873
4874         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
4875         this function is called, it's not allowed to share LocalBuilders
4876         among ILGenerators.
4877
4878 2002-07-19  Martin Baulig  <martin@gnome.org>
4879
4880         * expression.cs (Argument.Resolve): Report an error 118 when trying
4881         to pass a type as argument.
4882
4883 2002-07-18  Martin Baulig  <martin@gnome.org>
4884
4885         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
4886         Conv_R_Un for the signed `long' type.
4887
4888 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
4889
4890         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
4891         `expr' for the temporary result, as that will fail if we do
4892         multiple resolves on the same expression.
4893
4894 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
4895
4896         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
4897         ec.TypeContainer for looking up aliases. 
4898
4899         * class.cs (TypeContainer): Remove LookupAlias from here.
4900
4901         * decl.cs (DeclSpace); Move here.
4902
4903 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
4904
4905         * class.cs (FindMembers): Only call filter if the constructor
4906         bulider is not null.
4907
4908         Also handle delegates in `NestedTypes' now.  Now we will perform
4909         type lookups using the standard resolution process.  This also
4910         fixes a bug.
4911
4912         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
4913         This uses Expressions (the limited kind that can be parsed by the
4914         tree) instead of strings.
4915
4916         * expression.cs (ComposedCast.ToString): Implement, used to flag
4917         errors since now we have to render expressions.
4918
4919         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
4920         FormArrayType. 
4921
4922         * ecore.cs (SimpleName.ToString): ditto.
4923
4924         * cs-parser.jay: Instead of using strings to assemble types, use
4925         Expressions to assemble the type (using SimpleName, ComposedCast,
4926         MemberAccess).  This should fix the type lookups in declarations,
4927         because we were using a different code path for this.
4928
4929         * statement.cs (Block.Resolve): Continue processing statements
4930         even when there is an error.
4931
4932 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
4933
4934         * class.cs (Event.Define): Also remove the `remove' method from
4935         the list of pending items.
4936
4937         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
4938         generate more compact code. 
4939
4940 2002-07-17  Martin Baulig  <martin@gnome.org>
4941
4942         * const.cs (Const.LookupConstantValue): Add support for constant
4943         `unchecked' and `checked' expressions.
4944         Also adding test case test-140.cs for this.
4945
4946 2002-07-17  Martin Baulig  <martin@gnome.org>
4947
4948         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
4949         check whether mi.ReturnType implements the IEnumerator interface; the
4950         `==' and the IsAssignableFrom() will fail in this situation.
4951
4952 2002-07-16  Ravi Pratap  <ravi@ximian.com>
4953
4954         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
4955         here too.
4956
4957 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4958
4959         * expression.cs: fixed bug #27811.
4960
4961 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
4962
4963         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
4964         Molaro: when we are a ref, the value already contains a pointer
4965         value, do not take the address of it.
4966
4967 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
4968         * removed mb-parser.jay and mb-tokenizer.cs
4969
4970 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
4971
4972         * expression.cs: check against the building corlib void type.
4973
4974 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
4975
4976         * ecore.cs: fix for valuetype static readonly fields: when 
4977         initializing them, we need their address, not the address of a copy.
4978
4979 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
4980
4981         * typemanager.cs: register also enum_type in corlib.
4982
4983 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
4984
4985         * class.cs: allow calling this (but not base) initializers in structs.
4986
4987 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
4988
4989         * ecore.cs: make sure we compare against the building base types
4990         in GetTypeSize ().
4991
4992 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
4993
4994         * typemanager.cs: fix TypeToCoreType() to handle void and object
4995         (corlib gets no more typerefs after this change).
4996
4997 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
4998
4999         * expression.cs (ArrayCreation.EmitArrayArguments): use
5000         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
5001
5002         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
5003         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
5004         array indexes, the runtime actually forbids them.
5005
5006         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
5007         for array arguments here.
5008
5009         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
5010         instead of the default for ValueTypes.
5011
5012         (New.DoEmit): Use IsValueType instead of
5013         IsSubclassOf (value_type)
5014         (New.DoResolve): ditto.
5015         (Invocation.EmitCall): ditto.
5016
5017         * assign.cs (Assign): ditto.
5018
5019         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
5020         Statements *are* currently doing part of their resolution during
5021         Emit.  
5022
5023         Expressions do always resolve during resolve, but statements are
5024         only required to propagate resolution to their children.
5025
5026 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
5027
5028         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
5029
5030         (LoadAssembly): Do not add the dll if it is already specified
5031         
5032         (MainDriver): Add the System directory to the link path at the end,
5033         after all the other -L arguments. 
5034
5035         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
5036         wrong opcode for loading bytes and bools (ldelem.i1 instead of
5037         ldelem.u1) and using the opposite for sbytes.
5038
5039         This fixes Digger, and we can finally run it.
5040
5041         * driver.cs (UnixParseOption): Move the option parsing here.  
5042         (CSCParseOption): Implement CSC-like parsing of options.
5043
5044         We now support both modes of operation, the old Unix way, and the
5045         new CSC-like way.  This should help those who wanted to make cross
5046         platform makefiles.
5047
5048         The only thing broken is that /r:, /reference: and /lib: are not
5049         implemented, because I want to make those have the same semantics
5050         as the CSC compiler has, and kill once and for all the confussion
5051         around this.   Will be doing this tomorrow.
5052
5053         * statement.cs (Unsafe.Resolve): The state is checked during
5054         resolve, not emit, so we have to set the flags for IsUnsfe here.
5055
5056 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5057
5058         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
5059         not catch the Error_ObjectRefRequired in SimpleName (as it is
5060         possible to have a class/instance variable name that later gets
5061         deambiguated), we have to check this here.      
5062
5063 2002-07-10  Ravi Pratap  <ravi@ximian.com>
5064
5065         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
5066         make static and put into Expression.
5067
5068         (Event.Define): Register the private field of the event with the 
5069         TypeManager so that GetFieldFromEvent can get at it.
5070
5071         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
5072         keep track of the private field associated with an event which
5073         has no accessors.
5074
5075         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
5076         private field.
5077
5078         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
5079         
5080 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
5081
5082         * expression.cs (Binary.EmitBranchable): this routine emits the
5083         Binary expression in a branchable context.  This basically means:
5084         we need to branch somewhere, not just get the value on the stack.
5085
5086         This works together with Statement.EmitBoolExpression.
5087
5088         * statement.cs (Statement.EmitBoolExpression): Use
5089         EmitBranchable. 
5090
5091 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
5092
5093         * statement.cs (For): Reduce the number of jumps in loops.
5094
5095         (For): Implement loop inversion for the For statement.
5096
5097         (Break): We can be breaking out of a Try/Catch controlled section
5098         (foreach might have an implicit try/catch clause), so we need to
5099         use Leave instead of Br.
5100
5101         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
5102         now).  If the instace expression supports IMemoryLocation, we use
5103         the AddressOf method from the IMemoryLocation to extract the
5104         address instead of emitting the instance.
5105
5106         This showed up with `This', as we were emitting the instance
5107         always (Emit) instead of the Address of This.  Particularly
5108         interesting when This is a value type, as we dont want the Emit
5109         effect (which was to load the object).
5110         
5111 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
5112
5113         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
5114
5115         * statement.cs (Checked): Set the CheckedState during the resolve
5116         process too, as the ConvCast operations track the checked state on
5117         the resolve process, and not emit.
5118
5119         * cs-parser.jay (namespace_member_declaration): Flag that we have
5120         found a declaration when we do.  This is used to flag error 1529
5121
5122         * driver.cs: Report ok when we display the help only.
5123
5124 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
5125
5126         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
5127
5128 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
5129
5130         * cs-tokenizer.cs (define): We also have to track locally the
5131         defines.  AllDefines is just used for the Conditional Attribute,
5132         but we also need the local defines for the current source code. 
5133
5134 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
5135
5136         * statement.cs (While, For, Do): These loops can exit through a
5137         Break statement, use this information to tell whether the
5138         statement is the last piece of code.
5139
5140         (Break): Flag that we break.
5141
5142         * codegen.cs (EmitContexts): New `Breaks' state variable.
5143
5144 2002-07-03  Martin Baulig  <martin@gnome.org>
5145
5146         * class.cs (TypeContainer.MethodModifiersValid): Allow override
5147         modifiers in method declarations in structs.  Otherwise, you won't
5148         be able to override things like Object.Equals().
5149
5150 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5151
5152         * class.cs (Method, Property, Indexer): Do not allow the public
5153         modifier to be used in explicit interface implementations.
5154
5155         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
5156         override modifiers in method declarations in structs
5157
5158 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
5159
5160         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
5161         integer or real overflow, report an error
5162
5163 2002-07-02  Martin Baulig  <martin@gnome.org>
5164
5165         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
5166         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
5167         to tell the runtime about our newly created System.Object and
5168         System.ValueType types.
5169
5170 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
5171
5172         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
5173         struct instead of Ldarg/Starg.
5174
5175 2002-07-02  Martin Baulig  <martin@gnome.org>
5176
5177         * expression.cs (Indirection.Indirection): Call
5178         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
5179
5180 2002-07-02  Martin Baulig  <martin@gnome.org>
5181
5182         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
5183         ValueType, call TypeManager.TypeToCoreType() on it.
5184         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
5185         the OpCodes.Newarr argument.
5186
5187 2002-07-02  Martin Baulig  <martin@gnome.org>
5188
5189         * expression.cs (Invocation.EmitCall): When compiling corlib,
5190         replace all calls to the system's System.Array type to calls to
5191         the newly created one.
5192
5193         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
5194         System.Array methods.
5195         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
5196         from the system's System.Array type which must be replaced.
5197
5198 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
5199
5200         * typemanager.cs: load unverifiable_code_ctor so we can build
5201         corlib using the correct type. Avoid using GetTypeCode() with
5202         TypeBuilders.
5203         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
5204         TypeManager.object_type to allow building corlib.
5205
5206 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
5207
5208         * ecore.cs: handle System.Enum separately in LoadFromPtr().
5209
5210 2002-07-01  Martin Baulig  <martin@gnome.org>
5211
5212         * class.cs: Make the last change actually work, we need to check
5213         whether `ifaces != null' to avoid a crash.
5214
5215 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
5216
5217         * class.cs: when we build structs without fields that implement
5218         interfaces, we need to add the interfaces separately, since there is
5219         no API to both set the size and add the interfaces at type creation
5220         time.
5221
5222 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
5223
5224         * expression.cs: the dimension arguments to the array constructors
5225         need to be converted if they are a long.
5226
5227 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
5228
5229         * class.cs: don't emit ldarg.0 if there is no parent constructor
5230         (fixes showstopper for corlib).
5231
5232 2002-06-29  Martin Baulig  <martin@gnome.org>
5233
5234         MCS now compiles corlib on GNU/Linux :-)
5235
5236         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
5237         ie. check for MethodImplOptions.InternalCall.
5238
5239         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
5240         and TypeManager.attribute_type are null, so we must explicitly check
5241         whether parent is not null to find out whether it's an attribute type.
5242         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
5243         and SetBuilder, not only if the property is neither abstract nor external.
5244         This is necessary to set the MethodImplOptions on the accessor methods.
5245         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
5246         SetBuilder, see Property.Emit().
5247
5248         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
5249         populate "System.Object", "System.ValueType" and "System.Attribute" since
5250         they've already been populated from BootCorlib_PopulateCoreTypes().
5251
5252 2002-06-29  Martin Baulig  <martin@gnome.org>
5253
5254         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
5255         is the NullLiteral, we also need to make sure that target_type is not
5256         an enum type.   
5257
5258 2002-06-29  Martin Baulig  <martin@gnome.org>
5259
5260         * rootcontext.cs (RootContext.ResolveCore): We must initialize
5261         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
5262         before calling BootstrapCorlib_ResolveDelegate ().
5263
5264 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
5265
5266         * statement.cs: fixed build-breaker. All tests passed ok.
5267
5268 2002-06-27  Martin Baulig  <martin@gnome.org>
5269
5270         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
5271         for System.Decimal when compiling corlib.
5272
5273 2002-06-27  Martin Baulig  <martin@gnome.org>
5274
5275         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
5276         switch blocks which contain nothing but a default clause.
5277
5278 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
5279
5280        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
5281
5282 2002-06-27  Martin Baulig  <martin@gnome.org>
5283
5284         * ecore.cs (PropertyExpr.PropertyExpr): Call
5285         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
5286
5287         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
5288         is already a TypeBuilder.
5289
5290 2002-06-27  Martin Baulig  <martin@gnome.org>
5291
5292         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
5293         `target_type == TypeManager.array_type', not IsAssignableFrom() in
5294         the "from an array-type to System.Array" case.  This makes it work
5295         when compiling corlib.
5296
5297 2002-06-27  Martin Baulig  <martin@gnome.org>
5298
5299         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
5300         non-static PropertyExpr, set its InstanceExpression.  This makes
5301         the `ICollection.Count' property work in System/Array.cs.
5302
5303 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
5304
5305         * driver.cs: Made error handling more consistent.  Errors now
5306         tracked by Report class, so many methods which used to return int
5307         now return void.  Main() now prints success/failure and 
5308         errors/warnings message.
5309
5310         Renamed '--probe' compiler argument to '--expect-error'.  Removed
5311         the magic number return values (123 and 124).  Now, if the
5312         expected error occurs, the compiler exits with success (exit value
5313         0).  If the compilation completes without seeing that particular
5314         error, the compiler exits with failure (exit value 1).  The
5315         makefile in mcs/errors has been changed to handle the new behaviour.
5316
5317         * report.cs: Made 'expected error' number a property and renamed
5318         it from 'Probe' to 'ExpectedError'.
5319
5320         * genericparser.cs: Removed error handling support, since it is
5321         now all done by Report class.
5322
5323         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
5324         class, so parse() no longer returns an int.
5325
5326         * namespace.cs: Use Report.Error instead of GenericParser.error
5327
5328 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
5329
5330         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
5331         TypeContainer.AddOperator): At the front of the list put the
5332         explicit implementations, so they get resolved/defined first. 
5333
5334 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
5335
5336         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
5337         interface type is implemented by this TypeContainer.  Used during
5338         explicit interface implementation.
5339
5340         (Property.Define, Indexer.Define, Method.Define): Validate that
5341         the given interface in the explicit implementation is one of the
5342         base classes for the containing type.
5343
5344         Also if we are explicitly implementing an interface, but there is
5345         no match in the pending implementation table, report an error.
5346
5347         (Property.Define): Only define the property if we are
5348         not explicitly implementing a property from an interface.  Use the
5349         correct name also for those properties (the same CSC uses,
5350         although that is really not needed).
5351         
5352         (Property.Emit): Do not emit attributes for explicitly implemented
5353         properties, as there is no TypeBuilder.
5354
5355         (Indexer.Emit): ditto.
5356
5357         Hiding then means that we do not really *implement* a pending
5358         implementation, which makes code fail.
5359
5360 2002-06-22  Martin Baulig  <martin@gnome.org>
5361
5362         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
5363         the return value of Object.GetType().  [FIXME: we need to do this whenever
5364         we get a type back from the reflection library].
5365
5366 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
5367
5368         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
5369
5370 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
5371
5372         * attribute.cs: Return null if we can not look up the type.
5373
5374         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
5375         the interface types found.
5376
5377         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
5378         interface types found.
5379
5380         * typemanager.cs (GetInterfaces): Make this routine returns alll
5381         the interfaces and work around the lame differences between
5382         System.Type and System.Reflection.Emit.TypeBuilder in the results
5383         result for GetInterfaces.
5384         
5385         (ExpandInterfaces): Given an array of interface types, expand and
5386         eliminate repeated ocurrences of an interface.  This expands in
5387         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
5388         be IA, IB, IC.
5389         
5390 2002-06-21  Martin Baulig  <martin@gnome.org>
5391
5392         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
5393         on System.Enum.
5394
5395 2002-06-21  Martin Baulig  <martin@gnome.org>
5396
5397         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
5398         and called with one of the core types, return the corresponding typebuilder for
5399         that type.
5400
5401         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
5402         element type.
5403
5404 2002-06-21  Martin Baulig  <martin@gnome.org>
5405
5406         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
5407         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
5408         (Expression.ConvertReferenceExplicit): Likewise.
5409
5410         * expression.cs (ElementAccess.DoResolve): Likewise.
5411         (ElementAccess.DoResolveLValue): Likewise.
5412
5413 2002-06-10  Martin Baulig  <martin@gnome.org>
5414
5415         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
5416         add the "value" parameter to the parameter list.
5417
5418         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
5419         to our caller.
5420
5421 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
5422
5423         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
5424         the argument to an int, uint, long or ulong, per the spec.  Also
5425         catch negative constants in array creation.
5426
5427 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
5428
5429         * class.cs: do not allow the same interface to appear twice in
5430         the definition list.
5431
5432 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
5433
5434         * ecore.cs: don't use ldlen with System.Array.
5435
5436 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
5437
5438         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
5439
5440 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
5441
5442         * modifiers.cs: produce correct field attributes for protected
5443         internal. Easy fix so miguel can work on ther harder stuff:-)
5444
5445 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
5446
5447         * pending.cs: New file.  Move the code from class.cs here.
5448         Support clearning the pending flag for all methods (when not doing
5449         explicit interface implementation).
5450
5451 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
5452
5453         * rootcontext.cs: added a couple more types needed to bootstrap.
5454
5455 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
5456
5457         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
5458         constructor in the type, instead of any constructor in the type
5459         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
5460         a bug in the Mono runtime when applying the params attribute). 
5461
5462 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
5463         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
5464
5465 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
5466
5467         * expression.cs (Unary.ResolveOperator): Use TypeManager
5468         to resolve the type.
5469         
5470 2002-06-13  Ravi Pratap  <ravi@ximian.com>
5471
5472         * cs-parser.jay (enum_member_declaration): Pass in the attributes
5473         attached.
5474
5475         * enum.cs (AddEnumMember): Add support to store the attributes associated 
5476         with each member too.
5477
5478         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
5479         field builders too - this takes care of the enum member case.
5480
5481 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
5482
5483         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
5484         address-of operator on both value types and pointers.
5485         
5486 2002-06-10  Martin Baulig  <martin@gnome.org>
5487
5488         * interface.cs (Interface.PopulateIndexer): Add the indexer's
5489         PropertyBuilder to the `property_builders' list.
5490
5491         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
5492         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
5493         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
5494         find any indexers which are inherited from an interface.
5495
5496 2002-06-09  Martin Baulig  <martin@gnome.org>
5497
5498         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
5499         the same type as the constant if necessary.  There's also a test-130.cs
5500         for this.
5501
5502         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
5503
5504         * typemanager.cs (TypeManager.ChangeType): Previously known as
5505         Enum.ChangeEnumType().
5506
5507 2002-06-09  Martin Baulig  <martin@gnome.org>
5508
5509         * expression.cs (Cast.TryReduce): Added support for consts.
5510
5511 2002-06-08  Ravi Pratap  <ravi@ximian.com>
5512
5513         * class.cs (Accessor): Hold attributes information so we can pass
5514         it along.
5515
5516         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
5517         Modify to pass in attributes attached to the methods.
5518
5519         (add_accessor_declaration, remove_accessor_declaration): Ditto.
5520
5521         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
5522         to handle the Accessor kind :-)
5523
5524         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
5525         
5526 2002-06-08  Martin Baulig  <martin@gnome.org>
5527
5528         * expression.cs (Unary.TryReduceNegative): Added support for
5529         ULongConstants.
5530
5531 2002-06-08  Martin Baulig  <martin@gnome.org>
5532
5533         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
5534         name can't be found in the `defined_names' - the caller will do a
5535         MemberLookup in this case and thus find methods in System.Enum
5536         such as Enum.IsDefined().
5537
5538 2002-06-08  Martin Baulig  <martin@gnome.org>
5539
5540         * enum.cs (Enum.ChangeEnumType): This is a custom version of
5541         Convert.ChangeType() which works with TypeBuilder created types.
5542         (Enum.LookupEnumValue, Enum.Define): Use it here.
5543
5544         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
5545         `TypeBuilder.BaseType != null' check.
5546         (TypeContainer.FindMembers): Only lookup parent members if we
5547         actually have a parent.
5548         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
5549         (ConstructorInitializer.Resolve): Likewise.
5550
5551         * interface.cs (Interface.FindMembers): Added
5552         `TypeBuilder.BaseType != null' check.
5553
5554         * rootcontext.cs (RootContext.ResolveCore): Added
5555         "System.Runtime.CompilerServices.IndexerNameAttribute" to
5556         classes_second_stage.
5557
5558         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
5559         debug_type and trace_type when compiling with --nostdlib.       
5560
5561 2002-06-07  Martin Baulig  <martin@gnome.org>
5562
5563         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
5564         (AddField): Set it to true when adding a non-static field.
5565         (DefineType): Use `have_nonstatic_fields' to find out whether we
5566         have non-static fields, not `Fields != null'.
5567
5568 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
5569
5570         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
5571         dereferencing a null on the static-field code path)
5572
5573 2002-05-30  Martin Baulig  <martin@gnome.org>
5574
5575         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
5576         to take command line arguments.  Use reflection to call the new
5577         custom `Initialize' function on the symbol writer and pass it the
5578         command line arguments.
5579
5580         * driver.cs (--debug-args): New command line argument to pass command
5581         line arguments to the symbol writer.
5582
5583 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
5584
5585         * assign.cs (DoResolve): Forgot to do the implicit conversion to
5586         the target type for indexers and properties.  Thanks to Joe for
5587         catching this.
5588
5589 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
5590
5591         * typemanager.cs (MethodFlags): returns the method flags
5592         (Obsolete/ShouldIgnore) that control warning emission and whether
5593         the invocation should be made, or ignored. 
5594
5595         * expression.cs (Invocation.Emit): Remove previous hack, we should
5596         not do this on matching a base type, we should do this based on an attribute
5597
5598         Only emit calls to System.Diagnostics.Debug and
5599         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
5600         on the command line.
5601
5602         * rootcontext.cs: Global settings for tracing and debugging.
5603
5604         * cs-tokenizer.cs (define): New utility function to track
5605         defines.   Set the global settings for TRACE and DEBUG if found.
5606
5607 2002-05-25  Ravi Pratap  <ravi@ximian.com>
5608
5609         * interface.cs (Populate*): Pass in the TypeContainer as well as
5610         the DeclSpace as parameters so that we can create EmitContexts and
5611         then use that to apply attributes etc.
5612
5613         (PopulateMethod, PopulateEvent, PopulateProperty)
5614         (PopulateIndexer): Apply attributes everywhere.
5615
5616         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
5617         etc.
5618
5619         (ApplyAttributes): Update accordingly.
5620
5621         We now apply interface attributes for all members too.
5622
5623 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
5624
5625         * class.cs (Indexer.Define); Correctly check if we are explicit
5626         implementation (instead of checking the Name for a ".", we
5627         directly look up if the InterfaceType was specified).
5628
5629         Delay the creation of the PropertyBuilder.
5630
5631         Only create the PropertyBuilder if we are not an explicit
5632         interface implementation.   This means that explicit interface
5633         implementation members do not participate in regular function
5634         lookups, and hence fixes another major ambiguity problem in
5635         overload resolution (that was the visible effect).
5636
5637         (DefineMethod): Return whether we are doing an interface
5638         implementation. 
5639         
5640         * typemanager.cs: Temporary hack until we get attributes in
5641         interfaces (Ravi is working on that) and we get IndexerName
5642         support in interfaces.
5643
5644         * interface.cs: Register the indexers as properties.
5645
5646         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
5647         warning, I have verified that this is a bug in the .NET runtime
5648         (JavaScript suffers of the same problem).
5649
5650         * typemanager.cs (MemberLookup): When looking up members for
5651         interfaces, the parent of an interface is the implicit
5652         System.Object (so we succeed in searches of Object methods in an
5653         interface method invocation.  Example:  IEnumerable x;  x.ToString
5654         ()) 
5655
5656 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
5657
5658         * class.cs (Event): Events should also register if they do
5659         implement the methods that an interface requires.
5660
5661         * typemanager.cs (MemberLookup); use the new GetInterfaces
5662         method. 
5663
5664         (GetInterfaces): The code used to lookup interfaces for a type is
5665         used in more than one place, factor it here. 
5666
5667         * driver.cs: Track the errors at the bottom of the file, we kept
5668         on going.
5669
5670         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
5671         instance if the method we are calling is static!
5672
5673 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
5674
5675         * attribute.cs (ApplyAttributes): Make this function filter out
5676         the IndexerName attribute (as that attribute in reality is never
5677         applied) and return the string constant for the IndexerName
5678         attribute. 
5679
5680         * class.cs (TypeContainer.Emit): Validate that all the indexers
5681         have the same IndexerName attribute, and if so, set the
5682         DefaultName attribute on the class. 
5683
5684         * typemanager.cs: The return value might contain other stuff (not
5685         only methods).  For instance, consider a method with an "Item"
5686         property and an Item method.
5687
5688         * class.cs: If there is a problem with the parameter types,
5689         return. 
5690
5691 2002-05-24  Ravi Pratap  <ravi@ximian.com>
5692
5693         * ecore.cs (ImplicitConversionExists): Wrapper function which also
5694         looks at user defined conversion after making a call to 
5695         StandardConversionExists - we need this for overload resolution.
5696
5697         * expression.cs : Update accordingly the various method calls.
5698
5699         This fixes 2 bugs filed against implicit user defined conversions 
5700
5701 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
5702
5703         * statement.cs: Track the result of the assignment.
5704
5705 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
5706
5707         * expression.cs (MemberAccess): Improved error reporting for
5708         inaccessible members.
5709
5710 2002-05-22  Martin Baulig  <martin@gnome.org>
5711
5712         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
5713         itself with debugging support.
5714
5715 2002-05-22  Martin Baulig  <martin@gnome.org>
5716
5717         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
5718         Removed, this isn't needed anymore.
5719
5720 2002-05-20  Martin Baulig  <martin@gnome.org>
5721
5722         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
5723         be underlying type for an enum.
5724
5725 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
5726
5727         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
5728         that splits out the loading of just the core types.
5729
5730         * rootcontext.cs (ResolveCore): Split the struct resolution in
5731         two, so we can load the enumeration underlying types before any
5732         enums are used.
5733
5734         * expression.cs (Is): Bandaid until we fix properly Switch (see
5735         bug #24985 for details).
5736
5737         * typemanager.cs (ImplementsInterface): The hashtable will contain
5738         a null if there are no interfaces implemented.
5739
5740 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
5741
5742         * cs-parser.jay (indexer_declarator): It is fine to have array
5743         parameters
5744
5745 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5746
5747         * typemanager.cs: (RegisterBuilder): New function used to register
5748         TypeBuilders that implement interfaces.  Since
5749         TypeBuilder.GetInterfaces (as usual) does not work with lame
5750         Reflection.Emit. 
5751         (AddUserType): register interfaces.
5752
5753         (ImplementsInterface): Use the builder_to_ifaces hash if we are
5754         dealing with TypeBuilder.  Also, arrays are showing up as
5755         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
5756         methods can not be invoked on them!
5757
5758         * ecore.cs (ExplicitReferenceConversionExists): Made public.
5759         (ImplicitReferenceConversionExists): Split out from
5760         StandardConversionExists. 
5761
5762         * expression.cs (As): We were only implementing one of the three
5763         cases for the as operator.  We now implement them all.
5764         (Is): Implement the various other cases for Is as well.
5765
5766         * typemanager.cs (CACHE): New define used to control if we want or
5767         not the FindMembers cache.  Seems to have a negative impact on
5768         performance currently
5769
5770         (MemberLookup): Nested types have full acess to
5771         enclosing type members
5772
5773         Remove code that coped with instance/static returns for events, we
5774         now catch this in RealFindMembers.
5775
5776         (RealFindMembers): only perform static lookup if the instance
5777         lookup did not return a type or an event.  
5778
5779 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
5780
5781         * assign.cs (CompoundAssign): We pass more semantic information
5782         now to Compound Assignments than we did before: now we have all
5783         the information at hand, and now we resolve the target *before* we
5784         do the expression expansion, which allows the "CacheValue" method
5785         to have the effect we intended (before, a [x] += 1 would generate
5786         two differen ArrayAccess expressions from the ElementAccess,
5787         during the resolution process).
5788
5789         (CompoundAssign.DoResolve): Resolve target and original_source here.
5790
5791 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
5792
5793         * expression.cs (ArrayAccess): dropped debugging information. 
5794
5795         * typemanager.cs: Small bug fix: I was always returning i_members,
5796         instead of one of i_members or s_members (depending on which had
5797         the content).
5798
5799         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
5800         method is invoked before any code generation takes place, and it
5801         is a mechanism to inform that the expression will be invoked more
5802         than once, and that the method should use temporary values to
5803         avoid having side effects
5804
5805         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
5806         
5807         * ecore.cs (Expression.CacheTemporaries): Provide empty default
5808         implementation.
5809
5810         * expression.cs (Indirection, ArrayAccess): Add support for
5811         CacheTemporaries in these two bad boys. 
5812
5813         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
5814         ldobj or ldind_ref.  
5815         (StoreFromPtr): Handle stobj as well.
5816
5817         * expression.cs (UnaryMutator): Share more code.
5818         
5819         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
5820         down: I was not tracking the Filter function as well, which
5821         was affecting the results of the cache.
5822
5823 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
5824
5825         * attribute.cs: Remove the hack to handle the CharSet property on
5826         StructLayouts. 
5827
5828 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
5829
5830         * attribute.cs (DoResolve): More uglyness, we now only try to
5831         resolve the attribute partially, to extract the CharSet
5832         information (only if we are a StructLayout attribute).  Otherwise 
5833
5834         (GetExtraTypeInfo): Add some code to conditionally kill in the
5835         future this.   I am more and more convinced that the .NET
5836         framework has special code to handle the attribute setting on
5837         certain elements.
5838
5839         * expression.cs (IsParamsMethodApplicable): Revert my previous
5840         foreach change here, it was wrong.
5841
5842 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
5843
5844         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
5845         (pp_expr): do not abort on unknown input, just return.
5846         (eval): abort if there are pending chars.
5847
5848         * attribute.cs (Attribute.Resolve): Positional parameters are
5849         optional.  Deal with that case.
5850
5851         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
5852         the Ansi/Unicode/Auto information for the type.
5853
5854         (TypeContainer.DefineType): instantiate the EmitContext here, as
5855         we will be using it during the type definition (to resolve
5856         attributes) and during the emit phase.
5857
5858         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
5859         to pull type information out of the attributes
5860
5861         (Attribute.Resolve): track the constructor builder, and allow for
5862         multiple invocations (structs and classes will use this).
5863
5864         * ecore.cs (MemberLookupFinal): new version with all the
5865         parameters customizable.
5866
5867         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
5868         constructors.  Return if the result value is null (as the error
5869         would have been flagged already by MemberLookupFinal)
5870
5871         Do not allow instances of abstract classes or interfaces to be
5872         created.
5873         
5874         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
5875         We have to compare the assembly property here when dealing with
5876         FamANDAssem and Assembly access modifiers, because we might be
5877         creating an assembly from *modules* (that means that we are not
5878         getting TypeBuilders for types defined in other modules that are
5879         part of this assembly).
5880
5881         (Method.Emit): If the method is marked abstract and has a body,
5882         emit an error. 
5883
5884         (TypeContainer.DefineMembers): If both the defined member and the
5885         parent name match are methods, then do not emit any warnings: let
5886         the Method.Define routine take care of flagging warnings.  But if
5887         there is a mismatch (method overrides something else, or method is
5888         overriwritten by something, then emit warning).
5889
5890         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
5891         set to null, this means `do not check for the return type on the
5892         signature'. 
5893
5894         (Method.Define): set the return type for the method signature to
5895         null, so that we get methods with the same name and parameters and
5896         different return types.  This is used to flag warning 114 (you are
5897         hiding a method, and you probably want to use the new/override
5898         keywords instead).
5899
5900         * typemanager.cs (MemberLookup): Implemented proper access
5901         control, closing a long standing set of bug reports.  The problem
5902         was that the Framework only has two bits: Public and NonPublic,
5903         and NonPublic includes private and protected methods, but we need
5904         to enforce the FamANDAssem, FamOrAssem and Family. 
5905
5906 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
5907
5908         * statement.cs (GotoCase): Return true: Ammounts to giving up
5909         knowledge on whether we return or not, and letting the other case
5910         be responsible for it.
5911
5912 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
5913
5914         * driver.cs: Do not load directories for each file processed, only
5915         do it if there is a pattern.
5916
5917         * ecore.cs: Report readonly assigns here as well, as we might have
5918         been resolved only by MemberAccess.
5919
5920         (SimpleName.SimpleNameResolve): Also be useful for LValue
5921         resolution.   We need this to propagate assign to local readonly variables
5922
5923         * typemanager.cs: Use a ptrhashtable for the criteria, because we
5924         do not want to reuse potential criteria memory.
5925
5926         * class.cs (MyEventBuilder): Set reflected_type;
5927
5928         * ecore.cs (Constantify): Added support for constifying bools.
5929
5930         (RootContext.LookupType): Added a cache for values looked up in
5931         the declaration space.
5932
5933         * typemanager.cs (FindMembers): Now is a front-end to
5934         RealFindMembers, and provides a two-level hashtable-based cache to
5935         the request.  
5936
5937         15% performance improvement: from 22.5 to 19.2 seconds.
5938
5939         * expression.cs (IsParamsMethodApplicable): use foreach.
5940         (Invocation.DoResolve): ditto.
5941         (New.DoResolve): ditto.
5942         (ArrayCreation.DoResolve): ditto.
5943
5944         * ecore.cs (FindMostEncompassingType): use foreach.
5945
5946         * delegate.cs (NewDelegate.DoResolve): Use foreach
5947
5948         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
5949         (RemoveMethods): use foreach.
5950
5951         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
5952         nested foreach statements instead of for, and also break out of
5953         the inner loop once a match is found.
5954         
5955         (Invocation.OverloadResolve): Use foreach, simplify the code. 
5956
5957 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
5958
5959         * cfold.cs (BinaryFold): During an enumeration evaluation context,
5960         we actually unwrap the expression to allow for extra information
5961         to be extracted. 
5962
5963         * expression.cs: Use Shr_Un on unsigned operations. 
5964
5965 2002-05-08  Ravi Pratap  <ravi@ximian.com>
5966
5967         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
5968         applicable operators was not being considered correctly. This closes
5969         the bug Miguel reported.
5970
5971 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
5972
5973         * attribute.cs: check that the type derives from System.Attribute
5974         and report the correct error in that case (moved the duplicate code to
5975         its own method, too).
5976
5977 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
5978
5979         * attribute.cs: lookup attribute type name as the spec says: first the
5980         bare attribute name and then name + "Attribute" (nant compiles with
5981         mcs after this fix).
5982
5983 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
5984
5985         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
5986         Because of the way we parse things, we should try to see if a
5987         UIntConstant can fit in an integer.
5988
5989 2002-05-07  Ravi Pratap  <ravi@ximian.com>
5990
5991         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
5992         when we are in an explicit context.
5993
5994         (ConvertReferenceExplicit): When converting from Iface type S to Class
5995         T make sure the rules are implemented as an OR.
5996
5997         * parameter.cs (ParameterType): Make it a property for now although the
5998         purpose really isn't anything immediate.
5999         
6000         * expression.cs (Is*Applicable): Do better checking on the parameter type
6001         of a ref/out parameter. The ones from the system assemblies are already 
6002         marked with the correct type so we don't need to do any correction.
6003
6004         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
6005         the object type is standard too so include that.
6006
6007 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6008
6009         * ecore.cs (StandardConversionExists): Augment with missing code:
6010         deal with IntConstant, LongConstants and Enumerations.
6011
6012         * assign.cs: Report the error, instead of failing silently
6013
6014         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
6015         typecontainer that they are declared, because the
6016         typecontainer/namespace will have the list of using clauses that
6017         need to be applied.
6018
6019         Assembly Attributes were escaping the normal registration
6020         mechanism. 
6021
6022         (EmitCode): Apply attributes within an EmitContext that represents
6023         the container they were declared on.
6024         
6025         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
6026
6027 2002-05-06  Ravi Pratap  <ravi@ximian.com>
6028
6029         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
6030         Revamp completely - make much cleaner as we now operate only
6031         on a set of Types.
6032
6033         (FindMostSpecificSource, FindMostSpecificTarget): New methods
6034         to implement the logic detailed in the spec more correctly.
6035
6036         (UserDefinedConversion): Update accordingly.
6037
6038 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6039
6040         * statement.cs: Return flow analysis information up.
6041
6042         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
6043         and the default.
6044
6045         (token): Do not consume an extra character before calling
6046         decimal_digits.
6047
6048 2002-05-06  Piers Haken <piersh@friskit.com>
6049
6050         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
6051
6052 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
6053
6054         * class.cs (Constructor.Emit): Set the IsStatic flag in the
6055         EmitContext during the instance constructor initializer
6056         resolution, to stop access to instance variables.
6057
6058         This is mandated by the spec, last paragraph of the `constructor
6059         initializers' section. 
6060
6061 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
6062
6063         * cs-parser.jay, class.cs (Accessor): new class used to represent
6064         an accessor (get or set).  In the past we used `null' to represent
6065         a missing accessor.  But this is ambiguous because there was no
6066         way to tell in abstract indexers/properties if one of them was
6067         specified.
6068
6069         Now there is a way of addressing that.
6070
6071         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
6072         instead of FindMembers.
6073
6074         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
6075         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
6076
6077         * attribute.cs: Treat indexers and properties as the same in terms
6078         of applying attributes
6079
6080         * ecore.cs (FindMostEncompassedType): Use statically initialized
6081         EmptyExpressions()s like we do elsewhere to avoid creating useless
6082         objects (and we take this out of the tight loop).
6083
6084         (GetConversionOperators): Move the code to extract the actual
6085         operators to a separate routine to clean things up.
6086
6087 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
6088
6089         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
6090         events are always registered FieldBuilders.
6091         
6092         * class.cs (FieldBase): New class shared by Fields 
6093
6094         * delegate.cs: If we are a toplevel delegate, use our full name.
6095         If we are a nested delegate, then only use our tail name.
6096
6097 2002-05-02  Ravi Pratap  <ravi@ximian.com>
6098
6099         * expression.cs (IsApplicable): Ensure that we add the "&" to
6100         ref/out types before comparing it with the type of the argument.
6101
6102         (IsParamsMethodApplicable): Ditto.
6103
6104         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
6105         silly me ;-)
6106
6107         * delegate.cs : Handle the case when we have more than one applicable
6108         method. Flag an error only when we finish checking all.
6109
6110 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
6111
6112         * expression.cs: Add support for boolean static initializers.
6113
6114 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
6115
6116         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
6117
6118         * parameter.cs (ComputeParameterTypes,
6119         ComputeAndDefineParameterTypes): Better error handling: now we
6120         clear the `types' cache if we fail during any of the type lookups.
6121         We also return the status code correctly to our caller
6122
6123         * delegate.cs: If we fail to define a delegate, abort the extra
6124         steps. 
6125
6126         * expression.cs (Binary.ResolveOperator): for
6127         operator==(object,object) and operator !=(object, object) we also
6128         have to verify that there is an implicit conversion from one to
6129         the other.
6130
6131         (ArrayAccess.DoResolve): Array Access can operate on
6132         non-variables. 
6133
6134 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
6135
6136         * assign.cs (CompoundAssign): A new class used as a "flag" that
6137         the assignment actually is happening as part of a compound
6138         assignment operator.
6139
6140         During compound assignment, a few new rules exist to enable things
6141         like:
6142
6143         byte b |= 1 + 2
6144
6145         From the spec:
6146         
6147         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
6148         to the type of x) if y is implicitly convertible to the type of x,
6149         and the operator is a builtin operator and the return type of the
6150         operator is explicitly convertible to the type of x. 
6151
6152         * rootcontext.cs: Reset warning level to 2.  4 catches various
6153         "interesting" features in mcs, we must clean this up at some
6154         point, but currently am trying to kill other bugs ;-)
6155
6156         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
6157         in container classes as well.  
6158
6159         * expression.cs (Binary.ResolveOperator): Handle string case
6160         before anything else (as operator overloading does emit an error
6161         before doing anything else).
6162
6163         This code could go away when we move to a table driven model, but
6164         i could not come up with a good plan last night.
6165         
6166 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
6167
6168         * typemanager.cs (CSharpName): reimplementation using regex.
6169         * class.cs: added null check for fields in Emit
6170         * rootcontext.cs: set warninglevel to 4
6171
6172 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
6173
6174         * typemanager.cs (CSharpName): reimplemented with Lupus
6175         suggestion.
6176
6177 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
6178
6179         * statement.cs (If): correclty implement Resolve, because we were
6180         not catching sem errors in there.  The same process is needed
6181         everywhere else. 
6182         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
6183         
6184
6185         (Statement.Warning_DeadCodeFound): Factorize code.
6186         (While): Report dead code here too.
6187
6188         (Statement): Added Resolve virtual method to allow
6189         for resolution split from the emit code.
6190
6191 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6192
6193         * statement.cs (EmitBoolExpression): No longer try to resolve the
6194         expression here.    
6195         (MakeBoolean): New utility function that resolve, implicitly
6196         converts to boolean and tags the expression. 
6197         
6198
6199         (If, Do): Implement dead code elimination.
6200         (While): Implement loop inversion
6201
6202         (Do, While, For, If): Resolve the expression prior to calling our
6203         code generation.
6204
6205 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
6206
6207         * class.cs:
6208           - added method Report28 (warning: program has more than one entry point)
6209           - added method IsEntryPoint, implements paragraph 10.1 of the spec
6210           - modified method Method.Define, the part at the end of the method
6211
6212         * rootcontext.cs: added static public Location EntryPointLocation;
6213           
6214         * ../errors/cs0028.cs : Add test case for the above warning.              
6215
6216         * typemanager.cs:
6217           - modified method CSharpName to allow arrays of primitive type to
6218             be printed nicely (e.g. instead of System.Int32[][] it now prints
6219             int[][])
6220           - added method CSharpSignature: returns the signature of a method
6221             in string format to be used in reporting errors, warnings, etc.
6222
6223         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
6224         with String.Empty.
6225         
6226 2002-04-26  Ravi Pratap  <ravi@ximian.com>
6227
6228         * delegate.cs (Define): Fix extremely silly bug where I was
6229         setting the type of the 'object' parameter of the BeginInvoke
6230         method to System.IAsyncResult instead of System.Object ;-)
6231
6232 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
6233
6234         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
6235         here. 
6236
6237         (Constructor.Emit): return if we fail to initialize the
6238         constructor.  Another door closed!  
6239
6240         * expression.cs (New.DoResolve): Improve error message (from -6 to
6241         1501).  Use DeclaredOnly lookup to find the exact constructor.
6242
6243         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
6244         loop.  This is useful.
6245
6246         * cs-parser.jay: Adjust the default parameters so that destructors
6247         have the proper signature.
6248
6249 2002-04-26  Martin Baulig  <martin@gnome.org>
6250
6251         * driver.cs (LoadAssembly): If `assembly' contains any characters
6252         which are only valid in path names and not in assembly names
6253         (currently slash, backslash and point), use Assembly.LoadFrom ()
6254         instead of Assembly.Load () on the `assembly' (before iteration
6255         over the link_paths).
6256
6257 2002-04-26  Martin Baulig  <martin@gnome.org>
6258
6259         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
6260
6261 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
6262
6263         * class.cs (Property): use the new typemanager.MemberLookup
6264
6265         (TypeContainer.MemberLookup): Implement using the
6266         TypeManager.MemberLookup now. 
6267         
6268         * typemanager.cs: Make MemberLookup a function of the TypeManager,
6269         and return MemberInfos, so that these can be used without an
6270         EmitContext (what we had before).
6271
6272 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * expression.cs: Fix the case where the argument to params if the
6275         type of the params.  I omitted handling this before.   Fixed
6276
6277 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6278
6279         * driver.cs: Call BootCorlib_PopulateCoreType
6280
6281         * class.cs (Property.CheckBase): Check for properties only, not
6282         for all members. 
6283
6284         * interface.cs: Temporary hack: try/catch around the
6285         CustomAttributeBuilder, because I am getting an exception that I
6286         do not understand.
6287
6288         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
6289         types whose definitions are required to be there (attributes are
6290         defined before standard types).
6291
6292         Compute definitions as we boot the various types, as they are used
6293         immediately (value_type class will need object_type, but if we do
6294         not initialize object_type, we will pass a null, which will let
6295         the runtime pick the System.Object from the existing corlib, which
6296         is not what we want).
6297
6298 2002-04-22  Patrik Torstensson <totte@labs2.com>
6299
6300         * cs-tokenizer.cs: fixed a number of trim() issues.
6301
6302 2002-04-22  Ravi Pratap  <ravi@ximian.com>
6303
6304         * expression.cs (Argument.Type): Ensure that we return the correct
6305         type when we have out or ref parameters [in which case we 
6306         append a "&"].
6307         
6308 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
6309
6310         * class.cs (Property, Indexer): Allow extern modifier in there. 
6311
6312         * typemanager.cs (InitBaseTypes): Initializes object_type and
6313         value_type, since those will be used early on during the bootstrap
6314         process to compile corlib.
6315
6316         (InitCoreTypes): Move code from here to InitBaseTypes.
6317
6318 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
6319
6320         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
6321         single-dimension arrays as using the ldlen opcode.  
6322
6323         Daniel Lewis discovered this optimization.  
6324
6325         * typemanager.cs: Add signature for System.Array::get_Length
6326
6327 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6328
6329         * statement.cs: report the error when the foreach does not apply to an
6330         array nor a collection.
6331
6332 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
6333
6334         * expression.cs: Add implicit conversions to the operator ~.
6335
6336         * constant.cs (DecimalConstant.Emit): Emit decimal value.
6337
6338         * typemanager.cs: Locate the decimal constructor.
6339
6340 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6341
6342         * attribute.cs: use the new property of TypeOf.
6343         * expression.cs: added 'get' property around typearg.
6344
6345         These changes fix a build breaker reported by NickD. Is this the
6346         correct way to fix?  If not, please, revert my changes and make it
6347         work :-).
6348
6349 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
6350
6351         * attribute.cs: Add support for typeof in attribute invocations.
6352         I am not sure that this is right though.
6353
6354 2002-04-14  Duncan Mak  <duncan@ximian.com>
6355
6356         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
6357         Binary.Operator.Division case.
6358
6359 2002-04-13  Ravi Pratap  <ravi@ximian.com>
6360
6361         * class.cs (DefineType): Ensure that we do a proper check on
6362         attribute types and also register it with the TypeManager.
6363
6364         (TypeContainer.Targets): The default for attribute types is
6365         AttributeTargets.All.
6366         
6367         * attribute.cs (ApplyAttributes): Registering the attribute type
6368         is done elsewhere, not when we discover we have a Usage attribute.
6369
6370 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6371
6372         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
6373         and get rid of is_delegate parameter.
6374
6375         * everywhere : update.
6376         
6377 2002-04-12  Ravi Pratap  <ravi@ximian.com>
6378
6379         * cs-parser.jay (compilation_unit): Revamp completely to use
6380         some new ideas that I got from Rhys' grammar to solve the problems
6381         with assembly level attributes.
6382
6383         (outer_declaration): New grammar production.
6384
6385         (attribute_sections): Add.
6386
6387         (opt_attributes): Base on attribute_sections
6388
6389         (namespace_declaration): Allow opt_attributes to tackle the case
6390         when we have assembly level attributes - we are clever in this
6391         regard now ;-)
6392
6393         * attribute.cs (ApplyAttributes): Do not worry about assembly 
6394         attributes in the non-global context.
6395
6396         * rootcontext.cs (AddGlobalAttributes): Go back to using this
6397         instead of SetGlobalAttributes.
6398
6399         * class.cs, rootcontext.cs : Ensure we define and generate 
6400         attribute types before anything else.
6401
6402         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
6403         and flag the new error -20 for the case when the attribute type
6404         does not have valid targets specified. csc does not catch this.
6405
6406         * ../errors/errors.txt : update for error # -20
6407
6408 2002-04-11  Ravi Pratap  <ravi@ximian.com>
6409
6410         * support.cs (InternalParameters.ParameterModifier): Do some null
6411         checking and return sane values.
6412
6413         * class.cs (Method.Define): If we are a PInvoke method, ensure
6414         that we are static and extern. Report error # 601
6415
6416         * ../errors/cs0601.cs : Add test case for the above error.
6417
6418 2002-04-07  Ravi Pratap  <ravi@ximian.com>
6419
6420         * rootcontext.cs (attribute_types): We need to keep type of
6421         all attribute types separately and emit code for them first.
6422
6423         (RegisterAttribute) : Implement.
6424
6425         * class.cs (DefineType): Check if the current Type is a custom
6426         attribute type and register it accordingly.
6427
6428         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
6429         adding the first attribute twice and rename to
6430
6431         (SetGlobalAttributes): this.
6432
6433         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
6434         lookups.
6435
6436         * attribute.cs (ApplyAttributes): Take an additional argument telling us
6437         if we are processing global arguments. Hmm, I am unsure of this.
6438
6439 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
6440
6441         * expression.cs: added static array of strings to avoid calling
6442         Enum.ToString () for Operator in Binary. Significant recover of
6443         performance.
6444
6445 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
6446
6447         * class.cs (FindMembers): Allow the Builders of the various
6448         members to be null.  If they are skip them.  This only happens
6449         during the PInvoke declaration.
6450
6451 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
6452
6453         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
6454         failure, so we do not keep going afterwards.
6455
6456         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
6457         wanted to pass `false' as the `is_delegate' argument.  If this is
6458         the case, why not use delegate_type == null to mean `is_delegate =
6459         false' and anything else as is_delegate = true.
6460
6461 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
6462
6463         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
6464         code for the section, not the beginning of the tests.
6465
6466 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
6467
6468         * cfold.cs: Handle operator + (Enum x, Underlying x) 
6469
6470         * expression.cs (Binary): same.  Warn about errors where we have
6471         Enum/Enum in operator + as well.
6472
6473 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
6474
6475         * statement.cs:
6476                 - added support for switch(bool)
6477                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
6478                 - add TableSwitchEmit() to handle table-based switch statements
6479
6480 2002-04-05  Ravi Pratap  <ravi@ximian.com>
6481
6482         * expression.cs (Invocation.OverloadResolve): Factor out code which
6483         does parameter compatibility checking with arguments so that we can 
6484         re-use the code even from Delegate.VerifyApplicability
6485
6486         (VerifyArgumentsCompat): Move above code here.
6487
6488         * delegate.cs (VerifyApplicability): Get rid of duplicate code
6489         and instead make a call to the above method.
6490
6491 2002-03-31  Ravi Pratap  <ravi@ximian.com>
6492
6493         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
6494         We use it to keep track of classes which are attribute types.
6495
6496 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
6497
6498         * delegate.cs (Delegate.Define): Correctly define the types in the
6499         presence of fixed and array parameters.
6500
6501         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
6502         doing FindMembers.
6503
6504         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
6505         include NonPublic after the first iteration.
6506
6507         * class.cs (Indexer.CheckBase): Only check if both parents are
6508         non-null. 
6509         
6510         * cs-parser.jay (accessor_body): If empty, set to null.
6511
6512         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
6513         same code path here to resolve constants names that we did have in
6514         MemberAccess.DoResolve.  There is too much code duplicated here.
6515
6516 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
6517
6518         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
6519
6520         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
6521         to MakeUnionSet.
6522
6523         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
6524         tokens, numbers and strings.
6525
6526         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
6527         parenthesis.
6528
6529         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
6530         asyncronous parameters and the regular parameters.  
6531
6532         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
6533         specify the target directory.
6534
6535         * expression.cs: (This.DoResolve): Simplify
6536         (As.Emit): Optimize, do not generate IsInst if the expression is
6537         always of the given type.
6538
6539         (Is.DoResolve): Bug fix, we were reporting both always/never for
6540         the is expression.
6541
6542         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
6543         creating too many unnecessary arrays.
6544
6545 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
6546
6547         * class.cs (EmitFieldInitializer): Use Assign expression to assign
6548         fields instead of rolling our own initializer.   Takes care of all
6549         implicit conversions, and drops unnecessary static checks/argument.
6550
6551 2002-03-31  Dick Porter  <dick@ximian.com>
6552
6553         * driver.cs: use the GetDirectories() return values properly, and
6554         use "/" as path separator.
6555
6556 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
6557
6558         * expression.cs (Unary): Optimize - - expr into expr.
6559         (Binary): Optimize a + (-b) into a -b.
6560
6561         * codegen.cs (CodeGen): Made all methods static.
6562
6563 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
6564
6565         * rootcontext.cs: 
6566
6567         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
6568         TypeBuilder property.
6569
6570         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
6571         instead. 
6572
6573         * tree.cs: Removed the various RecordXXXX, and replaced with a
6574         single RecordDecl.  Removed all the accessor methods, and just
6575         left a single access point Type 
6576
6577         * enum.cs: Rename DefineEnum to DefineType.
6578
6579         * decl.cs: New abstract method `DefineType' used to unify the
6580         Defines for Enumerations, Interfaces, TypeContainers and
6581         Delegates.
6582
6583         (FindType): Moved LookupInterfaceOrClass here.  Moved the
6584         LookupBaseClasses method that used to live in class.cs and
6585         interface.cs here, and renamed to FindType.
6586         
6587         * delegate.cs: Implement DefineType.  Take advantage of the
6588         refactored pattern for locating the parent builder without taking
6589         the parent_builder argument (which we know does not work if we are
6590         nested, and triggering a toplevel definition).
6591
6592 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6593
6594         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
6595         accessibility of a member has changed during override and report
6596         an error if so.
6597
6598         * class.cs (Method.Define, Property.Define): Only complain on
6599         overrides if the method is private, any other accessibility is
6600         fine (and since we just checked the permission is the same, we are
6601         good to go).
6602
6603         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
6604         and elif are processed always.  The other pre-processing
6605         directives are only processed if we are "taking" the path
6606
6607 2002-03-29  Martin Baulig  <martin@gnome.org>
6608
6609         * class.cs (Method.Emit): Only emit symbolic debugging info if the
6610         current location is not Null.
6611
6612         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
6613         a separate method so we can profile it.
6614
6615         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
6616         `span.Seconds' are just seconds, but no minutes or hours.
6617         (MainDriver): Profile the CodeGen.SaveSymbols calls.
6618
6619 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6620
6621         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
6622         Remove the gratuitous set of Final:
6623
6624                                 // If an interface implementation, then we can set Final.
6625                                 if (((flags & MethodAttributes.Abstract) == 0) &&
6626                                     implementing.DeclaringType.IsInterface)
6627                                         flags |= MethodAttributes.Final;
6628
6629         I do not know what I was smoking when I used that.
6630         
6631
6632         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
6633         step into fixing the name resolution issues for delegates and
6634         unifying the toplevel name resolution.
6635
6636 2002-03-28  Martin Baulig  <martin@gnome.org>
6637
6638         * class.cs (Method.Emit): If we have a symbol writer, call its
6639         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
6640         tell it about the current method.
6641
6642         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
6643         writer that we're going to emit the first byte of IL code for a new
6644         statement (a new source line).
6645         (EmitContext.EmitTopBlock): If we have a symbol writer, call
6646         EmitContext.Mark() before emitting any code.
6647
6648         * location.cs (SymbolDocument): Return null when we're Null.
6649
6650         * statement.cs (Statement): Moved the `Location loc' variable here.
6651         (Statement.EmitBoolExpression): If we have a symbol writer, call
6652         ec.Mark() before emitting any code to tell it that we're at the
6653         beginning of a new statement.
6654         (StatementExpression): Added `Location' argument to the constructor.
6655         (Block): Added public readonly variable `StartLocation' and public
6656         variable `EndLocation'.  The latter is to be set using SetEndLocation().
6657         (Block): Added constructor which takes a start and end location.
6658         (Block.SetEndLocation): New method. This sets the end location.
6659         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
6660         local variables we create.
6661         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
6662         each statement and do also mark the begin and end of the block.
6663
6664         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
6665         tell it the current lexer.Location, use Location.Null for the end of the
6666         block.
6667         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
6668         current block, set its end location using SetEndLocation().
6669         (statement_expression): StatementExpression constructor now takes the
6670         lexer.Location as additional argument.
6671         (for_statement, declare_local_variables): Likewise.
6672         (declare_local_variables): When creating a new implicit block, use the
6673         new Block constructor and pass it the lexer.Location.
6674
6675 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
6676
6677         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
6678         members also on the parent interfaces recursively.
6679
6680 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
6681
6682         * report.cs: Use new formats, since Gonzalo finished the missing
6683         bits. 
6684
6685         * expression.cs (Binary.ResolveOperator): added missing operator|
6686         operator& and operator^ for bool/bool.
6687
6688         * cs-parser.jay: CheckDef now takes a Location argument that is
6689         used to report errors more precisly (instead of reporting the end
6690         of a definition, we try to track something which is a lot closer
6691         to the source of the problem).
6692
6693         * cs-tokenizer.cs: Track global token use, so we can properly flag
6694         the use of #define/#undef after the first token has been seen.
6695
6696         Also, rename the reportXXXX to Error_DescriptiveName
6697
6698         * decl.cs (DeclSpace.IsTopLevel): Move property here from
6699         TypeContainer, so that Enum and Interface can use this too.
6700
6701         * class.cs (TypeContainer.LookupInterfaceOrClass,
6702         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
6703         `builder' argument.  Typically this was used to pass the parent
6704         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
6705         the definition).  
6706
6707         The problem is that a nested class could trigger the definition of
6708         a toplevel class, and the builder would be obviously wrong in that
6709         case. 
6710
6711         So we drop this argument, and we compute dynamically the
6712         TypeBuilder/ModuleBuilder (the correct information was available
6713         to us anyways from DeclSpace.Parent)
6714
6715         * interface.cs (Interface.DefineInterface): Drop builder
6716         parameter cleanup like class.cs
6717
6718         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
6719         like class.cs
6720
6721         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
6722         values. 
6723
6724         (Try.Emit): Propagate the returns value from the statement.
6725
6726         (Return.Emit): Even if we are leavning 
6727
6728         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
6729
6730         * modifiers.cs: Fix the computation of MethodAttributes flags.
6731
6732 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
6733
6734         * driver.cs: allow compilation of files that start with '/'.
6735         Add a default case when checking the argument of --target.
6736
6737 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
6738
6739         * interface.cs: Implement the same search algorithm for types in
6740         the interface code.
6741
6742         * delegate.cs: Do not allow multiple definition.
6743
6744         * Recovered ChangeLog that got accidentally amputated
6745
6746         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
6747
6748         * rootcontext.cs: Load manually enum to allow core classes to
6749         contain enumerations.
6750
6751         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
6752         Update to new static methods in TypeManager.
6753
6754         * typemanager.cs (GetMethod, GetConstructor): Use our
6755         implementation of FindMembers to find the members, since during
6756         corlib compilation, the types are TypeBuilders and GetMethod and
6757         GetConstructor do not work.
6758
6759         Make all methods in TypeManager static.
6760
6761         (InitCodeHelpers): Split the functionality from
6762         the InitCodeTypes function.
6763
6764         * driver.cs: Call InitCodeHelpers after we have populated the
6765         types. 
6766
6767         * cs-parser.jay (delegate_declaration): we did not used to compute
6768         the delegate name correctly for void delegates.
6769
6770 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
6771
6772         * rootcontext.cs (RootContext): Init the interface_resolve_order
6773         and type_container_resolve_order always.
6774
6775         (ResolveCore, BootstrapCorlib_ResolveClass,
6776         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
6777         compiler when compiling with --nostdlib
6778
6779         * class.cs (TypeContainer.DefineType): Check that our parent is
6780         not null.  This test is most important when we are bootstraping
6781         the core types.
6782
6783         * codegen.cs: Split out the symbol writing code.
6784
6785 2002-03-25  Martin Baulig  <martin@gnome.org>
6786
6787         * driver.cs (-g): Made -g an alias for --debug.
6788
6789 2002-03-24  Martin Baulig  <martin@gnome.org>
6790
6791         * codegen.cs (SymbolWriter): New public variable. Returns the
6792         current symbol writer.
6793         (CodeGen): Added `bool want_debugging_support' argument to the
6794          constructor. If true, tell the ModuleBuild that we want debugging
6795         support and ask it for the ISymbolWriter.
6796         (Save): If we have a symbol writer, call it's Close() method after
6797         saving the assembly.
6798
6799         * driver.c (--debug): New command line argument to create a
6800         debugger information file.
6801
6802         * location.cs (SymbolDocument): New public property. Returns an
6803         ISymbolDocumentWriter object for the current source file or null
6804         if we don't have a symbol writer.
6805
6806 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
6807
6808         * driver.cs (LoadAssembly): Correctly return when all the paths
6809         have been tried and not before.
6810
6811         * statement.cs (Switch.Emit): return the actual coverage for this
6812         statement (returns/not-returns)
6813
6814         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
6815         switch of the statement if we are the last switch section.  That
6816         kills two problems: try/catch problems (we used to emit an empty
6817         nop at the end) and switch statements where all branches would
6818         return. 
6819
6820 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
6821
6822         * driver.cs: Add default assemblies (the equivalent to the
6823         Microsoft CSC.RSP file)
6824
6825         * cs-tokenizer.cs: When updating `cols and setting it to zero,
6826         also update tokens_seen and set it to false.
6827
6828         * driver.cs: Implement --recurse for Mike.
6829
6830         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
6831         correctly splitting out the paths.
6832
6833 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
6834
6835         * interface.cs (Interface.PopulateProperty): Instead of using
6836         `parent' as the declaration space for the set parameters, use
6837         `this' 
6838
6839         * support.cs (InternalParameters): InternalParameters constructor
6840         takes a DeclSpace instead of a TypeContainer.
6841
6842         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
6843         types are being initialized, load the address of it before calling
6844         the function.  
6845
6846         (New): Provide a mechanism to disable the generation of local
6847         value type temporaries when the caller will be providing us with
6848         an address to store it.
6849
6850         (ArrayCreation.EmitDynamicInitializers): Use it.
6851
6852 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
6853
6854         * expression.cs (Invocation.EmitArguments): Only probe for array
6855         property if there is more than one argument.  Sorry about that.
6856
6857         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
6858         empty param arrays.
6859         
6860         * class.cs (Method.LabelParameters): Fix incorrect code path that
6861         prevented the `ParamArrayAttribute' from being applied to the
6862         params attribute.
6863
6864 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
6865
6866         * support.cs (ReflectionParameters): Correctly compute whether the
6867         last argument is a params array.  Fixes the problem with
6868         string.Split ('a')
6869
6870         * typemanager.cs: Make the assemblies array always be non-null
6871         (empty, but non-null)
6872
6873         * tree.cs (RecordDecl): New function that abstracts the recording
6874         of names.  This reports error 101, and provides a pointer to the
6875         previous declaration.  Fixes a crash in the compiler.
6876
6877         * cs-parser.jay (constructor_declaration): Update to new grammar,
6878         and provide a constructor_body that can be empty.
6879
6880 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
6881
6882         * driver.cs: Add support for --resources.
6883
6884         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
6885         Make all types for the various array helper methods be integer.
6886
6887         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
6888         CheckState to ConvCast.
6889
6890         (ConvCast): Now it takes a `checked' state argument, to avoid
6891         depending on the emit context for the conversion, and just using
6892         the resolve time setting.
6893
6894         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
6895         instead of Invocation.EmitArguments.  We do not emit the original
6896         arguments, instead we emit those which have been converted to
6897         unsigned int expressions.
6898
6899         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
6900
6901         * codegen.cs: ditto.
6902
6903         * expression.cs (LocalVariableReference): Drop the use of the
6904         Store function that depended on the variable index.
6905
6906         * statement.cs (VariableInfo): Drop the `Idx' property from this
6907         class, as this is not taking into account the indexes for
6908         temporaries tat we generate during the execution, getting the
6909         indexes wrong.
6910
6911         * class.cs: First emit class initializers, then call the parent
6912         constructor. 
6913
6914         * expression.cs (Binary): Fix opcode emision.
6915         (UnaryMutator.EmitCode): Support checked code generation
6916
6917         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
6918         matches for events for both the Static and Instance scans,
6919         pointing to the same element.   Fix that.
6920
6921 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
6922
6923         * rootcontext.cs (ResolveTree): Always set the
6924         interface_resolve_order, because nested interfaces will be calling
6925         into us.
6926
6927         * class.cs (GetInterfaceOrClass): Track the same resolution
6928         process used by TypeManager.LookupType.  This fixes the nested
6929         type lookups in class declarations (separate path from
6930         LookupType). 
6931
6932         (TypeContainer.DefineType): Also define nested interfaces.
6933         (TypeContainer.RegisterOrder): New public function used to
6934         register the order in which child interfaces need to be closed.
6935
6936         Nested interfaces need to be closed after their parents have been
6937         created. 
6938         
6939         * interface.cs (InterfaceAttr): Put all the logic for computing
6940         the interface attribute here. 
6941
6942         (DefineInterface): Register our interface order with the
6943         RootContext or with the TypeContainer depending on the case.
6944
6945 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6946
6947         * cs-parser.jay: rework foreach statement to work with the new
6948         changes to the policy on SimpleNames.
6949         
6950         * report.cs: support Stacktrace on warnings as well.
6951
6952         * makefile: drop --unsafe and /unsafe from the compile.
6953
6954 2002-03-13  Ravi Pratap  <ravi@ximian.com>
6955
6956         * ecore.cs (StandardConversionExists): Modify to take an Expression
6957         as the first parameter. Ensure we do null -> reference type conversion
6958         checking.
6959
6960         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
6961         temporary Expression objects.
6962
6963 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
6964
6965         * interface.cs: workaround bug in method overloading resolution
6966         (there is already a bugzilla bug for it).
6967
6968 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
6969
6970         We could also solve this problem by having a separate path for
6971         performing type lookups, instead of DoResolve, we could have a
6972         ResolveType entry point, and only participating pieces of the
6973         production (simplename, deref, array) would implement this. 
6974         
6975         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
6976         signal SimpleName to only resolve type names and not attempt to
6977         resolve anything else.
6978
6979         * expression.cs (Cast): Set the flag.
6980
6981         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
6982
6983         * class.cs: Only report 108 if there is no `new' modifier.
6984
6985         * cs-parser.jay: rework foreach statement to work with the new
6986         changes to the policy on SimpleNames.
6987         
6988         * report.cs: support Stacktrace on warnings as well.
6989
6990         * makefile: drop --unsafe and /unsafe from the compile.
6991
6992 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
6993
6994         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
6995         lookups here, instead of doing that at parse time.  This means
6996         that our grammar will not introduce `LocalVariableReferences' as
6997         expressions at this point.  That solves the problem of code like
6998         this:
6999
7000         class X {
7001            static void Main ()
7002            { int X = 1;
7003             { X x = null }}}
7004
7005         This is only half the fix.  The full fix requires parameters to
7006         also be handled in this way.
7007
7008         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
7009         makes the use more obvious of the DeclSpace.  The
7010         ec.TypeContainer.TypeBuilder is now only used to pull the
7011         TypeBuilder for it.
7012
7013         My theory is that I can get rid of the TypeBuilder completely from
7014         the EmitContext, and have typecasts where it is used (from
7015         DeclSpace to where it matters).  
7016
7017         The only pending problem is that the code that implements Aliases
7018         is on TypeContainer, and probably should go in DeclSpace.
7019
7020         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
7021         lookups here, instead of doing that at parse time.  This means
7022         that our grammar will not introduce `LocalVariableReferences' as
7023         expressions at this point.  That solves the problem of code like
7024         this:
7025
7026         class X {
7027            static void Main ()
7028            { int X = 1;
7029             { X x = null }}}
7030
7031         This is only half the fix.  The full fix requires parameters to
7032         also be handled in this way.
7033
7034         * class.cs (Property.DefineMethod): When implementing an interface
7035         method, set newslot, when implementing an abstract method, do not
7036         set the flag (before we tried never setting it, or always setting
7037         it, which is the difference).
7038         (Indexer.DefineMethod): same.
7039         (Method.DefineMethod): same.
7040
7041         * ecore.cs: Only set the status used flag if we get back a Field.
7042
7043         * attribute.cs: Temporary hack, so Paolo can keep working.
7044
7045 2002-03-08  Ravi Pratap  <ravi@ximian.com>
7046
7047         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
7048         the unmanaged type in the case we have a MarshalAs attribute.
7049
7050         (Resolve): Handle the case when we are parsing the special MarshalAs
7051         attribute [we need to store the unmanaged type to use later]
7052         
7053         * typemanager.cs (marshal_as_attr_type): Built in type for the 
7054         MarshalAs Attribute.
7055
7056         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
7057         on parameters and accordingly set the marshalling info.
7058         
7059 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
7060
7061         * class.cs: Optimizing slightly by removing redundant code after
7062         we switched to the `NoTypes' return value.
7063         (Property.DefineMethod): use NoTypes here too.
7064
7065         This fixes the bug I introduced in my last batch of changes.
7066
7067 2002-03-05  Ravi Pratap  <ravi@ximian.com>
7068
7069         * tree.cs (RecordEnum): Add. We now keep track of enums too.
7070
7071         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
7072         Enums since those are types too. 
7073
7074         * cs-parser.jay (enum_declaration): Record enums as we parse them.
7075         
7076         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
7077         thanks to a call during the lookup process.
7078
7079 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
7080
7081         * statement.cs (Foreach): Lots of work to accomodate a particular
7082         kind of foreach statement that I had not kept in mind.  It is
7083         possible to have foreachs on classes that provide a GetEnumerator
7084         method that return objects that implement the "pattern" for using
7085         a foreach, there is no need to support GetEnumerator
7086         specifically. 
7087
7088         This is needed to compile nant.
7089
7090         * decl.cs: Only report 114 if the member is not `Finalize' and if
7091         the warning level is at least 2.
7092
7093         * class.cs: Moved the compare function from Method to
7094         MethodSignature. 
7095
7096         (MethodSignature.InheritableMemberSignatureCompare): Add new
7097         filter function that is used to extract inheritable methods from a
7098         class. 
7099
7100         (Method.Define): Use the new `inheritable_method_signature_filter'
7101         delegate
7102
7103         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
7104         command. 
7105
7106 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
7107
7108         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
7109
7110         * cs-parser.jay: Add opt_semicolon to the interface declaration.
7111
7112         * expression.cs: Pass location information to
7113         ConvertImplicitStandard. 
7114
7115         * class.cs: Added debugging code to track return values from
7116         interfaces. 
7117
7118 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
7119
7120         * expression.cs (Is.DoResolve): If either side of the `is' is an
7121         interface, do not flag the warning.
7122
7123         * ecore.cs (ImplicitReferenceConversion): We need a separate test
7124         for interfaces
7125
7126         * report.cs: Allow for --fatal to be used with --probe.
7127         
7128         * typemanager.cs (NoTypes): Move the definition for the empty Type
7129         array here. 
7130
7131         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
7132         properties. 
7133         (TypeContainer.DefineProxy): New function used to proxy to parent
7134         implementations when implementing interfaces.
7135         (TypeContainer.ParentImplements): used to lookup if our parent
7136         implements a public function that is required by an interface.
7137         (TypeContainer.VerifyPendingMethods): Hook this up.
7138
7139         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
7140         `modules' and `assemblies' arraylists into arrays.  We only grow
7141         these are the very early start up of the program, so this improves
7142         the speedof LookupType (nicely measured).
7143
7144         * expression.cs (MakeByteBlob): Replaced unsafe code with
7145         BitConverter, as suggested by Paolo.
7146
7147         * cfold.cs (ConstantFold.Binary): Special case: perform constant
7148         folding of string concatenation, but if either side is a string,
7149         and the other is not, then return null, and let the runtime use
7150         the concatenation on the string plus the object (using
7151         `Object.ToString'). 
7152
7153 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
7154
7155         Constant Folding has been implemented now.
7156         
7157         * expression.cs (Unary.Reduce): Do not throw an exception, catch
7158         the error instead on types that are not supported in one's
7159         complement. 
7160
7161         * constant.cs (Constant and all children): New set of functions to
7162         perform implict and explicit conversions.
7163         
7164         * ecore.cs (EnumConstant): Implement the new functions to perform
7165         conversion by proxying to the child expression.
7166
7167         * codegen.cs: (ConstantCheckState): Constant evaluation has its
7168         own separate setting that can not be turned off from the command
7169         line using --unchecked or --checked and is only controlled using
7170         the checked/unchecked statements and expressions.  This setting is
7171         used by the constant folder to flag errors.
7172
7173         * expression.cs (CheckedExpr, UncheckedExpr): Set the
7174         ConstantCheckState as well.   
7175
7176         During Resolve, they also have to flag the state, because the
7177         constant folder runs completely in the Resolve phase.
7178
7179         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
7180         well.
7181
7182 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7183
7184         * cfold.cs: New file, this file contains the constant folder.
7185         
7186         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
7187         argument to track whether we are using the resulting address to
7188         load or store a value and provide better error messages. 
7189
7190         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
7191         new AddressOf arguments.
7192
7193         * statement.cs (Foreach.EmitCollectionForeach): Update
7194
7195         * expression.cs (Argument.Emit): Call AddressOf with proper
7196         arguments to track usage.
7197
7198         (New.DoEmit): Call AddressOf with new arguments.
7199
7200         (Unary.Emit): Adjust AddressOf call.
7201
7202 2002-03-01  Ravi Pratap  <ravi@ximian.com>
7203
7204         * cs-parser.jay (member_access): Change the case for pre-defined types
7205         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
7206         this suggestion.
7207
7208         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
7209         a method body.
7210
7211         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
7212         essentially like methods and apply attributes like MethodImplOptions to them too.
7213
7214         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
7215         not being null.
7216
7217         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
7218         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
7219         is the DeclSpace.
7220
7221         * Update code everywhere accordingly.
7222
7223         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
7224
7225         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
7226
7227 2002-02-28  Ravi Pratap  <ravi@ximian.com>
7228
7229         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
7230         try performing lookups against those instead of jumping straight into using
7231         the 'using' clauses.
7232
7233         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
7234
7235         (LookupType): Perform lookups in implicit parents too.
7236
7237         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
7238         sequence as RootContext.LookupType. 
7239
7240         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
7241         the various cases of namespace lookups into this method.
7242
7243 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
7244
7245         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
7246         in positional arguments)
7247
7248         * class.cs (Operator): Update the AllowedModifiers to contain
7249         extern. 
7250
7251         * cs-parser.jay: Update operator declaration to allow for the
7252         operator body to be empty.
7253
7254         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
7255         values. 
7256
7257 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
7258
7259         * class.cs (Method.Emit): Label parameters.
7260
7261         * driver.cs: Return 1 or 0 as the program exit code.
7262
7263 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
7264
7265         * expression.cs: Special case the `null' object when trying to
7266         auto-compute the type, as anything can be explicitly converted to
7267         that. 
7268
7269         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
7270         spotting this Paolo.
7271
7272         (Expression.ImplicitNumericConversion): Perform comparissions of
7273         the type using the underlying type in the case of an enumeration
7274         rather than using the enumeration type for the compare.
7275
7276         Cope with the underlying == type case, which is not possible to
7277         catch before. 
7278
7279         (Expression.ConvertNumericExplicit): Perform comparissions of
7280         the type using the underlying type in the case of an enumeration
7281         rather than using the enumeration type for the compare.
7282
7283         * driver.cs: If the user does not supply an extension, assume .exe
7284
7285         * cs-parser.jay (if_statement): Rewrote so that we can track the
7286         location for the if statement.
7287
7288         * expression.cs (Binary.ConstantFold): Only concat strings when
7289         the operation is "+", not everything ;-)
7290
7291         * statement.cs (Statement.EmitBoolExpression): Take a location
7292         argument. 
7293         (If, While, Do): Track location.
7294
7295         * expression.cs (Binary.ResolveOperator): In the object + string
7296         case, I was missing a call to ConvertImplicit
7297
7298 2002-02-25  Ravi Pratap  <ravi@ximian.com>
7299
7300         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
7301         Location arguments. Ensure we use RootContext.LookupType to do our work
7302         and not try to do a direct Type.GetType and ModuleBuilder.GetType
7303
7304         * interface.cs (PopulateMethod): Handle the type of the parameter being
7305         null gracefully.
7306
7307         * expression.cs (Invocation.BetterFunction): Handle the case when we 
7308         have a params method with no fixed arguments and a call is made with no
7309         arguments.
7310
7311 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
7312
7313         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
7314         the verbatim-string-literal
7315
7316         * support.cs (InternalParameters.ParameterModifier): handle null
7317         fixed parameters.
7318         (InternalParameters.ParameterType): ditto.
7319
7320         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
7321         duplicating the name of the variable parameter.
7322         (GetParameterByName): Fix bug where we were not looking up array
7323         paramters if they were the only present (thanks Paolo!).
7324         (GetParameterInfo): We only have an empty set of types if both
7325         fixed and array are set to null.
7326         (GetParameterInfo-idx): Handle FixedParameter == null
7327
7328         * cs-parser.jay: Handle the case where there is no catch
7329         statements (missing null test).
7330
7331 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
7332
7333         * driver.cs (MainDriver): Be conservative on our command line
7334         handling.
7335
7336         Catch DirectoryNotFoundException when calling GetFiles.
7337         
7338         (SplitPathAndPattern): Used to split the input specification into
7339         a path and a pattern that we can feed to Directory.GetFiles.
7340
7341 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
7342
7343         * statement.cs (Fixed): Implement the last case of the Fixed
7344         statement (string handling).
7345
7346         * expression.cs (StringPtr): New class used to return a char * to
7347         a string;  Used by the Fixed statement.
7348
7349         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
7350
7351         * expression.cs (Binary.ResolveOperator): Remove redundant
7352         MemberLookup pn parent type.
7353         Optimize union call, we do not need a union if the types are the same.
7354         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
7355         type.
7356
7357         Specialize the use of MemberLookup everywhere, instead of using
7358         the default settings. 
7359
7360         (StackAlloc): Implement stackalloc keyword.
7361
7362         * cs-parser.jay: Add rule to parse stackalloc.
7363         
7364         * driver.cs: Handle /h, /help, /?
7365
7366         * expression.cs (MakeByteBlob): Removed the hacks we had in place
7367         before we supported unsafe code.
7368         
7369         * makefile: add --unsafe to the self compilation of mcs.
7370
7371 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
7372
7373         * expression.cs (PointerArithmetic): New class that is used to
7374         perform pointer arithmetic.
7375         (Binary.Resolve): Handle pointer arithmetic
7376         Handle pointer comparission.
7377         (ArrayPtr): Utility expression class that is used to take the
7378         address of an array.
7379
7380         (ElementAccess): Implement array access for pointers
7381         
7382         * statement.cs (Fixed): Implement fixed statement for arrays, we
7383         are missing one more case before we are done.
7384
7385         * expression.cs (Indirection): Implement EmitAssign and set the
7386         ExprClass to Variable.  This allows pointer dereferences to be
7387         treated as variables, and to have values assigned to them.
7388         
7389         * ecore.cs (Expression.StoreFromPtr): New utility function to
7390         store values dereferencing.
7391
7392 2002-02-20  Ravi Pratap  <ravi@ximian.com>
7393
7394         * expression.cs (Binary.ResolveOperator): Ensure that we are
7395         not trying to operate on a void type - this fixes the reported
7396         bug.
7397
7398         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
7399         the parent implementation is sealed.
7400
7401         * ../errors/cs0239.cs : Add.
7402
7403         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
7404
7405         * typemanager.cs (unverifiable_code_type): Corresponds to 
7406         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
7407         which have unsafe code in them.
7408
7409         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
7410         unsafe context.
7411
7412 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
7413
7414         * cs-tokenizer.cs: Add support for @"litreal strings"
7415
7416         Make tokenizer accept pre-processor directives
7417         on any column (remove the old C-like limitation). 
7418
7419         * rootcontext.cs (EmitCode): Emit any global attributes.
7420         (AddGlobalAttributes): Used to keep track of assembly attributes. 
7421
7422         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
7423
7424         * cs-parser.jay: Add support for global attributes.  
7425
7426 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
7427
7428         * expression.cs (Indirection): New helper class.  Unary will
7429         create Indirection classes to be able to implement the
7430         IMemoryLocation interface on it.
7431
7432 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * cs-parser.jay (fixed_statement): reference the right statement.
7435
7436         * statement.cs (Fixed.Emit): Finish implementing the fixed
7437         statement for the &x case.
7438
7439 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
7440
7441         * class.cs (Property.Define, Method.Define): Remove newslot when
7442         `implementing'.  
7443
7444         * modifiers.cs: My use of NewSlot when `Abstract' was set was
7445         wrong.  NewSlot should only be used if the `new' keyword is present.
7446
7447         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
7448         locating our system dir.  Sorry about this.
7449
7450 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7451
7452         * driver.cs (GetSystemDir): Compute correctly the location of our
7453         system assemblies.  I was using the compiler directory instead of
7454         the library directory.
7455
7456 2002-02-13  Ravi Pratap  <ravi@ximian.com>
7457
7458         * expression.cs (BetterFunction): Put back in what Miguel commented out
7459         since it is the correct fix. The problem is elsewhere ;-)
7460
7461         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
7462         parameters of the parms method are themselves compatible or not !
7463
7464         (StandardConversionExists): Fix very dangerous bug where we were forgetting
7465         to check that a class implements an interface before saying that an implicit
7466         conversion was allowed. Use ImplementsInterface to do the checking.
7467
7468 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
7469
7470         * class.cs (Method.Define): Track whether we are an explicit
7471         implementation or not.  And only call DefineMethodOverride if we
7472         are an explicit implementation.
7473
7474         (Property.DefineMethod): Ditto.
7475
7476 2002-02-11  Ravi Pratap  <ravi@ximian.com>
7477
7478         * expression.cs (BetterFunction): Catch hideous bug which was
7479          preventing us from detecting ambiguous calls due to implicit casts i.e
7480         cs0121.
7481
7482 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
7483
7484         * support.cs (Pair): Remove un-needed method.  I figured why I was
7485         getting the error in cs-parser.jay, the variable in a foreach loop
7486         is readonly, and the compiler does not really treat this as a variable.
7487
7488         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
7489         instead of EQUALS in grammar.  
7490
7491         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
7492
7493         * expression.cs (Unary.DoResolve): Check whether the argument is
7494         managed or not.
7495
7496 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
7497
7498         * support.cs: Api for Pair to set a value.  Despite the fact that
7499         the variables are public the MS C# compiler refuses to compile
7500         code that accesses the field if the variable is part of a foreach
7501         statement. 
7502
7503         * statement.cs (Fixed): Begin implementation of the fixed
7504         statement.
7505
7506         (Block.AddVariable): Return the VariableInfo on success and null
7507         on failure instead of true/false. 
7508
7509         * cs-parser.jay (foreach): Catch errors on variables already
7510         defined (we were ignoring this value before) and properly unwind
7511         the block hierarchy
7512
7513         (fixed_statement): grammar for the fixed statement.
7514
7515 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
7516
7517         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
7518         pointer types to be incretemented.
7519
7520         (SizeOf): Implement.
7521
7522         * cs-parser.jay (pointer_member_access): Implement
7523         expr->IDENTIFIER production.
7524
7525         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
7526         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
7527         on safe contexts.
7528
7529         (Unary): Implement indirection.
7530
7531         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
7532         use in non-unsafe context).
7533
7534         (SimpleName.DoResolve): Check for pointers in field access on safe
7535         contexts. 
7536
7537         (Expression.LoadFromPtr): Factor the load-indirect code in this
7538         function.  This was duplicated in UnboxCast and ParameterReference
7539
7540 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
7541
7542         * expression.cs (ComposedCast): report an error if a pointer cast
7543         is used in a safe region.
7544
7545         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
7546         pointer type casts in unsafe context.
7547
7548         * codegen.cs (EmitContext): Set up IsUnsafe.
7549
7550         * cs-parser.jay (non_expression_type): Add productions for pointer
7551         casts. 
7552
7553         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
7554         code.  We should not use force into static mode if the method is
7555         not virtual.  Fixes bug in MIS
7556
7557         * statement.cs (Do.Emit, While.Emit, For.Emit,
7558         Statement.EmitBoolExpression): Add support to Do and While to
7559         propagate infinite loop as `I do return' semantics.
7560
7561         Improve the For case to also test for boolean constants.
7562
7563         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
7564         to the list of attributes we can add.
7565
7566         Remove `EmitContext' argument.
7567
7568         * class.cs (Method.Define): Apply parameter attributes.
7569         (Constructor.Define): Apply parameter attributes.
7570         (MethodCore.LabelParameters): Move here the core of labeling
7571         parameters. 
7572
7573         * support.cs (ReflectionParameters.ParameterModifier,
7574         InternalParameters.ParameterModifier): Use IsByRef on the type and
7575         only return the OUT bit for these parameters instead of in/out/ref
7576         flags.
7577
7578         This is because I miss-understood things.  The ParameterInfo.IsIn
7579         and IsOut represent whether the parameter has the [In] and [Out]
7580         attributes set.  
7581
7582 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
7583
7584         * ecore.cs (FieldExpr.Emit): Release temporaries.
7585
7586         * assign.cs (LocalTemporary.Release): new function.
7587
7588         * codegen.cs (EmitContext.GetTemporaryStorage,
7589         EmitContext.FreeTemporaryStorage): Rework the way we deal with
7590         temporary storage.  Now we can "put back" localbuilders when we
7591         are done with them
7592
7593 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
7594
7595         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
7596         need to make a copy of the variable to generate verifiable code.
7597
7598 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
7599
7600         * driver.cs: Compute dynamically the system directory.
7601
7602         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
7603         Slower, but more generally useful.  Used by the abstract
7604         registering implementation. 
7605
7606         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
7607         the rules for the special rule on Type/instances.  First check if
7608         we have the same name, and if so, try that special static path
7609         rather than the instance path.
7610         
7611 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
7612
7613         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
7614         for, while and if.
7615
7616         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
7617         Enum, ValueType, Delegate or Array for non-corlib compiles.
7618
7619         * cs-tokenizer.cs: Catch long identifiers (645)
7620
7621         * typemanager.cs (IndexerPropetyName): Ravi never tested this
7622         piece of code.
7623
7624         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
7625         fix, we were returning too early, so we were not registering
7626         pending methods from abstract classes.
7627
7628         Do not register pending methods if the class is abstract.
7629
7630         * expression.cs (Conditional.DoResolve): Report circular implicit
7631         conversions when we neecd to compute it for conditional
7632         expressions. 
7633
7634         (Is.DoResolve): If the expression is always of the provided type,
7635         flag warning 183.  If the expression can not ever be of the
7636         provided type flag warning 184.
7637
7638         * class.cs: Catch 169 as well.
7639
7640         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
7641         read. 
7642
7643 2002-01-18  Nick Drochak  <ndrochak@gol.com>
7644
7645         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
7646
7647 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
7648
7649         * interface.cs: (PopulateMethod): Check for pointers being defined
7650         only if the unsafe context is active.
7651         (PopulateProperty): ditto.
7652         (PopulateIndexer): ditto.
7653
7654         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
7655         specified.  If pointers are present, make sure that they are
7656         present in an unsafe context.
7657         (Constructor, Constructor.Define): ditto.
7658         (Field, Field.Define): ditto.
7659         (Property, Property.Define): ditto.
7660         (Event, Event.Define): ditto.
7661
7662         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
7663         hashtable if there are classes or structs defined.
7664
7665         * expression.cs (LocalVariableReference.DoResolve): Simplify this
7666         code, as the constant resolution moved.
7667
7668         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
7669         the metadata, so we can flag error 133. 
7670
7671         * decl.cs (MemberCore.UnsafeOK): New function to test that a
7672         pointer is being declared in an unsafe context.
7673
7674 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
7675
7676         * modifiers.cs (Modifiers.Check): Require a Location argument.
7677         Report error 227 for Unsafe use.
7678
7679         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
7680
7681         * statement.cs (For.Emit): If the test is null, then report that
7682         we do `return', as we wont reach anything afterwards.
7683
7684         (Switch.SwitchGoverningType): Track the expression that matched
7685         the conversion.
7686
7687         * driver.cs: Allow negative numbers as an error code to flag.
7688
7689         * cs-parser.jay: Handle 1551.
7690
7691         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
7692
7693 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7694
7695         * cs-parser.jay: Report 1518 (type declaration can only contain
7696         class, struct, interface, enum or delegate)
7697
7698         (switch_label): Report 1523 (keywords `case' or `default' must
7699         preced code)
7700
7701         (opt_switch_sections): Report 1522 (empty switch)
7702
7703         * driver.cs: Report 1515 (response file specified multiple times)
7704         Report 1516 (Source file specified multiple times).
7705
7706         * expression.cs (Argument.Resolve): Signal 1510
7707
7708         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
7709         access not allowed in static code)
7710
7711 2002-01-11  Ravi Pratap  <ravi@ximian.com>
7712
7713         * typemanager.cs (IsPointerType): Utility method which we are going
7714         to need a lot.
7715
7716         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
7717         the object type, so we take care of that.
7718
7719         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
7720         
7721         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
7722         added to non-params parameters :-)
7723
7724         * typemanager.cs (CSharpName): Include 'void' type too. 
7725
7726         (void_ptr_type): Include in the set of core types.
7727
7728         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
7729         duplicating code.
7730
7731         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
7732         an unsafe context.
7733
7734         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
7735         completely forgotten about it.
7736
7737 2002-01-10  Ravi Pratap  <ravi@ximian.com>
7738
7739         * cs-parser.jay (pointer_type): Add. This begins our implementation
7740         of parsing rules for unsafe code.
7741
7742         (unsafe_statement): Implement.
7743
7744         (embedded_statement): Modify to include the above.
7745
7746         * statement.cs (Unsafe): Implement new class for unsafe blocks.
7747
7748         * codegen.cs (EmitContext.InUnsafe): Add. This determines
7749         if the current context is an unsafe one.
7750
7751         * cs-parser.jay (local_variable_pointer_type): Since local variable types
7752         are handled differently, we need separate rules for them.
7753
7754         (local_variable_declaration): Update to use local_variable_pointer_type
7755         to allow variable declarations of unmanaged pointer types.
7756
7757         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
7758         in unsafe contexts.
7759
7760         * ../errors/cs0214.cs : Add.
7761
7762 2002-01-16  Nick Drochak  <ndrochak@gol.com>
7763
7764         * makefile: remove 'response' file when cleaning.
7765
7766 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
7767
7768         * cs-parser.jay: Report 1524.
7769
7770 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
7771
7772         * typemanager.cs (RegisterMethod): drop checking if we have
7773         registered this from here
7774
7775 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
7776
7777         * class.cs (Method.EmitDestructor): Implement calling our base
7778         destructor. 
7779
7780         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
7781         value of InFinally.
7782
7783         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
7784         this routine and will wrap the call in a try/catch block.  Deal
7785         with the case.
7786
7787 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
7788
7789         * ecore.cs (Expression.MemberLookup): instead of taking a
7790         parameter `same_type' that was used to tell whether we could
7791         access private members we compute our containing type from the
7792         EmitContext.
7793
7794         (FieldExpr): Added partial support for volatile fields.  This does
7795         not work for volatile fields exposed from assemblies, as I can not
7796         figure out how to extract the modreq from it.
7797
7798         Updated all the source files to use this.
7799
7800         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
7801         because it is referenced by MemberLookup very often. 
7802
7803 2002-01-09  Ravi Pratap  <ravi@ximian.com>
7804
7805         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
7806         TypeBuilder.GetCustomAttributes to retrieve what we need.
7807
7808         Get rid of redundant default_member_attr_type as this is the same as
7809         default_member_type which already exists.
7810
7811         * interface.cs, attribute.cs : Update accordingly.
7812         
7813 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
7814
7815         * typemanager.cs: Enable IndexerPropertyName again.  It does not
7816         work for TYpeBuilders though.  Ravi, can you please fix this?
7817
7818         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
7819
7820         * expression.cs (Argument.Emit): Handle the case of ref objects
7821         being passed to ref functions;  
7822
7823         (ParameterReference.EmitLoad): Loads the content of the pointer
7824         without dereferencing.
7825
7826 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7827
7828         * cs-tokenizer.cs: Implemented the pre-processing expressions.
7829
7830 2002-01-08  Ravi Pratap  <ravi@ximian.com>
7831
7832         * class.cs (Indexer.DefineMethod): Incorporate the interface
7833         type in the name of the method if we are doing explicit interface
7834         implementation.
7835
7836         * expression.cs (ConversionExists): Remove as it is completely obsolete.
7837
7838         (BetterConversion): Fix extremely trivial bug where we were referring to
7839         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
7840         again !
7841
7842         * ../errors/bug16.cs : Add although we have fixed it.
7843
7844 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
7845
7846         * expression.cs (BaseIndexer): Begin implementation.
7847
7848         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
7849
7850         * cs-parser.jay (indexer_declarator): Use qualified_identifier
7851         production directly to remove a shift/reduce, and implement
7852         explicit interface implementation.
7853
7854         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
7855         after a floating point suffix.
7856
7857         * expression.cs (DoNumericPromotions): Improved the conversion for
7858         uint/uint.  If we have a constant, we avoid doing a typecast to a
7859         larger type.
7860
7861         * class.cs (Indexer): Implement explicit interface implementation
7862         for indexers.
7863         
7864 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
7865
7866         * class.cs: make the default instance constructor public and hidebysig.
7867
7868 2001-01-03  Ravi Pratap  <ravi@ximian.com>
7869
7870         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
7871         so we can call it from elsewhere.
7872
7873         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
7874         we emit it internally if the class has a defined indexer; otherwise the user
7875         emits it by decorating the class definition with the DefaultMemberAttribute.
7876
7877         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
7878         attribute is not used on a type which defines an indexer.
7879
7880         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
7881         character when we skip whitespace.
7882
7883         * ../errors/cs0646.cs : Add.
7884
7885 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
7886
7887         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
7888         again. 
7889
7890         * makefile: Add practical target `mcs3.exe' which builds the third
7891         generation compiler. 
7892
7893         * expression.cs (New): Fix structures constructor calling.
7894
7895         * class.cs (Property, Method, Indexer): Emit Final flag on the
7896         method if we are an interface implementation and we are not
7897         abstract. 
7898
7899         * ecore.cs (PropertyExpr): New public field `IsBase', tells
7900         whether this property is referencing a `base' method.
7901
7902         * expression.cs (Invocation.EmitCall): take an extra argument:
7903         is_base, this is used to determine whether the `call' or
7904         `callvirt' opcode should be used.
7905
7906         
7907         * delegate.cs: update EmitCall.
7908
7909         * class.cs (Method.Define): Set NewSlot for the cases where we are
7910         not implementing an interface method.
7911
7912         (Property.Define): ditto.
7913
7914 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
7915
7916         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
7917         'r'.  Allows mcs to parse itself fully.
7918
7919 2002-01-02  Ravi Pratap  <ravi@ximian.com>
7920
7921         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
7922         of the number of initializers that require the InitializeArray method.
7923
7924         (CheckIndices): Store the Expression in all cases - not the plain value. Also
7925         update the above field where necessary.
7926
7927         (MakeByteBlob): Update accordingly.
7928
7929         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
7930         greater than 2.
7931
7932         (EmitDynamicInitializers): Update in accordance with the new optimization.
7933
7934         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
7935         same OpCode applies.
7936
7937         * cs-parser.jay : Fix some glaring errors I introduced.
7938
7939 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
7940
7941         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
7942         so that we can check for name clashes there too.
7943
7944         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
7945         for interface indexers.
7946
7947         * interfaces.cs (Define): Emit the default member attribute.
7948
7949         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
7950         variable was being referred to while setting the value ;-)
7951
7952 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
7953
7954         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
7955         byte-by-byte information when we know the data is zero.
7956
7957         Make the block always a multiple of 4, because
7958         DefineInitializedData has a bug.
7959
7960         * assign.cs: Fix, we should assign from the temporary, not from
7961         the source. 
7962
7963         * expression.cs (MakeByteBlob): Fix my incorrect code.
7964
7965 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
7966
7967         * typemanager.cs (EnumToUnderlying): This function is used to get
7968         the underlying type from an enumeration, because it does not
7969         always work. 
7970
7971         * constant.cs: Use the I4_S form for values between -128 and 127.
7972
7973         * statement.cs (Block.LookupLabel): Looks up a label.
7974         (Block): Drop support for labeled blocks.
7975
7976         (LabeledStatement): New kind of statement that represents a label
7977         only.
7978
7979         (Goto): Finally implement this bad boy.
7980         
7981         * cs-parser.jay: Update to reflect new mechanism to implement
7982         labels.
7983
7984 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
7985
7986         * codegen.cs (EmitContext.This): a codegen property that keeps the
7987         a single instance of this instead of creating many different this
7988         instances. 
7989
7990         * delegate.cs (Delegate.DoResolve): Update to use the property;
7991
7992         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
7993
7994         * expression.cs (BaseAccess.DoResolve): Ditto.
7995
7996 2001-12-29  Ravi Pratap  <ravi@ximian.com>
7997
7998         * typemanager.cs (methodimpl_attr_type): Add to hold the type
7999         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
8000
8001         (InitCoreTypes): Update accordingly.
8002
8003         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
8004         so we can quickly store the state.
8005
8006         (ApplyAttributes): Set the correct implementation flags
8007         for InternalCall methods.
8008
8009 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
8010
8011         * expression.cs (EmitCall): if a method is not virtual, then do
8012         not use callvirt on it.
8013
8014         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
8015         user defined stuff) requires the use of stobj, which takes an
8016         address on the stack instead of an array and an index.  So emit
8017         the Ldelema operation for it.
8018
8019         (EmitStoreOpcode): Use stobj for valuetypes.
8020
8021         (UnaryMutator.EmitCode): Use the right 1 value depending on
8022         whether we are dealing with int64/uint64, float or doubles.
8023
8024         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
8025         constructors that I implemented last night.
8026
8027         (Constructor.IsDefault): Fix to work properly for static
8028         constructors.
8029
8030         * cs-parser.jay (CheckDef): report method signature errors.
8031         Update error number 103 to be 132.
8032
8033         * decl.cs: New AdditionResult enumeration value: MethodExists.
8034         Although we do this check for methods later on in the semantic
8035         analysis, catching repeated default constructors is so easy that
8036         we catch these here. 
8037         
8038         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
8039         promotions code.
8040
8041         (ParameterReference.EmitAssign, Emit): handle
8042         bools as bytes.
8043
8044         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
8045         (ArrayAccess.EmitStoreOpcode): ditto.
8046
8047         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
8048
8049         * expression.cs (MakeByteBlob): Complete all the missing types
8050         (uint, short, ushort, byte, sbyte)
8051
8052         * class.cs: Only init instance field initializers on instance
8053         constructors. 
8054
8055         Rename `constructors' to instance_constructors. 
8056
8057         (TypeContainer.AddConstructor): Only add constructors to the list
8058         if it is not static.
8059
8060         Make sure that we handle default_static_constructor independently
8061         everywhere where we handle instance_constructors
8062
8063 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
8064
8065         * class.cs: Do not lookup or create a base initializer for a
8066         static constructor.
8067
8068         (ConstructorInitializer.Resolve): use the proper type to lookup
8069         for constructors.
8070
8071         * cs-parser.jay: Report error 1585 (modifiers between type and name).
8072
8073         * enum.cs, interface.cs: Remove CloseType, this is taken care by
8074         in DeclSpace. 
8075
8076         * decl.cs: CloseType is now an virtual method, the default
8077         implementation just closes this type.
8078         
8079 2001-12-28  Ravi Pratap  <ravi@ximian.com>
8080
8081         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
8082         to PreserveSig by default. Also emit HideBySig on such methods.
8083
8084         Basically, set the defaults to standard values.
8085
8086         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
8087         argument, if candidate is better, it can't be worse than the best !
8088
8089         (Invocation): Re-write bits to differentiate between methods being
8090         applicable in their expanded form and their normal form - for params
8091         methods of course.
8092
8093         Get rid of use_standard everywhere as only standard conversions are allowed
8094         in overload resolution. 
8095
8096         More spec conformance.
8097         
8098 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8099
8100         * driver.cs: Add --timestamp, to see where the compiler spends
8101         most of its time.
8102
8103         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
8104         `this' in static code.
8105
8106         (SimpleName.DoResolve): Implement in terms of a helper function
8107         that allows static-references to be passed upstream to
8108         MemberAccess.
8109
8110         (Expression.ResolveWithSimpleName): Resolve specially simple
8111         names when called by MemberAccess to implement the special
8112         semantics. 
8113
8114         (Expression.ImplicitReferenceConversion): Handle conversions from
8115         Null to reference types before others, as Null's type is
8116         System.Object. 
8117
8118         * expression.cs (Invocation.EmitCall): Handle the special case of
8119         calling methods declared on a reference type from a ValueType
8120         (Base classes System.Object and System.Enum)
8121
8122         (MemberAccess.Resolve): Only perform lookups on Enumerations if
8123         the left hand side is a TypeExpr, not on every enumeration. 
8124
8125         (Binary.Resolve): If types are reference types, then do a cast to
8126         object on operators != and == of both arguments.
8127         
8128         * typemanager.cs (FindMembers): Extract instance and static
8129         members if requested.
8130
8131         * interface.cs (PopulateProperty): Use void_type instead of null
8132         as the return type for the setter method.
8133
8134         (PopulateIndexer): ditto.
8135
8136 2001-12-27  Ravi Pratap  <ravi@ximian.com>
8137
8138         * support.cs (ReflectionParameters): Fix minor bug where we
8139         were examining the wrong parameter for the ParamArray attribute.
8140
8141         Cope with requests for the type of the parameter at position
8142         greater than the params parameter's. We now return the element
8143         type of the params array as that makes more sense.
8144
8145         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
8146         accordingly as we no longer have to extract the element type
8147         ourselves.
8148
8149         (Invocation.OverloadResolve): Update.
8150
8151 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
8154         against IEnumerator, test whether the return value is a descendant
8155         of the IEnumerator interface.
8156
8157         * class.cs (Indexer.Define): Use an auxiliary method to implement
8158         the other bits of the method definition.  Begin support for
8159         explicit interface implementation.
8160
8161         (Property.DefineMethod): Use TypeManager.void_type instead of null
8162         for an empty return value.
8163
8164 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
8165
8166         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
8167         dealing with a FieldExpr which is composed of a FieldBuilder, in
8168         the code path we did extract the constant, but we should have
8169         obtained the underlying value to be able to cast it (otherwise we
8170         end up in an infinite loop, this is what Ravi was running into).
8171
8172         (ArrayCreation.UpdateIndices): Arrays might be empty.
8173
8174         (MemberAccess.ResolveMemberAccess): Add support for section
8175         14.5.4.1 that deals with the special case of E.I when E is a type
8176         and something else, that I can be a reference to a static member.
8177
8178         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
8179         handle a particular array type to create byte blobs, it is just
8180         something we dont generate byteblobs for.
8181
8182         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
8183         arguments. 
8184
8185         * location.cs (Push): remove the key from the hashtable that we
8186         are about to add.   This happens for empty files.
8187
8188         * driver.cs: Dispose files after we have parsed them.
8189
8190         (tokenize): new function that only runs the tokenizer on its
8191         input, for speed testing.
8192
8193 2001-12-26  Ravi Pratap  <ravi@ximian.com>
8194
8195         * class.cs (Event.Define): Define the private field only if there
8196         are no accessors defined.
8197
8198         * expression.cs (ResolveMemberAccess): If there is no associated
8199         field with the event, that means we have an event defined with its
8200         own accessors and we should flag error cs0070 since transforming
8201         ourselves into a field is not valid in that case.
8202
8203         * ecore.cs (SimpleName.DoResolve): Same as above.
8204
8205         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
8206         and charset to sane values.
8207
8208 2001-12-25  Ravi Pratap  <ravi@ximian.com>
8209
8210         * assign.cs (DoResolve): Perform check on events only if they 
8211         are being accessed outside the declaring type.
8212
8213         * cs-parser.jay (event_declarations): Update rules to correctly
8214         set the type of the implicit parameter etc.
8215
8216         (add_accessor, remove_accessor): Set current local parameters.
8217
8218         * expression.cs (Binary): For delegate addition and subtraction,
8219         cast the return value from the method into the appropriate delegate
8220         type.
8221
8222 2001-12-24  Ravi Pratap  <ravi@ximian.com>
8223
8224         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
8225         of these as the workaround is unnecessary.
8226
8227         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
8228         delegate data - none of that is needed at all.
8229
8230         Re-write bits to extract the instance expression and the delegate method
8231         correctly.
8232
8233         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
8234         on delegates too.
8235
8236         * attribute.cs (ApplyAttributes): New method to take care of common tasks
8237         of attaching attributes instead of duplicating code everywhere.
8238
8239         * everywhere : Update code to do attribute emission using the above method.
8240
8241 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8242
8243         * expression.cs (IsParamsMethodApplicable): if there are not
8244         parameters, return immediately.
8245
8246         * ecore.cs: The 0 literal can be implicity converted to an enum
8247         type. 
8248
8249         (SimpleName.DoResolve): First lookup the type, then lookup the
8250         members. 
8251
8252         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
8253         want to get its address.  If the InstanceExpression is not
8254         addressable, store the result in a temporary variable, then get
8255         the address of it.
8256
8257         * codegen.cs: Only display 219 errors on warning level or above. 
8258
8259         * expression.cs (ArrayAccess): Make it implement the
8260         IMemoryLocation interface.
8261
8262         (Binary.DoResolve): handle the operator == (object a, object b)
8263         and operator != (object a, object b) without incurring into a
8264         BoxedCast (because 5 != o should never be performed).
8265
8266         Handle binary enumerator operators.
8267
8268         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
8269         value type, otherwise use Ldelem_ref.
8270
8271         Use precomputed names;
8272
8273         (AddressOf): Implement address of
8274
8275         * cs-parser.jay (labeled_statement): Fix recursive block
8276         addition by reworking the production.
8277
8278         * expression.cs (New.DoEmit): New has a special case:
8279                 
8280                  If we are dealing with a ValueType, we have a few
8281                  situations to deal with:
8282                 
8283                     * The target of New is a ValueType variable, that is
8284                       easy, we just pass this as the variable reference
8285                 
8286                     * The target of New is being passed as an argument,
8287                       to a boxing operation or a function that takes a
8288                       ValueType.
8289                 
8290                       In this case, we need to create a temporary variable
8291                       that is the argument of New.
8292
8293
8294 2001-12-23  Ravi Pratap  <ravi@ximian.com>
8295
8296         * rootcontext.cs (LookupType): Check that current_type is not null before
8297         going about looking at nested types.
8298
8299         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
8300         not implement the IAssignMethod interface any more.
8301
8302         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
8303         where we tranform them into FieldExprs if they are being resolved from within
8304         the declaring type.
8305
8306         * ecore.cs (SimpleName.DoResolve): Do the same here.
8307
8308         * assign.cs (DoResolve, Emit): Clean up code considerably. 
8309
8310         * ../errors/bug10.cs : Add.
8311
8312         * ../errors/cs0070.cs : Add.
8313
8314         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
8315
8316         * assign.cs : Get rid of EventIsLocal everywhere.
8317         
8318 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
8319
8320         * ecore.cs (ConvertIntLiteral): finished the implementation.
8321
8322         * statement.cs (SwitchLabel): Convert the value we are using as a
8323         key before looking up the table.
8324
8325 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8326
8327         * codegen.cs (EmitTopBlock): Require a Location argument now.
8328
8329         * cs-parser.jay (constructor_declarator): We need to setup
8330         current_local_parameters before we parse the
8331         opt_constructor_initializer, to allow the variables to be bound
8332         to the constructor arguments.
8333
8334         * rootcontext.cs (LookupType): First lookup nested classes in our
8335         class and our parents before we go looking outside our class.
8336
8337         * expression.cs (ConstantFold): Extract/debox the values at the
8338         beginnning. 
8339
8340         * rootcontext.cs (EmitCode): Resolve the constants first before we
8341         resolve the types.  This is not really needed, but it helps debugging.
8342
8343         * statement.cs: report location.
8344         
8345         * cs-parser.jay: pass location to throw statement.
8346
8347         * driver.cs: Small bug fix.
8348
8349         * report.cs: Updated format to be 4-zero filled digits.
8350
8351 2001-12-22  Ravi Pratap  <ravi@ximian.com>
8352
8353         * expression.cs (CheckIndices): Fix minor bug where the wrong
8354         variable was being referred to ;-)
8355
8356         (DoEmit): Do not call EmitStaticInitializers when the 
8357         underlying type is System.Object.
8358
8359 2001-12-21  Ravi Pratap  <ravi@ximian.com>
8360
8361         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
8362         and do the usual workaround for SRE.
8363
8364         * class.cs (MyEventBuilder.EventType): New member to get at the type
8365         of the event, quickly.
8366
8367         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
8368
8369         * assign.cs (Assign.DoResolve): Handle the case when the target
8370         is an EventExpr and perform the necessary checks.
8371
8372         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
8373         interface.
8374
8375         (SimpleName.MemberStaticCheck): Include check for EventExpr.
8376
8377         (EventExpr): Set the type in the constructor itself since we 
8378         are meant to be born fully resolved.
8379
8380         (EventExpr.Define): Revert code I wrote earlier.
8381                 
8382         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
8383         instance expression is null. The instance expression is a This in that case
8384         or a null, depending on whether it is a static method or not.
8385
8386         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
8387         refers to more than one method.
8388
8389         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
8390         and accordingly flag errors.
8391
8392 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8393
8394         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
8395
8396 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
8397
8398         * location.cs (ToString): Provide useful rutine.
8399
8400 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
8401
8402         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
8403         objects, return the actual integral boxed.
8404
8405         * statement.cs (SwitchLabel): define an ILLabel for each
8406         SwitchLabel. 
8407         
8408         (Switch.CheckSwitch): If the value is a Literal, extract
8409         the underlying literal.
8410         
8411         Also in the unused hashtable we had, add the SwitchLabel so we can
8412         quickly look this value up.
8413
8414         * constant.cs: Implement a bunch of new constants.  Rewrite
8415         Literal based on this.  Made changes everywhere to adapt to this.
8416         
8417         * expression.cs (Expression.MakeByteBlob): Optimize routine by
8418         dereferencing array only once, and also copes with enumrations.
8419
8420         bytes are two bytes wide, not one.
8421
8422         (Cast): Perform constant conversions.
8423         
8424         * ecore.cs (TryImplicitIntConversion): Return literals instead of
8425         wrappers to the literals here.
8426
8427         * expression.cs (DoNumericPromotions): long literals can converted
8428         to ulong implicity (this is taken care of elsewhere, but I was
8429         missing this spot).
8430
8431         * ecore.cs (Expression.Literalize): Make the return type Literal,
8432         to improve type checking.
8433
8434         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
8435
8436 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8437
8438         * literal.cs: Revert code from ravi that checked the bounds.  The
8439         bounds are sane by the definition of the type itself. 
8440
8441         * typemanager.cs: Fix implementation of ImplementsInterface.  We
8442         need to actually look up in our parent hierarchy for interfaces
8443         implemented. 
8444
8445         * const.cs: Use the underlying type for enumerations
8446
8447         * delegate.cs: Compute the basename for the delegate creation,
8448         that should fix the delegate test case, and restore the correct
8449         Type Lookup semantics in rootcontext
8450
8451         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
8452         referencing a nested type with the Reflection API is using the "+"
8453         sign. 
8454
8455         * cs-parser.jay: Do not require EOF token at the end.
8456
8457 2001-12-20  Ravi Pratap  <ravi@ximian.com>
8458
8459         * rootcontext.cs (LookupType): Concatenate type names with
8460         a '.' instead of a '+' The test suite passes again.
8461
8462         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
8463         field of the enumeration.
8464
8465         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
8466         the case when the member is an EventExpr.
8467
8468         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
8469         static has an associated instance expression.
8470
8471         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
8472
8473         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
8474
8475         * class.cs (Event.Define): Register event and perform appropriate checks
8476         for error #111.
8477
8478         We define the Add and Remove methods even if the use provides none because
8479         in that case, we provide default implementations ourselves.
8480
8481         Define a private field of the type of the event. This is done by the CSC compiler
8482         and we should be doing it too ;-)
8483
8484         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
8485         More methods we use in code we generate.
8486
8487         (multicast_delegate_type, delegate_type): Two separate types since the distinction
8488         is important.
8489
8490         (InitCoreTypes): Update accordingly for the above.
8491
8492         * class.cs (Event.Emit): Generate code for default accessors that we provide
8493
8494         (EmitDefaultMethod): Do the job in the above.
8495
8496         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
8497         appropriate place.
8498
8499 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
8500
8501         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
8502         builders even if we were missing one.
8503
8504         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
8505         pass the Basename as our class name instead of the Name.  The
8506         basename will be correctly composed for us.
8507
8508         * parameter.cs (Paramters): Now takes a Location argument.
8509
8510         * decl.cs (DeclSpace.LookupType): Removed convenience function and
8511         make all the code call directly LookupType in RootContext and take
8512         this chance to pass the Location information everywhere.
8513
8514         * Everywhere: pass Location information.
8515
8516 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
8517
8518         * class.cs (Constructor.Define): Updated way of detecting the
8519         length of the parameters.
8520
8521         (TypeContainer.DefineType): Use basename as the type name for
8522         nested types.
8523
8524         (TypeContainer.Define): Do not recursively define types here, as
8525         definition is taken care in order by the RootContext.
8526
8527         * tree.cs: Keep track of namespaces in a per-file basis.
8528
8529         * parameter.cs (Parameter.ComputeSignature): Update to use
8530         DeclSpace. 
8531
8532         (Parameters.GetSignature): ditto.
8533
8534         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
8535         instead of a TypeContainer.
8536
8537         (Interface.SemanticAnalysis): Use `this' instead of our parent to
8538         resolve names.  Because we need to be resolve in our context, not
8539         our parents.
8540         
8541         * driver.cs: Implement response files.
8542
8543         * class.cs (TypeContainer.DefineType): If we are defined, do not
8544         redefine ourselves.
8545         
8546         (Event.Emit): Emit the code for add/remove handlers.
8547         (Event.Define): Save the MethodBuilders for add/remove.
8548
8549         * typemanager.cs: Use pair here too.
8550
8551         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
8552         DictionaryEntry requires the first argument to be non-null.  
8553         
8554         (enum_declaration): Compute full name for registering the
8555         enumeration.
8556         
8557         (delegate_declaration): Instead of using
8558         formal_parameter_list, use opt_formal_parameter_list as the list
8559         can be empty.
8560
8561         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
8562         (EventParsing): New property that controls whether `add' and
8563         `remove' are returned as tokens or identifiers (for events);
8564
8565 2001-12-19  Ravi Pratap  <ravi@ximian.com>
8566
8567         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
8568         use MyEventBuilder only and let it wrap the real builder for us.
8569
8570         (MyEventBuilder): Revamp constructor etc.
8571
8572         Implement all operations that we perform on EventBuilder in precisely the same
8573         way here too.
8574
8575         (FindMembers): Update to use the EventBuilder member.
8576
8577         (Event.Emit): Update accordingly.
8578
8579 2001-12-18  Ravi Pratap  <ravi@ximian.com>
8580
8581         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
8582         by calling the appropriate methods.
8583
8584         (GetCustomAttributes): Make stubs as they cannot possibly do anything
8585         useful.
8586
8587         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
8588
8589 2001-12-17  Ravi Pratap  <ravi@ximian.com>
8590
8591         * delegate.cs (Delegate.Populate): Check that the return type
8592         and various parameters types are indeed accessible.
8593
8594         * class.cs (Constructor.Define): Same here.
8595
8596         (Field.Define): Ditto.
8597
8598         (Event.Define): Ditto.
8599
8600         (Operator.Define): Check that the underlying Method defined itself
8601         correctly - so it's MethodBuilder should not be null.
8602
8603         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
8604         expression happens to be null.
8605
8606         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
8607         members but as of now we don't seem to be able to do anything really useful with it.
8608
8609         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
8610         not the EventBuilder.
8611
8612 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
8613
8614         * cs-tokenizer.cs: Add support for defines.
8615         Add support for #if, #elif, #else, #endif
8616         
8617         (eval_var): evaluates a variable.
8618         (eval): stubbed for evaluating functions.
8619
8620         * cs-parser.jay: Pass the defines information
8621
8622         * driver.cs: Add --define command line option.
8623
8624         * decl.cs: Move MemberCore here.
8625
8626         Make it the base class for DeclSpace.  This allows us to catch and
8627         report 108 and 109 for everything now.
8628
8629         * class.cs (TypeContainer.Define): Extract all the members
8630         before populating and emit the warning 108 (new keyword required
8631         to override) instead of having each member implement this.
8632
8633         (MemberCore.Define): New abstract method, we will be using this in
8634         the warning reporting engine in Populate.
8635         
8636         (Operator.Define): Adjust to new MemberCore protocol. 
8637
8638         * const.cs (Const): This does not derive from Expression, it is a
8639         temporary object we use to create fields, it is a MemberCore. 
8640
8641         * class.cs (Method.Define): Allow the entry point to be in a
8642         specific class.
8643
8644         * driver.cs: Rewrite the argument handler to clean it up a bit.
8645
8646         * rootcontext.cs: Made it just an auxiliary namespace feature by
8647         making everything static.
8648
8649         * driver.cs: Adapt code to use RootContext type name instead of
8650         instance variable.
8651
8652         * delegate.cs: Remove RootContext argument.
8653
8654         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
8655         argument. 
8656
8657         * class.cs (Event.Define): The lookup can fail.
8658         
8659         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
8660
8661         * expression.cs: Resolve the this instance before invoking the code.
8662
8663 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
8664
8665         * cs-parser.jay: Add a production in element_access that allows
8666         the thing to become a "type" reference.  This way we can parse
8667         things like "(string [])" as a type.
8668
8669         Note that this still does not handle the more complex rules of
8670         casts. 
8671         
8672
8673         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
8674
8675         * ecore.cs: (CopyNewMethods): new utility function used to
8676         assemble the list of methods from running FindMembers.
8677
8678         (MemberLookup): Rework FindMembers so that 
8679
8680 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
8681
8682         * class.cs (TypeContainer): Remove Delegates who fail to be
8683         defined.
8684
8685         * delegate.cs (Populate): Verify that we dont get null return
8686         values.   TODO: Check for AsAccessible.
8687
8688         * cs-parser.jay: Use basename to emit error 574 (destructor should
8689         have the same name as container class), not the full name.
8690
8691         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
8692         possible representation.  
8693
8694         Also implements integer type suffixes U and L.
8695
8696 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
8697
8698         * expression.cs (ArrayCreation.DoResolve): We need to do the
8699         argument resolution *always*.
8700
8701         * decl.cs: Make this hold the namespace.  Hold the root context as
8702         well.
8703         (LookupType): Move here.
8704
8705         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
8706
8707         * location.cs (Row, Name): Fixed the code, it was always returning
8708         references to the first file.
8709
8710         * interface.cs: Register properties defined through interfaces.
8711
8712         * driver.cs: Add support for globbing on the command line
8713
8714         * class.cs (Field): Make it derive from MemberCore as well.
8715         (Event): ditto.
8716
8717 2001-12-15  Ravi Pratap  <ravi@ximian.com>
8718
8719         * class.cs (Event::Define): Check that the type of the event is a delegate
8720         type else flag error #66.
8721
8722         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
8723         same.
8724
8725         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
8726         values of EntryPoint, CharSet etc etc.
8727
8728         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
8729
8730         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
8731         be null and we should ignore this. I am not sure if this is really clean. Apparently,
8732         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
8733         which needs this to do its work.
8734
8735         * ../errors/cs0066.cs : Add.
8736
8737 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
8738
8739         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
8740         helper functions.
8741
8742         * class.cs: (MethodSignature.MethodSignature): Removed hack that
8743         clears out the parameters field.
8744         (MemberSignatureCompare): Cleanup
8745
8746         (MemberCore): New base class used to share code between MethodCore
8747         and Property.
8748
8749         (RegisterRequiredImplementations) BindingFlags.Public requires
8750         either BindingFlags.Instace or Static.  Use instance here.
8751
8752         (Property): Refactored code to cope better with the full spec.
8753
8754         * parameter.cs (GetParameterInfo): Return an empty array instead
8755         of null on error.
8756
8757         * class.cs (Property): Abstract or extern properties have no bodies.
8758
8759         * parameter.cs (GetParameterInfo): return a zero-sized array.
8760
8761         * class.cs (TypeContainer.MethodModifiersValid): Move all the
8762         method modifier validation to the typecontainer so we can reuse
8763         this on properties.
8764
8765         (MethodCore.ParameterTypes): return an empty sized array of types.
8766
8767         (Property.Define): Test property modifier validity.
8768
8769         Add tests for sealed/override too.
8770
8771         (Method.Emit): abstract or extern methods have no bodies.
8772
8773 2001-12-14  Ravi Pratap  <ravi@ximian.com>
8774
8775         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
8776         thing.
8777
8778         (Method::Define, ::Emit): Modify accordingly.
8779
8780         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
8781
8782         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
8783
8784         * makefile: Pass in /unsafe.
8785
8786 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
8787
8788         * class.cs (MakeKey): Kill routine.
8789         
8790         * class.cs (TypeContainer.Define): Correctly define explicit
8791         method implementations (they require the full interface name plus
8792         the method name).
8793
8794         * typemanager.cs: Deply the PtrHashtable here and stop using the
8795         lame keys.  Things work so much better.
8796
8797         This of course broke everyone who depended on `RegisterMethod' to
8798         do the `test for existance' test.  This has to be done elsewhere.
8799
8800         * support.cs (PtrHashtable): A hashtable that avoid comparing with
8801         the object stupid Equals method (because, that like fails all over
8802         the place).  We still do not use it.
8803
8804         * class.cs (TypeContainer.SetRequiredInterface,
8805         TypeContainer.RequireMethods): Killed these two routines and moved
8806         all the functionality to RegisterRequiredImplementations.
8807
8808         (TypeContainer.RegisterRequiredImplementations): This routine now
8809         registers all the implementations required in an array for the
8810         interfaces and abstract methods.  We use an array of structures
8811         which can be computed ahead of time to reduce memory usage and we
8812         also assume that lookups are cheap as most classes will not
8813         implement too many interfaces.
8814
8815         We also avoid creating too many MethodSignatures.
8816
8817         (TypeContainer.IsInterfaceMethod): Update and optionally does not
8818         clear the "pending" bit if we find that there are problems with
8819         the declaration.
8820
8821         (TypeContainer.VerifyPendingMethods): Update to report errors of
8822         methods that look like implementations but are not.
8823
8824         (TypeContainer.Define): Add support for explicit interface method
8825         implementation. 
8826         
8827 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
8828
8829         * typemanager.cs: Keep track of the parameters here instead of
8830         being a feature of the TypeContainer.
8831
8832         * class.cs: Drop the registration of parameters here, as
8833         InterfaceMethods are also interface declarations.
8834
8835         * delegate.cs: Register methods with the TypeManager not only with
8836         the TypeContainer.  This code was buggy.
8837
8838         * interface.cs: Full registation here.
8839
8840 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
8841
8842         * expression.cs: Remove reducer for binary expressions, it can not
8843         be done this way.
8844
8845         * const.cs: Put here the code that used to go into constant.cs
8846
8847         * constant.cs: Put here the code for constants, this is a new base
8848         class for Literals.
8849
8850         * literal.cs: Make Literal derive from Constant.
8851
8852 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
8853
8854         * statement.cs (Return.Emit): Report error 157 if the user
8855         attempts to return from a finally block.
8856
8857         (Return.Emit): Instead of emitting a return, jump to the end of
8858         the function.
8859
8860         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
8861         LocalBuilder to store the result of the function.  ReturnLabel is
8862         the target where we jump.
8863         
8864
8865 2001-12-09  Radek Doulik  <rodo@ximian.com>
8866
8867         * cs-parser.jay: remember alias in current namespace
8868
8869         * ecore.cs (SimpleName::DoResolve): use aliases for types or
8870         namespaces
8871
8872         * class.cs (LookupAlias): lookup alias in my_namespace
8873
8874         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
8875         aliases hashtable
8876         (LookupAlias): lookup alias in this and if needed in parent
8877         namespaces
8878
8879 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
8880
8881         * support.cs: 
8882
8883         * rootcontext.cs: (ModuleBuilder) Made static, first step into
8884         making things static.  I need this to avoid passing the
8885         TypeContainer when calling ParameterType.
8886
8887         * support.cs (InternalParameters.ParameterType): Remove ugly hack
8888         that did string manipulation to compute the type and then call
8889         GetType.  Use Parameter.ParameterType instead.
8890
8891         * cs-tokenizer.cs: Consume the suffix for floating values.
8892
8893         * expression.cs (ParameterReference): figure out whether this is a
8894         reference parameter or not.  Kill an extra variable by computing
8895         the arg_idx during emission.
8896
8897         * parameter.cs (Parameters.GetParameterInfo): New overloaded
8898         function that returns whether a parameter is an out/ref value or not.
8899
8900         (Parameter.ParameterType): The type of the parameter (base,
8901         without ref/out applied).
8902         
8903         (Parameter.Resolve): Perform resolution here.
8904         (Parameter.ExternalType): The full type (with ref/out applied).
8905
8906         * statement.cs (Using.Emit, Using.EmitExpression): Implement
8907         support for expressions on the using statement.
8908
8909 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
8910
8911         * statement.cs (Using.EmitLocalVariableDecls): Split the
8912         localvariable handling of the using statement.
8913
8914         (Block.EmitMeta): Keep track of variable count across blocks.  We
8915         were reusing slots on separate branches of blocks.
8916
8917         (Try.Emit): Emit the general code block, we were not emitting it. 
8918
8919         Check the type of the declaration to be an IDisposable or
8920         something that can be implicity converted to it. 
8921
8922         Emit conversions if required.
8923
8924         * ecore.cs (EmptyExpression): New utility class.
8925         (Expression.ImplicitConversionExists): New utility function.
8926
8927 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
8928
8929         * statement.cs (Using): Implement.
8930
8931         * expression.cs (LocalVariableReference): Support read only variables.
8932
8933         * statement.cs: Remove the explicit emit for the Leave opcode.
8934         (VariableInfo): Add a readonly field.
8935
8936 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
8937
8938         * ecore.cs (ConvCast): new class used to encapsulate the various
8939         explicit integer conversions that works in both checked and
8940         unchecked contexts.
8941
8942         (Expression.ConvertNumericExplicit): Use new ConvCast class to
8943         properly generate the overflow opcodes.
8944
8945 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8946
8947         * statement.cs: The correct type for the EmptyExpression is the
8948         element_type, not the variable type.  Ravi pointed this out.
8949
8950 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8951
8952         * class.cs (Method::Define): Handle PInvoke methods specially
8953         by using DefinePInvokeMethod instead of the usual one.
8954
8955         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
8956         above to do the task of extracting information and defining the method.
8957         
8958 2001-12-04  Ravi Pratap  <ravi@ximian.com>
8959
8960         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
8961         of the condition for string type.
8962
8963         (Emit): Move that here. 
8964
8965         (ArrayCreation::CheckIndices): Keep string literals in their expression
8966         form.
8967
8968         (EmitDynamicInitializers): Handle strings appropriately.
8969
8970 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
8971
8972         * codegen.cs (EmitContext): Replace multiple variables with a
8973         single pointer to the current Switch statement.
8974
8975         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
8976         EmitContext.
8977
8978 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
8979
8980         * statement.cs 
8981
8982         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
8983         default'.
8984         
8985         (Foreach.Emit): Foreach on arrays was not setting
8986         up the loop variables (for break/continue).
8987
8988         (GotoCase): Semi-implented.
8989         
8990 2001-12-03  Ravi Pratap  <ravi@ximian.com>
8991
8992         * attribute.cs (CheckAttribute): Handle system attributes by using
8993         Attribute.GetAttributes to examine information we need.
8994
8995         (GetValidPlaces): Same here.
8996
8997         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
8998
8999         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
9000
9001         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
9002
9003         (Method::Define): Set appropriate flags if we have a DllImport attribute.
9004
9005         (Method::Emit): Handle the case when we are a PInvoke method.
9006
9007 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
9008
9009         * expression.cs: Use ResolveWithSimpleName on compound names.
9010
9011 2001-12-02  Ravi Pratap  <ravi@ximian.com>
9012
9013         * constant.cs (EmitConstant): Make sure we resolve the associated expression
9014         before trying to reduce it.
9015
9016         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
9017
9018         * constant.cs (LookupConstantValue): Implement.
9019
9020         (EmitConstant): Use the above in emitting the constant.
9021
9022         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
9023         that are user-defined by doing a LookupConstantValue on them.
9024
9025         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
9026         too, like above.
9027
9028 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
9029
9030         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
9031
9032         (BaseAccess.DoResolve): Implement.
9033
9034         (MemberAccess.DoResolve): Split this routine into a
9035         ResolveMemberAccess routine that can be used independently
9036
9037 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
9038
9039         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
9040         As that share bits of the implementation.  Is returns a boolean,
9041         while As returns the Type that is being probed.
9042
9043 2001-12-01  Ravi Pratap  <ravi@ximian.com>
9044
9045         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
9046         instead of a Literal - much easier.
9047
9048         (EnumInTransit): Remove - utterly useless :-)
9049
9050         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
9051
9052         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
9053
9054         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
9055         chain when we have no associated expression.
9056
9057 2001-11-30  Ravi Pratap  <ravi@ximian.com>
9058
9059         * constant.cs (Define): Use Location while reporting the errror.
9060
9061         Also emit a warning when 'new' is used and there is no inherited
9062         member to hide.
9063
9064         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
9065         populated.
9066
9067         (LookupEnumValue): Implement to lookup an enum member's value and define it
9068         if necessary.
9069
9070         (Populate): Re-write accordingly to use the above routine.
9071
9072 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
9073
9074         * expression.cs (This): Fix prototype for DoResolveLValue to
9075         override the base class DoResolveLValue.
9076
9077         * cs-parser.cs: Report errors cs574 and cs575 (destructor
9078         declarations) 
9079
9080         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
9081         (we need to load the address of the field here).  This fixes
9082         test-22. 
9083         
9084         (FieldExpr.DoResolveLValue): Call the DoResolve
9085         function to initialize the Instance expression.
9086         
9087         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
9088         correctly the GetEnumerator operation on a value type.
9089
9090         * cs-parser.jay: Add more simple parsing error catches.
9091
9092         * statement.cs (Switch): Add support for string switches.
9093         Handle null specially.
9094
9095         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
9096
9097 2001-11-28  Ravi Pratap  <ravi@ximian.com>
9098
9099         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
9100
9101         (declare_local_constant): New helper function.
9102
9103         * statement.cs (AddConstant): Keep a separate record of constants
9104
9105         (IsConstant): Implement to determine if a variable is a constant.
9106
9107         (GetConstantExpression): Implement.
9108
9109         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
9110
9111         * statement.cs (IsVariableDefined): Re-write.
9112
9113 2001-11-27  Ravi Pratap  <ravi@ximian.com>
9114
9115         * class.cs (TypeContainer::FindMembers): Look for constants
9116         in the case when we are looking for MemberTypes.Field
9117
9118         * expression.cs (MemberAccess::DoResolve): Check that in the
9119         case we are a FieldExpr and a Literal, we are not being accessed
9120         by an instance reference.
9121
9122         * cs-parser.jay (local_constant_declaration): Implement.
9123
9124         (declaration_statement): Implement for constant declarations.
9125
9126 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
9127
9128         * statement.cs (Switch): Catch double defaults.
9129
9130         (Switch): More work on the switch() statement
9131         implementation.  It works for integral values now, need to finish
9132         string support.
9133
9134
9135 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9136
9137         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
9138         integer literals into other integer literals.  To be used by
9139         switch. 
9140
9141 2001-11-24  Ravi Pratap  <ravi@ximian.com>
9142
9143         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
9144         some memory.
9145
9146         (EmitDynamicInitializers): Cope with the above since we extract data
9147         directly from ArrayData now.
9148
9149         (ExpectInitializers): Keep track of whether initializers are mandatory
9150         or not.
9151
9152         (Bounds): Make it a hashtable to prevent the same dimension being 
9153         recorded for every element in that dimension.
9154
9155         (EmitDynamicInitializers): Fix bug which prevented the Set array method
9156         from being found.
9157
9158         Also fix bug which was causing the indices to be emitted in the reverse
9159         order.
9160
9161 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
9162
9163         * expression.cs (ArrayCreation): Implement the bits that Ravi left
9164         unfinished.  They do not work, because the underlying code is
9165         sloppy.
9166
9167 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9168
9169         * cs-parser.jay: Remove bogus fixme.
9170
9171         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
9172         on Switch statement.
9173         
9174 2001-11-23  Ravi Pratap  <ravi@ximian.com>
9175
9176         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
9177         the same. 
9178         
9179         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
9180         parameter. Apparently, any expression is allowed. 
9181
9182         (ValidateInitializers): Update accordingly.
9183
9184         (CheckIndices): Fix some tricky bugs thanks to recursion.
9185
9186         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
9187         I was being completely brain-dead.
9188
9189         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
9190         and re-write acordingly.
9191
9192         (DelegateInvocation): Re-write accordingly.
9193
9194         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
9195
9196         (MakeByteBlob): Handle types more correctly.
9197
9198         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
9199         initialization from expressions but it is incomplete because I am a complete
9200         Dodo :-|
9201
9202 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9203
9204         * statement.cs (If.Emit): Fix a bug that generated incorrect code
9205         on If.  Basically, we have to return `true' (ie, we do return to
9206         our caller) only if both branches of the if return.
9207
9208         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
9209         short-circuit operators, handle them as short circuit operators. 
9210
9211         (Cast.DoResolve): Resolve type.
9212         (Cast.Cast): Take an expression as the target type.
9213
9214         * cs-parser.jay (cast_expression): Remove old hack that only
9215         allowed a limited set of types to be handled.  Now we take a
9216         unary_expression and we resolve to a type during semantic
9217         analysis.
9218
9219         Use the grammar productions from Rhys to handle casts (this is
9220         not complete like Rhys syntax yet, we fail to handle that corner
9221         case that C# has regarding (-x), but we will get there.
9222         
9223 2001-11-22  Ravi Pratap  <ravi@ximian.com>
9224
9225         * class.cs (EmitFieldInitializer): Take care of the case when we have a
9226         field which is an array type.
9227
9228         * cs-parser.jay (declare_local_variables): Support array initialization too.
9229
9230         * typemanager.cs (MakeKey): Implement.
9231
9232         (everywhere): Use the above appropriately.
9233
9234         * cs-parser.jay (for_statement): Update for array initialization while
9235         declaring variables.
9236
9237         * ecore.cs : The error message was correct, it's the variable's names that
9238         were misleading ;-) Make the code more readable.
9239
9240         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
9241         the correct type etc.
9242
9243         (ConvertExplicit): Handle Enum types by examining the underlying type.
9244
9245 2001-11-21  Ravi Pratap  <ravi@ximian.com>
9246
9247         * parameter.cs (GetCallingConvention): Always return
9248         CallingConventions.Standard for now.
9249
9250 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
9251
9252         * expression.cs (Binary.ResolveOperator): Update the values of `l'
9253         and `r' after calling DoNumericPromotions.
9254
9255         * ecore.cs: Fix error message (the types were in the wrong order).
9256
9257         * statement.cs (Foreach.ProbeCollectionType): Need to pass
9258         BindingFlags.Instance as well 
9259
9260         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
9261         implicit int literal conversion in an empty cast so that we
9262         propagate the right type upstream.
9263
9264         (UnboxCast): new class used to unbox value types.
9265         (Expression.ConvertExplicit): Add explicit type conversions done
9266         by unboxing.
9267
9268         (Expression.ImplicitNumericConversion): Oops, forgot to test for
9269         the target type before applying the implicit LongLiterals to ULong
9270         literal cast.
9271
9272 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
9273
9274         * cs-parser.jay (for_statement): Reworked the way For works: now
9275         we declare manually any variables that are introduced in
9276         for_initializer to solve the problem of having out-of-band code
9277         emition (that is what got for broken).
9278
9279         (declaration_statement): Perform the actual variable declaration
9280         that used to be done in local_variable_declaration here.
9281
9282         (local_variable_declaration): Do not declare anything, just pass
9283         the information on a DictionaryEntry
9284
9285 2001-11-20  Ravi Pratap  <ravi@ximian.com>
9286
9287         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
9288         re-write of the logic to now make it recursive.
9289
9290         (UpdateIndices): Re-write accordingly.
9291
9292         Store element data in a separate ArrayData list in the above methods.
9293
9294         (MakeByteBlob): Implement to dump the array data into a byte array.
9295
9296 2001-11-19  Ravi Pratap  <ravi@ximian.com>
9297
9298         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
9299         into CheckIndices.
9300
9301         * constant.cs (Define): Implement.
9302
9303         (EmitConstant): Re-write fully.
9304
9305         Pass in location info.
9306
9307         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
9308         respectively.
9309
9310         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
9311         DictionaryEntry since we need location info too.
9312
9313         (constant_declaration): Update accordingly.
9314
9315         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
9316         code into another method : UpdateIndices.
9317
9318 2001-11-18  Ravi Pratap  <ravi@ximian.com>
9319
9320         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
9321         some type checking etc.
9322
9323 2001-11-17  Ravi Pratap  <ravi@ximian.com>
9324
9325         * expression.cs (ArrayCreation::ValidateInitializers): Implement
9326         bits to provide dimension info if the user skips doing that.
9327
9328         Update second constructor to store the rank correctly.
9329
9330 2001-11-16  Ravi Pratap  <ravi@ximian.com>
9331
9332         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
9333         and try to implement.
9334
9335         * ../errors/cs0150.cs : Add.
9336
9337         * ../errors/cs0178.cs : Add.
9338
9339 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
9340
9341         * statement.cs: Implement foreach on multi-dimensional arrays. 
9342
9343         * parameter.cs (Parameters.GetParameterByName): Also lookup the
9344         name of the params argument.
9345
9346         * expression.cs: Use EmitStoreOpcode to get the right opcode while
9347         initializing the array.
9348
9349         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
9350         we can use this elsewhere.
9351
9352         * statement.cs: Finish implementation of foreach for single
9353         dimension arrays.
9354
9355         * cs-parser.jay: Use an out-of-band stack to pass information
9356         around, I wonder why I need this.
9357
9358         foreach_block: Make the new foreach_block the current_block.
9359
9360         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
9361         function used to return a static Parameters structure.  Used for
9362         empty parameters, as those are created very frequently.
9363
9364         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
9365
9366 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9367
9368         * interface.cs : Default modifier is private, not public. The
9369         make verify test passes again.
9370
9371 2001-11-15  Ravi Pratap  <ravi@ximian.com>
9372
9373         * support.cs (ReflectionParameters): Fix logic to determine
9374         whether the last parameter is a params one. Test 9 passes again.
9375
9376         * delegate.cs (Populate): Register the builders we define with
9377         RegisterParameterForBuilder. Test 19 passes again.
9378
9379         * cs-parser.jay (property_declaration): Reference $6 instead
9380         of $$ to get at the location.
9381
9382         (indexer_declaration): Similar stuff.
9383
9384         (attribute): Ditto.
9385
9386         * class.cs (Property): Register parameters for the Get and Set methods
9387         if they exist. Test 23 passes again.
9388
9389         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
9390         call to EmitArguments as we are sure there aren't any params arguments. 
9391         Test 32 passes again.
9392
9393         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
9394         IndexOutOfRangeException. 
9395
9396         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
9397         Test 33 now passes again.
9398         
9399 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
9400
9401         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
9402         broke a bunch of things.  Will have to come up with a better way
9403         of tracking locations.
9404
9405         * statement.cs: Implemented foreach for single dimension arrays.
9406
9407 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9408
9409         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
9410         an error.  This removes the lookup from the critical path.
9411
9412         * cs-parser.jay: Removed use of temporary_loc, which is completely
9413         broken. 
9414
9415 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
9416
9417         * support.cs (ReflectionParameters.ParameterModifier): Report
9418         whether the argument is a PARAMS argument or not.
9419
9420         * class.cs: Set the attribute `ParamArrayAttribute' on the
9421         parameter argument.
9422
9423         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
9424         and cons_param_array_attribute (ConstructorInfo for
9425         ParamArrayAttribute)., 
9426
9427         * codegen.cs: Emit the return using the `Return' statement, that
9428         way we can report the error correctly for missing return values. 
9429
9430         * class.cs (Method.Emit): Clean up.
9431
9432         * expression.cs (Argument.Resolve): Take another argument: the
9433         location where this argument is used.  Notice that this is not
9434         part of the "Argument" class as to reduce the size of the
9435         structure (we know the approximate location anyways).
9436
9437         Test if the argument is a variable-reference, if not, then
9438         complain with a 206.
9439
9440         (Argument.Emit): Emit addresses of variables.
9441
9442         (Argument.FullDesc): Simplify.
9443
9444         (Invocation.DoResolve): Update for Argument.Resolve.
9445
9446         (ElementAccess.DoResolve): ditto.
9447
9448         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
9449         method should be virtual, as this method is always virtual.
9450
9451         (NewDelegate.DoResolve): Update for Argument.Resolve.
9452
9453         * class.cs (ConstructorInitializer.DoResolve): ditto.
9454         
9455         * attribute.cs (Attribute.Resolve): ditto.
9456
9457 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
9458
9459         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
9460
9461         * expression.cs (ParameterReference): Drop IStackStorage and implement
9462         IAssignMethod instead. 
9463
9464         (LocalVariableReference): ditto.
9465         
9466         * ecore.cs (FieldExpr): Drop IStackStorage and implement
9467         IAssignMethod instead. 
9468
9469 2001-11-13  Miguel de Icaza <miguel@ximian.com>
9470
9471         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
9472         enumerations that are used in heavily used structures derive from
9473         byte in a laughable and pathetic attempt to reduce memory usage.
9474         This is the kind of pre-optimzations that you should not do at
9475         home without adult supervision.
9476
9477         * expression.cs (UnaryMutator): New class, used to handle ++ and
9478         -- separatedly from the other unary operators.  Cleans up the
9479         code, and kills the ExpressionStatement dependency in Unary.
9480
9481         (Unary): Removed `method' and `Arguments' from this class, making
9482         it smaller, and moving it all to SimpleCall, so I can reuse this
9483         code in other locations and avoid creating a lot of transient data
9484         strucutres when not required.
9485
9486         * cs-parser.jay: Adjust for new changes.
9487
9488 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
9489
9490         * enum.cs (Enum.Populate): If there is a failure during
9491         definition, return
9492
9493         * cs-parser.jay (opt_enum_base): we used to catch type errors
9494         here, but this is really incorrect.  The type error should be
9495         catched during semantic analysis.
9496
9497 2001-12-11  Ravi Pratap  <ravi@ximian.com>
9498
9499         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
9500         current_local_parameters as expected since I, in my stupidity, had forgotten
9501         to do this :-)
9502
9503         * attribute.cs (GetValidPlaces): Fix stupid bug.
9504
9505         * class.cs (Method::Emit): Perform check on applicability of attributes.
9506
9507         (Constructor::Emit): Ditto.
9508
9509         (Field::Emit): Ditto.
9510
9511         (Field.Location): Store location information.
9512
9513         (Property, Event, Indexer, Operator): Ditto.
9514
9515         * cs-parser.jay (field_declaration): Pass in location for each field.
9516
9517         * ../errors/cs0592.cs : Add.
9518
9519 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9520
9521         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
9522
9523         (InitCoreTypes): Update accordingly.
9524
9525         (RegisterAttrType, LookupAttr): Implement.
9526
9527         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
9528         info about the same.
9529
9530         (Resolve): Update to populate the above as necessary.
9531
9532         (Error592): Helper.
9533
9534         (GetValidPlaces): Helper to the above.
9535
9536         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
9537
9538         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
9539
9540 2001-11-12  Ravi Pratap  <ravi@ximian.com>
9541
9542         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
9543
9544         * ../errors/cs0617.cs : Add.
9545
9546 2001-11-11  Ravi Pratap  <ravi@ximian.com>
9547
9548         * enum.cs (Emit): Rename to Populate to be more consistent with what
9549         we expect it to do and when exactly it is called.
9550
9551         * class.cs, rootcontext.cs : Update accordingly.
9552
9553         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
9554         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
9555
9556         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
9557
9558         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
9559         of a fieldinfo using the above, when dealing with a FieldBuilder.
9560
9561 2001-11-10  Ravi Pratap  <ravi@ximian.com>
9562
9563         * ../errors/cs0031.cs : Add.
9564
9565         * ../errors/cs1008.cs : Add.
9566
9567         * ../errrors/cs0543.cs : Add.
9568
9569         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
9570         enum type.
9571
9572         (FindMembers): Implement.
9573
9574         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
9575         enums and delegates too.
9576
9577         (enum_types): Rename to builder_to_enum.
9578
9579         (delegate_types): Rename to builder_to_delegate.
9580
9581         * delegate.cs (FindMembers): Implement.
9582
9583 2001-11-09  Ravi Pratap  <ravi@ximian.com>
9584
9585         * typemanager.cs (IsEnumType): Implement.
9586
9587         * enum.cs (Emit): Re-write parts to account for the underlying type
9588         better and perform checking etc.
9589
9590         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
9591         of the underlying type.
9592
9593         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
9594         value
9595
9596         * enum.cs (error31): Helper to report error #31.
9597
9598         * cs-parser.jay (enum_declaration): Store location of each member too.
9599
9600         * enum.cs (member_to_location): New hashtable. 
9601
9602         (AddEnumMember): Update location hashtable.
9603
9604         (Emit): Use the location of each member while reporting errors.
9605
9606 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
9607
9608         * cs-parser.jay: A for_initializer if is a
9609         local_variable_declaration really ammount to have an implicit
9610         block with the variable declaration and no initializer for for.
9611
9612         * statement.cs (For.Emit): Cope with null initializers.
9613
9614         This fixes the infinite loop on for initializers.
9615
9616 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
9617
9618         * enum.cs: More cleanup.
9619
9620         * ecore.cs: Remove dead code.
9621
9622         * class.cs (Property.Emit): More simplification.
9623         (Event.Emit): ditto.
9624
9625         Reworked to have less levels of indentation.
9626         
9627 2001-11-08  Ravi Pratap  <ravi@ximian.com>
9628
9629         * class.cs (Property): Emit attributes.
9630
9631         (Field): Ditto.
9632         
9633         (Event): Ditto.
9634
9635         (Indexer): Ditto.
9636
9637         (Operator): Ditto.
9638
9639         * enum.cs (Emit): Ditto.
9640
9641         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
9642         Enums too.
9643
9644         * class.cs (Field, Event, etc.): Move attribute generation into the
9645         Emit method everywhere.
9646
9647         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
9648         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
9649         as we had no way of defining nested enums !
9650
9651         * rootcontext.cs : Adjust code accordingly.
9652
9653         * typemanager.cs (AddEnumType): To keep track of enum types separately.
9654
9655 2001-11-07  Ravi Pratap  <ravi@ximian.com>
9656
9657         * expression.cs (EvalConstantExpression): Move into ecore.cs
9658         
9659         * enum.cs (Enum): Rename some members and make them public and readonly
9660         according to our convention.
9661
9662         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
9663         nothing else.
9664
9665         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
9666
9667         (Enum::Emit): Write a simple version for now which doesn't try to compute
9668         expressions. I shall modify this to be more robust in just a while.
9669
9670         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
9671
9672         (TypeContainer::CloseType): Create the Enum types too.
9673
9674         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
9675
9676         * expression.cs (EvalConstantExpression): Get rid of completely.
9677
9678         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
9679         user-defined values and other cases.
9680
9681         (IsValidEnumLiteral): Helper function.
9682
9683         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
9684         out there in the case we had a literal FieldExpr.
9685
9686         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
9687
9688         (Literalize): Revamp a bit to take two arguments.
9689         
9690         (EnumLiteral): New class which derives from Literal to wrap enum literals.
9691         
9692 2001-11-06  Ravi Pratap  <ravi@ximian.com>
9693
9694         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
9695
9696         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
9697
9698         (Resolve): Use the above to ensure we have proper initializers.
9699
9700 2001-11-05  Ravi Pratap  <ravi@ximian.com>
9701
9702         * expression.cs (Expression::EvalConstantExpression): New method to 
9703         evaluate constant expressions.
9704
9705         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
9706
9707 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
9708
9709         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
9710         in an array.
9711
9712         (Binary.ResolveOperator): Handle operator != (object a, object b)
9713         and operator == (object a, object b);
9714
9715         (Binary.DoNumericPromotions): Indicate whether the numeric
9716         promotion was possible.
9717
9718         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
9719         Implement.  
9720
9721         Made the ArrayAccess implement interface IAssignMethod instead of
9722         IStackStore as the order in which arguments are passed reflects
9723         this.
9724
9725         * assign.cs: Instead of using expr.ExprClass to select the way of
9726         assinging, probe for the IStackStore/IAssignMethod interfaces.
9727
9728         * typemanager.cs: Load InitializeArray definition.
9729
9730         * rootcontext.cs (RootContext.MakeStaticData): Used to define
9731         static data that can be used to initialize arrays. 
9732
9733 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
9734
9735         * expression.cs: Handle operator== and operator!= for booleans.
9736
9737         (Conditioal.Reduce): Implement reducer for the ?: operator.
9738
9739         (Conditional.Resolve): Implement dead code elimination.
9740
9741         (Binary.Resolve): Catch string literals and return a new
9742         concatenated string.
9743
9744         (Unary.Reduce): Implement reduction of unary expressions.
9745
9746         * ecore.cs: Split out the expression core handling here.
9747
9748         (Expression.Reduce): New method used to perform constant folding
9749         and CSE.  This is needed to support constant-expressions. 
9750         
9751         * statement.cs (Statement.EmitBoolExpression): Pass true and false
9752         targets, and optimize for !x.
9753
9754 2001-11-04  Ravi Pratap  <ravi@ximian.com>
9755
9756         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
9757         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
9758         set custom atttributes.
9759
9760         * literal.cs (Literal::GetValue): New abstract method to return the actual
9761         value of the literal, cast as an object.
9762
9763         (*Literal): Implement GetValue method.
9764
9765         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
9766         expressions to the arraylist but objects of type Argument.
9767
9768         * class.cs (TypeContainer::Emit): Emit our attributes too.
9769
9770         (Method::Emit, Constructor::Emit): Ditto.
9771
9772         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
9773         to be ignoring earlier.
9774
9775 2001-11-03  Ravi Pratap  <ravi@ximian.com>
9776
9777         * attribute.cs (AttributeSection::Define): Implement to do the business
9778         of constructing a CustomAttributeBuilder.
9779
9780         (Attribute): New trivial class. Increases readability of code.  
9781
9782         * cs-parser.jay : Update accordingly.
9783
9784         (positional_argument_list, named_argument_list, named_argument): New rules
9785
9786         (attribute_arguments): Use the above so that we are more correct.
9787         
9788 2001-11-02  Ravi Pratap  <ravi@ximian.com>
9789         
9790         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
9791         to perform all checks for a method with a params parameter.
9792
9793         (Invocation::OverloadResolve): Update to use the above method and therefore
9794         cope correctly with params method invocations.
9795
9796         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
9797         params too.
9798
9799         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
9800         constructors in our parent too because we can't afford to miss out on 
9801         protected ones ;-)
9802
9803         * attribute.cs (AttributeSection): New name for the class Attribute
9804
9805         Other trivial changes to improve readability.
9806
9807         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
9808         use the new class names.
9809         
9810 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9811
9812         * class.cs (Method::Define): Complete definition for params types too
9813
9814         (Indexer::Define): Ditto.
9815
9816         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
9817         Cope everywhere with a request for info about the array parameter.
9818
9819 2001-11-01  Ravi Pratap  <ravi@ximian.com>
9820
9821         * tree.cs (RecordNamespace): Fix up to check for the correct key.
9822
9823         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
9824         local_variable_type to extract the string corresponding to the type.
9825
9826         (local_variable_type): Fixup the action to use the new helper method.
9827
9828         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
9829         go.
9830
9831         * expression.cs : Clean out code which uses the above.
9832
9833 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9834         
9835         * typemanager.cs (RegisterMethod): Check if we already have an existing key
9836         and bale out if necessary by returning a false.
9837
9838         (RegisterProperty): Ditto.
9839
9840         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
9841         and print out appropriate error messages.
9842
9843         * interface.cs (everywhere): Ditto.
9844
9845         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
9846         location to constructor.
9847
9848         * class.cs (Property, Event, Indexer): Update accordingly.
9849
9850         * ../errors/cs111.cs : Added.
9851
9852         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
9853         of a method, as laid down by the spec.
9854
9855         (Invocation::OverloadResolve): Use the above method.
9856
9857 2001-10-31  Ravi Pratap  <ravi@ximian.com>
9858
9859         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
9860         now take a TypeContainer and a Parameters object.
9861
9862         (ParameterData): Modify return type of ParameterModifier method to be 
9863         Parameter.Modifier and not a string.
9864
9865         (ReflectionParameters, InternalParameters): Update accordingly.
9866
9867         * expression.cs (Argument::GetParameterModifier): Same here.
9868
9869         * support.cs (InternalParameters::ParameterType): Find a better way of determining
9870         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
9871         symbol in it at all so maybe this is only for now.
9872
9873 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9874
9875         * support.cs (InternalParameters): Constructor now takes an extra argument 
9876         which is the actual Parameters class.
9877
9878         (ParameterDesc): Update to provide info on ref/out modifiers.
9879
9880         * class.cs (everywhere): Update call to InternalParameters to pass in
9881         the second argument too.
9882
9883         * support.cs (ParameterData): Add ParameterModifier, which is a method 
9884         to return the modifier info [ref/out etc]
9885
9886         (InternalParameters, ReflectionParameters): Implement the above.
9887
9888         * expression.cs (Argument::ParameterModifier): Similar function to return
9889         info about the argument's modifiers.
9890
9891         (Invocation::OverloadResolve): Update to take into account matching modifiers 
9892         too.
9893
9894         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
9895         a new SetFormalParameters object which we pass to InternalParameters.
9896
9897 2001-10-30  Ravi Pratap  <ravi@ximian.com>
9898
9899         * expression.cs (NewArray): Merge into the ArrayCreation class.
9900
9901 2001-10-29  Ravi Pratap  <ravi@ximian.com>
9902
9903         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
9904         NewUserdefinedArray into one as there wasn't much of a use in having
9905         two separate ones.
9906
9907         * expression.cs (Argument): Change field's name to ArgType from Type.
9908
9909         (Type): New readonly property which returns the proper type, taking into 
9910         account ref/out modifiers.
9911
9912         (everywhere): Adjust code accordingly for the above.
9913
9914         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
9915         whether we are emitting for a ref or out parameter.
9916
9917         * expression.cs (Argument::Emit): Use the above field to set the state.
9918
9919         (LocalVariableReference::Emit): Update to honour the flag and emit the
9920         right stuff.
9921
9922         * parameter.cs (Attributes): Set the correct flags for ref parameters.
9923
9924         * expression.cs (Argument::FullDesc): New function to provide a full desc.
9925
9926         * support.cs (ParameterData): Add method ParameterDesc to the interface.
9927
9928         (ReflectionParameters, InternalParameters): Implement the above method.
9929
9930         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
9931         reporting errors.
9932
9933         (Invocation::FullMethodDesc): Ditto. 
9934
9935 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
9936
9937         * cs-parser.jay: Add extra production for the second form of array
9938         creation. 
9939
9940         * expression.cs (ArrayCreation): Update to reflect the above
9941         change. 
9942
9943         * Small changes to prepare for Array initialization.
9944
9945 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
9946
9947         * typemanager.cs (ImplementsInterface): interface might be null;
9948         Deal with this problem;
9949
9950         Also, we do store negative hits on the cache (null values), so use
9951         this instead of calling t.GetInterfaces on the type everytime.
9952
9953 2001-10-28  Ravi Pratap  <ravi@ximian.com>
9954
9955         * typemanager.cs (IsBuiltinType): New method to help determine the same.
9956
9957         * expression.cs (New::DoResolve): Get rid of array creation code and instead
9958         split functionality out into different classes.
9959
9960         (New::FormArrayType): Move into NewBuiltinArray.
9961
9962         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
9963         quite useless.
9964
9965         (NewBuiltinArray): New class to handle creation of built-in arrays.
9966
9967         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
9968         account creation of one-dimensional arrays.
9969
9970         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
9971
9972         (NewUserdefinedArray::DoResolve): Implement.
9973
9974         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
9975
9976         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
9977         we maintain inside the TypeManager. This is necessary to perform lookups on the
9978         module builder.
9979
9980         (LookupType): Update to perform GetType on the module builders too.     
9981
9982         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
9983
9984         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
9985
9986 2001-10-23  Ravi Pratap  <ravi@ximian.com>
9987
9988         * expression.cs (New::DoResolve): Implement guts of array creation.
9989
9990         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
9991         
9992 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
9993
9994         * expression.cs: Fix bug I introduced lsat night that broke
9995         Delegates. 
9996
9997         (Expression.Resolve): Report a 246 error (can not resolve name)
9998         if we find a SimpleName in the stream.
9999         
10000         (Expression.ResolveLValue): Ditto.
10001         
10002         (Expression.ResolveWithSimpleName): This function is a variant of
10003         ResolveName, this one allows SimpleNames to be returned without a
10004         warning.  The only consumer of SimpleNames is MemberAccess
10005
10006 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
10007
10008         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
10009         might arrive here.  I have my doubts that this is correct.
10010
10011         * statement.cs (Lock): Implement lock statement.
10012
10013         * cs-parser.jay: Small fixes to support `lock' and `using'
10014
10015         * cs-tokenizer.cs: Remove extra space
10016
10017         * driver.cs: New flag --checked, allows to turn on integer math
10018         checking. 
10019
10020         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
10021         Threading.Monitor.Exit 
10022         
10023 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
10024
10025         * expression.cs (IndexerAccess::DoResolveLValue): Set the
10026         Expression Class to be IndexerAccess.
10027
10028         Notice that Indexer::DoResolve sets the eclass to Value.
10029
10030 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * class.cs (TypeContainer::Emit): Emit code for indexers.
10033
10034         * assign.cs (IAssignMethod): New interface implemented by Indexers
10035         and Properties for handling assignment.
10036
10037         (Assign::Emit): Simplify and reuse code. 
10038         
10039         * expression.cs (IndexerAccess, PropertyExpr): Implement
10040         IAssignMethod, clean up old code. 
10041
10042 2001-10-22  Ravi Pratap  <ravi@ximian.com>
10043
10044         * typemanager.cs (ImplementsInterface): New method to determine if a type
10045         implements a given interface. Provides a nice cache too.
10046
10047         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
10048         method.
10049
10050         (ConvertReferenceExplicit): Ditto.
10051
10052         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
10053         various methods, with correct names etc.
10054
10055         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
10056         Operator.UnaryNegation.
10057
10058         * cs-parser.jay (operator_declarator): Be a little clever in the case where
10059         we have a unary plus or minus operator.
10060
10061         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
10062         UnaryMinus.
10063
10064         * everywhere : update accordingly.
10065
10066         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
10067         respectively.
10068
10069         * class.cs (Method::Define): For the case where we are implementing a method
10070         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
10071         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
10072         
10073 2001-10-21  Ravi Pratap  <ravi@ximian.com>
10074
10075         * interface.cs (FindMembers): Implement to work around S.R.E
10076         lameness.
10077
10078         * typemanager.cs (IsInterfaceType): Implement.
10079
10080         (FindMembers): Update to handle interface types too.
10081
10082         * expression.cs (ImplicitReferenceConversion): Re-write bits which
10083         use IsAssignableFrom as that is not correct - it doesn't work.
10084
10085         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
10086         and accordingly override EmitStatement.
10087
10088         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
10089         using the correct logic :-)
10090
10091 2001-10-19  Ravi Pratap  <ravi@ximian.com>
10092
10093         * ../errors/cs-11.cs : Add to demonstrate error -11 
10094
10095 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
10096
10097         * assign.cs (Assign::Resolve): Resolve right hand side first, and
10098         then pass this as a hint to ResolveLValue.
10099         
10100         * expression.cs (FieldExpr): Add Location information
10101
10102         (FieldExpr::LValueResolve): Report assignment to readonly
10103         variable. 
10104         
10105         (Expression::ExprClassFromMemberInfo): Pass location information.
10106
10107         (Expression::ResolveLValue): Add new method that resolves an
10108         LValue. 
10109
10110         (Expression::DoResolveLValue): Default invocation calls
10111         DoResolve. 
10112
10113         (Indexers): New class used to keep track of indexers in a given
10114         Type. 
10115
10116         (IStackStore): Renamed from LValue, as it did not really describe
10117         what this did.  Also ResolveLValue is gone from this interface and
10118         now is part of Expression.
10119
10120         (ElementAccess): Depending on the element access type
10121         
10122         * typemanager.cs: Add `indexer_name_type' as a Core type
10123         (System.Runtime.CompilerServices.IndexerNameAttribute)
10124
10125         * statement.cs (Goto): Take a location.
10126         
10127 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10128
10129         * delegate.cs (Delegate::VerifyDelegate): New method to verify
10130         if two delegates are compatible.
10131
10132         (NewDelegate::DoResolve): Update to take care of the case when
10133         we instantiate a delegate from another delegate.
10134
10135         * typemanager.cs (FindMembers): Don't even try to look up members
10136         of Delegate types for now.
10137
10138 2001-10-18  Ravi Pratap  <ravi@ximian.com>
10139
10140         * delegate.cs (NewDelegate): New class to take care of delegate
10141         instantiation.
10142
10143         * expression.cs (New): Split the delegate related code out into 
10144         the NewDelegate class.
10145
10146         * delegate.cs (DelegateInvocation): New class to handle delegate 
10147         invocation.
10148
10149         * expression.cs (Invocation): Split out delegate related code into
10150         the DelegateInvocation class.
10151
10152 2001-10-17  Ravi Pratap  <ravi@ximian.com>
10153
10154         * expression.cs (New::DoResolve): Implement delegate creation fully
10155         and according to the spec.
10156
10157         (New::DoEmit): Update to handle delegates differently.
10158
10159         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
10160         because of which we were printing out arguments in reverse order !
10161
10162         * delegate.cs (VerifyMethod): Implement to check if the given method
10163         matches the delegate.
10164
10165         (FullDelegateDesc): Implement.
10166
10167         (VerifyApplicability): Implement.
10168
10169         * expression.cs (Invocation::DoResolve): Update to accordingly handle
10170         delegate invocations too.
10171
10172         (Invocation::Emit): Ditto.
10173
10174         * ../errors/cs1593.cs : Added.
10175
10176         * ../errors/cs1594.cs : Added.
10177
10178         * delegate.cs (InstanceExpression, TargetMethod): New properties.
10179
10180 2001-10-16  Ravi Pratap  <ravi@ximian.com>
10181
10182         * typemanager.cs (intptr_type): Core type for System.IntPtr
10183
10184         (InitCoreTypes): Update for the same.
10185
10186         (iasyncresult_type, asynccallback_type): Ditto.
10187
10188         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
10189         correct.
10190
10191         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
10192         too.
10193
10194         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
10195         the builders for the 4 members of a delegate type :-)
10196
10197         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
10198         type.
10199
10200         * expression.cs (New::DoResolve): Implement guts for delegate creation.
10201
10202         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
10203
10204 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
10205
10206         * statement.cs (Break::Emit): Implement.   
10207         (Continue::Emit): Implement.
10208
10209         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10210         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10211         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
10212         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
10213         end loop
10214         
10215         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
10216         properties that track the label for the current loop (begin of the
10217         loop and end of the loop).
10218
10219 2001-10-15  Ravi Pratap  <ravi@ximian.com>
10220
10221         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
10222         use of emitting anything at all.
10223
10224         * class.cs, rootcontext.cs : Get rid of calls to the same.
10225
10226         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
10227
10228         (Populate): Define the constructor correctly and set the implementation
10229         attributes.
10230
10231         * typemanager.cs (delegate_types): New hashtable to hold delegates that
10232         have been defined.
10233
10234         (AddDelegateType): Implement.
10235
10236         (IsDelegateType): Implement helper method.
10237
10238         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
10239
10240         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
10241         and accordingly handle it.
10242
10243         * delegate.cs (Populate): Take TypeContainer argument.
10244         Implement bits to define the Invoke method. However, I still haven't figured out
10245         how to take care of the native int bit :-(
10246
10247         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
10248         Qualify the name of the delegate, not its return type !
10249
10250         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
10251         conversion.
10252
10253         (StandardConversionExists): Checking for array types turns out to be recursive.
10254
10255         (ConvertReferenceExplicit): Implement array conversion.
10256
10257         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
10258         
10259 2001-10-12  Ravi Pratap  <ravi@ximian.com>
10260
10261         * cs-parser.jay (delegate_declaration): Store the fully qualified
10262         name as it is a type declaration.
10263
10264         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
10265         readonly.
10266
10267         (DefineDelegate): Renamed from Define. Does the same thing essentially,
10268         as TypeContainer::DefineType.
10269
10270         (Populate): Method in which all the definition of the various methods (Invoke)
10271         etc is done.
10272
10273         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
10274         see.
10275         
10276         (CloseDelegate): Finally creates the delegate.
10277
10278         * class.cs (TypeContainer::DefineType): Update to define delegates.
10279         (Populate, Emit and CloseType): Do the same thing here too.
10280
10281         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
10282         delegates in all these operations.
10283
10284 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
10285
10286         * expression.cs: LocalTemporary: a new expression used to
10287         reference a temporary that has been created.
10288
10289         * assign.cs: Handle PropertyAccess back here, so that we can
10290         provide the proper semantic access to properties.
10291
10292         * expression.cs (Expression::ConvertReferenceExplicit): Implement
10293         a few more explicit conversions. 
10294
10295         * modifiers.cs: `NEW' modifier maps to HideBySig.
10296
10297         * expression.cs (PropertyExpr): Make this into an
10298         ExpressionStatement, and support the EmitStatement code path. 
10299
10300         Perform get/set error checking, clean up the interface.
10301
10302         * assign.cs: recognize PropertyExprs as targets, and if so, turn
10303         them into toplevel access objects.
10304
10305 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
10306
10307         * expression.cs: PropertyExpr::PropertyExpr: use work around the
10308         SRE.
10309
10310         * typemanager.cs: Keep track here of our PropertyBuilders again to
10311         work around lameness in SRE.
10312
10313 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
10314
10315         * expression.cs (LValue::LValueResolve): New method in the
10316         interface, used to perform a second resolution pass for LValues. 
10317         
10318         (This::DoResolve): Catch the use of this in static methods.
10319
10320         (This::LValueResolve): Implement.
10321
10322         (This::Store): Remove warning, assigning to `this' in structures
10323         is 
10324
10325         (Invocation::Emit): Deal with invocation of
10326         methods on value types.  We need to pass the address to structure
10327         methods rather than the object itself.  (The equivalent code to
10328         emit "this" for structures leaves the entire structure on the
10329         stack instead of a pointer to it). 
10330
10331         (ParameterReference::DoResolve): Compute the real index for the
10332         argument based on whether the method takes or not a `this' pointer
10333         (ie, the method is static).
10334
10335         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
10336         value types returned from functions when we need to invoke a
10337         method on the sturcture.
10338         
10339
10340 2001-10-11  Ravi Pratap  <ravi@ximian.com>
10341
10342         * class.cs (TypeContainer::DefineType): Method to actually do the business of
10343         defining the type in the Modulebuilder or Typebuilder. This is to take
10344         care of nested types which need to be defined on the TypeBuilder using
10345         DefineNestedMethod.
10346
10347         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
10348         methods in RootContext, only ported to be part of TypeContainer.
10349
10350         (TypeContainer::GetInterfaceOrClass): Ditto.
10351
10352         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
10353
10354         * interface.cs (Interface::DefineInterface): New method. Does exactly
10355         what RootContext.CreateInterface did earlier, only it takes care of nested types 
10356         too.
10357
10358         (Interface::GetInterfaces): Move from RootContext here and port.
10359
10360         (Interface::GetInterfaceByName): Same here.
10361
10362         * rootcontext.cs (ResolveTree): Re-write.
10363
10364         (PopulateTypes): Re-write.
10365
10366         * class.cs (TypeContainer::Populate): Populate nested types too.
10367         (TypeContainer::Emit): Emit nested members too.
10368
10369         * typemanager.cs (AddUserType): Do not make use of the FullName property,
10370         instead just use the name argument passed in as it is already fully
10371         qualified.
10372
10373         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
10374         to TypeContainer mapping to see if a type is user-defined.
10375
10376         * class.cs (TypeContainer::CloseType): Implement. 
10377
10378         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
10379         the default constructor.
10380         
10381         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
10382         twice.
10383
10384         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
10385
10386         * interface.cs (CloseType): Create the type here.
10387         
10388         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
10389         the hierarchy.
10390
10391         Remove all the methods which are now in TypeContainer.
10392
10393 2001-10-10  Ravi Pratap  <ravi@ximian.com>
10394
10395         * delegate.cs (Define): Re-write bits to define the delegate
10396         correctly.
10397
10398 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
10399
10400         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
10401
10402         * expression.cs (ImplicitReferenceConversion): handle null as well
10403         as a source to convert to any reference type.
10404
10405         * statement.cs (Return): Perform any implicit conversions to
10406         expected return type.  
10407
10408         Validate use of return statement.  
10409
10410         * codegen.cs (EmitContext): Pass the expected return type here.
10411
10412         * class.cs (Method, Constructor, Property): Pass expected return
10413         type to EmitContext.
10414
10415 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
10416
10417         * expression.cs: Make DoResolve take an EmitContext instead of a
10418         TypeContainer.
10419
10420         Replaced `l' and `location' for `loc', for consistency.
10421         
10422         (Error, Warning): Remove unneeded Tc argument.
10423
10424         * assign.cs, literal.cs, constant.cs: Update to new calling
10425         convention. 
10426         
10427         * codegen.cs: EmitContext now contains a flag indicating whether
10428         code is being generated in a static method or not.
10429
10430         * cs-parser.jay: DecomposeQI, new function that replaces the old
10431         QualifiedIdentifier.  Now we always decompose the assembled
10432         strings from qualified_identifier productions into a group of
10433         memberaccesses.
10434
10435 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
10436
10437         * rootcontext.cs: Deal with field-less struct types correctly now
10438         by passing the size option to Define Type.
10439
10440         * class.cs: Removed hack that created one static field. 
10441
10442 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10443
10444         * statement.cs: Moved most of the code generation here. 
10445
10446 2001-10-09  Ravi Pratap  <ravi@ximian.com>
10447
10448         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
10449         seem very right.
10450
10451         (ElementAccess): Remove useless bits for now - keep checks as the spec
10452         says.
10453
10454 2001-10-08  Ravi Pratap  <ravi@ximian.com>
10455
10456         * expression.cs (ElementAccess::DoResolve): Remove my crap code
10457         and start performing checks according to the spec.
10458
10459 2001-10-07  Ravi Pratap  <ravi@ximian.com>
10460
10461         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
10462         rank_specifiers instead.
10463
10464         (rank_specifiers): Change the order in which the rank specifiers are stored
10465
10466         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
10467
10468         * expression.cs (ElementAccess): Implement the LValue interface too.
10469         
10470 2001-10-06  Ravi Pratap  <ravi@ximian.com>
10471         
10472         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
10473         except that user defined conversions are not included.
10474
10475         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
10476         perform the conversion of the return type, if necessary.
10477
10478         (New::DoResolve): Check whether we are creating an array or an object
10479         and accordingly do the needful.
10480
10481         (New::Emit): Same here.
10482
10483         (New::DoResolve): Implement guts of array creation.
10484
10485         (New::FormLookupType): Helper function.
10486
10487 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
10488
10489         * codegen.cs: Removed most of the code generation here, and move the
10490         corresponding code generation bits to the statement classes. 
10491
10492         Added support for try/catch/finalize and throw.
10493         
10494         * cs-parser.jay: Added support for try/catch/finalize.
10495
10496         * class.cs: Catch static methods having the flags override,
10497         virtual or abstract.
10498
10499         * expression.cs (UserCast): This user cast was not really doing
10500         what it was supposed to do.  Which is to be born in fully resolved
10501         state.  Parts of the resolution were being performed at Emit time! 
10502
10503         Fixed this code.
10504
10505 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10506
10507         * expression.cs: Implicity convert the result from UserCast.
10508
10509 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10510
10511         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
10512         prevented it from working correctly. 
10513
10514         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
10515         merely ConvertImplicit.
10516
10517 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
10518
10519         * typemanager.cs: Make the LookupTypeContainer function static,
10520         and not per-instance.  
10521
10522         * class.cs: Make static FindMembers (the one that takes a Type
10523         argument). 
10524
10525         * codegen.cs: Add EmitForeach here.
10526
10527         * cs-parser.jay: Make foreach a toplevel object instead of the
10528         inline expansion, as we need to perform semantic analysis on it. 
10529
10530 2001-10-05  Ravi Pratap  <ravi@ximian.com>
10531
10532         * expression.cs (Expression::ImplicitUserConversion): Rename to
10533         UserDefinedConversion.
10534
10535         (Expression::UserDefinedConversion): Take an extra argument specifying 
10536         whether we look for explicit user conversions too.
10537
10538         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
10539
10540         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
10541
10542         (ExplicitUserConversion): Make it a call to UserDefinedConversion
10543         with the appropriate arguments.
10544
10545         * cs-parser.jay (cast_expression): Record location too.
10546
10547         * expression.cs (Cast): Record location info.
10548
10549         (Expression::ConvertExplicit): Take location argument.
10550
10551         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
10552         to determine if we are doing explicit conversions.
10553
10554         (UserCast::Emit): Update accordingly.
10555
10556         (Expression::ConvertExplicit): Report an error if everything fails.
10557
10558         * ../errors/cs0030.cs : Add.
10559
10560 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
10561
10562         * modifiers.cs: If the ABSTRACT keyword is present, also set the
10563         virtual and newslot bits. 
10564
10565         * class.cs (TypeContainer::RegisterRequiredImplementations):
10566         Record methods we need.
10567
10568         (TypeContainer::MakeKey): Helper function to make keys for
10569         MethodBases, since the Methodbase key is useless.
10570
10571         (TypeContainer::Populate): Call RegisterRequiredImplementations
10572         before defining the methods.   
10573
10574         Create a mapping for method_builders_to_methods ahead of time
10575         instead of inside a tight loop.
10576
10577         (::RequireMethods):  Accept an object as the data to set into the
10578         hashtable so we can report interface vs abstract method mismatch.
10579
10580 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10581
10582         * report.cs: Make all of it static.
10583
10584         * rootcontext.cs: Drop object_type and value_type computations, as
10585         we have those in the TypeManager anyways.
10586
10587         Drop report instance variable too, now it is a global.
10588
10589         * driver.cs: Use try/catch on command line handling.
10590
10591         Add --probe option to debug the error reporting system with a test
10592         suite. 
10593
10594         * report.cs: Add support for exiting program when a probe
10595         condition is reached.
10596
10597 2001-10-03  Ravi Pratap  <ravi@ximian.com>
10598
10599         * expression.cs (Binary::DoNumericPromotions): Fix the case when
10600         we do a forcible conversion regardless of type, to check if 
10601         ForceConversion returns a null.
10602
10603         (Binary::error19): Use location to report error.
10604
10605         (Unary::error23): Use location here too.
10606
10607         * ../errors/cs0019.cs : Check in.
10608
10609         * ../errors/cs0023.cs : Check in.
10610
10611         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
10612         case of a non-null MethodInfo object with a length of 0 !
10613
10614         (Binary::ResolveOperator): Flag error if overload resolution fails to find
10615         an applicable member - according to the spec :-)
10616         Also fix logic to find members in base types.
10617
10618         (Unary::ResolveOperator): Same here.
10619
10620         (Unary::report23): Change name to error23 and make first argument a TypeContainer
10621         as I was getting thoroughly confused between this and error19 :-)
10622         
10623         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
10624         (::FindMostEncompassedType): Implement.
10625         (::FindMostEncompassingType): Implement.
10626         (::StandardConversionExists): Implement.
10627
10628         (UserImplicitCast): Re-vamp. We now need info about most specific
10629         source and target types so that we can do the necessary conversions.
10630
10631         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
10632         mathematical union with no duplicates.
10633
10634 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
10635
10636         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
10637         in order from base classes to child classes, so that we can in
10638         child classes look up in our parent for method names and
10639         attributes (required for handling abstract, virtual, new, override
10640         constructs: we need to instrospect our base class, and if we dont
10641         populate the classes in order, the introspection might be
10642         incorrect.  For example, a method could query its parent before
10643         the parent has any methods and would determine that the parent has
10644         no abstract methods (while it could have had them)).
10645
10646         (RootContext::CreateType): Record the order in which we define the
10647         classes.
10648
10649 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
10650
10651         * class.cs (TypeContainer::Populate): Also method definitions can
10652         fail now, keep track of this.
10653
10654         (TypeContainer::FindMembers): Implement support for
10655         DeclaredOnly/noDeclaredOnly flag.
10656
10657         (Constructor::Emit) Return the ConstructorBuilder.
10658
10659         (Method::Emit) Return the MethodBuilder. 
10660         Check for abstract or virtual methods to be public.
10661
10662         * rootcontext.cs (RootContext::CreateType): Register all the
10663         abstract methods required for the class to be complete and the
10664         interface methods that must be implemented. 
10665
10666         * cs-parser.jay: Report error 501 (method requires body if it is
10667         not marked abstract or extern).
10668
10669         * expression.cs (TypeOf::Emit): Implement.
10670
10671         * typemanager.cs: runtime_handle_type, new global type.
10672
10673         * class.cs (Property::Emit): Generate code for properties.
10674
10675 2001-10-02  Ravi Pratap  <ravi@ximian.com>
10676
10677         * expression.cs (Unary::ResolveOperator): Find operators on base type
10678         too - we now conform exactly to the spec.
10679
10680         (Binary::ResolveOperator): Same here.
10681
10682         * class.cs (Operator::Define): Fix minor quirk in the tests.
10683
10684         * ../errors/cs0215.cs : Added.
10685
10686         * ../errors/cs0556.cs : Added.
10687
10688         * ../errors/cs0555.cs : Added.
10689
10690 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10691
10692         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
10693         single integer which is really efficient
10694
10695 2001-10-01  Ravi Pratap  <ravi@ximian.com>
10696
10697         *  expression.cs (Expression::ImplicitUserConversion): Use location
10698         even in the case when we are examining True operators.
10699  
10700         * class.cs (Operator::Define): Perform extensive checks to conform
10701         with the rules for operator overloading in the spec.
10702
10703         * expression.cs (Expression::ImplicitReferenceConversion): Implement
10704         some of the other conversions mentioned in the spec.
10705
10706         * typemanager.cs (array_type): New static member for the System.Array built-in
10707         type.
10708
10709         (cloneable_interface): For System.ICloneable interface.
10710
10711         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
10712         we start resolving the tree and populating types.
10713
10714         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
10715  
10716 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
10717
10718         * expression.cs (Expression::ExprClassFromMemberInfo,
10719         Expression::Literalize): Create literal expressions from
10720         FieldInfos which are literals.
10721
10722         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
10723         type casts, because they were wrong.  The test suite in tests
10724         caught these ones.
10725
10726         (ImplicitNumericConversion): ushort to ulong requires a widening
10727         cast. 
10728
10729         Int32 constant to long requires widening cast as well.
10730
10731         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
10732         for integers because the type on the stack is not i4.
10733
10734 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
10735
10736         * expression.cs (report118): require location argument. 
10737
10738         * parameter.cs: Do not dereference potential null value.
10739
10740         * class.cs: Catch methods that lack the `new' keyword when
10741         overriding a name.  Report warnings when `new' is used without
10742         anything being there to override.
10743
10744         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
10745
10746         * class.cs: Only add constructor to hashtable if it is non-null
10747         (as now constructors can fail on define).
10748
10749         (TypeManager, Class, Struct): Take location arguments.
10750
10751         Catch field instance initialization in structs as errors.
10752
10753         accepting_filter: a new filter for FindMembers that is static so
10754         that we dont create an instance per invocation.
10755
10756         (Constructor::Define): Catch errors where a struct constructor is
10757         parameterless 
10758
10759         * cs-parser.jay: Pass location information for various new
10760         constructs. 
10761         
10762         * delegate.cs (Delegate): take a location argument.
10763
10764         * driver.cs: Do not call EmitCode if there were problesm in the
10765         Definition of the types, as many Builders wont be there. 
10766
10767         * decl.cs (Decl::Decl): Require a location argument.
10768
10769         * cs-tokenizer.cs: Handle properly hex constants that can not fit
10770         into integers, and find the most appropiate integer for it.
10771
10772         * literal.cs: Implement ULongLiteral.
10773
10774         * rootcontext.cs: Provide better information about the location of
10775         failure when CreateType fails.
10776         
10777 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
10778
10779         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
10780         as well.
10781
10782         * expression.cs (Binary::CheckShiftArguments): Add missing type
10783         computation.
10784         (Binary::ResolveOperator): Add type to the logical and and logical
10785         or, Bitwise And/Or and Exclusive Or code paths, it was missing
10786         before.
10787
10788         (Binary::DoNumericPromotions): In the case where either argument
10789         is ulong (and most signed types combined with ulong cause an
10790         error) perform implicit integer constant conversions as well.
10791
10792 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10793
10794         * expression.cs (UserImplicitCast): Method should always be
10795         non-null. 
10796         (Invocation::BetterConversion): Simplified test for IntLiteral.
10797
10798         (Expression::ImplicitNumericConversion): Split this routine out.
10799         Put the code that performs implicit constant integer conversions
10800         here. 
10801
10802         (Expression::Resolve): Become a wrapper around DoResolve so we can
10803         check eclass and type being set after resolve.
10804
10805         (Invocation::Badness): Remove this dead function
10806
10807         (Binary::ResolveOperator): Do not compute the expensive argumnets
10808         unless we have a union for it.
10809
10810         (Probe::Emit): Is needs to do an isinst and then
10811         compare against null.
10812
10813         (::CanConvert): Added Location argument.  If the Location argument
10814         is null (Location.Null), then we do not report errors.  This is
10815         used by the `probe' mechanism of the Explicit conversion.  We do
10816         not want to generate an error for something that the user
10817         explicitly requested to be casted.  But the pipeline for an
10818         explicit cast first tests for potential implicit casts.
10819
10820         So for now, if the Location is null, it means `Probe only' to
10821         avoid adding another argument.   Might have to revise this
10822         strategy later.
10823
10824         (ClassCast): New class used to type cast objects into arbitrary
10825         classes (used in Explicit Reference Conversions).
10826
10827         Implement `as' as well.
10828
10829         Reverted all the patches from Ravi below: they were broken:
10830
10831                 * The use of `level' as a mechanism to stop recursive
10832                   invocations is wrong.  That was there just to catch the
10833                   bug with a strack trace but not as a way of addressing
10834                   the problem.
10835
10836                   To fix the problem we have to *understand* what is going
10837                   on and the interactions and come up with a plan, not
10838                   just get things going.
10839
10840                 * The use of the type conversion cache that I proposed
10841                   last night had an open topic: How does this work across
10842                   protection domains.  A user defined conversion might not
10843                   be public in the location where we are applying the
10844                   conversion, a different conversion might be selected
10845                   (ie, private A->B (better) but public B->A (worse),
10846                   inside A, A->B applies, but outside it, B->A will
10847                   apply).
10848
10849                 * On top of that (ie, even if the above is solved),
10850                   conversions in a cache need to be abstract.  Ie, `To
10851                   convert from an Int to a Short use an OpcodeCast', not
10852                   `To convert from an Int to a Short use the OpcodeCast on
10853                   the variable 5' (which is what this patch was doing).
10854         
10855 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10856
10857         * expression.cs (Invocation::ConversionExists): Re-write to use
10858         the conversion cache
10859         
10860         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
10861         cache all conversions done, not just user-defined ones.
10862
10863         (Invocation::BetterConversion): The real culprit. Use ConversionExists
10864         to determine if a conversion exists instead of acutually trying to 
10865         perform the conversion. It's faster too.
10866
10867         (Expression::ConvertExplicit): Modify to use ConversionExists to check
10868         and only then attempt the implicit conversion.
10869
10870 2001-09-28  Ravi Pratap  <ravi@ximian.com>
10871
10872         * expression.cs (ConvertImplicit): Use a cache for conversions
10873         already found. Check level of recursion and bail out if necessary.
10874         
10875 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
10876
10877         * typemanager.cs (string_concat_string_string, string_concat_object_object):
10878         Export standard methods that we expect for string operations.
10879         
10880         * statement.cs (Block::UsageWarning): Track usage of variables and
10881         report the errors for not used variables.
10882
10883         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
10884         operator. 
10885
10886 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10887
10888         * codegen.cs: remove unnneded code 
10889
10890         * expression.cs: Removed BuiltinTypeAccess class
10891
10892         Fix the order in which implicit conversions are
10893         done.  
10894
10895         The previous fixed dropped support for boxed conversions (adding a
10896         test to the test suite now)
10897
10898         (UserImplicitCast::CanConvert): Remove test for source being null,
10899         that code is broken.  We should not feed a null to begin with, if
10900         we do, then we should track the bug where the problem originates
10901         and not try to cover it up here.
10902
10903         Return a resolved expression of type UserImplicitCast on success
10904         rather than true/false.  Ravi: this is what I was talking about,
10905         the pattern is to use a static method as a "constructor" for
10906         objects. 
10907
10908         Also, do not create arguments until the very last minute,
10909         otherwise we always create the arguments even for lookups that
10910         will never be performed. 
10911
10912         (UserImplicitCast::Resolve): Eliminate, objects of type
10913         UserImplicitCast are born in a fully resolved state. 
10914         
10915         * typemanager.cs (InitCoreTypes): Init also value_type
10916         (System.ValueType). 
10917
10918         * expression.cs (Cast::Resolve): First resolve the child expression.
10919
10920         (LValue): Add new method AddressOf to be used by
10921         the `&' operator.  
10922
10923         Change the argument of Store to take an EmitContext instead of an
10924         ILGenerator, because things like FieldExpr need to be able to call
10925         their children expression to generate the instance code. 
10926
10927         (Expression::Error, Expression::Warning): Sugar functions for
10928         reporting errors.
10929
10930         (Expression::MemberLookup): Accept a TypeContainer instead of a
10931         Report as the first argument.
10932
10933         (Expression::ResolvePrimary): Killed.  I still want to improve
10934         this as currently the code is just not right.
10935
10936         (Expression::ResolveMemberAccess): Simplify, but it is still
10937         wrong. 
10938
10939         (Unary::Resolve): Catch errors in AddressOf operators.
10940
10941         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
10942         index to a byte for the short-version, or the compiler will choose
10943         the wrong Emit call, which generates the wrong data.
10944
10945         (ParameterReference::Emit, ::Store): same.
10946
10947         (FieldExpr::AddressOf): Implement.
10948         
10949         * typemanager.cs: TypeManager: made public variable instead of
10950         property.
10951         
10952         * driver.cs: document --fatal.
10953
10954         * report.cs (ErrorMessage, WarningMessage): new names for the old
10955         Error and Warning classes.
10956
10957         * cs-parser.jay (member_access): Turn built-in access to types
10958         into a normal simplename
10959
10960 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10961
10962         * expression.cs (Invocation::BetterConversion): Fix to cope
10963         with q being null, since this was introducing a bug.
10964
10965         * expression.cs (ConvertImplicit): Do built-in conversions first.
10966
10967 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10968
10969         * expression.cs (UserImplicitCast::Resolve): Fix bug.
10970
10971 2001-09-27  Ravi Pratap  <ravi@ximian.com>
10972
10973         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
10974         I had introduced long ago (what's new ?).
10975
10976         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
10977         the work of all the checking. 
10978         (ConvertImplicit): Call CanConvert and only then create object if necessary.
10979         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
10980
10981         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
10982         that is the right way. 
10983
10984         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
10985         overloading resolution. Use everywhere instead of cutting and pasting code.
10986
10987         (Binary::ResolveOperator): Use MakeUnionSet.
10988
10989         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
10990         we have to convert to bool types. Not complete yet.
10991         
10992 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
10993
10994         * typemanager.cs (TypeManager::CSharpName): support ushort.
10995
10996         * expression.cs (Expression::TryImplicitIntConversion): Attempts
10997         to provide an expression that performsn an implicit constant int
10998         conversion (section 6.1.6).
10999         (Expression::ConvertImplicitRequired): Reworked to include
11000         implicit constant expression conversions.
11001
11002         (Expression::ConvertNumericExplicit): Finished.
11003
11004         (Invocation::Emit): If InstanceExpression is null, then it means
11005         that we perform a call on this.
11006         
11007 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11008
11009         * expression.cs (Unary::Emit): Remove some dead code.
11010         (Probe): Implement Resolve and Emit for `is'.
11011         (Expression::ConvertImplicitRequired): Attempt to do constant
11012         expression conversions here.  Maybe should be moved to
11013         ConvertImplicit, but I am not sure.
11014         (Expression::ImplicitLongConstantConversionPossible,
11015         Expression::ImplicitIntConstantConversionPossible): New functions
11016         that tell whether is it possible to apply an implicit constant
11017         expression conversion.
11018
11019         (ConvertNumericExplicit): Started work on explicit numeric
11020         conversions.
11021
11022         * cs-parser.jay: Update operator constants.
11023
11024         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
11025         (Parameters::GetSignature): Hook up VerifyArgs here.
11026         (Parameters::VerifyArgs): Verifies that no two arguments have the
11027         same name. 
11028
11029         * class.cs (Operator): Update the operator names to reflect the
11030         ones that the spec expects (as we are just stringizing the
11031         operator names).
11032         
11033         * expression.cs (Unary::ResolveOperator): Fix bug: Use
11034         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
11035         previous usage did only work for our methods.
11036         (Expression::ConvertImplicit): Handle decimal implicit numeric
11037         conversions as well.
11038         (Expression::InternalTypeConstructor): Used to invoke constructors
11039         on internal types for default promotions.
11040
11041         (Unary::Emit): Implement special handling for the pre/post
11042         increment/decrement for overloaded operators, as they need to have
11043         the same semantics as the other operators.
11044
11045         (Binary::ResolveOperator): ditto.
11046         (Invocation::ConversionExists): ditto.
11047         (UserImplicitCast::Resolve): ditto.
11048         
11049 2001-09-26  Ravi Pratap  <ravi@ximian.com>
11050
11051         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
11052         operator, return after emitting body. Regression tests pass again !
11053
11054         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
11055         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
11056         (Invocation::OverloadResolve): Ditto.
11057         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
11058
11059         * everywhere : update calls to the above methods accordingly.
11060
11061 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
11062
11063         * assign.cs (Assign): Make it inherit from ExpressionStatement.
11064
11065         * expression.cs (ExpressionStatement): New base class used for
11066         expressions that can appear in statements, so that we can provide
11067         an alternate path to generate expression that do not leave a value
11068         on the stack.
11069
11070         (Expression::Emit, and all the derivatives): We no longer return
11071         whether a value is left on the stack or not.  Every expression
11072         after being emitted leaves a single value on the stack.
11073
11074         * codegen.cs (EmitContext::EmitStatementExpression): Use the
11075         facilties of ExpressionStatement if possible.
11076
11077         * cs-parser.jay: Update statement_expression.
11078
11079 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
11080
11081         * driver.cs: Change the wording of message
11082
11083 2001-09-25  Ravi Pratap  <ravi@ximian.com>
11084
11085         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
11086         the type of the expression to the return type of the method if
11087         we have an overloaded operator match ! The regression tests pass again !
11088         (Unary::ResolveOperator): Ditto.
11089
11090         * expression.cs (Invocation::ConversionExists): Correct the member lookup
11091         to find "op_Implicit", not "implicit" ;-)
11092         (UserImplicitCast): New class to take care of user-defined implicit conversions.
11093         (ConvertImplicit, ForceConversion): Take TypeContainer argument
11094
11095         * everywhere : Correct calls to the above accordingly.
11096
11097         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
11098         (ConvertImplicit): Do user-defined conversion if it exists.
11099
11100 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
11101
11102         * assign.cs: track location.
11103         (Resolve): Use implicit conversions on assignment.
11104
11105         * literal.cs: Oops.  Not good, Emit of short access values should
11106         pass (Bytes) or the wrong argument will be selected.
11107
11108         * expression.cs (Unary::Emit): Emit code for -expr.
11109         
11110         (Unary::ResolveOperator): Handle `Substract' for non-constants
11111         (substract from zero from the non-constants).
11112         Deal with Doubles as well. 
11113         
11114         (Expression::ConvertImplicitRequired): New routine that reports an
11115         error if no implicit conversion exists. 
11116
11117         (Invocation::OverloadResolve): Store the converted implicit
11118         expressions if we make them
11119         
11120 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11121
11122         * class.cs (ConstructorInitializer): Take a Location argument.
11123         (ConstructorBaseInitializer): Same here.
11124         (ConstructorThisInitializer): Same here.
11125
11126         * cs-parser.jay : Update all calls accordingly.
11127
11128         * expression.cs (Unary, Binary, New): Take location argument.
11129         Update accordingly everywhere.
11130
11131         * cs-parser.jay : Update all calls to the above to take a location
11132         argument.
11133
11134         * class.cs : Ditto.
11135
11136 2001-09-24  Ravi Pratap  <ravi@ximian.com>
11137
11138         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
11139         (Invocation::BetterConversion): Same here
11140         (Invocation::ConversionExists): Ditto.
11141
11142         (Invocation::ConversionExists): Implement.
11143
11144 2001-09-22  Ravi Pratap  <ravi@ximian.com>
11145
11146         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
11147         Also take an additional TypeContainer argument.
11148
11149         * All over : Pass in TypeContainer as argument to OverloadResolve.
11150
11151         * typemanager.cs (CSharpName): Update to check for the string type and return
11152         that too.
11153
11154         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
11155         a given method.
11156         
11157 2001-09-21  Ravi Pratap  <ravi@ximian.com>
11158
11159         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
11160         (Invocation::BetterFunction): Implement.
11161         (Invocation::BetterConversion): Implement.
11162         (Invocation::ConversionExists): Skeleton, no implementation yet.
11163
11164         Okay, things work fine !
11165
11166 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
11167
11168         * typemanager.cs: declare and load enum_type, delegate_type and
11169         void_type. 
11170
11171         * expression.cs (Expression::Emit): Now emit returns a value that
11172         tells whether a value is left on the stack or not.  This strategy
11173         might be reveted tomorrow with a mechanism that would address
11174         multiple assignments.
11175         (Expression::report118): Utility routine to report mismatches on
11176         the ExprClass.
11177
11178         (Unary::Report23): Report impossible type/operator combination
11179         utility function.
11180
11181         (Unary::IsIncrementableNumber): Whether the type can be
11182         incremented or decremented with add.
11183         (Unary::ResolveOperator): Also allow enumerations to be bitwise
11184         complemented. 
11185         (Unary::ResolveOperator): Implement ++, !, ~,
11186
11187         (Invocation::Emit): Deal with new Emit convetion.
11188         
11189         * All Expression derivatives: Updated their Emit method to return
11190         whether they leave values on the stack or not.
11191         
11192         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
11193         stack for expressions that are statements. 
11194
11195 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11196
11197         * expression.cs (LValue): New interface.  Must be implemented by
11198         LValue objects.
11199         (LocalVariableReference, ParameterReference, FieldExpr): Implement
11200         LValue interface.
11201         
11202         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
11203         interface for generating code, simplifies the code.
11204
11205 2001-09-20  Ravi Pratap  <ravi@ximian.com>
11206
11207         * expression.cs (everywhere): Comment out return statements in ::Resolve
11208         methods to avoid the warnings.
11209
11210 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
11211
11212         * driver.cs (parse): Report error 2001 if we can not open the
11213         source file.
11214
11215         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
11216         not resolve it.
11217
11218         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
11219         object. 
11220
11221         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
11222         otherwise nested blocks end up with the same index.
11223
11224         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
11225
11226         * expression.cs:  Instead of having FIXMEs in the Resolve
11227         functions, throw exceptions so it is obvious that we are facing a
11228         bug. 
11229
11230         * cs-parser.jay (invocation_expression): Pass Location information.
11231
11232         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
11233         Use a basename for those routines because .NET does not like paths
11234         on them. 
11235
11236         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
11237         already defined.
11238
11239 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
11240
11241         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
11242         are loading the correct data types (throws an exception if not).
11243         (TypeManager::InitCoreTypes): Use CoreLookupType
11244
11245         * expression.cs (Unary::ResolveOperator): return the child
11246         expression for expressions which are just +expr.
11247         (Unary::ResolveOperator): Return negative literals for -LITERAL
11248         expressions (otherwise they are Unary {Literal}).
11249         (Invocation::Badness): Take into account `Implicit constant
11250         expression conversions'.
11251
11252         * literal.cs (LongLiteral): Implement long literal class.
11253         (IntLiteral): export the `Value' of the intliteral. 
11254
11255 2001-09-19  Ravi Pratap  <ravi@ximian.com>
11256
11257         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
11258
11259         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
11260         instead of 'Operator'
11261
11262         * expression.cs (Binary::ResolveOperator): Update accordingly.
11263         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
11264         and 'Minus'
11265
11266         * cs-parser.jay (unary_expression): Update to use the new names.
11267
11268         * gen-treedump.cs (GetUnary): Same here.
11269
11270         * expression.cs (Unary::Resolve): Implement.
11271         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
11272         operators are found instead of making noise ;-)
11273         (Unary::ResolveOperator): New method to do precisely the same thing which
11274         Binary::ResolveOperator does for Binary expressions.
11275         (Unary.method, .Arguments): Add.
11276         (Unary::OperName): Implement.   
11277         (Unary::ForceConversion): Copy and Paste !
11278
11279         * class.cs (Operator::Define): Fix a small bug for the case when we have 
11280         a unary operator.
11281
11282         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
11283         for the inbuilt operators. Only overloading works for now ;-)
11284
11285 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
11286
11287         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
11288         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
11289
11290         * expression.cs (This::Emit): Implement. 
11291         (This::Resolve): Implement.
11292         (TypeOf:Resolve): Implement.
11293         (Expression::ResolveSimpleName): Add an implicit this to instance
11294         field references. 
11295         (MemberAccess::Resolve): Deal with Parameters and Fields. 
11296         Bind instance variable to Field expressions.
11297         (FieldExpr::Instance): New field used to track the expression that
11298         represents the object instance.
11299         (FieldExpr::Resolve): Track potential errors from MemberLookup not
11300         binding 
11301         (FieldExpr::Emit): Implement.
11302
11303         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
11304         the last instruction contains a return opcode to avoid generating
11305         the last `ret' instruction (this generates correct code, and it is
11306         nice to pass the peverify output).
11307
11308         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
11309         initializer for static and instance variables.
11310         (Constructor::Emit): Allow initializer to be null in the case of
11311         static constructors.  Only emit initializer for instance
11312         constructors. 
11313
11314         (TypeContainer::FindMembers): Return a null array if there are no
11315         matches.
11316
11317         Also fix the code for the MemberTypes.Method branch, as it was not
11318         scanning that for operators (or tried to access null variables before).
11319
11320         * assign.cs (Assign::Emit): Handle instance and static fields. 
11321
11322         * TODO: Updated.
11323
11324         * driver.cs: Stop compilation if there are parse errors.
11325
11326         * cs-parser.jay (constructor_declaration): Provide default base
11327         initializer for non-static constructors.
11328         (constructor_declarator): Do not provide a default base
11329         initializers if none was specified.
11330         Catch the fact that constructors should not have parameters.
11331
11332         * class.cs: Do not emit parent class initializers for static
11333         constructors, that should be flagged as an error.
11334
11335 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11336
11337         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
11338         Move back code into TypeContainer::Populate.
11339
11340 2001-09-18  Ravi Pratap  <ravi@ximian.com>
11341
11342         * class.cs (TypeContainer::AddConstructor): Fix the check to
11343         compare against Name, not Basename. 
11344         (Operator::OpType): Change Plus and Minus to Add and Subtract.
11345
11346         * cs-parser.jay : Update accordingly.
11347
11348         * class.cs (TypeContainer::FindMembers): For the case where we are searching
11349         for methods, don't forget to look into the operators too.
11350         (RegisterMethodBuilder): Helper method to take care of this for
11351         methods, constructors and operators.
11352         (Operator::Define): Completely revamp.
11353         (Operator.OperatorMethod, MethodName): New fields.
11354         (TypeContainer::Populate): Move the registering of builders into
11355         RegisterMethodBuilder.
11356         (Operator::Emit): Re-write.
11357
11358         * expression.cs (Binary::Emit): Comment out code path to emit method
11359         invocation stuff for the case when we have a user defined operator. I am
11360         just not able to get it right !
11361         
11362 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11363
11364         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
11365         argument. 
11366
11367         (Expression::MemberLookup): Provide a version that allows to
11368         specify the MemberTypes and BindingFlags. 
11369
11370         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
11371         so it was not fetching variable information from outer blocks.
11372
11373         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
11374         Beforefieldinit as it was buggy.
11375
11376         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
11377         that Ravi put here.  
11378
11379         * class.cs (Constructor::Emit): Only emit if block is not null.
11380         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
11381         deal with this by semantically definining it as if the user had
11382         done it.
11383
11384         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
11385         constructors as we now "emit" them at a higher level.
11386
11387         (TypeContainer::DefineDefaultConstructor): Used to define the
11388         default constructors if none was provided.
11389
11390         (ConstructorInitializer): Add methods Resolve and Emit. 
11391         
11392         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
11393
11394 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11395
11396         * class.cs (TypeContainer::EmitDefaultConstructor): Register
11397         the default constructor builder with our hashtable for methodbuilders
11398         to methodcores.
11399
11400         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
11401         and argument_count is 0 in which case we have a match.
11402         (Binary::ResolveOperator): More null checking and miscellaneous coding
11403         style cleanup.
11404
11405 2001-09-17  Ravi Pratap  <ravi@ximian.com>
11406
11407         * rootcontext.cs (IsNameSpace): Compare against null.
11408
11409         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
11410
11411         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
11412         and Unary::Operator.
11413
11414         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
11415         accordingly.
11416
11417         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
11418         we have overloaded operators.
11419         (Binary::ResolveOperator): Implement the part which does the operator overload
11420         resolution.
11421
11422         * class.cs (Operator::Emit): Implement.
11423         (TypeContainer::Emit): Emit the operators we have too.
11424
11425         * expression.cs (Binary::Emit): Update to emit the appropriate code for
11426         the case when we have a user-defined operator.
11427         
11428 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
11429
11430         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
11431
11432 2001-09-16  Ravi Pratap  <ravi@ximian.com>
11433
11434         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
11435         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
11436         (Constructor::Emit): Implement.
11437         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
11438         if we have no work to do. 
11439         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
11440         Emit method.
11441
11442         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
11443         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
11444
11445         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
11446         of parent.parent.
11447
11448 2001-09-15  Ravi Pratap  <ravi@ximian.com>
11449
11450         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
11451         in the source.
11452         (Tree::RecordNamespace): Method to do what the name says ;-)
11453         (Tree::Namespaces): Property to get at the namespaces hashtable.
11454
11455         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
11456         keep track.
11457
11458         * rootcontext.cs (IsNamespace): Fixed it :-)
11459
11460 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11461
11462         * class.cs (TypeContainer::FindMembers): Add support for
11463         constructors. 
11464         (MethodCore): New class that encapsulates both the shared aspects
11465         of a Constructor and a Method.  
11466         (Method, Constructor): Factored pieces into MethodCore.
11467
11468         * driver.cs: Added --fatal which makes errors throw exceptions.
11469         Load System assembly as well as part of the standard library.
11470
11471         * report.cs: Allow throwing exceptions on errors for debugging.
11472
11473         * modifiers.cs: Do not use `parent', instead use the real type
11474         container to evaluate permission settings.
11475
11476         * class.cs: Put Ravi's patch back in.  He is right, and we will
11477         have to cope with the
11478
11479 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11480
11481         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
11482         FamORAssem, not FamANDAssem.
11483         
11484 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
11485
11486         * driver.cs: Added --parse option that only parses its input files
11487         and terminates.
11488
11489         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
11490         incorrect.  IsTopLevel is not used to tell whether an object is
11491         root_types or not (that can be achieved by testing this ==
11492         root_types).  But to see if this is a top-level *class* (not
11493         necessarly our "toplevel" container). 
11494
11495 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11496
11497         * enum.cs (Enum::Define): Modify to call the Lookup method on the
11498         parent instead of a direct call to GetType.
11499
11500 2001-09-14  Ravi Pratap  <ravi@ximian.com>
11501
11502         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
11503         Modifiers.TypeAttr. This should just be a call to that method.
11504
11505         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
11506         object so that we can determine if we are top-level or not.
11507
11508         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
11509         TypeContainer too.
11510
11511         * enum.cs (Enum::Define): Ditto.
11512
11513         * modifiers.cs (FieldAttr): Re-write.
11514
11515         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
11516         (TypeContainer::HaveStaticConstructor): New property to provide access
11517         to precisely that info.
11518
11519         * modifiers.cs (MethodAttr): Re-write.
11520         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
11521
11522         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
11523         of top-level types as claimed.
11524         
11525 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11526
11527         * expression.cs (MemberLookup): Fruitless attempt to lookup
11528         constructors.  Maybe I need to emit default constructors?  That
11529         might be it (currently .NET emits this for me automatically).
11530         (Invocation::OverloadResolve): Cope with Arguments == null.
11531         (Invocation::EmitArguments): new function, shared by the new
11532         constructor and us.
11533         (Invocation::Emit): Handle static and instance methods.  Emit
11534         proper call instruction for virtual or non-virtual invocations.
11535         (New::Emit): Implement.
11536         (New::Resolve): Implement.
11537         (MemberAccess:Resolve): Implement.
11538         (MethodGroupExpr::InstanceExpression): used conforming to the spec
11539         to track instances.
11540         (FieldExpr::Resolve): Set type.
11541
11542         * support.cs: Handle empty arguments.
11543                 
11544         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
11545         SimpleLookup): Auxiliary routines to help parse a qualifier
11546         identifier.  
11547
11548         Update qualifier_identifier rule.
11549
11550         * codegen.cs: Removed debugging messages.
11551
11552         * class.cs: Make this a global thing, this acts just as a "key" to
11553         objects that we might have around.
11554
11555         (Populate): Only initialize method_builders_to_methods once.
11556
11557         * expression.cs (PropertyExpr): Initialize type from the
11558         PropertyType. 
11559
11560         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
11561         Resolve pattern.  Attempt to implicitly convert value to boolean.
11562         Emit code.
11563
11564         * expression.cs: Set the type for the int32/int32 argument case.
11565         (Binary::ResolveOperator): Set the return type to boolean for
11566         comparission operators
11567
11568         * typemanager.cs: Remove debugging print code.
11569
11570         (Invocation::Resolve): resolve type.
11571
11572         * class.cs: Allocate a MemberInfo of the correct size, as the code
11573         elsewhere depends on the test to reflect the correct contents.
11574
11575         (Method::) Keep track of parameters, due to System.Reflection holes
11576
11577         (TypeContainer::Populate): Keep track of MethodBuilders to Method
11578         mapping here.
11579
11580         (TypeContainer::FindMembers): Use ArrayList and then copy an array
11581         of the exact size and return that.
11582
11583         (Class::LookupMethodByBuilder): New function that maps
11584         MethodBuilders to its methods.  Required to locate the information
11585         on methods because System.Reflection bit us again.
11586
11587         * support.cs: New file, contains an interface ParameterData and
11588         two implementations: ReflectionParameters and InternalParameters
11589         used to access Parameter information.  We will need to grow this
11590         as required.
11591
11592         * expression.cs (Invocation::GetParameterData): implement a cache
11593         and a wrapper around the ParameterData creation for methods. 
11594         (Invocation::OverloadResolve): Use new code.
11595
11596 2001-09-13  Ravi Pratap  <ravi@ximian.com>
11597
11598         * class.cs (TypeContainer::EmitField): Remove and move into 
11599         (Field::Define): here and modify accordingly.
11600         (Field.FieldBuilder): New member.
11601         (TypeContainer::Populate): Update accordingly.
11602         (TypeContainer::FindMembers): Implement.
11603
11604 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
11605
11606         * statement.cs: (VariableInfo::VariableType): New field to be
11607         initialized with the full type once it is resolved. 
11608
11609 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
11610
11611         * parameter.cs (GetParameterInfo): Use a type cache to compute
11612         things only once, and to reuse this information
11613
11614         * expression.cs (LocalVariableReference::Emit): Implement.
11615         (OpcodeCast::Emit): fix.
11616
11617         (ParameterReference::Resolve): Implement.
11618         (ParameterReference::Emit): Implement.
11619
11620         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
11621         that are expressions need to stay as Expressions.
11622
11623         * typemanager.cs (CSharpName): Returns the C# name of a type if
11624         possible. 
11625
11626         * expression.cs (Expression::ConvertImplicit): New function that
11627         implements implicit type conversions.
11628
11629         (Expression::ImplicitReferenceConversion): Implements implicit
11630         reference conversions.
11631
11632         (EmptyCast): New type for transparent casts.
11633
11634         (OpcodeCast): New type for casts of types that are performed with
11635         a sequence of bytecodes.
11636         
11637         (BoxedCast): New type used for casting value types into reference
11638         types.  Emits a box opcode.
11639
11640         (Binary::DoNumericPromotions): Implements numeric promotions of
11641         and computation of the Binary::Type.
11642
11643         (Binary::EmitBranchable): Optimization.
11644
11645         (Binary::Emit): Implement code emission for expressions.
11646         
11647         * typemanager.cs (TypeManager): Added two new core types: sbyte
11648         and byte.
11649
11650 2001-09-12  Ravi Pratap  <ravi@ximian.com>
11651
11652         * class.cs (TypeContainer::FindMembers): Method which does exactly
11653         what Type.FindMembers does, only we don't have to use reflection. No
11654         implementation yet.
11655
11656         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
11657         typecontainer objects as we need to get at them.
11658         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
11659
11660         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
11661         typecontainer object.
11662
11663         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
11664         of just a Report object.
11665
11666 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11667
11668         * class.cs (Event::Define): Go back to using the prefixes "add_" and
11669         "remove_"
11670         (TypeContainer::Populate): Now define the delegates of the type too.
11671         (TypeContainer.Delegates): Property to access the list of delegates defined
11672         in the type.
11673
11674         * delegates.cs (Delegate::Define): Implement partially.
11675
11676         * modifiers.cs (TypeAttr): Handle more flags.
11677
11678 2001-09-11  Ravi Pratap  <ravi@ximian.com>
11679
11680         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
11681         and not <=
11682         (Operator::Define): Re-write logic to get types by using the LookupType method
11683         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
11684         (Indexer::Define): Ditto.
11685         (Event::Define): Ditto.
11686         (Property::Define): Ditto.
11687         
11688 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11689
11690         * class.cs (TypeContainer::Populate): Now define operators too. 
11691         (TypeContainer.Operators): New property to access the list of operators
11692         in a type.
11693         (Operator.OperatorMethodBuilder): New member to hold the method builder
11694         for the operator we are defining.
11695         (Operator::Define): Implement.
11696
11697 2001-09-10  Ravi Pratap  <ravi@ximian.com>
11698
11699         * class.cs (Event::Define): Make the prefixes of the accessor methods
11700         addOn_ and removeOn_ 
11701
11702         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
11703         of the location being passed in too. Ideally, this should go later since all
11704         error reporting should be done through the Report object.
11705
11706         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
11707         (Populate): Iterate thru the indexers we have and define them too.
11708         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
11709         for the get and set accessors.
11710         (Indexer::Define): Implement.
11711         
11712 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
11713
11714         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
11715         my previous implementation, did not work.
11716
11717         * typemanager.cs: Add a couple of missing types (the longs).
11718
11719         * literal.cs: Use TypeManager.bool_type instead of getting it.
11720
11721         * expression.cs (EventExpr): New kind of expressions.
11722         (Expressio::ExprClassFromMemberInfo): finish
11723
11724 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
11725
11726         * assign.cs: Emit stores to static fields differently.
11727
11728 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11729
11730         * Merge in changes and adjust code to tackle conflicts. Backed out my
11731         code in Assign::Resolve ;-) 
11732
11733 2001-09-08  Ravi Pratap  <ravi@ximian.com>
11734
11735         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
11736         instead Report.Error and also pass in the location.
11737         (CSharpParser::Lexer): New readonly property to return the reference
11738         to the Tokenizer object.
11739         (declare_local_variables): Use Report.Error with location instead of plain 
11740         old error.
11741         (CheckDef): Ditto.
11742
11743         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
11744         (Operator.CheckBinaryOperator): Ditto.
11745
11746         * cs-parser.jay (operator_declarator): Update accordingly.
11747
11748         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
11749         (CheckBinaryOperator): Same here.
11750
11751         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
11752         on the name without any prefixes of namespace names etc. This is because we
11753         already might have something already fully qualified like 
11754         'System.Console.WriteLine'
11755
11756         * assign.cs (Resolve): Begin implementation. Stuck ;-)
11757
11758 2001-09-07  Ravi Pratap  <ravi@ximian.com>
11759
11760         * cs-tokenizer.cs (location): Return a string which also contains
11761         the file name.
11762
11763         * expression.cs (ElementAccess): New class for expressions of the
11764         type 'element access.'
11765         (BaseAccess): New class for expressions of the type 'base access.'
11766         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
11767         respectively.
11768         
11769         * cs-parser.jay (element_access): Implement action.
11770         (base_access): Implement actions.
11771         (checked_expression, unchecked_expression): Implement.
11772
11773         * cs-parser.jay (local_variable_type): Correct and implement.
11774         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
11775
11776         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
11777
11778         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
11779         name and the specifiers.
11780
11781         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
11782         
11783         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
11784         making them all public ;-)
11785
11786         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
11787         class anyways.
11788         
11789 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
11790
11791         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
11792         PropertyExprs.
11793         (FieldExpr, PropertyExprs): New resolved expressions.
11794         (SimpleName::MemberStaticCheck): Perform static checks for access
11795         to non-static fields on static methods. Maybe this should be
11796         generalized for MemberAccesses. 
11797         (SimpleName::ResolveSimpleName): More work on simple name
11798         resolution. 
11799
11800         * cs-parser.jay (primary_expression/qualified_identifier): track
11801         the parameter index.
11802
11803         * codegen.cs (CodeGen::Save): Catch save exception, report error.
11804         (EmitContext::EmitBoolExpression): Chain to expression generation
11805         instead of temporary hack.
11806         (::EmitStatementExpression): Put generic expression code generation.
11807
11808         * assign.cs (Assign::Emit): Implement variable assignments to
11809         local variables, parameters and fields.
11810
11811 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * statement.cs (Block::GetVariableInfo): New method, returns the
11814         VariableInfo for a variable name in a block.
11815         (Block::GetVariableType): Implement in terms of GetVariableInfo
11816
11817         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
11818         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
11819
11820 2001-09-06  Ravi Pratap  <ravi@ximian.com>
11821
11822         * cs-parser.jay (operator_declaration): Continue on my quest : update
11823         to take attributes argument.
11824         (event_declaration): Ditto.
11825         (enum_declaration): Ditto.
11826         (indexer_declaration): Ditto.
11827         
11828         * class.cs (Operator::Operator): Update constructor accordingly.
11829         (Event::Event): Ditto.
11830
11831         * delegate.cs (Delegate::Delegate): Same here.
11832
11833         * enum.cs (Enum::Enum): Same here.
11834         
11835 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11836
11837         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
11838
11839         * ../tests/cs0658.cs : New file to demonstrate error 0658.
11840
11841         * attribute.cs (Attributes): New class to encapsulate all attributes which were
11842         being passed around as an arraylist.
11843         (Attributes::AddAttribute): Method to add attribute sections.
11844
11845         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
11846         (struct_declaration): Update accordingly.
11847         (constant_declaration): Update.
11848         (field_declaration): Update.
11849         (method_header): Update.
11850         (fixed_parameter): Update.
11851         (parameter_array): Ditto.
11852         (property_declaration): Ditto.
11853         (destructor_declaration): Ditto.
11854         
11855         * class.cs (Struct::Struct): Update constructors accordingly.
11856         (Class::Class): Ditto.
11857         (Field::Field): Ditto.
11858         (Method::Method): Ditto.
11859         (Property::Property): Ditto.
11860         (TypeContainer::OptAttribute): update property's return type.
11861         
11862         * interface.cs (Interface.opt_attributes): New member.
11863         (Interface::Interface): Update to take the extra Attributes argument.
11864
11865         * parameter.cs (Parameter::Parameter): Ditto.
11866
11867         * constant.cs (Constant::Constant): Ditto.
11868
11869         * interface.cs (InterfaceMemberBase): New OptAttributes field.
11870         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
11871         the attributes as a parameter.
11872         (InterfaceProperty): Update constructor call.
11873         (InterfaceEvent): Ditto.
11874         (InterfaceMethod): Ditto.
11875         (InterfaceIndexer): Ditto.
11876
11877         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
11878         pass the attributes too.
11879         (interface_event_declaration): Ditto.
11880         (interface_property_declaration): Ditto.
11881         (interface_method_declaration): Ditto.
11882         (interface_declaration): Ditto.
11883
11884 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
11885
11886         * class.cs (Method::Define): Track the "static Main" definition to
11887         create an entry point. 
11888
11889         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
11890         EntryPoint if we find it. 
11891
11892         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
11893         (EmitContext::ig): Make this variable public.
11894
11895         * driver.cs: Make the default output file be the first file name
11896         with the .exe extension.  
11897
11898         Detect empty compilations
11899
11900         Handle various kinds of output targets.  Handle --target and
11901         rename -t to --dumper.
11902
11903         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
11904         methods inherited from Expression return now an Expression.  This
11905         will is used during the tree rewriting as we resolve them during
11906         semantic analysis.
11907
11908         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
11909         the spec.  Missing entirely is the information about
11910         accessability of elements of it.
11911
11912         (Expression::ExprClassFromMemberInfo): New constructor for
11913         Expressions that creates a fully initialized Expression based on
11914         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
11915         a Type.
11916
11917         (Invocation::Resolve): Begin implementing resolution of invocations.
11918         
11919         * literal.cs (StringLiteral):  Implement Emit.
11920
11921 2001-09-05  Ravi Pratap  <ravi@ximian.com>
11922
11923         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
11924         member.
11925         
11926 2001-09-04  Ravi Pratap  <ravi@ximian.com>
11927
11928         * cs-parser.jay (attribute_arguments): Implement actions.
11929         (attribute): Fix bug in production. Implement action.
11930         (attribute_list): Implement.
11931         (attribute_target): Implement.
11932         (attribute_target_specifier, opt_target_specifier): Implement
11933         (CheckAttributeTarget): New method to check if the attribute target
11934         is valid.
11935         (attribute_section): Implement.
11936         (opt_attributes): Implement.
11937
11938         * attribute.cs : New file to handle attributes.
11939         (Attribute): Class to hold attribute info.
11940
11941         * cs-parser.jay (opt_attribute_target_specifier): Remove production
11942         (attribute_section): Modify production to use 2 different rules to 
11943         achieve the same thing. 1 s/r conflict down !
11944         Clean out commented, useless, non-reducing dimension_separator rules.
11945         
11946         * class.cs (TypeContainer.attributes): New member to hold list
11947         of attributes for a type.
11948         (Struct::Struct): Modify to take one more argument, the attribute list.
11949         (Class::Class): Ditto.
11950         (Field::Field): Ditto.
11951         (Method::Method): Ditto.
11952         (Property::Property): Ditto.
11953         
11954         * cs-parser.jay (struct_declaration): Update constructor call to
11955         pass in the attributes too.
11956         (class_declaration): Ditto.
11957         (constant_declaration): Ditto.
11958         (field_declaration): Ditto.
11959         (method_header): Ditto.
11960         (fixed_parameter): Ditto.
11961         (parameter_array): Ditto.
11962         (property_declaration): Ditto.
11963
11964         * constant.cs (Constant::Constant): Update constructor similarly.
11965         Use System.Collections.
11966
11967         * parameter.cs (Parameter::Parameter): Update as above.
11968
11969 2001-09-02  Ravi Pratap  <ravi@ximian.com>
11970
11971         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
11972         (TypeContainer.delegates): New member to hold list of delegates.
11973
11974         * cs-parser.jay (delegate_declaration): Implement the action correctly 
11975         this time as I seem to be on crack ;-)
11976
11977 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
11978
11979         * rootcontext.cs (RootContext::IsNamespace): new function, used to
11980         tell whether an identifier represents a namespace.
11981
11982         * expression.cs (NamespaceExpr): A namespace expression, used only
11983         temporarly during expression resolution.
11984         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
11985         utility functions to resolve names on expressions.
11986
11987 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
11988
11989         * codegen.cs: Add hook for StatementExpressions. 
11990
11991         * class.cs: Fix inverted test for static flag in methods.
11992
11993 2001-09-02  Ravi Pratap  <ravi@ximian.com>
11994
11995         * class.cs (Operator::CheckUnaryOperator): Correct error number used
11996         to make it coincide with MS' number.
11997         (Operator::CheckBinaryOperator): Ditto.
11998
11999         * ../errors/errors.txt : Remove error numbers added earlier.
12000
12001         * ../errors/cs1019.cs : Test case for error # 1019
12002
12003         * ../errros/cs1020.cs : Test case for error # 1020
12004
12005         * cs-parser.jay : Clean out commented cruft.
12006         (dimension_separators, dimension_separator): Comment out. Ostensibly not
12007         used anywhere - non-reducing rule.
12008         (namespace_declarations): Non-reducing rule - comment out.
12009
12010         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
12011         with TypeContainer::AddEnum.
12012
12013         * delegate.cs : New file for delegate handling classes.
12014         (Delegate): Class for declaring delegates.
12015
12016         * makefile : Update.
12017
12018         * cs-parser.jay (delegate_declaration): Implement.
12019
12020 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
12021
12022         * class.cs (Event::Define): Implement.
12023         (Event.EventBuilder): New member.
12024
12025         * class.cs (TypeContainer::Populate): Update to define all enums and events
12026         we have.
12027         (Events): New property for the events arraylist we hold. Shouldn't we move to using
12028         readonly fields for all these cases ?
12029
12030 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12031
12032         * class.cs (Property): Revamp to use the convention of making fields readonly.
12033         Accordingly modify code elsewhere.
12034
12035         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
12036         the Define method of the Property class.
12037
12038         * class.cs : Clean up applied patch and update references to variables etc. Fix 
12039         trivial bug.
12040         (TypeContainer::Populate): Update to define all the properties we have. Also
12041         define all enumerations.
12042
12043         * enum.cs (Define): Implement.
12044         
12045 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
12046
12047         * cs-parser.jay (overloadable_operator): The semantic value is an
12048         enum of the Operator class.
12049         (operator_declarator): Implement actions.
12050         (operator_declaration): Implement.
12051
12052         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
12053         validity of definitions.
12054         (Operator::CheckBinaryOperator): Static method to check for binary operators
12055         (TypeContainer::AddOperator): New method to add an operator to a type.
12056
12057         * cs-parser.jay (indexer_declaration): Added line to actually call the
12058         AddIndexer method so it gets added ;-)
12059
12060         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
12061         already taken care of by the MS compiler ?  
12062
12063 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12064
12065         * class.cs (Operator): New class for operator declarations.
12066         (Operator::OpType): Enum for the various operators.
12067
12068 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
12069
12070         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
12071         ostensibly handle this in semantic analysis.
12072
12073         * cs-parser.jay (general_catch_clause): Comment out
12074         (specific_catch_clauses, specific_catch_clause): Ditto.
12075         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
12076         (catch_args, opt_catch_args): New productions.
12077         (catch_clause): Rewrite to use the new productions above
12078         (catch_clauses): Modify accordingly.
12079         (opt_catch_clauses): New production to use in try_statement
12080         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
12081         and re-write the code in the actions to extract the specific and
12082         general catch clauses by being a little smart ;-)
12083
12084         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
12085         Hooray, try and catch statements parse fine !
12086         
12087 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12088
12089         * statement.cs (Block::GetVariableType): Fix logic to extract the type
12090         string from the hashtable of variables.
12091
12092         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
12093         I end up making that mistake ;-)
12094         (catch_clauses): Fixed gross error which made Key and Value of the 
12095         DictionaryEntry the same : $1 !!
12096
12097 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12098
12099         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
12100
12101         * cs-parser.jay (event_declaration): Correct to remove the semicolon
12102         when the add and remove accessors are specified. 
12103
12104 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
12105
12106         * cs-parser.jay (IndexerDeclaration): New helper class to hold
12107         information about indexer_declarator.
12108         (indexer_declarator): Implement actions.
12109         (parsing_indexer): New local boolean used to keep track of whether
12110         we are parsing indexers or properties. This is necessary because 
12111         implicit_parameters come into picture even for the get accessor in the 
12112         case of an indexer.
12113         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
12114
12115         * class.cs (Indexer): New class for indexer declarations.
12116         (TypeContainer::AddIndexer): New method to add an indexer to a type.
12117         (TypeContainer::indexers): New member to hold list of indexers for the
12118         type.
12119
12120 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12121
12122         * cs-parser.jay (add_accessor_declaration): Implement action.
12123         (remove_accessor_declaration): Implement action.
12124         (event_accessors_declaration): Implement
12125         (variable_declarators): swap statements for first rule - trivial.
12126
12127         * class.cs (Event): New class to hold information about event
12128         declarations.
12129         (TypeContainer::AddEvent): New method to add an event to a type
12130         (TypeContainer::events): New member to hold list of events.
12131
12132         * cs-parser.jay (event_declaration): Implement actions.
12133
12134 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
12135
12136         * cs-parser.jay (dim_separators): Implement. Make it a string
12137         concatenating all the commas together, just as they appear.
12138         (opt_dim_separators): Modify accordingly
12139         (rank_specifiers): Update accordingly. Basically do the same
12140         thing - instead, collect the brackets here.
12141         (opt_rank_sepcifiers): Modify accordingly.
12142         (array_type): Modify to actually return the complete type string
12143         instead of ignoring the rank_specifiers.
12144         (expression_list): Implement to collect the expressions
12145         (variable_initializer): Implement. We make it a list of expressions
12146         essentially so that we can handle the array_initializer case neatly too.
12147         (variable_initializer_list): Implement.
12148         (array_initializer): Make it a list of variable_initializers
12149         (opt_array_initializer): Modify accordingly.
12150
12151         * expression.cs (New::NType): Add enumeration to help us
12152         keep track of whether we have an object/delegate creation
12153         or an array creation.
12154         (New:NewType, New::Rank, New::Indices, New::Initializers): New
12155         members to hold data about array creation.
12156         (New:New): Modify to update NewType
12157         (New:New): New Overloaded contructor for the array creation
12158         case.
12159
12160         * cs-parser.jay (array_creation_expression): Implement to call
12161         the overloaded New constructor.
12162         
12163 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
12164
12165         * class.cs (TypeContainer::Constructors): Return member
12166         constructors instead of returning null.
12167
12168 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
12169
12170         * typemanager.cs (InitCoreTypes): Initialize the various core
12171         types after we have populated the type manager with the user
12172         defined types (this distinction will be important later while
12173         compiling corlib.dll)
12174
12175         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
12176         on Expression Classification.  Now all expressions have a method
12177         `Resolve' and a method `Emit'.
12178
12179         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
12180         generation from working.     Also add some temporary debugging
12181         code. 
12182         
12183 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
12184
12185         * codegen.cs: Lots of code generation pieces.  This is only the
12186         beginning, will continue tomorrow with more touches of polish.  We
12187         handle the fundamentals of if, while, do, for, return.  Others are
12188         trickier and I need to start working on invocations soon.
12189         
12190         * gen-treedump.cs: Bug fix, use s.Increment here instead of
12191         s.InitStatement. 
12192
12193         * codegen.cs (EmitContext): New struct, used during code
12194         emission to keep a context.   Most of the code generation will be
12195         here. 
12196
12197         * cs-parser.jay: Add embedded blocks to the list of statements of
12198         this block.  So code generation proceeds in a top down fashion.
12199
12200 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
12201
12202         * statement.cs: Add support for multiple child blocks.
12203
12204 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
12205
12206         * codegen.cs (EmitCode): New function, will emit the code for a
12207         Block of code given a TypeContainer and its ILGenerator. 
12208
12209         * statement.cs (Block): Standard public readonly optimization.
12210         (Block::Block constructors): Link children. 
12211         (Block::Child): Child Linker.
12212         (Block::EmitVariables): Emits IL variable declarations.
12213
12214         * class.cs: Drop support for MethodGroups here, delay until
12215         Semantic Analysis.
12216         (Method::): Applied the same simplification that I did before, and
12217         move from Properties to public readonly fields.
12218         (Method::ParameterTypes): Returns the parameter types for the
12219         function, and implements a cache that will be useful later when I
12220         do error checking and the semantic analysis on the methods is
12221         performed.
12222         (Constructor::GetCallingConvention): Renamed from CallingConvetion
12223         and made a method, optional argument tells whether this is a class
12224         or a structure to apply the `has-this' bit.
12225         (Method::GetCallingConvention): Implement, returns the calling
12226         convention. 
12227         (Method::Define): Defines the type, a second pass is performed
12228         later to populate the methods.
12229
12230         (Constructor::ParameterTypes): implement a cache similar to the
12231         one on Method::ParameterTypes, useful later when we do semantic
12232         analysis. 
12233
12234         (TypeContainer::EmitMethod):  New method.  Emits methods.
12235
12236         * expression.cs: Removed MethodGroup class from here.
12237         
12238         * parameter.cs (Parameters::GetCallingConvention): new method.
12239
12240 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
12241
12242         * class.cs (TypeContainer::Populate): Drop RootContext from the
12243         argument. 
12244
12245         (Constructor::CallingConvention): Returns the calling convention.
12246         (Constructor::ParameterTypes): Returns the constructor parameter
12247         types. 
12248         
12249         (TypeContainer::AddConstructor): Keep track of default constructor
12250         and the default static constructor.
12251
12252         (Constructor::) Another class that starts using `public readonly'
12253         instead of properties. 
12254
12255         (Constructor::IsDefault): Whether this is a default constructor. 
12256
12257         (Field::) use readonly public fields instead of properties also.
12258
12259         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
12260         track of static constructors;  If none is used, turn on
12261         BeforeFieldInit in the TypeAttributes. 
12262
12263         * cs-parser.jay (opt_argument_list): now the return can be null
12264         for the cases where there are no arguments. 
12265
12266         (constructor_declarator): If there is no implicit `base' or
12267         `this', then invoke the default parent constructor. 
12268         
12269         * modifiers.cs (MethodAttr): New static function maps a set of
12270         modifiers flags into a MethodAttributes enum
12271         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
12272         MethodAttr, TypeAttr to represent the various mappings where the
12273         modifiers are used.
12274         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
12275
12276 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
12277
12278         * parameter.cs (GetParameterInfo): Fix bug where there would be no
12279         method arguments.
12280
12281         * interface.cs (PopulateIndexer): Implemented the code generator
12282         for interface indexers.
12283
12284 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
12285
12286         * interface.cs (InterfaceMemberBase): Now we track the new status
12287         here.  
12288
12289         (PopulateProperty): Implement property population.  Woohoo!  Got
12290         Methods and Properties going today. 
12291
12292         Removed all the properties for interfaces, and replaced them with
12293         `public readonly' fields. 
12294
12295 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
12296
12297         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
12298         initialize their hashtables/arraylists only when they are needed
12299         instead of doing this always.
12300
12301         * parameter.cs: Handle refs and out parameters.
12302
12303         * cs-parser.jay: Use an ArrayList to construct the arguments
12304         instead of the ParameterCollection, and then cast that to a
12305         Parameter[] array.
12306
12307         * parameter.cs: Drop the use of ParameterCollection and use
12308         instead arrays of Parameters.
12309
12310         (GetParameterInfo): Use the Type, not the Name when resolving
12311         types. 
12312
12313 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
12314
12315         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
12316         and instead use public readonly fields.
12317
12318         * class.cs: Put back walking code for type containers.
12319
12320 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
12321
12322         * class.cs (MakeConstant): Code to define constants.
12323
12324         * rootcontext.cs (LookupType): New function.  Used to locate types 
12325
12326         
12327 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
12328
12329         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
12330         this System.Reflection code is.  Kudos to Microsoft
12331         
12332         * typemanager.cs: Implement a type cache and avoid loading all
12333         types at boot time.  Wrap in LookupType the internals.  This made
12334         the compiler so much faster.  Wow.  I rule!
12335         
12336         * driver.cs: Make sure we always load mscorlib first (for
12337         debugging purposes, nothing really important).
12338
12339         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
12340         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
12341
12342         * rootcontext.cs: Lookup types on their namespace;  Lookup types
12343         on namespaces that have been imported using the `using' keyword.
12344
12345         * class.cs (TypeContainer::TypeAttr): Virtualize.
12346         (Class::TypeAttr): Return attributes suitable for this bad boy.
12347         (Struct::TypeAttr): ditto.
12348         Handle nested classes.
12349         (TypeContainer::) Remove all the type visiting code, it is now
12350         replaced with the rootcontext.cs code
12351
12352         * rootcontext.cs (GetClassBases): Added support for structs. 
12353
12354 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
12355
12356         * interface.cs, statement.cs, class.cs, parameter.cs,
12357         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
12358         Drop use of TypeRefs, and use strings instead.
12359
12360 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
12361
12362         * rootcontext.cs: 
12363
12364         * class.cs (Struct::Struct): set the SEALED flags after
12365         checking the modifiers.
12366         (TypeContainer::TypeAttr): new property, returns the
12367         TypeAttributes for a class.  
12368
12369         * cs-parser.jay (type_list): Oops, list production was creating a
12370         new list of base types.
12371
12372         * rootcontext.cs (StdLib): New property.
12373         (GetInterfaceTypeByName): returns an interface by type name, and
12374         encapsulates error handling here.
12375         (GetInterfaces): simplified.
12376         (ResolveTree): Encapsulated all the tree resolution here.
12377         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
12378         types. 
12379         
12380         * driver.cs: Add support for --nostdlib, to avoid loading the
12381         default assemblies.
12382         (Main): Do not put tree resolution here. 
12383
12384         * rootcontext.cs: Beginning of the class resolution.
12385
12386 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
12387
12388         * rootcontext.cs: Provide better error reporting. 
12389
12390         * cs-parser.jay (interface_base): set our $$ to be interfaces.
12391
12392         * rootcontext.cs (CreateInterface): Handle the case where there
12393         are no parent interfaces.
12394         
12395         (CloseTypes): Routine to flush types at the end.
12396         (CreateInterface): Track types.
12397         (GetInterfaces): Returns an array of Types from the list of
12398         defined interfaces.
12399
12400         * typemanager.c (AddUserType): Mechanism to track user types (puts
12401         the type on the global type hash, and allows us to close it at the
12402         end). 
12403         
12404 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
12405
12406         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
12407         RecordInterface instead.
12408
12409         * cs-parser.jay: Updated to reflect changes above.
12410
12411         * decl.cs (Definition): Keep track of the TypeBuilder type that
12412         represents this type here.  Not sure we will use it in the long
12413         run, but wont hurt for now.
12414
12415         * driver.cs: Smaller changes to accomodate the new code.
12416
12417         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
12418         when done. 
12419
12420         * rootcontext.cs (CreateInterface):  New method, used to create
12421         the System.TypeBuilder type for interfaces.
12422         (ResolveInterfaces): new entry point to resolve the interface
12423         hierarchy. 
12424         (CodeGen): Property, used to keep track of the code generator.
12425
12426 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
12427
12428         * cs-parser.jay: Add a second production for delegate_declaration
12429         with `VOID'.
12430
12431         (enum_body): Put an opt_comma here instead of putting it on
12432         enum_body or enum_member_declarations so we can handle trailing
12433         commas on enumeration members.  Gets rid of a shift/reduce.
12434         
12435         (type_list): Need a COMMA in the middle.
12436
12437         (indexer_declaration): Tell tokenizer to recognize get/set
12438
12439         * Remove old targets.
12440
12441         * Re-add the parser target.
12442
12443 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12444
12445         * cs-parser.jay: Add precendence rules for a number of operators
12446         ot reduce the number of shift/reduce conflicts in the grammar.
12447         
12448 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
12449
12450         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
12451         and put it here.
12452
12453         Get rid of old crufty code.
12454
12455         * rootcontext.cs: Use this to keep track of the parsed
12456         representation and the defined types available to the program. 
12457
12458         * gen-treedump.cs: adjust for new convention.
12459
12460         * type.cs: Split out the type manager, and the assembly builder
12461         from here. 
12462
12463         * typemanager.cs: the type manager will live here now.
12464
12465         * cil-codegen.cs: And the code generator here. 
12466
12467 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
12468
12469         * makefile: Fixed up for easy making.
12470
12471 2001-07-13  Simon Cozens <simon@simon-cozens.org>
12472
12473         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
12474         the 
12475
12476         (unary_expression): Expand pre_increment_expression and
12477         post_decrement_expression to reduce a shift/reduce.
12478
12479 2001-07-11  Simon Cozens
12480
12481         * cs-tokenizer.cs: Hex numbers should begin with a 0.
12482
12483         Improve allow_keyword_as_indent name.
12484
12485 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
12486
12487         * Adjustments for Beta2. 
12488
12489 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * decl.cs: Added `Define' abstract method.
12492         (InTransit): new property, used to catch recursive definitions. 
12493
12494         * interface.cs: Implement `Define'. 
12495
12496         * modifiers.cs: Map Modifiers.constants to
12497         System.Reflection.TypeAttribute flags.
12498
12499         * class.cs: Keep track of types and user-defined types.
12500         (BuilderInit): New method for creating an assembly
12501         (ResolveType): New function to launch the resolution process, only
12502         used by interfaces for now.
12503
12504         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
12505         that are inserted into the name space. 
12506
12507 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
12508
12509         * ARGH.  I have screwed up my tree so many times due to the use of
12510         rsync rather than using CVS.  Going to fix this at once. 
12511
12512         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
12513         load types.
12514
12515 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
12516
12517         * Experiment successful: Use System.Type rather that our own
12518         version of Type.  
12519
12520 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
12521
12522         * cs-parser.jay: Removed nsAliases from here.
12523
12524         Use new namespaces, handle `using XXX;' 
12525
12526         * namespace.cs: Reimplemented namespace handling, use a recursive
12527         definition of the class.  Now we can keep track of using clauses
12528         and catch invalid using clauses.
12529
12530 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
12531
12532         * gen-treedump.cs: Adapted for all the renaming.
12533
12534         * expression.cs (Expression): this class now has a Type property
12535         which returns an expression Type.
12536
12537         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
12538         `Type', as this has a different meaning now in the base
12539
12540 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
12541
12542         * interface.cs, class.cs: Removed from all the sources the
12543         references to signature computation, as we can not do method
12544         signature computation during the parsing time, as we are not
12545         trying to solve at that point distinguishing:
12546
12547         class X {
12548                 void a (Blah x) {}
12549                 void a (NS.Blah x) {}
12550         }
12551
12552         Which depending on the context might be valid or not, as we do not
12553         know if Blah is the same thing as NS.Blah at that point.
12554
12555         * Redid everything so the code uses TypeRefs now instead of
12556         Types.  TypeRefs are just temporary type placeholders, that need
12557         to be resolved.  They initially have a pointer to a string and the
12558         current scope in which they are used.  This is used later by the
12559         compiler to resolve the reference to an actual Type. 
12560
12561         * DeclSpace is no longer a CIR.Type, and neither are
12562         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
12563         are all DeclSpaces, but no Types. 
12564
12565         * type.cs (TypeRefManager): This implements the TypeRef manager,
12566         which keeps track of all the types that need to be resolved after
12567         the parsing has finished. 
12568
12569 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * ARGH.  We are going to have to store `foreach' as a class rather
12572         than resolving it, as we need to verify error 1579 after name
12573         resolution.   *OR* we could keep a flag that says `This request to
12574         IEnumerator comes from a foreach statement' which we can then use
12575         to generate the error.
12576
12577 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
12578
12579         * class.cs (TypeContainer.AddMethod): we now add methods to the
12580         MethodGroup instead of the method hashtable.  
12581
12582         * expression.cs: Add MethodGroup abstraction, which gets us one
12583         step closer to the specification in the way we handle method
12584         declarations.  
12585
12586         * cs-parser.jay (primary_expression): qualified_identifier now
12587         tried to match up an identifier to a local variable reference or
12588         to a parameter reference.
12589
12590         current_local_parameters is now a parser global variable that
12591         points to the current parameters for the block, used during name
12592         lookup.
12593
12594         (property_declaration): Now creates an implicit `value' argument to
12595         the set accessor.
12596
12597 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
12598
12599         * parameter.cs: Do not use `param' arguments as part of the
12600         signature, per the spec.
12601
12602 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
12603
12604         * decl.cs: Base class for classes, structs and interfaces.  This
12605         is the "Declaration Space" 
12606
12607         * cs-parser.jay: Use CheckDef for checking declaration errors
12608         instead of having one on each function.
12609
12610         * class.cs: Factor out some code for handling error handling in
12611         accordance to the "Declarations" section in the "Basic Concepts"
12612         chapter in the ECMA C# spec.
12613
12614         * interface.cs: Make all interface member classes derive from
12615         InterfaceMemberBase.
12616
12617 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
12618
12619         * Many things: all interfaces are parsed and generated in
12620         gen-treedump.  Support for member variables, constructors,
12621         destructors, properties, constants is there.
12622
12623         Beginning of the IL backend, but very little done, just there for
12624         testing purposes. 
12625
12626 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
12627
12628         * cs-parser.jay: Fix labeled statement.
12629
12630         * cs-tokenizer.cs (escape): Escape " and ' always.
12631         ref_line, ref_name: keep track of the line/filename as instructed
12632         by #line by the compiler.
12633         Parse #line.
12634
12635 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
12636
12637         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
12638         to match the values in System.CodeDOM.
12639
12640         Divid renamed to Divide.
12641
12642         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
12643         statements. 
12644         (Statements.set): remove.
12645
12646         * System.CodeDOM/CodeCatchClause.cs: always have a valid
12647         statements. 
12648
12649         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
12650         falseStatements always have valid values. 
12651
12652         * cs-parser.jay: Use System.CodeDOM now.
12653