Added OdbcErrorCollection.cs to list.
[mono.git] / mcs / mcs / ChangeLog
1 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
2
3         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
4
5 2002-10-20  Mark Crichton  <crichton@gimp.org>
6
7         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
8
9 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10
11         * cfold.cs: Fixed compile blocker.
12
13 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14
15         * driver.cs: I was chekcing the key, not the file.
16
17 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18
19         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20         message that we were generating - we just need to silently return
21         a null.
22
23 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
24
25         * class.cs (Event.Define): Change my previous commit, as this
26         breaks the debugger.  This is a temporary hack, as it seems like
27         the compiler is generating events incorrectly to begin with.
28
29         * expression.cs (Binary.ResolveOperator): Added support for 
30         "U operator - (E x, E y)"
31
32         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
33         y)".
34
35         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
36         init-only variables, but this path did not take into account that
37         there might be also instance readonly variables.  Correct this
38         problem. 
39
40         This fixes bug 32253
41
42         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
43         delegates as well.
44
45         * driver.cs: Change the extension for modules to `netmodule'
46
47         * cs-parser.jay: Improved slightly the location tracking for
48         the debugger symbols.
49
50         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
51         modifiers that were specified instead of the hardcoded value
52         (FamAndAssem).  This was basically ignoring the static modifier,
53         and others.  Fixes 32429.
54
55         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
56         fixed a bug in the process (32476)
57
58         * expression.cs (ArrayAccess.EmitAssign): Patch from
59         hwang_rob@yahoo.ca that fixes bug 31834.3
60
61 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
62
63         * driver.cs: Make the module extension .netmodule.
64
65 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
66
67         * driver.cs: Report an error if the resource file is not found
68         instead of crashing.
69
70         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
71         false, like Emit does.
72
73 2002-10-16  Nick Drochak  <ndrochak@gol.com>
74
75         * typemanager.cs: Remove unused private member.  Also reported mcs
76         bug to report this as a warning like csc.
77
78 2002-10-15  Martin Baulig  <martin@gnome.org>
79
80         * statement.cs (Statement.Emit): Made this a virtual method; emits
81         the line number info and calls DoEmit().
82         (Statement.DoEmit): New protected abstract method, formerly knows
83         as Statement.Emit().
84
85         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
86
87 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
88
89         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
90         have fixed a remaining problem: not every AddXXXX was adding a
91         fully qualified name.  
92
93         Now everyone registers a fully qualified name in the DeclSpace as
94         being defined instead of the partial name.  
95
96         Downsides: we are slower than we need to be due to the excess
97         copies and the names being registered this way.  
98
99         The reason for this is that we currently depend (on the corlib
100         bootstrap for instance) that types are fully qualified, because
101         we dump all the types in the namespace, and we should really have
102         types inserted into the proper namespace, so we can only store the
103         basenames in the defined_names array.
104
105 2002-10-10  Martin Baulig  <martin@gnome.org>
106
107         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
108         from bug #31834, see the bug report for a testcase which is
109         miscompiled.
110
111 2002-10-10  Martin Baulig  <martin@gnome.org>
112
113         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
114         flow analysis code for this.
115
116         * statement.cs (Do, While, For): Tell the flow analysis code about
117         infinite loops.
118         (FlowBranching.UsageVector): Added support for infinite loops.
119         (Block.Resolve): Moved the dead code elimination here and use flow
120         analysis to do it.
121
122 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
123
124         * class.cs (Field.Define): Catch cycles on struct type
125         definitions. 
126
127         * typemanager.cs (IsUnmanagedtype): Do not recursively check
128         fields if the fields are static.  We only need to check instance
129         fields. 
130
131         * expression.cs (As.DoResolve): Test for reference type.
132
133         * statement.cs (Using.ResolveExpression): Use
134         ConvertImplicitRequired, not ConvertImplicit which reports an
135         error on failture
136         (Using.ResolveLocalVariableDecls): ditto.
137
138         * expression.cs (Binary.ResolveOperator): Report errors in a few
139         places where we had to.
140
141         * typemanager.cs (IsUnmanagedtype): Finish implementation.
142
143 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
144
145         * expression.cs: Use StoreFromPtr instead of extracting the type
146         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
147
148         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
149         an enumeration value to a System.Enum, but System.Enum is not a
150         value type, but an class type, so we need to box.
151
152         (Expression.ConvertExplicit): One codepath could return
153         errors but not flag them.  Fix this.  Fixes #31853
154
155         * parameter.cs (Resolve): Do not allow void as a parameter type.
156
157 2002-10-06  Martin Baulig  <martin@gnome.org>
158
159         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
160         if it's a class type and not a struct.  Fixes #31815.
161
162 2002-10-06  Martin Baulig  <martin@gnome.org>
163
164         * statement.cs: Reworked the flow analysis code a bit to make it
165         usable for dead code elimination.
166
167 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
168
169         * cs-parser.jay: allow empty source files. Fixes bug #31781.
170
171 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
172
173         * expression.cs (ComposedCast.DoResolveType): A quick workaround
174         to fix the test 165, will investigate deeper.
175
176 2002-10-04  Martin Baulig  <martin@gnome.org>
177
178         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
179         finally blocks actually work.
180         (Try.Resolve): We don't need to create a sibling for `finally' if
181         there is no finally block.
182
183 2002-10-04  Martin Baulig  <martin@gnome.org>
184
185         * class.cs (Constructor.Define): The default accessibility for a
186         non-default constructor is private, not public.
187
188 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
189
190         * class.cs (Constructor): Make AllowedModifiers public, add
191         EXTERN.
192
193         * cs-parser.jay: Perform the modifiers test here, as the
194         constructor for the Constructor class usually receives a zero
195         because of the way we create it (first we create, later we
196         customize, and we were never checking the modifiers).
197
198         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
199         is a version of LookupTypeReflection that includes the type-name
200         cache.  This can be used as a fast path for functions that know
201         the fully qualified name and are only calling into *.GetType() to
202         obtain a composed type.
203
204         This is also used by TypeManager.LookupType during its type
205         composition.
206
207         (LookupType): We now also track the real type name, as sometimes
208         we can get a quey for the real type name from things like
209         ComposedCast.  This fixes bug 31422.
210         
211         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
212         complete type fullname, it does not have to go through the type
213         resolution system to obtain the composed version of the type (for
214         obtaining arrays or pointers).
215         
216         (Conditional.Emit): Use the EmitBoolExpression to
217         generate nicer code, as requested by Paolo.
218
219         (ArrayCreation.CheckIndices): Use the patch from
220         hwang_rob@yahoo.ca to validate the array initializers. 
221
222 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
223
224         * class.cs (ConstructorInitializer.Emit): simplify code by using
225         Invocation.EmitCall, and at the same time, fix the bugs in calling
226         parent constructors that took variable arguments. 
227
228         * ecore.cs (Expression.ConvertNumericExplicit,
229         Expression.ImplicitNumericConversion): Remove the code that
230         manually wrapped decimal (InternalTypeConstructor call is now gone
231         as well).
232
233         * expression.cs (Cast.TryReduce): Also handle decimal types when
234         trying to perform a constant fold on the type.
235
236         * typemanager.cs (IsUnmanagedtype): Partially implemented.
237
238         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
239         that only turned off an error report, and did nothing else. 
240
241 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
242
243         * driver.cs: Handle and ignore /fullpaths
244
245 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
246
247         * expression.cs (Binary.ResolveOperator): Catch the case where
248         DoNumericPromotions returns true, 
249
250         (Binary.DoNumericPromotions): Simplify the code, and the tests.
251
252 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
253
254         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
255         report error 70.
256
257 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
258
259         * ecore.cs (ConvertNumericExplicit): It is not enough that the
260         conversion exists, but it is also required that the conversion be
261         performed.  This manifested in "(Type64Enum) 2".  
262
263         * class.cs (TypeManager.AddMethod): The fix is not to change
264         AddEnum, because that one was using a fully qualified name (every
265         DeclSpace derivative does), but to change the AddMethod routine
266         that was using an un-namespaced name.  This now correctly reports
267         the duplicated name.
268
269         Revert patch until I can properly fix it.  The issue
270         is that we have a shared Type space across all namespaces
271         currently, which is wrong.
272
273         Options include making the Namespace a DeclSpace, and merge
274         current_namespace/current_container in the parser.
275
276 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
277
278         * cs-parser.jay: Improve error reporting when we get a different
279         kind of expression in local_variable_type and
280         local_variable_pointer_type. 
281
282         Propagate this to avoid missleading errors being reported.
283
284         * ecore.cs (ImplicitReferenceConversion): treat
285         TypeManager.value_type as a target just like object_type.   As
286         code like this:
287
288         ValueType v = 1;
289
290         Is valid, and needs to result in the int 1 being boxed before it
291         is assigned to the value type v.
292
293         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
294         to validate the enumeration name.
295
296         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
297         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
298         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
299
300         * ecore.cs (TryImplicitIntConversion): When doing an
301         implicit-enumeration-conversion, check if the type is 64-bits and
302         perform a conversion before passing to EnumConstant.
303
304 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
305
306         * decl.cs (Error_AmbiguousTypeReference); New routine used to
307         report ambiguous type references.  Unlike the MS version, we
308         report what the ambiguity is.   Innovation at work ;-)
309
310         (DeclSpace.FindType): Require a location argument to
311         display when we display an ambiguous error.
312
313         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
314
315         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
316
317         * expression.cs (EmitDynamicInitializers): Apply patch from
318         hwang_rob@yahoo.ca that fixes the order in which we emit our
319         initializers. 
320
321 2002-09-21  Martin Baulig  <martin@gnome.org>
322
323         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
324         delegate takes no arguments.
325
326 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
327
328         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
329         from integers.
330
331         * expression.cs: Extract the underlying type.
332
333         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
334
335         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
336
337 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
338
339         * class.cs (TypeContainer.DefineType): We can not use the nice
340         PackingSize with the size set to 1 DefineType method, because it
341         will not allow us to define the interfaces that the struct
342         implements.
343
344         This completes the fixing of bug 27287
345
346         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
347         means also structs.  This fixes part of the problem. 
348         (Expresion.ImplicitReferenceConversionExists): ditto.
349
350         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
351         error if there were no errors reported during the type lookup
352         process, to avoid duplicates or redundant errors.  Without this
353         you would get an ambiguous errors plus a type not found.  We have
354         beaten the user enough with the first error.  
355
356         (DeclSparce.FindType): Emit a warning if we have an ambiguous
357         reference. 
358
359         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
360         during the resolution process, stop the lookup, this avoids
361         repeated error reports (same error twice).
362
363         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
364
365         * typemanager.cs (LookupType): Redo the type lookup code to match
366         the needs of System.Reflection.  
367
368         The issue is that System.Reflection requires references to nested
369         types to begin with a "+" sign instead of a dot.  So toplevel
370         types look like: "NameSpace.TopLevelClass", and nested ones look
371         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
372         levels. 
373
374 2002-09-19  Martin Baulig  <martin@gnome.org>
375
376         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
377         says that a method always returns or always throws an exception,
378         don't report the CS0161.
379
380         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
381         set `Returns = new_returns'.
382
383 2002-09-19  Martin Baulig  <martin@gnome.org>
384
385         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
386         to an enum constant, check for a CS0176.
387
388 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
389
390         * class.cs (TypeContainer.CheckPairedOperators): Now we check
391         for operators that must be in pairs and report errors.
392
393         * ecore.cs (SimpleName.DoResolveType): During the initial type
394         resolution process, when we define types recursively, we must
395         check first for types in our current scope before we perform
396         lookups in the enclosing scopes.
397
398         * expression.cs (MakeByteBlob): Handle Decimal blobs.
399
400         (Invocation.VerifyArgumentsCompat): Call
401         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
402         I thought we were supposed to always call this, but there are a
403         few places in the code where we dont do it.
404
405 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
406
407         * driver.cs: Add support in -linkres and -resource to specify the
408         name of the identifier.
409
410 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
411
412         * ecore.cs (StandardConversionExists): Sync with the conversion
413         code: allow anything-* to void* conversions.
414
415         (FindMostSpecificSource): Use an Expression argument
416         instead of a Type, because we might be handed over a Literal which
417         gets a few more implicit conversions that plain types do not.  So
418         this information was being lost.
419
420         Also, we drop the temporary type-holder expression when not
421         required.
422
423 2002-09-17  Martin Baulig  <martin@gnome.org>
424
425         * class.cs (PropertyBase.CheckBase): Don't check the base class if
426         this is an explicit interface implementation.
427
428 2002-09-17  Martin Baulig  <martin@gnome.org>
429
430         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
431         different `IndexerName' attributes.
432
433         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
434         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
435         virtual CommonResolve().
436
437 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
438
439         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
440         and convert that to the UnderlyingType.
441
442         * statement.cs (Foreach.Resolve): Indexers are just like variables
443         or PropertyAccesses.
444
445         * cs-tokenizer.cs (consume_string): Track line numbers and columns
446         inside quoted strings, we were not doing this before.
447
448 2002-09-16  Martin Baulig  <martin@gnome.org>
449
450         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
451         resolve it.  This is needed for the definite assignment check of the
452         instance expression, fixes bug #29846.
453         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
454
455 2002-09-16  Nick Drochak  <ndrochak@gol.com>
456
457         * parameter.cs: Fix compile error.  Cannot reference static member
458         from an instance object.  Is this an mcs bug?
459
460 2002-09-14  Martin Baulig  <martin@gnome.org>
461
462         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
463         multiple times.  Fixes bug #30295, added test-166.cs.
464
465 2002-09-14  Martin Baulig  <martin@gnome.org>
466
467         * statement.cs (Block.Emit): Don't emit unreachable code.
468         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
469         `break' statements.
470         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
471
472 2002-09-14  Martin Baulig  <martin@gnome.org>
473
474         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
475         is set.
476
477 2002-09-14  Martin Baulig  <martin@gnome.org>
478
479         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
480         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
481         be false on the ms runtime.
482
483 2002-09-13  Martin Baulig  <martin@gnome.org>
484
485         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
486         the CS0038 error message.
487
488 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
489
490         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
491         constant inside, return it.
492
493 2002-09-12  Martin Baulig  <martin@gnome.org>
494
495         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
496         implicit conversion can be done between enum types.
497
498         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
499         check whether an implicit conversion to the current enum's UnderlyingType
500         exists and report an error if not.
501
502         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
503         without debugging support.
504
505         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
506         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
507
508 2002-09-12  Martin Baulig  <martin@gnome.org>
509
510         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
511
512         * ecore.cs (IMemberExpr.DeclaringType): New property.
513         (SimpleName.SimpleNameResolve): Check whether we're accessing a
514         nonstatic member of an outer type (CS0038).
515
516 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
517
518         * driver.cs: Activate the using-error detector at warning level
519         4 (at least for MS-compatible APIs).
520
521         * namespace.cs (VerifyUsing): Small buglett fix.
522
523         * pending.cs (PendingImplementation): pass the container pointer. 
524
525         * interface.cs (GetMethods): Allow for recursive definition.  Long
526         term, I would like to move every type to support recursive
527         definitions, not the current ordering mechanism that we have right
528         now.
529
530         The situation is this: Attributes are handled before interfaces,
531         so we can apply attributes to interfaces.  But some attributes
532         implement interfaces, we will now handle the simple cases
533         (recursive definitions will just get an error).  
534
535         * parameter.cs: Only invalidate types at the end if we fail to
536         lookup all types.  
537
538 2002-09-09  Martin Baulig  <martin@gnome.org>
539
540         * ecore.cs (PropertyExpr.Emit): Also check for
541         TypeManager.system_int_array_get_length so this'll also work when
542         compiling corlib.  Fixes #30003.
543
544 2002-09-09  Martin Baulig  <martin@gnome.org>
545
546         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
547         and throw an exception if we can't get the type's size.  Fixed #30040,
548         added test-165.cs.
549
550 2002-09-09  Martin Baulig  <martin@gnome.org>
551
552         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
553
554         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
555         context.  Fixes bug #30027.
556
557         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
558         virtual functions.  Fixes bug #30043, added test-164.cs.
559
560 2002-09-08  Ravi Pratap  <ravi@ximian.com>
561
562         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
563
564 2002-09-08  Nick Drochak  <ndrochak@gol.com>
565
566         * driver.cs: Use an object to get the windows codepage since it's not a
567         static property.
568
569 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
570
571         * statement.cs (For.Emit): for infinite loops (test == null)
572         return whether there is a break inside, not always "true".
573
574         * namespace.cs (UsingEntry): New struct to hold the name of the
575         using definition, the location where it is defined, and whether it
576         has been used in a successful type lookup.
577         
578         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
579         strings.
580
581         * decl.cs: ditto.
582
583 2002-09-06  Ravi Pratap  <ravi@ximian.com>
584
585         * attribute.cs : Fix incorrect code which relied on catching
586         a NullReferenceException to detect a null being passed in
587         where an object was expected.
588
589 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
590
591         * statement.cs (Try): flag the catch variable as assigned
592
593         * expression.cs (Cast): Simplified by using ResolveType instead of
594         manually resolving.
595
596         * statement.cs (Catch): Fix bug by using ResolveType.
597
598 2002-09-06  Ravi Pratap  <ravi@ximian.com>
599
600         * expression.cs (BetterConversion): Special case for when we have
601         a NullLiteral as the argument and we have to choose between string
602         and object types - we choose string the way csc does.
603
604         * attribute.cs (Attribute.Resolve): Catch the
605         NullReferenceException and report error #182 since the Mono
606         runtime no more has the bug and having this exception raised means
607         we tried to select a constructor which takes an object and is
608         passed a null.
609
610 2002-09-05  Ravi Pratap  <ravi@ximian.com>
611
612         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
613         message (1502, 1503) when we can't locate a method after overload
614         resolution. This is much more informative and closes the bug
615         Miguel reported.
616
617         * interface.cs (PopulateMethod): Return if there are no argument
618         types. Fixes a NullReferenceException bug.
619
620         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
621         expressions too. Previously we were checking only in one place for
622         positional arguments leaving out named arguments.
623
624         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
625         type to the enum type is not allowed. Remove code corresponding to
626         that.
627
628         (ConvertNumericExplicit): Allow explicit conversions from
629         the underlying type to enum type. This precisely follows the spec
630         and closes a bug filed by Gonzalo.
631         
632 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
633
634         * compiler.csproj:
635         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
636
637 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
638
639         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
640         it was important that we stored the right value after the
641         reduction in `converted'.
642
643 2002-09-04  Martin Baulig  <martin@gnome.org>
644
645         * location.cs (Location.SymbolDocument): Use full pathnames for the
646         source files.
647
648 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
649
650         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
651         of the expression resolve mechanism, because that will catch the
652         SimpleName error failures.
653
654         (Conditional): If we can not resolve the
655         expression, return, do not crash.
656
657 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
658
659         * cs-tokenizer.cs:
660         (location): display token name instead of its number.
661
662 2002-08-28  Martin Baulig  <martin@gnome.org>
663
664         * expression.cs (Binary.ResolveOperator): Don't silently return
665         but return an error if an operator cannot be applied between two
666         enum types.
667
668 2002-08-28  Martin Baulig  <martin@gnome.org>
669
670         * class.cs (Constructor.Define): Set the permission attributes
671         correctly instead of making all constructors public.
672
673 2002-08-28  Martin Baulig  <martin@gnome.org>
674
675         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
676         for private members before reporting a CS0103; if we find anything,
677         it's a CS0122.
678
679 2002-08-28  Martin Baulig  <martin@gnome.org>
680
681         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
682         to check whether `closure_start_type == closure_invocation_type',
683         we also need to check whether `m.DeclaringType == closure_invocation_type'
684         before bypassing the permission checks.  We might be accessing
685         protected/private members from the base class.
686         (TypeManager.RealMemberLookup): Only set private_ok if private
687         members were requested via BindingFlags.NonPublic.
688
689         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
690
691         * expression.cs (MemberAccess.ResolveMemberAccess): Set
692         MethodGroupExpr.IsExplicitImpl if appropriate.
693         (Invocation.DoResolve): Don't report the CS0120 for explicit
694         interface implementations.
695
696 2002-08-27  Martin Baulig  <martin@gnome.org>
697
698         * expression.cs (Invocation.DoResolve): If this is a static
699         method and we don't have an InstanceExpression, we must report
700         a CS0120.
701
702 2002-08-25  Martin Baulig  <martin@gnome.org>
703
704         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
705         `==' between a valuetype and an object.
706
707 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
708
709         * ecore.cs (TypeExpr): Provide a ToString method.
710
711 2002-08-24  Martin Baulig  <martin@gnome.org>
712
713         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
714         now called proggie.dbg and it's a binary file.
715
716 2002-08-23  Martin Baulig  <martin@gnome.org>
717
718         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
719
720 2002-08-23  Martin Baulig  <martin@gnome.org>
721
722         * struct.cs (MyStructInfo.ctor): Make this work with empty
723         structs; it's not allowed to use foreach() on null.
724
725 2002-08-23  Martin Baulig  <martin@gnome.org>
726
727         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
728         writer the full pathname of the generated assembly.
729
730 2002-08-23  Martin Baulig  <martin@gnome.org>
731
732         * statements.cs (FlowBranching.UsageVector.MergeChildren):
733         A `finally' block never returns or breaks; improved handling of
734         unreachable code.
735
736 2002-08-23  Martin Baulig  <martin@gnome.org>
737
738         * statement.cs (Throw.Resolve): Allow `throw null'.
739
740 2002-08-23  Martin Baulig  <martin@gnome.org>
741
742         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
743         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
744         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
745         MemberLookup would return a wrong event if this is an explicit
746         interface implementation and the class has an event with the same
747         name.
748
749 2002-08-23  Martin Baulig  <martin@gnome.org>
750
751         * statement.cs (Block.AddChildVariableNames): New public method.
752         (Block.AddChildVariableName): Likewise.
753         (Block.IsVariableNameUsedInChildBlock): Likewise.
754         (Block.AddVariable): Check whether a variable name has already
755         been used in a child block.
756
757         * cs-parser.jay (declare_local_variables): Mark all variable names
758         from the current block as being used in a child block in the
759         implicit block.
760
761 2002-08-23  Martin Baulig  <martin@gnome.org>
762
763         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
764         find the symbol writer.
765
766         * driver.cs: csc also allows the arguments to /define being
767         separated by commas, not only by semicolons.
768
769 2002-08-23  Martin Baulig  <martin@gnome.org>
770
771         * interface.cs (Interface.GetMembers): Added static check for events.
772
773 2002-08-15  Martin Baulig  <martin@gnome.org>
774
775         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
776         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
777
778         * ecore.cs (Expression.MemberLookup): Added documentation and explained
779         why the MethodData.EmitDestructor() change was necessary.
780
781 2002-08-20  Martin Baulig  <martin@gnome.org>
782
783         * class.cs (TypeContainer.FindMembers): Added static check for events.
784
785         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
786
787         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
788         use Type.GetEvents(), not Type.FindMembers().
789
790 2002-08-20  Martin Baulig  <martin@gnome.org>
791
792         * decl.cs (MemberCache): Added a special method cache which will
793         be used for method-only searched.  This ensures that a method
794         search will return a MethodInfo with the correct ReflectedType for
795         inherited methods.      
796
797 2002-08-20  Martin Baulig  <martin@gnome.org>
798
799         * decl.cs (DeclSpace.FindMembers): Made this public.
800
801 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
802
803         * delegate.cs: fixed build on windows.
804         [FIXME:  Filed as bug #29150: MCS must report these errors.]
805
806 2002-08-19  Ravi Pratap  <ravi@ximian.com>
807
808         * ecore.cs (StandardConversionExists): Return a false
809         if we are trying to convert the void type to anything else
810         since that is not allowed.
811
812         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
813         we flag error 70 in the event an event is trying to be accessed
814         directly from outside the declaring type.
815
816 2002-08-20  Martin Baulig  <martin@gnome.org>
817
818         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
819         MemberCache from typemanager.cs to decl.cs.
820
821 2002-08-19  Martin Baulig  <martin@gnome.org>
822
823         * class.cs (TypeContainer): Implement IMemberContainer.
824         (TypeContainer.DefineMembers): Create the MemberCache.
825         (TypeContainer.FindMembers): Do better BindingFlags checking; only
826         return public members if BindingFlags.Public was given, check
827         whether members are static.
828
829 2002-08-16  Martin Baulig  <martin@gnome.org>
830
831         * decl.cs (DeclSpace.Define): Splitted this in Define and
832         DefineMembers.  DefineMembers is called first and initializes the
833         MemberCache.
834
835         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
836         DefineMembers() on all our DeclSpaces.
837
838         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
839         but call DefineMembers() on all nested interfaces.  We call their
840         Define() in our new Define() function.
841
842         * interface.cs (Interface): Implement IMemberContainer.
843         (Interface.Define): Moved all code except the attribute stuf to
844         DefineMembers().
845         (Interface.DefineMembers): Initialize the member cache.
846
847         * typemanager.cs (IMemberFinder): Removed this interface, we don't
848         need this anymore since we can use MemberCache.FindMembers directly.
849
850 2002-08-19  Martin Baulig  <martin@gnome.org>
851
852         * typemanager.cs (MemberCache): When creating the cache for an
853         interface type, add all inherited members.
854         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
855         to `out bool used_cache' and documented it.
856         (TypeManager.MemberLookup): If we already used the cache in the first
857         iteration, we don't need to do the interfaces check.
858
859 2002-08-19  Martin Baulig  <martin@gnome.org>
860
861         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
862         here from IMemberFinder and don't implement this interface anymore.
863         (DeclSpace.MemberCache): Moved here from IMemberFinder.
864
865         * typemanager.cs (IMemberFinder): This interface is now only used by
866         classes which actually support the member cache.
867         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
868         since we only put DeclSpaces into this Hashtable.
869         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
870         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
871
872 2002-08-16  Martin Baulig  <martin@gnome.org>
873
874         * typemanager.cs (ICachingMemberFinder): Removed.
875         (IMemberFinder.MemberCache): New property.
876         (TypeManager.FindMembers): Merged this with RealFindMembers().
877         This function will never be called from TypeManager.MemberLookup()
878         so we can't use the cache here, just the IMemberFinder.
879         (TypeManager.MemberLookup_FindMembers): Check whether the
880         IMemberFinder has a MemberCache and call the cache's FindMembers
881         function.
882         (MemberCache): Rewrote larger parts of this yet another time and
883         cleaned it up a bit.
884
885 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
886
887         * driver.cs (LoadArgs): Support quoting.
888
889         (Usage): Show the CSC-like command line arguments.
890
891         Improved a few error messages.
892
893 2002-08-15  Martin Baulig  <martin@gnome.org>
894
895         * typemanager.cs (IMemberContainer.Type): New property.
896         (IMemberContainer.IsInterface): New property.
897
898         The following changes are conditional to BROKEN_RUNTIME, which is
899         defined at the top of the file.
900
901         * typemanager.cs (MemberCache.MemberCache): Don't add the base
902         class'es members, but add all members from TypeHandle.ObjectType
903         if we're an interface.
904         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
905         is the current type.
906         (MemberCache.CacheEntry.Container): Removed this field.
907         (TypeHandle.GetMembers): Include inherited members.
908
909 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
910
911         * typemanager.cs: fixed compilation and added a comment on a field that
912         is never used.
913
914 2002-08-15  Martin Baulig  <martin@gnome.org>
915
916         * class.cs (ConstructorInitializer.Resolve): In the
917         Expression.MemberLookup call, use the queried_type as
918         invocation_type.
919
920         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
921         declared' attribute, it's always true.
922         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
923         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
924         temporary wrapper for FindMembers which tells MemberLookup whether
925         members from the base classes are included in the return value.
926         This will go away soon.
927         (TypeManager.MemberLookup): Use this temporary hack here; once the
928         new MemberCache is completed, we don't need to do the DeclaredOnly
929         looping here anymore since the MemberCache will take care of this.
930         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
931         (MemberCache): When creating the MemberCache for a class, get
932         members from the current class and all its base classes.
933         (MemberCache.CacheEntry.Container): New field.  This is a
934         temporary hack until the Mono runtime is fixed to distinguish
935         between ReflectedType and DeclaringType.  It allows us to use MCS
936         with both the MS runtime and the unfixed Mono runtime without
937         problems and without accecting performance.
938         (MemberCache.SearchMembers): The DeclaredOnly looping from
939         TypeManager.MemberLookup is now done here.      
940
941 2002-08-14  Martin Baulig  <martin@gnome.org>
942
943         * statement.cs (MyStructInfo.MyStructInfo): Don't call
944         Type.GetFields on dynamic types but get the fields from the
945         corresponding TypeContainer.
946         (MyStructInfo.GetStructInfo): Added check for enum types.
947
948         * typemanager.cs (MemberList.IsSynchronized): Implemented.
949         (MemberList.SyncRoot): Implemented.
950         (TypeManager.FilterWithClosure): No need to check permissions if
951         closure_start_type == closure_invocation_type, don't crash if
952         closure_invocation_type is null.
953
954 2002-08-13  Martin Baulig  <martin@gnome.org>
955
956         Rewrote TypeContainer.FindMembers to use a member cache.  This
957         gives us a speed increase of about 35% for the self-hosting MCS
958         build and of about 15-20% for the class libs (both on GNU/Linux).
959
960         * report.cs (Timer): New class to get enhanced profiling.  This
961         whole class is "TIMER" conditional since it remarkably slows down
962         compilation speed.
963
964         * class.cs (MemberList): New class.  This is an IList wrapper
965         which we're now using instead of passing MemberInfo[]'s around to
966         avoid copying this array unnecessarily.
967         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
968         (ICachingMemberFinder, IMemberContainer): New interface.
969         (TypeManager.FilterWithClosure): If `criteria' is null, the name
970         has already been checked, otherwise use it for the name comparision.
971         (TypeManager.FindMembers): Renamed to RealMemberFinder and
972         provided wrapper which tries to use ICachingMemberFinder.FindMembers
973         if possible.  Returns a MemberList, not a MemberInfo [].
974         (TypeHandle): New class, implements IMemberContainer.  We create
975         one instance of this class per type, it contains a MemberCache
976         which is used to do the member lookups.
977         (MemberCache): New class.  Each instance of this class contains
978         all members of a type and a name-based hash table.
979         (MemberCache.FindMembers): This is our new member lookup
980         function.  First, it looks up all members of the requested name in
981         the hash table.  Then, it walks this list and sorts out all
982         applicable members and returns them.
983
984 2002-08-13  Martin Baulig  <martin@gnome.org>
985
986         In addition to a nice code cleanup, this gives us a performance
987         increase of about 1.4% on GNU/Linux - not much, but it's already
988         half a second for the self-hosting MCS compilation.
989
990         * typemanager.cs (IMemberFinder): New interface.  It is used by
991         TypeManager.FindMembers to call FindMembers on a TypeContainer,
992         Enum, Delegate or Interface.
993         (TypeManager.finder_to_member_finder): New PtrHashtable.
994         (TypeManager.finder_to_container): Removed.
995         (TypeManager.finder_to_delegate): Removed.
996         (TypeManager.finder_to_interface): Removed.
997         (TypeManager.finder_to_enum): Removed.
998
999         * interface.cs (Interface): Implement IMemberFinder.
1000
1001         * delegate.cs (Delegate): Implement IMemberFinder.
1002
1003         * enum.cs (Enum): Implement IMemberFinder.
1004
1005         * class.cs (TypeContainer): Implement IMemberFinder.
1006
1007 2002-08-12  Martin Baulig  <martin@gnome.org>
1008
1009         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
1010
1011 2002-08-12  Martin Baulig  <martin@gnome.org>
1012
1013         * ecore.cs (ITypeExpression): New interface for expressions which
1014         resolve to a type.
1015         (TypeExpression): Renamed to TypeLookupExpression.
1016         (Expression.DoResolve): If we're doing a types-only lookup, the
1017         expression must implement the ITypeExpression interface and we
1018         call DoResolveType() on it.
1019         (SimpleName): Implement the new ITypeExpression interface.
1020         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
1021         hack, the situation that we're only looking up types can't happen
1022         anymore when this method is called.  Moved the type lookup code to
1023         DoResolveType() and call it.
1024         (SimpleName.DoResolveType): This ITypeExpression interface method
1025         is now doing the types-only lookup.
1026         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
1027         (ResolveFlags): Added MaskExprClass.
1028
1029         * expression.cs (MemberAccess): Implement the ITypeExpression
1030         interface.
1031         (MemberAccess.DoResolve): Added support for a types-only lookup
1032         when we're called via ITypeExpression.DoResolveType().
1033         (ComposedCast): Implement the ITypeExpression interface.
1034
1035         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
1036         Expression.Resolve() with ResolveFlags.Type instead.
1037
1038 2002-08-12  Martin Baulig  <martin@gnome.org>
1039
1040         * interface.cs (Interface.Define): Apply attributes.
1041
1042         * attribute.cs (Attribute.ApplyAttributes): Added support for
1043         interface attributes.
1044
1045 2002-08-11  Martin Baulig  <martin@gnome.org>
1046
1047         * statement.cs (Block.Emit): Only check the "this" variable if we
1048         do not always throw an exception.
1049
1050         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
1051         whether the property has a set accessor.
1052
1053 2002-08-11  Martin Baulig  <martin@gnome.org>
1054
1055         Added control flow analysis support for structs.
1056
1057         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
1058         with control flow analysis turned off.
1059         (IVariable): New interface.
1060         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
1061         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
1062         (FieldExpr.DoResolve): Resolve the instance expression with flow
1063         analysis turned off and do the definite assignment check after the
1064         resolving when we know what the expression will resolve to.
1065
1066         * expression.cs (LocalVariableReference, ParameterReference):
1067         Implement the new IVariable interface, only call the flow analysis
1068         code if ec.DoFlowAnalysis is true.
1069         (This): Added constructor which takes a Block argument.  Implement
1070         the new IVariable interface.
1071         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
1072         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
1073         This does the definite assignment checks for struct members.
1074
1075         * class.cs (Constructor.Emit): If this is a non-static `struct'
1076         constructor which doesn't have any initializer, call
1077         Block.AddThisVariable() to tell the flow analysis code that all
1078         struct elements must be initialized before control returns from
1079         the constructor.
1080
1081         * statement.cs (MyStructInfo): New public class.
1082         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
1083         argument to this indexer.  If non-zero, check an individual struct
1084         member, not the whole struct.
1085         (FlowBranching.CheckOutParameters): Check struct members.
1086         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
1087         overloaded versions of these methods which take an additional
1088         `int field_idx' argument to check struct members.
1089         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
1090         overloaded versions of these methods which take an additional
1091         `string field_name' argument to check struct member.s
1092         (VariableInfo): Implement the IVariable interface.
1093         (VariableInfo.StructInfo): New public property.  Returns the
1094         MyStructInfo instance of the variable if it's a struct or null.
1095         (Block.AddThisVariable): New public method.  This is called from
1096         Constructor.Emit() for non-static `struct' constructor which do
1097         not have any initializer.  It creates a special variable for the
1098         "this" instance variable which will be checked by the flow
1099         analysis code to ensure that all of the struct's fields are
1100         initialized before control returns from the constructor.
1101         (UsageVector): Added support for struct members.  If a
1102         variable/parameter is a struct with N members, we reserve a slot
1103         in the usage vector for each member.  A struct is considered fully
1104         initialized if either the struct itself (slot 0) or all its
1105         members are initialized.
1106
1107 2002-08-08  Martin Baulig  <martin@gnome.org>
1108
1109         * driver.cs (Driver.MainDriver): Only report an error CS5001
1110         if there were no compilation errors.
1111
1112         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
1113         `UnsafeContext' property to determine whether the parent is in
1114         unsafe context rather than checking the parent's ModFlags:
1115         classes nested in an unsafe class are unsafe as well.
1116
1117 2002-08-08  Martin Baulig  <martin@gnome.org>
1118
1119         * statement.cs (UsageVector.MergeChildren): Distinguish between
1120         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
1121         we return.  Added test17() and test18() to test-154.cs.
1122
1123 2002-08-08  Martin Baulig  <martin@gnome.org>
1124
1125         * typemanager.cs (TypeManager.FilterWithClosure): If we have
1126         Family access, make sure the invoking type isn't a subclass of the
1127         queried type (that'd be a CS1540).
1128
1129         * ecore.cs (Expression.MemberLookup): Added overloaded version of
1130         this method which takes an additional `Type invocation_type'.
1131
1132         * expression.cs (BaseAccess.DoResolve): Use the base type as
1133         invocation and query type.
1134         (MemberAccess.DoResolve): If the lookup failed and we're about to
1135         report a CS0122, try a lookup with the ec.ContainerType - if this
1136         succeeds, we must report a CS1540.
1137
1138 2002-08-08  Martin Baulig  <martin@gnome.org>
1139
1140         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
1141         (MethodGroupExpr): Implement the IMemberExpr interface.
1142
1143         * expression (MemberAccess.ResolveMemberAccess): No need to have
1144         any special code for MethodGroupExprs anymore, they're now
1145         IMemberExprs.   
1146
1147 2002-08-08  Martin Baulig  <martin@gnome.org>
1148
1149         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
1150         Family, FamANDAssem and FamORAssem permissions.
1151         (TypeManager.IsSubclassOrNestedChildOf): New public method.
1152
1153 2002-08-08  Martin Baulig  <martin@gnome.org>
1154
1155         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
1156         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
1157         or loop block.
1158
1159 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
1160
1161         * driver.cs: implemented /resource option to embed managed resources.
1162
1163 2002-08-07  Martin Baulig  <martin@gnome.org>
1164
1165         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
1166         (FieldBase.HasFieldInitializer): New public property.
1167         (FieldBase.GetInitializerExpression): New public method.  Resolves and
1168         returns the field initializer and makes sure it is only resolved once.
1169         (TypeContainer.EmitFieldInitializers): Call
1170         FieldBase.GetInitializerExpression to get the initializer, this ensures
1171         that it isn't resolved multiple times.
1172
1173         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
1174         the resolving process (SimpleName/MemberLookup) that we're currently
1175         emitting a field initializer (which must not access any instance members,
1176         this is an error CS0236).
1177
1178         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
1179         argument, if the `IsFieldInitializer' flag is set, we must report and
1180         error CS0236 and not an error CS0120.   
1181
1182 2002-08-07  Martin Baulig  <martin@gnome.org>
1183
1184         * ecore.cs (IMemberExpr): New public interface.
1185         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
1186         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
1187         if the expression is an IMemberExpr.
1188
1189         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
1190         to be null, implicitly default to `this' if we're non-static in
1191         this case.  Simplified the code a lot by using the new IMemberExpr
1192         interface.  Also fixed bug #28176 here.
1193
1194 2002-08-06  Martin Baulig  <martin@gnome.org>
1195
1196         * cs-parser.jay (SimpleLookup): Removed.  We need to create
1197         ParameterReferences during semantic analysis so that we can do a
1198         type-only search when resolving Cast, TypeOf and SizeOf.
1199         (block): Pass the `current_local_parameters' to the Block's
1200         constructor.
1201
1202         * class.cs (ConstructorInitializer): Added `Parameters parameters'
1203         argument to the constructor.
1204         (ConstructorInitializer.Resolve): Create a temporary implicit
1205         block with the parameters.
1206
1207         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
1208         references here if we aren't doing a type-only search.
1209
1210         * statement.cs (Block): Added constructor which takes a
1211         `Parameters parameters' argument.
1212         (Block.Parameters): New public property.
1213
1214         * support.cs (InternalParameters.Parameters): Renamed `parameters'
1215         to `Parameters' and made it public readonly.
1216
1217 2002-08-06  Martin Baulig  <martin@gnome.org>
1218
1219         * ecore.cs (Expression.Warning): Made this public as well.
1220
1221         * report.cs (Report.Debug): Print the contents of collections.
1222
1223 2002-08-06  Martin Baulig  <martin@gnome.org>
1224
1225         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
1226         used to tell Resolve() which kinds of expressions it may return.
1227         (Expression.Resolve): Added overloaded version of this method which
1228         takes a `ResolveFlags flags' argument.  This can be used to tell
1229         Resolve() which kinds of expressions it may return.  Reports a
1230         CS0118 on error.
1231         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
1232         ResolveFlags.SimpleName.
1233         (Expression.Error118): Added overloaded version of this method which
1234         takes a `ResolveFlags flags' argument.  It uses the flags to determine
1235         which kinds of expressions are allowed.
1236
1237         * expression.cs (Argument.ResolveMethodGroup): New public method.
1238         Resolves an argument, but allows a MethodGroup to be returned.
1239         This is used when invoking a delegate.
1240
1241         * TODO: Updated a bit.
1242
1243 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1244
1245         Fixed compilation with csc.
1246
1247         * ecore.cs: Expression.Error made public. Is this correct? Should
1248         Warning be made public too?
1249
1250         * expression.cs: use ea.Location instead of ea.loc.
1251         [FIXME:  Filed as bug #28607: MCS must report these errors.]
1252
1253 2002-08-06  Martin Baulig  <martin@gnome.org>
1254
1255         * ecore.cs (Expression.loc): Moved the location here instead of
1256         duplicating it in all derived classes.
1257         (Expression.Location): New public property.
1258         (Expression.Error, Expression.Warning): Made them non-static and
1259         removed the location argument.
1260         (Expression.Warning): Added overloaded version which takes an
1261         `int level' argument.
1262         (Expression.Error118): Make this non-static and removed the
1263         expression and location arguments.
1264         (TypeExpr): Added location argument to the constructor.
1265
1266         * expression.cs (StaticCallExpr): Added location argument to
1267         the constructor.
1268         (Indirection, PointerArithmetic): Likewise.
1269         (CheckedExpr, UnCheckedExpr): Likewise.
1270         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
1271         (StringPtr): Likewise.
1272
1273
1274 2002-08-05  Martin Baulig  <martin@gnome.org>
1275
1276         * expression.cs (BaseAccess.DoResolve): Actually report errors.
1277
1278         * assign.cs (Assign.DoResolve): Check whether the source
1279         expression is a value or variable.
1280
1281         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
1282         while resolving the corresponding blocks.
1283
1284         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
1285         an error, don't silently return null.
1286
1287         * statement.cs (Block.AddVariable): Do the error reporting here
1288         and distinguish between CS0128 and CS0136.
1289         (Block.DoResolve): Report all unused labels (warning CS0164).
1290         (LabeledStatement): Pass the location to the constructor.
1291         (LabeledStatement.HasBeenReferenced): New property.
1292         (LabeledStatement.Resolve): Set it to true here.
1293
1294         * statement.cs (Return.Emit): Return success even after reporting
1295         a type mismatch error (CS0126 or CS0127), this is what csc does and
1296         it avoids confusing the users with any consecutive errors.
1297
1298 2002-08-05  Martin Baulig  <martin@gnome.org>
1299
1300         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
1301
1302         * const.cs (Const.LookupConstantValue): Catch circular definitions.
1303
1304         * expression.cs (MemberAccess.DoResolve): Silently return if an
1305         error has already been reported.
1306
1307         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
1308         error has already been reported.
1309
1310 2002-08-05  Martin Baulig  <martin@gnome.org>
1311
1312         * statement.cs (UsageVector): Only initialize the `parameters'
1313         vector if we actually have any "out" parameters.
1314
1315 2002-08-05  Martin Baulig  <martin@gnome.org>
1316
1317         * expression.cs (Binary.ResolveOperator): When combining delegates,
1318         they must have the same type.
1319
1320 2002-08-05  Martin Baulig  <martin@gnome.org>
1321
1322         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
1323         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
1324         work with the ms runtime and we also don't need it: if we're a
1325         PropertyBuilder and not in the `indexer_arguments' hash, then we
1326         are a property and not an indexer.
1327
1328         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
1329         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
1330         since the latter one doesn't work with the ms runtime.
1331
1332 2002-08-03  Martin Baulig  <martin@gnome.org>
1333
1334         Fixed bugs #27998 and #22735.
1335
1336         * class.cs (Method.IsOperator): New public field.
1337         (Method.CheckBase): Report CS0111 if there's already a method
1338         with the same parameters in the current class.  Report CS0508 when
1339         attempting to change the return type of an inherited method.
1340         (MethodData.Emit): Report CS0179 if a method doesn't have a body
1341         and it's not marked abstract or extern.
1342         (PropertyBase): New abstract base class for Property and Indexer.
1343         (PropertyBase.CheckBase): Moved here from Property and made it work
1344         for indexers.
1345         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
1346         the same so we can reuse it there.
1347         (Property, Indexer): Derive from PropertyBase.
1348         (MethodSignature.inheritable_property_signature_filter): New delegate
1349         to find properties and indexers.
1350
1351         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
1352         argument and improved error reporting.
1353
1354         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
1355         EmptyReadOnlyParameters and made it a property.
1356
1357         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
1358         version of this method which takes a `PropertyInfo indexer'.
1359         (TypeManager.RegisterIndexer): New method.
1360
1361         * class.cs: Added myself as author of this file :-)
1362
1363 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1364
1365         * class.cs: fixed compilation on windoze.
1366
1367 2002-08-03  Martin Baulig  <martin@gnome.org>
1368
1369         * interface.cs (Interface.GetInterfaceBases): Check whether all
1370         base interfaces are at least as accessible than the current one.
1371
1372         * class.cs (TypeContainer.GetClassBases): Check whether base types
1373         are at least as accessible than the current type.
1374         (TypeContainer.AsAccessible): Implemented and made non-static.
1375         (MemberBase.CheckParameters): Report errors if the accessibility
1376         checks fail.
1377
1378         * delegate.cs (Delegate.Delegate): The default visibility is
1379         internal for top-level types and private for nested types.
1380         (Delegate.Define): Report errors if the accessibility checks fail.
1381
1382         * enum.cs (Enum.Enum): The default visibility is internal for
1383         top-level types and private for nested types.
1384         (Enum.DefineType): Compute the correct visibility.
1385
1386         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
1387         function which takes a `bool is_toplevel' instead of a TypeContainer.
1388
1389         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
1390         builtin type.
1391
1392 2002-08-02  Martin Baulig  <martin@gnome.org>
1393
1394         * expression.cs (LocalVariableReferenc): Added constructor which
1395         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
1396         (LocalVariableReference.IsReadOnly): New property.
1397         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
1398         variable is readonly, use our own readonly flag to do this; you can
1399         use the new constructor to get a writable reference to a read-only
1400         variable.
1401
1402         * cs-parser.jay (foreach_statement, using_statement): Get a writable
1403         reference to the local variable.
1404
1405 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
1406
1407         * rootcontext.cs (ResolveCore): Also include System.Exception
1408
1409         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
1410         we reach an EmptyStatement.
1411
1412         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
1413         is also fine.
1414
1415         * expression.cs (Binary.ResolveOperator): Check error result in
1416         two places.
1417
1418         use brtrue/brfalse directly and avoid compares to null.
1419
1420 2002-08-02  Martin Baulig  <martin@gnome.org>
1421
1422         * class.cs (TypeContainer.Define): Define all nested interfaces here.
1423         Fixes bug #28407, added test-155.cs.
1424
1425 2002-08-01  Martin Baulig  <martin@gnome.org>
1426
1427         * class.cs (Event.EmitDefaultMethod): Make this work with static
1428         events.  Fixes #28311, added verify-3.cs.
1429
1430 2002-08-01  Martin Baulig  <martin@gnome.org>
1431
1432         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
1433         `is_disposable' fields.
1434         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
1435         `hm.is_disposable' if we're using the collection pattern.
1436         (Foreach.EmitCollectionForeach): Use the correct type for the
1437         enumerator's local variable, only emit the try/finally block if
1438         necessary (fixes #27713).
1439
1440 2002-08-01  Martin Baulig  <martin@gnome.org>
1441
1442         * ecore.cs (Expression.report118): Renamed to Error118 and made
1443         it public static.
1444
1445         * statement.cs (Throw.Resolve): Check whether the expression is of
1446         the correct type (CS0118) and whether the type derives from
1447         System.Exception (CS0155).
1448         (Catch.Resolve): New method.  Do the type lookup here and check
1449         whether it derives from System.Exception (CS0155).
1450         (Catch.CatchType, Catch.IsGeneral): New public properties.
1451
1452         * typemanager.cs (TypeManager.exception_type): Added.
1453
1454 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
1455
1456         * driver.cs: Updated About function.
1457
1458 2002-07-31  Martin Baulig  <martin@gnome.org>
1459
1460         Implemented Control Flow Analysis.
1461
1462         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
1463         (EmitContext.CurrentBranching): Added.
1464         (EmitContext.StartFlowBranching): Added.
1465         (EmitContext.EndFlowBranching): Added.
1466         (EmitContext.KillFlowBranching): Added.
1467         (EmitContext.IsVariableAssigned): Added.
1468         (EmitContext.SetVariableAssigned): Added.
1469         (EmitContext.IsParameterAssigned): Added.
1470         (EmitContext.SetParameterAssigned): Added.
1471         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
1472         Added control flow analysis stuff here.
1473
1474         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
1475         resolve the expression as lvalue.
1476         (LocalVariableReference.DoResolve): Check whether the variable has
1477         already been assigned.
1478         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
1479         the parameter as assigned here.
1480         (ParameterReference.DoResolve): Check whether the parameter has already
1481         been assigned.
1482         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
1483         expression as lvalue.
1484
1485         * statement.cs (FlowBranching): New class for the flow analysis code.
1486         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
1487         (LabeledStatement.IsDefined): New public property.
1488         (LabeledStatement.AddUsageVector): New public method to tell flow
1489         analyis that the label may be reached via a forward jump.
1490         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
1491         flow analysis.
1492         (VariableInfo.Number): New public field.  This is used by flow analysis
1493         to number all locals of a block.
1494         (Block.CountVariables): New public property.  This is the number of
1495         local variables in this block (including the locals from all parent
1496         blocks).
1497         (Block.EmitMeta): Number all the variables.
1498
1499         * statement.cs: Added flow analysis support to all classes.
1500
1501 2002-07-31  Martin Baulig  <martin@gnome.org>
1502
1503         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
1504         To get debugging messages, compile mcs with /define:MCS_DEBUG and
1505         then use this argument.
1506
1507         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
1508
1509         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
1510         use this to specify /define options.
1511
1512 2002-07-29  Martin Baulig  <martin@gnome.org>
1513
1514         * statement.cs (Fixed): Moved all code that does variable lookups
1515         and resolvings from Emit to Resolve.
1516
1517         * statement.cs (For): Moved all code that does variable lookups
1518         and resolvings from Emit to Resolve.
1519
1520         * statement.cs (Using): Moved all code that does variable lookups
1521         and resolvings from Emit to Resolve.
1522
1523 2002-07-29  Martin Baulig  <martin@gnome.org>
1524
1525         * attribute.cs (Attribute.Resolve): Explicitly catch a
1526         System.NullReferenceException when creating the
1527         CustromAttributeBuilder and report a different warning message.
1528
1529 2002-07-29  Martin Baulig  <martin@gnome.org>
1530
1531         * support.cs (ParameterData.ParameterName): Added method to
1532         get the name of a parameter.
1533
1534         * typemanager.cs (TypeManager.IsValueType): New public method.
1535
1536 2002-07-29  Martin Baulig  <martin@gnome.org>
1537
1538         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
1539         is a flag which specifies that it's either ref or out.
1540         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
1541         the out parameter to `out Parameter.Modifier mod', also set the
1542         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
1543
1544         * support.cs (InternalParameters.ParameterModifier): Distinguish
1545         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
1546         Parameter.Modifier.ISBYREF flag if it's either ref or out.
1547
1548         * expression.cs (Argument.GetParameterModifier): Distinguish
1549         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
1550         Parameter.Modifier.ISBYREF flag if it's either ref or out.
1551
1552 2002-07-29  Martin Baulig  <martin@gnome.org>
1553
1554         * expression.cs (ParameterReference.ParameterReference): Added
1555         `Location loc' argument to the constructor.
1556
1557         * cs-parser.jay: Pass location to ParameterReference.
1558
1559 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
1560
1561         * statement.cs (Try): Initialize the location.
1562
1563         * cs-parser.jay: pass location to Try.
1564
1565         * expression.cs (Unary.Reduce): Change the prototype to return
1566         whether a constant fold could be performed or not.  The result is
1567         returned in an out parameters.  In the case of Indirection and
1568         AddressOf, we want to perform the full tests.
1569
1570 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
1571
1572         * statement.cs (Statement.Emit): Flag dead code.
1573
1574 2002-07-27  Andrew Birkett  <andy@nobugs.org>
1575
1576         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
1577
1578 2002-07-27  Martin Baulig  <martin@gnome.org>
1579
1580         * class.cs (MethodData.Define): Put back call to
1581         TypeManager.AddMethod(), accidentally commented this out.
1582
1583         * report.cs (Debug): New public method to print debugging information,
1584         this is `[Conditional ("DEBUG")]'.
1585
1586 2002-07-26  Martin Baulig  <martin@gnome.org>
1587
1588         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
1589         (switch_statement): Push the current_block to the switch_stack and
1590         pop it again when we're done with the switch.
1591         (switch_section): The new block is a child of the current_block.
1592         Fixes bug #24007, added test-152.cs.
1593
1594 2002-07-27  Martin Baulig  <martin@gnome.org>
1595
1596         * expression.cs (Invocation.EmitArguments): When calling a varargs
1597         function with only its fixed arguments, we need to pass an empty
1598         array.
1599
1600 2002-07-27  Martin Baulig  <martin@gnome.org>
1601
1602         Mono 0.13 has been released.
1603
1604 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
1605
1606         * driver.cs: Rename --resource to --linkres, because that is what
1607         we do currently, we dont support --resource yet.
1608
1609         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
1610
1611 2002-07-25  Martin Baulig  <martin@gnome.org>
1612
1613         * class.cs (MethodData): New public class.  This is a `method builder'
1614         class for a method or one accessor of a Property/Indexer/Event.
1615         (MethodData.GetMethodFlags): Moved here from MemberBase.
1616         (MethodData.ApplyAttributes): Likewise.
1617         (MethodData.ApplyObsoleteAttribute): Likewise.
1618         (MethodData.ApplyConditionalAttribute): Likewise.
1619         (MethodData.ApplyDllImportAttribute): Likewise.
1620         (MethodData.CheckAbstractAndExternal): Likewise.
1621         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
1622         (MethodData.Emit): Formerly known as Method.Emit().
1623         (MemberBase): Moved everything which was specific to a single
1624         accessor/method to MethodData.
1625         (Method): Create a new MethodData and call Define() and Emit() on it.
1626         (Property, Indexer, Event): Create a new MethodData objects for each
1627         accessor and call Define() and Emit() on them.
1628
1629 2002-07-25  Martin Baulig  <martin@gnome.org>
1630
1631         Made MethodCore derive from MemberBase to reuse the code from there.
1632         MemberBase now also checks for attributes.
1633
1634         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
1635         (MemberBase.GetMethodFlags): Moved here from class Method and marked
1636         as virtual.
1637         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
1638         `CallingConventions cc' and `Attributes opt_attrs' arguments.
1639         (MemberBase.ApplyAttributes): New virtual method; applies the
1640         attributes to a method or accessor.
1641         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
1642         (MemberBase.ApplyConditionalAttribute): Likewise.
1643         (MemberBase.ApplyDllImportAttribute): Likewise.
1644         (MemberBase.CheckAbstractAndExternal): Likewise.
1645         (MethodCore.ParameterTypes): This is now a property instead of a
1646         method, it's initialized from DoDefineParameters().
1647         (MethodCore.ParameterInfo): Removed the set accessor.
1648         (MethodCore.DoDefineParameters): New protected virtual method to
1649         initialize ParameterTypes and ParameterInfo.
1650         (Method.GetReturnType): We can now simply return the MemberType.
1651         (Method.GetMethodFlags): Override the MemberBase version and add
1652         the conditional flags.
1653         (Method.CheckBase): Moved some code from Define() here, call
1654         DoDefineParameters() here.
1655         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
1656         here to avoid some larger code duplication.
1657         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
1658         ensure that abstract and external accessors don't declare a body.
1659
1660         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
1661         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
1662         lookup in the attribute's parent classes, so we need to abort as soon
1663         as we found the first match.
1664         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
1665         the attribute has no arguments.
1666
1667         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
1668         of a Method.
1669
1670 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1671
1672         * cs-parser.jay: reverted previous patch.
1673
1674 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1675
1676         * cs-parser.jay: fixed bug #22119.
1677
1678 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1679
1680         * attribute.cs: fixed compilation. The error was:
1681         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
1682         be assigned to before control leaves the current method."
1683         [FIXME:  Filed as bug #28186: MCS must report this error.]
1684
1685 2002-07-25  Martin Baulig  <martin@gnome.org>
1686
1687         * attribute.cs (Attribute.Conditional_GetConditionName): New static
1688         method to pull the condition name ouf of a Conditional attribute.
1689         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
1690         the obsolete message and error flag out of an Obsolete attribute.
1691
1692         * class.cs (Method.GetMethodFlags): New public method to get the
1693         TypeManager.MethodFlags for this method.
1694         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
1695         private methods.
1696         (Method.Define): Get and apply the Obsolete and Conditional attributes;
1697         if we're overriding a virtual function, set the new private variable
1698         `parent_method'; call the new TypeManager.AddMethod().
1699
1700         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
1701         the MethodBuilder and the Method in a PtrHashtable.
1702         (TypeManager.builder_to_method): Added for this purpose.
1703         (TypeManager.MethodFlags): Added IsObsoleteError.
1704         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
1705         Obsolete and Conditional arguments in MethodBuilders.  If we discover
1706         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
1707         the message from the attribute.
1708
1709 2002-07-24  Martin Baulig  <martin@gnome.org>
1710
1711         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
1712         preprocessor directives, ensure that the argument to #define/#undef is
1713         exactly one identifier and that it's actually an identifier.
1714
1715         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
1716         did not work ....
1717
1718 2002-07-24  Martin Baulig  <martin@gnome.org>
1719
1720         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
1721         initialize it to TypeManager.object_type in the constructor.
1722         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
1723         of the `hm.get_current' method if we're using the collection pattern.
1724         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
1725         for the explicit conversion to make it work when we're using the collection
1726         pattern and the `Current' property has a different return type than `object'.
1727         Fixes #27713.
1728
1729 2002-07-24  Martin Baulig  <martin@gnome.org>
1730
1731         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
1732         does not match, but don't report any errors.  This method is called in
1733         order for all methods in a MethodGroupExpr until a matching method is
1734         found, so we don't want to bail out if the first method doesn't match.
1735         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
1736         matches, report the 123.  Fixes #28070.
1737
1738 2002-07-24  Martin Baulig  <martin@gnome.org>
1739
1740         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
1741         TypeManager.TypeToCoreType() to the top of the method so the
1742         following equality checks will work.  Fixes #28107.
1743
1744 2002-07-24  Martin Baulig  <martin@gnome.org>
1745
1746         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
1747         operand is of type uint, and the other operand is of type sbyte,
1748         short or int, the operands are converted to type long." -
1749         Actually do what this comment already told us.  Fixes bug #28106,
1750         added test-150.cs.
1751
1752 2002-07-24  Martin Baulig  <martin@gnome.org>
1753
1754         * class.cs (MethodBase): New abstract class.  This is now a base
1755         class for Property, Indexer and Event to avoid some code duplication
1756         in their Define() and DefineMethods() methods.
1757         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
1758         generic methods for Define() and DefineMethods().
1759         (FieldBase): Derive from MemberBase, not MemberCore.
1760         (Property): Derive from MemberBase, not MemberCore.
1761         (Property.DefineMethod): Moved all the code from this method to the
1762         new MethodBase.DefineAccessor(), just call it with appropriate
1763         argumetnts.
1764         (Property.Define): Call the new Property.DoDefine(), this does some
1765         sanity checks and we don't need to duplicate the code everywhere.
1766         (Event): Derive from MemberBase, not MemberCore.
1767         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
1768         accessors, this will also make them work with interface events.
1769         (Indexer): Derive from MemberBase, not MemberCore.
1770         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
1771         (Indexer.Define): Use the new MethodBase functions.
1772
1773         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
1774         argument to the constructor.
1775         (Interface.FindMembers): Added support for interface events.
1776         (Interface.PopluateEvent): Implemented.
1777
1778         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
1779
1780 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
1781
1782         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
1783         but this is required to check for a method name being the same as
1784         the containing class.  
1785
1786         Handle this now.
1787
1788 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1789
1790         * interface.cs: initialize variable.
1791
1792 2002-07-23  Martin Baulig  <martin@gnome.org>
1793
1794         Implemented the IndexerName attribute in interfaces.
1795
1796         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
1797         name if this is an explicit interface implementation.
1798         (Indexer.InterfaceIndexerName): New public variable.  If we're
1799         implementing an interface indexer, this is the IndexerName in that
1800         interface.  Otherwise, it's the IndexerName.
1801         (Indexer.DefineMethod): If we're implementing interface indexer,
1802         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
1803         and Pending.ImplementIndexer methods.
1804         (Indexer.Define): Also define the PropertyBuilder if we're
1805         implementing an interface indexer and this is neither an explicit
1806         interface implementation nor do the IndexerName match the one in
1807         the interface.
1808
1809         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
1810         If a method is defined here, then we always need to create a proxy
1811         for it.  This is used when implementing interface indexers.
1812         (Pending.IsInterfaceIndexer): New public method.
1813         (Pending.ImplementIndexer): New public method.
1814         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
1815         This is used when implementing interface indexers to define a proxy
1816         if necessary.
1817         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
1818         define a proxy if necessary.
1819
1820         * interface.cs (Interface.IndexerName): New public variable.
1821         (Interface.PopulateIndexer): Set the IndexerName.
1822         (Interface.DefineIndexers): New private method.  Populate all the
1823         indexers and make sure their IndexerNames match.
1824
1825         * typemanager.cs (IndexerPropertyName): Added support for interface
1826         indexers.
1827
1828 2002-07-22  Martin Baulig  <martin@gnome.org>
1829
1830         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
1831         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
1832         ret if HasReturnLabel.
1833         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
1834         variables.
1835
1836         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
1837         and set the ec.LoopBeginTryCatchLevel.
1838         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
1839         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
1840         the current ec.TryCatchLevel, the branch goes out of an exception
1841         block.  In this case, we need to use Leave and not Br.
1842
1843 2002-07-22  Martin Baulig  <martin@gnome.org>
1844
1845         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
1846         block unless the block does not always return or it is contained in
1847         another try { ... } catch { ... } block.  Fixes bug #26506.
1848         Added verify-1.cs to the test suite.
1849
1850 2002-07-22  Martin Baulig  <martin@gnome.org>
1851
1852         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
1853         then we do not always return.  Fixes bug #24985.
1854
1855 2002-07-22  Martin Baulig  <martin@gnome.org>
1856
1857         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
1858         lookup on a per-class level; ie. walk up the class hierarchy until we
1859         found at least one applicable method, then choose the best among them.
1860         Fixes bug #24463 and test-29.cs.
1861
1862 2002-07-22  Martin Baulig  <martin@gnome.org>
1863
1864         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
1865         return types of the methods.  The return type is not part of the
1866         signature and we must not check it to make the `new' modifier work.
1867         Fixes bug #27999, also added test-147.cs.
1868         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
1869
1870         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
1871         on the method's return type.
1872
1873 2002-07-21  Martin Baulig  <martin@gnome.org>
1874
1875         * assign.cs: Make this work if the rightmost source is a constant and
1876         we need to do an implicit type conversion.  Also adding a few more tests
1877         to test-38.cs which should have caught this.
1878
1879         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
1880         target in the makefile for this.  The makefile.gnu is primarily intended
1881         for end-users who don't want to debug the compiler.
1882
1883 2002-07-21  Martin Baulig  <martin@gnome.org>
1884
1885         * assign.cs: Improved the Assign class so it can now handle embedded
1886         assignments (X = Y = Z = something).  As a side-effect this'll now also
1887         consume less local variables.  test-38.cs now passes with MCS, added
1888         a few new test cases to that test.
1889
1890 2002-07-20  Martin Baulig  <martin@gnome.org>
1891
1892         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
1893         instructions.  Fixes bug #27977, also added test-146.cs.
1894
1895 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1896
1897         * cs-tokenizer.cs: fixed getHex ().
1898
1899 2002-07-19  Martin Baulig  <martin@gnome.org>
1900
1901         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
1902         not Type.GetType() to lookup the array type.  This is needed when
1903         we're constructing an array of a user-defined type.
1904         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
1905         single-dimensional arrays, but also for single-dimensial arrays of
1906         type decimal.
1907
1908 2002-07-19  Martin Baulig  <martin@gnome.org>
1909
1910         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
1911         this function is called, it's not allowed to share LocalBuilders
1912         among ILGenerators.
1913
1914 2002-07-19  Martin Baulig  <martin@gnome.org>
1915
1916         * expression.cs (Argument.Resolve): Report an error 118 when trying
1917         to pass a type as argument.
1918
1919 2002-07-18  Martin Baulig  <martin@gnome.org>
1920
1921         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
1922         Conv_R_Un for the signed `long' type.
1923
1924 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
1925
1926         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
1927         `expr' for the temporary result, as that will fail if we do
1928         multiple resolves on the same expression.
1929
1930 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
1931
1932         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
1933         ec.TypeContainer for looking up aliases. 
1934
1935         * class.cs (TypeContainer): Remove LookupAlias from here.
1936
1937         * decl.cs (DeclSpace); Move here.
1938
1939 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
1940
1941         * class.cs (FindMembers): Only call filter if the constructor
1942         bulider is not null.
1943
1944         Also handle delegates in `NestedTypes' now.  Now we will perform
1945         type lookups using the standard resolution process.  This also
1946         fixes a bug.
1947
1948         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
1949         This uses Expressions (the limited kind that can be parsed by the
1950         tree) instead of strings.
1951
1952         * expression.cs (ComposedCast.ToString): Implement, used to flag
1953         errors since now we have to render expressions.
1954
1955         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
1956         FormArrayType. 
1957
1958         * ecore.cs (SimpleName.ToString): ditto.
1959
1960         * cs-parser.jay: Instead of using strings to assemble types, use
1961         Expressions to assemble the type (using SimpleName, ComposedCast,
1962         MemberAccess).  This should fix the type lookups in declarations,
1963         because we were using a different code path for this.
1964
1965         * statement.cs (Block.Resolve): Continue processing statements
1966         even when there is an error.
1967
1968 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
1969
1970         * class.cs (Event.Define): Also remove the `remove' method from
1971         the list of pending items.
1972
1973         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
1974         generate more compact code. 
1975
1976 2002-07-17  Martin Baulig  <martin@gnome.org>
1977
1978         * const.cs (Const.LookupConstantValue): Add support for constant
1979         `unchecked' and `checked' expressions.
1980         Also adding test case test-140.cs for this.
1981
1982 2002-07-17  Martin Baulig  <martin@gnome.org>
1983
1984         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
1985         check whether mi.ReturnType implements the IEnumerator interface; the
1986         `==' and the IsAssignableFrom() will fail in this situation.
1987
1988 2002-07-16  Ravi Pratap  <ravi@ximian.com>
1989
1990         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
1991         here too.
1992
1993 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
1994
1995         * expression.cs: fixed bug #27811.
1996
1997 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
1998
1999         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
2000         Molaro: when we are a ref, the value already contains a pointer
2001         value, do not take the address of it.
2002
2003 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
2004         * removed mb-parser.jay and mb-tokenizer.cs
2005
2006 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
2007
2008         * expression.cs: check against the building corlib void type.
2009
2010 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
2011
2012         * ecore.cs: fix for valuetype static readonly fields: when 
2013         initializing them, we need their address, not the address of a copy.
2014
2015 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
2016
2017         * typemanager.cs: register also enum_type in corlib.
2018
2019 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
2020
2021         * class.cs: allow calling this (but not base) initializers in structs.
2022
2023 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
2024
2025         * ecore.cs: make sure we compare against the building base types
2026         in GetTypeSize ().
2027
2028 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
2029
2030         * typemanager.cs: fix TypeToCoreType() to handle void and object
2031         (corlib gets no more typerefs after this change).
2032
2033 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
2034
2035         * expression.cs (ArrayCreation.EmitArrayArguments): use
2036         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
2037
2038         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
2039         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
2040         array indexes, the runtime actually forbids them.
2041
2042         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
2043         for array arguments here.
2044
2045         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
2046         instead of the default for ValueTypes.
2047
2048         (New.DoEmit): Use IsValueType instead of
2049         IsSubclassOf (value_type)
2050         (New.DoResolve): ditto.
2051         (Invocation.EmitCall): ditto.
2052
2053         * assign.cs (Assign): ditto.
2054
2055         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
2056         Statements *are* currently doing part of their resolution during
2057         Emit.  
2058
2059         Expressions do always resolve during resolve, but statements are
2060         only required to propagate resolution to their children.
2061
2062 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
2063
2064         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
2065
2066         (LoadAssembly): Do not add the dll if it is already specified
2067         
2068         (MainDriver): Add the System directory to the link path at the end,
2069         after all the other -L arguments. 
2070
2071         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
2072         wrong opcode for loading bytes and bools (ldelem.i1 instead of
2073         ldelem.u1) and using the opposite for sbytes.
2074
2075         This fixes Digger, and we can finally run it.
2076
2077         * driver.cs (UnixParseOption): Move the option parsing here.  
2078         (CSCParseOption): Implement CSC-like parsing of options.
2079
2080         We now support both modes of operation, the old Unix way, and the
2081         new CSC-like way.  This should help those who wanted to make cross
2082         platform makefiles.
2083
2084         The only thing broken is that /r:, /reference: and /lib: are not
2085         implemented, because I want to make those have the same semantics
2086         as the CSC compiler has, and kill once and for all the confussion
2087         around this.   Will be doing this tomorrow.
2088
2089         * statement.cs (Unsafe.Resolve): The state is checked during
2090         resolve, not emit, so we have to set the flags for IsUnsfe here.
2091
2092 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
2093
2094         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
2095         not catch the Error_ObjectRefRequired in SimpleName (as it is
2096         possible to have a class/instance variable name that later gets
2097         deambiguated), we have to check this here.      
2098
2099 2002-07-10  Ravi Pratap  <ravi@ximian.com>
2100
2101         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
2102         make static and put into Expression.
2103
2104         (Event.Define): Register the private field of the event with the 
2105         TypeManager so that GetFieldFromEvent can get at it.
2106
2107         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
2108         keep track of the private field associated with an event which
2109         has no accessors.
2110
2111         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
2112         private field.
2113
2114         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
2115         
2116 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
2117
2118         * expression.cs (Binary.EmitBranchable): this routine emits the
2119         Binary expression in a branchable context.  This basically means:
2120         we need to branch somewhere, not just get the value on the stack.
2121
2122         This works together with Statement.EmitBoolExpression.
2123
2124         * statement.cs (Statement.EmitBoolExpression): Use
2125         EmitBranchable. 
2126
2127 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
2128
2129         * statement.cs (For): Reduce the number of jumps in loops.
2130
2131         (For): Implement loop inversion for the For statement.
2132
2133         (Break): We can be breaking out of a Try/Catch controlled section
2134         (foreach might have an implicit try/catch clause), so we need to
2135         use Leave instead of Br.
2136
2137         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
2138         now).  If the instace expression supports IMemoryLocation, we use
2139         the AddressOf method from the IMemoryLocation to extract the
2140         address instead of emitting the instance.
2141
2142         This showed up with `This', as we were emitting the instance
2143         always (Emit) instead of the Address of This.  Particularly
2144         interesting when This is a value type, as we dont want the Emit
2145         effect (which was to load the object).
2146         
2147 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
2148
2149         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
2150
2151         * statement.cs (Checked): Set the CheckedState during the resolve
2152         process too, as the ConvCast operations track the checked state on
2153         the resolve process, and not emit.
2154
2155         * cs-parser.jay (namespace_member_declaration): Flag that we have
2156         found a declaration when we do.  This is used to flag error 1529
2157
2158         * driver.cs: Report ok when we display the help only.
2159
2160 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
2161
2162         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
2163
2164 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
2165
2166         * cs-tokenizer.cs (define): We also have to track locally the
2167         defines.  AllDefines is just used for the Conditional Attribute,
2168         but we also need the local defines for the current source code. 
2169
2170 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
2171
2172         * statement.cs (While, For, Do): These loops can exit through a
2173         Break statement, use this information to tell whether the
2174         statement is the last piece of code.
2175
2176         (Break): Flag that we break.
2177
2178         * codegen.cs (EmitContexts): New `Breaks' state variable.
2179
2180 2002-07-03  Martin Baulig  <martin@gnome.org>
2181
2182         * class.cs (TypeContainer.MethodModifiersValid): Allow override
2183         modifiers in method declarations in structs.  Otherwise, you won't
2184         be able to override things like Object.Equals().
2185
2186 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
2187
2188         * class.cs (Method, Property, Indexer): Do not allow the public
2189         modifier to be used in explicit interface implementations.
2190
2191         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
2192         override modifiers in method declarations in structs
2193
2194 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
2195
2196         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
2197         integer or real overflow, report an error
2198
2199 2002-07-02  Martin Baulig  <martin@gnome.org>
2200
2201         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
2202         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
2203         to tell the runtime about our newly created System.Object and
2204         System.ValueType types.
2205
2206 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
2207
2208         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
2209         struct instead of Ldarg/Starg.
2210
2211 2002-07-02  Martin Baulig  <martin@gnome.org>
2212
2213         * expression.cs (Indirection.Indirection): Call
2214         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
2215
2216 2002-07-02  Martin Baulig  <martin@gnome.org>
2217
2218         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
2219         ValueType, call TypeManager.TypeToCoreType() on it.
2220         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
2221         the OpCodes.Newarr argument.
2222
2223 2002-07-02  Martin Baulig  <martin@gnome.org>
2224
2225         * expression.cs (Invocation.EmitCall): When compiling corlib,
2226         replace all calls to the system's System.Array type to calls to
2227         the newly created one.
2228
2229         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
2230         System.Array methods.
2231         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
2232         from the system's System.Array type which must be replaced.
2233
2234 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
2235
2236         * typemanager.cs: load unverifiable_code_ctor so we can build
2237         corlib using the correct type. Avoid using GetTypeCode() with
2238         TypeBuilders.
2239         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
2240         TypeManager.object_type to allow building corlib.
2241
2242 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
2243
2244         * ecore.cs: handle System.Enum separately in LoadFromPtr().
2245
2246 2002-07-01  Martin Baulig  <martin@gnome.org>
2247
2248         * class.cs: Make the last change actually work, we need to check
2249         whether `ifaces != null' to avoid a crash.
2250
2251 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
2252
2253         * class.cs: when we build structs without fields that implement
2254         interfaces, we need to add the interfaces separately, since there is
2255         no API to both set the size and add the interfaces at type creation
2256         time.
2257
2258 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
2259
2260         * expression.cs: the dimension arguments to the array constructors
2261         need to be converted if they are a long.
2262
2263 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
2264
2265         * class.cs: don't emit ldarg.0 if there is no parent constructor
2266         (fixes showstopper for corlib).
2267
2268 2002-06-29  Martin Baulig  <martin@gnome.org>
2269
2270         MCS now compiles corlib on GNU/Linux :-)
2271
2272         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
2273         ie. check for MethodImplOptions.InternalCall.
2274
2275         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
2276         and TypeManager.attribute_type are null, so we must explicitly check
2277         whether parent is not null to find out whether it's an attribute type.
2278         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
2279         and SetBuilder, not only if the property is neither abstract nor external.
2280         This is necessary to set the MethodImplOptions on the accessor methods.
2281         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
2282         SetBuilder, see Property.Emit().
2283
2284         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
2285         populate "System.Object", "System.ValueType" and "System.Attribute" since
2286         they've already been populated from BootCorlib_PopulateCoreTypes().
2287
2288 2002-06-29  Martin Baulig  <martin@gnome.org>
2289
2290         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
2291         is the NullLiteral, we also need to make sure that target_type is not
2292         an enum type.   
2293
2294 2002-06-29  Martin Baulig  <martin@gnome.org>
2295
2296         * rootcontext.cs (RootContext.ResolveCore): We must initialize
2297         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
2298         before calling BootstrapCorlib_ResolveDelegate ().
2299
2300 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
2301
2302         * statement.cs: fixed build-breaker. All tests passed ok.
2303
2304 2002-06-27  Martin Baulig  <martin@gnome.org>
2305
2306         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
2307         for System.Decimal when compiling corlib.
2308
2309 2002-06-27  Martin Baulig  <martin@gnome.org>
2310
2311         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
2312         switch blocks which contain nothing but a default clause.
2313
2314 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
2315
2316        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
2317
2318 2002-06-27  Martin Baulig  <martin@gnome.org>
2319
2320         * ecore.cs (PropertyExpr.PropertyExpr): Call
2321         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
2322
2323         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
2324         is already a TypeBuilder.
2325
2326 2002-06-27  Martin Baulig  <martin@gnome.org>
2327
2328         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
2329         `target_type == TypeManager.array_type', not IsAssignableFrom() in
2330         the "from an array-type to System.Array" case.  This makes it work
2331         when compiling corlib.
2332
2333 2002-06-27  Martin Baulig  <martin@gnome.org>
2334
2335         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
2336         non-static PropertyExpr, set its InstanceExpression.  This makes
2337         the `ICollection.Count' property work in System/Array.cs.
2338
2339 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
2340
2341         * driver.cs: Made error handling more consistent.  Errors now
2342         tracked by Report class, so many methods which used to return int
2343         now return void.  Main() now prints success/failure and 
2344         errors/warnings message.
2345
2346         Renamed '--probe' compiler argument to '--expect-error'.  Removed
2347         the magic number return values (123 and 124).  Now, if the
2348         expected error occurs, the compiler exits with success (exit value
2349         0).  If the compilation completes without seeing that particular
2350         error, the compiler exits with failure (exit value 1).  The
2351         makefile in mcs/errors has been changed to handle the new behaviour.
2352
2353         * report.cs: Made 'expected error' number a property and renamed
2354         it from 'Probe' to 'ExpectedError'.
2355
2356         * genericparser.cs: Removed error handling support, since it is
2357         now all done by Report class.
2358
2359         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
2360         class, so parse() no longer returns an int.
2361
2362         * namespace.cs: Use Report.Error instead of GenericParser.error
2363
2364 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
2365
2366         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
2367         TypeContainer.AddOperator): At the front of the list put the
2368         explicit implementations, so they get resolved/defined first. 
2369
2370 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
2371
2372         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
2373         interface type is implemented by this TypeContainer.  Used during
2374         explicit interface implementation.
2375
2376         (Property.Define, Indexer.Define, Method.Define): Validate that
2377         the given interface in the explicit implementation is one of the
2378         base classes for the containing type.
2379
2380         Also if we are explicitly implementing an interface, but there is
2381         no match in the pending implementation table, report an error.
2382
2383         (Property.Define): Only define the property if we are
2384         not explicitly implementing a property from an interface.  Use the
2385         correct name also for those properties (the same CSC uses,
2386         although that is really not needed).
2387         
2388         (Property.Emit): Do not emit attributes for explicitly implemented
2389         properties, as there is no TypeBuilder.
2390
2391         (Indexer.Emit): ditto.
2392
2393         Hiding then means that we do not really *implement* a pending
2394         implementation, which makes code fail.
2395
2396 2002-06-22  Martin Baulig  <martin@gnome.org>
2397
2398         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
2399         the return value of Object.GetType().  [FIXME: we need to do this whenever
2400         we get a type back from the reflection library].
2401
2402 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
2403
2404         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
2405
2406 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
2407
2408         * attribute.cs: Return null if we can not look up the type.
2409
2410         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
2411         the interface types found.
2412
2413         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
2414         interface types found.
2415
2416         * typemanager.cs (GetInterfaces): Make this routine returns alll
2417         the interfaces and work around the lame differences between
2418         System.Type and System.Reflection.Emit.TypeBuilder in the results
2419         result for GetInterfaces.
2420         
2421         (ExpandInterfaces): Given an array of interface types, expand and
2422         eliminate repeated ocurrences of an interface.  This expands in
2423         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
2424         be IA, IB, IC.
2425         
2426 2002-06-21  Martin Baulig  <martin@gnome.org>
2427
2428         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
2429         on System.Enum.
2430
2431 2002-06-21  Martin Baulig  <martin@gnome.org>
2432
2433         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
2434         and called with one of the core types, return the corresponding typebuilder for
2435         that type.
2436
2437         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
2438         element type.
2439
2440 2002-06-21  Martin Baulig  <martin@gnome.org>
2441
2442         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
2443         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
2444         (Expression.ConvertReferenceExplicit): Likewise.
2445
2446         * expression.cs (ElementAccess.DoResolve): Likewise.
2447         (ElementAccess.DoResolveLValue): Likewise.
2448
2449 2002-06-10  Martin Baulig  <martin@gnome.org>
2450
2451         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
2452         add the "value" parameter to the parameter list.
2453
2454         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
2455         to our caller.
2456
2457 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
2458
2459         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
2460         the argument to an int, uint, long or ulong, per the spec.  Also
2461         catch negative constants in array creation.
2462
2463 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
2464
2465         * class.cs: do not allow the same interface to appear twice in
2466         the definition list.
2467
2468 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
2469
2470         * ecore.cs: don't use ldlen with System.Array.
2471
2472 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
2473
2474         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
2475
2476 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
2477
2478         * modifiers.cs: produce correct field attributes for protected
2479         internal. Easy fix so miguel can work on ther harder stuff:-)
2480
2481 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
2482
2483         * pending.cs: New file.  Move the code from class.cs here.
2484         Support clearning the pending flag for all methods (when not doing
2485         explicit interface implementation).
2486
2487 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
2488
2489         * rootcontext.cs: added a couple more types needed to bootstrap.
2490
2491 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
2492
2493         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
2494         constructor in the type, instead of any constructor in the type
2495         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
2496         a bug in the Mono runtime when applying the params attribute). 
2497
2498 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
2499         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
2500
2501 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
2502
2503         * expression.cs (Unary.ResolveOperator): Use TypeManager
2504         to resolve the type.
2505         
2506 2002-06-13  Ravi Pratap  <ravi@ximian.com>
2507
2508         * cs-parser.jay (enum_member_declaration): Pass in the attributes
2509         attached.
2510
2511         * enum.cs (AddEnumMember): Add support to store the attributes associated 
2512         with each member too.
2513
2514         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
2515         field builders too - this takes care of the enum member case.
2516
2517 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
2518
2519         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
2520         address-of operator on both value types and pointers.
2521         
2522 2002-06-10  Martin Baulig  <martin@gnome.org>
2523
2524         * interface.cs (Interface.PopulateIndexer): Add the indexer's
2525         PropertyBuilder to the `property_builders' list.
2526
2527         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
2528         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
2529         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
2530         find any indexers which are inherited from an interface.
2531
2532 2002-06-09  Martin Baulig  <martin@gnome.org>
2533
2534         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
2535         the same type as the constant if necessary.  There's also a test-130.cs
2536         for this.
2537
2538         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
2539
2540         * typemanager.cs (TypeManager.ChangeType): Previously known as
2541         Enum.ChangeEnumType().
2542
2543 2002-06-09  Martin Baulig  <martin@gnome.org>
2544
2545         * expression.cs (Cast.TryReduce): Added support for consts.
2546
2547 2002-06-08  Ravi Pratap  <ravi@ximian.com>
2548
2549         * class.cs (Accessor): Hold attributes information so we can pass
2550         it along.
2551
2552         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
2553         Modify to pass in attributes attached to the methods.
2554
2555         (add_accessor_declaration, remove_accessor_declaration): Ditto.
2556
2557         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
2558         to handle the Accessor kind :-)
2559
2560         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
2561         
2562 2002-06-08  Martin Baulig  <martin@gnome.org>
2563
2564         * expression.cs (Unary.TryReduceNegative): Added support for
2565         ULongConstants.
2566
2567 2002-06-08  Martin Baulig  <martin@gnome.org>
2568
2569         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
2570         name can't be found in the `defined_names' - the caller will do a
2571         MemberLookup in this case and thus find methods in System.Enum
2572         such as Enum.IsDefined().
2573
2574 2002-06-08  Martin Baulig  <martin@gnome.org>
2575
2576         * enum.cs (Enum.ChangeEnumType): This is a custom version of
2577         Convert.ChangeType() which works with TypeBuilder created types.
2578         (Enum.LookupEnumValue, Enum.Define): Use it here.
2579
2580         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
2581         `TypeBuilder.BaseType != null' check.
2582         (TypeContainer.FindMembers): Only lookup parent members if we
2583         actually have a parent.
2584         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
2585         (ConstructorInitializer.Resolve): Likewise.
2586
2587         * interface.cs (Interface.FindMembers): Added
2588         `TypeBuilder.BaseType != null' check.
2589
2590         * rootcontext.cs (RootContext.ResolveCore): Added
2591         "System.Runtime.CompilerServices.IndexerNameAttribute" to
2592         classes_second_stage.
2593
2594         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
2595         debug_type and trace_type when compiling with --nostdlib.       
2596
2597 2002-06-07  Martin Baulig  <martin@gnome.org>
2598
2599         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
2600         (AddField): Set it to true when adding a non-static field.
2601         (DefineType): Use `have_nonstatic_fields' to find out whether we
2602         have non-static fields, not `Fields != null'.
2603
2604 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
2605
2606         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
2607         dereferencing a null on the static-field code path)
2608
2609 2002-05-30  Martin Baulig  <martin@gnome.org>
2610
2611         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
2612         to take command line arguments.  Use reflection to call the new
2613         custom `Initialize' function on the symbol writer and pass it the
2614         command line arguments.
2615
2616         * driver.cs (--debug-args): New command line argument to pass command
2617         line arguments to the symbol writer.
2618
2619 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
2620
2621         * assign.cs (DoResolve): Forgot to do the implicit conversion to
2622         the target type for indexers and properties.  Thanks to Joe for
2623         catching this.
2624
2625 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
2626
2627         * typemanager.cs (MethodFlags): returns the method flags
2628         (Obsolete/ShouldIgnore) that control warning emission and whether
2629         the invocation should be made, or ignored. 
2630
2631         * expression.cs (Invocation.Emit): Remove previous hack, we should
2632         not do this on matching a base type, we should do this based on an attribute
2633
2634         Only emit calls to System.Diagnostics.Debug and
2635         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
2636         on the command line.
2637
2638         * rootcontext.cs: Global settings for tracing and debugging.
2639
2640         * cs-tokenizer.cs (define): New utility function to track
2641         defines.   Set the global settings for TRACE and DEBUG if found.
2642
2643 2002-05-25  Ravi Pratap  <ravi@ximian.com>
2644
2645         * interface.cs (Populate*): Pass in the TypeContainer as well as
2646         the DeclSpace as parameters so that we can create EmitContexts and
2647         then use that to apply attributes etc.
2648
2649         (PopulateMethod, PopulateEvent, PopulateProperty)
2650         (PopulateIndexer): Apply attributes everywhere.
2651
2652         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
2653         etc.
2654
2655         (ApplyAttributes): Update accordingly.
2656
2657         We now apply interface attributes for all members too.
2658
2659 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
2660
2661         * class.cs (Indexer.Define); Correctly check if we are explicit
2662         implementation (instead of checking the Name for a ".", we
2663         directly look up if the InterfaceType was specified).
2664
2665         Delay the creation of the PropertyBuilder.
2666
2667         Only create the PropertyBuilder if we are not an explicit
2668         interface implementation.   This means that explicit interface
2669         implementation members do not participate in regular function
2670         lookups, and hence fixes another major ambiguity problem in
2671         overload resolution (that was the visible effect).
2672
2673         (DefineMethod): Return whether we are doing an interface
2674         implementation. 
2675         
2676         * typemanager.cs: Temporary hack until we get attributes in
2677         interfaces (Ravi is working on that) and we get IndexerName
2678         support in interfaces.
2679
2680         * interface.cs: Register the indexers as properties.
2681
2682         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
2683         warning, I have verified that this is a bug in the .NET runtime
2684         (JavaScript suffers of the same problem).
2685
2686         * typemanager.cs (MemberLookup): When looking up members for
2687         interfaces, the parent of an interface is the implicit
2688         System.Object (so we succeed in searches of Object methods in an
2689         interface method invocation.  Example:  IEnumerable x;  x.ToString
2690         ()) 
2691
2692 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
2693
2694         * class.cs (Event): Events should also register if they do
2695         implement the methods that an interface requires.
2696
2697         * typemanager.cs (MemberLookup); use the new GetInterfaces
2698         method. 
2699
2700         (GetInterfaces): The code used to lookup interfaces for a type is
2701         used in more than one place, factor it here. 
2702
2703         * driver.cs: Track the errors at the bottom of the file, we kept
2704         on going.
2705
2706         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
2707         instance if the method we are calling is static!
2708
2709 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
2710
2711         * attribute.cs (ApplyAttributes): Make this function filter out
2712         the IndexerName attribute (as that attribute in reality is never
2713         applied) and return the string constant for the IndexerName
2714         attribute. 
2715
2716         * class.cs (TypeContainer.Emit): Validate that all the indexers
2717         have the same IndexerName attribute, and if so, set the
2718         DefaultName attribute on the class. 
2719
2720         * typemanager.cs: The return value might contain other stuff (not
2721         only methods).  For instance, consider a method with an "Item"
2722         property and an Item method.
2723
2724         * class.cs: If there is a problem with the parameter types,
2725         return. 
2726
2727 2002-05-24  Ravi Pratap  <ravi@ximian.com>
2728
2729         * ecore.cs (ImplicitConversionExists): Wrapper function which also
2730         looks at user defined conversion after making a call to 
2731         StandardConversionExists - we need this for overload resolution.
2732
2733         * expression.cs : Update accordingly the various method calls.
2734
2735         This fixes 2 bugs filed against implicit user defined conversions 
2736
2737 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
2738
2739         * statement.cs: Track the result of the assignment.
2740
2741 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
2742
2743         * expression.cs (MemberAccess): Improved error reporting for
2744         inaccessible members.
2745
2746 2002-05-22  Martin Baulig  <martin@gnome.org>
2747
2748         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
2749         itself with debugging support.
2750
2751 2002-05-22  Martin Baulig  <martin@gnome.org>
2752
2753         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
2754         Removed, this isn't needed anymore.
2755
2756 2002-05-20  Martin Baulig  <martin@gnome.org>
2757
2758         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
2759         be underlying type for an enum.
2760
2761 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
2762
2763         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
2764         that splits out the loading of just the core types.
2765
2766         * rootcontext.cs (ResolveCore): Split the struct resolution in
2767         two, so we can load the enumeration underlying types before any
2768         enums are used.
2769
2770         * expression.cs (Is): Bandaid until we fix properly Switch (see
2771         bug #24985 for details).
2772
2773         * typemanager.cs (ImplementsInterface): The hashtable will contain
2774         a null if there are no interfaces implemented.
2775
2776 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
2777
2778         * cs-parser.jay (indexer_declarator): It is fine to have array
2779         parameters
2780
2781 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
2782
2783         * typemanager.cs: (RegisterBuilder): New function used to register
2784         TypeBuilders that implement interfaces.  Since
2785         TypeBuilder.GetInterfaces (as usual) does not work with lame
2786         Reflection.Emit. 
2787         (AddUserType): register interfaces.
2788
2789         (ImplementsInterface): Use the builder_to_ifaces hash if we are
2790         dealing with TypeBuilder.  Also, arrays are showing up as
2791         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
2792         methods can not be invoked on them!
2793
2794         * ecore.cs (ExplicitReferenceConversionExists): Made public.
2795         (ImplicitReferenceConversionExists): Split out from
2796         StandardConversionExists. 
2797
2798         * expression.cs (As): We were only implementing one of the three
2799         cases for the as operator.  We now implement them all.
2800         (Is): Implement the various other cases for Is as well.
2801
2802         * typemanager.cs (CACHE): New define used to control if we want or
2803         not the FindMembers cache.  Seems to have a negative impact on
2804         performance currently
2805
2806         (MemberLookup): Nested types have full acess to
2807         enclosing type members
2808
2809         Remove code that coped with instance/static returns for events, we
2810         now catch this in RealFindMembers.
2811
2812         (RealFindMembers): only perform static lookup if the instance
2813         lookup did not return a type or an event.  
2814
2815 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
2816
2817         * assign.cs (CompoundAssign): We pass more semantic information
2818         now to Compound Assignments than we did before: now we have all
2819         the information at hand, and now we resolve the target *before* we
2820         do the expression expansion, which allows the "CacheValue" method
2821         to have the effect we intended (before, a [x] += 1 would generate
2822         two differen ArrayAccess expressions from the ElementAccess,
2823         during the resolution process).
2824
2825         (CompoundAssign.DoResolve): Resolve target and original_source here.
2826
2827 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
2828
2829         * expression.cs (ArrayAccess): dropped debugging information. 
2830
2831         * typemanager.cs: Small bug fix: I was always returning i_members,
2832         instead of one of i_members or s_members (depending on which had
2833         the content).
2834
2835         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
2836         method is invoked before any code generation takes place, and it
2837         is a mechanism to inform that the expression will be invoked more
2838         than once, and that the method should use temporary values to
2839         avoid having side effects
2840
2841         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
2842         
2843         * ecore.cs (Expression.CacheTemporaries): Provide empty default
2844         implementation.
2845
2846         * expression.cs (Indirection, ArrayAccess): Add support for
2847         CacheTemporaries in these two bad boys. 
2848
2849         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
2850         ldobj or ldind_ref.  
2851         (StoreFromPtr): Handle stobj as well.
2852
2853         * expression.cs (UnaryMutator): Share more code.
2854         
2855         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
2856         down: I was not tracking the Filter function as well, which
2857         was affecting the results of the cache.
2858
2859 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
2860
2861         * attribute.cs: Remove the hack to handle the CharSet property on
2862         StructLayouts. 
2863
2864 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
2865
2866         * attribute.cs (DoResolve): More uglyness, we now only try to
2867         resolve the attribute partially, to extract the CharSet
2868         information (only if we are a StructLayout attribute).  Otherwise 
2869
2870         (GetExtraTypeInfo): Add some code to conditionally kill in the
2871         future this.   I am more and more convinced that the .NET
2872         framework has special code to handle the attribute setting on
2873         certain elements.
2874
2875         * expression.cs (IsParamsMethodApplicable): Revert my previous
2876         foreach change here, it was wrong.
2877
2878 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
2879
2880         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
2881         (pp_expr): do not abort on unknown input, just return.
2882         (eval): abort if there are pending chars.
2883
2884         * attribute.cs (Attribute.Resolve): Positional parameters are
2885         optional.  Deal with that case.
2886
2887         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
2888         the Ansi/Unicode/Auto information for the type.
2889
2890         (TypeContainer.DefineType): instantiate the EmitContext here, as
2891         we will be using it during the type definition (to resolve
2892         attributes) and during the emit phase.
2893
2894         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
2895         to pull type information out of the attributes
2896
2897         (Attribute.Resolve): track the constructor builder, and allow for
2898         multiple invocations (structs and classes will use this).
2899
2900         * ecore.cs (MemberLookupFinal): new version with all the
2901         parameters customizable.
2902
2903         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
2904         constructors.  Return if the result value is null (as the error
2905         would have been flagged already by MemberLookupFinal)
2906
2907         Do not allow instances of abstract classes or interfaces to be
2908         created.
2909         
2910         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
2911         We have to compare the assembly property here when dealing with
2912         FamANDAssem and Assembly access modifiers, because we might be
2913         creating an assembly from *modules* (that means that we are not
2914         getting TypeBuilders for types defined in other modules that are
2915         part of this assembly).
2916
2917         (Method.Emit): If the method is marked abstract and has a body,
2918         emit an error. 
2919
2920         (TypeContainer.DefineMembers): If both the defined member and the
2921         parent name match are methods, then do not emit any warnings: let
2922         the Method.Define routine take care of flagging warnings.  But if
2923         there is a mismatch (method overrides something else, or method is
2924         overriwritten by something, then emit warning).
2925
2926         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
2927         set to null, this means `do not check for the return type on the
2928         signature'. 
2929
2930         (Method.Define): set the return type for the method signature to
2931         null, so that we get methods with the same name and parameters and
2932         different return types.  This is used to flag warning 114 (you are
2933         hiding a method, and you probably want to use the new/override
2934         keywords instead).
2935
2936         * typemanager.cs (MemberLookup): Implemented proper access
2937         control, closing a long standing set of bug reports.  The problem
2938         was that the Framework only has two bits: Public and NonPublic,
2939         and NonPublic includes private and protected methods, but we need
2940         to enforce the FamANDAssem, FamOrAssem and Family. 
2941
2942 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
2943
2944         * statement.cs (GotoCase): Return true: Ammounts to giving up
2945         knowledge on whether we return or not, and letting the other case
2946         be responsible for it.
2947
2948 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
2949
2950         * driver.cs: Do not load directories for each file processed, only
2951         do it if there is a pattern.
2952
2953         * ecore.cs: Report readonly assigns here as well, as we might have
2954         been resolved only by MemberAccess.
2955
2956         (SimpleName.SimpleNameResolve): Also be useful for LValue
2957         resolution.   We need this to propagate assign to local readonly variables
2958
2959         * typemanager.cs: Use a ptrhashtable for the criteria, because we
2960         do not want to reuse potential criteria memory.
2961
2962         * class.cs (MyEventBuilder): Set reflected_type;
2963
2964         * ecore.cs (Constantify): Added support for constifying bools.
2965
2966         (RootContext.LookupType): Added a cache for values looked up in
2967         the declaration space.
2968
2969         * typemanager.cs (FindMembers): Now is a front-end to
2970         RealFindMembers, and provides a two-level hashtable-based cache to
2971         the request.  
2972
2973         15% performance improvement: from 22.5 to 19.2 seconds.
2974
2975         * expression.cs (IsParamsMethodApplicable): use foreach.
2976         (Invocation.DoResolve): ditto.
2977         (New.DoResolve): ditto.
2978         (ArrayCreation.DoResolve): ditto.
2979
2980         * ecore.cs (FindMostEncompassingType): use foreach.
2981
2982         * delegate.cs (NewDelegate.DoResolve): Use foreach
2983
2984         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
2985         (RemoveMethods): use foreach.
2986
2987         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
2988         nested foreach statements instead of for, and also break out of
2989         the inner loop once a match is found.
2990         
2991         (Invocation.OverloadResolve): Use foreach, simplify the code. 
2992
2993 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
2994
2995         * cfold.cs (BinaryFold): During an enumeration evaluation context,
2996         we actually unwrap the expression to allow for extra information
2997         to be extracted. 
2998
2999         * expression.cs: Use Shr_Un on unsigned operations. 
3000
3001 2002-05-08  Ravi Pratap  <ravi@ximian.com>
3002
3003         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
3004         applicable operators was not being considered correctly. This closes
3005         the bug Miguel reported.
3006
3007 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
3008
3009         * attribute.cs: check that the type derives from System.Attribute
3010         and report the correct error in that case (moved the duplicate code to
3011         its own method, too).
3012
3013 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
3014
3015         * attribute.cs: lookup attribute type name as the spec says: first the
3016         bare attribute name and then name + "Attribute" (nant compiles with
3017         mcs after this fix).
3018
3019 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
3020
3021         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
3022         Because of the way we parse things, we should try to see if a
3023         UIntConstant can fit in an integer.
3024
3025 2002-05-07  Ravi Pratap  <ravi@ximian.com>
3026
3027         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
3028         when we are in an explicit context.
3029
3030         (ConvertReferenceExplicit): When converting from Iface type S to Class
3031         T make sure the rules are implemented as an OR.
3032
3033         * parameter.cs (ParameterType): Make it a property for now although the
3034         purpose really isn't anything immediate.
3035         
3036         * expression.cs (Is*Applicable): Do better checking on the parameter type
3037         of a ref/out parameter. The ones from the system assemblies are already 
3038         marked with the correct type so we don't need to do any correction.
3039
3040         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
3041         the object type is standard too so include that.
3042
3043 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
3044
3045         * ecore.cs (StandardConversionExists): Augment with missing code:
3046         deal with IntConstant, LongConstants and Enumerations.
3047
3048         * assign.cs: Report the error, instead of failing silently
3049
3050         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
3051         typecontainer that they are declared, because the
3052         typecontainer/namespace will have the list of using clauses that
3053         need to be applied.
3054
3055         Assembly Attributes were escaping the normal registration
3056         mechanism. 
3057
3058         (EmitCode): Apply attributes within an EmitContext that represents
3059         the container they were declared on.
3060         
3061         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
3062
3063 2002-05-06  Ravi Pratap  <ravi@ximian.com>
3064
3065         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
3066         Revamp completely - make much cleaner as we now operate only
3067         on a set of Types.
3068
3069         (FindMostSpecificSource, FindMostSpecificTarget): New methods
3070         to implement the logic detailed in the spec more correctly.
3071
3072         (UserDefinedConversion): Update accordingly.
3073
3074 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
3075
3076         * statement.cs: Return flow analysis information up.
3077
3078         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
3079         and the default.
3080
3081         (token): Do not consume an extra character before calling
3082         decimal_digits.
3083
3084 2002-05-06  Piers Haken <piersh@friskit.com>
3085
3086         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
3087
3088 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
3089
3090         * class.cs (Constructor.Emit): Set the IsStatic flag in the
3091         EmitContext during the instance constructor initializer
3092         resolution, to stop access to instance variables.
3093
3094         This is mandated by the spec, last paragraph of the `constructor
3095         initializers' section. 
3096
3097 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
3098
3099         * cs-parser.jay, class.cs (Accessor): new class used to represent
3100         an accessor (get or set).  In the past we used `null' to represent
3101         a missing accessor.  But this is ambiguous because there was no
3102         way to tell in abstract indexers/properties if one of them was
3103         specified.
3104
3105         Now there is a way of addressing that.
3106
3107         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
3108         instead of FindMembers.
3109
3110         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
3111         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
3112
3113         * attribute.cs: Treat indexers and properties as the same in terms
3114         of applying attributes
3115
3116         * ecore.cs (FindMostEncompassedType): Use statically initialized
3117         EmptyExpressions()s like we do elsewhere to avoid creating useless
3118         objects (and we take this out of the tight loop).
3119
3120         (GetConversionOperators): Move the code to extract the actual
3121         operators to a separate routine to clean things up.
3122
3123 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
3124
3125         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
3126         events are always registered FieldBuilders.
3127         
3128         * class.cs (FieldBase): New class shared by Fields 
3129
3130         * delegate.cs: If we are a toplevel delegate, use our full name.
3131         If we are a nested delegate, then only use our tail name.
3132
3133 2002-05-02  Ravi Pratap  <ravi@ximian.com>
3134
3135         * expression.cs (IsApplicable): Ensure that we add the "&" to
3136         ref/out types before comparing it with the type of the argument.
3137
3138         (IsParamsMethodApplicable): Ditto.
3139
3140         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
3141         silly me ;-)
3142
3143         * delegate.cs : Handle the case when we have more than one applicable
3144         method. Flag an error only when we finish checking all.
3145
3146 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
3147
3148         * expression.cs: Add support for boolean static initializers.
3149
3150 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
3151
3152         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
3153
3154         * parameter.cs (ComputeParameterTypes,
3155         ComputeAndDefineParameterTypes): Better error handling: now we
3156         clear the `types' cache if we fail during any of the type lookups.
3157         We also return the status code correctly to our caller
3158
3159         * delegate.cs: If we fail to define a delegate, abort the extra
3160         steps. 
3161
3162         * expression.cs (Binary.ResolveOperator): for
3163         operator==(object,object) and operator !=(object, object) we also
3164         have to verify that there is an implicit conversion from one to
3165         the other.
3166
3167         (ArrayAccess.DoResolve): Array Access can operate on
3168         non-variables. 
3169
3170 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
3171
3172         * assign.cs (CompoundAssign): A new class used as a "flag" that
3173         the assignment actually is happening as part of a compound
3174         assignment operator.
3175
3176         During compound assignment, a few new rules exist to enable things
3177         like:
3178
3179         byte b |= 1 + 2
3180
3181         From the spec:
3182         
3183         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
3184         to the type of x) if y is implicitly convertible to the type of x,
3185         and the operator is a builtin operator and the return type of the
3186         operator is explicitly convertible to the type of x. 
3187
3188         * rootcontext.cs: Reset warning level to 2.  4 catches various
3189         "interesting" features in mcs, we must clean this up at some
3190         point, but currently am trying to kill other bugs ;-)
3191
3192         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
3193         in container classes as well.  
3194
3195         * expression.cs (Binary.ResolveOperator): Handle string case
3196         before anything else (as operator overloading does emit an error
3197         before doing anything else).
3198
3199         This code could go away when we move to a table driven model, but
3200         i could not come up with a good plan last night.
3201         
3202 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
3203
3204         * typemanager.cs (CSharpName): reimplementation using regex.
3205         * class.cs: added null check for fields in Emit
3206         * rootcontext.cs: set warninglevel to 4
3207
3208 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
3209
3210         * typemanager.cs (CSharpName): reimplemented with Lupus
3211         suggestion.
3212
3213 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
3214
3215         * statement.cs (If): correclty implement Resolve, because we were
3216         not catching sem errors in there.  The same process is needed
3217         everywhere else. 
3218         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
3219         
3220
3221         (Statement.Warning_DeadCodeFound): Factorize code.
3222         (While): Report dead code here too.
3223
3224         (Statement): Added Resolve virtual method to allow
3225         for resolution split from the emit code.
3226
3227 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
3228
3229         * statement.cs (EmitBoolExpression): No longer try to resolve the
3230         expression here.    
3231         (MakeBoolean): New utility function that resolve, implicitly
3232         converts to boolean and tags the expression. 
3233         
3234
3235         (If, Do): Implement dead code elimination.
3236         (While): Implement loop inversion
3237
3238         (Do, While, For, If): Resolve the expression prior to calling our
3239         code generation.
3240
3241 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
3242
3243         * class.cs:
3244           - added method Report28 (warning: program has more than one entry point)
3245           - added method IsEntryPoint, implements paragraph 10.1 of the spec
3246           - modified method Method.Define, the part at the end of the method
3247
3248         * rootcontext.cs: added static public Location EntryPointLocation;
3249           
3250         * ../errors/cs0028.cs : Add test case for the above warning.              
3251
3252         * typemanager.cs:
3253           - modified method CSharpName to allow arrays of primitive type to
3254             be printed nicely (e.g. instead of System.Int32[][] it now prints
3255             int[][])
3256           - added method CSharpSignature: returns the signature of a method
3257             in string format to be used in reporting errors, warnings, etc.
3258
3259         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
3260         with String.Empty.
3261         
3262 2002-04-26  Ravi Pratap  <ravi@ximian.com>
3263
3264         * delegate.cs (Define): Fix extremely silly bug where I was
3265         setting the type of the 'object' parameter of the BeginInvoke
3266         method to System.IAsyncResult instead of System.Object ;-)
3267
3268 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
3269
3270         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
3271         here. 
3272
3273         (Constructor.Emit): return if we fail to initialize the
3274         constructor.  Another door closed!  
3275
3276         * expression.cs (New.DoResolve): Improve error message (from -6 to
3277         1501).  Use DeclaredOnly lookup to find the exact constructor.
3278
3279         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
3280         loop.  This is useful.
3281
3282         * cs-parser.jay: Adjust the default parameters so that destructors
3283         have the proper signature.
3284
3285 2002-04-26  Martin Baulig  <martin@gnome.org>
3286
3287         * driver.cs (LoadAssembly): If `assembly' contains any characters
3288         which are only valid in path names and not in assembly names
3289         (currently slash, backslash and point), use Assembly.LoadFrom ()
3290         instead of Assembly.Load () on the `assembly' (before iteration
3291         over the link_paths).
3292
3293 2002-04-26  Martin Baulig  <martin@gnome.org>
3294
3295         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
3296
3297 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
3298
3299         * class.cs (Property): use the new typemanager.MemberLookup
3300
3301         (TypeContainer.MemberLookup): Implement using the
3302         TypeManager.MemberLookup now. 
3303         
3304         * typemanager.cs: Make MemberLookup a function of the TypeManager,
3305         and return MemberInfos, so that these can be used without an
3306         EmitContext (what we had before).
3307
3308 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
3309
3310         * expression.cs: Fix the case where the argument to params if the
3311         type of the params.  I omitted handling this before.   Fixed
3312
3313 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
3314
3315         * driver.cs: Call BootCorlib_PopulateCoreType
3316
3317         * class.cs (Property.CheckBase): Check for properties only, not
3318         for all members. 
3319
3320         * interface.cs: Temporary hack: try/catch around the
3321         CustomAttributeBuilder, because I am getting an exception that I
3322         do not understand.
3323
3324         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
3325         types whose definitions are required to be there (attributes are
3326         defined before standard types).
3327
3328         Compute definitions as we boot the various types, as they are used
3329         immediately (value_type class will need object_type, but if we do
3330         not initialize object_type, we will pass a null, which will let
3331         the runtime pick the System.Object from the existing corlib, which
3332         is not what we want).
3333
3334 2002-04-22  Patrik Torstensson <totte@labs2.com>
3335
3336         * cs-tokenizer.cs: fixed a number of trim() issues.
3337
3338 2002-04-22  Ravi Pratap  <ravi@ximian.com>
3339
3340         * expression.cs (Argument.Type): Ensure that we return the correct
3341         type when we have out or ref parameters [in which case we 
3342         append a "&"].
3343         
3344 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
3345
3346         * class.cs (Property, Indexer): Allow extern modifier in there. 
3347
3348         * typemanager.cs (InitBaseTypes): Initializes object_type and
3349         value_type, since those will be used early on during the bootstrap
3350         process to compile corlib.
3351
3352         (InitCoreTypes): Move code from here to InitBaseTypes.
3353
3354 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
3355
3356         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
3357         single-dimension arrays as using the ldlen opcode.  
3358
3359         Daniel Lewis discovered this optimization.  
3360
3361         * typemanager.cs: Add signature for System.Array::get_Length
3362
3363 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3364
3365         * statement.cs: report the error when the foreach does not apply to an
3366         array nor a collection.
3367
3368 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
3369
3370         * expression.cs: Add implicit conversions to the operator ~.
3371
3372         * constant.cs (DecimalConstant.Emit): Emit decimal value.
3373
3374         * typemanager.cs: Locate the decimal constructor.
3375
3376 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3377
3378         * attribute.cs: use the new property of TypeOf.
3379         * expression.cs: added 'get' property around typearg.
3380
3381         These changes fix a build breaker reported by NickD. Is this the
3382         correct way to fix?  If not, please, revert my changes and make it
3383         work :-).
3384
3385 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
3386
3387         * attribute.cs: Add support for typeof in attribute invocations.
3388         I am not sure that this is right though.
3389
3390 2002-04-14  Duncan Mak  <duncan@ximian.com>
3391
3392         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
3393         Binary.Operator.Division case.
3394
3395 2002-04-13  Ravi Pratap  <ravi@ximian.com>
3396
3397         * class.cs (DefineType): Ensure that we do a proper check on
3398         attribute types and also register it with the TypeManager.
3399
3400         (TypeContainer.Targets): The default for attribute types is
3401         AttributeTargets.All.
3402         
3403         * attribute.cs (ApplyAttributes): Registering the attribute type
3404         is done elsewhere, not when we discover we have a Usage attribute.
3405
3406 2002-04-12  Ravi Pratap  <ravi@ximian.com>
3407
3408         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
3409         and get rid of is_delegate parameter.
3410
3411         * everywhere : update.
3412         
3413 2002-04-12  Ravi Pratap  <ravi@ximian.com>
3414
3415         * cs-parser.jay (compilation_unit): Revamp completely to use
3416         some new ideas that I got from Rhys' grammar to solve the problems
3417         with assembly level attributes.
3418
3419         (outer_declaration): New grammar production.
3420
3421         (attribute_sections): Add.
3422
3423         (opt_attributes): Base on attribute_sections
3424
3425         (namespace_declaration): Allow opt_attributes to tackle the case
3426         when we have assembly level attributes - we are clever in this
3427         regard now ;-)
3428
3429         * attribute.cs (ApplyAttributes): Do not worry about assembly 
3430         attributes in the non-global context.
3431
3432         * rootcontext.cs (AddGlobalAttributes): Go back to using this
3433         instead of SetGlobalAttributes.
3434
3435         * class.cs, rootcontext.cs : Ensure we define and generate 
3436         attribute types before anything else.
3437
3438         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
3439         and flag the new error -20 for the case when the attribute type
3440         does not have valid targets specified. csc does not catch this.
3441
3442         * ../errors/errors.txt : update for error # -20
3443
3444 2002-04-11  Ravi Pratap  <ravi@ximian.com>
3445
3446         * support.cs (InternalParameters.ParameterModifier): Do some null
3447         checking and return sane values.
3448
3449         * class.cs (Method.Define): If we are a PInvoke method, ensure
3450         that we are static and extern. Report error # 601
3451
3452         * ../errors/cs0601.cs : Add test case for the above error.
3453
3454 2002-04-07  Ravi Pratap  <ravi@ximian.com>
3455
3456         * rootcontext.cs (attribute_types): We need to keep type of
3457         all attribute types separately and emit code for them first.
3458
3459         (RegisterAttribute) : Implement.
3460
3461         * class.cs (DefineType): Check if the current Type is a custom
3462         attribute type and register it accordingly.
3463
3464         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
3465         adding the first attribute twice and rename to
3466
3467         (SetGlobalAttributes): this.
3468
3469         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
3470         lookups.
3471
3472         * attribute.cs (ApplyAttributes): Take an additional argument telling us
3473         if we are processing global arguments. Hmm, I am unsure of this.
3474
3475 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
3476
3477         * expression.cs: added static array of strings to avoid calling
3478         Enum.ToString () for Operator in Binary. Significant recover of
3479         performance.
3480
3481 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
3482
3483         * class.cs (FindMembers): Allow the Builders of the various
3484         members to be null.  If they are skip them.  This only happens
3485         during the PInvoke declaration.
3486
3487 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
3488
3489         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
3490         failure, so we do not keep going afterwards.
3491
3492         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
3493         wanted to pass `false' as the `is_delegate' argument.  If this is
3494         the case, why not use delegate_type == null to mean `is_delegate =
3495         false' and anything else as is_delegate = true.
3496
3497 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
3498
3499         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
3500         code for the section, not the beginning of the tests.
3501
3502 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
3503
3504         * cfold.cs: Handle operator + (Enum x, Underlying x) 
3505
3506         * expression.cs (Binary): same.  Warn about errors where we have
3507         Enum/Enum in operator + as well.
3508
3509 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
3510
3511         * statement.cs:
3512                 - added support for switch(bool)
3513                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
3514                 - add TableSwitchEmit() to handle table-based switch statements
3515
3516 2002-04-05  Ravi Pratap  <ravi@ximian.com>
3517
3518         * expression.cs (Invocation.OverloadResolve): Factor out code which
3519         does parameter compatibility checking with arguments so that we can 
3520         re-use the code even from Delegate.VerifyApplicability
3521
3522         (VerifyArgumentsCompat): Move above code here.
3523
3524         * delegate.cs (VerifyApplicability): Get rid of duplicate code
3525         and instead make a call to the above method.
3526
3527 2002-03-31  Ravi Pratap  <ravi@ximian.com>
3528
3529         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
3530         We use it to keep track of classes which are attribute types.
3531
3532 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
3533
3534         * delegate.cs (Delegate.Define): Correctly define the types in the
3535         presence of fixed and array parameters.
3536
3537         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
3538         doing FindMembers.
3539
3540         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
3541         include NonPublic after the first iteration.
3542
3543         * class.cs (Indexer.CheckBase): Only check if both parents are
3544         non-null. 
3545         
3546         * cs-parser.jay (accessor_body): If empty, set to null.
3547
3548         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
3549         same code path here to resolve constants names that we did have in
3550         MemberAccess.DoResolve.  There is too much code duplicated here.
3551
3552 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
3553
3554         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
3555
3556         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
3557         to MakeUnionSet.
3558
3559         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
3560         tokens, numbers and strings.
3561
3562         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
3563         parenthesis.
3564
3565         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
3566         asyncronous parameters and the regular parameters.  
3567
3568         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
3569         specify the target directory.
3570
3571         * expression.cs: (This.DoResolve): Simplify
3572         (As.Emit): Optimize, do not generate IsInst if the expression is
3573         always of the given type.
3574
3575         (Is.DoResolve): Bug fix, we were reporting both always/never for
3576         the is expression.
3577
3578         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
3579         creating too many unnecessary arrays.
3580
3581 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
3582
3583         * class.cs (EmitFieldInitializer): Use Assign expression to assign
3584         fields instead of rolling our own initializer.   Takes care of all
3585         implicit conversions, and drops unnecessary static checks/argument.
3586
3587 2002-03-31  Dick Porter  <dick@ximian.com>
3588
3589         * driver.cs: use the GetDirectories() return values properly, and
3590         use "/" as path separator.
3591
3592 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
3593
3594         * expression.cs (Unary): Optimize - - expr into expr.
3595         (Binary): Optimize a + (-b) into a -b.
3596
3597         * codegen.cs (CodeGen): Made all methods static.
3598
3599 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
3600
3601         * rootcontext.cs: 
3602
3603         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
3604         TypeBuilder property.
3605
3606         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
3607         instead. 
3608
3609         * tree.cs: Removed the various RecordXXXX, and replaced with a
3610         single RecordDecl.  Removed all the accessor methods, and just
3611         left a single access point Type 
3612
3613         * enum.cs: Rename DefineEnum to DefineType.
3614
3615         * decl.cs: New abstract method `DefineType' used to unify the
3616         Defines for Enumerations, Interfaces, TypeContainers and
3617         Delegates.
3618
3619         (FindType): Moved LookupInterfaceOrClass here.  Moved the
3620         LookupBaseClasses method that used to live in class.cs and
3621         interface.cs here, and renamed to FindType.
3622         
3623         * delegate.cs: Implement DefineType.  Take advantage of the
3624         refactored pattern for locating the parent builder without taking
3625         the parent_builder argument (which we know does not work if we are
3626         nested, and triggering a toplevel definition).
3627
3628 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
3629
3630         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
3631         accessibility of a member has changed during override and report
3632         an error if so.
3633
3634         * class.cs (Method.Define, Property.Define): Only complain on
3635         overrides if the method is private, any other accessibility is
3636         fine (and since we just checked the permission is the same, we are
3637         good to go).
3638
3639         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
3640         and elif are processed always.  The other pre-processing
3641         directives are only processed if we are "taking" the path
3642
3643 2002-03-29  Martin Baulig  <martin@gnome.org>
3644
3645         * class.cs (Method.Emit): Only emit symbolic debugging info if the
3646         current location is not Null.
3647
3648         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
3649         a separate method so we can profile it.
3650
3651         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
3652         `span.Seconds' are just seconds, but no minutes or hours.
3653         (MainDriver): Profile the CodeGen.SaveSymbols calls.
3654
3655 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
3656
3657         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
3658         Remove the gratuitous set of Final:
3659
3660                                 // If an interface implementation, then we can set Final.
3661                                 if (((flags & MethodAttributes.Abstract) == 0) &&
3662                                     implementing.DeclaringType.IsInterface)
3663                                         flags |= MethodAttributes.Final;
3664
3665         I do not know what I was smoking when I used that.
3666         
3667
3668         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
3669         step into fixing the name resolution issues for delegates and
3670         unifying the toplevel name resolution.
3671
3672 2002-03-28  Martin Baulig  <martin@gnome.org>
3673
3674         * class.cs (Method.Emit): If we have a symbol writer, call its
3675         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
3676         tell it about the current method.
3677
3678         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
3679         writer that we're going to emit the first byte of IL code for a new
3680         statement (a new source line).
3681         (EmitContext.EmitTopBlock): If we have a symbol writer, call
3682         EmitContext.Mark() before emitting any code.
3683
3684         * location.cs (SymbolDocument): Return null when we're Null.
3685
3686         * statement.cs (Statement): Moved the `Location loc' variable here.
3687         (Statement.EmitBoolExpression): If we have a symbol writer, call
3688         ec.Mark() before emitting any code to tell it that we're at the
3689         beginning of a new statement.
3690         (StatementExpression): Added `Location' argument to the constructor.
3691         (Block): Added public readonly variable `StartLocation' and public
3692         variable `EndLocation'.  The latter is to be set using SetEndLocation().
3693         (Block): Added constructor which takes a start and end location.
3694         (Block.SetEndLocation): New method. This sets the end location.
3695         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
3696         local variables we create.
3697         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
3698         each statement and do also mark the begin and end of the block.
3699
3700         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
3701         tell it the current lexer.Location, use Location.Null for the end of the
3702         block.
3703         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
3704         current block, set its end location using SetEndLocation().
3705         (statement_expression): StatementExpression constructor now takes the
3706         lexer.Location as additional argument.
3707         (for_statement, declare_local_variables): Likewise.
3708         (declare_local_variables): When creating a new implicit block, use the
3709         new Block constructor and pass it the lexer.Location.
3710
3711 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
3712
3713         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
3714         members also on the parent interfaces recursively.
3715
3716 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
3717
3718         * report.cs: Use new formats, since Gonzalo finished the missing
3719         bits. 
3720
3721         * expression.cs (Binary.ResolveOperator): added missing operator|
3722         operator& and operator^ for bool/bool.
3723
3724         * cs-parser.jay: CheckDef now takes a Location argument that is
3725         used to report errors more precisly (instead of reporting the end
3726         of a definition, we try to track something which is a lot closer
3727         to the source of the problem).
3728
3729         * cs-tokenizer.cs: Track global token use, so we can properly flag
3730         the use of #define/#undef after the first token has been seen.
3731
3732         Also, rename the reportXXXX to Error_DescriptiveName
3733
3734         * decl.cs (DeclSpace.IsTopLevel): Move property here from
3735         TypeContainer, so that Enum and Interface can use this too.
3736
3737         * class.cs (TypeContainer.LookupInterfaceOrClass,
3738         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
3739         `builder' argument.  Typically this was used to pass the parent
3740         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
3741         the definition).  
3742
3743         The problem is that a nested class could trigger the definition of
3744         a toplevel class, and the builder would be obviously wrong in that
3745         case. 
3746
3747         So we drop this argument, and we compute dynamically the
3748         TypeBuilder/ModuleBuilder (the correct information was available
3749         to us anyways from DeclSpace.Parent)
3750
3751         * interface.cs (Interface.DefineInterface): Drop builder
3752         parameter cleanup like class.cs
3753
3754         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
3755         like class.cs
3756
3757         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
3758         values. 
3759
3760         (Try.Emit): Propagate the returns value from the statement.
3761
3762         (Return.Emit): Even if we are leavning 
3763
3764         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
3765
3766         * modifiers.cs: Fix the computation of MethodAttributes flags.
3767
3768 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
3769
3770         * driver.cs: allow compilation of files that start with '/'.
3771         Add a default case when checking the argument of --target.
3772
3773 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
3774
3775         * interface.cs: Implement the same search algorithm for types in
3776         the interface code.
3777
3778         * delegate.cs: Do not allow multiple definition.
3779
3780         * Recovered ChangeLog that got accidentally amputated
3781
3782         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
3783
3784         * rootcontext.cs: Load manually enum to allow core classes to
3785         contain enumerations.
3786
3787         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
3788         Update to new static methods in TypeManager.
3789
3790         * typemanager.cs (GetMethod, GetConstructor): Use our
3791         implementation of FindMembers to find the members, since during
3792         corlib compilation, the types are TypeBuilders and GetMethod and
3793         GetConstructor do not work.
3794
3795         Make all methods in TypeManager static.
3796
3797         (InitCodeHelpers): Split the functionality from
3798         the InitCodeTypes function.
3799
3800         * driver.cs: Call InitCodeHelpers after we have populated the
3801         types. 
3802
3803         * cs-parser.jay (delegate_declaration): we did not used to compute
3804         the delegate name correctly for void delegates.
3805
3806 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
3807
3808         * rootcontext.cs (RootContext): Init the interface_resolve_order
3809         and type_container_resolve_order always.
3810
3811         (ResolveCore, BootstrapCorlib_ResolveClass,
3812         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
3813         compiler when compiling with --nostdlib
3814
3815         * class.cs (TypeContainer.DefineType): Check that our parent is
3816         not null.  This test is most important when we are bootstraping
3817         the core types.
3818
3819         * codegen.cs: Split out the symbol writing code.
3820
3821 2002-03-25  Martin Baulig  <martin@gnome.org>
3822
3823         * driver.cs (-g): Made -g an alias for --debug.
3824
3825 2002-03-24  Martin Baulig  <martin@gnome.org>
3826
3827         * codegen.cs (SymbolWriter): New public variable. Returns the
3828         current symbol writer.
3829         (CodeGen): Added `bool want_debugging_support' argument to the
3830          constructor. If true, tell the ModuleBuild that we want debugging
3831         support and ask it for the ISymbolWriter.
3832         (Save): If we have a symbol writer, call it's Close() method after
3833         saving the assembly.
3834
3835         * driver.c (--debug): New command line argument to create a
3836         debugger information file.
3837
3838         * location.cs (SymbolDocument): New public property. Returns an
3839         ISymbolDocumentWriter object for the current source file or null
3840         if we don't have a symbol writer.
3841
3842 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
3843
3844         * driver.cs (LoadAssembly): Correctly return when all the paths
3845         have been tried and not before.
3846
3847         * statement.cs (Switch.Emit): return the actual coverage for this
3848         statement (returns/not-returns)
3849
3850         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
3851         switch of the statement if we are the last switch section.  That
3852         kills two problems: try/catch problems (we used to emit an empty
3853         nop at the end) and switch statements where all branches would
3854         return. 
3855
3856 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
3857
3858         * driver.cs: Add default assemblies (the equivalent to the
3859         Microsoft CSC.RSP file)
3860
3861         * cs-tokenizer.cs: When updating `cols and setting it to zero,
3862         also update tokens_seen and set it to false.
3863
3864         * driver.cs: Implement --recurse for Mike.
3865
3866         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
3867         correctly splitting out the paths.
3868
3869 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
3870
3871         * interface.cs (Interface.PopulateProperty): Instead of using
3872         `parent' as the declaration space for the set parameters, use
3873         `this' 
3874
3875         * support.cs (InternalParameters): InternalParameters constructor
3876         takes a DeclSpace instead of a TypeContainer.
3877
3878         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
3879         types are being initialized, load the address of it before calling
3880         the function.  
3881
3882         (New): Provide a mechanism to disable the generation of local
3883         value type temporaries when the caller will be providing us with
3884         an address to store it.
3885
3886         (ArrayCreation.EmitDynamicInitializers): Use it.
3887
3888 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
3889
3890         * expression.cs (Invocation.EmitArguments): Only probe for array
3891         property if there is more than one argument.  Sorry about that.
3892
3893         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
3894         empty param arrays.
3895         
3896         * class.cs (Method.LabelParameters): Fix incorrect code path that
3897         prevented the `ParamArrayAttribute' from being applied to the
3898         params attribute.
3899
3900 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
3901
3902         * support.cs (ReflectionParameters): Correctly compute whether the
3903         last argument is a params array.  Fixes the problem with
3904         string.Split ('a')
3905
3906         * typemanager.cs: Make the assemblies array always be non-null
3907         (empty, but non-null)
3908
3909         * tree.cs (RecordDecl): New function that abstracts the recording
3910         of names.  This reports error 101, and provides a pointer to the
3911         previous declaration.  Fixes a crash in the compiler.
3912
3913         * cs-parser.jay (constructor_declaration): Update to new grammar,
3914         and provide a constructor_body that can be empty.
3915
3916 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
3917
3918         * driver.cs: Add support for --resources.
3919
3920         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
3921         Make all types for the various array helper methods be integer.
3922
3923         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
3924         CheckState to ConvCast.
3925
3926         (ConvCast): Now it takes a `checked' state argument, to avoid
3927         depending on the emit context for the conversion, and just using
3928         the resolve time setting.
3929
3930         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
3931         instead of Invocation.EmitArguments.  We do not emit the original
3932         arguments, instead we emit those which have been converted to
3933         unsigned int expressions.
3934
3935         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
3936
3937         * codegen.cs: ditto.
3938
3939         * expression.cs (LocalVariableReference): Drop the use of the
3940         Store function that depended on the variable index.
3941
3942         * statement.cs (VariableInfo): Drop the `Idx' property from this
3943         class, as this is not taking into account the indexes for
3944         temporaries tat we generate during the execution, getting the
3945         indexes wrong.
3946
3947         * class.cs: First emit class initializers, then call the parent
3948         constructor. 
3949
3950         * expression.cs (Binary): Fix opcode emision.
3951         (UnaryMutator.EmitCode): Support checked code generation
3952
3953         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
3954         matches for events for both the Static and Instance scans,
3955         pointing to the same element.   Fix that.
3956
3957 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
3958
3959         * rootcontext.cs (ResolveTree): Always set the
3960         interface_resolve_order, because nested interfaces will be calling
3961         into us.
3962
3963         * class.cs (GetInterfaceOrClass): Track the same resolution
3964         process used by TypeManager.LookupType.  This fixes the nested
3965         type lookups in class declarations (separate path from
3966         LookupType). 
3967
3968         (TypeContainer.DefineType): Also define nested interfaces.
3969         (TypeContainer.RegisterOrder): New public function used to
3970         register the order in which child interfaces need to be closed.
3971
3972         Nested interfaces need to be closed after their parents have been
3973         created. 
3974         
3975         * interface.cs (InterfaceAttr): Put all the logic for computing
3976         the interface attribute here. 
3977
3978         (DefineInterface): Register our interface order with the
3979         RootContext or with the TypeContainer depending on the case.
3980
3981 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
3982
3983         * cs-parser.jay: rework foreach statement to work with the new
3984         changes to the policy on SimpleNames.
3985         
3986         * report.cs: support Stacktrace on warnings as well.
3987
3988         * makefile: drop --unsafe and /unsafe from the compile.
3989
3990 2002-03-13  Ravi Pratap  <ravi@ximian.com>
3991
3992         * ecore.cs (StandardConversionExists): Modify to take an Expression
3993         as the first parameter. Ensure we do null -> reference type conversion
3994         checking.
3995
3996         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
3997         temporary Expression objects.
3998
3999 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
4000
4001         * interface.cs: workaround bug in method overloading resolution
4002         (there is already a bugzilla bug for it).
4003
4004 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
4005
4006         We could also solve this problem by having a separate path for
4007         performing type lookups, instead of DoResolve, we could have a
4008         ResolveType entry point, and only participating pieces of the
4009         production (simplename, deref, array) would implement this. 
4010         
4011         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
4012         signal SimpleName to only resolve type names and not attempt to
4013         resolve anything else.
4014
4015         * expression.cs (Cast): Set the flag.
4016
4017         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
4018
4019         * class.cs: Only report 108 if there is no `new' modifier.
4020
4021         * cs-parser.jay: rework foreach statement to work with the new
4022         changes to the policy on SimpleNames.
4023         
4024         * report.cs: support Stacktrace on warnings as well.
4025
4026         * makefile: drop --unsafe and /unsafe from the compile.
4027
4028 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
4029
4030         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
4031         lookups here, instead of doing that at parse time.  This means
4032         that our grammar will not introduce `LocalVariableReferences' as
4033         expressions at this point.  That solves the problem of code like
4034         this:
4035
4036         class X {
4037            static void Main ()
4038            { int X = 1;
4039             { X x = null }}}
4040
4041         This is only half the fix.  The full fix requires parameters to
4042         also be handled in this way.
4043
4044         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
4045         makes the use more obvious of the DeclSpace.  The
4046         ec.TypeContainer.TypeBuilder is now only used to pull the
4047         TypeBuilder for it.
4048
4049         My theory is that I can get rid of the TypeBuilder completely from
4050         the EmitContext, and have typecasts where it is used (from
4051         DeclSpace to where it matters).  
4052
4053         The only pending problem is that the code that implements Aliases
4054         is on TypeContainer, and probably should go in DeclSpace.
4055
4056         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
4057         lookups here, instead of doing that at parse time.  This means
4058         that our grammar will not introduce `LocalVariableReferences' as
4059         expressions at this point.  That solves the problem of code like
4060         this:
4061
4062         class X {
4063            static void Main ()
4064            { int X = 1;
4065             { X x = null }}}
4066
4067         This is only half the fix.  The full fix requires parameters to
4068         also be handled in this way.
4069
4070         * class.cs (Property.DefineMethod): When implementing an interface
4071         method, set newslot, when implementing an abstract method, do not
4072         set the flag (before we tried never setting it, or always setting
4073         it, which is the difference).
4074         (Indexer.DefineMethod): same.
4075         (Method.DefineMethod): same.
4076
4077         * ecore.cs: Only set the status used flag if we get back a Field.
4078
4079         * attribute.cs: Temporary hack, so Paolo can keep working.
4080
4081 2002-03-08  Ravi Pratap  <ravi@ximian.com>
4082
4083         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
4084         the unmanaged type in the case we have a MarshalAs attribute.
4085
4086         (Resolve): Handle the case when we are parsing the special MarshalAs
4087         attribute [we need to store the unmanaged type to use later]
4088         
4089         * typemanager.cs (marshal_as_attr_type): Built in type for the 
4090         MarshalAs Attribute.
4091
4092         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
4093         on parameters and accordingly set the marshalling info.
4094         
4095 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
4096
4097         * class.cs: Optimizing slightly by removing redundant code after
4098         we switched to the `NoTypes' return value.
4099         (Property.DefineMethod): use NoTypes here too.
4100
4101         This fixes the bug I introduced in my last batch of changes.
4102
4103 2002-03-05  Ravi Pratap  <ravi@ximian.com>
4104
4105         * tree.cs (RecordEnum): Add. We now keep track of enums too.
4106
4107         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
4108         Enums since those are types too. 
4109
4110         * cs-parser.jay (enum_declaration): Record enums as we parse them.
4111         
4112         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
4113         thanks to a call during the lookup process.
4114
4115 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
4116
4117         * statement.cs (Foreach): Lots of work to accomodate a particular
4118         kind of foreach statement that I had not kept in mind.  It is
4119         possible to have foreachs on classes that provide a GetEnumerator
4120         method that return objects that implement the "pattern" for using
4121         a foreach, there is no need to support GetEnumerator
4122         specifically. 
4123
4124         This is needed to compile nant.
4125
4126         * decl.cs: Only report 114 if the member is not `Finalize' and if
4127         the warning level is at least 2.
4128
4129         * class.cs: Moved the compare function from Method to
4130         MethodSignature. 
4131
4132         (MethodSignature.InheritableMemberSignatureCompare): Add new
4133         filter function that is used to extract inheritable methods from a
4134         class. 
4135
4136         (Method.Define): Use the new `inheritable_method_signature_filter'
4137         delegate
4138
4139         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
4140         command. 
4141
4142 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
4143
4144         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
4145
4146         * cs-parser.jay: Add opt_semicolon to the interface declaration.
4147
4148         * expression.cs: Pass location information to
4149         ConvertImplicitStandard. 
4150
4151         * class.cs: Added debugging code to track return values from
4152         interfaces. 
4153
4154 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
4155
4156         * expression.cs (Is.DoResolve): If either side of the `is' is an
4157         interface, do not flag the warning.
4158
4159         * ecore.cs (ImplicitReferenceConversion): We need a separate test
4160         for interfaces
4161
4162         * report.cs: Allow for --fatal to be used with --probe.
4163         
4164         * typemanager.cs (NoTypes): Move the definition for the empty Type
4165         array here. 
4166
4167         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
4168         properties. 
4169         (TypeContainer.DefineProxy): New function used to proxy to parent
4170         implementations when implementing interfaces.
4171         (TypeContainer.ParentImplements): used to lookup if our parent
4172         implements a public function that is required by an interface.
4173         (TypeContainer.VerifyPendingMethods): Hook this up.
4174
4175         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
4176         `modules' and `assemblies' arraylists into arrays.  We only grow
4177         these are the very early start up of the program, so this improves
4178         the speedof LookupType (nicely measured).
4179
4180         * expression.cs (MakeByteBlob): Replaced unsafe code with
4181         BitConverter, as suggested by Paolo.
4182
4183         * cfold.cs (ConstantFold.Binary): Special case: perform constant
4184         folding of string concatenation, but if either side is a string,
4185         and the other is not, then return null, and let the runtime use
4186         the concatenation on the string plus the object (using
4187         `Object.ToString'). 
4188
4189 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
4190
4191         Constant Folding has been implemented now.
4192         
4193         * expression.cs (Unary.Reduce): Do not throw an exception, catch
4194         the error instead on types that are not supported in one's
4195         complement. 
4196
4197         * constant.cs (Constant and all children): New set of functions to
4198         perform implict and explicit conversions.
4199         
4200         * ecore.cs (EnumConstant): Implement the new functions to perform
4201         conversion by proxying to the child expression.
4202
4203         * codegen.cs: (ConstantCheckState): Constant evaluation has its
4204         own separate setting that can not be turned off from the command
4205         line using --unchecked or --checked and is only controlled using
4206         the checked/unchecked statements and expressions.  This setting is
4207         used by the constant folder to flag errors.
4208
4209         * expression.cs (CheckedExpr, UncheckedExpr): Set the
4210         ConstantCheckState as well.   
4211
4212         During Resolve, they also have to flag the state, because the
4213         constant folder runs completely in the Resolve phase.
4214
4215         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
4216         well.
4217
4218 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
4219
4220         * cfold.cs: New file, this file contains the constant folder.
4221         
4222         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
4223         argument to track whether we are using the resulting address to
4224         load or store a value and provide better error messages. 
4225
4226         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
4227         new AddressOf arguments.
4228
4229         * statement.cs (Foreach.EmitCollectionForeach): Update
4230
4231         * expression.cs (Argument.Emit): Call AddressOf with proper
4232         arguments to track usage.
4233
4234         (New.DoEmit): Call AddressOf with new arguments.
4235
4236         (Unary.Emit): Adjust AddressOf call.
4237
4238 2002-03-01  Ravi Pratap  <ravi@ximian.com>
4239
4240         * cs-parser.jay (member_access): Change the case for pre-defined types
4241         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
4242         this suggestion.
4243
4244         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
4245         a method body.
4246
4247         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
4248         essentially like methods and apply attributes like MethodImplOptions to them too.
4249
4250         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
4251         not being null.
4252
4253         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
4254         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
4255         is the DeclSpace.
4256
4257         * Update code everywhere accordingly.
4258
4259         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
4260
4261         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
4262
4263 2002-02-28  Ravi Pratap  <ravi@ximian.com>
4264
4265         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
4266         try performing lookups against those instead of jumping straight into using
4267         the 'using' clauses.
4268
4269         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
4270
4271         (LookupType): Perform lookups in implicit parents too.
4272
4273         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
4274         sequence as RootContext.LookupType. 
4275
4276         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
4277         the various cases of namespace lookups into this method.
4278
4279 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
4280
4281         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
4282         in positional arguments)
4283
4284         * class.cs (Operator): Update the AllowedModifiers to contain
4285         extern. 
4286
4287         * cs-parser.jay: Update operator declaration to allow for the
4288         operator body to be empty.
4289
4290         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
4291         values. 
4292
4293 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
4294
4295         * class.cs (Method.Emit): Label parameters.
4296
4297         * driver.cs: Return 1 or 0 as the program exit code.
4298
4299 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
4300
4301         * expression.cs: Special case the `null' object when trying to
4302         auto-compute the type, as anything can be explicitly converted to
4303         that. 
4304
4305         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
4306         spotting this Paolo.
4307
4308         (Expression.ImplicitNumericConversion): Perform comparissions of
4309         the type using the underlying type in the case of an enumeration
4310         rather than using the enumeration type for the compare.
4311
4312         Cope with the underlying == type case, which is not possible to
4313         catch before. 
4314
4315         (Expression.ConvertNumericExplicit): Perform comparissions of
4316         the type using the underlying type in the case of an enumeration
4317         rather than using the enumeration type for the compare.
4318
4319         * driver.cs: If the user does not supply an extension, assume .exe
4320
4321         * cs-parser.jay (if_statement): Rewrote so that we can track the
4322         location for the if statement.
4323
4324         * expression.cs (Binary.ConstantFold): Only concat strings when
4325         the operation is "+", not everything ;-)
4326
4327         * statement.cs (Statement.EmitBoolExpression): Take a location
4328         argument. 
4329         (If, While, Do): Track location.
4330
4331         * expression.cs (Binary.ResolveOperator): In the object + string
4332         case, I was missing a call to ConvertImplicit
4333
4334 2002-02-25  Ravi Pratap  <ravi@ximian.com>
4335
4336         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
4337         Location arguments. Ensure we use RootContext.LookupType to do our work
4338         and not try to do a direct Type.GetType and ModuleBuilder.GetType
4339
4340         * interface.cs (PopulateMethod): Handle the type of the parameter being
4341         null gracefully.
4342
4343         * expression.cs (Invocation.BetterFunction): Handle the case when we 
4344         have a params method with no fixed arguments and a call is made with no
4345         arguments.
4346
4347 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
4348
4349         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
4350         the verbatim-string-literal
4351
4352         * support.cs (InternalParameters.ParameterModifier): handle null
4353         fixed parameters.
4354         (InternalParameters.ParameterType): ditto.
4355
4356         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
4357         duplicating the name of the variable parameter.
4358         (GetParameterByName): Fix bug where we were not looking up array
4359         paramters if they were the only present (thanks Paolo!).
4360         (GetParameterInfo): We only have an empty set of types if both
4361         fixed and array are set to null.
4362         (GetParameterInfo-idx): Handle FixedParameter == null
4363
4364         * cs-parser.jay: Handle the case where there is no catch
4365         statements (missing null test).
4366
4367 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
4368
4369         * driver.cs (MainDriver): Be conservative on our command line
4370         handling.
4371
4372         Catch DirectoryNotFoundException when calling GetFiles.
4373         
4374         (SplitPathAndPattern): Used to split the input specification into
4375         a path and a pattern that we can feed to Directory.GetFiles.
4376
4377 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
4378
4379         * statement.cs (Fixed): Implement the last case of the Fixed
4380         statement (string handling).
4381
4382         * expression.cs (StringPtr): New class used to return a char * to
4383         a string;  Used by the Fixed statement.
4384
4385         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
4386
4387         * expression.cs (Binary.ResolveOperator): Remove redundant
4388         MemberLookup pn parent type.
4389         Optimize union call, we do not need a union if the types are the same.
4390         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
4391         type.
4392
4393         Specialize the use of MemberLookup everywhere, instead of using
4394         the default settings. 
4395
4396         (StackAlloc): Implement stackalloc keyword.
4397
4398         * cs-parser.jay: Add rule to parse stackalloc.
4399         
4400         * driver.cs: Handle /h, /help, /?
4401
4402         * expression.cs (MakeByteBlob): Removed the hacks we had in place
4403         before we supported unsafe code.
4404         
4405         * makefile: add --unsafe to the self compilation of mcs.
4406
4407 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
4408
4409         * expression.cs (PointerArithmetic): New class that is used to
4410         perform pointer arithmetic.
4411         (Binary.Resolve): Handle pointer arithmetic
4412         Handle pointer comparission.
4413         (ArrayPtr): Utility expression class that is used to take the
4414         address of an array.
4415
4416         (ElementAccess): Implement array access for pointers
4417         
4418         * statement.cs (Fixed): Implement fixed statement for arrays, we
4419         are missing one more case before we are done.
4420
4421         * expression.cs (Indirection): Implement EmitAssign and set the
4422         ExprClass to Variable.  This allows pointer dereferences to be
4423         treated as variables, and to have values assigned to them.
4424         
4425         * ecore.cs (Expression.StoreFromPtr): New utility function to
4426         store values dereferencing.
4427
4428 2002-02-20  Ravi Pratap  <ravi@ximian.com>
4429
4430         * expression.cs (Binary.ResolveOperator): Ensure that we are
4431         not trying to operate on a void type - this fixes the reported
4432         bug.
4433
4434         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
4435         the parent implementation is sealed.
4436
4437         * ../errors/cs0239.cs : Add.
4438
4439         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
4440
4441         * typemanager.cs (unverifiable_code_type): Corresponds to 
4442         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
4443         which have unsafe code in them.
4444
4445         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
4446         unsafe context.
4447
4448 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
4449
4450         * cs-tokenizer.cs: Add support for @"litreal strings"
4451
4452         Make tokenizer accept pre-processor directives
4453         on any column (remove the old C-like limitation). 
4454
4455         * rootcontext.cs (EmitCode): Emit any global attributes.
4456         (AddGlobalAttributes): Used to keep track of assembly attributes. 
4457
4458         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
4459
4460         * cs-parser.jay: Add support for global attributes.  
4461
4462 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
4463
4464         * expression.cs (Indirection): New helper class.  Unary will
4465         create Indirection classes to be able to implement the
4466         IMemoryLocation interface on it.
4467
4468 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
4469
4470         * cs-parser.jay (fixed_statement): reference the right statement.
4471
4472         * statement.cs (Fixed.Emit): Finish implementing the fixed
4473         statement for the &x case.
4474
4475 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
4476
4477         * class.cs (Property.Define, Method.Define): Remove newslot when
4478         `implementing'.  
4479
4480         * modifiers.cs: My use of NewSlot when `Abstract' was set was
4481         wrong.  NewSlot should only be used if the `new' keyword is present.
4482
4483         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
4484         locating our system dir.  Sorry about this.
4485
4486 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
4487
4488         * driver.cs (GetSystemDir): Compute correctly the location of our
4489         system assemblies.  I was using the compiler directory instead of
4490         the library directory.
4491
4492 2002-02-13  Ravi Pratap  <ravi@ximian.com>
4493
4494         * expression.cs (BetterFunction): Put back in what Miguel commented out
4495         since it is the correct fix. The problem is elsewhere ;-)
4496
4497         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
4498         parameters of the parms method are themselves compatible or not !
4499
4500         (StandardConversionExists): Fix very dangerous bug where we were forgetting
4501         to check that a class implements an interface before saying that an implicit
4502         conversion was allowed. Use ImplementsInterface to do the checking.
4503
4504 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
4505
4506         * class.cs (Method.Define): Track whether we are an explicit
4507         implementation or not.  And only call DefineMethodOverride if we
4508         are an explicit implementation.
4509
4510         (Property.DefineMethod): Ditto.
4511
4512 2002-02-11  Ravi Pratap  <ravi@ximian.com>
4513
4514         * expression.cs (BetterFunction): Catch hideous bug which was
4515          preventing us from detecting ambiguous calls due to implicit casts i.e
4516         cs0121.
4517
4518 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
4519
4520         * support.cs (Pair): Remove un-needed method.  I figured why I was
4521         getting the error in cs-parser.jay, the variable in a foreach loop
4522         is readonly, and the compiler does not really treat this as a variable.
4523
4524         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
4525         instead of EQUALS in grammar.  
4526
4527         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
4528
4529         * expression.cs (Unary.DoResolve): Check whether the argument is
4530         managed or not.
4531
4532 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
4533
4534         * support.cs: Api for Pair to set a value.  Despite the fact that
4535         the variables are public the MS C# compiler refuses to compile
4536         code that accesses the field if the variable is part of a foreach
4537         statement. 
4538
4539         * statement.cs (Fixed): Begin implementation of the fixed
4540         statement.
4541
4542         (Block.AddVariable): Return the VariableInfo on success and null
4543         on failure instead of true/false. 
4544
4545         * cs-parser.jay (foreach): Catch errors on variables already
4546         defined (we were ignoring this value before) and properly unwind
4547         the block hierarchy
4548
4549         (fixed_statement): grammar for the fixed statement.
4550
4551 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
4552
4553         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
4554         pointer types to be incretemented.
4555
4556         (SizeOf): Implement.
4557
4558         * cs-parser.jay (pointer_member_access): Implement
4559         expr->IDENTIFIER production.
4560
4561         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
4562         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
4563         on safe contexts.
4564
4565         (Unary): Implement indirection.
4566
4567         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
4568         use in non-unsafe context).
4569
4570         (SimpleName.DoResolve): Check for pointers in field access on safe
4571         contexts. 
4572
4573         (Expression.LoadFromPtr): Factor the load-indirect code in this
4574         function.  This was duplicated in UnboxCast and ParameterReference
4575
4576 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
4577
4578         * expression.cs (ComposedCast): report an error if a pointer cast
4579         is used in a safe region.
4580
4581         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
4582         pointer type casts in unsafe context.
4583
4584         * codegen.cs (EmitContext): Set up IsUnsafe.
4585
4586         * cs-parser.jay (non_expression_type): Add productions for pointer
4587         casts. 
4588
4589         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
4590         code.  We should not use force into static mode if the method is
4591         not virtual.  Fixes bug in MIS
4592
4593         * statement.cs (Do.Emit, While.Emit, For.Emit,
4594         Statement.EmitBoolExpression): Add support to Do and While to
4595         propagate infinite loop as `I do return' semantics.
4596
4597         Improve the For case to also test for boolean constants.
4598
4599         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
4600         to the list of attributes we can add.
4601
4602         Remove `EmitContext' argument.
4603
4604         * class.cs (Method.Define): Apply parameter attributes.
4605         (Constructor.Define): Apply parameter attributes.
4606         (MethodCore.LabelParameters): Move here the core of labeling
4607         parameters. 
4608
4609         * support.cs (ReflectionParameters.ParameterModifier,
4610         InternalParameters.ParameterModifier): Use IsByRef on the type and
4611         only return the OUT bit for these parameters instead of in/out/ref
4612         flags.
4613
4614         This is because I miss-understood things.  The ParameterInfo.IsIn
4615         and IsOut represent whether the parameter has the [In] and [Out]
4616         attributes set.  
4617
4618 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
4619
4620         * ecore.cs (FieldExpr.Emit): Release temporaries.
4621
4622         * assign.cs (LocalTemporary.Release): new function.
4623
4624         * codegen.cs (EmitContext.GetTemporaryStorage,
4625         EmitContext.FreeTemporaryStorage): Rework the way we deal with
4626         temporary storage.  Now we can "put back" localbuilders when we
4627         are done with them
4628
4629 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
4630
4631         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
4632         need to make a copy of the variable to generate verifiable code.
4633
4634 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
4635
4636         * driver.cs: Compute dynamically the system directory.
4637
4638         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
4639         Slower, but more generally useful.  Used by the abstract
4640         registering implementation. 
4641
4642         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
4643         the rules for the special rule on Type/instances.  First check if
4644         we have the same name, and if so, try that special static path
4645         rather than the instance path.
4646         
4647 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
4648
4649         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
4650         for, while and if.
4651
4652         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
4653         Enum, ValueType, Delegate or Array for non-corlib compiles.
4654
4655         * cs-tokenizer.cs: Catch long identifiers (645)
4656
4657         * typemanager.cs (IndexerPropetyName): Ravi never tested this
4658         piece of code.
4659
4660         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
4661         fix, we were returning too early, so we were not registering
4662         pending methods from abstract classes.
4663
4664         Do not register pending methods if the class is abstract.
4665
4666         * expression.cs (Conditional.DoResolve): Report circular implicit
4667         conversions when we neecd to compute it for conditional
4668         expressions. 
4669
4670         (Is.DoResolve): If the expression is always of the provided type,
4671         flag warning 183.  If the expression can not ever be of the
4672         provided type flag warning 184.
4673
4674         * class.cs: Catch 169 as well.
4675
4676         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
4677         read. 
4678
4679 2002-01-18  Nick Drochak  <ndrochak@gol.com>
4680
4681         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
4682
4683 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
4684
4685         * interface.cs: (PopulateMethod): Check for pointers being defined
4686         only if the unsafe context is active.
4687         (PopulateProperty): ditto.
4688         (PopulateIndexer): ditto.
4689
4690         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
4691         specified.  If pointers are present, make sure that they are
4692         present in an unsafe context.
4693         (Constructor, Constructor.Define): ditto.
4694         (Field, Field.Define): ditto.
4695         (Property, Property.Define): ditto.
4696         (Event, Event.Define): ditto.
4697
4698         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
4699         hashtable if there are classes or structs defined.
4700
4701         * expression.cs (LocalVariableReference.DoResolve): Simplify this
4702         code, as the constant resolution moved.
4703
4704         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
4705         the metadata, so we can flag error 133. 
4706
4707         * decl.cs (MemberCore.UnsafeOK): New function to test that a
4708         pointer is being declared in an unsafe context.
4709
4710 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
4711
4712         * modifiers.cs (Modifiers.Check): Require a Location argument.
4713         Report error 227 for Unsafe use.
4714
4715         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
4716
4717         * statement.cs (For.Emit): If the test is null, then report that
4718         we do `return', as we wont reach anything afterwards.
4719
4720         (Switch.SwitchGoverningType): Track the expression that matched
4721         the conversion.
4722
4723         * driver.cs: Allow negative numbers as an error code to flag.
4724
4725         * cs-parser.jay: Handle 1551.
4726
4727         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
4728
4729 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
4730
4731         * cs-parser.jay: Report 1518 (type declaration can only contain
4732         class, struct, interface, enum or delegate)
4733
4734         (switch_label): Report 1523 (keywords `case' or `default' must
4735         preced code)
4736
4737         (opt_switch_sections): Report 1522 (empty switch)
4738
4739         * driver.cs: Report 1515 (response file specified multiple times)
4740         Report 1516 (Source file specified multiple times).
4741
4742         * expression.cs (Argument.Resolve): Signal 1510
4743
4744         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
4745         access not allowed in static code)
4746
4747 2002-01-11  Ravi Pratap  <ravi@ximian.com>
4748
4749         * typemanager.cs (IsPointerType): Utility method which we are going
4750         to need a lot.
4751
4752         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
4753         the object type, so we take care of that.
4754
4755         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
4756         
4757         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
4758         added to non-params parameters :-)
4759
4760         * typemanager.cs (CSharpName): Include 'void' type too. 
4761
4762         (void_ptr_type): Include in the set of core types.
4763
4764         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
4765         duplicating code.
4766
4767         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
4768         an unsafe context.
4769
4770         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
4771         completely forgotten about it.
4772
4773 2002-01-10  Ravi Pratap  <ravi@ximian.com>
4774
4775         * cs-parser.jay (pointer_type): Add. This begins our implementation
4776         of parsing rules for unsafe code.
4777
4778         (unsafe_statement): Implement.
4779
4780         (embedded_statement): Modify to include the above.
4781
4782         * statement.cs (Unsafe): Implement new class for unsafe blocks.
4783
4784         * codegen.cs (EmitContext.InUnsafe): Add. This determines
4785         if the current context is an unsafe one.
4786
4787         * cs-parser.jay (local_variable_pointer_type): Since local variable types
4788         are handled differently, we need separate rules for them.
4789
4790         (local_variable_declaration): Update to use local_variable_pointer_type
4791         to allow variable declarations of unmanaged pointer types.
4792
4793         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
4794         in unsafe contexts.
4795
4796         * ../errors/cs0214.cs : Add.
4797
4798 2002-01-16  Nick Drochak  <ndrochak@gol.com>
4799
4800         * makefile: remove 'response' file when cleaning.
4801
4802 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
4803
4804         * cs-parser.jay: Report 1524.
4805
4806 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
4807
4808         * typemanager.cs (RegisterMethod): drop checking if we have
4809         registered this from here
4810
4811 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
4812
4813         * class.cs (Method.EmitDestructor): Implement calling our base
4814         destructor. 
4815
4816         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
4817         value of InFinally.
4818
4819         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
4820         this routine and will wrap the call in a try/catch block.  Deal
4821         with the case.
4822
4823 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
4824
4825         * ecore.cs (Expression.MemberLookup): instead of taking a
4826         parameter `same_type' that was used to tell whether we could
4827         access private members we compute our containing type from the
4828         EmitContext.
4829
4830         (FieldExpr): Added partial support for volatile fields.  This does
4831         not work for volatile fields exposed from assemblies, as I can not
4832         figure out how to extract the modreq from it.
4833
4834         Updated all the source files to use this.
4835
4836         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
4837         because it is referenced by MemberLookup very often. 
4838
4839 2002-01-09  Ravi Pratap  <ravi@ximian.com>
4840
4841         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
4842         TypeBuilder.GetCustomAttributes to retrieve what we need.
4843
4844         Get rid of redundant default_member_attr_type as this is the same as
4845         default_member_type which already exists.
4846
4847         * interface.cs, attribute.cs : Update accordingly.
4848         
4849 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
4850
4851         * typemanager.cs: Enable IndexerPropertyName again.  It does not
4852         work for TYpeBuilders though.  Ravi, can you please fix this?
4853
4854         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
4855
4856         * expression.cs (Argument.Emit): Handle the case of ref objects
4857         being passed to ref functions;  
4858
4859         (ParameterReference.EmitLoad): Loads the content of the pointer
4860         without dereferencing.
4861
4862 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
4863
4864         * cs-tokenizer.cs: Implemented the pre-processing expressions.
4865
4866 2002-01-08  Ravi Pratap  <ravi@ximian.com>
4867
4868         * class.cs (Indexer.DefineMethod): Incorporate the interface
4869         type in the name of the method if we are doing explicit interface
4870         implementation.
4871
4872         * expression.cs (ConversionExists): Remove as it is completely obsolete.
4873
4874         (BetterConversion): Fix extremely trivial bug where we were referring to
4875         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
4876         again !
4877
4878         * ../errors/bug16.cs : Add although we have fixed it.
4879
4880 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
4881
4882         * expression.cs (BaseIndexer): Begin implementation.
4883
4884         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
4885
4886         * cs-parser.jay (indexer_declarator): Use qualified_identifier
4887         production directly to remove a shift/reduce, and implement
4888         explicit interface implementation.
4889
4890         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
4891         after a floating point suffix.
4892
4893         * expression.cs (DoNumericPromotions): Improved the conversion for
4894         uint/uint.  If we have a constant, we avoid doing a typecast to a
4895         larger type.
4896
4897         * class.cs (Indexer): Implement explicit interface implementation
4898         for indexers.
4899         
4900 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
4901
4902         * class.cs: make the default instance constructor public and hidebysig.
4903
4904 2001-01-03  Ravi Pratap  <ravi@ximian.com>
4905
4906         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
4907         so we can call it from elsewhere.
4908
4909         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
4910         we emit it internally if the class has a defined indexer; otherwise the user
4911         emits it by decorating the class definition with the DefaultMemberAttribute.
4912
4913         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
4914         attribute is not used on a type which defines an indexer.
4915
4916         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
4917         character when we skip whitespace.
4918
4919         * ../errors/cs0646.cs : Add.
4920
4921 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
4922
4923         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
4924         again. 
4925
4926         * makefile: Add practical target `mcs3.exe' which builds the third
4927         generation compiler. 
4928
4929         * expression.cs (New): Fix structures constructor calling.
4930
4931         * class.cs (Property, Method, Indexer): Emit Final flag on the
4932         method if we are an interface implementation and we are not
4933         abstract. 
4934
4935         * ecore.cs (PropertyExpr): New public field `IsBase', tells
4936         whether this property is referencing a `base' method.
4937
4938         * expression.cs (Invocation.EmitCall): take an extra argument:
4939         is_base, this is used to determine whether the `call' or
4940         `callvirt' opcode should be used.
4941
4942         
4943         * delegate.cs: update EmitCall.
4944
4945         * class.cs (Method.Define): Set NewSlot for the cases where we are
4946         not implementing an interface method.
4947
4948         (Property.Define): ditto.
4949
4950 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
4951
4952         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
4953         'r'.  Allows mcs to parse itself fully.
4954
4955 2002-01-02  Ravi Pratap  <ravi@ximian.com>
4956
4957         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
4958         of the number of initializers that require the InitializeArray method.
4959
4960         (CheckIndices): Store the Expression in all cases - not the plain value. Also
4961         update the above field where necessary.
4962
4963         (MakeByteBlob): Update accordingly.
4964
4965         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
4966         greater than 2.
4967
4968         (EmitDynamicInitializers): Update in accordance with the new optimization.
4969
4970         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
4971         same OpCode applies.
4972
4973         * cs-parser.jay : Fix some glaring errors I introduced.
4974
4975 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
4976
4977         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
4978         so that we can check for name clashes there too.
4979
4980         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
4981         for interface indexers.
4982
4983         * interfaces.cs (Define): Emit the default member attribute.
4984
4985         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
4986         variable was being referred to while setting the value ;-)
4987
4988 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
4989
4990         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
4991         byte-by-byte information when we know the data is zero.
4992
4993         Make the block always a multiple of 4, because
4994         DefineInitializedData has a bug.
4995
4996         * assign.cs: Fix, we should assign from the temporary, not from
4997         the source. 
4998
4999         * expression.cs (MakeByteBlob): Fix my incorrect code.
5000
5001 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
5002
5003         * typemanager.cs (EnumToUnderlying): This function is used to get
5004         the underlying type from an enumeration, because it does not
5005         always work. 
5006
5007         * constant.cs: Use the I4_S form for values between -128 and 127.
5008
5009         * statement.cs (Block.LookupLabel): Looks up a label.
5010         (Block): Drop support for labeled blocks.
5011
5012         (LabeledStatement): New kind of statement that represents a label
5013         only.
5014
5015         (Goto): Finally implement this bad boy.
5016         
5017         * cs-parser.jay: Update to reflect new mechanism to implement
5018         labels.
5019
5020 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
5021
5022         * codegen.cs (EmitContext.This): a codegen property that keeps the
5023         a single instance of this instead of creating many different this
5024         instances. 
5025
5026         * delegate.cs (Delegate.DoResolve): Update to use the property;
5027
5028         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
5029
5030         * expression.cs (BaseAccess.DoResolve): Ditto.
5031
5032 2001-12-29  Ravi Pratap  <ravi@ximian.com>
5033
5034         * typemanager.cs (methodimpl_attr_type): Add to hold the type
5035         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
5036
5037         (InitCoreTypes): Update accordingly.
5038
5039         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
5040         so we can quickly store the state.
5041
5042         (ApplyAttributes): Set the correct implementation flags
5043         for InternalCall methods.
5044
5045 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
5046
5047         * expression.cs (EmitCall): if a method is not virtual, then do
5048         not use callvirt on it.
5049
5050         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
5051         user defined stuff) requires the use of stobj, which takes an
5052         address on the stack instead of an array and an index.  So emit
5053         the Ldelema operation for it.
5054
5055         (EmitStoreOpcode): Use stobj for valuetypes.
5056
5057         (UnaryMutator.EmitCode): Use the right 1 value depending on
5058         whether we are dealing with int64/uint64, float or doubles.
5059
5060         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
5061         constructors that I implemented last night.
5062
5063         (Constructor.IsDefault): Fix to work properly for static
5064         constructors.
5065
5066         * cs-parser.jay (CheckDef): report method signature errors.
5067         Update error number 103 to be 132.
5068
5069         * decl.cs: New AdditionResult enumeration value: MethodExists.
5070         Although we do this check for methods later on in the semantic
5071         analysis, catching repeated default constructors is so easy that
5072         we catch these here. 
5073         
5074         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
5075         promotions code.
5076
5077         (ParameterReference.EmitAssign, Emit): handle
5078         bools as bytes.
5079
5080         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
5081         (ArrayAccess.EmitStoreOpcode): ditto.
5082
5083         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
5084
5085         * expression.cs (MakeByteBlob): Complete all the missing types
5086         (uint, short, ushort, byte, sbyte)
5087
5088         * class.cs: Only init instance field initializers on instance
5089         constructors. 
5090
5091         Rename `constructors' to instance_constructors. 
5092
5093         (TypeContainer.AddConstructor): Only add constructors to the list
5094         if it is not static.
5095
5096         Make sure that we handle default_static_constructor independently
5097         everywhere where we handle instance_constructors
5098
5099 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
5100
5101         * class.cs: Do not lookup or create a base initializer for a
5102         static constructor.
5103
5104         (ConstructorInitializer.Resolve): use the proper type to lookup
5105         for constructors.
5106
5107         * cs-parser.jay: Report error 1585 (modifiers between type and name).
5108
5109         * enum.cs, interface.cs: Remove CloseType, this is taken care by
5110         in DeclSpace. 
5111
5112         * decl.cs: CloseType is now an virtual method, the default
5113         implementation just closes this type.
5114         
5115 2001-12-28  Ravi Pratap  <ravi@ximian.com>
5116
5117         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
5118         to PreserveSig by default. Also emit HideBySig on such methods.
5119
5120         Basically, set the defaults to standard values.
5121
5122         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
5123         argument, if candidate is better, it can't be worse than the best !
5124
5125         (Invocation): Re-write bits to differentiate between methods being
5126         applicable in their expanded form and their normal form - for params
5127         methods of course.
5128
5129         Get rid of use_standard everywhere as only standard conversions are allowed
5130         in overload resolution. 
5131
5132         More spec conformance.
5133         
5134 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
5135
5136         * driver.cs: Add --timestamp, to see where the compiler spends
5137         most of its time.
5138
5139         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
5140         `this' in static code.
5141
5142         (SimpleName.DoResolve): Implement in terms of a helper function
5143         that allows static-references to be passed upstream to
5144         MemberAccess.
5145
5146         (Expression.ResolveWithSimpleName): Resolve specially simple
5147         names when called by MemberAccess to implement the special
5148         semantics. 
5149
5150         (Expression.ImplicitReferenceConversion): Handle conversions from
5151         Null to reference types before others, as Null's type is
5152         System.Object. 
5153
5154         * expression.cs (Invocation.EmitCall): Handle the special case of
5155         calling methods declared on a reference type from a ValueType
5156         (Base classes System.Object and System.Enum)
5157
5158         (MemberAccess.Resolve): Only perform lookups on Enumerations if
5159         the left hand side is a TypeExpr, not on every enumeration. 
5160
5161         (Binary.Resolve): If types are reference types, then do a cast to
5162         object on operators != and == of both arguments.
5163         
5164         * typemanager.cs (FindMembers): Extract instance and static
5165         members if requested.
5166
5167         * interface.cs (PopulateProperty): Use void_type instead of null
5168         as the return type for the setter method.
5169
5170         (PopulateIndexer): ditto.
5171
5172 2001-12-27  Ravi Pratap  <ravi@ximian.com>
5173
5174         * support.cs (ReflectionParameters): Fix minor bug where we
5175         were examining the wrong parameter for the ParamArray attribute.
5176
5177         Cope with requests for the type of the parameter at position
5178         greater than the params parameter's. We now return the element
5179         type of the params array as that makes more sense.
5180
5181         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
5182         accordingly as we no longer have to extract the element type
5183         ourselves.
5184
5185         (Invocation.OverloadResolve): Update.
5186
5187 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
5188
5189         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
5190         against IEnumerator, test whether the return value is a descendant
5191         of the IEnumerator interface.
5192
5193         * class.cs (Indexer.Define): Use an auxiliary method to implement
5194         the other bits of the method definition.  Begin support for
5195         explicit interface implementation.
5196
5197         (Property.DefineMethod): Use TypeManager.void_type instead of null
5198         for an empty return value.
5199
5200 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
5201
5202         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
5203         dealing with a FieldExpr which is composed of a FieldBuilder, in
5204         the code path we did extract the constant, but we should have
5205         obtained the underlying value to be able to cast it (otherwise we
5206         end up in an infinite loop, this is what Ravi was running into).
5207
5208         (ArrayCreation.UpdateIndices): Arrays might be empty.
5209
5210         (MemberAccess.ResolveMemberAccess): Add support for section
5211         14.5.4.1 that deals with the special case of E.I when E is a type
5212         and something else, that I can be a reference to a static member.
5213
5214         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
5215         handle a particular array type to create byte blobs, it is just
5216         something we dont generate byteblobs for.
5217
5218         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
5219         arguments. 
5220
5221         * location.cs (Push): remove the key from the hashtable that we
5222         are about to add.   This happens for empty files.
5223
5224         * driver.cs: Dispose files after we have parsed them.
5225
5226         (tokenize): new function that only runs the tokenizer on its
5227         input, for speed testing.
5228
5229 2001-12-26  Ravi Pratap  <ravi@ximian.com>
5230
5231         * class.cs (Event.Define): Define the private field only if there
5232         are no accessors defined.
5233
5234         * expression.cs (ResolveMemberAccess): If there is no associated
5235         field with the event, that means we have an event defined with its
5236         own accessors and we should flag error cs0070 since transforming
5237         ourselves into a field is not valid in that case.
5238
5239         * ecore.cs (SimpleName.DoResolve): Same as above.
5240
5241         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
5242         and charset to sane values.
5243
5244 2001-12-25  Ravi Pratap  <ravi@ximian.com>
5245
5246         * assign.cs (DoResolve): Perform check on events only if they 
5247         are being accessed outside the declaring type.
5248
5249         * cs-parser.jay (event_declarations): Update rules to correctly
5250         set the type of the implicit parameter etc.
5251
5252         (add_accessor, remove_accessor): Set current local parameters.
5253
5254         * expression.cs (Binary): For delegate addition and subtraction,
5255         cast the return value from the method into the appropriate delegate
5256         type.
5257
5258 2001-12-24  Ravi Pratap  <ravi@ximian.com>
5259
5260         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
5261         of these as the workaround is unnecessary.
5262
5263         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
5264         delegate data - none of that is needed at all.
5265
5266         Re-write bits to extract the instance expression and the delegate method
5267         correctly.
5268
5269         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
5270         on delegates too.
5271
5272         * attribute.cs (ApplyAttributes): New method to take care of common tasks
5273         of attaching attributes instead of duplicating code everywhere.
5274
5275         * everywhere : Update code to do attribute emission using the above method.
5276
5277 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
5278
5279         * expression.cs (IsParamsMethodApplicable): if there are not
5280         parameters, return immediately.
5281
5282         * ecore.cs: The 0 literal can be implicity converted to an enum
5283         type. 
5284
5285         (SimpleName.DoResolve): First lookup the type, then lookup the
5286         members. 
5287
5288         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
5289         want to get its address.  If the InstanceExpression is not
5290         addressable, store the result in a temporary variable, then get
5291         the address of it.
5292
5293         * codegen.cs: Only display 219 errors on warning level or above. 
5294
5295         * expression.cs (ArrayAccess): Make it implement the
5296         IMemoryLocation interface.
5297
5298         (Binary.DoResolve): handle the operator == (object a, object b)
5299         and operator != (object a, object b) without incurring into a
5300         BoxedCast (because 5 != o should never be performed).
5301
5302         Handle binary enumerator operators.
5303
5304         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
5305         value type, otherwise use Ldelem_ref.
5306
5307         Use precomputed names;
5308
5309         (AddressOf): Implement address of
5310
5311         * cs-parser.jay (labeled_statement): Fix recursive block
5312         addition by reworking the production.
5313
5314         * expression.cs (New.DoEmit): New has a special case:
5315                 
5316                  If we are dealing with a ValueType, we have a few
5317                  situations to deal with:
5318                 
5319                     * The target of New is a ValueType variable, that is
5320                       easy, we just pass this as the variable reference
5321                 
5322                     * The target of New is being passed as an argument,
5323                       to a boxing operation or a function that takes a
5324                       ValueType.
5325                 
5326                       In this case, we need to create a temporary variable
5327                       that is the argument of New.
5328
5329
5330 2001-12-23  Ravi Pratap  <ravi@ximian.com>
5331
5332         * rootcontext.cs (LookupType): Check that current_type is not null before
5333         going about looking at nested types.
5334
5335         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
5336         not implement the IAssignMethod interface any more.
5337
5338         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
5339         where we tranform them into FieldExprs if they are being resolved from within
5340         the declaring type.
5341
5342         * ecore.cs (SimpleName.DoResolve): Do the same here.
5343
5344         * assign.cs (DoResolve, Emit): Clean up code considerably. 
5345
5346         * ../errors/bug10.cs : Add.
5347
5348         * ../errors/cs0070.cs : Add.
5349
5350         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
5351
5352         * assign.cs : Get rid of EventIsLocal everywhere.
5353         
5354 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
5355
5356         * ecore.cs (ConvertIntLiteral): finished the implementation.
5357
5358         * statement.cs (SwitchLabel): Convert the value we are using as a
5359         key before looking up the table.
5360
5361 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
5362
5363         * codegen.cs (EmitTopBlock): Require a Location argument now.
5364
5365         * cs-parser.jay (constructor_declarator): We need to setup
5366         current_local_parameters before we parse the
5367         opt_constructor_initializer, to allow the variables to be bound
5368         to the constructor arguments.
5369
5370         * rootcontext.cs (LookupType): First lookup nested classes in our
5371         class and our parents before we go looking outside our class.
5372
5373         * expression.cs (ConstantFold): Extract/debox the values at the
5374         beginnning. 
5375
5376         * rootcontext.cs (EmitCode): Resolve the constants first before we
5377         resolve the types.  This is not really needed, but it helps debugging.
5378
5379         * statement.cs: report location.
5380         
5381         * cs-parser.jay: pass location to throw statement.
5382
5383         * driver.cs: Small bug fix.
5384
5385         * report.cs: Updated format to be 4-zero filled digits.
5386
5387 2001-12-22  Ravi Pratap  <ravi@ximian.com>
5388
5389         * expression.cs (CheckIndices): Fix minor bug where the wrong
5390         variable was being referred to ;-)
5391
5392         (DoEmit): Do not call EmitStaticInitializers when the 
5393         underlying type is System.Object.
5394
5395 2001-12-21  Ravi Pratap  <ravi@ximian.com>
5396
5397         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
5398         and do the usual workaround for SRE.
5399
5400         * class.cs (MyEventBuilder.EventType): New member to get at the type
5401         of the event, quickly.
5402
5403         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
5404
5405         * assign.cs (Assign.DoResolve): Handle the case when the target
5406         is an EventExpr and perform the necessary checks.
5407
5408         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
5409         interface.
5410
5411         (SimpleName.MemberStaticCheck): Include check for EventExpr.
5412
5413         (EventExpr): Set the type in the constructor itself since we 
5414         are meant to be born fully resolved.
5415
5416         (EventExpr.Define): Revert code I wrote earlier.
5417                 
5418         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
5419         instance expression is null. The instance expression is a This in that case
5420         or a null, depending on whether it is a static method or not.
5421
5422         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
5423         refers to more than one method.
5424
5425         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
5426         and accordingly flag errors.
5427
5428 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
5429
5430         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
5431
5432 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
5433
5434         * location.cs (ToString): Provide useful rutine.
5435
5436 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
5437
5438         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
5439         objects, return the actual integral boxed.
5440
5441         * statement.cs (SwitchLabel): define an ILLabel for each
5442         SwitchLabel. 
5443         
5444         (Switch.CheckSwitch): If the value is a Literal, extract
5445         the underlying literal.
5446         
5447         Also in the unused hashtable we had, add the SwitchLabel so we can
5448         quickly look this value up.
5449
5450         * constant.cs: Implement a bunch of new constants.  Rewrite
5451         Literal based on this.  Made changes everywhere to adapt to this.
5452         
5453         * expression.cs (Expression.MakeByteBlob): Optimize routine by
5454         dereferencing array only once, and also copes with enumrations.
5455
5456         bytes are two bytes wide, not one.
5457
5458         (Cast): Perform constant conversions.
5459         
5460         * ecore.cs (TryImplicitIntConversion): Return literals instead of
5461         wrappers to the literals here.
5462
5463         * expression.cs (DoNumericPromotions): long literals can converted
5464         to ulong implicity (this is taken care of elsewhere, but I was
5465         missing this spot).
5466
5467         * ecore.cs (Expression.Literalize): Make the return type Literal,
5468         to improve type checking.
5469
5470         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
5471
5472 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
5473
5474         * literal.cs: Revert code from ravi that checked the bounds.  The
5475         bounds are sane by the definition of the type itself. 
5476
5477         * typemanager.cs: Fix implementation of ImplementsInterface.  We
5478         need to actually look up in our parent hierarchy for interfaces
5479         implemented. 
5480
5481         * const.cs: Use the underlying type for enumerations
5482
5483         * delegate.cs: Compute the basename for the delegate creation,
5484         that should fix the delegate test case, and restore the correct
5485         Type Lookup semantics in rootcontext
5486
5487         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
5488         referencing a nested type with the Reflection API is using the "+"
5489         sign. 
5490
5491         * cs-parser.jay: Do not require EOF token at the end.
5492
5493 2001-12-20  Ravi Pratap  <ravi@ximian.com>
5494
5495         * rootcontext.cs (LookupType): Concatenate type names with
5496         a '.' instead of a '+' The test suite passes again.
5497
5498         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
5499         field of the enumeration.
5500
5501         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
5502         the case when the member is an EventExpr.
5503
5504         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
5505         static has an associated instance expression.
5506
5507         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
5508
5509         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
5510
5511         * class.cs (Event.Define): Register event and perform appropriate checks
5512         for error #111.
5513
5514         We define the Add and Remove methods even if the use provides none because
5515         in that case, we provide default implementations ourselves.
5516
5517         Define a private field of the type of the event. This is done by the CSC compiler
5518         and we should be doing it too ;-)
5519
5520         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
5521         More methods we use in code we generate.
5522
5523         (multicast_delegate_type, delegate_type): Two separate types since the distinction
5524         is important.
5525
5526         (InitCoreTypes): Update accordingly for the above.
5527
5528         * class.cs (Event.Emit): Generate code for default accessors that we provide
5529
5530         (EmitDefaultMethod): Do the job in the above.
5531
5532         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
5533         appropriate place.
5534
5535 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
5536
5537         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
5538         builders even if we were missing one.
5539
5540         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
5541         pass the Basename as our class name instead of the Name.  The
5542         basename will be correctly composed for us.
5543
5544         * parameter.cs (Paramters): Now takes a Location argument.
5545
5546         * decl.cs (DeclSpace.LookupType): Removed convenience function and
5547         make all the code call directly LookupType in RootContext and take
5548         this chance to pass the Location information everywhere.
5549
5550         * Everywhere: pass Location information.
5551
5552 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
5553
5554         * class.cs (Constructor.Define): Updated way of detecting the
5555         length of the parameters.
5556
5557         (TypeContainer.DefineType): Use basename as the type name for
5558         nested types.
5559
5560         (TypeContainer.Define): Do not recursively define types here, as
5561         definition is taken care in order by the RootContext.
5562
5563         * tree.cs: Keep track of namespaces in a per-file basis.
5564
5565         * parameter.cs (Parameter.ComputeSignature): Update to use
5566         DeclSpace. 
5567
5568         (Parameters.GetSignature): ditto.
5569
5570         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
5571         instead of a TypeContainer.
5572
5573         (Interface.SemanticAnalysis): Use `this' instead of our parent to
5574         resolve names.  Because we need to be resolve in our context, not
5575         our parents.
5576         
5577         * driver.cs: Implement response files.
5578
5579         * class.cs (TypeContainer.DefineType): If we are defined, do not
5580         redefine ourselves.
5581         
5582         (Event.Emit): Emit the code for add/remove handlers.
5583         (Event.Define): Save the MethodBuilders for add/remove.
5584
5585         * typemanager.cs: Use pair here too.
5586
5587         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
5588         DictionaryEntry requires the first argument to be non-null.  
5589         
5590         (enum_declaration): Compute full name for registering the
5591         enumeration.
5592         
5593         (delegate_declaration): Instead of using
5594         formal_parameter_list, use opt_formal_parameter_list as the list
5595         can be empty.
5596
5597         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
5598         (EventParsing): New property that controls whether `add' and
5599         `remove' are returned as tokens or identifiers (for events);
5600
5601 2001-12-19  Ravi Pratap  <ravi@ximian.com>
5602
5603         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
5604         use MyEventBuilder only and let it wrap the real builder for us.
5605
5606         (MyEventBuilder): Revamp constructor etc.
5607
5608         Implement all operations that we perform on EventBuilder in precisely the same
5609         way here too.
5610
5611         (FindMembers): Update to use the EventBuilder member.
5612
5613         (Event.Emit): Update accordingly.
5614
5615 2001-12-18  Ravi Pratap  <ravi@ximian.com>
5616
5617         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
5618         by calling the appropriate methods.
5619
5620         (GetCustomAttributes): Make stubs as they cannot possibly do anything
5621         useful.
5622
5623         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
5624
5625 2001-12-17  Ravi Pratap  <ravi@ximian.com>
5626
5627         * delegate.cs (Delegate.Populate): Check that the return type
5628         and various parameters types are indeed accessible.
5629
5630         * class.cs (Constructor.Define): Same here.
5631
5632         (Field.Define): Ditto.
5633
5634         (Event.Define): Ditto.
5635
5636         (Operator.Define): Check that the underlying Method defined itself
5637         correctly - so it's MethodBuilder should not be null.
5638
5639         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
5640         expression happens to be null.
5641
5642         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
5643         members but as of now we don't seem to be able to do anything really useful with it.
5644
5645         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
5646         not the EventBuilder.
5647
5648 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
5649
5650         * cs-tokenizer.cs: Add support for defines.
5651         Add support for #if, #elif, #else, #endif
5652         
5653         (eval_var): evaluates a variable.
5654         (eval): stubbed for evaluating functions.
5655
5656         * cs-parser.jay: Pass the defines information
5657
5658         * driver.cs: Add --define command line option.
5659
5660         * decl.cs: Move MemberCore here.
5661
5662         Make it the base class for DeclSpace.  This allows us to catch and
5663         report 108 and 109 for everything now.
5664
5665         * class.cs (TypeContainer.Define): Extract all the members
5666         before populating and emit the warning 108 (new keyword required
5667         to override) instead of having each member implement this.
5668
5669         (MemberCore.Define): New abstract method, we will be using this in
5670         the warning reporting engine in Populate.
5671         
5672         (Operator.Define): Adjust to new MemberCore protocol. 
5673
5674         * const.cs (Const): This does not derive from Expression, it is a
5675         temporary object we use to create fields, it is a MemberCore. 
5676
5677         * class.cs (Method.Define): Allow the entry point to be in a
5678         specific class.
5679
5680         * driver.cs: Rewrite the argument handler to clean it up a bit.
5681
5682         * rootcontext.cs: Made it just an auxiliary namespace feature by
5683         making everything static.
5684
5685         * driver.cs: Adapt code to use RootContext type name instead of
5686         instance variable.
5687
5688         * delegate.cs: Remove RootContext argument.
5689
5690         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
5691         argument. 
5692
5693         * class.cs (Event.Define): The lookup can fail.
5694         
5695         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
5696
5697         * expression.cs: Resolve the this instance before invoking the code.
5698
5699 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
5700
5701         * cs-parser.jay: Add a production in element_access that allows
5702         the thing to become a "type" reference.  This way we can parse
5703         things like "(string [])" as a type.
5704
5705         Note that this still does not handle the more complex rules of
5706         casts. 
5707         
5708
5709         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
5710
5711         * ecore.cs: (CopyNewMethods): new utility function used to
5712         assemble the list of methods from running FindMembers.
5713
5714         (MemberLookup): Rework FindMembers so that 
5715
5716 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
5717
5718         * class.cs (TypeContainer): Remove Delegates who fail to be
5719         defined.
5720
5721         * delegate.cs (Populate): Verify that we dont get null return
5722         values.   TODO: Check for AsAccessible.
5723
5724         * cs-parser.jay: Use basename to emit error 574 (destructor should
5725         have the same name as container class), not the full name.
5726
5727         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
5728         possible representation.  
5729
5730         Also implements integer type suffixes U and L.
5731
5732 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
5733
5734         * expression.cs (ArrayCreation.DoResolve): We need to do the
5735         argument resolution *always*.
5736
5737         * decl.cs: Make this hold the namespace.  Hold the root context as
5738         well.
5739         (LookupType): Move here.
5740
5741         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
5742
5743         * location.cs (Row, Name): Fixed the code, it was always returning
5744         references to the first file.
5745
5746         * interface.cs: Register properties defined through interfaces.
5747
5748         * driver.cs: Add support for globbing on the command line
5749
5750         * class.cs (Field): Make it derive from MemberCore as well.
5751         (Event): ditto.
5752
5753 2001-12-15  Ravi Pratap  <ravi@ximian.com>
5754
5755         * class.cs (Event::Define): Check that the type of the event is a delegate
5756         type else flag error #66.
5757
5758         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
5759         same.
5760
5761         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
5762         values of EntryPoint, CharSet etc etc.
5763
5764         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
5765
5766         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
5767         be null and we should ignore this. I am not sure if this is really clean. Apparently,
5768         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
5769         which needs this to do its work.
5770
5771         * ../errors/cs0066.cs : Add.
5772
5773 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
5774
5775         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
5776         helper functions.
5777
5778         * class.cs: (MethodSignature.MethodSignature): Removed hack that
5779         clears out the parameters field.
5780         (MemberSignatureCompare): Cleanup
5781
5782         (MemberCore): New base class used to share code between MethodCore
5783         and Property.
5784
5785         (RegisterRequiredImplementations) BindingFlags.Public requires
5786         either BindingFlags.Instace or Static.  Use instance here.
5787
5788         (Property): Refactored code to cope better with the full spec.
5789
5790         * parameter.cs (GetParameterInfo): Return an empty array instead
5791         of null on error.
5792
5793         * class.cs (Property): Abstract or extern properties have no bodies.
5794
5795         * parameter.cs (GetParameterInfo): return a zero-sized array.
5796
5797         * class.cs (TypeContainer.MethodModifiersValid): Move all the
5798         method modifier validation to the typecontainer so we can reuse
5799         this on properties.
5800
5801         (MethodCore.ParameterTypes): return an empty sized array of types.
5802
5803         (Property.Define): Test property modifier validity.
5804
5805         Add tests for sealed/override too.
5806
5807         (Method.Emit): abstract or extern methods have no bodies.
5808
5809 2001-12-14  Ravi Pratap  <ravi@ximian.com>
5810
5811         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
5812         thing.
5813
5814         (Method::Define, ::Emit): Modify accordingly.
5815
5816         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
5817
5818         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
5819
5820         * makefile: Pass in /unsafe.
5821
5822 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
5823
5824         * class.cs (MakeKey): Kill routine.
5825         
5826         * class.cs (TypeContainer.Define): Correctly define explicit
5827         method implementations (they require the full interface name plus
5828         the method name).
5829
5830         * typemanager.cs: Deply the PtrHashtable here and stop using the
5831         lame keys.  Things work so much better.
5832
5833         This of course broke everyone who depended on `RegisterMethod' to
5834         do the `test for existance' test.  This has to be done elsewhere.
5835
5836         * support.cs (PtrHashtable): A hashtable that avoid comparing with
5837         the object stupid Equals method (because, that like fails all over
5838         the place).  We still do not use it.
5839
5840         * class.cs (TypeContainer.SetRequiredInterface,
5841         TypeContainer.RequireMethods): Killed these two routines and moved
5842         all the functionality to RegisterRequiredImplementations.
5843
5844         (TypeContainer.RegisterRequiredImplementations): This routine now
5845         registers all the implementations required in an array for the
5846         interfaces and abstract methods.  We use an array of structures
5847         which can be computed ahead of time to reduce memory usage and we
5848         also assume that lookups are cheap as most classes will not
5849         implement too many interfaces.
5850
5851         We also avoid creating too many MethodSignatures.
5852
5853         (TypeContainer.IsInterfaceMethod): Update and optionally does not
5854         clear the "pending" bit if we find that there are problems with
5855         the declaration.
5856
5857         (TypeContainer.VerifyPendingMethods): Update to report errors of
5858         methods that look like implementations but are not.
5859
5860         (TypeContainer.Define): Add support for explicit interface method
5861         implementation. 
5862         
5863 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
5864
5865         * typemanager.cs: Keep track of the parameters here instead of
5866         being a feature of the TypeContainer.
5867
5868         * class.cs: Drop the registration of parameters here, as
5869         InterfaceMethods are also interface declarations.
5870
5871         * delegate.cs: Register methods with the TypeManager not only with
5872         the TypeContainer.  This code was buggy.
5873
5874         * interface.cs: Full registation here.
5875
5876 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
5877
5878         * expression.cs: Remove reducer for binary expressions, it can not
5879         be done this way.
5880
5881         * const.cs: Put here the code that used to go into constant.cs
5882
5883         * constant.cs: Put here the code for constants, this is a new base
5884         class for Literals.
5885
5886         * literal.cs: Make Literal derive from Constant.
5887
5888 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
5889
5890         * statement.cs (Return.Emit): Report error 157 if the user
5891         attempts to return from a finally block.
5892
5893         (Return.Emit): Instead of emitting a return, jump to the end of
5894         the function.
5895
5896         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
5897         LocalBuilder to store the result of the function.  ReturnLabel is
5898         the target where we jump.
5899         
5900
5901 2001-12-09  Radek Doulik  <rodo@ximian.com>
5902
5903         * cs-parser.jay: remember alias in current namespace
5904
5905         * ecore.cs (SimpleName::DoResolve): use aliases for types or
5906         namespaces
5907
5908         * class.cs (LookupAlias): lookup alias in my_namespace
5909
5910         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
5911         aliases hashtable
5912         (LookupAlias): lookup alias in this and if needed in parent
5913         namespaces
5914
5915 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
5916
5917         * support.cs: 
5918
5919         * rootcontext.cs: (ModuleBuilder) Made static, first step into
5920         making things static.  I need this to avoid passing the
5921         TypeContainer when calling ParameterType.
5922
5923         * support.cs (InternalParameters.ParameterType): Remove ugly hack
5924         that did string manipulation to compute the type and then call
5925         GetType.  Use Parameter.ParameterType instead.
5926
5927         * cs-tokenizer.cs: Consume the suffix for floating values.
5928
5929         * expression.cs (ParameterReference): figure out whether this is a
5930         reference parameter or not.  Kill an extra variable by computing
5931         the arg_idx during emission.
5932
5933         * parameter.cs (Parameters.GetParameterInfo): New overloaded
5934         function that returns whether a parameter is an out/ref value or not.
5935
5936         (Parameter.ParameterType): The type of the parameter (base,
5937         without ref/out applied).
5938         
5939         (Parameter.Resolve): Perform resolution here.
5940         (Parameter.ExternalType): The full type (with ref/out applied).
5941
5942         * statement.cs (Using.Emit, Using.EmitExpression): Implement
5943         support for expressions on the using statement.
5944
5945 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
5946
5947         * statement.cs (Using.EmitLocalVariableDecls): Split the
5948         localvariable handling of the using statement.
5949
5950         (Block.EmitMeta): Keep track of variable count across blocks.  We
5951         were reusing slots on separate branches of blocks.
5952
5953         (Try.Emit): Emit the general code block, we were not emitting it. 
5954
5955         Check the type of the declaration to be an IDisposable or
5956         something that can be implicity converted to it. 
5957
5958         Emit conversions if required.
5959
5960         * ecore.cs (EmptyExpression): New utility class.
5961         (Expression.ImplicitConversionExists): New utility function.
5962
5963 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
5964
5965         * statement.cs (Using): Implement.
5966
5967         * expression.cs (LocalVariableReference): Support read only variables.
5968
5969         * statement.cs: Remove the explicit emit for the Leave opcode.
5970         (VariableInfo): Add a readonly field.
5971
5972 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
5973
5974         * ecore.cs (ConvCast): new class used to encapsulate the various
5975         explicit integer conversions that works in both checked and
5976         unchecked contexts.
5977
5978         (Expression.ConvertNumericExplicit): Use new ConvCast class to
5979         properly generate the overflow opcodes.
5980
5981 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
5982
5983         * statement.cs: The correct type for the EmptyExpression is the
5984         element_type, not the variable type.  Ravi pointed this out.
5985
5986 2001-12-04  Ravi Pratap  <ravi@ximian.com>
5987
5988         * class.cs (Method::Define): Handle PInvoke methods specially
5989         by using DefinePInvokeMethod instead of the usual one.
5990
5991         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
5992         above to do the task of extracting information and defining the method.
5993         
5994 2001-12-04  Ravi Pratap  <ravi@ximian.com>
5995
5996         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
5997         of the condition for string type.
5998
5999         (Emit): Move that here. 
6000
6001         (ArrayCreation::CheckIndices): Keep string literals in their expression
6002         form.
6003
6004         (EmitDynamicInitializers): Handle strings appropriately.
6005
6006 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
6007
6008         * codegen.cs (EmitContext): Replace multiple variables with a
6009         single pointer to the current Switch statement.
6010
6011         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
6012         EmitContext.
6013
6014 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
6015
6016         * statement.cs 
6017
6018         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
6019         default'.
6020         
6021         (Foreach.Emit): Foreach on arrays was not setting
6022         up the loop variables (for break/continue).
6023
6024         (GotoCase): Semi-implented.
6025         
6026 2001-12-03  Ravi Pratap  <ravi@ximian.com>
6027
6028         * attribute.cs (CheckAttribute): Handle system attributes by using
6029         Attribute.GetAttributes to examine information we need.
6030
6031         (GetValidPlaces): Same here.
6032
6033         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
6034
6035         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
6036
6037         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
6038
6039         (Method::Define): Set appropriate flags if we have a DllImport attribute.
6040
6041         (Method::Emit): Handle the case when we are a PInvoke method.
6042
6043 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
6044
6045         * expression.cs: Use ResolveWithSimpleName on compound names.
6046
6047 2001-12-02  Ravi Pratap  <ravi@ximian.com>
6048
6049         * constant.cs (EmitConstant): Make sure we resolve the associated expression
6050         before trying to reduce it.
6051
6052         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
6053
6054         * constant.cs (LookupConstantValue): Implement.
6055
6056         (EmitConstant): Use the above in emitting the constant.
6057
6058         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
6059         that are user-defined by doing a LookupConstantValue on them.
6060
6061         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
6062         too, like above.
6063
6064 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
6065
6066         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
6067
6068         (BaseAccess.DoResolve): Implement.
6069
6070         (MemberAccess.DoResolve): Split this routine into a
6071         ResolveMemberAccess routine that can be used independently
6072
6073 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
6074
6075         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
6076         As that share bits of the implementation.  Is returns a boolean,
6077         while As returns the Type that is being probed.
6078
6079 2001-12-01  Ravi Pratap  <ravi@ximian.com>
6080
6081         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
6082         instead of a Literal - much easier.
6083
6084         (EnumInTransit): Remove - utterly useless :-)
6085
6086         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
6087
6088         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
6089
6090         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
6091         chain when we have no associated expression.
6092
6093 2001-11-30  Ravi Pratap  <ravi@ximian.com>
6094
6095         * constant.cs (Define): Use Location while reporting the errror.
6096
6097         Also emit a warning when 'new' is used and there is no inherited
6098         member to hide.
6099
6100         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
6101         populated.
6102
6103         (LookupEnumValue): Implement to lookup an enum member's value and define it
6104         if necessary.
6105
6106         (Populate): Re-write accordingly to use the above routine.
6107
6108 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
6109
6110         * expression.cs (This): Fix prototype for DoResolveLValue to
6111         override the base class DoResolveLValue.
6112
6113         * cs-parser.cs: Report errors cs574 and cs575 (destructor
6114         declarations) 
6115
6116         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
6117         (we need to load the address of the field here).  This fixes
6118         test-22. 
6119         
6120         (FieldExpr.DoResolveLValue): Call the DoResolve
6121         function to initialize the Instance expression.
6122         
6123         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
6124         correctly the GetEnumerator operation on a value type.
6125
6126         * cs-parser.jay: Add more simple parsing error catches.
6127
6128         * statement.cs (Switch): Add support for string switches.
6129         Handle null specially.
6130
6131         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
6132
6133 2001-11-28  Ravi Pratap  <ravi@ximian.com>
6134
6135         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
6136
6137         (declare_local_constant): New helper function.
6138
6139         * statement.cs (AddConstant): Keep a separate record of constants
6140
6141         (IsConstant): Implement to determine if a variable is a constant.
6142
6143         (GetConstantExpression): Implement.
6144
6145         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
6146
6147         * statement.cs (IsVariableDefined): Re-write.
6148
6149 2001-11-27  Ravi Pratap  <ravi@ximian.com>
6150
6151         * class.cs (TypeContainer::FindMembers): Look for constants
6152         in the case when we are looking for MemberTypes.Field
6153
6154         * expression.cs (MemberAccess::DoResolve): Check that in the
6155         case we are a FieldExpr and a Literal, we are not being accessed
6156         by an instance reference.
6157
6158         * cs-parser.jay (local_constant_declaration): Implement.
6159
6160         (declaration_statement): Implement for constant declarations.
6161
6162 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
6163
6164         * statement.cs (Switch): Catch double defaults.
6165
6166         (Switch): More work on the switch() statement
6167         implementation.  It works for integral values now, need to finish
6168         string support.
6169
6170
6171 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
6172
6173         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
6174         integer literals into other integer literals.  To be used by
6175         switch. 
6176
6177 2001-11-24  Ravi Pratap  <ravi@ximian.com>
6178
6179         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
6180         some memory.
6181
6182         (EmitDynamicInitializers): Cope with the above since we extract data
6183         directly from ArrayData now.
6184
6185         (ExpectInitializers): Keep track of whether initializers are mandatory
6186         or not.
6187
6188         (Bounds): Make it a hashtable to prevent the same dimension being 
6189         recorded for every element in that dimension.
6190
6191         (EmitDynamicInitializers): Fix bug which prevented the Set array method
6192         from being found.
6193
6194         Also fix bug which was causing the indices to be emitted in the reverse
6195         order.
6196
6197 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
6198
6199         * expression.cs (ArrayCreation): Implement the bits that Ravi left
6200         unfinished.  They do not work, because the underlying code is
6201         sloppy.
6202
6203 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
6204
6205         * cs-parser.jay: Remove bogus fixme.
6206
6207         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
6208         on Switch statement.
6209         
6210 2001-11-23  Ravi Pratap  <ravi@ximian.com>
6211
6212         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
6213         the same. 
6214         
6215         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
6216         parameter. Apparently, any expression is allowed. 
6217
6218         (ValidateInitializers): Update accordingly.
6219
6220         (CheckIndices): Fix some tricky bugs thanks to recursion.
6221
6222         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
6223         I was being completely brain-dead.
6224
6225         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
6226         and re-write acordingly.
6227
6228         (DelegateInvocation): Re-write accordingly.
6229
6230         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
6231
6232         (MakeByteBlob): Handle types more correctly.
6233
6234         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
6235         initialization from expressions but it is incomplete because I am a complete
6236         Dodo :-|
6237
6238 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
6239
6240         * statement.cs (If.Emit): Fix a bug that generated incorrect code
6241         on If.  Basically, we have to return `true' (ie, we do return to
6242         our caller) only if both branches of the if return.
6243
6244         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
6245         short-circuit operators, handle them as short circuit operators. 
6246
6247         (Cast.DoResolve): Resolve type.
6248         (Cast.Cast): Take an expression as the target type.
6249
6250         * cs-parser.jay (cast_expression): Remove old hack that only
6251         allowed a limited set of types to be handled.  Now we take a
6252         unary_expression and we resolve to a type during semantic
6253         analysis.
6254
6255         Use the grammar productions from Rhys to handle casts (this is
6256         not complete like Rhys syntax yet, we fail to handle that corner
6257         case that C# has regarding (-x), but we will get there.
6258         
6259 2001-11-22  Ravi Pratap  <ravi@ximian.com>
6260
6261         * class.cs (EmitFieldInitializer): Take care of the case when we have a
6262         field which is an array type.
6263
6264         * cs-parser.jay (declare_local_variables): Support array initialization too.
6265
6266         * typemanager.cs (MakeKey): Implement.
6267
6268         (everywhere): Use the above appropriately.
6269
6270         * cs-parser.jay (for_statement): Update for array initialization while
6271         declaring variables.
6272
6273         * ecore.cs : The error message was correct, it's the variable's names that
6274         were misleading ;-) Make the code more readable.
6275
6276         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
6277         the correct type etc.
6278
6279         (ConvertExplicit): Handle Enum types by examining the underlying type.
6280
6281 2001-11-21  Ravi Pratap  <ravi@ximian.com>
6282
6283         * parameter.cs (GetCallingConvention): Always return
6284         CallingConventions.Standard for now.
6285
6286 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
6287
6288         * expression.cs (Binary.ResolveOperator): Update the values of `l'
6289         and `r' after calling DoNumericPromotions.
6290
6291         * ecore.cs: Fix error message (the types were in the wrong order).
6292
6293         * statement.cs (Foreach.ProbeCollectionType): Need to pass
6294         BindingFlags.Instance as well 
6295
6296         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
6297         implicit int literal conversion in an empty cast so that we
6298         propagate the right type upstream.
6299
6300         (UnboxCast): new class used to unbox value types.
6301         (Expression.ConvertExplicit): Add explicit type conversions done
6302         by unboxing.
6303
6304         (Expression.ImplicitNumericConversion): Oops, forgot to test for
6305         the target type before applying the implicit LongLiterals to ULong
6306         literal cast.
6307
6308 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
6309
6310         * cs-parser.jay (for_statement): Reworked the way For works: now
6311         we declare manually any variables that are introduced in
6312         for_initializer to solve the problem of having out-of-band code
6313         emition (that is what got for broken).
6314
6315         (declaration_statement): Perform the actual variable declaration
6316         that used to be done in local_variable_declaration here.
6317
6318         (local_variable_declaration): Do not declare anything, just pass
6319         the information on a DictionaryEntry
6320
6321 2001-11-20  Ravi Pratap  <ravi@ximian.com>
6322
6323         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
6324         re-write of the logic to now make it recursive.
6325
6326         (UpdateIndices): Re-write accordingly.
6327
6328         Store element data in a separate ArrayData list in the above methods.
6329
6330         (MakeByteBlob): Implement to dump the array data into a byte array.
6331
6332 2001-11-19  Ravi Pratap  <ravi@ximian.com>
6333
6334         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
6335         into CheckIndices.
6336
6337         * constant.cs (Define): Implement.
6338
6339         (EmitConstant): Re-write fully.
6340
6341         Pass in location info.
6342
6343         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
6344         respectively.
6345
6346         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
6347         DictionaryEntry since we need location info too.
6348
6349         (constant_declaration): Update accordingly.
6350
6351         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
6352         code into another method : UpdateIndices.
6353
6354 2001-11-18  Ravi Pratap  <ravi@ximian.com>
6355
6356         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
6357         some type checking etc.
6358
6359 2001-11-17  Ravi Pratap  <ravi@ximian.com>
6360
6361         * expression.cs (ArrayCreation::ValidateInitializers): Implement
6362         bits to provide dimension info if the user skips doing that.
6363
6364         Update second constructor to store the rank correctly.
6365
6366 2001-11-16  Ravi Pratap  <ravi@ximian.com>
6367
6368         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
6369         and try to implement.
6370
6371         * ../errors/cs0150.cs : Add.
6372
6373         * ../errors/cs0178.cs : Add.
6374
6375 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
6376
6377         * statement.cs: Implement foreach on multi-dimensional arrays. 
6378
6379         * parameter.cs (Parameters.GetParameterByName): Also lookup the
6380         name of the params argument.
6381
6382         * expression.cs: Use EmitStoreOpcode to get the right opcode while
6383         initializing the array.
6384
6385         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
6386         we can use this elsewhere.
6387
6388         * statement.cs: Finish implementation of foreach for single
6389         dimension arrays.
6390
6391         * cs-parser.jay: Use an out-of-band stack to pass information
6392         around, I wonder why I need this.
6393
6394         foreach_block: Make the new foreach_block the current_block.
6395
6396         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
6397         function used to return a static Parameters structure.  Used for
6398         empty parameters, as those are created very frequently.
6399
6400         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
6401
6402 2001-11-15  Ravi Pratap  <ravi@ximian.com>
6403
6404         * interface.cs : Default modifier is private, not public. The
6405         make verify test passes again.
6406
6407 2001-11-15  Ravi Pratap  <ravi@ximian.com>
6408
6409         * support.cs (ReflectionParameters): Fix logic to determine
6410         whether the last parameter is a params one. Test 9 passes again.
6411
6412         * delegate.cs (Populate): Register the builders we define with
6413         RegisterParameterForBuilder. Test 19 passes again.
6414
6415         * cs-parser.jay (property_declaration): Reference $6 instead
6416         of $$ to get at the location.
6417
6418         (indexer_declaration): Similar stuff.
6419
6420         (attribute): Ditto.
6421
6422         * class.cs (Property): Register parameters for the Get and Set methods
6423         if they exist. Test 23 passes again.
6424
6425         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
6426         call to EmitArguments as we are sure there aren't any params arguments. 
6427         Test 32 passes again.
6428
6429         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
6430         IndexOutOfRangeException. 
6431
6432         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
6433         Test 33 now passes again.
6434         
6435 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
6436
6437         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
6438         broke a bunch of things.  Will have to come up with a better way
6439         of tracking locations.
6440
6441         * statement.cs: Implemented foreach for single dimension arrays.
6442
6443 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
6444
6445         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
6446         an error.  This removes the lookup from the critical path.
6447
6448         * cs-parser.jay: Removed use of temporary_loc, which is completely
6449         broken. 
6450
6451 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
6452
6453         * support.cs (ReflectionParameters.ParameterModifier): Report
6454         whether the argument is a PARAMS argument or not.
6455
6456         * class.cs: Set the attribute `ParamArrayAttribute' on the
6457         parameter argument.
6458
6459         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
6460         and cons_param_array_attribute (ConstructorInfo for
6461         ParamArrayAttribute)., 
6462
6463         * codegen.cs: Emit the return using the `Return' statement, that
6464         way we can report the error correctly for missing return values. 
6465
6466         * class.cs (Method.Emit): Clean up.
6467
6468         * expression.cs (Argument.Resolve): Take another argument: the
6469         location where this argument is used.  Notice that this is not
6470         part of the "Argument" class as to reduce the size of the
6471         structure (we know the approximate location anyways).
6472
6473         Test if the argument is a variable-reference, if not, then
6474         complain with a 206.
6475
6476         (Argument.Emit): Emit addresses of variables.
6477
6478         (Argument.FullDesc): Simplify.
6479
6480         (Invocation.DoResolve): Update for Argument.Resolve.
6481
6482         (ElementAccess.DoResolve): ditto.
6483
6484         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
6485         method should be virtual, as this method is always virtual.
6486
6487         (NewDelegate.DoResolve): Update for Argument.Resolve.
6488
6489         * class.cs (ConstructorInitializer.DoResolve): ditto.
6490         
6491         * attribute.cs (Attribute.Resolve): ditto.
6492
6493 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
6494
6495         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
6496
6497         * expression.cs (ParameterReference): Drop IStackStorage and implement
6498         IAssignMethod instead. 
6499
6500         (LocalVariableReference): ditto.
6501         
6502         * ecore.cs (FieldExpr): Drop IStackStorage and implement
6503         IAssignMethod instead. 
6504
6505 2001-11-13  Miguel de Icaza <miguel@ximian.com>
6506
6507         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
6508         enumerations that are used in heavily used structures derive from
6509         byte in a laughable and pathetic attempt to reduce memory usage.
6510         This is the kind of pre-optimzations that you should not do at
6511         home without adult supervision.
6512
6513         * expression.cs (UnaryMutator): New class, used to handle ++ and
6514         -- separatedly from the other unary operators.  Cleans up the
6515         code, and kills the ExpressionStatement dependency in Unary.
6516
6517         (Unary): Removed `method' and `Arguments' from this class, making
6518         it smaller, and moving it all to SimpleCall, so I can reuse this
6519         code in other locations and avoid creating a lot of transient data
6520         strucutres when not required.
6521
6522         * cs-parser.jay: Adjust for new changes.
6523
6524 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
6525
6526         * enum.cs (Enum.Populate): If there is a failure during
6527         definition, return
6528
6529         * cs-parser.jay (opt_enum_base): we used to catch type errors
6530         here, but this is really incorrect.  The type error should be
6531         catched during semantic analysis.
6532
6533 2001-12-11  Ravi Pratap  <ravi@ximian.com>
6534
6535         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
6536         current_local_parameters as expected since I, in my stupidity, had forgotten
6537         to do this :-)
6538
6539         * attribute.cs (GetValidPlaces): Fix stupid bug.
6540
6541         * class.cs (Method::Emit): Perform check on applicability of attributes.
6542
6543         (Constructor::Emit): Ditto.
6544
6545         (Field::Emit): Ditto.
6546
6547         (Field.Location): Store location information.
6548
6549         (Property, Event, Indexer, Operator): Ditto.
6550
6551         * cs-parser.jay (field_declaration): Pass in location for each field.
6552
6553         * ../errors/cs0592.cs : Add.
6554
6555 2001-11-12  Ravi Pratap  <ravi@ximian.com>
6556
6557         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
6558
6559         (InitCoreTypes): Update accordingly.
6560
6561         (RegisterAttrType, LookupAttr): Implement.
6562
6563         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
6564         info about the same.
6565
6566         (Resolve): Update to populate the above as necessary.
6567
6568         (Error592): Helper.
6569
6570         (GetValidPlaces): Helper to the above.
6571
6572         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
6573
6574         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
6575
6576 2001-11-12  Ravi Pratap  <ravi@ximian.com>
6577
6578         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
6579
6580         * ../errors/cs0617.cs : Add.
6581
6582 2001-11-11  Ravi Pratap  <ravi@ximian.com>
6583
6584         * enum.cs (Emit): Rename to Populate to be more consistent with what
6585         we expect it to do and when exactly it is called.
6586
6587         * class.cs, rootcontext.cs : Update accordingly.
6588
6589         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
6590         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
6591
6592         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
6593
6594         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
6595         of a fieldinfo using the above, when dealing with a FieldBuilder.
6596
6597 2001-11-10  Ravi Pratap  <ravi@ximian.com>
6598
6599         * ../errors/cs0031.cs : Add.
6600
6601         * ../errors/cs1008.cs : Add.
6602
6603         * ../errrors/cs0543.cs : Add.
6604
6605         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
6606         enum type.
6607
6608         (FindMembers): Implement.
6609
6610         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
6611         enums and delegates too.
6612
6613         (enum_types): Rename to builder_to_enum.
6614
6615         (delegate_types): Rename to builder_to_delegate.
6616
6617         * delegate.cs (FindMembers): Implement.
6618
6619 2001-11-09  Ravi Pratap  <ravi@ximian.com>
6620
6621         * typemanager.cs (IsEnumType): Implement.
6622
6623         * enum.cs (Emit): Re-write parts to account for the underlying type
6624         better and perform checking etc.
6625
6626         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
6627         of the underlying type.
6628
6629         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
6630         value
6631
6632         * enum.cs (error31): Helper to report error #31.
6633
6634         * cs-parser.jay (enum_declaration): Store location of each member too.
6635
6636         * enum.cs (member_to_location): New hashtable. 
6637
6638         (AddEnumMember): Update location hashtable.
6639
6640         (Emit): Use the location of each member while reporting errors.
6641
6642 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
6643
6644         * cs-parser.jay: A for_initializer if is a
6645         local_variable_declaration really ammount to have an implicit
6646         block with the variable declaration and no initializer for for.
6647
6648         * statement.cs (For.Emit): Cope with null initializers.
6649
6650         This fixes the infinite loop on for initializers.
6651
6652 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
6653
6654         * enum.cs: More cleanup.
6655
6656         * ecore.cs: Remove dead code.
6657
6658         * class.cs (Property.Emit): More simplification.
6659         (Event.Emit): ditto.
6660
6661         Reworked to have less levels of indentation.
6662         
6663 2001-11-08  Ravi Pratap  <ravi@ximian.com>
6664
6665         * class.cs (Property): Emit attributes.
6666
6667         (Field): Ditto.
6668         
6669         (Event): Ditto.
6670
6671         (Indexer): Ditto.
6672
6673         (Operator): Ditto.
6674
6675         * enum.cs (Emit): Ditto.
6676
6677         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
6678         Enums too.
6679
6680         * class.cs (Field, Event, etc.): Move attribute generation into the
6681         Emit method everywhere.
6682
6683         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
6684         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
6685         as we had no way of defining nested enums !
6686
6687         * rootcontext.cs : Adjust code accordingly.
6688
6689         * typemanager.cs (AddEnumType): To keep track of enum types separately.
6690
6691 2001-11-07  Ravi Pratap  <ravi@ximian.com>
6692
6693         * expression.cs (EvalConstantExpression): Move into ecore.cs
6694         
6695         * enum.cs (Enum): Rename some members and make them public and readonly
6696         according to our convention.
6697
6698         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
6699         nothing else.
6700
6701         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
6702
6703         (Enum::Emit): Write a simple version for now which doesn't try to compute
6704         expressions. I shall modify this to be more robust in just a while.
6705
6706         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
6707
6708         (TypeContainer::CloseType): Create the Enum types too.
6709
6710         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
6711
6712         * expression.cs (EvalConstantExpression): Get rid of completely.
6713
6714         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
6715         user-defined values and other cases.
6716
6717         (IsValidEnumLiteral): Helper function.
6718
6719         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
6720         out there in the case we had a literal FieldExpr.
6721
6722         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
6723
6724         (Literalize): Revamp a bit to take two arguments.
6725         
6726         (EnumLiteral): New class which derives from Literal to wrap enum literals.
6727         
6728 2001-11-06  Ravi Pratap  <ravi@ximian.com>
6729
6730         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
6731
6732         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
6733
6734         (Resolve): Use the above to ensure we have proper initializers.
6735
6736 2001-11-05  Ravi Pratap  <ravi@ximian.com>
6737
6738         * expression.cs (Expression::EvalConstantExpression): New method to 
6739         evaluate constant expressions.
6740
6741         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
6742
6743 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
6744
6745         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
6746         in an array.
6747
6748         (Binary.ResolveOperator): Handle operator != (object a, object b)
6749         and operator == (object a, object b);
6750
6751         (Binary.DoNumericPromotions): Indicate whether the numeric
6752         promotion was possible.
6753
6754         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
6755         Implement.  
6756
6757         Made the ArrayAccess implement interface IAssignMethod instead of
6758         IStackStore as the order in which arguments are passed reflects
6759         this.
6760
6761         * assign.cs: Instead of using expr.ExprClass to select the way of
6762         assinging, probe for the IStackStore/IAssignMethod interfaces.
6763
6764         * typemanager.cs: Load InitializeArray definition.
6765
6766         * rootcontext.cs (RootContext.MakeStaticData): Used to define
6767         static data that can be used to initialize arrays. 
6768
6769 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
6770
6771         * expression.cs: Handle operator== and operator!= for booleans.
6772
6773         (Conditioal.Reduce): Implement reducer for the ?: operator.
6774
6775         (Conditional.Resolve): Implement dead code elimination.
6776
6777         (Binary.Resolve): Catch string literals and return a new
6778         concatenated string.
6779
6780         (Unary.Reduce): Implement reduction of unary expressions.
6781
6782         * ecore.cs: Split out the expression core handling here.
6783
6784         (Expression.Reduce): New method used to perform constant folding
6785         and CSE.  This is needed to support constant-expressions. 
6786         
6787         * statement.cs (Statement.EmitBoolExpression): Pass true and false
6788         targets, and optimize for !x.
6789
6790 2001-11-04  Ravi Pratap  <ravi@ximian.com>
6791
6792         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
6793         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
6794         set custom atttributes.
6795
6796         * literal.cs (Literal::GetValue): New abstract method to return the actual
6797         value of the literal, cast as an object.
6798
6799         (*Literal): Implement GetValue method.
6800
6801         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
6802         expressions to the arraylist but objects of type Argument.
6803
6804         * class.cs (TypeContainer::Emit): Emit our attributes too.
6805
6806         (Method::Emit, Constructor::Emit): Ditto.
6807
6808         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
6809         to be ignoring earlier.
6810
6811 2001-11-03  Ravi Pratap  <ravi@ximian.com>
6812
6813         * attribute.cs (AttributeSection::Define): Implement to do the business
6814         of constructing a CustomAttributeBuilder.
6815
6816         (Attribute): New trivial class. Increases readability of code.  
6817
6818         * cs-parser.jay : Update accordingly.
6819
6820         (positional_argument_list, named_argument_list, named_argument): New rules
6821
6822         (attribute_arguments): Use the above so that we are more correct.
6823         
6824 2001-11-02  Ravi Pratap  <ravi@ximian.com>
6825         
6826         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
6827         to perform all checks for a method with a params parameter.
6828
6829         (Invocation::OverloadResolve): Update to use the above method and therefore
6830         cope correctly with params method invocations.
6831
6832         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
6833         params too.
6834
6835         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
6836         constructors in our parent too because we can't afford to miss out on 
6837         protected ones ;-)
6838
6839         * attribute.cs (AttributeSection): New name for the class Attribute
6840
6841         Other trivial changes to improve readability.
6842
6843         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
6844         use the new class names.
6845         
6846 2001-11-01  Ravi Pratap  <ravi@ximian.com>
6847
6848         * class.cs (Method::Define): Complete definition for params types too
6849
6850         (Indexer::Define): Ditto.
6851
6852         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
6853         Cope everywhere with a request for info about the array parameter.
6854
6855 2001-11-01  Ravi Pratap  <ravi@ximian.com>
6856
6857         * tree.cs (RecordNamespace): Fix up to check for the correct key.
6858
6859         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
6860         local_variable_type to extract the string corresponding to the type.
6861
6862         (local_variable_type): Fixup the action to use the new helper method.
6863
6864         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
6865         go.
6866
6867         * expression.cs : Clean out code which uses the above.
6868
6869 2001-10-31  Ravi Pratap  <ravi@ximian.com>
6870         
6871         * typemanager.cs (RegisterMethod): Check if we already have an existing key
6872         and bale out if necessary by returning a false.
6873
6874         (RegisterProperty): Ditto.
6875
6876         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
6877         and print out appropriate error messages.
6878
6879         * interface.cs (everywhere): Ditto.
6880
6881         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
6882         location to constructor.
6883
6884         * class.cs (Property, Event, Indexer): Update accordingly.
6885
6886         * ../errors/cs111.cs : Added.
6887
6888         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
6889         of a method, as laid down by the spec.
6890
6891         (Invocation::OverloadResolve): Use the above method.
6892
6893 2001-10-31  Ravi Pratap  <ravi@ximian.com>
6894
6895         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
6896         now take a TypeContainer and a Parameters object.
6897
6898         (ParameterData): Modify return type of ParameterModifier method to be 
6899         Parameter.Modifier and not a string.
6900
6901         (ReflectionParameters, InternalParameters): Update accordingly.
6902
6903         * expression.cs (Argument::GetParameterModifier): Same here.
6904
6905         * support.cs (InternalParameters::ParameterType): Find a better way of determining
6906         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
6907         symbol in it at all so maybe this is only for now.
6908
6909 2001-10-30  Ravi Pratap  <ravi@ximian.com>
6910
6911         * support.cs (InternalParameters): Constructor now takes an extra argument 
6912         which is the actual Parameters class.
6913
6914         (ParameterDesc): Update to provide info on ref/out modifiers.
6915
6916         * class.cs (everywhere): Update call to InternalParameters to pass in
6917         the second argument too.
6918
6919         * support.cs (ParameterData): Add ParameterModifier, which is a method 
6920         to return the modifier info [ref/out etc]
6921
6922         (InternalParameters, ReflectionParameters): Implement the above.
6923
6924         * expression.cs (Argument::ParameterModifier): Similar function to return
6925         info about the argument's modifiers.
6926
6927         (Invocation::OverloadResolve): Update to take into account matching modifiers 
6928         too.
6929
6930         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
6931         a new SetFormalParameters object which we pass to InternalParameters.
6932
6933 2001-10-30  Ravi Pratap  <ravi@ximian.com>
6934
6935         * expression.cs (NewArray): Merge into the ArrayCreation class.
6936
6937 2001-10-29  Ravi Pratap  <ravi@ximian.com>
6938
6939         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
6940         NewUserdefinedArray into one as there wasn't much of a use in having
6941         two separate ones.
6942
6943         * expression.cs (Argument): Change field's name to ArgType from Type.
6944
6945         (Type): New readonly property which returns the proper type, taking into 
6946         account ref/out modifiers.
6947
6948         (everywhere): Adjust code accordingly for the above.
6949
6950         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
6951         whether we are emitting for a ref or out parameter.
6952
6953         * expression.cs (Argument::Emit): Use the above field to set the state.
6954
6955         (LocalVariableReference::Emit): Update to honour the flag and emit the
6956         right stuff.
6957
6958         * parameter.cs (Attributes): Set the correct flags for ref parameters.
6959
6960         * expression.cs (Argument::FullDesc): New function to provide a full desc.
6961
6962         * support.cs (ParameterData): Add method ParameterDesc to the interface.
6963
6964         (ReflectionParameters, InternalParameters): Implement the above method.
6965
6966         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
6967         reporting errors.
6968
6969         (Invocation::FullMethodDesc): Ditto. 
6970
6971 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
6972
6973         * cs-parser.jay: Add extra production for the second form of array
6974         creation. 
6975
6976         * expression.cs (ArrayCreation): Update to reflect the above
6977         change. 
6978
6979         * Small changes to prepare for Array initialization.
6980
6981 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
6982
6983         * typemanager.cs (ImplementsInterface): interface might be null;
6984         Deal with this problem;
6985
6986         Also, we do store negative hits on the cache (null values), so use
6987         this instead of calling t.GetInterfaces on the type everytime.
6988
6989 2001-10-28  Ravi Pratap  <ravi@ximian.com>
6990
6991         * typemanager.cs (IsBuiltinType): New method to help determine the same.
6992
6993         * expression.cs (New::DoResolve): Get rid of array creation code and instead
6994         split functionality out into different classes.
6995
6996         (New::FormArrayType): Move into NewBuiltinArray.
6997
6998         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
6999         quite useless.
7000
7001         (NewBuiltinArray): New class to handle creation of built-in arrays.
7002
7003         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
7004         account creation of one-dimensional arrays.
7005
7006         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
7007
7008         (NewUserdefinedArray::DoResolve): Implement.
7009
7010         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
7011
7012         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
7013         we maintain inside the TypeManager. This is necessary to perform lookups on the
7014         module builder.
7015
7016         (LookupType): Update to perform GetType on the module builders too.     
7017
7018         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
7019
7020         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
7021
7022 2001-10-23  Ravi Pratap  <ravi@ximian.com>
7023
7024         * expression.cs (New::DoResolve): Implement guts of array creation.
7025
7026         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
7027         
7028 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
7029
7030         * expression.cs: Fix bug I introduced lsat night that broke
7031         Delegates. 
7032
7033         (Expression.Resolve): Report a 246 error (can not resolve name)
7034         if we find a SimpleName in the stream.
7035         
7036         (Expression.ResolveLValue): Ditto.
7037         
7038         (Expression.ResolveWithSimpleName): This function is a variant of
7039         ResolveName, this one allows SimpleNames to be returned without a
7040         warning.  The only consumer of SimpleNames is MemberAccess
7041
7042 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
7043
7044         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
7045         might arrive here.  I have my doubts that this is correct.
7046
7047         * statement.cs (Lock): Implement lock statement.
7048
7049         * cs-parser.jay: Small fixes to support `lock' and `using'
7050
7051         * cs-tokenizer.cs: Remove extra space
7052
7053         * driver.cs: New flag --checked, allows to turn on integer math
7054         checking. 
7055
7056         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
7057         Threading.Monitor.Exit 
7058         
7059 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
7060
7061         * expression.cs (IndexerAccess::DoResolveLValue): Set the
7062         Expression Class to be IndexerAccess.
7063
7064         Notice that Indexer::DoResolve sets the eclass to Value.
7065
7066 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
7067
7068         * class.cs (TypeContainer::Emit): Emit code for indexers.
7069
7070         * assign.cs (IAssignMethod): New interface implemented by Indexers
7071         and Properties for handling assignment.
7072
7073         (Assign::Emit): Simplify and reuse code. 
7074         
7075         * expression.cs (IndexerAccess, PropertyExpr): Implement
7076         IAssignMethod, clean up old code. 
7077
7078 2001-10-22  Ravi Pratap  <ravi@ximian.com>
7079
7080         * typemanager.cs (ImplementsInterface): New method to determine if a type
7081         implements a given interface. Provides a nice cache too.
7082
7083         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
7084         method.
7085
7086         (ConvertReferenceExplicit): Ditto.
7087
7088         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
7089         various methods, with correct names etc.
7090
7091         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
7092         Operator.UnaryNegation.
7093
7094         * cs-parser.jay (operator_declarator): Be a little clever in the case where
7095         we have a unary plus or minus operator.
7096
7097         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
7098         UnaryMinus.
7099
7100         * everywhere : update accordingly.
7101
7102         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
7103         respectively.
7104
7105         * class.cs (Method::Define): For the case where we are implementing a method
7106         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
7107         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
7108         
7109 2001-10-21  Ravi Pratap  <ravi@ximian.com>
7110
7111         * interface.cs (FindMembers): Implement to work around S.R.E
7112         lameness.
7113
7114         * typemanager.cs (IsInterfaceType): Implement.
7115
7116         (FindMembers): Update to handle interface types too.
7117
7118         * expression.cs (ImplicitReferenceConversion): Re-write bits which
7119         use IsAssignableFrom as that is not correct - it doesn't work.
7120
7121         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
7122         and accordingly override EmitStatement.
7123
7124         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
7125         using the correct logic :-)
7126
7127 2001-10-19  Ravi Pratap  <ravi@ximian.com>
7128
7129         * ../errors/cs-11.cs : Add to demonstrate error -11 
7130
7131 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
7132
7133         * assign.cs (Assign::Resolve): Resolve right hand side first, and
7134         then pass this as a hint to ResolveLValue.
7135         
7136         * expression.cs (FieldExpr): Add Location information
7137
7138         (FieldExpr::LValueResolve): Report assignment to readonly
7139         variable. 
7140         
7141         (Expression::ExprClassFromMemberInfo): Pass location information.
7142
7143         (Expression::ResolveLValue): Add new method that resolves an
7144         LValue. 
7145
7146         (Expression::DoResolveLValue): Default invocation calls
7147         DoResolve. 
7148
7149         (Indexers): New class used to keep track of indexers in a given
7150         Type. 
7151
7152         (IStackStore): Renamed from LValue, as it did not really describe
7153         what this did.  Also ResolveLValue is gone from this interface and
7154         now is part of Expression.
7155
7156         (ElementAccess): Depending on the element access type
7157         
7158         * typemanager.cs: Add `indexer_name_type' as a Core type
7159         (System.Runtime.CompilerServices.IndexerNameAttribute)
7160
7161         * statement.cs (Goto): Take a location.
7162         
7163 2001-10-18  Ravi Pratap  <ravi@ximian.com>
7164
7165         * delegate.cs (Delegate::VerifyDelegate): New method to verify
7166         if two delegates are compatible.
7167
7168         (NewDelegate::DoResolve): Update to take care of the case when
7169         we instantiate a delegate from another delegate.
7170
7171         * typemanager.cs (FindMembers): Don't even try to look up members
7172         of Delegate types for now.
7173
7174 2001-10-18  Ravi Pratap  <ravi@ximian.com>
7175
7176         * delegate.cs (NewDelegate): New class to take care of delegate
7177         instantiation.
7178
7179         * expression.cs (New): Split the delegate related code out into 
7180         the NewDelegate class.
7181
7182         * delegate.cs (DelegateInvocation): New class to handle delegate 
7183         invocation.
7184
7185         * expression.cs (Invocation): Split out delegate related code into
7186         the DelegateInvocation class.
7187
7188 2001-10-17  Ravi Pratap  <ravi@ximian.com>
7189
7190         * expression.cs (New::DoResolve): Implement delegate creation fully
7191         and according to the spec.
7192
7193         (New::DoEmit): Update to handle delegates differently.
7194
7195         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
7196         because of which we were printing out arguments in reverse order !
7197
7198         * delegate.cs (VerifyMethod): Implement to check if the given method
7199         matches the delegate.
7200
7201         (FullDelegateDesc): Implement.
7202
7203         (VerifyApplicability): Implement.
7204
7205         * expression.cs (Invocation::DoResolve): Update to accordingly handle
7206         delegate invocations too.
7207
7208         (Invocation::Emit): Ditto.
7209
7210         * ../errors/cs1593.cs : Added.
7211
7212         * ../errors/cs1594.cs : Added.
7213
7214         * delegate.cs (InstanceExpression, TargetMethod): New properties.
7215
7216 2001-10-16  Ravi Pratap  <ravi@ximian.com>
7217
7218         * typemanager.cs (intptr_type): Core type for System.IntPtr
7219
7220         (InitCoreTypes): Update for the same.
7221
7222         (iasyncresult_type, asynccallback_type): Ditto.
7223
7224         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
7225         correct.
7226
7227         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
7228         too.
7229
7230         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
7231         the builders for the 4 members of a delegate type :-)
7232
7233         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
7234         type.
7235
7236         * expression.cs (New::DoResolve): Implement guts for delegate creation.
7237
7238         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
7239
7240 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
7241
7242         * statement.cs (Break::Emit): Implement.   
7243         (Continue::Emit): Implement.
7244
7245         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
7246         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
7247         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
7248         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
7249         end loop
7250         
7251         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
7252         properties that track the label for the current loop (begin of the
7253         loop and end of the loop).
7254
7255 2001-10-15  Ravi Pratap  <ravi@ximian.com>
7256
7257         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
7258         use of emitting anything at all.
7259
7260         * class.cs, rootcontext.cs : Get rid of calls to the same.
7261
7262         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
7263
7264         (Populate): Define the constructor correctly and set the implementation
7265         attributes.
7266
7267         * typemanager.cs (delegate_types): New hashtable to hold delegates that
7268         have been defined.
7269
7270         (AddDelegateType): Implement.
7271
7272         (IsDelegateType): Implement helper method.
7273
7274         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
7275
7276         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
7277         and accordingly handle it.
7278
7279         * delegate.cs (Populate): Take TypeContainer argument.
7280         Implement bits to define the Invoke method. However, I still haven't figured out
7281         how to take care of the native int bit :-(
7282
7283         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
7284         Qualify the name of the delegate, not its return type !
7285
7286         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
7287         conversion.
7288
7289         (StandardConversionExists): Checking for array types turns out to be recursive.
7290
7291         (ConvertReferenceExplicit): Implement array conversion.
7292
7293         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
7294         
7295 2001-10-12  Ravi Pratap  <ravi@ximian.com>
7296
7297         * cs-parser.jay (delegate_declaration): Store the fully qualified
7298         name as it is a type declaration.
7299
7300         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
7301         readonly.
7302
7303         (DefineDelegate): Renamed from Define. Does the same thing essentially,
7304         as TypeContainer::DefineType.
7305
7306         (Populate): Method in which all the definition of the various methods (Invoke)
7307         etc is done.
7308
7309         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
7310         see.
7311         
7312         (CloseDelegate): Finally creates the delegate.
7313
7314         * class.cs (TypeContainer::DefineType): Update to define delegates.
7315         (Populate, Emit and CloseType): Do the same thing here too.
7316
7317         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
7318         delegates in all these operations.
7319
7320 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
7321
7322         * expression.cs: LocalTemporary: a new expression used to
7323         reference a temporary that has been created.
7324
7325         * assign.cs: Handle PropertyAccess back here, so that we can
7326         provide the proper semantic access to properties.
7327
7328         * expression.cs (Expression::ConvertReferenceExplicit): Implement
7329         a few more explicit conversions. 
7330
7331         * modifiers.cs: `NEW' modifier maps to HideBySig.
7332
7333         * expression.cs (PropertyExpr): Make this into an
7334         ExpressionStatement, and support the EmitStatement code path. 
7335
7336         Perform get/set error checking, clean up the interface.
7337
7338         * assign.cs: recognize PropertyExprs as targets, and if so, turn
7339         them into toplevel access objects.
7340
7341 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
7342
7343         * expression.cs: PropertyExpr::PropertyExpr: use work around the
7344         SRE.
7345
7346         * typemanager.cs: Keep track here of our PropertyBuilders again to
7347         work around lameness in SRE.
7348
7349 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
7350
7351         * expression.cs (LValue::LValueResolve): New method in the
7352         interface, used to perform a second resolution pass for LValues. 
7353         
7354         (This::DoResolve): Catch the use of this in static methods.
7355
7356         (This::LValueResolve): Implement.
7357
7358         (This::Store): Remove warning, assigning to `this' in structures
7359         is 
7360
7361         (Invocation::Emit): Deal with invocation of
7362         methods on value types.  We need to pass the address to structure
7363         methods rather than the object itself.  (The equivalent code to
7364         emit "this" for structures leaves the entire structure on the
7365         stack instead of a pointer to it). 
7366
7367         (ParameterReference::DoResolve): Compute the real index for the
7368         argument based on whether the method takes or not a `this' pointer
7369         (ie, the method is static).
7370
7371         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
7372         value types returned from functions when we need to invoke a
7373         method on the sturcture.
7374         
7375
7376 2001-10-11  Ravi Pratap  <ravi@ximian.com>
7377
7378         * class.cs (TypeContainer::DefineType): Method to actually do the business of
7379         defining the type in the Modulebuilder or Typebuilder. This is to take
7380         care of nested types which need to be defined on the TypeBuilder using
7381         DefineNestedMethod.
7382
7383         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
7384         methods in RootContext, only ported to be part of TypeContainer.
7385
7386         (TypeContainer::GetInterfaceOrClass): Ditto.
7387
7388         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
7389
7390         * interface.cs (Interface::DefineInterface): New method. Does exactly
7391         what RootContext.CreateInterface did earlier, only it takes care of nested types 
7392         too.
7393
7394         (Interface::GetInterfaces): Move from RootContext here and port.
7395
7396         (Interface::GetInterfaceByName): Same here.
7397
7398         * rootcontext.cs (ResolveTree): Re-write.
7399
7400         (PopulateTypes): Re-write.
7401
7402         * class.cs (TypeContainer::Populate): Populate nested types too.
7403         (TypeContainer::Emit): Emit nested members too.
7404
7405         * typemanager.cs (AddUserType): Do not make use of the FullName property,
7406         instead just use the name argument passed in as it is already fully
7407         qualified.
7408
7409         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
7410         to TypeContainer mapping to see if a type is user-defined.
7411
7412         * class.cs (TypeContainer::CloseType): Implement. 
7413
7414         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
7415         the default constructor.
7416         
7417         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
7418         twice.
7419
7420         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
7421
7422         * interface.cs (CloseType): Create the type here.
7423         
7424         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
7425         the hierarchy.
7426
7427         Remove all the methods which are now in TypeContainer.
7428
7429 2001-10-10  Ravi Pratap  <ravi@ximian.com>
7430
7431         * delegate.cs (Define): Re-write bits to define the delegate
7432         correctly.
7433
7434 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
7435
7436         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
7437
7438         * expression.cs (ImplicitReferenceConversion): handle null as well
7439         as a source to convert to any reference type.
7440
7441         * statement.cs (Return): Perform any implicit conversions to
7442         expected return type.  
7443
7444         Validate use of return statement.  
7445
7446         * codegen.cs (EmitContext): Pass the expected return type here.
7447
7448         * class.cs (Method, Constructor, Property): Pass expected return
7449         type to EmitContext.
7450
7451 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
7452
7453         * expression.cs: Make DoResolve take an EmitContext instead of a
7454         TypeContainer.
7455
7456         Replaced `l' and `location' for `loc', for consistency.
7457         
7458         (Error, Warning): Remove unneeded Tc argument.
7459
7460         * assign.cs, literal.cs, constant.cs: Update to new calling
7461         convention. 
7462         
7463         * codegen.cs: EmitContext now contains a flag indicating whether
7464         code is being generated in a static method or not.
7465
7466         * cs-parser.jay: DecomposeQI, new function that replaces the old
7467         QualifiedIdentifier.  Now we always decompose the assembled
7468         strings from qualified_identifier productions into a group of
7469         memberaccesses.
7470
7471 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
7472
7473         * rootcontext.cs: Deal with field-less struct types correctly now
7474         by passing the size option to Define Type.
7475
7476         * class.cs: Removed hack that created one static field. 
7477
7478 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
7479
7480         * statement.cs: Moved most of the code generation here. 
7481
7482 2001-10-09  Ravi Pratap  <ravi@ximian.com>
7483
7484         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
7485         seem very right.
7486
7487         (ElementAccess): Remove useless bits for now - keep checks as the spec
7488         says.
7489
7490 2001-10-08  Ravi Pratap  <ravi@ximian.com>
7491
7492         * expression.cs (ElementAccess::DoResolve): Remove my crap code
7493         and start performing checks according to the spec.
7494
7495 2001-10-07  Ravi Pratap  <ravi@ximian.com>
7496
7497         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
7498         rank_specifiers instead.
7499
7500         (rank_specifiers): Change the order in which the rank specifiers are stored
7501
7502         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
7503
7504         * expression.cs (ElementAccess): Implement the LValue interface too.
7505         
7506 2001-10-06  Ravi Pratap  <ravi@ximian.com>
7507         
7508         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
7509         except that user defined conversions are not included.
7510
7511         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
7512         perform the conversion of the return type, if necessary.
7513
7514         (New::DoResolve): Check whether we are creating an array or an object
7515         and accordingly do the needful.
7516
7517         (New::Emit): Same here.
7518
7519         (New::DoResolve): Implement guts of array creation.
7520
7521         (New::FormLookupType): Helper function.
7522
7523 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
7524
7525         * codegen.cs: Removed most of the code generation here, and move the
7526         corresponding code generation bits to the statement classes. 
7527
7528         Added support for try/catch/finalize and throw.
7529         
7530         * cs-parser.jay: Added support for try/catch/finalize.
7531
7532         * class.cs: Catch static methods having the flags override,
7533         virtual or abstract.
7534
7535         * expression.cs (UserCast): This user cast was not really doing
7536         what it was supposed to do.  Which is to be born in fully resolved
7537         state.  Parts of the resolution were being performed at Emit time! 
7538
7539         Fixed this code.
7540
7541 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
7542
7543         * expression.cs: Implicity convert the result from UserCast.
7544
7545 2001-10-05  Ravi Pratap  <ravi@ximian.com>
7546
7547         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
7548         prevented it from working correctly. 
7549
7550         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
7551         merely ConvertImplicit.
7552
7553 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
7554
7555         * typemanager.cs: Make the LookupTypeContainer function static,
7556         and not per-instance.  
7557
7558         * class.cs: Make static FindMembers (the one that takes a Type
7559         argument). 
7560
7561         * codegen.cs: Add EmitForeach here.
7562
7563         * cs-parser.jay: Make foreach a toplevel object instead of the
7564         inline expansion, as we need to perform semantic analysis on it. 
7565
7566 2001-10-05  Ravi Pratap  <ravi@ximian.com>
7567
7568         * expression.cs (Expression::ImplicitUserConversion): Rename to
7569         UserDefinedConversion.
7570
7571         (Expression::UserDefinedConversion): Take an extra argument specifying 
7572         whether we look for explicit user conversions too.
7573
7574         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
7575
7576         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
7577
7578         (ExplicitUserConversion): Make it a call to UserDefinedConversion
7579         with the appropriate arguments.
7580
7581         * cs-parser.jay (cast_expression): Record location too.
7582
7583         * expression.cs (Cast): Record location info.
7584
7585         (Expression::ConvertExplicit): Take location argument.
7586
7587         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
7588         to determine if we are doing explicit conversions.
7589
7590         (UserCast::Emit): Update accordingly.
7591
7592         (Expression::ConvertExplicit): Report an error if everything fails.
7593
7594         * ../errors/cs0030.cs : Add.
7595
7596 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
7597
7598         * modifiers.cs: If the ABSTRACT keyword is present, also set the
7599         virtual and newslot bits. 
7600
7601         * class.cs (TypeContainer::RegisterRequiredImplementations):
7602         Record methods we need.
7603
7604         (TypeContainer::MakeKey): Helper function to make keys for
7605         MethodBases, since the Methodbase key is useless.
7606
7607         (TypeContainer::Populate): Call RegisterRequiredImplementations
7608         before defining the methods.   
7609
7610         Create a mapping for method_builders_to_methods ahead of time
7611         instead of inside a tight loop.
7612
7613         (::RequireMethods):  Accept an object as the data to set into the
7614         hashtable so we can report interface vs abstract method mismatch.
7615
7616 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
7617
7618         * report.cs: Make all of it static.
7619
7620         * rootcontext.cs: Drop object_type and value_type computations, as
7621         we have those in the TypeManager anyways.
7622
7623         Drop report instance variable too, now it is a global.
7624
7625         * driver.cs: Use try/catch on command line handling.
7626
7627         Add --probe option to debug the error reporting system with a test
7628         suite. 
7629
7630         * report.cs: Add support for exiting program when a probe
7631         condition is reached.
7632
7633 2001-10-03  Ravi Pratap  <ravi@ximian.com>
7634
7635         * expression.cs (Binary::DoNumericPromotions): Fix the case when
7636         we do a forcible conversion regardless of type, to check if 
7637         ForceConversion returns a null.
7638
7639         (Binary::error19): Use location to report error.
7640
7641         (Unary::error23): Use location here too.
7642
7643         * ../errors/cs0019.cs : Check in.
7644
7645         * ../errors/cs0023.cs : Check in.
7646
7647         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
7648         case of a non-null MethodInfo object with a length of 0 !
7649
7650         (Binary::ResolveOperator): Flag error if overload resolution fails to find
7651         an applicable member - according to the spec :-)
7652         Also fix logic to find members in base types.
7653
7654         (Unary::ResolveOperator): Same here.
7655
7656         (Unary::report23): Change name to error23 and make first argument a TypeContainer
7657         as I was getting thoroughly confused between this and error19 :-)
7658         
7659         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
7660         (::FindMostEncompassedType): Implement.
7661         (::FindMostEncompassingType): Implement.
7662         (::StandardConversionExists): Implement.
7663
7664         (UserImplicitCast): Re-vamp. We now need info about most specific
7665         source and target types so that we can do the necessary conversions.
7666
7667         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
7668         mathematical union with no duplicates.
7669
7670 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
7671
7672         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
7673         in order from base classes to child classes, so that we can in
7674         child classes look up in our parent for method names and
7675         attributes (required for handling abstract, virtual, new, override
7676         constructs: we need to instrospect our base class, and if we dont
7677         populate the classes in order, the introspection might be
7678         incorrect.  For example, a method could query its parent before
7679         the parent has any methods and would determine that the parent has
7680         no abstract methods (while it could have had them)).
7681
7682         (RootContext::CreateType): Record the order in which we define the
7683         classes.
7684
7685 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
7686
7687         * class.cs (TypeContainer::Populate): Also method definitions can
7688         fail now, keep track of this.
7689
7690         (TypeContainer::FindMembers): Implement support for
7691         DeclaredOnly/noDeclaredOnly flag.
7692
7693         (Constructor::Emit) Return the ConstructorBuilder.
7694
7695         (Method::Emit) Return the MethodBuilder. 
7696         Check for abstract or virtual methods to be public.
7697
7698         * rootcontext.cs (RootContext::CreateType): Register all the
7699         abstract methods required for the class to be complete and the
7700         interface methods that must be implemented. 
7701
7702         * cs-parser.jay: Report error 501 (method requires body if it is
7703         not marked abstract or extern).
7704
7705         * expression.cs (TypeOf::Emit): Implement.
7706
7707         * typemanager.cs: runtime_handle_type, new global type.
7708
7709         * class.cs (Property::Emit): Generate code for properties.
7710
7711 2001-10-02  Ravi Pratap  <ravi@ximian.com>
7712
7713         * expression.cs (Unary::ResolveOperator): Find operators on base type
7714         too - we now conform exactly to the spec.
7715
7716         (Binary::ResolveOperator): Same here.
7717
7718         * class.cs (Operator::Define): Fix minor quirk in the tests.
7719
7720         * ../errors/cs0215.cs : Added.
7721
7722         * ../errors/cs0556.cs : Added.
7723
7724         * ../errors/cs0555.cs : Added.
7725
7726 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
7727
7728         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
7729         single integer which is really efficient
7730
7731 2001-10-01  Ravi Pratap  <ravi@ximian.com>
7732
7733         *  expression.cs (Expression::ImplicitUserConversion): Use location
7734         even in the case when we are examining True operators.
7735  
7736         * class.cs (Operator::Define): Perform extensive checks to conform
7737         with the rules for operator overloading in the spec.
7738
7739         * expression.cs (Expression::ImplicitReferenceConversion): Implement
7740         some of the other conversions mentioned in the spec.
7741
7742         * typemanager.cs (array_type): New static member for the System.Array built-in
7743         type.
7744
7745         (cloneable_interface): For System.ICloneable interface.
7746
7747         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
7748         we start resolving the tree and populating types.
7749
7750         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
7751  
7752 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
7753
7754         * expression.cs (Expression::ExprClassFromMemberInfo,
7755         Expression::Literalize): Create literal expressions from
7756         FieldInfos which are literals.
7757
7758         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
7759         type casts, because they were wrong.  The test suite in tests
7760         caught these ones.
7761
7762         (ImplicitNumericConversion): ushort to ulong requires a widening
7763         cast. 
7764
7765         Int32 constant to long requires widening cast as well.
7766
7767         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
7768         for integers because the type on the stack is not i4.
7769
7770 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
7771
7772         * expression.cs (report118): require location argument. 
7773
7774         * parameter.cs: Do not dereference potential null value.
7775
7776         * class.cs: Catch methods that lack the `new' keyword when
7777         overriding a name.  Report warnings when `new' is used without
7778         anything being there to override.
7779
7780         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
7781
7782         * class.cs: Only add constructor to hashtable if it is non-null
7783         (as now constructors can fail on define).
7784
7785         (TypeManager, Class, Struct): Take location arguments.
7786
7787         Catch field instance initialization in structs as errors.
7788
7789         accepting_filter: a new filter for FindMembers that is static so
7790         that we dont create an instance per invocation.
7791
7792         (Constructor::Define): Catch errors where a struct constructor is
7793         parameterless 
7794
7795         * cs-parser.jay: Pass location information for various new
7796         constructs. 
7797         
7798         * delegate.cs (Delegate): take a location argument.
7799
7800         * driver.cs: Do not call EmitCode if there were problesm in the
7801         Definition of the types, as many Builders wont be there. 
7802
7803         * decl.cs (Decl::Decl): Require a location argument.
7804
7805         * cs-tokenizer.cs: Handle properly hex constants that can not fit
7806         into integers, and find the most appropiate integer for it.
7807
7808         * literal.cs: Implement ULongLiteral.
7809
7810         * rootcontext.cs: Provide better information about the location of
7811         failure when CreateType fails.
7812         
7813 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
7814
7815         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
7816         as well.
7817
7818         * expression.cs (Binary::CheckShiftArguments): Add missing type
7819         computation.
7820         (Binary::ResolveOperator): Add type to the logical and and logical
7821         or, Bitwise And/Or and Exclusive Or code paths, it was missing
7822         before.
7823
7824         (Binary::DoNumericPromotions): In the case where either argument
7825         is ulong (and most signed types combined with ulong cause an
7826         error) perform implicit integer constant conversions as well.
7827
7828 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
7829
7830         * expression.cs (UserImplicitCast): Method should always be
7831         non-null. 
7832         (Invocation::BetterConversion): Simplified test for IntLiteral.
7833
7834         (Expression::ImplicitNumericConversion): Split this routine out.
7835         Put the code that performs implicit constant integer conversions
7836         here. 
7837
7838         (Expression::Resolve): Become a wrapper around DoResolve so we can
7839         check eclass and type being set after resolve.
7840
7841         (Invocation::Badness): Remove this dead function
7842
7843         (Binary::ResolveOperator): Do not compute the expensive argumnets
7844         unless we have a union for it.
7845
7846         (Probe::Emit): Is needs to do an isinst and then
7847         compare against null.
7848
7849         (::CanConvert): Added Location argument.  If the Location argument
7850         is null (Location.Null), then we do not report errors.  This is
7851         used by the `probe' mechanism of the Explicit conversion.  We do
7852         not want to generate an error for something that the user
7853         explicitly requested to be casted.  But the pipeline for an
7854         explicit cast first tests for potential implicit casts.
7855
7856         So for now, if the Location is null, it means `Probe only' to
7857         avoid adding another argument.   Might have to revise this
7858         strategy later.
7859
7860         (ClassCast): New class used to type cast objects into arbitrary
7861         classes (used in Explicit Reference Conversions).
7862
7863         Implement `as' as well.
7864
7865         Reverted all the patches from Ravi below: they were broken:
7866
7867                 * The use of `level' as a mechanism to stop recursive
7868                   invocations is wrong.  That was there just to catch the
7869                   bug with a strack trace but not as a way of addressing
7870                   the problem.
7871
7872                   To fix the problem we have to *understand* what is going
7873                   on and the interactions and come up with a plan, not
7874                   just get things going.
7875
7876                 * The use of the type conversion cache that I proposed
7877                   last night had an open topic: How does this work across
7878                   protection domains.  A user defined conversion might not
7879                   be public in the location where we are applying the
7880                   conversion, a different conversion might be selected
7881                   (ie, private A->B (better) but public B->A (worse),
7882                   inside A, A->B applies, but outside it, B->A will
7883                   apply).
7884
7885                 * On top of that (ie, even if the above is solved),
7886                   conversions in a cache need to be abstract.  Ie, `To
7887                   convert from an Int to a Short use an OpcodeCast', not
7888                   `To convert from an Int to a Short use the OpcodeCast on
7889                   the variable 5' (which is what this patch was doing).
7890         
7891 2001-09-28  Ravi Pratap  <ravi@ximian.com>
7892
7893         * expression.cs (Invocation::ConversionExists): Re-write to use
7894         the conversion cache
7895         
7896         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
7897         cache all conversions done, not just user-defined ones.
7898
7899         (Invocation::BetterConversion): The real culprit. Use ConversionExists
7900         to determine if a conversion exists instead of acutually trying to 
7901         perform the conversion. It's faster too.
7902
7903         (Expression::ConvertExplicit): Modify to use ConversionExists to check
7904         and only then attempt the implicit conversion.
7905
7906 2001-09-28  Ravi Pratap  <ravi@ximian.com>
7907
7908         * expression.cs (ConvertImplicit): Use a cache for conversions
7909         already found. Check level of recursion and bail out if necessary.
7910         
7911 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
7912
7913         * typemanager.cs (string_concat_string_string, string_concat_object_object):
7914         Export standard methods that we expect for string operations.
7915         
7916         * statement.cs (Block::UsageWarning): Track usage of variables and
7917         report the errors for not used variables.
7918
7919         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
7920         operator. 
7921
7922 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
7923
7924         * codegen.cs: remove unnneded code 
7925
7926         * expression.cs: Removed BuiltinTypeAccess class
7927
7928         Fix the order in which implicit conversions are
7929         done.  
7930
7931         The previous fixed dropped support for boxed conversions (adding a
7932         test to the test suite now)
7933
7934         (UserImplicitCast::CanConvert): Remove test for source being null,
7935         that code is broken.  We should not feed a null to begin with, if
7936         we do, then we should track the bug where the problem originates
7937         and not try to cover it up here.
7938
7939         Return a resolved expression of type UserImplicitCast on success
7940         rather than true/false.  Ravi: this is what I was talking about,
7941         the pattern is to use a static method as a "constructor" for
7942         objects. 
7943
7944         Also, do not create arguments until the very last minute,
7945         otherwise we always create the arguments even for lookups that
7946         will never be performed. 
7947
7948         (UserImplicitCast::Resolve): Eliminate, objects of type
7949         UserImplicitCast are born in a fully resolved state. 
7950         
7951         * typemanager.cs (InitCoreTypes): Init also value_type
7952         (System.ValueType). 
7953
7954         * expression.cs (Cast::Resolve): First resolve the child expression.
7955
7956         (LValue): Add new method AddressOf to be used by
7957         the `&' operator.  
7958
7959         Change the argument of Store to take an EmitContext instead of an
7960         ILGenerator, because things like FieldExpr need to be able to call
7961         their children expression to generate the instance code. 
7962
7963         (Expression::Error, Expression::Warning): Sugar functions for
7964         reporting errors.
7965
7966         (Expression::MemberLookup): Accept a TypeContainer instead of a
7967         Report as the first argument.
7968
7969         (Expression::ResolvePrimary): Killed.  I still want to improve
7970         this as currently the code is just not right.
7971
7972         (Expression::ResolveMemberAccess): Simplify, but it is still
7973         wrong. 
7974
7975         (Unary::Resolve): Catch errors in AddressOf operators.
7976
7977         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
7978         index to a byte for the short-version, or the compiler will choose
7979         the wrong Emit call, which generates the wrong data.
7980
7981         (ParameterReference::Emit, ::Store): same.
7982
7983         (FieldExpr::AddressOf): Implement.
7984         
7985         * typemanager.cs: TypeManager: made public variable instead of
7986         property.
7987         
7988         * driver.cs: document --fatal.
7989
7990         * report.cs (ErrorMessage, WarningMessage): new names for the old
7991         Error and Warning classes.
7992
7993         * cs-parser.jay (member_access): Turn built-in access to types
7994         into a normal simplename
7995
7996 2001-09-27  Ravi Pratap  <ravi@ximian.com>
7997
7998         * expression.cs (Invocation::BetterConversion): Fix to cope
7999         with q being null, since this was introducing a bug.
8000
8001         * expression.cs (ConvertImplicit): Do built-in conversions first.
8002
8003 2001-09-27  Ravi Pratap  <ravi@ximian.com>
8004
8005         * expression.cs (UserImplicitCast::Resolve): Fix bug.
8006
8007 2001-09-27  Ravi Pratap  <ravi@ximian.com>
8008
8009         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
8010         I had introduced long ago (what's new ?).
8011
8012         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
8013         the work of all the checking. 
8014         (ConvertImplicit): Call CanConvert and only then create object if necessary.
8015         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
8016
8017         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
8018         that is the right way. 
8019
8020         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
8021         overloading resolution. Use everywhere instead of cutting and pasting code.
8022
8023         (Binary::ResolveOperator): Use MakeUnionSet.
8024
8025         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
8026         we have to convert to bool types. Not complete yet.
8027         
8028 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
8029
8030         * typemanager.cs (TypeManager::CSharpName): support ushort.
8031
8032         * expression.cs (Expression::TryImplicitIntConversion): Attempts
8033         to provide an expression that performsn an implicit constant int
8034         conversion (section 6.1.6).
8035         (Expression::ConvertImplicitRequired): Reworked to include
8036         implicit constant expression conversions.
8037
8038         (Expression::ConvertNumericExplicit): Finished.
8039
8040         (Invocation::Emit): If InstanceExpression is null, then it means
8041         that we perform a call on this.
8042         
8043 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
8044
8045         * expression.cs (Unary::Emit): Remove some dead code.
8046         (Probe): Implement Resolve and Emit for `is'.
8047         (Expression::ConvertImplicitRequired): Attempt to do constant
8048         expression conversions here.  Maybe should be moved to
8049         ConvertImplicit, but I am not sure.
8050         (Expression::ImplicitLongConstantConversionPossible,
8051         Expression::ImplicitIntConstantConversionPossible): New functions
8052         that tell whether is it possible to apply an implicit constant
8053         expression conversion.
8054
8055         (ConvertNumericExplicit): Started work on explicit numeric
8056         conversions.
8057
8058         * cs-parser.jay: Update operator constants.
8059
8060         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
8061         (Parameters::GetSignature): Hook up VerifyArgs here.
8062         (Parameters::VerifyArgs): Verifies that no two arguments have the
8063         same name. 
8064
8065         * class.cs (Operator): Update the operator names to reflect the
8066         ones that the spec expects (as we are just stringizing the
8067         operator names).
8068         
8069         * expression.cs (Unary::ResolveOperator): Fix bug: Use
8070         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
8071         previous usage did only work for our methods.
8072         (Expression::ConvertImplicit): Handle decimal implicit numeric
8073         conversions as well.
8074         (Expression::InternalTypeConstructor): Used to invoke constructors
8075         on internal types for default promotions.
8076
8077         (Unary::Emit): Implement special handling for the pre/post
8078         increment/decrement for overloaded operators, as they need to have
8079         the same semantics as the other operators.
8080
8081         (Binary::ResolveOperator): ditto.
8082         (Invocation::ConversionExists): ditto.
8083         (UserImplicitCast::Resolve): ditto.
8084         
8085 2001-09-26  Ravi Pratap  <ravi@ximian.com>
8086
8087         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
8088         operator, return after emitting body. Regression tests pass again !
8089
8090         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
8091         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
8092         (Invocation::OverloadResolve): Ditto.
8093         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
8094
8095         * everywhere : update calls to the above methods accordingly.
8096
8097 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
8098
8099         * assign.cs (Assign): Make it inherit from ExpressionStatement.
8100
8101         * expression.cs (ExpressionStatement): New base class used for
8102         expressions that can appear in statements, so that we can provide
8103         an alternate path to generate expression that do not leave a value
8104         on the stack.
8105
8106         (Expression::Emit, and all the derivatives): We no longer return
8107         whether a value is left on the stack or not.  Every expression
8108         after being emitted leaves a single value on the stack.
8109
8110         * codegen.cs (EmitContext::EmitStatementExpression): Use the
8111         facilties of ExpressionStatement if possible.
8112
8113         * cs-parser.jay: Update statement_expression.
8114
8115 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
8116
8117         * driver.cs: Change the wording of message
8118
8119 2001-09-25  Ravi Pratap  <ravi@ximian.com>
8120
8121         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
8122         the type of the expression to the return type of the method if
8123         we have an overloaded operator match ! The regression tests pass again !
8124         (Unary::ResolveOperator): Ditto.
8125
8126         * expression.cs (Invocation::ConversionExists): Correct the member lookup
8127         to find "op_Implicit", not "implicit" ;-)
8128         (UserImplicitCast): New class to take care of user-defined implicit conversions.
8129         (ConvertImplicit, ForceConversion): Take TypeContainer argument
8130
8131         * everywhere : Correct calls to the above accordingly.
8132
8133         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
8134         (ConvertImplicit): Do user-defined conversion if it exists.
8135
8136 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
8137
8138         * assign.cs: track location.
8139         (Resolve): Use implicit conversions on assignment.
8140
8141         * literal.cs: Oops.  Not good, Emit of short access values should
8142         pass (Bytes) or the wrong argument will be selected.
8143
8144         * expression.cs (Unary::Emit): Emit code for -expr.
8145         
8146         (Unary::ResolveOperator): Handle `Substract' for non-constants
8147         (substract from zero from the non-constants).
8148         Deal with Doubles as well. 
8149         
8150         (Expression::ConvertImplicitRequired): New routine that reports an
8151         error if no implicit conversion exists. 
8152
8153         (Invocation::OverloadResolve): Store the converted implicit
8154         expressions if we make them
8155         
8156 2001-09-24  Ravi Pratap  <ravi@ximian.com>
8157
8158         * class.cs (ConstructorInitializer): Take a Location argument.
8159         (ConstructorBaseInitializer): Same here.
8160         (ConstructorThisInitializer): Same here.
8161
8162         * cs-parser.jay : Update all calls accordingly.
8163
8164         * expression.cs (Unary, Binary, New): Take location argument.
8165         Update accordingly everywhere.
8166
8167         * cs-parser.jay : Update all calls to the above to take a location
8168         argument.
8169
8170         * class.cs : Ditto.
8171
8172 2001-09-24  Ravi Pratap  <ravi@ximian.com>
8173
8174         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
8175         (Invocation::BetterConversion): Same here
8176         (Invocation::ConversionExists): Ditto.
8177
8178         (Invocation::ConversionExists): Implement.
8179
8180 2001-09-22  Ravi Pratap  <ravi@ximian.com>
8181
8182         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
8183         Also take an additional TypeContainer argument.
8184
8185         * All over : Pass in TypeContainer as argument to OverloadResolve.
8186
8187         * typemanager.cs (CSharpName): Update to check for the string type and return
8188         that too.
8189
8190         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
8191         a given method.
8192         
8193 2001-09-21  Ravi Pratap  <ravi@ximian.com>
8194
8195         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
8196         (Invocation::BetterFunction): Implement.
8197         (Invocation::BetterConversion): Implement.
8198         (Invocation::ConversionExists): Skeleton, no implementation yet.
8199
8200         Okay, things work fine !
8201
8202 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
8203
8204         * typemanager.cs: declare and load enum_type, delegate_type and
8205         void_type. 
8206
8207         * expression.cs (Expression::Emit): Now emit returns a value that
8208         tells whether a value is left on the stack or not.  This strategy
8209         might be reveted tomorrow with a mechanism that would address
8210         multiple assignments.
8211         (Expression::report118): Utility routine to report mismatches on
8212         the ExprClass.
8213
8214         (Unary::Report23): Report impossible type/operator combination
8215         utility function.
8216
8217         (Unary::IsIncrementableNumber): Whether the type can be
8218         incremented or decremented with add.
8219         (Unary::ResolveOperator): Also allow enumerations to be bitwise
8220         complemented. 
8221         (Unary::ResolveOperator): Implement ++, !, ~,
8222
8223         (Invocation::Emit): Deal with new Emit convetion.
8224         
8225         * All Expression derivatives: Updated their Emit method to return
8226         whether they leave values on the stack or not.
8227         
8228         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
8229         stack for expressions that are statements. 
8230
8231 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
8232
8233         * expression.cs (LValue): New interface.  Must be implemented by
8234         LValue objects.
8235         (LocalVariableReference, ParameterReference, FieldExpr): Implement
8236         LValue interface.
8237         
8238         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
8239         interface for generating code, simplifies the code.
8240
8241 2001-09-20  Ravi Pratap  <ravi@ximian.com>
8242
8243         * expression.cs (everywhere): Comment out return statements in ::Resolve
8244         methods to avoid the warnings.
8245
8246 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
8247
8248         * driver.cs (parse): Report error 2001 if we can not open the
8249         source file.
8250
8251         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
8252         not resolve it.
8253
8254         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
8255         object. 
8256
8257         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
8258         otherwise nested blocks end up with the same index.
8259
8260         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
8261
8262         * expression.cs:  Instead of having FIXMEs in the Resolve
8263         functions, throw exceptions so it is obvious that we are facing a
8264         bug. 
8265
8266         * cs-parser.jay (invocation_expression): Pass Location information.
8267
8268         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
8269         Use a basename for those routines because .NET does not like paths
8270         on them. 
8271
8272         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
8273         already defined.
8274
8275 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
8276
8277         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
8278         are loading the correct data types (throws an exception if not).
8279         (TypeManager::InitCoreTypes): Use CoreLookupType
8280
8281         * expression.cs (Unary::ResolveOperator): return the child
8282         expression for expressions which are just +expr.
8283         (Unary::ResolveOperator): Return negative literals for -LITERAL
8284         expressions (otherwise they are Unary {Literal}).
8285         (Invocation::Badness): Take into account `Implicit constant
8286         expression conversions'.
8287
8288         * literal.cs (LongLiteral): Implement long literal class.
8289         (IntLiteral): export the `Value' of the intliteral. 
8290
8291 2001-09-19  Ravi Pratap  <ravi@ximian.com>
8292
8293         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
8294
8295         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
8296         instead of 'Operator'
8297
8298         * expression.cs (Binary::ResolveOperator): Update accordingly.
8299         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
8300         and 'Minus'
8301
8302         * cs-parser.jay (unary_expression): Update to use the new names.
8303
8304         * gen-treedump.cs (GetUnary): Same here.
8305
8306         * expression.cs (Unary::Resolve): Implement.
8307         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
8308         operators are found instead of making noise ;-)
8309         (Unary::ResolveOperator): New method to do precisely the same thing which
8310         Binary::ResolveOperator does for Binary expressions.
8311         (Unary.method, .Arguments): Add.
8312         (Unary::OperName): Implement.   
8313         (Unary::ForceConversion): Copy and Paste !
8314
8315         * class.cs (Operator::Define): Fix a small bug for the case when we have 
8316         a unary operator.
8317
8318         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
8319         for the inbuilt operators. Only overloading works for now ;-)
8320
8321 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
8322
8323         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
8324         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
8325
8326         * expression.cs (This::Emit): Implement. 
8327         (This::Resolve): Implement.
8328         (TypeOf:Resolve): Implement.
8329         (Expression::ResolveSimpleName): Add an implicit this to instance
8330         field references. 
8331         (MemberAccess::Resolve): Deal with Parameters and Fields. 
8332         Bind instance variable to Field expressions.
8333         (FieldExpr::Instance): New field used to track the expression that
8334         represents the object instance.
8335         (FieldExpr::Resolve): Track potential errors from MemberLookup not
8336         binding 
8337         (FieldExpr::Emit): Implement.
8338
8339         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
8340         the last instruction contains a return opcode to avoid generating
8341         the last `ret' instruction (this generates correct code, and it is
8342         nice to pass the peverify output).
8343
8344         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
8345         initializer for static and instance variables.
8346         (Constructor::Emit): Allow initializer to be null in the case of
8347         static constructors.  Only emit initializer for instance
8348         constructors. 
8349
8350         (TypeContainer::FindMembers): Return a null array if there are no
8351         matches.
8352
8353         Also fix the code for the MemberTypes.Method branch, as it was not
8354         scanning that for operators (or tried to access null variables before).
8355
8356         * assign.cs (Assign::Emit): Handle instance and static fields. 
8357
8358         * TODO: Updated.
8359
8360         * driver.cs: Stop compilation if there are parse errors.
8361
8362         * cs-parser.jay (constructor_declaration): Provide default base
8363         initializer for non-static constructors.
8364         (constructor_declarator): Do not provide a default base
8365         initializers if none was specified.
8366         Catch the fact that constructors should not have parameters.
8367
8368         * class.cs: Do not emit parent class initializers for static
8369         constructors, that should be flagged as an error.
8370
8371 2001-09-18  Ravi Pratap  <ravi@ximian.com>
8372
8373         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
8374         Move back code into TypeContainer::Populate.
8375
8376 2001-09-18  Ravi Pratap  <ravi@ximian.com>
8377
8378         * class.cs (TypeContainer::AddConstructor): Fix the check to
8379         compare against Name, not Basename. 
8380         (Operator::OpType): Change Plus and Minus to Add and Subtract.
8381
8382         * cs-parser.jay : Update accordingly.
8383
8384         * class.cs (TypeContainer::FindMembers): For the case where we are searching
8385         for methods, don't forget to look into the operators too.
8386         (RegisterMethodBuilder): Helper method to take care of this for
8387         methods, constructors and operators.
8388         (Operator::Define): Completely revamp.
8389         (Operator.OperatorMethod, MethodName): New fields.
8390         (TypeContainer::Populate): Move the registering of builders into
8391         RegisterMethodBuilder.
8392         (Operator::Emit): Re-write.
8393
8394         * expression.cs (Binary::Emit): Comment out code path to emit method
8395         invocation stuff for the case when we have a user defined operator. I am
8396         just not able to get it right !
8397         
8398 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
8399
8400         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
8401         argument. 
8402
8403         (Expression::MemberLookup): Provide a version that allows to
8404         specify the MemberTypes and BindingFlags. 
8405
8406         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
8407         so it was not fetching variable information from outer blocks.
8408
8409         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
8410         Beforefieldinit as it was buggy.
8411
8412         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
8413         that Ravi put here.  
8414
8415         * class.cs (Constructor::Emit): Only emit if block is not null.
8416         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
8417         deal with this by semantically definining it as if the user had
8418         done it.
8419
8420         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
8421         constructors as we now "emit" them at a higher level.
8422
8423         (TypeContainer::DefineDefaultConstructor): Used to define the
8424         default constructors if none was provided.
8425
8426         (ConstructorInitializer): Add methods Resolve and Emit. 
8427         
8428         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
8429
8430 2001-09-17  Ravi Pratap  <ravi@ximian.com>
8431
8432         * class.cs (TypeContainer::EmitDefaultConstructor): Register
8433         the default constructor builder with our hashtable for methodbuilders
8434         to methodcores.
8435
8436         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
8437         and argument_count is 0 in which case we have a match.
8438         (Binary::ResolveOperator): More null checking and miscellaneous coding
8439         style cleanup.
8440
8441 2001-09-17  Ravi Pratap  <ravi@ximian.com>
8442
8443         * rootcontext.cs (IsNameSpace): Compare against null.
8444
8445         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
8446
8447         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
8448         and Unary::Operator.
8449
8450         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
8451         accordingly.
8452
8453         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
8454         we have overloaded operators.
8455         (Binary::ResolveOperator): Implement the part which does the operator overload
8456         resolution.
8457
8458         * class.cs (Operator::Emit): Implement.
8459         (TypeContainer::Emit): Emit the operators we have too.
8460
8461         * expression.cs (Binary::Emit): Update to emit the appropriate code for
8462         the case when we have a user-defined operator.
8463         
8464 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
8465
8466         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
8467
8468 2001-09-16  Ravi Pratap  <ravi@ximian.com>
8469
8470         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
8471         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
8472         (Constructor::Emit): Implement.
8473         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
8474         if we have no work to do. 
8475         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
8476         Emit method.
8477
8478         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
8479         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
8480
8481         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
8482         of parent.parent.
8483
8484 2001-09-15  Ravi Pratap  <ravi@ximian.com>
8485
8486         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
8487         in the source.
8488         (Tree::RecordNamespace): Method to do what the name says ;-)
8489         (Tree::Namespaces): Property to get at the namespaces hashtable.
8490
8491         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
8492         keep track.
8493
8494         * rootcontext.cs (IsNamespace): Fixed it :-)
8495
8496 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
8497
8498         * class.cs (TypeContainer::FindMembers): Add support for
8499         constructors. 
8500         (MethodCore): New class that encapsulates both the shared aspects
8501         of a Constructor and a Method.  
8502         (Method, Constructor): Factored pieces into MethodCore.
8503
8504         * driver.cs: Added --fatal which makes errors throw exceptions.
8505         Load System assembly as well as part of the standard library.
8506
8507         * report.cs: Allow throwing exceptions on errors for debugging.
8508
8509         * modifiers.cs: Do not use `parent', instead use the real type
8510         container to evaluate permission settings.
8511
8512         * class.cs: Put Ravi's patch back in.  He is right, and we will
8513         have to cope with the
8514
8515 2001-09-14  Ravi Pratap  <ravi@ximian.com>
8516
8517         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
8518         FamORAssem, not FamANDAssem.
8519         
8520 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
8521
8522         * driver.cs: Added --parse option that only parses its input files
8523         and terminates.
8524
8525         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
8526         incorrect.  IsTopLevel is not used to tell whether an object is
8527         root_types or not (that can be achieved by testing this ==
8528         root_types).  But to see if this is a top-level *class* (not
8529         necessarly our "toplevel" container). 
8530
8531 2001-09-14  Ravi Pratap  <ravi@ximian.com>
8532
8533         * enum.cs (Enum::Define): Modify to call the Lookup method on the
8534         parent instead of a direct call to GetType.
8535
8536 2001-09-14  Ravi Pratap  <ravi@ximian.com>
8537
8538         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
8539         Modifiers.TypeAttr. This should just be a call to that method.
8540
8541         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
8542         object so that we can determine if we are top-level or not.
8543
8544         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
8545         TypeContainer too.
8546
8547         * enum.cs (Enum::Define): Ditto.
8548
8549         * modifiers.cs (FieldAttr): Re-write.
8550
8551         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
8552         (TypeContainer::HaveStaticConstructor): New property to provide access
8553         to precisely that info.
8554
8555         * modifiers.cs (MethodAttr): Re-write.
8556         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
8557
8558         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
8559         of top-level types as claimed.
8560         
8561 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
8562
8563         * expression.cs (MemberLookup): Fruitless attempt to lookup
8564         constructors.  Maybe I need to emit default constructors?  That
8565         might be it (currently .NET emits this for me automatically).
8566         (Invocation::OverloadResolve): Cope with Arguments == null.
8567         (Invocation::EmitArguments): new function, shared by the new
8568         constructor and us.
8569         (Invocation::Emit): Handle static and instance methods.  Emit
8570         proper call instruction for virtual or non-virtual invocations.
8571         (New::Emit): Implement.
8572         (New::Resolve): Implement.
8573         (MemberAccess:Resolve): Implement.
8574         (MethodGroupExpr::InstanceExpression): used conforming to the spec
8575         to track instances.
8576         (FieldExpr::Resolve): Set type.
8577
8578         * support.cs: Handle empty arguments.
8579                 
8580         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
8581         SimpleLookup): Auxiliary routines to help parse a qualifier
8582         identifier.  
8583
8584         Update qualifier_identifier rule.
8585
8586         * codegen.cs: Removed debugging messages.
8587
8588         * class.cs: Make this a global thing, this acts just as a "key" to
8589         objects that we might have around.
8590
8591         (Populate): Only initialize method_builders_to_methods once.
8592
8593         * expression.cs (PropertyExpr): Initialize type from the
8594         PropertyType. 
8595
8596         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
8597         Resolve pattern.  Attempt to implicitly convert value to boolean.
8598         Emit code.
8599
8600         * expression.cs: Set the type for the int32/int32 argument case.
8601         (Binary::ResolveOperator): Set the return type to boolean for
8602         comparission operators
8603
8604         * typemanager.cs: Remove debugging print code.
8605
8606         (Invocation::Resolve): resolve type.
8607
8608         * class.cs: Allocate a MemberInfo of the correct size, as the code
8609         elsewhere depends on the test to reflect the correct contents.
8610
8611         (Method::) Keep track of parameters, due to System.Reflection holes
8612
8613         (TypeContainer::Populate): Keep track of MethodBuilders to Method
8614         mapping here.
8615
8616         (TypeContainer::FindMembers): Use ArrayList and then copy an array
8617         of the exact size and return that.
8618
8619         (Class::LookupMethodByBuilder): New function that maps
8620         MethodBuilders to its methods.  Required to locate the information
8621         on methods because System.Reflection bit us again.
8622
8623         * support.cs: New file, contains an interface ParameterData and
8624         two implementations: ReflectionParameters and InternalParameters
8625         used to access Parameter information.  We will need to grow this
8626         as required.
8627
8628         * expression.cs (Invocation::GetParameterData): implement a cache
8629         and a wrapper around the ParameterData creation for methods. 
8630         (Invocation::OverloadResolve): Use new code.
8631
8632 2001-09-13  Ravi Pratap  <ravi@ximian.com>
8633
8634         * class.cs (TypeContainer::EmitField): Remove and move into 
8635         (Field::Define): here and modify accordingly.
8636         (Field.FieldBuilder): New member.
8637         (TypeContainer::Populate): Update accordingly.
8638         (TypeContainer::FindMembers): Implement.
8639
8640 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
8641
8642         * statement.cs: (VariableInfo::VariableType): New field to be
8643         initialized with the full type once it is resolved. 
8644
8645 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
8646
8647         * parameter.cs (GetParameterInfo): Use a type cache to compute
8648         things only once, and to reuse this information
8649
8650         * expression.cs (LocalVariableReference::Emit): Implement.
8651         (OpcodeCast::Emit): fix.
8652
8653         (ParameterReference::Resolve): Implement.
8654         (ParameterReference::Emit): Implement.
8655
8656         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
8657         that are expressions need to stay as Expressions.
8658
8659         * typemanager.cs (CSharpName): Returns the C# name of a type if
8660         possible. 
8661
8662         * expression.cs (Expression::ConvertImplicit): New function that
8663         implements implicit type conversions.
8664
8665         (Expression::ImplicitReferenceConversion): Implements implicit
8666         reference conversions.
8667
8668         (EmptyCast): New type for transparent casts.
8669
8670         (OpcodeCast): New type for casts of types that are performed with
8671         a sequence of bytecodes.
8672         
8673         (BoxedCast): New type used for casting value types into reference
8674         types.  Emits a box opcode.
8675
8676         (Binary::DoNumericPromotions): Implements numeric promotions of
8677         and computation of the Binary::Type.
8678
8679         (Binary::EmitBranchable): Optimization.
8680
8681         (Binary::Emit): Implement code emission for expressions.
8682         
8683         * typemanager.cs (TypeManager): Added two new core types: sbyte
8684         and byte.
8685
8686 2001-09-12  Ravi Pratap  <ravi@ximian.com>
8687
8688         * class.cs (TypeContainer::FindMembers): Method which does exactly
8689         what Type.FindMembers does, only we don't have to use reflection. No
8690         implementation yet.
8691
8692         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
8693         typecontainer objects as we need to get at them.
8694         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
8695
8696         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
8697         typecontainer object.
8698
8699         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
8700         of just a Report object.
8701
8702 2001-09-11  Ravi Pratap  <ravi@ximian.com>
8703
8704         * class.cs (Event::Define): Go back to using the prefixes "add_" and
8705         "remove_"
8706         (TypeContainer::Populate): Now define the delegates of the type too.
8707         (TypeContainer.Delegates): Property to access the list of delegates defined
8708         in the type.
8709
8710         * delegates.cs (Delegate::Define): Implement partially.
8711
8712         * modifiers.cs (TypeAttr): Handle more flags.
8713
8714 2001-09-11  Ravi Pratap  <ravi@ximian.com>
8715
8716         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
8717         and not <=
8718         (Operator::Define): Re-write logic to get types by using the LookupType method
8719         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
8720         (Indexer::Define): Ditto.
8721         (Event::Define): Ditto.
8722         (Property::Define): Ditto.
8723         
8724 2001-09-10  Ravi Pratap  <ravi@ximian.com>
8725
8726         * class.cs (TypeContainer::Populate): Now define operators too. 
8727         (TypeContainer.Operators): New property to access the list of operators
8728         in a type.
8729         (Operator.OperatorMethodBuilder): New member to hold the method builder
8730         for the operator we are defining.
8731         (Operator::Define): Implement.
8732
8733 2001-09-10  Ravi Pratap  <ravi@ximian.com>
8734
8735         * class.cs (Event::Define): Make the prefixes of the accessor methods
8736         addOn_ and removeOn_ 
8737
8738         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
8739         of the location being passed in too. Ideally, this should go later since all
8740         error reporting should be done through the Report object.
8741
8742         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
8743         (Populate): Iterate thru the indexers we have and define them too.
8744         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
8745         for the get and set accessors.
8746         (Indexer::Define): Implement.
8747         
8748 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
8749
8750         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
8751         my previous implementation, did not work.
8752
8753         * typemanager.cs: Add a couple of missing types (the longs).
8754
8755         * literal.cs: Use TypeManager.bool_type instead of getting it.
8756
8757         * expression.cs (EventExpr): New kind of expressions.
8758         (Expressio::ExprClassFromMemberInfo): finish
8759
8760 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
8761
8762         * assign.cs: Emit stores to static fields differently.
8763
8764 2001-09-08  Ravi Pratap  <ravi@ximian.com>
8765
8766         * Merge in changes and adjust code to tackle conflicts. Backed out my
8767         code in Assign::Resolve ;-) 
8768
8769 2001-09-08  Ravi Pratap  <ravi@ximian.com>
8770
8771         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
8772         instead Report.Error and also pass in the location.
8773         (CSharpParser::Lexer): New readonly property to return the reference
8774         to the Tokenizer object.
8775         (declare_local_variables): Use Report.Error with location instead of plain 
8776         old error.
8777         (CheckDef): Ditto.
8778
8779         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
8780         (Operator.CheckBinaryOperator): Ditto.
8781
8782         * cs-parser.jay (operator_declarator): Update accordingly.
8783
8784         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
8785         (CheckBinaryOperator): Same here.
8786
8787         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
8788         on the name without any prefixes of namespace names etc. This is because we
8789         already might have something already fully qualified like 
8790         'System.Console.WriteLine'
8791
8792         * assign.cs (Resolve): Begin implementation. Stuck ;-)
8793
8794 2001-09-07  Ravi Pratap  <ravi@ximian.com>
8795
8796         * cs-tokenizer.cs (location): Return a string which also contains
8797         the file name.
8798
8799         * expression.cs (ElementAccess): New class for expressions of the
8800         type 'element access.'
8801         (BaseAccess): New class for expressions of the type 'base access.'
8802         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
8803         respectively.
8804         
8805         * cs-parser.jay (element_access): Implement action.
8806         (base_access): Implement actions.
8807         (checked_expression, unchecked_expression): Implement.
8808
8809         * cs-parser.jay (local_variable_type): Correct and implement.
8810         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
8811
8812         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
8813
8814         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
8815         name and the specifiers.
8816
8817         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
8818         
8819         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
8820         making them all public ;-)
8821
8822         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
8823         class anyways.
8824         
8825 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
8826
8827         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
8828         PropertyExprs.
8829         (FieldExpr, PropertyExprs): New resolved expressions.
8830         (SimpleName::MemberStaticCheck): Perform static checks for access
8831         to non-static fields on static methods. Maybe this should be
8832         generalized for MemberAccesses. 
8833         (SimpleName::ResolveSimpleName): More work on simple name
8834         resolution. 
8835
8836         * cs-parser.jay (primary_expression/qualified_identifier): track
8837         the parameter index.
8838
8839         * codegen.cs (CodeGen::Save): Catch save exception, report error.
8840         (EmitContext::EmitBoolExpression): Chain to expression generation
8841         instead of temporary hack.
8842         (::EmitStatementExpression): Put generic expression code generation.
8843
8844         * assign.cs (Assign::Emit): Implement variable assignments to
8845         local variables, parameters and fields.
8846
8847 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
8848
8849         * statement.cs (Block::GetVariableInfo): New method, returns the
8850         VariableInfo for a variable name in a block.
8851         (Block::GetVariableType): Implement in terms of GetVariableInfo
8852
8853         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
8854         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
8855
8856 2001-09-06  Ravi Pratap  <ravi@ximian.com>
8857
8858         * cs-parser.jay (operator_declaration): Continue on my quest : update
8859         to take attributes argument.
8860         (event_declaration): Ditto.
8861         (enum_declaration): Ditto.
8862         (indexer_declaration): Ditto.
8863         
8864         * class.cs (Operator::Operator): Update constructor accordingly.
8865         (Event::Event): Ditto.
8866
8867         * delegate.cs (Delegate::Delegate): Same here.
8868
8869         * enum.cs (Enum::Enum): Same here.
8870         
8871 2001-09-05  Ravi Pratap  <ravi@ximian.com>
8872
8873         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
8874
8875         * ../tests/cs0658.cs : New file to demonstrate error 0658.
8876
8877         * attribute.cs (Attributes): New class to encapsulate all attributes which were
8878         being passed around as an arraylist.
8879         (Attributes::AddAttribute): Method to add attribute sections.
8880
8881         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
8882         (struct_declaration): Update accordingly.
8883         (constant_declaration): Update.
8884         (field_declaration): Update.
8885         (method_header): Update.
8886         (fixed_parameter): Update.
8887         (parameter_array): Ditto.
8888         (property_declaration): Ditto.
8889         (destructor_declaration): Ditto.
8890         
8891         * class.cs (Struct::Struct): Update constructors accordingly.
8892         (Class::Class): Ditto.
8893         (Field::Field): Ditto.
8894         (Method::Method): Ditto.
8895         (Property::Property): Ditto.
8896         (TypeContainer::OptAttribute): update property's return type.
8897         
8898         * interface.cs (Interface.opt_attributes): New member.
8899         (Interface::Interface): Update to take the extra Attributes argument.
8900
8901         * parameter.cs (Parameter::Parameter): Ditto.
8902
8903         * constant.cs (Constant::Constant): Ditto.
8904
8905         * interface.cs (InterfaceMemberBase): New OptAttributes field.
8906         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
8907         the attributes as a parameter.
8908         (InterfaceProperty): Update constructor call.
8909         (InterfaceEvent): Ditto.
8910         (InterfaceMethod): Ditto.
8911         (InterfaceIndexer): Ditto.
8912
8913         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
8914         pass the attributes too.
8915         (interface_event_declaration): Ditto.
8916         (interface_property_declaration): Ditto.
8917         (interface_method_declaration): Ditto.
8918         (interface_declaration): Ditto.
8919
8920 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
8921
8922         * class.cs (Method::Define): Track the "static Main" definition to
8923         create an entry point. 
8924
8925         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
8926         EntryPoint if we find it. 
8927
8928         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
8929         (EmitContext::ig): Make this variable public.
8930
8931         * driver.cs: Make the default output file be the first file name
8932         with the .exe extension.  
8933
8934         Detect empty compilations
8935
8936         Handle various kinds of output targets.  Handle --target and
8937         rename -t to --dumper.
8938
8939         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
8940         methods inherited from Expression return now an Expression.  This
8941         will is used during the tree rewriting as we resolve them during
8942         semantic analysis.
8943
8944         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
8945         the spec.  Missing entirely is the information about
8946         accessability of elements of it.
8947
8948         (Expression::ExprClassFromMemberInfo): New constructor for
8949         Expressions that creates a fully initialized Expression based on
8950         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
8951         a Type.
8952
8953         (Invocation::Resolve): Begin implementing resolution of invocations.
8954         
8955         * literal.cs (StringLiteral):  Implement Emit.
8956
8957 2001-09-05  Ravi Pratap  <ravi@ximian.com>
8958
8959         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
8960         member.
8961         
8962 2001-09-04  Ravi Pratap  <ravi@ximian.com>
8963
8964         * cs-parser.jay (attribute_arguments): Implement actions.
8965         (attribute): Fix bug in production. Implement action.
8966         (attribute_list): Implement.
8967         (attribute_target): Implement.
8968         (attribute_target_specifier, opt_target_specifier): Implement
8969         (CheckAttributeTarget): New method to check if the attribute target
8970         is valid.
8971         (attribute_section): Implement.
8972         (opt_attributes): Implement.
8973
8974         * attribute.cs : New file to handle attributes.
8975         (Attribute): Class to hold attribute info.
8976
8977         * cs-parser.jay (opt_attribute_target_specifier): Remove production
8978         (attribute_section): Modify production to use 2 different rules to 
8979         achieve the same thing. 1 s/r conflict down !
8980         Clean out commented, useless, non-reducing dimension_separator rules.
8981         
8982         * class.cs (TypeContainer.attributes): New member to hold list
8983         of attributes for a type.
8984         (Struct::Struct): Modify to take one more argument, the attribute list.
8985         (Class::Class): Ditto.
8986         (Field::Field): Ditto.
8987         (Method::Method): Ditto.
8988         (Property::Property): Ditto.
8989         
8990         * cs-parser.jay (struct_declaration): Update constructor call to
8991         pass in the attributes too.
8992         (class_declaration): Ditto.
8993         (constant_declaration): Ditto.
8994         (field_declaration): Ditto.
8995         (method_header): Ditto.
8996         (fixed_parameter): Ditto.
8997         (parameter_array): Ditto.
8998         (property_declaration): Ditto.
8999
9000         * constant.cs (Constant::Constant): Update constructor similarly.
9001         Use System.Collections.
9002
9003         * parameter.cs (Parameter::Parameter): Update as above.
9004
9005 2001-09-02  Ravi Pratap  <ravi@ximian.com>
9006
9007         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
9008         (TypeContainer.delegates): New member to hold list of delegates.
9009
9010         * cs-parser.jay (delegate_declaration): Implement the action correctly 
9011         this time as I seem to be on crack ;-)
9012
9013 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
9014
9015         * rootcontext.cs (RootContext::IsNamespace): new function, used to
9016         tell whether an identifier represents a namespace.
9017
9018         * expression.cs (NamespaceExpr): A namespace expression, used only
9019         temporarly during expression resolution.
9020         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
9021         utility functions to resolve names on expressions.
9022
9023 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
9024
9025         * codegen.cs: Add hook for StatementExpressions. 
9026
9027         * class.cs: Fix inverted test for static flag in methods.
9028
9029 2001-09-02  Ravi Pratap  <ravi@ximian.com>
9030
9031         * class.cs (Operator::CheckUnaryOperator): Correct error number used
9032         to make it coincide with MS' number.
9033         (Operator::CheckBinaryOperator): Ditto.
9034
9035         * ../errors/errors.txt : Remove error numbers added earlier.
9036
9037         * ../errors/cs1019.cs : Test case for error # 1019
9038
9039         * ../errros/cs1020.cs : Test case for error # 1020
9040
9041         * cs-parser.jay : Clean out commented cruft.
9042         (dimension_separators, dimension_separator): Comment out. Ostensibly not
9043         used anywhere - non-reducing rule.
9044         (namespace_declarations): Non-reducing rule - comment out.
9045
9046         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
9047         with TypeContainer::AddEnum.
9048
9049         * delegate.cs : New file for delegate handling classes.
9050         (Delegate): Class for declaring delegates.
9051
9052         * makefile : Update.
9053
9054         * cs-parser.jay (delegate_declaration): Implement.
9055
9056 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
9057
9058         * class.cs (Event::Define): Implement.
9059         (Event.EventBuilder): New member.
9060
9061         * class.cs (TypeContainer::Populate): Update to define all enums and events
9062         we have.
9063         (Events): New property for the events arraylist we hold. Shouldn't we move to using
9064         readonly fields for all these cases ?
9065
9066 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
9067
9068         * class.cs (Property): Revamp to use the convention of making fields readonly.
9069         Accordingly modify code elsewhere.
9070
9071         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
9072         the Define method of the Property class.
9073
9074         * class.cs : Clean up applied patch and update references to variables etc. Fix 
9075         trivial bug.
9076         (TypeContainer::Populate): Update to define all the properties we have. Also
9077         define all enumerations.
9078
9079         * enum.cs (Define): Implement.
9080         
9081 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
9082
9083         * cs-parser.jay (overloadable_operator): The semantic value is an
9084         enum of the Operator class.
9085         (operator_declarator): Implement actions.
9086         (operator_declaration): Implement.
9087
9088         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
9089         validity of definitions.
9090         (Operator::CheckBinaryOperator): Static method to check for binary operators
9091         (TypeContainer::AddOperator): New method to add an operator to a type.
9092
9093         * cs-parser.jay (indexer_declaration): Added line to actually call the
9094         AddIndexer method so it gets added ;-)
9095
9096         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
9097         already taken care of by the MS compiler ?  
9098
9099 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
9100
9101         * class.cs (Operator): New class for operator declarations.
9102         (Operator::OpType): Enum for the various operators.
9103
9104 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
9105
9106         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
9107         ostensibly handle this in semantic analysis.
9108
9109         * cs-parser.jay (general_catch_clause): Comment out
9110         (specific_catch_clauses, specific_catch_clause): Ditto.
9111         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
9112         (catch_args, opt_catch_args): New productions.
9113         (catch_clause): Rewrite to use the new productions above
9114         (catch_clauses): Modify accordingly.
9115         (opt_catch_clauses): New production to use in try_statement
9116         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
9117         and re-write the code in the actions to extract the specific and
9118         general catch clauses by being a little smart ;-)
9119
9120         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
9121         Hooray, try and catch statements parse fine !
9122         
9123 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
9124
9125         * statement.cs (Block::GetVariableType): Fix logic to extract the type
9126         string from the hashtable of variables.
9127
9128         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
9129         I end up making that mistake ;-)
9130         (catch_clauses): Fixed gross error which made Key and Value of the 
9131         DictionaryEntry the same : $1 !!
9132
9133 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
9134
9135         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
9136
9137         * cs-parser.jay (event_declaration): Correct to remove the semicolon
9138         when the add and remove accessors are specified. 
9139
9140 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
9141
9142         * cs-parser.jay (IndexerDeclaration): New helper class to hold
9143         information about indexer_declarator.
9144         (indexer_declarator): Implement actions.
9145         (parsing_indexer): New local boolean used to keep track of whether
9146         we are parsing indexers or properties. This is necessary because 
9147         implicit_parameters come into picture even for the get accessor in the 
9148         case of an indexer.
9149         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
9150
9151         * class.cs (Indexer): New class for indexer declarations.
9152         (TypeContainer::AddIndexer): New method to add an indexer to a type.
9153         (TypeContainer::indexers): New member to hold list of indexers for the
9154         type.
9155
9156 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
9157
9158         * cs-parser.jay (add_accessor_declaration): Implement action.
9159         (remove_accessor_declaration): Implement action.
9160         (event_accessors_declaration): Implement
9161         (variable_declarators): swap statements for first rule - trivial.
9162
9163         * class.cs (Event): New class to hold information about event
9164         declarations.
9165         (TypeContainer::AddEvent): New method to add an event to a type
9166         (TypeContainer::events): New member to hold list of events.
9167
9168         * cs-parser.jay (event_declaration): Implement actions.
9169
9170 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
9171
9172         * cs-parser.jay (dim_separators): Implement. Make it a string
9173         concatenating all the commas together, just as they appear.
9174         (opt_dim_separators): Modify accordingly
9175         (rank_specifiers): Update accordingly. Basically do the same
9176         thing - instead, collect the brackets here.
9177         (opt_rank_sepcifiers): Modify accordingly.
9178         (array_type): Modify to actually return the complete type string
9179         instead of ignoring the rank_specifiers.
9180         (expression_list): Implement to collect the expressions
9181         (variable_initializer): Implement. We make it a list of expressions
9182         essentially so that we can handle the array_initializer case neatly too.
9183         (variable_initializer_list): Implement.
9184         (array_initializer): Make it a list of variable_initializers
9185         (opt_array_initializer): Modify accordingly.
9186
9187         * expression.cs (New::NType): Add enumeration to help us
9188         keep track of whether we have an object/delegate creation
9189         or an array creation.
9190         (New:NewType, New::Rank, New::Indices, New::Initializers): New
9191         members to hold data about array creation.
9192         (New:New): Modify to update NewType
9193         (New:New): New Overloaded contructor for the array creation
9194         case.
9195
9196         * cs-parser.jay (array_creation_expression): Implement to call
9197         the overloaded New constructor.
9198         
9199 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
9200
9201         * class.cs (TypeContainer::Constructors): Return member
9202         constructors instead of returning null.
9203
9204 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
9205
9206         * typemanager.cs (InitCoreTypes): Initialize the various core
9207         types after we have populated the type manager with the user
9208         defined types (this distinction will be important later while
9209         compiling corlib.dll)
9210
9211         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
9212         on Expression Classification.  Now all expressions have a method
9213         `Resolve' and a method `Emit'.
9214
9215         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
9216         generation from working.     Also add some temporary debugging
9217         code. 
9218         
9219 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
9220
9221         * codegen.cs: Lots of code generation pieces.  This is only the
9222         beginning, will continue tomorrow with more touches of polish.  We
9223         handle the fundamentals of if, while, do, for, return.  Others are
9224         trickier and I need to start working on invocations soon.
9225         
9226         * gen-treedump.cs: Bug fix, use s.Increment here instead of
9227         s.InitStatement. 
9228
9229         * codegen.cs (EmitContext): New struct, used during code
9230         emission to keep a context.   Most of the code generation will be
9231         here. 
9232
9233         * cs-parser.jay: Add embedded blocks to the list of statements of
9234         this block.  So code generation proceeds in a top down fashion.
9235
9236 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
9237
9238         * statement.cs: Add support for multiple child blocks.
9239
9240 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
9241
9242         * codegen.cs (EmitCode): New function, will emit the code for a
9243         Block of code given a TypeContainer and its ILGenerator. 
9244
9245         * statement.cs (Block): Standard public readonly optimization.
9246         (Block::Block constructors): Link children. 
9247         (Block::Child): Child Linker.
9248         (Block::EmitVariables): Emits IL variable declarations.
9249
9250         * class.cs: Drop support for MethodGroups here, delay until
9251         Semantic Analysis.
9252         (Method::): Applied the same simplification that I did before, and
9253         move from Properties to public readonly fields.
9254         (Method::ParameterTypes): Returns the parameter types for the
9255         function, and implements a cache that will be useful later when I
9256         do error checking and the semantic analysis on the methods is
9257         performed.
9258         (Constructor::GetCallingConvention): Renamed from CallingConvetion
9259         and made a method, optional argument tells whether this is a class
9260         or a structure to apply the `has-this' bit.
9261         (Method::GetCallingConvention): Implement, returns the calling
9262         convention. 
9263         (Method::Define): Defines the type, a second pass is performed
9264         later to populate the methods.
9265
9266         (Constructor::ParameterTypes): implement a cache similar to the
9267         one on Method::ParameterTypes, useful later when we do semantic
9268         analysis. 
9269
9270         (TypeContainer::EmitMethod):  New method.  Emits methods.
9271
9272         * expression.cs: Removed MethodGroup class from here.
9273         
9274         * parameter.cs (Parameters::GetCallingConvention): new method.
9275
9276 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
9277
9278         * class.cs (TypeContainer::Populate): Drop RootContext from the
9279         argument. 
9280
9281         (Constructor::CallingConvention): Returns the calling convention.
9282         (Constructor::ParameterTypes): Returns the constructor parameter
9283         types. 
9284         
9285         (TypeContainer::AddConstructor): Keep track of default constructor
9286         and the default static constructor.
9287
9288         (Constructor::) Another class that starts using `public readonly'
9289         instead of properties. 
9290
9291         (Constructor::IsDefault): Whether this is a default constructor. 
9292
9293         (Field::) use readonly public fields instead of properties also.
9294
9295         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
9296         track of static constructors;  If none is used, turn on
9297         BeforeFieldInit in the TypeAttributes. 
9298
9299         * cs-parser.jay (opt_argument_list): now the return can be null
9300         for the cases where there are no arguments. 
9301
9302         (constructor_declarator): If there is no implicit `base' or
9303         `this', then invoke the default parent constructor. 
9304         
9305         * modifiers.cs (MethodAttr): New static function maps a set of
9306         modifiers flags into a MethodAttributes enum
9307         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
9308         MethodAttr, TypeAttr to represent the various mappings where the
9309         modifiers are used.
9310         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
9311
9312 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
9313
9314         * parameter.cs (GetParameterInfo): Fix bug where there would be no
9315         method arguments.
9316
9317         * interface.cs (PopulateIndexer): Implemented the code generator
9318         for interface indexers.
9319
9320 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
9321
9322         * interface.cs (InterfaceMemberBase): Now we track the new status
9323         here.  
9324
9325         (PopulateProperty): Implement property population.  Woohoo!  Got
9326         Methods and Properties going today. 
9327
9328         Removed all the properties for interfaces, and replaced them with
9329         `public readonly' fields. 
9330
9331 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
9332
9333         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
9334         initialize their hashtables/arraylists only when they are needed
9335         instead of doing this always.
9336
9337         * parameter.cs: Handle refs and out parameters.
9338
9339         * cs-parser.jay: Use an ArrayList to construct the arguments
9340         instead of the ParameterCollection, and then cast that to a
9341         Parameter[] array.
9342
9343         * parameter.cs: Drop the use of ParameterCollection and use
9344         instead arrays of Parameters.
9345
9346         (GetParameterInfo): Use the Type, not the Name when resolving
9347         types. 
9348
9349 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
9350
9351         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
9352         and instead use public readonly fields.
9353
9354         * class.cs: Put back walking code for type containers.
9355
9356 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
9357
9358         * class.cs (MakeConstant): Code to define constants.
9359
9360         * rootcontext.cs (LookupType): New function.  Used to locate types 
9361
9362         
9363 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
9364
9365         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
9366         this System.Reflection code is.  Kudos to Microsoft
9367         
9368         * typemanager.cs: Implement a type cache and avoid loading all
9369         types at boot time.  Wrap in LookupType the internals.  This made
9370         the compiler so much faster.  Wow.  I rule!
9371         
9372         * driver.cs: Make sure we always load mscorlib first (for
9373         debugging purposes, nothing really important).
9374
9375         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
9376         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
9377
9378         * rootcontext.cs: Lookup types on their namespace;  Lookup types
9379         on namespaces that have been imported using the `using' keyword.
9380
9381         * class.cs (TypeContainer::TypeAttr): Virtualize.
9382         (Class::TypeAttr): Return attributes suitable for this bad boy.
9383         (Struct::TypeAttr): ditto.
9384         Handle nested classes.
9385         (TypeContainer::) Remove all the type visiting code, it is now
9386         replaced with the rootcontext.cs code
9387
9388         * rootcontext.cs (GetClassBases): Added support for structs. 
9389
9390 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
9391
9392         * interface.cs, statement.cs, class.cs, parameter.cs,
9393         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
9394         Drop use of TypeRefs, and use strings instead.
9395
9396 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
9397
9398         * rootcontext.cs: 
9399
9400         * class.cs (Struct::Struct): set the SEALED flags after
9401         checking the modifiers.
9402         (TypeContainer::TypeAttr): new property, returns the
9403         TypeAttributes for a class.  
9404
9405         * cs-parser.jay (type_list): Oops, list production was creating a
9406         new list of base types.
9407
9408         * rootcontext.cs (StdLib): New property.
9409         (GetInterfaceTypeByName): returns an interface by type name, and
9410         encapsulates error handling here.
9411         (GetInterfaces): simplified.
9412         (ResolveTree): Encapsulated all the tree resolution here.
9413         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
9414         types. 
9415         
9416         * driver.cs: Add support for --nostdlib, to avoid loading the
9417         default assemblies.
9418         (Main): Do not put tree resolution here. 
9419
9420         * rootcontext.cs: Beginning of the class resolution.
9421
9422 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
9423
9424         * rootcontext.cs: Provide better error reporting. 
9425
9426         * cs-parser.jay (interface_base): set our $$ to be interfaces.
9427
9428         * rootcontext.cs (CreateInterface): Handle the case where there
9429         are no parent interfaces.
9430         
9431         (CloseTypes): Routine to flush types at the end.
9432         (CreateInterface): Track types.
9433         (GetInterfaces): Returns an array of Types from the list of
9434         defined interfaces.
9435
9436         * typemanager.c (AddUserType): Mechanism to track user types (puts
9437         the type on the global type hash, and allows us to close it at the
9438         end). 
9439         
9440 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
9441
9442         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
9443         RecordInterface instead.
9444
9445         * cs-parser.jay: Updated to reflect changes above.
9446
9447         * decl.cs (Definition): Keep track of the TypeBuilder type that
9448         represents this type here.  Not sure we will use it in the long
9449         run, but wont hurt for now.
9450
9451         * driver.cs: Smaller changes to accomodate the new code.
9452
9453         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
9454         when done. 
9455
9456         * rootcontext.cs (CreateInterface):  New method, used to create
9457         the System.TypeBuilder type for interfaces.
9458         (ResolveInterfaces): new entry point to resolve the interface
9459         hierarchy. 
9460         (CodeGen): Property, used to keep track of the code generator.
9461
9462 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
9463
9464         * cs-parser.jay: Add a second production for delegate_declaration
9465         with `VOID'.
9466
9467         (enum_body): Put an opt_comma here instead of putting it on
9468         enum_body or enum_member_declarations so we can handle trailing
9469         commas on enumeration members.  Gets rid of a shift/reduce.
9470         
9471         (type_list): Need a COMMA in the middle.
9472
9473         (indexer_declaration): Tell tokenizer to recognize get/set
9474
9475         * Remove old targets.
9476
9477         * Re-add the parser target.
9478
9479 2001-07-13  Simon Cozens <simon@simon-cozens.org>
9480
9481         * cs-parser.jay: Add precendence rules for a number of operators
9482         ot reduce the number of shift/reduce conflicts in the grammar.
9483         
9484 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
9485
9486         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
9487         and put it here.
9488
9489         Get rid of old crufty code.
9490
9491         * rootcontext.cs: Use this to keep track of the parsed
9492         representation and the defined types available to the program. 
9493
9494         * gen-treedump.cs: adjust for new convention.
9495
9496         * type.cs: Split out the type manager, and the assembly builder
9497         from here. 
9498
9499         * typemanager.cs: the type manager will live here now.
9500
9501         * cil-codegen.cs: And the code generator here. 
9502
9503 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
9504
9505         * makefile: Fixed up for easy making.
9506
9507 2001-07-13  Simon Cozens <simon@simon-cozens.org>
9508
9509         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
9510         the 
9511
9512         (unary_expression): Expand pre_increment_expression and
9513         post_decrement_expression to reduce a shift/reduce.
9514
9515 2001-07-11  Simon Cozens
9516
9517         * cs-tokenizer.cs: Hex numbers should begin with a 0.
9518
9519         Improve allow_keyword_as_indent name.
9520
9521 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
9522
9523         * Adjustments for Beta2. 
9524
9525 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
9526
9527         * decl.cs: Added `Define' abstract method.
9528         (InTransit): new property, used to catch recursive definitions. 
9529
9530         * interface.cs: Implement `Define'. 
9531
9532         * modifiers.cs: Map Modifiers.constants to
9533         System.Reflection.TypeAttribute flags.
9534
9535         * class.cs: Keep track of types and user-defined types.
9536         (BuilderInit): New method for creating an assembly
9537         (ResolveType): New function to launch the resolution process, only
9538         used by interfaces for now.
9539
9540         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
9541         that are inserted into the name space. 
9542
9543 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
9544
9545         * ARGH.  I have screwed up my tree so many times due to the use of
9546         rsync rather than using CVS.  Going to fix this at once. 
9547
9548         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
9549         load types.
9550
9551 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
9552
9553         * Experiment successful: Use System.Type rather that our own
9554         version of Type.  
9555
9556 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
9557
9558         * cs-parser.jay: Removed nsAliases from here.
9559
9560         Use new namespaces, handle `using XXX;' 
9561
9562         * namespace.cs: Reimplemented namespace handling, use a recursive
9563         definition of the class.  Now we can keep track of using clauses
9564         and catch invalid using clauses.
9565
9566 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
9567
9568         * gen-treedump.cs: Adapted for all the renaming.
9569
9570         * expression.cs (Expression): this class now has a Type property
9571         which returns an expression Type.
9572
9573         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
9574         `Type', as this has a different meaning now in the base
9575
9576 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
9577
9578         * interface.cs, class.cs: Removed from all the sources the
9579         references to signature computation, as we can not do method
9580         signature computation during the parsing time, as we are not
9581         trying to solve at that point distinguishing:
9582
9583         class X {
9584                 void a (Blah x) {}
9585                 void a (NS.Blah x) {}
9586         }
9587
9588         Which depending on the context might be valid or not, as we do not
9589         know if Blah is the same thing as NS.Blah at that point.
9590
9591         * Redid everything so the code uses TypeRefs now instead of
9592         Types.  TypeRefs are just temporary type placeholders, that need
9593         to be resolved.  They initially have a pointer to a string and the
9594         current scope in which they are used.  This is used later by the
9595         compiler to resolve the reference to an actual Type. 
9596
9597         * DeclSpace is no longer a CIR.Type, and neither are
9598         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
9599         are all DeclSpaces, but no Types. 
9600
9601         * type.cs (TypeRefManager): This implements the TypeRef manager,
9602         which keeps track of all the types that need to be resolved after
9603         the parsing has finished. 
9604
9605 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
9606
9607         * ARGH.  We are going to have to store `foreach' as a class rather
9608         than resolving it, as we need to verify error 1579 after name
9609         resolution.   *OR* we could keep a flag that says `This request to
9610         IEnumerator comes from a foreach statement' which we can then use
9611         to generate the error.
9612
9613 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
9614
9615         * class.cs (TypeContainer.AddMethod): we now add methods to the
9616         MethodGroup instead of the method hashtable.  
9617
9618         * expression.cs: Add MethodGroup abstraction, which gets us one
9619         step closer to the specification in the way we handle method
9620         declarations.  
9621
9622         * cs-parser.jay (primary_expression): qualified_identifier now
9623         tried to match up an identifier to a local variable reference or
9624         to a parameter reference.
9625
9626         current_local_parameters is now a parser global variable that
9627         points to the current parameters for the block, used during name
9628         lookup.
9629
9630         (property_declaration): Now creates an implicit `value' argument to
9631         the set accessor.
9632
9633 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
9634
9635         * parameter.cs: Do not use `param' arguments as part of the
9636         signature, per the spec.
9637
9638 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
9639
9640         * decl.cs: Base class for classes, structs and interfaces.  This
9641         is the "Declaration Space" 
9642
9643         * cs-parser.jay: Use CheckDef for checking declaration errors
9644         instead of having one on each function.
9645
9646         * class.cs: Factor out some code for handling error handling in
9647         accordance to the "Declarations" section in the "Basic Concepts"
9648         chapter in the ECMA C# spec.
9649
9650         * interface.cs: Make all interface member classes derive from
9651         InterfaceMemberBase.
9652
9653 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
9654
9655         * Many things: all interfaces are parsed and generated in
9656         gen-treedump.  Support for member variables, constructors,
9657         destructors, properties, constants is there.
9658
9659         Beginning of the IL backend, but very little done, just there for
9660         testing purposes. 
9661
9662 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
9663
9664         * cs-parser.jay: Fix labeled statement.
9665
9666         * cs-tokenizer.cs (escape): Escape " and ' always.
9667         ref_line, ref_name: keep track of the line/filename as instructed
9668         by #line by the compiler.
9669         Parse #line.
9670
9671 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
9672
9673         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
9674         to match the values in System.CodeDOM.
9675
9676         Divid renamed to Divide.
9677
9678         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
9679         statements. 
9680         (Statements.set): remove.
9681
9682         * System.CodeDOM/CodeCatchClause.cs: always have a valid
9683         statements. 
9684
9685         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
9686         falseStatements always have valid values. 
9687
9688         * cs-parser.jay: Use System.CodeDOM now.
9689