2008-03-27 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-03-27  Marek Safar  <marek.safar@gmail.com>
2
3         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
4         and not rely on broken IsEnum.
5
6 2008-03-27  Marek Safar  <marek.safar@gmail.com>
7
8         * nullable.cs: New file, extracted from generic.cs.
9         
10         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
11
12 2008-03-27  Marek Safar  <marek.safar@gmail.com>
13
14         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
15         predefined comparison operators and null literals.
16         
17         * report.cs: New warning ID.
18         
19 2008-03-25  Marek Safar  <marek.safar@gmail.com>
20
21         A fix for bug #370577
22         * lambda.cs: Check return type too.
23
24 2008-03-25  Marek Safar  <marek.safar@gmail.com>
25
26         A fix for bug #372846
27         * class.cs: Automatic properties can be declared as unsafe.
28
29 2008-03-20  Marek Safar  <marek.safar@gmail.com>
30
31         * location.cs: Use string based concatenation.
32         
33         * expression.cs: LiftedBinaryOperator is gmcs only.
34         
35 2008-03-20  Marek Safar  <marek.safar@gmail.com>
36
37         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
38         conversions rules and expression trees.
39
40 2008-03-19  Marek Safar  <marek.safar@gmail.com>
41
42         * delegate.cs: Use extension method source as delegate target.
43
44 2008-03-19  Marek Safar  <marek.safar@gmail.com>
45
46         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
47         binary operations to be purely based on binary operations and optimized
48         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
49         and other ET refactoring.
50         
51         * typemanager.cs: Fixed warning.
52         
53 2008-03-17  Marek Safar  <marek.safar@gmail.com>
54
55         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
56         
57         * symbolwriter.cs: Fixed.
58
59 2008-03-17  Marek Safar  <marek.safar@gmail.com>
60
61         * anonymous.cs, driver.cs: Reset anonymous types counters.
62
63 2008-03-17  Marek Safar  <marek.safar@gmail.com>
64
65         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
66         
67         * class.cs: Use fullname for all type member definitions.
68         
69 2008-02-19  Martin Baulig  <martin@ximian.com>
70
71         * class.cs
72         (IMethodData.EmitExtraSymbolInfo): New interface method.
73         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
74         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
75         interface method here as an empty public virtual method.
76
77         * anonymous.cs
78         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
79         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
80         CodeGen.SymbolWriter.SetRealMethodName().       
81
82 2008-02-18  Martin Baulig  <martin@ximian.com>
83
84         * anonymous.cs
85         (ScopeInfo.EmitType): Override this and emit debugging
86         information for captured variables.
87         (RootScopeInfo.EmitType): Override this and emit symbol
88         information for a captured `this'.
89
90 2008-02-15  Martin Baulig  <martin@ximian.com>
91
92         * iterators.cs: Emit debugging info.
93
94         * codegen.cs
95         (EmitContext.Flags): Add `OmitDebuggingInfo'.
96         (EmitContext.OmitDebuggingInfo): New public property.
97
98         * statement.cs
99         (While): Override Emit() and don't emit symbol info there; do it
100         inside DoEmit() instead.
101         (Block.Emit): Omit symbol information while emitting the scope
102         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
103         block logic.
104         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
105         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
106         .ctor to make `IsIterator' work.
107
108 2008-03-14  Martin Baulig  <martin@ximian.com>
109
110         * symbolwriter.cs: Added the new symbol writer function from the
111         debugger's `terrania' branch; temporarily enclose them inside
112         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
113         my vacations.
114
115 2008-03-14  Martin Baulig  <martin@ximian.com>
116
117         * symbolwriter.cs
118         (SymbolWriter): Make this a public static class.
119
120         * codegen.cs
121         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
122         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
123
124 2008-03-14  Marek Safar  <marek.safar@gmail.com>
125
126         A fix for bug #370577
127         * statement.cs, lambda.cs: Added extra limitations when dealing with void
128         return type.
129         
130 2008-03-14  Marek Safar  <marek.safar@gmail.com>
131
132         * typemanager.cs (CSharpName): Made 250 times faster.
133
134 2008-03-13  Marek Safar  <marek.safar@gmail.com>
135
136         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
137         
138 2008-03-12  Marek Safar  <marek.safar@gmail.com>
139
140         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
141         crash when predefined field does not exist.
142         
143 2008-03-12  Marek Safar  <marek.safar@gmail.com>
144
145         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
146         
147 2008-03-12  Marek Safar  <marek.safar@gmail.com>
148
149         * class.cs (FixedField): Don't crash when contructors are missing.
150
151 2008-03-11  Marek Safar  <marek.safar@gmail.com>
152
153         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
154         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
155         check internal types accessibility for internal and external types.
156         Replaced EnumToUnderlying by GetEnumUnderlyingType.
157
158 2008-03-11  Marek Safar  <marek.safar@gmail.com>
159
160         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
161         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
162         attribute.cs, statement: Use corect instance of predefined types (work
163         related to #364674).
164
165 2008-03-07  Marek Safar  <marek.safar@gmail.com>
166
167         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
168         
169 2008-03-07  Marek Safar  <marek.safar@gmail.com>
170
171         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
172         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
173         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
174         predefined types clean up, delayed predefined types members initialization
175         (work related to #364674).
176
177 2008-03-05  Marek Safar  <marek.safar@gmail.com>
178
179         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
180         
181 2008-03-05  Marek Safar  <marek.safar@gmail.com>
182
183         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
184         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
185         predefined types clean up (work related to #364674).
186
187 2008-03-04  Marek Safar  <marek.safar@gmail.com>
188
189         * ecore.cs: Print an error message instead of throwing exception.
190         
191 2008-03-04  Marek Safar  <marek.safar@gmail.com>
192
193         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
194         expression.cs, statement.cs: Unififed null literal representation.
195
196 2008-03-03  Marek Safar  <marek.safar@gmail.com>
197
198         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
199         expression.cs: Refactored binary operators resolve phase and improved speed.
200         The nullable code is still missing and won't work correctly, more fixes
201         required.
202
203         It also fixes #323726, #324312, #324248, and many other unreported issues.
204
205 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
206
207         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
208         instead of 'gmcs'.
209
210 2008-02-27  Marek Safar  <marek.safar@gmail.com>
211
212         * ecore.cs: Clean-up and split BetterConversion.
213         
214 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
215
216         Fix #363791
217         * enum.cs (EnumMember.Value): Only access 'value' if
218         ResolveValue says it's ok.
219         (EnumMember.DoResolveValue): Don't set prev_member.value.
220         (Enum.GetDefinition): Reverse arguments of Equals --
221         EnumMember.Value can return 'null'.
222
223         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
224
225 2008-02-22  Marek Safar  <marek.safar@gmail.com>
226
227         * generic.cs, expression.cs: More ongoing work on expression trees.
228         
229 2008-02-21  Marek Safar  <marek.safar@gmail.com>
230
231         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
232         handle missing matches when mutiple operators exist.
233         
234 2008-02-20  Marek Safar  <marek.safar@gmail.com>
235
236         A fix for bug #363218
237         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
238         initializers.
239         
240 2008-02-20  Marek Safar  <marek.safar@gmail.com>
241
242         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
243         update. This time to deal correctly with SideEffectConstant expression used
244         as an argument for another constant folding.
245
246 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
247
248         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
249         MethodBuilder.
250
251 2008-02-19  Marek Safar  <marek.safar@gmail.com>
252
253         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
254
255 2008-02-19  Marek Safar  <marek.safar@gmail.com>
256
257         A fix for bug #328136
258         * expression.cs: Do not fold immediately LogicalAnd operators when the left
259         side is a false constant, because we still need to evaluate the right-hand
260         side.
261
262         * statement.cs (If): Emit two types of boolean constants (simple constant,
263         side-effect constant).
264
265 2008-02-19  Marek Safar  <marek.safar@gmail.com>
266
267         * constant.cs (SideEffectConstant): Don't emit boolean constant.
268
269         * expression.cs: Fold immediately LogicalAnd operators when both sides are
270         constants.
271
272 2008-02-18  Marek Safar  <marek.safar@gmail.com>
273
274         A fix for bug #361457
275         * ecore.cs (IsApplicable): Params methods have lower priority.
276
277         * support.cs: Return correct parameter modifier for params types.
278
279 2008-02-18  Marek Safar  <marek.safar@gmail.com>
280
281         * generic.cs (TypeParameter): Cache attribute target name.
282
283         * support.cs: Removed unused variable.
284
285         * typemanager.cs: Removed debugging leftover.
286
287         * ecore.cs: Use local type instead of a property;
288
289         * class.cs (VerifyMembers): Consider also parent to test whether type member
290         is local or public.
291
292         * expression.cs (FullMethodDesc): Removed.
293
294         * attribute.cs (IsValidArgumentType): Made static.
295
296 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
297
298         Cleanup to be more readable.
299         * Makefile (GMCS_PROFILE): Remove.
300         (COMPILER_NAME): New helper.
301
302 2008-02-15  Miguel de Icaza  <miguel@novell.com>
303
304         * cs-tokenizer.cs: if a conditional expression happens inside a
305         (...) this also means that we do not need to de-ambiguate between
306         an parenthesized expression and a cast.
307
308         Fixes 346484.
309
310         * constant.cs (SideEffectConstant): a constant value that happens
311         to have a side effect.
312
313         Fixes the build regressions introduced by the fix for #359789
314
315 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
316
317         * expression.cs (Conditional.Emit): when emitting the ternary
318         operator, use local variables to generate code verifiable code.
319
320         The verifier cannot infer that the type on stack before the
321         stloc.0 is executed is of type ParentB. This happens because the
322         stack merge algorithm uses only parent types when deciding which
323         is the common type.  This is described in Part III 1.8.1.3 of ECMA
324         335.
325
326         This code compiled with mcs is not verifiable under MS. The MS
327         verifier picks the first common interface of Foo and Bar, which is
328         wrong, but doesn't use a full join type of the 2 interfaces.
329
330         CSC uses a clever hack to compile such code in a verifiable
331         way. It stores the intermediate values in a local variable with
332         the expected type.
333
334         Fixes: #358102
335
336 2008-02-14  Miguel de Icaza  <miguel@novell.com>
337
338         * expression.cs: Do not fold BitwiseAnd operators when the left
339         side is a false constant, because we still need to evaluate the
340         right-hand side.
341
342         Fixes #359789
343
344         * support.cs: Instead of throwing an InternalErrorException when
345         the position of the stream is outside the boundary of our buffer,
346         reset the state of the reader, and restart the reading from the
347         beginning of the file.
348
349 2008-02-14  Marek Safar  <marek.safar@gmail.com>
350
351         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
352
353 2008-02-14  Marek Safar  <marek.safar@gmail.com>
354
355         A fix for bug #361686
356         * decl.cs: A protected types used inside a private class which parents
357         derives from the protected class are accessible.
358
359 2008-02-13  Marek Safar  <marek.safar@gmail.com>
360
361         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
362         the parameterless constructor.
363
364 2008-02-13  Marek Safar  <marek.safar@gmail.com>
365
366         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
367         lookup methods to use standard member cache when doing member lookup.
368
369 2008-02-12  Marek Safar  <marek.safar@gmail.com>
370
371         * driver.cs: Don't report full path for referenced module as assembly error.
372
373 2008-02-12  Marek Safar  <marek.safar@gmail.com>
374
375         * Makefile: Fixed `qh' target to work on all machines.
376
377         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
378         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
379         and HasElementType with TypeManager implementation.
380
381 2008-02-08  Marek Safar  <marek.safar@gmail.com>
382
383         A fix for bugs #325134, #359749
384         * expression.cs, ecore.cs: Try to resolve an extension method even if the
385         first binds point to non-method member expression.
386
387 2008-02-08  Marek Safar  <marek.safar@gmail.com>
388
389         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
390
391 2008-02-08  Marek Safar  <marek.safar@gmail.com>
392
393         A fix for bugs #321394, #323028
394         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
395         Reworked naive IsAccessibleAs implementation to handle nested types.
396
397 2008-02-05  Jb Evain  <jbevain@novell.com>
398
399         * class.cs: use generic type comparison for parameters
400         as well.
401
402 2008-02-05  Marek Safar  <marek.safar@gmail.com>
403
404         A fix for bug #325372
405         * class.cs: Use generic type comparison when testing method signatures.
406
407 2008-02-05  Marek Safar  <marek.safar@gmail.com>
408
409         A fix for bug #357047
410         * ecore.cs: Applied C# 3.0 changes to better conversion.
411
412 2008-02-05  Marek Safar  <marek.safar@gmail.com>
413
414         A fix for bug #358374
415         * cs-parser.jay: Correctly set modifiers for all constructor types.
416
417 2008-02-04  Marek Safar  <marek.safar@gmail.com>
418
419         A fix for bug #355251
420         * generic.cs: Added base class constraint based type inference.
421
422 2008-02-01  Marek Safar  <marek.safar@gmail.com>
423
424         A fix for bug #357255
425         * decl.cs: One more missing visibility check.
426
427 2008-02-01  Marek Safar  <marek.safar@gmail.com>
428
429         * support.cs: Fixed broken return.
430
431 2008-01-25  Marek Safar  <marek.safar@gmail.com>
432
433         * report.cs: Correctly reset warnings count after probing.
434
435 2008-01-25  Martin Baulig  <martin@ximian.com>
436
437         * namespace.cs
438         (NamespaceEntry.SymbolFileID): Make this work again after
439         MemberName.ToString() is gone.
440
441 2008-01-25  Marek Safar  <marek.safar@gmail.com>
442
443         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
444         expressions.
445
446 2008-01-25  Marek Safar  <marek.safar@gmail.com>
447
448         * generic.cs: Use full implicit conversion for type inference fixing.
449
450 2008-01-24  Marek Safar  <marek.safar@gmail.com>
451
452         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
453         Fixed user operator conversions.
454
455 2008-01-24  Marek Safar  <marek.safar@gmail.com>
456
457         * generic.cs: Do nullable type to null comparison optimization during
458         resolve phase.
459
460 2008-01-24  Marek Safar  <marek.safar@gmail.com>
461
462         A fix for bug #355163
463         * generic.cs: Enabled l-value resolve on nullable expressions.
464
465 2008-01-24  Marek Safar  <marek.safar@gmail.com>
466
467         A fix for bug #353986
468         * class.cs: Ingore static ctors with parameters for any further checks.
469
470 2008-01-24  Marek Safar  <marek.safar@gmail.com>
471
472         A fix for bug #354310
473         * namespace.cs: Removed redundant check.
474
475 2008-01-24  Marek Safar  <marek.safar@gmail.com>
476
477         A fix for bug #354928
478         * expression.cs: ElementInitializers can be resolved only once.
479
480 2008-01-24  Marek Safar  <marek.safar@gmail.com>
481
482         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
483         Condition expressions.
484
485 2008-01-23  Marek Safar  <marek.safar@gmail.com>
486
487         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
488
489 2008-01-22  Marek Safar  <marek.safar@gmail.com>
490
491         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
492         not allowed.
493
494         * generic.cs: Implemented coalesce expression.
495
496 2008-01-22  Marek Safar  <marek.safar@gmail.com>
497
498         A fix for bug #355145
499         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
500         expression tree type inference.
501
502 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
503
504         Fix #354663
505         * expression.cs (Binary.IsUnsignedType): Fix typo.
506
507 2008-01-22  Marek Safar  <marek.safar@gmail.com>
508
509         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
510
511 2008-01-22  Marek Safar  <marek.safar@gmail.com>
512
513         A fix for bug #355161
514         * ecore.cs, expression.cs: Wider range of extension method supported
515         expressions.
516
517 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
518
519         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
520         AssemblyBuilder to operate in compiler context. Fixes mcs part of
521         bug #354970.
522
523 2008-01-22  Marek Safar  <marek.safar@gmail.com>
524
525         A fix for bug #355148
526         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
527
528 2008-01-22  Miguel de Icaza  <miguel@novell.com>
529
530         * expression.cs (CreateExpressionTree): Add support for or and
531         logical or, and indent following the coding conventions.
532
533         * typemanager.cs (LinqExpression): renamed from
534         ExpressionTreeManager, for a shorter name.
535
536         Use TypeManager.CoreLookupType to lookup types from our core
537         assemblies and turn those into "Type" variables.
538
539         Consumers that previously used "Namespace" and "Type" from this
540         class should instead use the TypeExpression which is a type that
541         is fully resolved (without involving the regular C# resolution
542         rules). 
543
544         This typically looks like this:
545
546         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
547         new MemberAccess (texpr, name, type_arguments, loc)
548
549         This avoids the problem in: #355178
550
551 2008-01-21  Marek Safar  <marek.safar@gmail.com>
552
553         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
554         feature in parser only as we do in other cases.
555         
556 2008-01-21  Marek Safar  <marek.safar@gmail.com>
557
558         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
559         typemanager.cs: A refactoring of params arguments to reuse existing
560         expressions (params -> array initializer) to emit params argument instead
561         of specialized handling.
562         It was required by expression tree implementation and it has other benefits
563         as well, we now apply same optimization for params arguments as we do for
564         array initializers.
565         
566 2008-01-18  Marek Safar  <marek.safar@gmail.com>
567
568         A fix for bug #353526
569         * generic.cs: A type inference of params arguments may not required any
570         temporary array creation.
571         
572 2008-01-18  Marek Safar  <marek.safar@gmail.com>
573
574         A fix for bug #353534
575         * generic.cs, ecore.cs, expression.cs: A method group type inference is
576         supported for delegates only.
577         
578 2008-01-18  Marek Safar  <marek.safar@gmail.com>
579
580         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
581         type for more than 1 candidates.
582         
583 2008-01-18  Marek Safar  <marek.safar@gmail.com>
584
585         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
586         expressions.
587         
588 2008-01-16  Marek Safar  <marek.safar@gmail.com>
589
590         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
591         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
592         operator) expressions. 
593                 
594 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
595
596         * statement.cs: Avoid declaring an IL variable for this_variable since it is
597         not accessed from the generated IL.
598
599 2008-01-14  Marek Safar  <marek.safar@gmail.com>
600
601         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
602         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
603         statement.cs: The first expression tree implementation drop, mostly
604         infrastructure work.
605
606 2008-01-14  Marek Safar  <marek.safar@gmail.com>
607
608         * ecore.cs (IsNestedChild): Refactored.
609
610 2008-01-11  Marek Safar  <marek.safar@gmail.com>
611
612         * lambda.cs: Don't use a cast on unknown expression statement.
613
614 2008-01-10  Geoff Norton  <gnorton@novell.com>
615
616         * cs-tokenizer.cs: One more token to distinguish between method and lambda
617         arguments
618
619 2008-01-09  Marek Safar  <marek.safar@gmail.com>
620
621         * doc.cs: Report better /doc crash details.
622         
623 2008-01-09  Marek Safar  <marek.safar@gmail.com>
624
625         A fix for bug #352536
626         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
627
628 2008-01-08  Marek Safar  <marek.safar@gmail.com>
629
630         A fix for bug #352287
631         * ecore.cs, expression.cs: Do `this' access checking in all member access
632         expressions.
633         
634 2008-01-08  Marek Safar  <marek.safar@gmail.com>
635
636         * rootcontext.cs, driver.cs: Switch to linq mode by default.
637         
638         * report.cs: Reset message stacks.
639         
640 2008-01-08  Marek Safar  <marek.safar@gmail.com>
641
642         * generic.cs (InferInPhases): Correctly calculate params position.
643         
644 2008-01-08  Marek Safar  <marek.safar@gmail.com>
645
646         * cs-tokenizer.cs: No need to parse full string when parsing lambda
647         arguments.
648
649 2008-01-07  Marek Safar  <marek.safar@gmail.com>
650
651         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
652         
653         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
654         
655         * driver.cs: Updated --help option.
656         
657 2008-01-07  Marek Safar  <marek.safar@gmail.com>
658
659         * generic.cs (InferParamsTypeArguments): Removed.
660         (InferInPhases): Add params type inference.
661         (LowerBoundInference): Fixed scoring mechanism.
662         
663         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
664         
665 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
666
667         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
668         byte array for unsigned "baked" assemblies.
669
670 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
671
672         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
673         array for assemblies that are not strongnamed.
674
675 2008-01-04  Marek Safar  <marek.safar@gmail.com>
676
677         A fix for bug #351481
678         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
679         declaring type for nested generic types.
680         
681 2008-01-04  Marek Safar  <marek.safar@gmail.com>
682
683         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
684         instead of ToString.
685         
686 2008-01-03  Marek Safar  <marek.safar@gmail.com>
687
688         A fix for bug #351047
689         * expression.cs (Binary.ResolveOperator): Allow equality operators between
690         null and structs only when equality and inequality operators are defined
691         either as an user-operators or predefined operators.
692         
693 2008-01-03  Marek Safar  <marek.safar@gmail.com>
694
695         A fix for bug #351047
696         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
697         
698 2008-01-03  Marek Safar  <marek.safar@gmail.com>
699
700         A fix for bug #351257
701         * cs-tokenizer.cs: Advance line number for '\r' correctly.
702         
703 2008-01-03  Marek Safar  <marek.safar@gmail.com>
704
705         A fix for bug #351157
706         * class.cs (Using): Fixed yet another broken cloning.
707         
708         (Block): Put back more sensible default value for statements.
709         
710 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
711
712         * codegen.cs: Allow AssemblyVersion with only major version component.
713         Fixes bug #351055.
714
715 2007-12-29  Marek Safar  <marek.safar@gmail.com>
716
717         A fix for bug #324654
718         * class.cs: Use FullName property as member name.
719
720 2007-12-28  Marek Safar  <marek.safar@gmail.com>
721
722         A fix for bug #342117
723         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
724         constructor constraint.
725
726 2007-12-28  Marek Safar  <marek.safar@gmail.com>
727
728         A fix for bug #338273
729         * class.cs (ProbertyBase): Access modifier checks are required for overrides
730         only.
731
732 2007-12-28  Marek Safar  <marek.safar@gmail.com>
733
734         A fix for bug #350839
735         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
736
737 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
738
739         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
740         GHOP:
741         
742         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
743
744         * statement.cs: Changed some Hashtables to use HybridDictionaries
745         instead. It was observed that some HashTables only contained a few
746         items in the vast majority of cases. Since HybridDictionary is
747         more efficient on small sets (<10 elements), "known_variables"
748         from class ExplicitBlock as well as "labels" and "constants " from
749         class Block were changed to HybridDictionaries. 
750
751         Atsai results: (56216kb->54987kb)
752
753         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
754
755
756 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
757
758         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
759         GHOP:
760         
761         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
762         
763         * expression.cs: foreach loop to for loop, saved on allocation of
764         enumerator (59333kb->59141kb)
765
766         * statement.cs. Changed foreach loops to for loops, saved on
767         allocation of enumerator (59141kb->59006kb)
768
769         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
770         when constructed with no specified capacity. This was causing a
771         few ArrayLists to allocate more memory than they would potentially
772         need in the Block class and MemberCache class. Setting the
773         ArrayLists to construct with a capacity of 1 saves some
774         memory. (56216kb->55585kb)
775
776 2007-12-27  Marek Safar  <marek.safar@gmail.com>
777
778         A fix for bug #347189 (2nd issue)
779         * expression.cs (MemberAccess): Nested type can be found in base non-generic
780         type.
781
782 2007-12-27  Miguel de Icaza  <miguel@novell.com>
783         
784         * report.cs: Do not use colors if stdout and stderr are not a
785         terminal.
786
787 2007-12-27  Marek Safar  <marek.safar@gmail.com>
788
789         A fix for bug #346998
790         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
791         overloads.
792
793 2007-12-27  Marek Safar  <marek.safar@gmail.com>
794
795         A fix for bug #343465
796         * class.cs: Explicit method name for nested types uses dots only.
797
798 2007-12-27  Marek Safar  <marek.safar@gmail.com>
799
800         A fix for bug #343707
801         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
802
803 2007-12-27  Marek Safar  <marek.safar@gmail.com>
804
805         * ecore.cs: Report type inference errors only when arguments count matches
806         parameter count.
807         
808         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
809         
810         * expression.cs, report.cs: New warning.
811         
812         * typemanager.cs: Catch anonymous method type too.
813
814 2007-12-23  Marek Safar  <marek.safar@gmail.com>
815
816         A fix for bug #346379
817         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
818
819 2007-12-23  Marek Safar  <marek.safar@gmail.com>
820
821         A fix for bug #347359
822         * expression.cs (Invocation): Don't resolve already resolved expression.
823
824 2007-12-23  Marek Safar  <marek.safar@gmail.com>
825
826         A fix for bug #347189
827         * class.cs (FixedField): Use non-dependent code only in the define phase.
828
829 2007-12-23  Marek Safar  <marek.safar@gmail.com>
830
831         A fix for bug #348076
832         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
833
834 2007-12-22  Marek Safar  <marek.safar@gmail.com>
835
836         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
837         discovered extension methods.
838
839 2007-12-22  Marek Safar  <marek.safar@gmail.com>
840
841         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
842         method.
843
844 2007-12-21  Miguel de Icaza  <miguel@novell.com>
845
846         * report.cs (ErrorMessage): Add support for using colors on
847         terminals that support it. 
848
849 2007-12-21  Marek Safar  <marek.safar@gmail.com>
850
851         * ecore.cs: Use information about expanded params for error reporting.
852
853 2007-12-21  Marek Safar  <marek.safar@gmail.com>
854
855         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
856         and logic for params overloads.
857         
858 2007-12-15  Miguel de Icaza  <miguel@novell.com>
859
860         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
861         as this is also created from the parser.  Fixes #349034
862
863 2007-12-12  Miguel de Icaza  <miguel@novell.com>
864
865         * statement.cs (Throw.CloneTo): it is valid to have empty
866         expressions for throw. 
867
868 2007-12-03  Marek Safar  <marek.safar@gmail.com>
869
870         * cs-parser.jay: Set delegate constraint parsing region correctly.
871
872 2007-12-03  Marek Safar  <marek.safar@gmail.com>
873
874         A fix for bug #345467
875         * typemanager.cs (IsEqual): Compare generic parameters position only.
876         
877 2007-11-28  Marek Safar  <marek.safar@gmail.com>
878
879         * expression.cs (BaseAccess): Type arguments can be null.
880
881 2007-11-27  Raja R Harinath  <harinath@gmail.com>
882
883         * statement.cs (Block.Resolve): Ensure flow-branching tree is
884         consistent even when an error has occured.
885         (Switch.Resolve): Likewise.
886
887 2007-11-22  Marek Safar  <marek.safar@gmail.com>
888
889         A fix for bug #334505
890         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
891         overrides.
892         
893 2007-11-22  Marek Safar  <marek.safar@gmail.com>
894
895         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
896         refactorings required to resolve extension methods correctly when mixing
897         generics and non-generics members.
898         
899 2007-11-20  Marek Safar  <marek.safar@gmail.com>
900
901         A fix for bug #342584
902         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
903         conversion.
904         
905 2007-11-19  Marek Safar  <marek.safar@gmail.com>
906
907         A fix for bug #342512
908         * delegate.cs: Use delegate argument expression when is available. Don't
909         emit virtual call when class is sealed.
910         
911 2007-11-16  Marek Safar  <marek.safar@gmail.com>
912
913         A fix for bug #325423
914         * assign.cs (FieldInitializer): Use resolved expression for emit.
915         
916         * class.cs: Print less confusing error message.
917         
918 2007-11-16  Marek Safar  <marek.safar@gmail.com>
919
920         * cs-tokenizer.cs: Removed GMCS ifdefs.
921         
922         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
923         mcs.
924         
925         * cs-parser.jay: Disabled nullable check.
926         
927         * generic-mcs: Copied more generic stuff.
928                 
929 2007-11-16  Marek Safar  <marek.safar@gmail.com>
930
931         * gcs-parser.jay: Merged to cs-parser.jay.
932         
933         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
934         * *.csproj, *.sources: Updated to use only jay parser file.
935
936 2007-11-16  Marek Safar  <marek.safar@gmail.com>
937
938         * gcs-parser.jay: Added nullable and default expression feature checks.
939         
940 2007-11-16  Marek Safar  <marek.safar@gmail.com>
941
942         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
943         it fixes many TODOs and hidden bugs.
944         
945         * expression: Removed duplicate error check.
946
947 2007-11-15  Marek Safar  <marek.safar@gmail.com>
948
949         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
950         implicitly type local variable only when it is used in a declaration.
951
952 2007-11-15  Marek Safar  <marek.safar@gmail.com>
953
954         * attribute.cs: Use CS0612 for empty strings.
955
956 2007-11-14  Marek Safar  <marek.safar@gmail.com>
957
958         * lambda.cs, statement.cs: Contextual return may act as a statement.
959
960 2007-11-14  Marek Safar  <marek.safar@gmail.com>
961
962         A fix for a regression cause by #324222
963         * class.cs: Don't report unused even when it implements an interface.
964         
965 2007-11-13  Marek Safar  <marek.safar@gmail.com>
966
967         A fix for bug #341205
968         * ecore.cs, expression.cs: Method group expression cannot do static
969         method access with an instance reference check before overloading takes
970         a place.
971         
972 2007-11-13  Marek Safar  <marek.safar@gmail.com>
973
974         A fix for bug #325359
975         * class.cs: Use predictable name for automatically generated property.
976         
977 2007-11-12  Marek Safar  <marek.safar@gmail.com>
978
979         A fix for bug #324996
980         * expression.cs (Is): Handle case where D is nullable and T is not
981         correctly.
982         
983         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
984         
985 2007-11-12  Marek Safar  <marek.safar@gmail.com>
986
987         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
988         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
989         Flush small error reporting changes.
990         
991 2007-11-09  Marek Safar  <marek.safar@gmail.com>
992
993         A fix for bug #324996
994         * expression.cs: Rewrote Is expression implementation to work with
995         generics, nullable types, anonymous method. A const result expression 
996         uses existing infrastructure instead of custom not fully-featured one.
997         
998 2007-11-08  Marek Safar  <marek.safar@gmail.com>
999
1000         A fix for bug #340202
1001         * class.cs: Consider generics for volatile field.
1002
1003 2007-11-08  Marek Safar  <marek.safar@gmail.com>
1004
1005         A fix for bug #335594
1006         * expression.cs: Use conversion rules when handling string addition.
1007         
1008 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1009
1010         A fix for bug #336651
1011         * expression.cs: Fixed a crash when probing is on.
1012         
1013 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1014
1015         A fix for bug #324242
1016         * covert.cs: Added a conversion from any nullable-type with an 
1017         underlying enum-type to the type System.Enum.
1018         
1019 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1020
1021         A fix for bug #324222
1022         * class.cs: Report all non-used event fields.
1023         
1024 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1025
1026         A fix for bug #325161
1027         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
1028         qualifier for generic types.
1029         
1030 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1031
1032         A fix for bug #322971
1033         * expression.cs, ecore.cs: Added intermediate result value check for
1034         indexers. 
1035         
1036 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1037
1038         A fix for bug #324754
1039         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
1040         when it was requested.
1041
1042 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1043
1044         A fix for bug #325101
1045         * expression.cs: Do type not value comparison for `is' expression.
1046
1047 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1048
1049         A fix for bug #320236
1050         * convert.cs: Don't apply user conversion on underlying target type.
1051
1052 2007-11-06  Marek Safar  <marek.safar@gmail.com>
1053
1054         * expression.cs: Don't use unresolved expression for error reporting.
1055  
1056 2007-11-06  Marek Safar  <marek.safar@gmail.com>
1057
1058         A fix for bugs #337712, #324490
1059         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
1060         overloading resolution too.
1061         
1062         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
1063         the process consistent and more robust.
1064         
1065         * expression.cs, linq.cs, report.cs: Update.
1066
1067 2007-11-02  Marek Safar  <marek.safar@gmail.com>
1068
1069         A fix for bug #332909
1070         * attribute.cs: Resolve attributes in correct context using error
1071         handling procedure.
1072         
1073         * rootcontext.cs: Define Obsolete attribute members as core members.
1074         
1075 2007-11-02  Marek Safar  <marek.safar@gmail.com>
1076
1077         * statement.cs: Removed unused methods.
1078         
1079 2007-10-31  Wade Berrier  <wberrier@novell.com>
1080
1081         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
1082         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
1083         during 'make dist')
1084
1085 2007-10-31  Marek Safar  <marek.safar@gmail.com>
1086
1087         A fix for bug #338102
1088         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
1089         methods registered as non-generics.
1090         
1091 2007-10-31  Marek Safar  <marek.safar@gmail.com>
1092
1093         A fix for bugs #337712, #324490
1094         * delegate.cs: Delegate covariance and contravariance is not allowed for
1095         value types.
1096         
1097 2007-10-31  Marek Safar  <marek.safar@gmail.com>
1098
1099         A fix for bug #337719 
1100         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
1101         `from' keyword.
1102         
1103 2007-10-30  Marek Safar  <marek.safar@gmail.com>
1104  
1105         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
1106
1107 2007-10-29  Marek Safar  <marek.safar@gmail.com>
1108  
1109         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
1110         query expressions.
1111
1112 2007-10-29  Raja R Harinath  <rharinath@novell.com>
1113
1114         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
1115
1116 2007-10-29  Marek Safar  <marek.safar@gmail.com>
1117  
1118         A fix for bug #334652
1119         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
1120         extension methods when we have not found the best candidate in normal
1121         container.
1122
1123 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1124
1125         * AssemblyInfo.cs: Keep up-to-date.
1126
1127 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1128
1129         * Makefile: Fixed generics compiler name.
1130         
1131 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1132
1133         * lambda.test: removed, lambda parsing is done differently.
1134         
1135         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
1136
1137 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
1138
1139         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
1140
1141 2007-10-27  Marek Safar  <marek.safar@gmail.com>
1142
1143         * Makefile, *.sources : All C# compilers are in mcs folder.
1144         
1145         * *.cs: Use existing 2_1 define for smcs.
1146
1147 2007-10-26  Marek Safar  <marek.safar@gmail.com>
1148
1149         A fix for bug #335847
1150         * assign.cs, expression.cs: Couple of changes to avoid creating a
1151         temporary variable for each object initializer assignment statement. It
1152         simplifies struct initialization too, otherwise two temporary variables
1153         would be required.
1154         Implemented optimization of redundant default element initializers.
1155         
1156 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1157
1158         A fix for bug #336766
1159         * expression.cs (Class.CheckBase): Use generic name when method is
1160         generic.
1161         
1162 2007-10-25  Marek Safar  <marek.safar@gmail.com>
1163
1164         A fix for bug #334737
1165         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
1166         variable and not variable argument for prepared copies.
1167
1168 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1169
1170         A fix for bug #325110
1171         * class.cs, expression.cs, attribute.cs: Use open generic method when
1172         checking conditional attribute.
1173         
1174 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1175
1176         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
1177         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
1178         FeatureIsNotAvailable.
1179
1180 2007-10-24  Marek Safar  <marek.safar@gmail.com>
1181
1182         ** C# 3.0 Partial methods
1183         
1184         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
1185         methods support. Because of member cache issue with generics only
1186         non-generics partial methods are fully supported.
1187         
1188 2007-10-23  Marek Safar  <marek.safar@gmail.com>
1189         
1190         * class.cs, decl.cs: Rewrote member overloads check to cope with 
1191         generics and to use member cache for member checking. It also improves
1192         performance and fixes remaining overloads issues.
1193         
1194 2007-10-20  Marek Safar  <marek.safar@gmail.com>
1195         
1196         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
1197         roottypes.cs, typemanager.cs:
1198                 
1199         A member cache creation logic changed to add members immediately and
1200         not rely on fallback. The member cache is now only prefered way
1201         how to access and find type declaration members. It saves 5 MB of memory
1202         during MWF compilation and makes code ready for more optimizations and
1203         clean-ups, it's also a pre-requirement for partial methods.
1204         
1205 2007-10-18  Raja R Harinath  <harinath@gmail.com>
1206
1207         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
1208         handling for generic parameters.
1209
1210 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1211         
1212         * class.cs (FixedField): Removed redundant volatile check.
1213         
1214 2007-10-15  Marek Safar  <marek.safar@gmail.com>
1215         
1216         * class.cs, decl.cs: Fixed overload members verification to do only one
1217         check per possible collision.
1218         
1219 2007-10-13  Marek Safar  <marek.safar@gmail.com>
1220         
1221         A fix for bug #325478
1222         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
1223         and create only one disposable flags container.
1224         
1225 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1226         
1227         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
1228         * statement.cs (Fixed): Fixed variables cloning.
1229         
1230 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1231         
1232         A fix for bug #333342
1233         * class.cs (EventField): Don't mark value type event as synchronized. 
1234         
1235 2007-10-12  Marek Safar  <marek.safar@gmail.com>
1236         
1237         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
1238         inference to identify best candidate method correctly.
1239         (ProperyExpr): A range variable is read only and cannot be modified.
1240         
1241 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1242         
1243         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
1244         logic to identify best candidate method correctly.
1245         
1246 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1247         
1248         * location.cs (Equals, GetHashCode): Removed.
1249         
1250 2007-10-11  Marek Safar  <marek.safar@gmail.com>
1251         
1252         * report.cs: Implemented message recorder. It is used mainly for lambda
1253         expressions to capture otherwise swallowed error messages.
1254         
1255         * anonymous.cs, lambda.cs.cs: Do full parameters check.
1256
1257         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
1258         and not at the top.
1259         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
1260                 
1261         * expression.cs (MemberAccess): Always report lookup failure.
1262         
1263         * location.cs: Implemented Equals, GetHashCode.
1264         
1265         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
1266         
1267 2007-10-10  Jb Evain  <jbevain@novell.com>
1268
1269         * codegen.cs: re-enable assembly version check.
1270
1271 2007-10-09  Marek Safar  <marek.safar@gmail.com>
1272         
1273         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
1274         checks.
1275         
1276         * namespace.cs (UsingAlias): Do correct version check.
1277         
1278 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1279         
1280         * expresison.cs, ecore.cs: Issue extension method error message when
1281         appropriate.
1282         
1283         * rootcontext.cs: Added ISO_2 compiler mode option.
1284
1285 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1286         
1287         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
1288          message.
1289         
1290 2007-10-08  Marek Safar  <marek.safar@gmail.com>
1291         
1292         * attribute.cs (GetString, GetBoolean): Work with both literal and
1293         constant.
1294         
1295         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
1296         Moved method overload specific methods to MethodGroupExpr.
1297         
1298         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
1299         it should be less memory consuming.
1300         
1301 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
1302
1303         * codegen.cs: remove the assembly version check until the buildbot is
1304         fixed.
1305
1306 2007-10-07  Jb Evain  <jbevain@novell.com>
1307
1308         * attribute.cs (Attribute.GetString): if the value
1309         expression is a StringConstant, return its string value.
1310
1311 2007-10-07  Jb Evain  <jbevain@novell.com>
1312
1313         * typemanager.cs: add `assembly_version_attribute_type`.
1314         * codegen.cs: on attribute emission, check that the
1315         AssemblyVersionAttribute doesn't overflow.
1316
1317 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1318         
1319         A fix for bug #324677
1320         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
1321         parent container of a scope container with currently resolved one. 
1322         
1323 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1324         
1325         A fix for bug #325534
1326         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
1327         only.
1328         
1329 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1330         
1331         A fix for bug #327504
1332         * class.cs (Operator.Define): Refactored implicit and explicit user
1333         operator conversion rules.
1334         
1335 2007-10-05  Marek Safar  <marek.safar@gmail.com>
1336         
1337         A fix for bug #327520
1338         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
1339         
1340 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1341         
1342         A fix for bug #328022
1343         * class.cs (MethodData.Define): Use correct method to check whether
1344         a method implementents an accessor.
1345         
1346 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1347         
1348         A fix for bug #330069
1349         * statement.cs (Fixed.Resolve): Read the first array element only when
1350         an array is instantiated. 
1351         
1352 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1353         
1354         * expression.cs, assign.cs, generics.cs: Print correct operator when
1355         compound assignment is used.
1356         
1357 2007-10-04  Marek Safar  <marek.safar@gmail.com>
1358         
1359         A fix for bug #325841
1360         * expression.cs (ArrayAccess): Use full argument cloning only for
1361         string compound concatenation.
1362         
1363 2007-10-03  Marek Safar  <marek.safar@gmail.com>
1364         
1365         A fix for bug #328774
1366         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
1367         assignment.
1368         (PropertyExpr.EmitAssign): Fixed string concatenation compound
1369         assignment.
1370
1371 2007-10-03  Raja R Harinath  <rharinath@novell.com>
1372
1373         Fix #328490
1374         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
1375         Event accessibility checks here.  Remove some bogus code that
1376         accidently made GenericMethods work.
1377         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
1378
1379 2007-09-25  Marek Safar  <marek.safar@gmail.com>
1380         
1381         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
1382         
1383         * statement.cs (Block): Refactored AddVariable to allow error handling
1384         customization.
1385         
1386         * generic.cs: New stub.
1387         
1388 2007-09-23  Marek Safar  <marek.safar@gmail.com>
1389         
1390         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
1391         flag.
1392         
1393 2007-09-17  Marek Safar  <marek.safar@gmail.com>
1394
1395         * class.cs: Use partial container to record whether any partial part
1396         contains static field initializer and therefore default contructor has
1397         to be defined.
1398         
1399 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1400
1401         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
1402         mono-list when only one of two partial parts has defined accessibility
1403         modifier.
1404         
1405 2007-09-14  Marek Safar  <marek.safar@gmail.com>
1406
1407         A fix for bug #82845
1408         
1409         * class.cs (TypeContainer): Set correct resolve context for all field
1410         initializers.
1411         
1412 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1413
1414         * assign.cs: Fixed a crash when field is resolved twice with an error.
1415         
1416         * codegen.cs: Changed InFieldInitializer to be flag.
1417         
1418         * anonymous.cs, ecore.cs, expression.cs: Update after
1419         IsInFieldInitializer rename.
1420         
1421         * const.cs: Removed unused parameter.
1422         
1423         * class.cs: Changed the way how we resolve and emit field initializers.
1424         The field initilizers have to have access to contructor block to emit
1425         compiler generated code.
1426
1427 2007-09-13  Marek Safar  <marek.safar@gmail.com>
1428
1429         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
1430         generics use TypeContainer instead.
1431         
1432 2007-09-12  Marek Safar  <marek.safar@gmail.com>
1433         
1434         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
1435
1436         * lambda.cs (ResolveParameters): Use more powerful
1437         InflateGenericArgument.
1438         
1439         * parameters.cs: Better exception message.
1440                 
1441 2007-09-10  Marek Safar  <marek.safar@gmail.com>
1442
1443         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
1444         correct expression block type. 
1445         
1446         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
1447         
1448         * expression.cs (Invocation): Extracted method group resolve to
1449         DoResolveOverload.
1450         
1451 2007-09-07  Marek Safar  <marek.safar@gmail.com>
1452
1453         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
1454         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
1455         
1456         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
1457         generic extension methods.
1458
1459 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1460
1461         A fix for bug #82676 (Do I get it right now?)
1462         * convert.cs (Binary.ResolveOperator): An interface is converted to the
1463         object before a standard conversion is applied.
1464         
1465 2007-09-06  Marek Safar  <marek.safar@gmail.com>
1466
1467         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
1468         #82676.
1469         
1470 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1471
1472         A fix for bug #82676
1473         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
1474         non-generic interface types.
1475         
1476 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1477
1478         A fix for bug #82690
1479         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
1480         
1481 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1482
1483         A fix for bug #82571
1484         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
1485         modifier for container based methods.
1486         
1487 2007-09-05  Marek Safar  <marek.safar@gmail.com>
1488
1489         A fix for bug #82676
1490         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
1491         any interface-type T means to any of interface type T.
1492
1493 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1494
1495         * namespace.cs: We have 2 versions of System.Core assembly.
1496
1497 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1498
1499         A fix for bug #82652
1500         * class.cs (Class.GetClassBases): Compare types and not expressions.
1501
1502 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1503
1504         A fix for bug #82620
1505         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
1506         actually never worked before.
1507         (IndexerAccess): Emit prepared arguments before they are modified.
1508         
1509 2007-09-04  Marek Safar  <marek.safar@gmail.com>
1510
1511         A fix for bug #82563
1512         * assign.cs: Revert wrong fix.
1513         
1514         * expression.cs (VariableReference.EmitAssign): Handle ref reference
1515         correctly.
1516         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
1517         Instead of ldelema/stdind we have to use temporary variables to handle
1518         cases like String.Concat (params string[]).
1519         
1520 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1521
1522         * class.cs: EmitAttributes to Emit rename.
1523         
1524         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
1525         null.
1526         (MemberCore.HasClsCompliantAttribute): Don't depend on 
1527         GetClsCompliantAttributeValue execution.
1528         
1529 2007-08-31  Marek Safar  <marek.safar@gmail.com>
1530
1531         * anonymous.cs: Use shorter type prefix.
1532         
1533         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
1534         when exist.
1535         
1536         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
1537         variables when probing is on.
1538         
1539         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
1540         unresolved variables.
1541         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
1542         handle transparent identifiers.
1543         
1544 2007-08-26  Marek Safar  <marek.safar@gmail.com>
1545
1546         * attribute.cs (IsClsCompliant): Add nullable types test.
1547         
1548 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
1549
1550         * doc.cs : catch other types of exception than XmlException to
1551           report CS1570. Fixed bug #82565.
1552
1553 2007-08-23  Marek Safar  <marek.safar@gmail.com>
1554
1555         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
1556         The number of delegate parameters has to match.
1557         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
1558         arrays.
1559
1560 2007-08-21  Marek Safar  <marek.safar@gmail.com>
1561
1562         * anonymous.cs (AnonymousMethod): Generate private anonymous method
1563         to fix problem with private arguments.
1564
1565 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1566
1567         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
1568         
1569         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
1570         
1571         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
1572         empty. Add cloning suport.
1573         
1574         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
1575
1576 2007-08-20  Marek Safar  <marek.safar@gmail.com>
1577
1578         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
1579         to create EmptyCast. It handles EmptyConstantCast specialization for
1580         constants.
1581         
1582 2007-08-18  Marek Safar  <marek.safar@gmail.com>
1583
1584         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
1585         (EmitArrayArgument): One routine for array arguments.
1586         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
1587         
1588 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1589
1590         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
1591
1592 2007-08-17  Marek Safar  <marek.safar@gmail.com>
1593
1594         * anonymous.cs: MemberLookupFinal update.
1595
1596         * class.cs (ConstructorInitializer): Is expression based.
1597         
1598         * delegate.cs: MethodGroupExpr update.
1599         
1600         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
1601         messages.
1602         (Error_MemberLookupFailed): Customizable error override.
1603         (MethodGroupExpr): Keep queried type for later usage.
1604         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
1605         resolve.
1606         
1607         * expression.cs: Error_MemberLookupFailed refactoring.
1608         (New.DoResolve): Resolve as much as possible.
1609         (ElementInitializer.Error_MemberLookupFailed): Object initializer
1610         customization for invalid member types.
1611
1612         * statement.cs: MethodGroupExpr update.
1613         
1614 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1615
1616         * modifier.cs (Check): Check all modifiers and not only accessibility
1617         ones.
1618
1619 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1620
1621         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
1622         type and not an expression.
1623
1624 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1625
1626         * statement.cs (Catch.Clone): Type and variable can be null.
1627
1628 2007-08-16  Marek Safar  <marek.safar@gmail.com>
1629
1630         A fix for bug #81979
1631         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
1632         I am really not sure whether this is the best fix.
1633         
1634         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
1635         only once.
1636         
1637 2007-08-14  Marek Safar  <marek.safar@gmail.com>
1638
1639         ** C# 3.0 Object and collection initializers (major re-write)
1640         
1641         * assign.cs (DoResolve): Initializers are not assign related.
1642         
1643         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
1644         used during collection or object initialization.
1645         
1646         * expression.cs (Error_InvalidArguments): Add initializers specific
1647         messages. More will come later because it requires some general
1648         refactoring.
1649         (New.DoResolve): Better error handling for unsafe types.
1650         (EmptyExpressionStatement): New class.
1651         (ElementInitializer): An object initializer expression.
1652         (CollectionElementInitializer): A collection initializer expression.
1653         (CollectionOrObjectInitializers): A block of object or collection
1654         initializers.
1655         (NewInitialize): New expression with element/object initializers.
1656         
1657         * statement.cs: Reverted object/collection initializer hacks.
1658         
1659         * typemanager.cs (CSharpName): Filter __arglist type.
1660         
1661 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1662
1663         ** C# 3.0 Anonymous Types (update to the latest standard)
1664         
1665         * expression.cs (Binary.ResolveOperator): Threat all null based types
1666         same.
1667         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
1668         (AnonymousTypeParameter): Updated.
1669         
1670         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
1671         (AnonymousTypeClass): New anonymous type container.
1672         
1673         * class.cs (AddField): Return operation result.
1674         
1675         * generic.cs: Another empty TypeArguments overload.
1676         
1677         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
1678         are stored at top of normal hierarchy.
1679         
1680         * typemanager.cs (CSharpName): Filter anonymous types.
1681         
1682 2007-08-09  Marek Safar  <marek.safar@gmail.com>
1683
1684         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
1685         as single Concat call. How could we miss that :-(
1686         
1687 2007-08-08  Marek Safar  <marek.safar@gmail.com>
1688
1689         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
1690         
1691 2007-08-07  Miguel de Icaza  <miguel@novell.com>
1692
1693         * expression.cs: Fix the previous commit, the creation of the
1694         arguments array list needs also to be conditional on the arguments
1695         not being null.
1696
1697         * class.cs: Add a little bit of help to help narrow down problems.
1698
1699         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
1700         not try to copy in that case. 
1701
1702         * driver.cs: When building SMCS, include a new different set of
1703         default assemblies here.   Do this here so we can control whether
1704         to include the default assemblies with /noconfig.
1705
1706 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1707
1708         A fix for bug #81979
1709         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
1710         only.
1711
1712 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1713
1714         A fix for bug #82300
1715
1716         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
1717         we are in probing scope.
1718
1719 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1720
1721         A fix for bug #82301
1722
1723         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
1724         (Statement.CloneTo): Clone and not map children blocks.
1725
1726 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1727
1728         A fix for bug #82299
1729
1730         * expression.cs (LocalVariableReference.CloneTo): Remap local info
1731         variable too.
1732         
1733         * statement.cs (Statement.CloneTo): Clone variables before statements
1734         to allow remaping of local variables.
1735
1736 2007-08-03  Marek Safar  <marek.safar@gmail.com>
1737
1738         A fix for bug #82296
1739
1740         * anonymous.cs,
1741         * report.cs: Log crash details for future clone problems.
1742         
1743         * statement.cs (Return.Clone): Don't clone non-existent expression.
1744
1745 2007-08-03  Raja R Harinath  <harinath@gmail.com>
1746
1747         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
1748         (Class.AddBasesForPart): Move CS0537 check here from ...
1749         * cs-parser.jay (class_declaration): ... here.  Move calling of
1750         'AddBasesForPart' to ...
1751         (class_bases): ... here.
1752         (struct_declaration, interface_declaration): Update to changes.
1753
1754 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1755
1756         A fix for bug #81923
1757
1758         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
1759         conversion is allowed.
1760
1761 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1762
1763         A fix for bug #81564
1764
1765         * ecore.cs (EventExpr): Add IsBase handling.
1766
1767         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
1768         too.    
1769         
1770 2007-08-02  Raja R Harinath  <harinath@gmail.com>
1771
1772         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
1773         * cs-parser.jay: Some whitespace cleanups.
1774         (current_delegate): New.
1775         (type_name): New.
1776         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
1777         a dummy code block, and use 'type_name' instead of 'member_name'.
1778         (interface_declaration, class_declaration): Likewise.
1779         (delegate_declaration): Likewise.  Rearrange slightly and use
1780         'current_delegate'.
1781         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
1782         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
1783
1784 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1785
1786         A fix for bug #82039
1787
1788         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
1789         available.
1790
1791         * typemanager.cs (CSharpName): Split to string overload.
1792
1793 2007-08-02  Marek Safar  <marek.safar@gmail.com>
1794
1795         * expression.cs,
1796         * report.cs: Updated warning CS0472.
1797
1798 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1799
1800         A fix for bug #82181
1801         * cs-parser.jay,
1802         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
1803
1804 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1805
1806         A fix for bug #82277
1807         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
1808
1809 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1810
1811         ** C# 3.0 Type Inference (major bits are working)
1812         
1813         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
1814         (.ImplicitStandardConversionExists): Uses compatible.
1815         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
1816         (.InferReturnType): New method.
1817         (.Compatible): Refactored.
1818         (.ResolveParameters): Uses factory to create resolved parameters.
1819         (.CompatibleMethod): Add probing mode support.
1820         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
1821         clearly distinguish between 2 different operations.
1822         (LambdaMethod): Moved to lambda.cs.
1823         (AnonymousMethod): Removed unused fields and methods.
1824         (AnonymousDelegate): Simplified.
1825         
1826         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
1827         
1828         * convert. cs (ImplicitConversionStandard): Compatible works differently.
1829         
1830         * delegate.cs (Delegate): New mehods to reduce code duplication.
1831         (.GetConstructor): New method.
1832         (.GetInvokeMethod): New method.
1833         (DelegateCreation): Updated.
1834         
1835         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
1836         does not exist.
1837         (OverloadResolve): Made probing little bit faster.
1838         
1839         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
1840         when probing is on.
1841         
1842         * generic.cs (TypeInferenceContext): Dummy implementation.
1843         
1844         * iterators.cs: Updated after Resolve/Define rename.
1845         
1846         * lambda.cs (LambdaExpression)
1847         (.ResolveParameters): Handles both type of arguments and type inference too.
1848         
1849         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
1850         (InflateTypes): Updated.
1851         
1852         * support.cs (InflateTypes): Changed signature and updated.
1853         
1854         * typemanager.cs (LookupMemberCache): Better dynamic type check.
1855         (MemberLookup_FindMembers): More MS tricks.
1856         (GetParameterData): Ditto.
1857         (GetDelegateParameters): Uses quick path for dynamic types.
1858         
1859 2007-08-01  Marek Safar  <marek.safar@gmail.com>
1860
1861         * class.cs (MethodData.Define): EmitContext is required for generic stuff
1862         only.
1863
1864 2007-07-31  Marek Safar  <marek.safar@gmail.com>
1865
1866         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
1867         syntax.
1868         
1869 2007-07-26  Jb Evain  <jbevain@novell.com>
1870
1871         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
1872         which takes a boolean 'report_errors', similar to the GetMethod.
1873         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
1874         in .net 2.1, do not report errors here.
1875
1876         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
1877         System.Runtime.CompilerServices.RequiredAttributeAttribute and
1878         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
1879         in .net 2.1.
1880
1881         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
1882         of the type InternalsVisibleToAttribute before the first call
1883         to CoreLookupType which is allowed to fail (third boolean parameter
1884         to true). Because, during the resolution for a type that is not
1885         immediately found, we try to check if the type is not defined in
1886         a friend assembly, and to do so, we need the
1887         InternalVisibleToAttribute.
1888
1889 2007-07-23  Miguel de Icaza  <miguel@novell.com>
1890
1891         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
1892         feature that allows structs to be compared against null and inline
1893         the result as true or false.
1894
1895         Notice that the same code is not permitted inside a generic block
1896         of code that would do:
1897
1898         class Foo<T> where T : struct {
1899             bool Eval (T x)
1900             {
1901                  return x == null;
1902             }
1903         }
1904
1905         It is only allowed if the type of T is not bound (no where
1906         clause).   In my opinion, this CSC 2 behavior is broken but people
1907         seem to be using it (IronRuby does, a few bug reports on bugzilla
1908         have it and some people have complained about it).
1909
1910         All of the users that depend on this behavior have code that is
1911         very likely broken. 
1912         
1913         * report.cs (Warning, Error): make these take object arguments,
1914         not strings, as that allows us to take advantage of Format.
1915
1916 2007-07-20  William Holmes  <billholmes54@gmail.com>
1917
1918         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
1919           Left member variable for the Count.
1920         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
1921           MemberName.CountTypeArguments to avoid a NRE. 
1922
1923         This code is contributed under the MIT X11 license
1924
1925 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1926
1927         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
1928
1929 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1930
1931         * doc.cs : generic method arguments are written as ``x while generic
1932           type arguments are `x. Combined with the previous change, fixed bug
1933           #79706.
1934
1935 2007-07-18  Raja R Harinath  <rharinath@novell.com>
1936
1937         Fix #82120
1938         * expression.cs (Binary.ResolveOperator): When converting
1939         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
1940
1941 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
1942
1943         * doc.cs : when T: or whatever x: is specified, it does not really
1944           check the doc comment's syntax correctness. Fixed bug #82006.
1945
1946 2007-07-18  Marek Safar  <marek.safar@gmail.com>
1947
1948         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
1949         LambdaExpression better.
1950         
1951         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
1952         
1953         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
1954         
1955         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
1956         as it can be generated.
1957         
1958         * expression.cs (Invocation.Error_InvalidArguments): Show correct
1959         modifiers.
1960         
1961         * lambda.cs (LambdaExpression): Refactored to share same code with
1962         AnonymousMethodExpression.
1963         
1964 2007-07-17  Marek Safar  <marek.safar@gmail.com>
1965
1966         * anonymous.cs (MakeName): Include host name for easier debugging.
1967         (LambdaMethod): New class for lambda spcecific stuff.
1968         
1969         * attribute.cs: Set EmitContext return type.
1970
1971         * class.cs: Set EmitContext return type.
1972         
1973         * codegen.cs (EmitContext): Return type cannot be null to stop messing
1974         with null/void meaning.
1975         
1976         * iterators.cs (ContainerType): Implemented.
1977         
1978         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
1979         
1980         * statement.cs (Return): Updated to lambda expressions.
1981         (Block.CloneTo): Parent can be null.
1982                 
1983 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1984
1985         A fix for bug #81917
1986         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
1987         
1988         * class.cs (FixedField): Check whether field is in unsafe scope.
1989
1990         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
1991         (FieldExpr.Emit): Fixed buffers cannot be volatile.
1992
1993         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
1994         FieldExpr.
1995         
1996         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
1997                 
1998 2007-07-13  Marek Safar  <marek.safar@gmail.com>
1999
2000         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
2001         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
2002         from Report class.
2003
2004 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2005
2006         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
2007         
2008 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2009
2010         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
2011         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
2012         
2013         * codegen.cs(EmitContext): Add ProbingMode flag.
2014         
2015         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
2016         
2017         * driver.cs: For now set both warning values.
2018         
2019         * ecore.cs (SimpleName): Name is readonly.
2020         (MethodGroup.OverloadResolve): One quick path for probing.
2021         
2022         * expression.cs (Unary): Set Oper r/o.
2023         (Binary): Set Oper r/o.
2024         (ParameterReference): Set few instance variables as r/o.
2025         (ParameterReference.DoResolveBase): Don't capture aruments when 
2026         the probing is on.
2027         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
2028         (Arglist): arguments are private.
2029         (SizeOf): type is private and r/o.
2030         (MemberAccess): arguments are private.
2031
2032         * report.cs: Enhanced reporting on/off capabilities.
2033         
2034         * lambda.cs: Uses ec.IsInProbingMode.
2035         (ContextualReturn): Derives from return.
2036         
2037         * rootcontext.cs: For now set both warning values.
2038         
2039         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
2040         copy if one exists.
2041         (Return.Resolve): Don't die immediately.
2042         (Block.Resolve): Speed-up probing.
2043         (Block.CloneTo): Clone only child blocks.
2044
2045 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
2046
2047         * iterators.cs: reverted Miguel's latest change (r81925) as it
2048         breaks the build in System.
2049
2050 2007-07-13  Miguel de Icaza  <miguel@novell.com>
2051
2052         * iterators.cs (Yield.CheckContext): Check for the iterator type
2053         also here as we can call into Yield even in codepaths that are not
2054         directly checked by
2055         (MethodOrOperator is the only path that was checked).
2056
2057         In addition to the standard check, use a more specific check for
2058         constructors to report a more verbose error. 
2059
2060 2007-07-12  Miguel de Icaza  <miguel@novell.com>
2061
2062         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
2063         report the warning and continue 
2064
2065         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
2066         values on the stack on the call to Emit.   Use EmitStatement if
2067         possible, or using Emit + Pop if not possible.   Fixes #82064
2068
2069 2007-07-12  Raja R Harinath  <rharinath@novell.com>
2070
2071         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
2072         avoid try...finally in some cases.
2073
2074 2007-07-10  Marek Safar  <marek.safar@gmail.com>
2075
2076         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
2077         
2078         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
2079         instead of method. Re-use standard error handling.
2080         (ConstructorInitializer.Emit): Simplified.
2081         
2082         * delegate.cs: Updated after Invocation.EmitCall change.
2083         
2084         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
2085         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
2086         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
2087         method and don't permanently changing input arguments.
2088         (MethodGroupExpr): Introduced resolved best_candidate, when method group
2089         is resolved it has one of the candidates is the best one which is later
2090         used to emit. Removed a few unused method.
2091         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
2092
2093         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
2094         (Binary.ResolveOperator): Ditto.
2095         (ConditionalLogicalOperator.DoResolve): Ditto.
2096         (Invocation): Uses method group.
2097         (Invocation.DoResolve): Simplified.
2098         (Invocation.EmitCall): Removed useless is_static.
2099         (Invocation.Emit): Delegate to method group.
2100         (Invocation.EmitStatement): Simplified.
2101         (New): Uses method group.
2102         (MemberAccess.DoResolve): Don't destroy original expression.
2103         
2104         * statement.cs (ForEach.Resolve): Use null for no method arguments.
2105         
2106 2007-07-04  Marek Safar  <marek.safar@gmail.com>
2107
2108         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
2109         
2110         * anonymous.cs,
2111         * lambda.cs: Add custom error message type.
2112
2113 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2114
2115         * lambda.cs: Simplified little bit.
2116         
2117         * parameter.cs: Introduced ImplicitLambdaParameter.
2118         (Parameters.CreateFullyResolved): New factory instead of ctor.
2119         
2120         * anonymous.cs,
2121         * class.cs,
2122         * delegate.cs: Updated parameter creation.
2123         
2124 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2125
2126         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
2127         arguments.
2128         
2129         * generic.cs: Synchronized with gmcs.
2130         
2131 2007-07-03  Marek Safar  <marek.safar@gmail.com>
2132
2133         * class.cs (Indexer): Check return type as soon as possible.
2134         
2135         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
2136         members too.
2137         
2138         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
2139         
2140         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
2141         
2142         * parameter.cs (Parameter): Use expression type when it is available.
2143         
2144         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
2145         method modifier for the first parameter only.
2146
2147 2007-06-24  Marek Safar  <marek.safar@gmail.com>
2148
2149         A fix for bug #81938
2150         * typemanager.cs (ChangeType): Fixed couple of char conversions.
2151         
2152         * constant.cs: Tide up an exception message.
2153
2154 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2155
2156         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
2157         an uninitialized variable is used.
2158         
2159         * expression.cs (LocalVariableReference.DoResolve): Ditto.
2160
2161 2007-06-22  Marek Safar  <marek.safar@gmail.com>
2162
2163         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
2164         not found error handling.
2165
2166         * expression.cs (ArrayCreation): Removed redundant fields and little bit
2167         simplified.
2168         (ArrayCreation.ResolveArrayElement): To be ready to customization.
2169         (ArrayCreation.DoResolve): Simplified.
2170         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
2171         its own resolve process.
2172         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
2173
2174 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2175
2176         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
2177         more error details.
2178         
2179 2007-06-20  Marek Safar  <marek.safar@gmail.com>
2180
2181         * cs-tokenizer.cs: Removed var related stuff.
2182         
2183         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
2184         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
2185         a type and a keyword at same time.
2186         
2187         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
2188         matches to "var".
2189         
2190         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
2191         implicitly typed arrays, more changes will follow.
2192         
2193         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
2194         
2195 2007-06-19  Marek Safar  <marek.safar@gmail.com>
2196
2197         * ecore.cs (VarExpr): Removed Handled field.
2198         
2199         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
2200         build-in assign functionality.
2201         (ForEach.Resolve): Removed all implicitly typed local variable code and
2202         simplified.
2203         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
2204         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
2205
2206 2007-06-18  Marek Safar  <marek.safar@gmail.com>
2207
2208         * assign.cs: Removed implicitly typed local variable check.
2209         
2210         * expression.cs (LocalVariableReference.DoResolve): Add check for self
2211         referencing implicitly typed local variable.
2212         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
2213         variable here.
2214         
2215         * statement.cs (Fixed): Removed unsupported implicitly typed local
2216         variable code.
2217
2218 2007-06-15  Marek Safar  <marek.safar@gmail.com>
2219
2220         * decl.cs (MemberName): Moved all Unbound stuff to parser.
2221
2222 2007-06-14  Marek Safar  <marek.safar@gmail.com>
2223
2224         A fix for bugs #81855 and #76274
2225         * attribute.cs (AttachTo): Always set owner for global attributes to
2226         prefined owner.
2227         
2228         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
2229         usefull too.
2230         
2231         * cs-parser.jay: Assembly and module attributes must precede all other
2232         elements except using clauses and extern alias declarations.
2233
2234 2007-06-13  Marek Safar  <marek.safar@gmail.com>
2235
2236         A fix for bug #81748
2237         * cs-tokenizer.cs,
2238         * expression.cs: More checks for non ISO-1 features.
2239
2240 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2241
2242         A fix for bug #81807
2243         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
2244         present inside switch statement and it is required by nullable check.
2245
2246 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2247
2248         A fix for bug #81840
2249         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
2250         when type matching fails.
2251         
2252         * namespace.cs: Tiny error message change.
2253
2254 2007-06-12  Marek Safar  <marek.safar@gmail.com>
2255
2256         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
2257         reporting. Added automatic property check.
2258         
2259         * class.cs: Updated after CheckAbstractAndExtern relocation.
2260         (AEventPropertyAccessor.GetSignatureForError): Customized.
2261         
2262 2007-06-11  Marek Safar  <marek.safar@gmail.com>
2263
2264         * class.cs (DefineBaseTypes): Base type can be undefined.
2265         
2266         * ecore.cs (TypeLookup): Minor refactoring.
2267         (DoResolveAsTypeStep): Removed redundant check.
2268
2269         * namespace.cs (Lookup): Removed redundant check.
2270                 
2271         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
2272         ResolveAsTypeTerminal step.
2273         (BootstrapCorlib_*): Simplified.
2274         (PopulateCoreType): Core types can be now external.
2275
2276 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2277
2278         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
2279          verification only.
2280          (InferTypeArguments): Infers anonymous expression type arguments.
2281          (Compatible): Split to Compatible and InferTypeArguments. 
2282         
2283         * lambda.cs: Updated.
2284
2285 2007-06-08  Marek Safar  <marek.safar@gmail.com>
2286
2287         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
2288
2289 2007-06-07  Raja R Harinath  <harinath@gmail.com>
2290
2291         Fix #80477, cs0135-2.cs, cs0135-3.cs
2292         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
2293         names to the "known" variables list.
2294         (Block.CheckInvariantMeaningInBlock): Handle the fact the
2295         parameter names are also "known".
2296         (Block.CheckError136): Remove.
2297         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
2298         null.
2299
2300 2007-06-07  Marek Safar  <marek.safar@gmail.com>
2301
2302         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
2303
2304 2007-06-06  Marek Safar  <marek.safar@gmail.com>
2305
2306         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
2307         internal error not an user error.
2308          
2309         * expression.cs (IsApplicable): Refactored to make debugging easier.
2310
2311         * support.cs: More tricks for non-mono runtimes.
2312         
2313         * typemanager.cs (CoreLookupType): Made public.
2314         (InitSystemCore): All linq specific stuff moved to linq.cs
2315
2316 2007-06-05  Marek Safar  <marek.safar@gmail.com>
2317
2318         * typemanager.cs (CSharpSignature): One more missing build-in types
2319         replacement.
2320         More tricks for non-mono runtime.
2321
2322 2007-06-05  Raja R Harinath  <harinath@gmail.com>
2323
2324         * statement.cs (Block.CheckError136_InParents): Remove.
2325         (Block.AddVariable): Use GetParameterInfo instead.
2326         (ToplevelBlock.ProcessArguments): Likewise.
2327
2328 2007-06-04  Raja R Harinath  <rharinath@novell.com>
2329
2330         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
2331         information too.
2332         (ToplevelBlock.GetParameterInfo): Split out of ...
2333         (ToplevelBlock.GetParameterRefernce): ... this.
2334         (ToplevelBlock.ParameterMap): Remove.
2335         * expression.cs (ParameterReference): Update to use
2336         ToplevelParameterInfo.
2337
2338         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
2339         regression.
2340
2341         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
2342         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
2343
2344         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
2345         (ToplevelBlock.ProcessParameters) ... here.
2346         (ToplevelBlock..ctor): Invoke it.
2347
2348         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
2349         new parameters.
2350
2351         * statement.cs (IKnownVariable): New interface.
2352         (LocalInfo): Implement it.
2353         (ToplevelParameterInfo): New class.
2354         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
2355         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
2356         GetKnownVariableInfo.
2357
2358 2007-06-03  Raja R Harinath  <harinath@gmail.com>
2359
2360         Partly speed up CS0136 error checks.
2361         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
2362         'recurse' parameter.
2363         (Block.DoCheckError136): Only check errors in parameters.  Move
2364         local variable checks ...
2365         (Block.AddVariable): ... here, and ...
2366         (ToplevelBlock.ResolveMeta): ... here.
2367
2368 2007-06-02  Raja R Harinath  <harinath@gmail.com>
2369
2370         * statement.cs (Block.IsChildOf): Remove.
2371
2372         * statement.cs (Statement.Clone): Move special case code ...
2373         (Block.CloneTo): ... here.
2374
2375 2007-05-29  Raja R Harinath  <rharinath@novell.com>
2376
2377         * statement.cs (ToplevelBlock.container): Remove field.  It's
2378         redundant with 'Parent'.
2379         (ToplevelBlock.ContainerBlock): Remove accessor.
2380         (ToplevelBlock..ctor): Update to changes.  Register anonymous
2381         child with parent here, ...
2382         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
2383         current_block.
2384         (start_anonymous): Don't save current_block.
2385         (top_current_block): Remove.
2386
2387         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
2388         (Block.Resolve): Update to changes.
2389         (Block..ctor): Move setting of "correct" 'Toplevel'
2390         and 'Explicit' fields to ...
2391         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
2392
2393 2007-05-27  Raja R Harinath  <harinath@gmail.com>
2394
2395         Kill Block.Implicit
2396         * statement.cs (Block.Implicit): Remove.
2397         (Block): Update to changes.
2398         * flowanalysis.cs: Likewise.
2399
2400         Mildly speed up CheckInvariantMeaningInBlock
2401         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
2402         Recursively call AddKnownVariable to all enclosing blocks.
2403         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
2404         Remove recursive calls.
2405         (Block): Update to changes.
2406
2407         New ExplicitBlock invariants
2408         * statement.cs (Block.Explicit): New field.  It points to the
2409         immediately enclosing non-implicit block.
2410         (Block..ctor): Maintain the invariant.
2411         * cs-parser.jay: Take advantage of invariant.
2412
2413         Introduce ExplicitBlock
2414         * statement.cs (ExplicitBlock): New.
2415         (ToplevelBlock): Derive from it.
2416         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
2417         sense of flag.
2418         (Block.Implicit): Update to changes.
2419         * cs-parser.jay: Update to changes.
2420
2421         Remove unused field
2422         * codegen.cs (EmitContext.IsLastStatement): Remove.
2423         * statement.cs (Block.DoEmit): Update to changes.
2424
2425 2007-05-25  Raja R Harinath  <rharinath@novell.com>
2426
2427         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
2428         modifying current_block directly.
2429
2430 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
2431         
2432         * class.cs: Implemented automatic properties (C# 3.0)
2433           Thanks to Marek for the help.
2434
2435 2007-05-23  Raja R Harinath  <rharinath@novell.com>
2436
2437         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
2438         variable as assigned, note also that all its components are
2439         assigned too.
2440         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
2441
2442 2007-05-19  Marek Safar  <marek.safar@gmail.com>
2443
2444         * anonymous.cs, class.cs: Emit Compiler generated attribute when
2445         member is marked as compiler generated.
2446         
2447         * decl.cs (MemberCore): Refactored ModFlags into property.
2448
2449         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
2450         (Check): Check only accessibility modifiers.
2451
2452 2007-05-18  Raja R Harinath  <rharinath@novell.com>
2453
2454         Track all assignable slots in one bit array
2455         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
2456         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
2457         logic from VariableMap constructor here.  Use the same 'offset'
2458         variable that's later used for computing offsets of local
2459         variables.
2460         * flowanalysis.cs (UsageVector.parameters): Remove.
2461         (UsageVector): Update to changes.
2462         (VariableMap): Remove.
2463
2464         Avoid creating ParameterMap in every block
2465         * statement.cs (Block.ParameterMap): Move ...
2466         (ToplevelBlock.ParameterMap): ... here.
2467         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
2468         only once.
2469         * flowanalysis.cs (FlowBranching.param_map): Remove.
2470         (FlowBranching.UsageVector): Update to changes.
2471         (FlowBranchingToplevel.CheckOutParameters): Likewise.
2472
2473         * statement.cs (Block.CloneTo): Clone Toplevel field too.
2474
2475         * expression.cs (ParameterReference): Distinguish between block
2476         where parameter was referenced and declared.
2477
2478 2007-05-18  Marek Safar  <marek.safar@gmail.com>
2479
2480         * flowanalysis.cs, statement.cs: Put back improved error handling.
2481
2482 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
2483         
2484         * assign.cs:
2485         * expression.cs:
2486           Imporved object and collection initialization (C# 3.0).
2487
2488 2007-05-15  Marek Safar  <marek.safar@gmail.com>
2489
2490         A fix for bug #81380
2491         * expression.cs (Is.DoResolve): Only value types have constant `is'
2492         behaviour.
2493
2494 2007-05-15  Raja R Harinath  <rharinath@novell.com>
2495
2496         * statement.cs (ToplevelBlock.child): Remove.
2497
2498 2007-05-15  Raja R Harinath  <harinath@gmail.com>
2499
2500         Rationalize ResolveMeta: refactoring
2501         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
2502         out constant handling code into ...
2503         (Block.DoResolveConstants): ... this.
2504
2505         Rationalize ResolveMeta: kill local_map
2506         * statement.cs (Block.local_map, Block.LocalMap): Remove.
2507         (Block.AssignableSlots): New.
2508         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
2509         for locals -- move code from VariableMap here.  Avoid unnecessary
2510         allocations.
2511         * flowanalysis.cs (FlowBranching.local_map): Remove.
2512         (FlowBranching..ctor): Use Block.AssignableSlots.
2513         (VariableMap): Remove unused constructors.
2514
2515 2007-05-11  Raja R Harinath  <rharinath@novell.com>
2516
2517         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
2518
2519 2007-05-11  Marek Safar  <marek.safar@gmail.com>
2520
2521         * typemanager.cs (IsFriendAssembly): Should not be called for building
2522         assembly.
2523
2524 2007-05-09  Marek Safar  <marek.safar@gmail.com>
2525
2526         * literal.cs (NullConstant): Print null in all cases.
2527         
2528         * expression.cs (Binary.ResolveOperator): Implemented delegate
2529          comparison based on C# 2.0 changes.
2530
2531 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
2532
2533         This code is contributed under the MIT X11 license
2534         
2535         The following enables support for several C# 3.0 language features:
2536         
2537         * cs-tokenizer.cs: Added support for the "var" keyword.
2538         
2539         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
2540           Added VarExpr class to facilitate type inferencing.
2541         
2542         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
2543           to support anonymous types.
2544         
2545         * assign.cs: Added support for type inferencing and initialization.
2546         
2547         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
2548         
2549         * expression.cs: Added implicit array support to ArrayCreation.
2550           Added 5 types and 1 interface:
2551           
2552           IInitializable                Implementing classes can inject initializing
2553                                         statements after object instantiation.
2554           
2555           Initializer                   Stores data for object initialization.
2556           
2557           AnonymousType                 An expression for anonymous types.
2558           
2559           AnonymousTypeParameter        Stores data about an anonymous type's field.
2560           
2561           NewInitialize                 An expression for object initialization.
2562           
2563           CollectionInitialize          An expression for collection initialization.
2564         
2565         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
2566           statements.
2567
2568 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2569
2570         A fix for bug #81500
2571         * cs-tokenizer.cs: Add special handling for coalescing operator.
2572
2573 2007-05-06  Marek Safar  <marek.safar@gmail.com>
2574
2575         A fix for bug #81529
2576         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
2577         its value from base class until it is redefined.
2578
2579 2007-05-02  Raja R Harinath  <rharinath@novell.com>
2580
2581         Fix regression in cs0631-3.cs
2582         * cs-parser.jay (operator_declarator): Add opt_attributes to error
2583         fallback.  Make error fallback catch more cases.
2584
2585 2007-05-01  Miguel de Icaza  <miguel@novell.com>
2586
2587         * cs-parser.jay: Allow parameters in operator declarations to have
2588         attributes. 
2589
2590 2007-04-27  Miguel de Icaza  <miguel@novell.com>
2591
2592         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
2593         exists. 
2594
2595         * lambda.cs (ContextualReturn.Resolve): An expression is valid
2596         inside the ContextualReturn, it does not have to be an
2597         ExpressionStatement. 
2598
2599 2007-04-24  Miguel de Icaza  <miguel@novell.com>
2600
2601         * lambda.cs (ContextualReturn.Resolve): if the return type is not
2602         set, set it.
2603
2604 2007-04-23  Miguel de Icaza  <miguel@novell.com>
2605
2606         * anonymous.cs (AnonymousContainer): split the virtual Resolve
2607         method in two methods: ResolveNoDefine and Resolve.
2608
2609         ResolveNoDefine will stop just after ResolveTopBlock has been
2610         called.   
2611
2612         Resolve will then continue by creating a method and issuing the
2613         call to method.Define ().
2614
2615         (AnonymousMethod): Split and implement the new Resolve and
2616         ResolveNoDefine as well.
2617
2618         * lambda.cs (LambdaExpression): Split the anonymous method
2619         resolution code into a separate routine (CoreCompatibilityTest)
2620         from DoCompatibleTest.
2621
2622         (LambdaExpression.TryBuild): New method, this method tries to
2623         build the LambdaExpression with the given set of types to be used
2624         as the types for the various parameters of the lambda expression. 
2625
2626         If the compilation succeed with the given types, the infered type
2627         of the Anonymous method is returned, otherwise null is returned.
2628
2629 2007-04-23  Marek Safar  <marek.safar@gmail.com>
2630
2631         A fix for bug #81414
2632         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
2633
2634 2007-04-22  Miguel de Icaza  <miguel@novell.com>
2635
2636         * cs-tokenizer.cs: Change various identifiers here from the
2637         camelCasing to the recommended Linux-like style for instance
2638         variables from the Coding Guidelines. 
2639
2640 2007-04-19  Martin Baulig  <martin@ximian.com>
2641
2642         * convert.cs
2643         (Convert.ImplicitReferenceConversionCore): Allow conversions from
2644         System.Enum to System.ValueType.
2645
2646 2007-04-13  Martin Baulig  <martin@ximian.com>
2647
2648         Rewrote implicit reference conversions.  We need to distinguish
2649         between implicit reference conversions (13.1.4) and implicit
2650         boxing conversions (13.1.5).
2651
2652         According to the spec, there's an an implicit conversion
2653         "From a one-dimensional array-type S[] to IList<T> and base
2654         interfaces of this interface, provided there is an implicit
2655         reference conversion from S to T."  Note that this does not
2656         include boxing conversions.
2657
2658         * convert.cs
2659         (Convert.ImplicitTypeParameterBoxingConversion): New method.
2660         (Convert.ImplicitReferenceConversion): Split into
2661         ImplicitReferenceConversionCore() and
2662         ImplicitBoxingConversionExist().
2663         (Convert.ImplicitReferenceConversionExists): Use the new
2664         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
2665
2666 2007-04-12  Martin Baulig  <martin@ximian.com>
2667
2668         * convert.cs (Convert.ImplicitReferenceConversion): Move the
2669         `TypeManager.null_type' checks up to the top of the method.
2670
2671 2007-04-11  Marek Safar  <marek.safar@gmail.com>
2672
2673         A fix for bug #81350
2674         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
2675         extension methods.
2676
2677 2007-04-11  Martin Baulig  <martin@ximian.com>
2678
2679         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
2680         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
2681         to make this work for generic classes; fixes #79561.
2682
2683 2007-04-11  Martin Baulig  <martin@ximian.com>
2684
2685         * expression.cs (As): Add support for nullable types; fixes #79371.
2686
2687 2007-04-11  Martin Baulig  <martin@ximian.com>
2688
2689         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
2690         `type.FullName' is null; fixes #80243.
2691
2692 2007-04-11  Martin Baulig  <martin@ximian.com>
2693
2694         * expression.cs (Invocation.IsApplicable): Don't modify the method
2695         if type inference succeeded, but the method was not applicable.
2696         Fixes #81250.
2697
2698 2007-04-10  Marek Safar  <marek.safar@gmail.com>
2699
2700         A fix for bug #81324
2701         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
2702         internal and external namespaces containers.
2703
2704 2007-04-10  Martin Baulig  <martin@ximian.com>
2705
2706         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
2707         TypeManager.DropGenericMethodArguments() so we also call
2708         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
2709
2710 2007-04-10  Martin Baulig  <martin@ximian.com>
2711
2712         * iterators.cs (Iterator.CreateIterator): Don't crash if
2713         `method.ReturnType' is null.  This happens if something went wrong
2714         while resolving that typ (we already reported an error in this case).
2715
2716 2007-04-10  Martin Baulig  <martin@ximian.com>
2717
2718         * expression.cs (New.DoResolve): Don't call CheckComImport() on
2719         generic interfaces; report the CS0144 directly.
2720
2721 2007-04-10  Martin Baulig  <martin@ximian.com>
2722
2723         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
2724         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
2725
2726 2007-04-10  Martin Baulig  <martin@ximian.com>
2727
2728         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
2729
2730 2007-04-09  Raja R Harinath  <rharinath@novell.com>
2731
2732         A better fix
2733         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
2734         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
2735
2736         Fix #81338
2737         * statement.cs (For.Resolve): If resolution fails, use
2738         KillFlowBranching.
2739
2740 2007-04-08  Marek Safar  <marek.safar@gmail.com>
2741
2742         * anonymous.cs (MakeName): Make faster and zero-based.
2743         (VerifyExplicitParameterCompatibility): Back to mode where generic
2744         parameter is ignored.
2745         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
2746
2747         * class.cs (EmitType): Method can emit another new method.
2748
2749         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
2750
2751         * driver.cs: Updated.
2752
2753         * lambda.cs: Reuse predefined empty parameters.
2754
2755         * parameter.cs: Updated
2756
2757         * support.cs: Implemented InflateTypes.
2758
2759         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
2760         (InitSystemCore): Introduced to isolate 3.0 dependencies.
2761
2762 2007-04-03  Martin Baulig  <martin@ximian.com>
2763
2764         Fix #80632.
2765
2766         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
2767         version of TypeManager.IsOverride() which also works with generic
2768         types.  
2769
2770 2007-04-03  Martin Baulig  <martin@ximian.com>
2771
2772         Fix #81044.
2773
2774         * convert.cs
2775         (Convert.ExplicitReferenceConversion): We need to cast when
2776         converting from IList<T> to S[].
2777
2778 2007-04-01  Marek Safar  <marek.safar@gmail.com>
2779
2780         * decl.cs (FindExtensionMethods): Consider all candidates with same name
2781         at this level.
2782         
2783         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
2784
2785 2007-03-31  Marek Safar  <marek.safar@gmail.com>
2786
2787         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
2788         argument and return type inferring.
2789
2790         * codegen.cs (InferReturnType): Flag whether return can be inferred.
2791         (ReturnType): Turned to property.
2792
2793         * statement.cs (Return): Implemented return type inferring.
2794
2795         * support.cs (ReflectionParameters): Use local types if possible.
2796
2797 2007-03-30  Raja R Harinath  <rharinath@novell.com>
2798
2799         * flowanalysis.cs (FlowBranching.Reachability): Remove.
2800         (FlowBranching.UsageVector): Update to changes.
2801
2802         Prepare to kill 'Reachability'
2803         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
2804         argument of constructor.
2805
2806 2007-03-29  Raja R Harinath  <rharinath@novell.com>
2807
2808         Prepare to kill 'Reachability'
2809         * flowanalysis.cs (UsageVector.is_unreachable): New.
2810         (UsageVector): Update to maintain 'is_unreachable' in parallel to
2811         'reachability', and verify they're consistent.
2812
2813         Fix #81121
2814         * expression.cs (New.EmitStatement): Handle type parameters here too.
2815
2816 2007-03-29  Martin Baulig  <martin@ximian.com>
2817
2818         Fix #79148.
2819
2820         * anonymous.cs
2821         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
2822         CompilerGeneratedClass.
2823         (ScopeInfo.EmitScopeInstance): Make this protected.
2824         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
2825         `ec.CurrentAnonymousMethod.Scope == Scope'.
2826
2827         * statement.cs (Block.ScopeInfo): Make this a property.
2828
2829 2007-03-27  Raja R Harinath  <harinath@gmail.com>
2830
2831         Prepare to kill 'Reachability'
2832         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
2833         (FlowBranching.UsageVector.Reachability): Remove property.
2834         (FlowBranching.UsageVector.IsUnreachable): New property.
2835         (FlowBranching.UsageVector.ResetBarrier): New.
2836         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
2837         * codegen.cs, statement.cs: Update to changes.
2838
2839 2007-03-27  Martin Baulig  <martin@ximian.com>
2840
2841         Fix #81209.
2842
2843         * decl.cs
2844         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
2845         generic types.
2846
2847 2007-03-26  Raja R Harinath  <rharinath@novell.com>
2848
2849         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
2850         instead of TriState.  Remove all mention of TriState.
2851
2852         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
2853         replaced by a boolean.  Add boolean 'is_unreachable' field, check
2854         and maintain invariants.
2855
2856 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2857
2858         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
2859
2860 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2861
2862         * expression.cs: Stop using obsolete 2.0 opcodes.
2863
2864 2007-03-25  Marek Safar  <marek.safar@gmail.com>
2865
2866         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
2867         one of the latests Martin's fixes.
2868
2869 2007-03-23  Miguel de Icaza  <miguel@novell.com>
2870
2871         * expression.cs: On BigEndian systems, swap the bytes, temporary
2872         solution until we get a new bitconverter class.
2873
2874 2007-03-23  Martin Baulig  <martin@ximian.com>
2875
2876         Fix #81158.
2877
2878         * decl.cs (MemberCache.AddMembers): Add generic methods both as
2879         "Method" and "Method`1".  Normally, a cache lookup is done on the
2880         "Method" form (ie. without the generic arity), but this one makes
2881         lookups on the full form work as well.
2882
2883 2007-03-22  Raja R Harinath  <rharinath@novell.com>
2884
2885         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
2886         unused properties.
2887
2888 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
2889         * class.cs: 
2890         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
2891         ordered_member_list, to TypeBuilder to store members to be defined
2892         in the order they were parsed in.
2893         - ordered_explicit_member_list contains all properties indexers
2894           and methods that are defined as explicit implementation of an
2895           interface or base class.
2896         - ordered_member_list contains all properties indexers and methods
2897           that are not defined as explicit implementation of an interface
2898           or base class.
2899
2900         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
2901         functionality in these removed classes has been replaced with 
2902         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
2903         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
2904
2905         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
2906         to CheckForDuplications inside GetMethod and SetMethod Define Method
2907         to handle method property and indexer name conflicts.
2908
2909         Fixes #79434
2910
2911         All code is contributed under the MIT/X11 license.
2912
2913 2007-03-20  Martin Baulig  <martin@ximian.com>
2914
2915         * class.cs (TypeContainer.Interfaces): Removed; they're now
2916         included in `TypeContainer.Types'.
2917
2918 2007-03-20  Martin Baulig  <martin@ximian.com>
2919
2920         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
2921
2922         * class.cs (TypeContainer.CreateType): New public method.  This is
2923         now called before DefineType() to create the TypeBuilders.
2924         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
2925         has already been created by CreateType().
2926         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
2927         don't resolve our base classes here; this has been moved into
2928         DefineBaseTypes().  We're now called from CreateType().
2929         (TypeContainer.DefineBaseTypes): New private method; resolve our
2930         base classes here.  We're now called from DefineType().
2931
2932         * rootcontext.cs
2933         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
2934         our types first to create all the TypeBuilders.  After that, call
2935         TypeContainer.DefineType() on all the types which'll resolve their
2936         base classes and setup the resolve order.
2937
2938 2007-03-20  Martin Baulig  <martin@ximian.com>
2939
2940         * class.cs (TypeContainer.Enums): Removed; they're now included in
2941         `TypeContainer.Types'.  
2942
2943 2007-03-20  Martin Baulig  <martin@ximian.com>
2944
2945         * class.cs
2946         (TypeContainer.DefineType): Don't call ResolveMembers() here.
2947         (TypeContainer.DoResolveMembers): Call DefineType() on our
2948         `compiler_generated' classes; moved here from DefineNestedTypes().
2949
2950         * rootcontext.cs
2951         (RootContext.ResolveTree): Call ResolveMembers() on all
2952         TypeContainer's in the `type_container_resolve_order'.
2953
2954 2007-03-19  Marek Safar  <marek.safar@gmail.com>
2955
2956         * class.cs: Use corlib to handle InternalMethodImplAttribute.
2957
2958 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2959
2960         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
2961         implementation flags.
2962
2963 2007-03-17  Marek Safar  <marek.safar@gmail.com>
2964
2965         * class.cs: More optimizations for type parameters.
2966
2967 2007-03-15  Marek Safar  <marek.safar@gmail.com>
2968
2969         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
2970
2971         * ecore.cs, parameter.cs: More common code for both corlibs.
2972
2973         * typemanager.cs (IsGenericMethod): Simplified.
2974
2975 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2976
2977         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2978         'returns'.
2979         * statement.cs, iterators.cs, lambda.cs: Update to changes.
2980
2981         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
2982         unconditionally.  Simplify explanation.
2983         (Try.Resolve, Using.Resolve): Likewise.
2984
2985 2007-03-15  Martin Baulig  <martin@ximian.com>
2986
2987         Fix #80731.
2988
2989         * decl.cs (DeclSpace): If we're a partial class, use our
2990         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
2991
2992 2007-03-15  Raja R Harinath  <rharinath@novell.com>
2993
2994         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
2995         'throws'.
2996         (FlowBranching.UsageVector): Update to changes.
2997         (FlowBranching.MergeSiblings): Likewise.
2998         * statement.cs: Likewise.
2999
3000 2007-03-15  Martin Baulig  <martin@ximian.com>
3001
3002         Fix #79302.
3003
3004         * decl.cs
3005         (MemberCache): Added a special .ctor for type parameters.
3006
3007         * typemanager.cs
3008         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
3009         `MemberCache'.  
3010
3011 2007-03-09  Martin Baulig  <martin@ximian.com>
3012
3013         * enum.cs (Enum): Make this a TypeContainer.
3014         (EnumMember): Derive from `Const'.
3015
3016         * const.cs
3017         (Const.DoResolveValue): New protected virtual method; move most of
3018         the functionality of ResolveValue() here so we can override it in
3019         `EnumMember'.
3020         (Const.CreateConstantReference): Make this virtual.
3021
3022         * class.cs (Kind): Add `Kind.Enum'.
3023         (TypeContainer.Emit): Don't emit the enums here; they're already
3024         in the `RootContext.typecontainer_resolve_order'.
3025
3026         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
3027         here; they're already in the `typecontainer_resolve_order'.
3028
3029         * ecore.cs (EnumConstant.ConvertImplicitly): Add
3030         TypeManager.DropGenericTypeArguments().
3031
3032         * typemanager.cs
3033         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
3034         (TypeManager.IsEnumType): Likewise.
3035         (TypeManager.EnumToUnderlying): Likewise.
3036         (TypeManager.IsEqual): Add support for enums.
3037
3038 2007-03-12  Raja R Harinath  <rharinath@novell.com>
3039
3040         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
3041         DefaultParameterValueAttribute to be undefined, say if System.dll
3042         is not referenced.
3043
3044 2007-03-11  Marek Safar  <marek.safar@gmail.com>
3045
3046         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
3047         any mscorlib.
3048
3049 2007-03-10  Marek Safar  <marek.safar@gmail.com>
3050
3051         * class.cs, parameter.cs: Unified parameters verification.
3052
3053 2007-03-08  Martin Baulig  <martin@ximian.com>
3054
3055         * cs-parser.jay (constructor_header): Pass the location to the
3056         newly created TopLevelBlock.
3057
3058 2007-03-07  Martin Baulig  <martin@ximian.com>
3059
3060         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
3061
3062 2007-03-06  Miguel de Icaza  <miguel@novell.com>
3063
3064         * convert.cs (ExplicitReferenceConversionExists): Sync this method
3065         with the changes from David, fixes the build.
3066
3067 2007-03-05  David Mitchell  <dmitchell@logos.com>
3068
3069         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
3070         and its base interfaces to a one-dimensional array type S[],
3071         provided there is an implicit or explicit reference conversion
3072         from S to T.
3073
3074 2007-03-03  Marek Safar  <marek.safar@gmail.com>
3075
3076         * cs-tokenizer.cs: Implemented basic linq grammar.
3077
3078         * driver.cs: Set linq lang version on demand.
3079
3080 2007-02-26  Marek Safar  <marek.safar@gmail.com>
3081
3082         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
3083
3084 2007-02-25  Marek Safar  <marek.safar@gmail.com>
3085
3086         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
3087         (Fixes #80455)
3088
3089         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
3090         here.
3091         Check property and event extern attributes.
3092
3093         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
3094         charset.
3095
3096 2007-02-24  Marek Safar  <marek.safar@gmail.com>
3097
3098         A fix for bug #80407
3099         * ecore.cs: Don't report ambiguity error when methods have same parent.
3100
3101 2007-02-23  Marek Safar  <marek.safar@gmail.com>
3102
3103         A fix for bug #80878
3104         * class.cs, cs-parser.jay: Event property can host anonymous methods.
3105
3106 2007-02-22  Marek Safar  <marek.safar@gmail.com>
3107
3108         * attribute.cs: Enable ExtensionAttribute presence test.
3109
3110 2007-02-22  Marek Safar  <marek.safar@gmail.com>
3111
3112         * class.cs: Warn about missing GetHashCode only when Equals is override.
3113
3114         * decl.cs: Check accessibility of type arguments.
3115
3116         * typemanager.cs: Correctly report nullable array.
3117
3118 2007-02-20  Marek Safar  <marek.safar@gmail.com>
3119
3120         * class.cs, report.cs: Capture more details when things go wrong.
3121
3122 2007-02-20  Marek Safar  <marek.safar@gmail.com>
3123
3124         A fix for bug #80650
3125         * cs-parser.jay: Anonymous container starts at constructor declaration
3126         and not at block beginning because it has to be usable in constructor
3127         initializer.
3128
3129         * statement.cs: Use context location and not block one for error reporting.
3130
3131 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3132
3133         A fix for bug #78712
3134         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
3135         too.
3136
3137 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3138
3139         A fix for bug #80493 by Atsushi Enomoto
3140         * cs-parser.jay: Ignore invalid attribute target.
3141
3142 2007-02-18  Marek Safar  <marek.safar@gmail.com>
3143  
3144         * cs-tokenizer.cs: Ignore '\0' as white space character.
3145
3146 2007-02-17  Miguel de Icaza  <miguel@novell.com>
3147
3148         * cs-parser.jay: Add support for lambda expressions to the mcs
3149         compiler as well.
3150
3151         * lambda.cs: Only clone when we are probing, not on the final call
3152         (Compatible is the final call). 
3153
3154         * statement.cs (CloneContext): Introduce class to provide block
3155         remapping during clone.
3156
3157         All statements Clone themselves now.
3158
3159         (Clone): special handling for blocks, when we clone a block, we
3160         register the block inside this routine, as children of the block
3161         might trigger a lookup. 
3162         
3163         * expression.cs: Add support for CloneContext in all expressions. 
3164         
3165 2007-02-17  Marek Safar  <marek.safar@gmail.com>
3166  
3167         A fix for bug #80493
3168         * statement.cs: Report ambiguous warning when interfaces are not related.
3169
3170 2007-02-15  Marek Safar  <marek.safar@gmail.com>
3171
3172         C# 3.0 extension methods.
3173
3174         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
3175         cannot be used directly.
3176
3177         * class.cs (Class.Emit): Emit extension attribute if any class method
3178         is extension method.
3179         (Method.Define): Add basic extension method validation conditions.
3180         (Method.Emit): Emit extension attribute for method.
3181
3182         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
3183         extension method exists. Currently we follow same approach as Microsoft
3184         does, emit even if a method or a class are private but this can change
3185         later.
3186
3187         * cs-parser.jay: Add handling of `this' keyword in method parameters
3188         context.
3189
3190         * decl.cs (DeclSpace.IsStaticClass): New property.
3191         (MemberCache.FindExtensionMethods): Looks for extension methods with
3192         defined name and extension type.
3193
3194         * doc.cs: Updated after OverloadResolve changes.
3195
3196         * driver.cs: Add new soft reference to System.Core.dll.
3197
3198         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
3199         (ExtensionMethodGroupExpr): Represents group of extension methods.
3200
3201         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
3202         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
3203         to MethodGroupExpr and made non-static for easier customization.
3204         (Invocation.DoResolve): Add extension method lookup when no standard
3205         method was found.
3206         (MemberAccess.DoResolve): Try extension methods if no member exists.
3207
3208         * modifiers.cs: Add METHOD_EXTENSION modifier.
3209
3210         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
3211         as well as candidate extension type.
3212         (ComputeNamespaces): When assembly constains extension methods registers
3213         them.
3214         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
3215         extension method lookup.
3216         (Namespace.LookupExtensionMethod): Looks for extension method in this
3217         namespace.
3218         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
3219         find a method which matches name and extensionType.
3220
3221         * parameter.cs (Parameter): Add This modifer.
3222         (HasExtensionMethodModifier): New property.
3223         (Resolve): Add extension parameter check.
3224         (ModFlags): turned to property to exclude this modifier as it is not real
3225         parameter modifier.
3226         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
3227
3228         * support.cs (ParameterData): Add ExtensionMethodType.
3229         (ReflectionParameters): Implemented ExtensionMethodType interface property.
3230
3231         * typemanager.cs: Add type and ctor extension attribute type.
3232
3233 2007-02-15  Miguel de Icaza  <miguel@novell.com>
3234
3235         * report.cs (DisableErrors, EnableErrors): used to prevent error
3236         output when we are "trying" to compile various methods with
3237         different types. 
3238
3239         * ecore.cs (Expression): Add Clone method that calls the virtual
3240         CloneTo method.  The current CloneTo method in Expression throws
3241         an exception so we can track down all the places where this must
3242         be implemented (not using abstract, because that would be a lot of
3243         up-front-work before we can start testing the implementation
3244         idea). 
3245
3246         Important: we only need Clone capabilities for expressions created
3247         by the parser, as the expressions we will be cloning are
3248         expressions in the pre-resolved state.   This vastly simplifies
3249         the work required. 
3250         
3251         (SimpleName): Add CloneTo that does nothing.
3252         (EmptyCast): Add CloneTo.
3253         
3254         * expression.cs (Binary): Implement CloneTo.
3255         (Invocation.IsApplicable): Store the current ec in
3256         EmitContext.TempEc and restore it on return.  This is used so we
3257         do not have to sprinkle hundres of methods with an extra
3258         EmitContext, we know that the only user is the lambda expression
3259         ImplicitConversionExists code. 
3260         
3261         (Argument): Add Cloning capabilities.
3262         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
3263         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
3264         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
3265         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
3266         IndexerAccess): Add Clone capability.
3267
3268         (LocalVariableReference, This): TODO: needs cloned Block mapping.
3269
3270         (Argument): Add cloning capability.
3271
3272         * assign.cs (Assign): Implement CloneTo.
3273
3274         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
3275         
3276         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
3277         version by calling Convert with the EmitContext (that we are
3278         currently storing in ec, this is not great, but will do for now,
3279         to avoid passing EmitContext parameters to hundreds of functions
3280         that do not need them now).
3281
3282         (SetExpression): Remove, it is not needed.
3283         
3284         (ContextualReturn): Implement CloneTo.
3285
3286         * statement.cs (Statement): Implement cloning infrastructure,
3287         similar to expressions.
3288
3289         (Block): Partial implementation of Clone for statements.
3290
3291         (Return): Implement clone.
3292         
3293         * constant.cs (Constant.CloneTo): New method, does nothing.
3294
3295         * codegen.cs (TempEc): Add a static EmitContext as a temporary
3296         solution, until we decide how to exactly do this.  
3297         
3298 2007-02-14  Marek Safar  <marek.safar@gmail.com>
3299  
3300         A fix for bug #80493
3301         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
3302         a property is override we need to use second accessor.
3303
3304 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3305  
3306         A fix for bug #80418
3307         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
3308         methods.
3309
3310 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3311
3312         Another fix for bug #80749
3313         * pending.cs: Abstract class has priority over interfaces.
3314
3315 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3316
3317         Another fix for bug #80749
3318         * pending.cs: Abstract class has priority over interfaces.
3319
3320 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3321
3322         Another fix for bug #80749
3323         * pending.cs: Abstract class has priority over interfaces.
3324
3325 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3326
3327         Another fix for bug #80749
3328         * pending.cs: Abstract class has priority over interfaces.
3329
3330 2007-02-13  Marek Safar  <marek.safar@gmail.com>
3331
3332         * class.cs Better error message.
3333
3334         * driver.cs: Add shorter versions of -optimize option.
3335
3336 2007-02-13  Martin Baulig  <martin@ximian.com>
3337
3338         * class.cs (Constructor.Emit): Check the return value of
3339         ec.ResolveTopBlock() and return on error.
3340
3341 2007-02-13  Raja R Harinath  <rharinath@novell.com>
3342
3343         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
3344         message to fix error message regression.
3345
3346 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3347
3348         * delegate.cs: Delegate creation expression cannot be of Nullable type.
3349
3350 2007-02-12  Marek Safar  <marek.safar@gmail.com>
3351
3352         A fix for bug #80749
3353         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
3354         its parent container.
3355
3356         * class.cs (DefineFieldInitializers): Each initializer can has different
3357         resolve context.
3358
3359         * const.cs: Updated.
3360
3361 2007-02-11  Miguel de Icaza  <miguel@novell.com>
3362
3363         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
3364         now all the heavy lifting to check that embedded statements or
3365         expressions have the right form is done in the ContextualReturn.
3366
3367         (ContextualReturn): New class.  
3368
3369         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
3370         method that can be invoked to report 201, so we do not replicate
3371         this everywhere.
3372
3373         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
3374         
3375         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
3376         treating tabs as spaces. 
3377
3378 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3379
3380         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
3381         * assign.cs: Use full implicit conversion for right side check.
3382
3383 2007-02-09  Marek Safar  <marek.safar@gmail.com>
3384
3385         * statement.cs (Switch): Switch over boolean type is not standardized.
3386
3387 2007-02-08  Marek Safar  <marek.safar@gmail.com>
3388
3389         A fix for bug #80755
3390         * decl.cs (FindBaseEvent): Don't use method cache for events.
3391
3392 2007-02-07  Marek Safar  <marek.safar@gmail.com>
3393
3394         * cs-parser.jay: Better syntax error handling.
3395
3396         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
3397         instead of underlying type value.
3398
3399 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3400
3401         * driver.cs: Check define identifier before is registered.
3402
3403         * namespace.cs: Use existing error message.
3404
3405         * report.cs: New warning.
3406
3407 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3408
3409         A fix for bug #80742
3410         * expression.cs: Delegate Invoke method can be called directly.
3411
3412 2007-02-06  Marek Safar  <marek.safar@gmail.com>
3413
3414         A fix for bug #80676
3415         * class.cs (IsEntryPoint): The Main method can have params modifier.
3416
3417 2007-02-04  Miguel de Icaza  <miguel@novell.com>
3418
3419         * parameter.cs (Parameter, Parameters): Add Clone method.
3420
3421         * anonymous.cs (Compatible): Turn method into virtual method, so
3422         LambdaExpression can implement a different behavior.
3423
3424         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
3425         out the basic checking here, so it can be used by
3426         LambdaExpressions.
3427         
3428         * lambda.cs: Introduce "Compatible" function that will do the
3429         heavy lifting.
3430
3431 2007-02-02  Marek Safar  <marek.safar@gmail.com>
3432
3433         * attribute.cs: Unified one error message.
3434
3435         * class.cs (Class): Use type attributes and not properties to test static
3436         class.
3437         (IsEntryPoint): Don's pass local variable.
3438
3439         * convert.cs: Removed duplicate check.
3440
3441         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
3442
3443         * driver.cs: Don't crash when soft reference does not exist.
3444
3445         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
3446         (UsingEntry): Removed redundant allocation.
3447
3448         * parameter.cs: Add fast path for type parameters.
3449
3450         * support.cs: Don't allocate attribute when it's not used.
3451
3452 2007-01-30  Miguel de Icaza  <miguel@novell.com>
3453
3454         * anonymous.cs
3455         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
3456         this into a virtual method, so we can override it in LambdaExpression.
3457
3458         * driver.cs: Improve diagnostics in case of failure. 
3459
3460         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
3461         write a function that is slightly more complex and that parses:
3462
3463         type identifier [, type identifier]* )
3464
3465         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
3466         this expression:
3467
3468                 (canEmpty ? i >= 0 : i > 0)
3469
3470 2007-01-30  Raja R Harinath  <rharinath@novell.com>
3471
3472         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
3473         exception on possibly valid code.
3474
3475 2007-01-29  Raja R Harinath  <rharinath@novell.com>
3476
3477         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
3478         Push/PopPosition.
3479         (parse_opt_type_arguments): Remove.  It's almost the same as
3480         parse_less_than.
3481         (parse_namespace_or_typename): Use parse_less_than.
3482
3483 2007-01-28  Miguel de Icaza  <miguel@novell.com>
3484
3485         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
3486         this bug took a few hours to find, because the state saved and
3487         restored by PushPosition and PopPosition was ignoring the state of
3488         parse_generic_less_than.
3489
3490         I can also now remove the handling of OP_LT and OP_GT, this solves
3491         the big mistery.
3492         
3493         * cs-tokenizer.cs: store the location for the ARROW token, we use
3494         that in the parser.
3495
3496         (PushPosition, PopPosition): save/restore also `current_token',
3497         restore `parse_generic_less_than' (was missing).
3498
3499         (parse_opt_type_arguments): use parse_type, not
3500         parse_namespace_or_typename to parse types.
3501
3502         * lambda.cs: Empty new file, will eventually have the lambda
3503         expression implementation.
3504
3505         * lambda.test: used to test the internal tokenizer. 
3506
3507         * report.cs (FeatureIsNotISO1): Rename from
3508         FeatureIsNotStandardized, because it was about the language level
3509         (1 vs 2) it was not about standarization.
3510
3511         (FeatureRequiresLINQ): New.
3512
3513         * support.cs (SeekableStreamReader): Only require that the reader
3514         is a TextReader, not a StreamReader, so we can plug StringReader. 
3515
3516         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
3517         given position in the input stream the following tokens can be
3518         parsed as a type followed by an identifier.
3519
3520         (is_punct): after a '(' if parse_type_and_parameter returns true,
3521         then return a special token OPEN_PARENS_LAMBDA which is used to
3522         avoid reduce/reduce errors in the grammar for the
3523         lambda_expression rules.
3524
3525         (parse_type): implement a type parser inside the
3526         tokenizer, the parser only returns true or false depending on
3527         whether the input at a given position can be parsed as a type.
3528
3529         (peek_token): new method used during type parsing.
3530
3531 2007-01-28  Raja R Harinath  <rharinath@novell.com>
3532
3533         Fix #80531
3534         * anonymous.cs (ScopeInfo.InflateParameters): New.
3535         (AnonymousContainer.Resolve): Use it to redirect types of
3536         delegate parameters.
3537
3538 2007-01-27  Raja R Harinath  <rharinath@novell.com>
3539
3540         Fix #80530
3541         * expression.cs (Error_InvalidArguments): Don't use two different
3542         messages for CS1503.  Use ExtraInformation and
3543         SymbolRelatedToPreviousError instead.
3544
3545         Fix #80358
3546         * decl.cs (DeclSpace.initialize_type_params): Don't access
3547         'type_params' of a partial class directly.
3548
3549 2007-01-26  Miguel de Icaza  <miguel@novell.com>
3550
3551         * constant.cs: Removed a handful of out-of-range checks that were
3552         not necessary. 
3553
3554 2007-01-25  Marek Safar  <marek.safar@gmail.com>
3555
3556         * expression.cs (CheckUselessComparison): Add additional check for char
3557         constants.
3558
3559         * namespace.cs: Fixed typo.
3560
3561 2007-01-23  Miguel de Icaza  <miguel@novell.com>
3562
3563         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
3564         gone, instead we inline the test, preventing the needless casts to
3565         longs, ulongs and doubles for the parameters, avoiding calls to
3566         methods that overchecked stuff, and instead inlined things
3567         nicely. 
3568
3569 2007-01-20  Marek Safar  <marek.safar@gmail.com>
3570
3571         * cs-parser.jay: Better parameter error handling.
3572
3573 2007-01-17  Marek Safar  <marek.safar@gmail.com>
3574
3575         A fix for bug #80368, #80522
3576         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
3577         whether array initializer contains constants only.
3578         (ArrayCreation.Emit): Use better formula to decide when
3579         are array initializers for static initialization.
3580         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
3581         have to emit even constants otherwise they are pre-initialized.
3582
3583 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
3584             Raja R Harinath  <rharinath@novell.com>
3585
3586         Fix emit order of 'get' vs. 'set'.
3587         * support.cs (Accessors): New.
3588         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
3589         Note the order in which accessors are declared in the source.
3590         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
3591         Refactored from Property.Define and Indexer.Define.
3592         (PropertyBase.DefineAccessors): New helper that calls the above in
3593         appropriate order as noted by the parser.
3594         (Property.Define, Indexer.Define): Update to changes.
3595         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
3596
3597 2007-01-17  Raja R Harinath  <rharinath@novell.com>
3598
3599         Fix cs0029-6.cs and gcs0029-2.cs (regression)
3600         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
3601         there's an implicit conversion from the current type to the target
3602         type before converting the underlying constant.
3603
3604 2007-01-16  Marek Safar  <marek.safar@gmail.com>
3605
3606         * const.cs (ResolveValue): Updated after constant conversion was made more
3607         generic.
3608
3609         * constant.cs (GetAttributableValue): constant to object conversion is
3610         used for attributes only.
3611         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
3612         constant conversions.
3613         (LongConstant.ConvertImplicitly): Ditto.
3614
3615         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
3616         (ImplicitConversionStandard): Handle constant conversion as extra step.
3617         It solves the issue when constant conversion was called indirectly like
3618         inside array initializer and constant folding was skipped.
3619
3620         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
3621         this change.
3622
3623         * statement.cs(ImplicitConversionStandard): Updated after constant
3624         conversion was made more generic.
3625
3626 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
3627
3628         * expression.cs (As.DoResolve): Use GenericConstraints instead of
3629         Constraints, solves the problem where the compiler incorrectly
3630         reported that a type parameter was not constrained to a class (Bug
3631         80518)
3632
3633 2007-01-14  Marek Habersack  <grendello@gmail.com>
3634
3635         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
3636
3637 2007-01-14  Marek Safar  <marek.safar@gmail.com>
3638
3639         A fix for bug #80368
3640         * assign.cs (FieldInitializer): New class implements field
3641         initializer statement.
3642
3643         * attribute.cs: Update after FieldMember rename.
3644
3645         * class.cs (PropertyBasedMember): New common class for property based
3646         types.
3647         (InterfaceMemberBase): New base class for all members which can be used as
3648         an interface members.
3649         (MethodCore): Moved really common code to InterfaceMemberBase.
3650         (Method.Define): Equal and GetHasCode detection is relevant for methods
3651         only.
3652         (MethodData.Define): Don't assume that public event implements an
3653         interface automatically.
3654         (MethodData.DefineMethodBuilder): Issue an error even if only extern
3655         modifier is used.
3656         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
3657         (FieldMember): Merged with FieldBase.
3658         (EventProperty.AEventPropertyAccessor): New specialization to check whether
3659         event extern modifier can be used.
3660         (EventField.EventFieldAccessor): Moved event field specific code here.
3661         (Event.AllowedModifiers): Even event can be extern.
3662         (Event.FindOutBaseMethod): New override specific to events.
3663         (Indexer.parameters): Reintroduce parameters because base class holds
3664         only properties common data.
3665         (Indexer.CheckForDuplications): Indexers are threated as methods so we
3666         need do extra parameters check.
3667
3668         * const.cs: Update after FieldMember rename.
3669
3670         * decl.cs (MemberCache.FindBaseEvent): New method.
3671
3672         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
3673         to reflect that indexer is now derived from PropertyBased.
3674
3675         * ecore.cs (GetMemberType): Made public.
3676         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
3677         obsolete event.
3678
3679         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
3680         
3681         * typemanager.cs (CSharpSignature): Correctly print event accessors.
3682         (RegisterEvent): Removed.
3683         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
3684         (GetPrivateFieldOfEvent): Renamed to GetEventField.
3685
3686 2007-01-11  Raja R Harinath  <rharinath@novell.com>
3687
3688         Fix #80249
3689         * statement.cs (CollectionForeach.TryType): Prefer generic
3690         GetEnumerator over non-generic variant.  Fix code to follow comments.
3691
3692 2007-01-09  Raja R Harinath  <rharinath@novell.com>
3693
3694         Fix #80446
3695         * support.cs (ReflectionParameter): Don't use an invalid index on
3696         the generic parameter data.
3697
3698 2007-01-08  Miguel de Icaza  <miguel@novell.com>
3699
3700         * driver.cs: Just add a tiny bit of infrastructure.
3701
3702 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3703
3704         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
3705         where field type is struct from current assembly.
3706         
3707         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
3708         it is possible.
3709
3710 2007-01-02  Marek Safar  <marek.safar@gmail.com>
3711
3712         A fix for bug #80381
3713         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
3714         the core types.
3715
3716         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
3717         messages.
3718         (Namespace.LookupType): Always use core types from corlib when speficied.
3719
3720         * report.cs: A new warning.
3721
3722         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
3723         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
3724         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
3725
3726         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
3727         (InitCoreTypes): Set expression type of object_type and value_type
3728         immediately after lookup.
3729
3730 2007-01-01  Miguel de Icaza  <miguel@novell.com>
3731
3732         * cs-tokenizer.cs: Accept Pc class characters (Connector
3733         Punctuation) as valid identifiers.  Fixes #78259
3734
3735         * expression.cs (Invocation.DoResolve): Moved the check for the
3736         use of `this' for doing method calls to the Invocation resolution
3737         step, after overload resolution has taken place instead of doing
3738         the check at the low-level `This.DoResolve' level.
3739
3740         The `This.DoResolve'(appens before overload resolution, so it has
3741         no way of knowing if the method that will be called will be
3742         instace or static, triggering an erroneous report for cs0188 (Bug
3743         78113).
3744
3745         We now do the check for instance method invocations after we know
3746         what method will be called.
3747
3748         (This.CheckThisUsage): Move the actual use of this structure
3749         checking into its own method and expose it. 
3750
3751         * Everywhere that called Error_ValueCannotBeConverted: pass a new
3752         EmitContext.
3753
3754         Exceptions: Null.ConvertImplicitly,
3755         Constant.ImplicitConversionRequired as there are too many call
3756         sites for passing the ec. 
3757
3758         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
3759         EmitContext, if the value is null, then we do not try to provide
3760         the extra information from the error (If a userdefined conversion
3761         exists, as UserDefinedConversion requires a non null-EmitContext).
3762
3763         Fixes: #80347
3764
3765 2006-12-30  Raja R Harinath  <rharinath@novell.com>
3766
3767         * flowanalysis.cs (MyBitVector): Document some invariants.
3768         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
3769         introduced below, and add a couple of others, 
3770
3771 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3772
3773         * attribute.cs (GetMethodObsoleteAttribute): Uses new
3774         GetPropertyFromAccessor and GetEventFromAccessor.
3775         
3776         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
3777         overrides non-obsolete one.
3778         (Indexer.Define): Error message has been moved to the parser.
3779
3780         * cs-parser.jay: Better syntax errors handling.
3781
3782         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
3783         when an invocation has no arguments.
3784
3785         * ecore.cs: Removed not used caching.
3786
3787         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
3788         implementation.
3789
3790         * report.cs: Add a new warning.
3791
3792         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
3793
3794         * typemanager.cs (enumeration_type): Removed.
3795         (CSharpSignature): Reuses IsSpecialMethod.
3796         (IsEqual): Hack for MS BCL.
3797         (GetPropertyFromAccessor): New method.
3798         (GetEventFromAccessor): New method.
3799         (IsSpecialMethod): Fixed to handle more cases.
3800
3801 2006-12-30  Marek Safar  <marek.safar@gmail.com>
3802
3803         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
3804         Made white spaces array static.
3805
3806         * ecore.cs (RemoveGenericArity): Optimized.
3807
3808         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
3809         10 times faster).
3810         (MyBitVector.initialize_vector): Simplified.
3811
3812 2006-12-22  Miguel de Icaza  <miguel@novell.com>
3813
3814         * ecore.cs: Am not entirely happy with this hack, but it seems to
3815         address the issue in 80257 (a small test case for
3816         CreativeDocs.NET). 
3817
3818         I set the MethodGroupExpr.Type to an internal compiler type
3819         (itself in this case) to force the resolution to take place.   Why
3820         it does not take place with a null is beyond me.
3821
3822 2006-12-20  Marek Safar  <marek.safar@gmail.com>
3823
3824         A fix for bug #80288
3825         * expression.cs (ResolveOperator): Consider user defined conversion for
3826         logical and operator too.
3827         (EmitBranchable): Optimization for logical and when full constant folding
3828         could not be applied but one operand is constant.
3829
3830 2006-12-19  Marek Safar  <marek.safar@gmail.com>
3831
3832         * class.cs (GetClassBases): Write 5 times every day, will never use
3833         FullName for error reporting.
3834
3835         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
3836
3837 2006-12-19  Martin Baulig  <martin@ximian.com>
3838
3839         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
3840         the symbol file info here.
3841
3842 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3843
3844         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
3845         of `elseif' is taking then following sections are not taking.
3846         Fixes an issue reported on mono mailing list.
3847
3848 2006-12-18  Marek Safar  <marek.safar@gmail.com>
3849
3850         A fix for bug #80300
3851         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
3852         a caller is not taking.
3853
3854 2006-12-18  Raja R Harinath  <rharinath@novell.com>
3855
3856         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
3857         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
3858         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
3859         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
3860         * class.cs: Update to changes.
3861
3862 2006-12-17  Marek Safar  <marek.safar@gmail.com>
3863
3864         A fix for bug #79934
3865         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
3866         partial container.
3867
3868         * class.cs (ResolveMembers): Register an iterator in current container and
3869         not in shared one.
3870
3871 2006-12-16  Raja R Harinath  <rharinath@novell.com>
3872
3873         Fix test-543.cs
3874         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
3875         satisfy a params annotated parameter.
3876
3877 2006-12-16  Marek Safar  <marek.safar@gmail.com>
3878
3879         A fix for bug #77014
3880         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
3881         paramters correctly and not rely on hacks in Parameters class.
3882         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
3883         at any possition.
3884         (Invocation.VerifyArgumentsCompat): Ditto.
3885         (Invocation.EmitArguments): Changed to correctly emit params arguments at
3886         any possition.
3887
3888         * parameter.cs (HasParams): Don't assume that params is the last one.
3889
3890         * support.cs (ReflectionParameters.ctor): Look for params attribute
3891         correctly.
3892         (ReflectionParameters.ParameterType): Removed hack when we returned last
3893         parameter for out of range parameters.
3894         (ParameterName, ParameterModifier): Ditto.
3895
3896 2006-12-14  Marek Safar  <marek.safar@gmail.com>
3897
3898         A fix for bug #79987
3899         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
3900         when assembly is not CLS compliant but type is. I have no idea why is this
3901         allowed.
3902
3903         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
3904
3905 2006-12-13  Miguel de Icaza  <miguel@novell.com>
3906
3907         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
3908         in struct constructors, they are basically no-ops.
3909
3910 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3911
3912         * cs-tokenizer.cs (Position): Save preprocessor status too.
3913
3914 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3915
3916         A fix for bug #77794
3917         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
3918
3919 2006-12-12  Marek Safar  <marek.safar@gmail.com>
3920
3921         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
3922         Fixes #69299.
3923         (pp_expr): Report error for an invalid expression.
3924         (handle_preprocessing_directive): Simplified; add more error checking.
3925
3926 2006-12-11  Marek Safar  <marek.safar@gmail.com>
3927
3928         A fix for bug #74939
3929         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
3930         directives handling.
3931
3932 2006-12-10  Marek Safar  <marek.safar@gmail.com>
3933
3934         A fix for bugs #80093, and #75984
3935         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
3936         logic, it seems to me as it worked before "by coincidence".
3937         (xtoken): Simplified to use reworked handle_preprocessing_directive.
3938         (cleanup): Enabled endif check.
3939
3940 2006-12-09  Marek Safar  <marek.safar@gmail.com>
3941
3942         A fix for bug #80162
3943         * statement.cs (CollectionForeach.TryType): Generics and non-generics
3944         enumerators are never ambiguous.
3945
3946 2006-12-08  Raja R Harinath  <rharinath@novell.com>
3947
3948         Fix #80060
3949         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
3950
3951 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3952
3953         A fix for bug #80144
3954         * class.cs (EventProperty.Define): Explicit implementation means
3955         that an even is used.
3956
3957 2006-12-06  Marek Safar  <marek.safar@gmail.com>
3958
3959         Fixes the operators implementation (part II)
3960
3961         * cfold.cs (DoConstantNumericPromotions): Renamed to
3962         DoBinaryNumericPromotions and simplified.
3963         (BinaryFold): Couple of conversion fixes; simplified.
3964
3965         * constant.cs, ecore.cs, literal.cs
3966         (ToType): Renamed to ConvertImplicitly.
3967         (Reduce): Renamed to ConvertExplicitly.
3968
3969         * class.cs, convert.cs: Updated.
3970
3971         * expression.cs: TryReduce doesn't throw an exception.
3972
3973 2006-12-01  Marek Safar  <marek.safar@gmail.com>
3974
3975         A fix for bug #80108
3976         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
3977         compatible.
3978
3979 2006-11-30  Marek Safar  <marek.safar@gmail.com>
3980
3981         Fixes unary operators implementation (part I)
3982         Also fixes #80026
3983
3984         * cfold.cs (Error_CompileTimeOverflow): Made internal
3985
3986         * const.cs (IConstant): Changed to use reference to constant and
3987         not constant itself.
3988         Updated IConstant implementations.
3989
3990         * constant.cs (CreateConstant): New factory method.
3991         Updated IConstant implementation.
3992
3993         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
3994
3995         * ecore.cs: Updated to use CreateConstantReference.
3996
3997         * enum.cs: Reflects IConstant changes.
3998
3999         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
4000
4001         * literal.cs (NullConstant): Change to be independently usable.
4002
4003 2006-11-29  Martin Baulig  <martin@ximian.com>
4004
4005         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
4006         we need to emit the scope initializer before calling the base .ctor.
4007
4008         * anonymous.cs: Merged back from the new anonymous methods branch.
4009         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
4010
4011         * expression.cs (ParameterReference.DoResolveBase): Create a
4012         "normal" ScopeInfo when capturing parameters rather than using the
4013         root scope; this makes things work with anonymous methods having
4014         parameters.
4015
4016         * statement.cs
4017         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
4018
4019 2006-11-22  Marek Safar  <marek.safar@gmail.com>
4020
4021         A fix for bug #79987
4022         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
4023         check to a base class.
4024         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
4025         only when assembly has missing attribute.
4026         * report.cs: Update.
4027
4028 2006-11-21  Marek Safar  <marek.safar@gmail.com>
4029
4030         * cs-tokenizer.cs: Merged with gmcs version.
4031
4032 2006-11-20  Marek Safar  <marek.safar@gmail.com>
4033
4034         * cs-tokenizer.cs,
4035         * cs-parser.jay: Better error message when partial keyword is misplaced.
4036
4037 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
4038
4039         A fix for bug #79810
4040         report.cs: CS1058 only applies to 2.0 profile (gmcs).
4041         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
4042         a RuntimeWrappedException by default.
4043
4044 2006-11-18  Marek Safar  <marek.safar@gmail.com>
4045
4046         A fix for bug #79843
4047         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
4048         implementation.
4049         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
4050
4051 2006-11-18  Marek Safar  <marek.safar@gmail.com>
4052
4053         * driver.cs, namespace.cs: Uses faster IndexOf version.
4054
4055 2006-11-17  Marek Safar  <marek.safar@gmail.com>
4056
4057         A fix for bug #79941
4058         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
4059         operators.
4060         (Operator.Define): Implicit/Explicit operator of same type is duplicate
4061         even if internal name is different.
4062         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
4063         (UserDefinedConversion): Simplified as the operators cannot be internal.
4064         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
4065         conversions.
4066         (MethodLookup): Replaced EmitContext with parentType.
4067         * expression.cs: Updated.
4068
4069 2006-11-09  Raja R Harinath  <rharinath@novell.com>
4070
4071         * driver.cs (BadAssembly): Handle all the ugliness of
4072         DefineDynamicAssembly.
4073
4074 2006-11-08  Raja R Harinath  <rharinath@novell.com>
4075
4076         Address parts of #58244 -- most of what's left is in the runtime
4077         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
4078         CS1509 error checks, and handle them for all assembly loads, not
4079         just the first invocation.
4080         (LoadModule): Likewise.  Move handling of 'adder_method' ...
4081         * codegen.cs (AssemblyClass.AddModule): ... here.
4082
4083 2006-11-02  Marek Safar  <marek.safar@gmail.com>
4084
4085         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
4086         IEnumerable<T> is ambiguous.
4087
4088 2006-10-31  Marek Safar  <marek.safar@gmail.com>
4089
4090         A fix for bug #67689
4091         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
4092         GetEnumerator is ambiguous.
4093
4094         * report.cs: Add new warning.
4095
4096 2006-10-29  Marek Safar  <marek.safar@gmail.com>
4097
4098         A fix for bug #78602
4099         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4100         to protected member can be nested type.
4101
4102 2006-10-28  Marek Safar  <marek.safar@gmail.com>
4103
4104         A fix for bug #78965
4105         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
4106         to protected member must derive from current type.
4107
4108 2006-10-27  Marek Safar  <marek.safar@gmail.com>
4109
4110         assign.cs: Reuses error method.
4111
4112         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
4113         instead of type for constants.
4114         (Expression.Error_ValueAssignment): Common error method.
4115
4116         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
4117         for any assignment.
4118
4119 2006-10-27  Marek Safar  <marek.safar@gmail.com>
4120
4121         A fix for bug #79081
4122         * expression.cs (MemberAccess.DoResolve): Check nested type
4123         accessibility.
4124
4125 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
4126
4127         * doc.cs : nested delegates were not handled. Fixed bug #79754.
4128
4129 2006-10-26  Marek Safar  <marek.safar@gmail.com>
4130
4131         A fix for bug #76591
4132         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
4133
4134 2006-10-26  Marek Safar  <marek.safar@gmail.com>
4135
4136         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
4137         type forwarder of the same type multiple times.
4138
4139 2006-10-26  Raja R Harinath  <rharinath@novell.com>
4140
4141         Fix #78820
4142         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
4143         instance as an rvalue, even when we later resolve as an lvalue.
4144
4145 2006-10-25  Martin Baulig  <martin@ximian.com>
4146
4147         * anonymous.cs: Fix #79673.
4148
4149 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
4150
4151         A fix for bug #79666
4152         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
4153         ignored when is optimized (= default value) as its value is already set.
4154
4155 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4156
4157         A fix for bug #79724
4158         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
4159         TypeContainer for type lookup.
4160
4161 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
4162
4163         A fix for bug #79231
4164         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
4165         * expression.cs (OverloadResolve): Always convert type name for
4166         an error message.
4167         (ResolveNamespaceOrType): Don't confuse a nested type with any 
4168         other member.
4169
4170 2006-10-18  Martin Baulig <martin@ximian.com>
4171
4172         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
4173
4174 2006-10-17  Miguel de Icaza  <miguel@novell.com>
4175
4176         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
4177         an int32, but requesting an int64 from the conversion
4178
4179 2006-10-12  Martin Baulig  <martin@ximian.com>
4180
4181         * anonymous.cs
4182         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
4183         
4184 2006-10-12  Martin Baulig  <martin@ximian.com>
4185
4186         * statement.cs
4187         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
4188
4189 2006-10-11  Miguel de Icaza  <miguel@novell.com>
4190
4191         * convert.cs: Remove broken code: I was doing the "Existance"
4192         tests for Implicit conversions.
4193
4194 2006-10-10  Miguel de Icaza  <miguel@novell.com>
4195
4196         * convert.cs: Added one missing case in
4197         ImplicitStandardConversionExists uint64 to intptr.
4198
4199         Fixes #59800
4200         
4201         * typemanager.cs (uintptr_type): another core known type.   
4202
4203         * ecore.cs (OperatorCast): routine used to do cast operations that
4204         depend on op_Explicit.  We could change some of the Decimal
4205         conversions to use this.
4206
4207         This one has a probe mechanism that checks both types for an op_
4208         which it coudl be used to eliminate two classes: CastToDecimal
4209         and CastFromDecimal.
4210
4211         * convert.cs: Implement the conversions documented in #59800
4212         
4213 2006-10-10  Martin Baulig  <martin@ximian.com>
4214
4215         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
4216         before RootScope.ResolveMembers().
4217
4218         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
4219         `CurrentType' if appropriate.
4220
4221 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
4222
4223         A fix for bug #78568
4224         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
4225         when contains binary operators.
4226         * cs-parser.jay: Updated.
4227
4228 2006-10-09  Martin Baulig  <martin@ximian.com>
4229
4230         * delegate.cs
4231         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
4232         moved that into Define() and also do the other type parameter
4233         checks there.  Fixes #79094.  Added gtest-292.cs.
4234
4235         * expression.cs
4236         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
4237         since that doesn't include type parameters; don't use `Ldelema'
4238         for type parameters.  Fixes #78980.  Added gtest-293.cs.
4239
4240 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
4241
4242         A fix for #77796
4243         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
4244         conversion is allowed.
4245
4246 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4247
4248         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
4249         error reporting when no error occurs.
4250
4251 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
4252
4253         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
4254         does not exist.
4255
4256 2006-10-06  Raja R Harinath  <rharinath@novell.com>
4257
4258         Fix #79584
4259         * class.cs (DefineTypeBuilder): Check circular dependencies before
4260         setting the parent of the TypeBuilder.
4261         (CheckRecursiveDefinition): Don't use 'BaseType', since
4262         it may not be valid until after DefineTypeBuilder.  Use
4263         'base_type' instead.
4264
4265 2006-10-04  Martin Baulig  <martin@ximian.com>
4266
4267         Merged the Anonymous Methods patch.
4268
4269         * anonymous.cs, iterators.cs: The new anonymous methods code.
4270
4271         * statement.cs (Variable): New public abstract class.
4272         (LocalInfo.Variable): New public property.
4273         (LocalInfo.ResolveVariable): New public method.
4274         (Block.Flags): Add `IsIterator'.
4275         (Block.AddVariable): Improved the CS0136 check.
4276         (Block.AnonymousChildren): New public property.
4277         (Block.AddAnonymousChild): New public method.
4278         (ToplevelBlock): Update to use the new anonymous method framework.
4279         (ToplevelBlock.ctor): `container' is now a `Block' and not a
4280         `ToplevelBlock'; this is required to correctly implement the
4281         CS0136 check.
4282         (Fixed, Using): Use `TemporaryVariable' instead of directly
4283         creating the `LocalBuilder'.
4284
4285         * parameter.cs (Parameter.ResolveVariable): New public method.
4286         (Parameters.ResolveVariable): Likewise.
4287
4288         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
4289
4290         * class.cs (TypeContainer): Replaced the `iterators' list and
4291         corresponding methods with a list of `CompilerGeneratedClass'es.
4292         (TypeContainer.ResolveMembers): New public method.
4293         (Method): `IIteratorContainer' has been replaced by
4294         `IAnonymousHost'.
4295
4296         * expression.cs (VariableReference): New public abstract base
4297         class for `LocalVariableReference', `ParameterReference' and
4298         `This'.
4299
4300         * codegen.cs (EmitContext): Removed `capture_context',
4301         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
4302         (EmitContext.EmitThis): Removed.
4303
4304         * cs-parser.jay: Replace `iterator_container' with
4305         `anonymous_host'.       
4306
4307 2006-10-04  Martin Baulig  <martin@ximian.com>
4308
4309         * generic.cs (GenericMethod): Don't make this abstract.
4310         (Constraints.Clone): Added dummy implementation.
4311
4312 2006-10-04  Raja R Harinath  <harinath@gmail.com>
4313
4314         Fix #79577
4315         * namespace.cs (LookForAnyGenericType): Avoid nullref on
4316         'declspaces'.  Avoid allocating arrays willy-nilly.
4317
4318         Fix #79553
4319         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
4320         cases out of the switch.
4321
4322 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4323
4324         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
4325         message when non-generic type is used with the type arguments.
4326         * expression.cs: Updated.
4327
4328 2006-09-28  Raja R Harinath  <rharinath@novell.com>
4329
4330         Fix #79013
4331         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
4332         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4333         Change semantics slightly.  Don't insist on having only one
4334         temporary EmptyExpression -- just throttle the creation of new ones.
4335
4336         Fix #79451
4337         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
4338         non-interfaces too.  If no methods are found, don't try to create
4339         a MethodGroupExpr.
4340
4341 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
4342
4343         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
4344         generic type.
4345
4346         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
4347         us produce better error message.
4348
4349 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
4350
4351         * expression.cs (Binary.ResolveOperator): Warn about a side effect
4352         of the `|' operator.
4353
4354         * report.cs: A new warning added.
4355
4356 2006-09-27  Martin Baulig  <martin@ximian.com>
4357
4358         * generic.cs (GenericMethod): Don't make this abstract.
4359
4360 2006-09-27  Martin Baulig  <martin@ximian.com>
4361
4362         * report.cs
4363         (InternalErrorException): Added overloaded ctor taking a params array.
4364
4365 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
4366
4367         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
4368         Fixed the cases when same error was reported twice.
4369
4370         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
4371         now report symbol information.
4372
4373 2006-09-25  Martin Baulig  <martin@ximian.com>
4374
4375         * class.cs: Completely unified with the gmcs version.
4376
4377 2006-09-25  Martin Baulig  <martin@ximian.com>
4378
4379         * typemanager.cs (TypeManager.IsNullableType): New public function.
4380         (TypeManager.IsNullableTypeOf): Likewise.
4381         (TypeManager.IsNullableValueType): Likewise.
4382
4383         * class.cs (MethodCore): Added the `GenericMethod' argument from
4384         gmcs and also unified all classes derived from `MethodCore' with gmcs.
4385
4386 2006-09-24  Raja R Harinath  <harinath@gmail.com>
4387
4388         * convert.cs: Unify with gmcs version.
4389
4390 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4391
4392         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
4393         verify them as well.
4394
4395         * report.cs: New warning.
4396
4397 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4398
4399         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
4400         for anonymous block with out argument.
4401
4402 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
4403
4404         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
4405         not used private events only.
4406
4407 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
4408
4409         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
4410
4411         * const.cs (Const.Define): Check for constant type.
4412         (Const.IsConstantTypeValid): Looks for valid constant types.
4413
4414         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
4415
4416         * ecore.cs (EmptyConstantCast): New common class for all constant based
4417         EmptyCast(s).
4418
4419         * expression.cs (Is.DoResolve): Handle null constant especially.
4420         (New.DoResolve): Check for new void().
4421         (MemberAccess.DoResolve): Cope with all kind of nulls.
4422
4423         * literal.cs (NullConstant): Uses EmptyConstantCast.
4424         (NullDefault): Based on EmptyConstantCast.
4425         (NullLiteral): Uses EmptyConstantCast.
4426
4427         * statement.cs (Block.ResolveMeta): Check for constant type.
4428
4429 2006-09-22  Martin Baulig  <martin@ximian.com>
4430
4431         * delegate.cs, attribute.cs: Merged with the gmcs versions.
4432
4433 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4434
4435         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
4436         not the null type.
4437
4438         Fix part of #79451
4439         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
4440         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
4441         code slightly.
4442
4443 2006-09-22  Martin Baulig  <martin@ximian.com>
4444
4445         * ecore.cs: Merged with the gmcs version.
4446
4447         * generic.cs (ConstructedType): New dummy class.
4448         (TypeArguments): Don't make this abstract.
4449
4450         * typemanager.cs
4451         (TypeManager.IsGenericTypeDefinition): New method.
4452         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
4453
4454 2006-09-22  Raja R Harinath  <rharinath@novell.com>
4455
4456         * expression.cs (ComposedCast): Check for arrays of TypedReference
4457         before creating the type, not after.
4458
4459 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
4460
4461         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
4462         after ToType change.
4463
4464         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
4465         when constant must be implicitly convertible.
4466
4467         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
4468
4469         * ecore.cs (NullCast): Derives from NullConstant.
4470
4471         * expression.cs (Is.DoResolve): Removed useless variables.
4472         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
4473         (New.Constantify): Add enum support.
4474         (MemberAccess.DoResolve): Add warning when accessing null constant or
4475         variable.
4476
4477         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
4478         property.
4479
4480         * literal.cs (NullConstant): New abstract class with common
4481         functionality for all null specializations.
4482         (NullDefault): Represents default(X) when result can be
4483         reduced to null.
4484         (NullLiteral): Updated.
4485
4486         * report.cs: Add new warning.
4487
4488 2006-09-21  Martin Baulig  <martin@ximian.com>
4489
4490         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
4491
4492 2006-09-21  Martin Baulig  <martin@ximian.com>
4493
4494         * generic.cs (GenericConstraints): New dummy class.
4495         (Constraints): Likewise.
4496         (TypeParameter): Likewise.
4497         (TypeParameterName): Likewise.
4498         (GenericMethod): Likewise.
4499
4500         * typemanager.cs (TypeManager.GetGenericArguments): New method.
4501
4502         * decl.cs: Merged with the gmcs version.
4503
4504 2006-09-21  Raja R Harinath  <rharinath@novell.com>
4505
4506         * generic.cs (TypeParameter): Implement IMemberContainer.
4507         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
4508
4509         * rootcontext.cs: Unify with gmcs version.
4510
4511         * report.cs: Unify with gmcs version.
4512         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
4513         from gmcs/generics.cs.
4514         * generics.cs (TypeParameter): New dummy class.
4515
4516         * support.cs: Unify with gmcs version.
4517
4518 2006-09-20  Raja R Harinath  <rharinath@novell.com>
4519
4520         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
4521         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
4522
4523         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
4524         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
4525         * mcs.exe.sources: Add generic.cs.
4526
4527         * codegen.cs: Unify with gmcs version.
4528
4529         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
4530         (EmitContext): Add GenericDeclContainer implementation.
4531         * decl.cs (MemberCore, DeclSpace): Likewise.
4532         * namespace.cs: Remove #ifdef GMCS_SOURCE.
4533
4534         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
4535         MCS TypeManager has a corresponding dummy method.
4536
4537 2006-09-19  Martin Baulig  <martin@ximian.com>
4538
4539         * expression.cs: Completely merged with the gmcs version.
4540
4541 2006-09-19  Martin Baulig  <martin@ximian.com>
4542
4543         * expression.cs (Invocation): Merged with the gmcs version.
4544         (ArrayAccess.GetStoreOpcode): Likewise.
4545
4546 2006-09-19  Martin Baulig  <martin@ximian.com>
4547
4548         * typemanager.cs
4549         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
4550         (TypeManager.IsGenericMethodDefinition): Likewise.
4551
4552 2006-09-19  Martin Baulig  <martin@ximian.com>
4553
4554         * typemanager.cs
4555         (TypeManager.IsEqual): Moved the gmcs implementation here.
4556         (TypeManager.DropGenericTypeArguments): Likewise.
4557         (TypeManager.DropGenericMethodArguments): Likewise.
4558         (TypeManager.GetTypeArguments): Moved here from gmcs.
4559         (TypeManager.HasGenericArguments): Likewise.
4560
4561 2006-09-19  Martin Baulig  <martin@ximian.com>
4562
4563         * expression.cs (Binary): Merged with the gmcs version.
4564
4565 2006-09-19  Martin Baulig  <martin@ximian.com>
4566
4567         * expression.cs (Probe, As, Is): Merged with the gmcs version.
4568
4569 2006-09-19  Martin Baulig  <martin@ximian.com>
4570
4571         * typemanager.cs: Merged with the gmcs version.
4572
4573 2006-09-16  Raja R Harinath  <rharinath@novell.com>
4574
4575         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
4576         * driver.cs: Likewise.
4577
4578 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
4579
4580         A fix for #79401
4581         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
4582         only if parent type is class.
4583         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
4584         update.
4585
4586 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
4587
4588         * cs-parser.jay,
4589         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
4590         keywords are used.
4591         * typemanager.cs(CSharpName): Converts NullType to null.
4592
4593 2006-09-15  Martin Baulig  <martin@ximian.com>
4594
4595         * typemanager.cs
4596         (TypeManager.GetMethodName): Added mcs implementation.
4597         (TypeManager.IsEqual): Likewise.
4598
4599         * ecore.cs
4600         (SimpleName.RemoveGenericArity): Added dummy implementation.
4601
4602         * pending.cs: Merged with the gmcs version.     
4603
4604 2006-09-15  Martin Baulig  <martin@ximian.com>
4605
4606         * statement.cs: Merge with the gmcs version.
4607
4608 2006-09-15  Martin Baulig  <martin@ximian.com>
4609
4610         * statement.cs (Switch): Merge with the gmcs implementation
4611         (without nullables), which is newer.
4612
4613 2006-09-15  Martin Baulig  <martin@ximian.com>
4614
4615         * statement.cs (Block.Variables): Make this public.
4616         (ToplevelBlock.Parameters): Make this a property.
4617         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
4618
4619 2006-09-15  Martin Baulig  <martin@ximian.com>
4620
4621         * namespace.cs: Merge with the gmcs version.
4622
4623 2006-09-15  Martin Baulig  <martin@ximian.com>
4624
4625         * decl.cs (MemberName): Minor code cleanups.
4626
4627 2006-09-15  Martin Baulig  <martin@ximian.com>
4628
4629         * parameter.cs: Merge with the gmcs version.
4630
4631 2006-09-15  Martin Baulig  <martin@ximian.com>
4632
4633         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
4634         and an error in mcs.
4635
4636 2006-09-15  Martin Baulig  <martin@ximian.com>
4637
4638         * flowanalysis.cs: Merged from GMCS; added the generics code into
4639         a `GMCS_SOURCE' conditional so we can share this file.
4640
4641 2006-09-08  Martin Baulig  <martin@ximian.com>
4642
4643         * typemanager.cs (TypeManager.interlocked_type): New public field.
4644         (TypeManager.int_interlocked_compare-exchange): New public field.
4645         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
4646         enumerator types here and call InitGenericCoreTypes().
4647         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
4648         after calling InitEnumUnderlyingTypes().
4649
4650         * rootcontext.cs
4651         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
4652         `classes_second_stage'. 
4653
4654 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
4655
4656         * assign.cs, ecore.cs, expression.cs: Share error message text.
4657         * class.cs (FieldMember.Define): Check for varible of static type.
4658         * driver.cs (LoadAssembly): Uses error output for errors.
4659         * statement.cs: Updated.
4660
4661 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
4662
4663         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
4664         type instance.
4665
4666 2006-09-07  Martin Baulig  <martin@ximian.com>
4667
4668         * driver.cs
4669         (MainDriver): Revert r62663 from Marek; see #70506 for details.
4670
4671 2006-08-29  Miguel de Icaza  <miguel@novell.com>
4672
4673         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4674         
4675 2006-08-17  Miguel de Icaza  <miguel@novell.com>
4676
4677         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
4678         #52019 and #79064, the use of the \uXXXX sequence in source code
4679         to represent unicode characters.
4680
4681 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
4682
4683         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
4684         support.
4685         * class.cs, ecore.cs, statement.cs: Merged to one error message.
4686
4687 2006-08-13  Miguel de Icaza  <miguel@novell.com>
4688
4689         * assign.cs: Catch attempts to assign to a method groups in += and
4690         report as 1656
4691
4692 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
4693
4694         A fix for #79056
4695         * cs-parser.jay: Don't destroy current array type by typeof of array's.
4696
4697 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
4698
4699         * class.cs (Method.Define): Issue a warning when generic method looks like
4700         an entry point.
4701         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
4702         as well.
4703
4704 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
4705  
4706         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
4707         looking for ctor.
4708         * decl.cs (MemberCache.FindMembers): When container is interface we need to
4709         search all base interfaces as a member can be ambiguous.
4710         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
4711         Constructor member type filter. 
4712         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
4713         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
4714         reporting for returned memberinfos.
4715         * report.cs: Updated.
4716         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
4717         version to work on all runtimes.
4718         (TypeManager.RealMemberLookup): Removed members filtering.
4719
4720 2006-08-08  Raja R Harinath  <rharinath@novell.com>
4721
4722         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
4723         (PropertyExpr.EmitAssign): Likewise.
4724         * expression.cs (Indirection.EmitAssign): Likewise.
4725         (LocalVariableReference.EmitAssign): Likewise.
4726         (ParameterReference.EmitAssign): Likewise.
4727         (Invocation.EmitArguments): Likewise.
4728         (ArrayAccess.EmitAssign): Likewise.
4729         (IndexerAccess.EmitAssign): Likewise.
4730         (This.EmitAssign): Likewise.
4731         (ConditionalLogicalOperator.Emit): Likewise.
4732
4733         Fix #79026
4734         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
4735         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
4736         leave it in after returning it.
4737         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
4738
4739 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
4740
4741         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
4742         message.
4743
4744 2006-08-03  Raja R Harinath  <rharinath@novell.com>
4745
4746         Fix cs0146-3.cs and cs0146-4.cs.
4747         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
4748         enclosing types don't depend on the current type.
4749
4750 2006-08-02  Raja R Harinath  <rharinath@novell.com>
4751
4752         Fix #77963
4753         * class.cs (TypeContainer.DoDefineMembers): Use
4754         FindBaseMemberWithSameName on Parent, since we're interested in
4755         whether we hide inherited members or not.
4756         (FindBaseMemberWithSameName): Make slightly more robust.
4757
4758         Fix the non-generic testcase from #77396
4759         * decl.cs (DeclSpace.DeclContainer): Remove override.
4760
4761         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4762         declspaces for doppelgangers too.
4763         (UsingEntry): Implement IResolveContext.
4764         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
4765         'this' as the resolve context.
4766         (LocalAliasEntry): Likewise.
4767
4768         Implement parts of #77403
4769         * roottypes.cs (RootDeclSpace): New.  Used to represent the
4770         toplevel declaration space.  Each namespace declaration introduces
4771         a "partial" root declaretion space.
4772         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
4773         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
4774         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
4775         from 'current_namespace.SlaveDeclSpace'.
4776         (namespace_declaration): Likewise.
4777         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
4778         check.  It can't happen now.
4779         * decl.cs (DeclSpace.LookupType): Likewise.
4780         * driver.cs (MainDriver): Sanity check.
4781
4782 2006-08-01  Raja R Harinath  <rharinath@novell.com>
4783
4784         * decl.cs (DeclSpace.FindNestedType): Remove.
4785         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
4786         LookupTypeContainer to get the container of the nested type.
4787         * class.cs (TypeContainer.FindNestedType): Make non-override.
4788
4789 2006-07-31  Raja R Harinath  <rharinath@novell.com>
4790
4791         * decl.cs (DeclSpace.PartialContainer): Move field from ...
4792         * class.cs (TypeContainer.PartialContainer): ... here.
4793         (TypeContainer.AddBasesForPart): New helper.
4794         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
4795         instead.
4796         * cs-parser.jay (current_class): Convert to DeclSpace.
4797         (struct_declaration, interface_declaration, class_declaration):
4798         Use AddBasesForPart instead of .Bases directly.
4799         * const.cs, iterators.cs: Update to changes.
4800
4801 2006-07-28  Raja R Harinath  <rharinath@novell.com>
4802
4803         * class.cs (TypeContainer.AddMemberType): Rename from
4804         AddToTypeContainer.
4805         (TypeContainer.AddMember): Rename from AddToMemberContainer.
4806         (AddTypeContainer): New.  Combine AddClassOrStruct and
4807         AddInterface.
4808         (AddPartial): Update.  Add 'is_partial' argument.
4809         * roottypes.cs: Update to changes.
4810         * cs-parser.jay (push_current_class): New helper for handling
4811         current_container and current_class.
4812         (struct_declaration, interface_declaration, class_declaration):
4813         Use it.
4814
4815 2006-07-26  Raja R Harinath  <rharinath@novell.com>
4816
4817         * roottypes.cs: Rename from tree.cs.
4818
4819         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
4820         * tree.cs (Tree, ITreeDump): Remove types.
4821         * rootcontext.cs (tree, Tree): Remove fields.
4822         (root, ToplevelTypes): New.
4823         * *.cs: Update to rename.
4824
4825         * tree.cs (Tree.RecordDecl): Remove.
4826         (RootTypes.AddToTypeContainer): Record the toplevel type in its
4827         namespace here.
4828         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
4829
4830 2006-07-23  Raja R Harinath  <harinath@gmail.com>
4831
4832         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
4833         DoFlowAnalysis and OmitStructFlowAnalysis here.
4834         (ec.With): Rename from WithUnsafe and generalize.
4835         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
4836         (ec.WithFlowAnalyis): New.
4837         * ecore.cs, expression.cs, statement.cs: Update.
4838
4839 2006-07-22  Raja R Harinath  <harinath@gmail.com>
4840
4841         * statement.cs (Block.ResolveMeta): Simplify slightly.
4842
4843         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
4844         multiple boolean fields.  Convert InUnsafe, constant_check_state,
4845         check_state to flags.
4846         (CheckState, ConstantCheckState): Update.
4847         (InUnsafe): New read-only property.
4848         (FlagsHandle): Rename from CheckStateHandle and convert to handle
4849         arbitrary flags.
4850         (WithUnsafe): New helper similar to WithCheckState.
4851         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
4852         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
4853
4854 2006-07-21  Raja R Harinath  <rharinath@novell.com>
4855
4856         Make comparisons use the same IL irrespective of whether they're
4857         in a 'checked' or 'unchecked' context: one of the issues in #78899
4858         * codegen.cs (EmitContext.CheckState): Make read-only property.
4859         (EmitContext.ConstantCheckState): Likewise.
4860         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
4861         helper that implement a save/restore stack for CheckState
4862         values.  This is the only way to change check-state.
4863         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
4864         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
4865         (CheckedExpr.EmitBranchable): New forwarding method.
4866         (UnCheckedExpr): Likewise.
4867         * statement.cs (Block.ResolveMeta): Use WithCheckState.
4868         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
4869         (Checked.Resolve, checked.DoEmit): Likewise.
4870
4871 2006-07-20  Miguel de Icaza  <miguel@novell.com>
4872
4873         * anonymous.cs: Cache the resolved anonymous delegate, and return
4874         this so that the ResolveTopBlock is only triggered once, not
4875         twice.
4876
4877         Currently we trigger ResolvetopBlock twice due to a first pass of
4878         argument check compatibility, and a second pass that does the
4879         actual resolution.   
4880         
4881 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4882
4883         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
4884         modifiers.
4885         * rootcontext.cs (Reset): Add helper_classes.
4886
4887 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
4888
4889         A fix for #78860
4890         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
4891         correctly.
4892
4893 2006-07-13  Miguel de Icaza  <miguel@novell.com>
4894
4895         * statement.cs (Lock): Handle expressions of type
4896         TypeManager.null_type specially.  Fixes #78770
4897
4898 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4899
4900         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
4901         to an event.
4902
4903 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
4904
4905         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
4906         for accessors as well.
4907         * ecore.cs (EventExpr): Add AccessorTable.
4908
4909 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
4910
4911         A fix for #78738
4912         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
4913         for CS0122 where appropriate.
4914         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
4915         level attributes.
4916         (Filter): Assembly can be null in the case of top level attributes.
4917
4918 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
4919
4920         A fix for #78690
4921
4922         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
4923         is done at global level.
4924
4925 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4926
4927         A fix for #77002, Implemented TypeForwarder support.
4928
4929         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
4930         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
4931         * typemanager.cs (): Add type_forwarder_attr_type.
4932
4933 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
4934
4935         * report.cs: Add CS0469 warning.
4936
4937 2006-06-21  Martin Baulig  <martin@ximian.com>
4938
4939         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
4940         the `try'-block, so we also report CS0016 etc. there.
4941
4942 2006-06-21  Martin Baulig  <martin@ximian.com>
4943
4944         * delegate.cs
4945         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
4946
4947 2006-06-21  Martin Baulig  <martin@ximian.com>
4948
4949         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
4950         also report CS1686 for parameters.
4951
4952 2006-06-21  Martin Baulig  <martin@ximian.com>
4953
4954         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
4955         instead of an error if the value is not implicitly convertible to
4956         the switch types; fixes #77964.
4957
4958 2006-06-21  Raja R Harinath  <rharinath@novell.com>
4959
4960         Fix #78673
4961         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
4962         FieldBuilder is null.
4963
4964         Fix #78662
4965         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
4966         'left' and 'right' before error-checking.
4967
4968 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
4969
4970         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
4971         Fixed bug #78601.
4972         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
4973         (FieldExpr.DoResolve): likewise.
4974         (PropertyExpr.InstanceResolve): likewise.
4975         (EventExpr.InstanceResolve): likewise. 
4976
4977 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
4978
4979         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
4980         attribute applicable tests for attribute argument.
4981
4982 2006-06-02  Raja R Harinath  <rharinath@novell.com>
4983
4984         Fix #78079
4985         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
4986         (Binary.OverloadResolve_PredefinedIntegral): New.
4987         (Binary.OverloadResolve_PredefinedFloating): New.
4988         (Binary.OverloadResolve_PredefinedString): New.
4989         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
4990         Follow the standard more closely, and treat numeric promotions in
4991         terms of overload resolution.
4992         (Binary.CheckShiftArguments): Simplify.
4993
4994 2006-06-01  Raja R Harinath  <rharinath@novell.com>
4995
4996         * flowanalysis.cs (MyBitVector): Simplify representation.
4997         (MyBitVector.Clone): Avoid allocating BitArray.
4998         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
4999         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
5000         (*): Update.  Change all references to MyBitVector.And and
5001         MyBitVector.Or to &= and |=.
5002
5003 2006-05-29  Raja R Harinath  <rharinath@novell.com>
5004
5005         Fix cs0231-[34].cs.
5006         * cs-parser.jay (formal_parameter_list): Extend the pattern below
5007         to param arguments too.
5008
5009 2006-05-26  Miguel de Icaza  <miguel@novell.com>
5010
5011         * cs-parser.jay: Catch another parsing form for arglist being
5012         followed by other arguments.  Fixes #78313.
5013
5014 2006-05-24  Raja R Harinath  <rharinath@novell.com>
5015
5016         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
5017         checking of out parameters to ...
5018         (FlowBranchingToplevel.Merge): ... here.
5019         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
5020         set, propagate the origin upward, and only complain if there was
5021         no other error.
5022         (FlowBranchingException.AddContinueOrigin): Likewise.
5023         (FlowBranchingException.AddReturnOrigin): Likewise.
5024         (FlowBranchingException.AddGotoOrigin): Likewise.       
5025
5026 2006-05-23  Raja R Harinath  <rharinath@novell.com>
5027
5028         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
5029         unreachable, skip it.
5030         (FlowBranchingException.Merge): Always propagate jumps, even if
5031         the finally block renders subsequent code unreachable.
5032
5033 2006-05-18  Raja R Harinath  <rharinath@novell.com>
5034
5035         Fix #77601
5036         * statement.cs (Goto.Resolve): Move responsibility for resolving
5037         'goto' to FlowBranching.AddGotoOrigin.
5038         (Goto.SetResolvedTarget): New.  Callback to set the
5039         LabeledStatement that's the target of the goto.
5040         (Goto.DoEmit): Use Leave instead of Br when crossing an
5041         unwind-protect boundary.
5042         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
5043         LookupLabel and adjust to new semantics.
5044         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
5045         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
5046         Goto.SetResolvedTarget to update target.
5047         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
5048         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
5049         AddBreakOrigin & co.  Delay propagation until ...
5050         (FlowBranchingException.Merge): ... this.
5051
5052         * statement.cs (Block.Resolve): Always depend on flow-branching to
5053         determine unreachability.  Kill workaround that originally emitted
5054         only one statement after an "unreachable" label (see infloop in
5055         test-515.cs).
5056
5057         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
5058         This is still "wrong", but anything better would probably need a
5059         multi-pass algorithm.
5060         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
5061         usage vector.  Force current usage vector to be reachable, to
5062         optimistically signify backward jumps.
5063         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
5064         detected.
5065         (FlowBranchingLabeled.Merge): New.  If no backward jump was
5066         detected, return the original salted-away usage vector instead,
5067         updated with appropriate changes.  Print unreachable warning if
5068         necessary.
5069         * statement.cs (Block.Resolve): Don't print unreachable warning on
5070         a labeled statement.
5071
5072 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
5073
5074         * driver.cs: Pass filename without path to AssemblyBuilder's 
5075         AddResourceFile. Fixes bug #78407.
5076
5077 2006-05-17  Raja R Harinath  <rharinath@novell.com>
5078
5079         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
5080         * flowanalysis.cs (FlowBranchingLabeled): ... here.
5081         (FlowBranching.MergeChild): Overwrite
5082         reachability information from Labeled branchings too.
5083
5084 2006-05-16  Raja R Harinath  <rharinath@novell.com>
5085
5086         * statement.cs (Goto.Resolve): Merge jump origins here ...
5087         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
5088
5089         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
5090         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
5091         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
5092         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
5093         here, ...
5094         * statement.cs (Goto.Resolve): ... not here.
5095         (Goto.Emit): Remove CS1632 check.
5096
5097 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
5098
5099         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
5100         error message.
5101
5102 2006-05-11  Raja R Harinath  <rharinath@novell.com>
5103
5104         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
5105         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
5106         (FlowBranchingException.Label): Likewise.
5107
5108         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
5109         given value.
5110         (MyBitVector.Or): Use it to avoid losing information (Count).
5111         (FlowBranching.MergeOrigins): Likewise.
5112
5113         * flowanalysis.cs (UsageVector.IsDirty): Remove.
5114         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
5115         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
5116         (UsageVector.ToString): Simplify.
5117         (UsageVector.MergeSiblings): Move here from ...
5118         (FlowBranching.Merge): ... here.
5119         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
5120         not a MyBitVector.
5121
5122 2006-05-10  Raja R Harinath  <rharinath@novell.com>
5123
5124         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
5125         null bitvector is treated as all-true.
5126
5127         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
5128         (MyBitVector): Rationalize invariants.  'vector != null' implies
5129         that we have our own copy of the bitvector.  Otherwise,
5130         'InheritsFrom == null' implies all inherited bits are true.
5131
5132 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
5133
5134         * statement.cs (LocalInfo): Add IsConstant.
5135         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
5136         local variable for constants.
5137
5138 2006-05-09  Raja R Harinath  <rharinath@novell.com>
5139
5140         * flowanalysis.cs (MyBitVector.Empty): New.
5141         (MyBitVector): Don't allow InheritedFrom to be null.
5142         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
5143         (UsageVector, FlowBranching): Update to changes.
5144
5145         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
5146         recursion.  The 'Parent == null' condition isn't sufficient for
5147         anonymous methods.
5148         (FlowBranching.AddBreakOrigin): Likewise.
5149         (FlowBranching.AddContinueOrigin): Likewise.
5150         (FlowBranching.AddReturnOrigin): Likewise.
5151         (FlowBranching.StealFinallyClauses): Likewise.
5152         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
5153         (FlowBranching.CheckOutParameters): Likewise.
5154         (FlowBranchingToplevel): Terminate all the above recursions here.
5155         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
5156         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
5157
5158         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
5159         toplevel block.
5160         (FlowBranchingToplevel): New.  Empty for now.
5161         (FlowBranching.MergeTopBlock): Update.
5162         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
5163         branching for the anonymous delegate.
5164         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
5165
5166         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
5167         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
5168         information at the start of the merge.  Reorganize.
5169
5170 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5171
5172         * class.cs (MethodData.Define): Method cannot implement interface accessor.
5173
5174 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5175
5176         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
5177         to newly introduced ctor.
5178
5179         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
5180         message to one place.
5181         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
5182         global namespace.
5183
5184 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
5185
5186         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
5187
5188         * ecore.cs (Expression.ResolveAsConstant): Updated.
5189
5190         * statement.cs (ResolveMeta): Updated.
5191
5192 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5193
5194         * cs-parser.jay: __arglist cannot be used in initializer.
5195
5196 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
5197
5198         A fix for #77879
5199         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
5200         private types.
5201
5202 2006-05-05  Raja R Harinath  <rharinath@novell.com>
5203
5204         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
5205         (LabeledStatement): Add 'name' parameter.
5206         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
5207         (Block.AddLabel): Update to changes.
5208         * cs-parser.jay (labeled_statement): Likewise.
5209
5210         * flowanalysis.cs (BranchingType.Labeled): New.
5211         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5212         (FlowBranchingLabeled): New.  Does nothing for now, but will
5213         eventually handle 'goto' flows.
5214         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
5215         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
5216         that's terminated ...
5217         (Block.Resolve): ... here.
5218
5219         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
5220         (UsageVector.MergeFinallyOrigins): Likewise.
5221         (FlowBranching.InTryOrCatch): Likewise.
5222         (FlowBranching.AddFinallyVector): Likewise.
5223         (FlowBranchingException): Update to changes.
5224
5225         Fix #78290
5226         * statement.cs (Return.Resolve): Move error checking to ...
5227         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
5228         (FlowBranchingException): Handle return origins like break and
5229         continue origins.
5230         (FlowBranching.UsageVector.CheckOutParameters): Remove.
5231
5232 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5233
5234         A fix for #76122
5235         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
5236         filter.
5237
5238 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
5239
5240         A fix for #77543
5241         * class.cs (MethodData.Define): Do public accessor check only when method
5242         implements an interface.
5243
5244 2006-05-04  Raja R Harinath  <rharinath@novell.com>
5245
5246         Remove special handling of 'break'
5247         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
5248         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
5249         (UsageVector.Break): Remove.
5250         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
5251         reachability.
5252         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
5253
5254         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
5255         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
5256
5257 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5258
5259         A fix for #75726
5260         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
5261         be the interface member.
5262
5263 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
5264
5265         A fix for #60069
5266         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
5267         for emitting small (int) values.
5268
5269 2006-05-03  Raja R Harinath  <rharinath@novell.com>
5270
5271         Fix #59427
5272         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
5273         control-flow passes through the 'finally' after merging-in all the
5274         control-flows from 'try' and the 'catch' clauses.
5275
5276         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
5277         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
5278         always true at the only non-recursive entry point.
5279         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
5280         FlowBranchingBreakable.
5281         (FlowBranchingLoop): Remove.
5282         * statement.cs (Return.DoResolve): Update to changes.
5283
5284         Fix #76471, #76665
5285         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
5286         (FlowBranching.CreateBranching): Handle it: create a
5287         FlowBranchingContinuable.
5288         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
5289         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
5290         except that it handles the 'continue' command.
5291         (FlowBranching.UsageVector.MergeOrigins): Rename from
5292         MergeBreakOrigins.
5293         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
5294         except that it overrides AddContinueOrigin.
5295         (FlowBranchingException): Override AddContinueOrigin, similar to
5296         AddBreakOrigin.
5297         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
5298         Create a new branching around the embedded statement.
5299         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
5300         control flow after the embedded statement.
5301         (Continue.Resolve): Move all error checking to AddContinueOrigin.
5302
5303         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
5304         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
5305         FlowBranchingBreakable.
5306         (FlowBranchingSwitch): Remove.
5307
5308         Fix test-503.cs
5309         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
5310         error reporting to ...
5311         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
5312         Rename from 'AddBreakVector'.  Add new location argument.  Return
5313         a bool indicating whether the 'break' crosses an unwind-protect.
5314         (FlowBranchingException.AddBreakOrigin): Add.
5315         (FlowBranchingException.Merge): Propagate 'break's to surrounding
5316         flowbranching after updating with the effects of the 'finally'
5317         clause.
5318         (FlowBranchingBreakable): New common base class for
5319         FlowBranchingLoop and FlowBranchingSwitch.
5320
5321         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
5322         embedded statement.
5323         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
5324
5325 2006-05-02  Raja R Harinath  <rharinath@novell.com>
5326
5327         * statement.cs (Do.Resolve): If the loop is infinite, set the
5328         barrier.
5329         (While.Resolve, For.Resolve): Set a barrier after the embedded
5330         statement.  There's no direct control flow that goes from the end
5331         of the embedded statement to the end of the loop.
5332         * flowanalysis.cs (FlowBranching.Infinite): Remove.
5333         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
5334         above ensure that the reachability is correctly computed.
5335
5336         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
5337         (UsageVector.MergeBreakOrigins): If the current path is
5338         unreachable, treat it as if all parameters/locals are initialized.
5339         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
5340         infinite loops before merging-in break origins.
5341
5342         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
5343         (Reachability.Reachable): Split part into ...
5344         (Reachability.Unreachable): ... this.  Simplify.
5345         (Reachability.IsUnreachable): Use 'Unreachable' instead.
5346
5347         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
5348         (Reachability.SetThrowsSometimes): Likewise.
5349         (FlowBranchingBlock.MergeTopBlock): Don't compare against
5350         TriState.Always, use corresponding property.
5351         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
5352         (Block.Resolve): Likewise.  Remove some redundant checks.
5353
5354 2006-05-02  Raja R Harinath  <harinath@gmail.com>
5355
5356         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
5357         (Reachability.Meet): Don't bother checking AlwaysThrows --
5358         barrier is always set.
5359         (FlowBranchingBlock.Merge): Likewise.
5360
5361 2006-05-01  Raja R Harinath  <harinath@gmail.com>
5362
5363         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
5364         checks for unreachable.
5365
5366 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
5367
5368         A fix for #77980
5369         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
5370
5371         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
5372         whether field is really assigned.
5373
5374 2006-04-30  Raja R Harinath  <harinath@gmail.com>
5375
5376         * flowanalysis.cs (Reachability): Make 4-argument constructor
5377         private.
5378         (Reachability.Meet): Rename from 'And'.  Remove static variant.
5379         (Reachability.Always): Rename from the highly misleading
5380         'Reachability.Never'.
5381         (FlowBranching.Merge): Update to changes.  Mark an impossible
5382         situation with a 'throw'.
5383         (*): Update to changes.
5384
5385 2006-04-29  Raja R Harinath  <harinath@gmail.com>
5386
5387         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
5388         Remove 'Undefined'.
5389         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
5390         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
5391         (*): Update to changes.
5392         * statement.cs: Update to changes.
5393
5394 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
5395
5396         A fix for #78049
5397         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
5398
5399 2006-04-28  Raja R Harinath  <harinath@gmail.com>
5400
5401         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
5402         dummy UsageVector.
5403
5404         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
5405         argument to two arguments: an usage-vector and a bool.  Move call
5406         to FlowBranching.Merge () ...
5407         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
5408
5409         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
5410         handling of loop and switch reachability to ...
5411         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
5412
5413 2006-04-27  Raja R Harinath  <harinath@gmail.com>
5414
5415         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
5416         handling to FlowBranchingLoop.InLoop.
5417         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
5418
5419 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
5420
5421         A fix for #78115
5422         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
5423         anonymous method is allowed from AnonymousContainer here.
5424
5425         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
5426
5427 2006-04-24  Raja R Harinath  <rharinath@novell.com>
5428
5429         Fix #78156
5430         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5431
5432 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
5433
5434         A fix for #49011.
5435         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
5436         (DoubleConstant.Reduce): Ditto.
5437
5438 2006-04-23  Raja R Harinath  <rharinath@novell.com>
5439
5440         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
5441         Remove 'lvalue_right_side' argument.  Move parts to ...
5442         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
5443         (LocalVariable.DoResolveLValue): ... these.
5444
5445 2006-04-21  Raja R Harinath  <rharinath@novell.com>
5446
5447         Fix cs1655.cs
5448         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
5449         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
5450         (LocalVariableReference.DoResolveBase): Use it to implement new
5451         CS1655 check.
5452         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
5453         (Argument.Resolve): Simplify.  Move CS1510 check ...
5454         * ecore.cs (Expression.ResolveLValue): ... here.
5455         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
5456         (PropertyExpr.DoResolveLValue): Likewise.
5457         (FieldExpr.Report_AssignToReadonly): Likewise.
5458         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
5459         LValueMemberAccess or LValueMemberOutAccess on instance depending
5460         on it.
5461         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
5462         DoResolve as appropriate.
5463
5464 2006-04-20  Raja R Harinath  <rharinath@novell.com>
5465
5466         Fix #75800
5467         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
5468         implicit conversions on 'out' and 'ref' arguments.
5469
5470         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
5471         improve clarity.  Remove dead code.
5472
5473         Fix #66031
5474         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
5475         (Catch.Resolve): Resolve VarBlock if it exists.
5476
5477 2006-04-19  Miguel de Icaza  <miguel@novell.com>
5478
5479         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
5480         twice, this was some residual code, the enumerator was emitted
5481         properly in the two branche of if later.
5482
5483 2006-04-19  Raja R Harinath  <rharinath@novell.com>
5484
5485         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
5486         cast is never an lvalue.
5487         (Cast.DoResolve, Cast.ResolveRest): Combine.
5488         (Argument.Emit): Simplify slightly.  Move 'Expr is
5489         IMemoryLocation' check ...
5490         (Argument.Resolve): ... here.
5491         (Argument.Error_LValueRequired): Remove.  Inline into only user.
5492
5493         Simplifications.  Fix cs0191-2.cs
5494         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
5495         CS1649 and CS1651 to ...
5496         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
5497         the actual selection of the error code and message to a lookup
5498         table.  Add a dummy return value to simplify callsites.
5499         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
5500         readonly fields of other instances of the same type.  Move CS0197
5501         warning from ...
5502         * expression.cs (Argument.Resolve): ... here.  Simplify code.
5503         Ensure that ec.InRefOutArgumentResolving is only set during LValue
5504         resolution of an out or ref argument.  The code simplification
5505         above uses this invariant.
5506
5507 2006-04-18  Raja R Harinath  <rharinath@novell.com>
5508
5509         Possibly fix #77752.  Fix cs1690-[4-7].cs.
5510         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
5511         CheckMarshallByRefAccess.  Drop parameter.
5512         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
5513         warning.
5514         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
5515         InstanceExpression.
5516         * report.cs (AllWarnings): Add CS1690.
5517         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
5518         for ref access too.
5519         (LocalVariableReference.DoResolveBase): Update.
5520
5521 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5522
5523         * class.cs (MethodOrOperator): Moved common parts from method class.
5524         detect obsolete attributes.
5525         (Method.Define): Simplified as it reuses code from base.
5526         (Constructor.ValidAttributeTargets): Fixed issue found during
5527         refactoring.
5528         (Destructor.ValidAttributeTargets): Fixed issue found during
5529         refactoring.
5530         (Operator): Finished refactoring set off by #78020. Operator class is now
5531         ordinary method class.
5532
5533         * anonymous.cs: Updated.
5534
5535         * decl.cs (DeclSpace): Add IsGeneric
5536
5537 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5538
5539         * class.cs (Constructor.Emit): Don't emit the attributes twice.
5540
5541 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5542
5543         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
5544         detect obsolete attributes.
5545         (Method.CreateEmitContext): Moved to MethodOrOperator.
5546
5547 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
5548
5549         A fix for #78048.
5550         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
5551         customized exception to make crash detection easier.
5552         (MethodOrOperator): Started to work on new base class for methods and
5553         operators.
5554         (Method): Derives from MethodOrOperator.
5555         (Constructor.Emit): Emits its own attributes.
5556         (AbstractPropertyEventMethod.Emit): Ditto.
5557         (Operator): Derives from MethodOrOperator, will refactor fully in extra
5558         patch.
5559         (Operator.Emit): It's temporary more tricky than should be.
5560         
5561         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
5562
5563         * report.cs (InternalErrorException): Add ctor with inner exception.
5564
5565 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
5566
5567         A fix for #76744.
5568         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
5569         only not visible.
5570
5571 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
5572
5573         A fix for #77916.
5574         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
5575         array.
5576
5577 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5578
5579         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
5580         attribute is present and Guid not.
5581         (Interface.ApplyAttributeBuilder): Ditto.
5582
5583         * attribute.cs: Add error message.
5584
5585 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
5586
5587         A fix for #78020.
5588
5589         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
5590         sources (it's composite) so hold them in extra array as they are used in
5591         Emit phase only. It worked in the previous versions by mistake.
5592         (Attribute.Emit): Emit attribute for more owners when exist.
5593
5594         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
5595         it has now different behaviour.
5596
5597 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
5598
5599         * constant.cs (Constant.IsDefaultInitializer): New method.
5600
5601         * class.cs: Updated.
5602
5603         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
5604         re-initialize default values. It saves KBs almost for every assembly.
5605         Thanks Zoltan for the idea.
5606         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
5607         (ArrayCreation.DoResolve): Resolve only once.
5608         (ArrayCreation.Emit): Emit static initializer only when it is faster.
5609         (ArrayCreation.GetAttributableValue): Cope with optimized values.
5610
5611 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
5612
5613         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
5614         From #77961.
5615
5616 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5617
5618         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
5619         in an embedded statement too.
5620
5621 2006-04-01  Raja R Harinath  <rharinath@novell.com>
5622
5623         Fix #77958
5624         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
5625
5626 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
5627
5628         A fix for #77966.
5629
5630         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
5631         was not specified.
5632
5633         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
5634
5635 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
5636
5637         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
5638         phase.
5639
5640         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
5641         LocalTemporary change.
5642
5643         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
5644         TypeContainer.
5645         (ClassOrStruct.DefineFieldInitializers): Implemented static field
5646         initializers optimization.
5647         (ClassOrStruct.TypeAttr): Moved from modifiers.
5648         (Constructor.CheckBase): Don't crash when static ctor has parameters.
5649         (FieldBase.ResolveInitializer): Resolves initializer.
5650         (FieldBase.HasDefaultInitializer): New property.
5651
5652         * cs-parser.jay: Removed message.
5653
5654         * expression.cs (CompilerGeneratedThis): New specialization.
5655
5656         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
5657
5658 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
5659
5660         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
5661
5662 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5663
5664         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
5665         be now EnumConstants only.
5666
5667 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
5668
5669         * attribute.cs, driver.cs: Reset more caches.
5670
5671 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5672
5673         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
5674
5675 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5676
5677         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
5678         for easier reuse. Updated all overrides.
5679         (IntegralConstant): New base class for all integral constants.
5680         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
5681         of the constant range, report custom error.
5682         (UIntConstant.Reduce): Fixed uint conversion.
5683
5684         * ecore.cs, literal.cs: Reduce updates.
5685
5686 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5687
5688         A fix for #75813.
5689
5690         * class.cs (Constructor.Define): Removed extra if for default ctors.
5691         A patch from Atsushi Enomoto.
5692
5693 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
5694
5695         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
5696         GetAttributableValue.
5697
5698         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
5699         when required.
5700
5701         * convert.cs (ImplicitConversionRequired): Error message moved to
5702         DoubleLiteral.
5703
5704         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
5705         automatic implicit conversion of an output value.
5706         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
5707
5708         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
5709         conversion.
5710         (TypeOf.GetAttributableValue): Add extra handling for object type.
5711
5712         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
5713         special error message.
5714
5715 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
5716
5717         * class.cs (Constructor.Emit): Don't crash when struct ctor is
5718         InternalCall.
5719         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
5720         compatible with MS runtime.
5721
5722 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
5723
5724         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
5725         attribute arguments here.
5726
5727         * class.cs (Indexer.Define): The check was moved to attribute class.
5728
5729 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
5730
5731         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
5732         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
5733         easier.
5734
5735 2006-03-22  Raja R Harinath  <rharinath@novell.com>
5736
5737         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
5738         mcs to keep code differences small.
5739         * attribute.cs (Attribute.GetParameterDefaultValue): New.
5740         * typemanager.cs (parameter_default_value_attribute_type): New.
5741         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
5742         CS1908 check.
5743
5744 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5745
5746         * expression.cs (StringConcat.Append): Reverted back to no warning state.
5747
5748 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
5749
5750         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
5751
5752         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
5753         the blocks too.
5754
5755 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
5756
5757         * doc-bootstrap.cs : fix build.
5758
5759 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5760
5761         * expression.cs (StringConcat.Append): Issue a warning when empty string
5762         is going to append.
5763
5764 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
5765
5766         * assign.cs (CompoundAssign.ResolveSource): Removed.
5767
5768         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
5769         clean up.
5770
5771         * class.cs (TypeContainer.FindMethods): Removed.
5772         (TypeContainer.CheckMemberUsage): Made static.
5773
5774         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
5775
5776         * constant.cs (CheckRange): Removed unused type argument.
5777         (CheckUnsigned): Removed unused type argument.
5778
5779         * cs-parser.jay: Updated after MemberAccess clean up.
5780         Uses Length for empty string test.
5781
5782         * cs-tokenizer.cs: Uses Length for empty string test.
5783         (IsCastToken): Made static.
5784         (is_hex): Made static.
5785         (real_type_suffix): Made static.
5786
5787         * decl.cs (SetupCache): Made static.
5788         (OnGenerateDocComment): Removed unused ds argument.
5789
5790         * delegate.cs (VerifyDelegate): Removed unused argument.
5791
5792         * doc.cs: Uses Length for empty string test.
5793
5794         * driver.cs: Uses Length for empty string test.
5795
5796         * enum.cs (IsValidEnumType): Made static
5797
5798         * expression.cs (EnumLiftUp): Removed unused argument.
5799         (ResolveMethodGroup): Ditto.
5800         (BetterConversion): Ditto.
5801         (GetVarargsTypes): Ditto.
5802         (UpdateIndices): Ditto.
5803         (ValidateInitializers): Ditto.
5804         (MemberAccess.ctor): Ditto.
5805         (GetIndexersForType): Ditto.
5806
5807         * flowanalysis.cs: (MergeFinally): Removed unused argument.
5808
5809         * iterators.cs: Updated after MemberAccess clean up.
5810
5811         * location.cs: Uses Length for empty string test.
5812
5813         * namespace.cs: Uses Length for empty string test.
5814
5815          * report.cs (CheckWarningCode): Made static.
5816
5817         * statement.cs (LabeledStatement): Removed unused argument.
5818
5819         * typemanager.cs (FilterNone): Removed.
5820
5821 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5822
5823         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
5824         obsolete.
5825
5826         * class.cs: Updated.
5827
5828 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5829
5830         * cs-parser.jay.cs: __arglist is not allowed for delegates.
5831
5832 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5833
5834         A fix for #77822.
5835
5836         * expression.cs (VerifyArgumentsCompat): Reverted to double error
5837         reporting, it's more tricky than I thought.
5838
5839 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
5840
5841         A fix for #77816.
5842
5843         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
5844         host container.
5845         (AnonymousMethod.ImplicitStandardConversionExists): New method.
5846         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
5847         Add more error reporting; Fixed issue with params.
5848
5849         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
5850
5851         * cs-parser.jay: AnonymousMethod requires host container.
5852
5853         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
5854
5855 2006-03-18  Raja R Harinath  <harinath@gmail.com>
5856
5857         * class.cs: Change 'TypeContainer ds' constructor argument to
5858         'DeclSpace parent'.  Some classes were missed below due to
5859         different naming convention.
5860
5861         * class.cs (MemberCore.Parent): Delete.  This makes the
5862         ParentContainer changes below enforceable by the compiler.
5863
5864         Treat pointers to enclosing declaration space as 'DeclSpace', not
5865         'TypeContainer'.
5866         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
5867         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
5868
5869         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
5870         of TypeContainer.
5871         (Block.AddThisVariable): Likewise.
5872         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
5873         (AbstractPropertyEventMethod.Emit): Likewise.
5874         (AbstractPropertyEventMethod.EmitMethod): Likewise.
5875         (GetMethod.Define, SetMethod.Define): Likewise.
5876         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
5877         (DelegateMethod.EmitMethod): Likewise.
5878
5879         Fix regression test-partial-13.cs.
5880         Rationalize use of PartialContainer.  Ensure that the partial
5881         class semantics can be tied to type-correctness, i.e., any
5882         violation will cause a compile error.
5883         * class.cs, const.cs: Access all fields that belong to class
5884         TypeContainer via ParentContainer.  Arguments of EmitContexts and
5885         Resolve()-like functions still use 'Parent'.
5886
5887         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
5888         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
5889         (PropertyMethod.CheckModifiers): Remove unused argument.
5890         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
5891         DeclSpace.
5892
5893 2006-03-17  Raja R Harinath  <harinath@gmail.com>
5894
5895         Make semantics of PartialContainer simpler.
5896         * decl.cs (DeclSpace.IsPartial): Remove.
5897         * class.cs (TypeContainer.IsPartial): Likewise.
5898         (TypeContainer..ctor): Set PartialContainer to point to self.
5899         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
5900         (TypeContainer.FindNestedType): Likewise.
5901         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
5902
5903 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
5904
5905         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
5906
5907 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5908
5909         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
5910         classes.
5911
5912 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
5913
5914         * class.cs (Operator.Define): An error for base conversion was not
5915         reported correctly.
5916
5917 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
5918
5919         * iterator.cs : yield break is allowed in try statement which has
5920           catch clauses. Fixed bug #77767.
5921
5922 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
5923
5924         A fix for #77593, #77574.
5925
5926         * class.cs (MethodCore.CheckBase): Another if for operator.
5927
5928 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
5929
5930         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
5931         were not resolved
5932
5933         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
5934         (DelegateCreation.ImplicitStandardConversionExists): New method for just
5935         conversion test.
5936         
5937         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
5938         not needed.
5939
5940         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
5941         Updated after another emitcontext usage was clean up. It should help us to
5942         synchronize with gmcs easier.
5943
5944 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
5945
5946         A fix for #77353.
5947
5948         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
5949         (Event.Define): ditto
5950         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
5951
5952         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
5953         Removed redundant code and set NewSlot for Invoke method too.
5954
5955         * parameter.cs (Parameters.ctor): Add custom, type ctor.
5956         (Parameters.MergeGenerated): New method. Use this method when you merge
5957         compiler generated argument with user arguments.
5958
5959 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
5960
5961         * attribute.cs (ResolveAsTypeTerminal): Removed.
5962
5963         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
5964         specialization for predefined types; 30% speed up.
5965         Finally placed obsolete check to right place.
5966         (Expression.ResolveType): Removed.
5967
5968         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
5969         Updated after ResolveType was removed.
5970
5971         * expression.cs (Cast.ctor): Check void cast.
5972         (Binary.ResolveAsTypeTerminal): Is never type.
5973         (Conditional.ResolveAsTypeTerminal): Is never type.
5974
5975         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
5976
5977 2006-03-01  Raja R Harinath  <rharinath@novell.com>
5978
5979         Fix #77679.
5980         * expression.cs (ParameterReference.DoResolveBase): Change return
5981         type to bool.
5982         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
5983         Update.
5984
5985         Fix #77628.
5986         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
5987
5988         Fix #77642.
5989         * typemanager.cs (GetFullNameSignature): Don't nullref on
5990         protected accessors.
5991
5992 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
5993
5994         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
5995         these two separated members to simplify the code.
5996         (Attribute.Resolve): Refactored to use new fields and methods.
5997         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
5998         implemented obsolete attribute checking.
5999         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
6000         implemented obsolete checking again. It look line never ending quest ;-)
6001         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
6002
6003         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
6004
6005         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
6006
6007         *class.cs (Property.Define): Add RegisterProperty call.
6008
6009         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
6010         argument groups (only 2).
6011
6012         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
6013         encoding expression to arguments.
6014         (Expression.ExprClassToResolveFlags): Just turned to property.
6015
6016         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
6017         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
6018         optimized as well as implemented support for zero-length attributes.
6019
6020         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
6021         Add caching of PropertyInfo's.
6022
6023 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
6024
6025         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
6026         error multiple times.
6027
6028 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
6029
6030         New partial class implementation.
6031         A fix for #77027, #77029, #77403
6032
6033         * attribute.cs (Attributable): Made attributes protected.
6034
6035         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
6036         the replacements of ClassPart and PartialContainer.
6037         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
6038         (TypeContainer.AddInterface): Ditto.
6039         (TypeContainer.AddPartial): The main method for partial classes. It checks
6040         for errors and merges ModFlags and attributes. At the end class is added to
6041         partial_parts list.
6042         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
6043         required here.
6044         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
6045         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
6046         from the rest of partial classes.
6047         (TypeContainer.GetClassBases): Simplified.
6048         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
6049         DefineType.
6050         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
6051         (TypeContainer.HasExplicitLayout): Uses Flags now.
6052         (PartialContainer): Removed.
6053         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
6054         (StaticClass): Was merged with Class.
6055         (Class.GetClassBases): class and static class bases are verified here.
6056         (Class.TypeAttr): Added static attributes when class is static.
6057         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
6058         (MemberBase): In some cases we need to call parent container for partial
6059         class. It should be eliminated but it's not easy now.
6060
6061         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
6062
6063         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
6064         partial classed to accumulate class comments.
6065         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
6066
6067         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
6068
6069         * driver.cs (MainDriver): Tree.GetDecl was removed.
6070
6071         * modifiers.cs (Modifiers): Add partial modifier.
6072
6073         * tree.cs (Tree.decl): Removed.
6074         (RootTypes): Started to use this class more often for root types
6075         specializations.
6076
6077 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
6078
6079         A fix for #77615
6080
6081         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
6082         external interface does not have an attribute.
6083
6084 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
6085
6086         Another prerequisites for new partial classs implementation.
6087         
6088         * attribute.cs (Attribute.Equal): Implemented.
6089         (Attribute.Emit): Changed as attributes can be applied more than twice.
6090         (Attributes.Emit): Check for duplicate attributes here.
6091
6092         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
6093         as a parameter, clean-up.
6094
6095 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
6096
6097         A fix for #77485
6098
6099         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
6100         contains obsolete attribute check which can in some cases look for base
6101         type of current class which is not initialized yet.
6102         (TypeContainer.BaseType): Replacement of ptype.
6103
6104         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
6105
6106 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
6107
6108         First of prerequisites for new partial classs implemention.
6109         
6110         * attribute.cs (Attributable): Extended by ResolveContext;
6111         Attributes finally have correct context for resolving in all cases.
6112         (AttachTo): Attribute owner is assigned here.
6113
6114         * codegen.cs (IResolveContext): Introduce new interface to hold
6115         all information needed in resolving phase.
6116         (EmitContext): Implements IResolveContext; more clean-up needed here.
6117         
6118         * decl.cs (MemberCore): Implemented IResolveContext.
6119
6120         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
6121         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
6122         parameter.cs, statement.cs, tree.cs, typemanager.cs:
6123         Refactored to use new IResolveContext instead of EmitContext; cleanup
6124
6125 2006-02-06  Miguel de Icaza  <miguel@novell.com>
6126
6127         * codegen.cs (EmitScopeInitFromBlock): check here the
6128         capture_context, there is no need to make two calls to the
6129         EmitContext. 
6130
6131         * anonymous.cs: Add some debugging messages that might help me
6132         track other instances of this problem in the future (the
6133         regression of test 467).
6134
6135         * cs-parser.jay: track the variable block, as we need to initalize
6136         any captured variables declared in this block for the "catch"
6137         portion of the "Try" statement.
6138
6139         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
6140         scope initialization for captured variables. 
6141
6142         Also, move the emit for the variables after the block location has
6143         been marked.
6144
6145 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
6146
6147         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
6148
6149 2006-02-02  Miguel de Icaza  <miguel@novell.com>
6150
6151         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
6152         commit yesterday, the initialization for the roots is necessary.
6153         What is not necessary is the scope activation.
6154
6155 2006-02-02  Raja R Harinath  <rharinath@novell.com>
6156
6157         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
6158         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
6159         CS0206 checks.
6160         (Argument.Resolve): Remove CS0206 checks.
6161
6162 2006-02-01  Miguel de Icaza  <miguel@novell.com>
6163
6164         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
6165         scopes for all the roots, the scopes will now be emitted when the
6166         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
6167
6168         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
6169         code.  This reduces a lot of existing cruft.
6170         
6171         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
6172         that the ScopeInfo is generated as we enter the scope, not at the
6173         time of use, which is what we used to do before.
6174
6175         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
6176         every time a Block is about to be emitted if we have a
6177         CaptureContext. 
6178
6179 2006-02-01  Raja R Harinath  <rharinath@novell.com>
6180
6181         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
6182         (Reset): Update.
6183         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
6184
6185         * typemanager.cs (cons_param_array_attribute): Make private.
6186         (Reset): Set it to null.
6187         (InitCoreHelpers): Don't initialize it.
6188         (ConsParamArrayAttribute): New.  Initialize it as needed.
6189         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
6190
6191 2006-01-31  Miguel de Icaza  <miguel@novell.com>
6192
6193         * expression.cs: There might be errors reported during the
6194         selection of applicable methods.  If there are errors, do not
6195         continue execution as it will lead the compiler to crash.
6196
6197 2006-01-30  Miguel de Icaza  <miguel@novell.com>
6198
6199         * expression.cs: Member access is not allowed on anonymous
6200         methods.  Fixes #77402.
6201
6202 2006-01-30  Raja R Harinath  <rharinath@novell.com>
6203
6204         Fix #77401
6205         * cs-parser.jay (VariableDeclaration): Don't set
6206         current_array_type to null.
6207         (field_declaration, event_declaration, declaration_statement):
6208         Set it to null here.
6209
6210 2006-01-28  Raja R Harinath  <harinath@gmail.com>
6211
6212         * typemanager.cs (GenericParameterPosition): New.
6213         * doc.cs: Use it.
6214
6215 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
6216
6217         * doc.cs : To process "include" elements, first we should create
6218           another list than XmlNodeList, because it could result in node
6219           removal, which could result in that the XmlNodeList gives up
6220           yielding next node.
6221
6222           (Also made code identical to gmcs again.)
6223
6224 2006-01-25  Miguel de Icaza  <miguel@novell.com>
6225
6226         * ecore.cs: Introduce an error report that we were not catching
6227         before, if not silent, we must report the error.  Gonzalo ran into
6228         it.
6229
6230 2006-01-23  Miguel de Icaza  <miguel@novell.com>
6231
6232         A fix for bug: #76957
6233         
6234         * iterators.cs (MoveNextMethod.CreateMethodHost): call
6235         ComputeMethodHost before creating the method, this is a new
6236         requirement. 
6237
6238         * anonymous.cs (AnonymousContainer): Now we track all the scopes
6239         that this method references (RegisterScope).  The actual scope
6240         where the method is hosted is computed with the ComputeMethodHost
6241         before we create the method.
6242
6243         Moved the Deepest routine here.
6244
6245         (AnonymousContainer.ComputeMethodHost): New routine used to
6246         compute the proper ScopeInfo that will host the anonymous method.
6247
6248         (ScopeInfo): Deal with multiple roots.  The problem was that we
6249         did not have a unique root where all ScopeInfos could be hanged
6250         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
6251         of roots.  
6252
6253         Remove AdjustMethodScope which is now computed at the end.  Remove
6254         LinkScope which did a partial link, instead link all ScopeInfos
6255         before code generation from the new "LinkScopes" routine. 
6256
6257         Simplify all the Add* routines as they no longer need to maintain
6258         the tree, they just need to record that they are using variables
6259         from a ScopeInfo.
6260
6261         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
6262         routines to produce the forest of ScopeInfo trees.
6263
6264         * class.cs (TypeContainer.AppendMethod): This is just like
6265         AddMethod, but ensures that an interface implementation method
6266         (IEnumerable.XXX) is not inserted at the beginning of the queue of
6267         methods, but at the end.
6268
6269         We use this functionality to ensure that the generated MoveNext
6270         method in the iterator class is resolved/emitted before the
6271         enumerator methods created.   
6272
6273         This is required because the MoveNext method computes the right
6274         ScopeInfo for the method.  And the other methods will eventually
6275         need to resolve and fetch information computed from the anonymous
6276         method. 
6277
6278 2006-01-21  Raja R Harinath  <harinath@gmail.com>
6279             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
6280
6281         Fix rest of #76995.
6282         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
6283         the 'aliases' hash.
6284         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
6285         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
6286
6287 2006-01-18  Raja R Harinath  <rharinath@novell.com>
6288
6289         Fix #76656, cs0231-2.cs.
6290         * cs-parser.jay (formal_parameter_list): Make error case catch
6291         more issues.
6292         (parenthesized_expression_0): Add CS1026 check.
6293         (invocation_expression): Remove unused { $$ = lexer.Location }.
6294
6295 2006-01-17  Raja R Harinath  <rharinath@novell.com>
6296
6297         Fix #76824.
6298         * cs-parser.jay (statement_expression): Don't list out the
6299         individual statement-expressions.  Convert syntax error into
6300         CS0201 check.
6301
6302 2006-01-16  Raja R Harinath  <rharinath@novell.com>
6303
6304         Fix #76874.
6305         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
6306         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
6307         CheckIntermediateModification.
6308         (FieldExpr.DoResolve): Add new two-argument version that
6309         allows us to resolve the InstanceExpression as an lvalue.
6310         The one-argument variant is now just a wrapper.
6311         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
6312         Resolve the lhs as an lvalue if the it has a value type.
6313         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
6314         from Assign.DoResolve.
6315         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
6316         resolved as an lvalue.
6317         (PropertyExpr.DoResolve): Update.
6318         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
6319         has a value type.  Move CS1612 check here from
6320         CheckIntermediateModification.
6321         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
6322         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
6323         'right_side' of a ResolveLValue on an 'out' argument.
6324         (EmptyExpression.LValueMemberAccess): New.  Used as the
6325         'right_side' of a propagated ResolveLValue on a value type.
6326         (LocalVariableReference.DoResolveBase): Recognize
6327         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
6328         Add CS1654 check.
6329         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
6330         EmptyExpression.Null.
6331
6332 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
6333
6334         * typemanager.cs : added IsGenericParameter(). In mcs it always
6335           return false.
6336         * doc.cs : for generic parameters, use GenericParameterPosition,
6337           not FullName.
6338
6339 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
6340
6341         * expression.cs: Fix Console.WriteLine ((this = x).foo);
6342
6343 2006-01-12  Miguel de Icaza  <miguel@novell.com>
6344
6345         This fixes the problem where we used ldfld instead of ldflda to
6346         load the "THIS" pointer on captured parameters, when THIS is a
6347         value type.  See bug #77205.
6348         
6349         * iterators.cs (CapturedThisReference.Emit): Pass false to
6350         EmitThis (we do not need the address).
6351
6352         * codegen.cs (EmitThis): it needs to know whether we need the
6353         address of `this' or not.  This is used by value types.  
6354
6355         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
6356         every other call passes false.
6357
6358 2006-01-12  Raja R Harinath  <rharinath@novell.com>
6359
6360         Fix #77221.
6361         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
6362         GetOverride.
6363         * expression.cs (Invocation.OverloadResolve): Update.
6364         (Invocation.DoResolve): Avoid double resolution of invocation.
6365
6366 2006-01-11  Raja R Harinath  <rharinath@novell.com>
6367
6368         Fix #77180.
6369         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
6370         unary negation of floating point types as 0-expr; negation cannot
6371         overflow in floating point types.
6372
6373         Fix #77204.
6374         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
6375         on operands of 'void' type.
6376
6377         Fix #77200.
6378         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
6379         and ExclusiveOr for boolean constants too.
6380
6381 2006-01-09  Raja R Harinath  <rharinath@novell.com>
6382
6383         Fix #75636.
6384         * expression.cs (Invocation.OverloadResolve): Replace reflected
6385         override methods with their base virtual methods, rather than
6386         skipping over them.
6387         * typemanager.cs (TypeManager.GetOverride): New.
6388
6389 2006-01-05  Jb Evain  <jbevain@gmail.com>
6390
6391         * class.cs (Property.Define, Indexer.Define): do not tag the
6392         properties as SpecialName | RTSpecialName.
6393
6394 2006-01-04  Miguel de Icaza  <miguel@novell.com>
6395
6396         * class.cs (MethodCore.IsDuplicateImplementation): This method was
6397         doing a low-level comparission of parameter types.  It was lacking
6398         a check for __argslist. 
6399
6400 2005-12-30  Miguel de Icaza  <miguel@novell.com>
6401
6402         * expression.cs (ParameterReference.DoResolveBase): Allow
6403         reference parameters if they are local to this block. 
6404
6405         This allows the ref and out parameters of a delegate to be used in
6406         an anonymous method, for example:
6407
6408         delegate void set (out int x);
6409
6410         set s = delegate (out int x){
6411                 x = 0;
6412         };
6413
6414         This is used by functionality introduced late in the C# language.
6415         
6416         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
6417         method that take ref and out parameters. 
6418
6419         Fixes #77119 which was a late change in the spec.
6420
6421 2005-12-23  Miguel de Icaza  <miguel@novell.com>
6422
6423         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
6424         parent if its the same scope.  Fixes #77060.
6425
6426 2005-12-21  Miguel de Icaza  <miguel@novell.com>
6427
6428         * driver.cs: Report the case of no source files and no -out:
6429         argument provided.
6430
6431 2005-12-20  Raja R Harinath  <rharinath@novell.com>
6432
6433         Fix #77035.
6434         * expression.cs (ComposedCast.GetSignatureForError): Define.
6435
6436 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6437
6438         Fix #76995
6439
6440         * namespace.cs (NamespaceEntry): Add extern_aliases as a
6441         ListDictionary, to contain the ExternAliasEntry entries (in
6442         addition to the NamespaceEntry.aliases hashtable). This field is
6443         shared between the original entry and its doppelganger (bodyless 
6444         copy of it).
6445         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
6446         extern_aliases field.
6447         (NamespaceEntry.Lookup): Move the IsImplicit check after the
6448         lookup in extern_aliases.
6449
6450 2005-12-16  Raja R Harinath  <rharinath@novell.com>
6451
6452         Fix #77006.
6453         * class.cs (TypeContainer.Mark_HasEquals): New.
6454         (TypeContainer.Mark_HasGetHashCode): New.
6455         (ClassPart): Override them.
6456         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
6457
6458         Fix #77008.
6459         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
6460         'parent' argument to the base constructor.
6461
6462         Remove all mention of TypeContainer from decl.cs.
6463         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
6464         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
6465         (DeclSpace.DeclSpace): Likewise.
6466         (DeclSpace.DefineMembers): Remove unused argument.
6467         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
6468         debugging check -- we don't care if the debug code throws an
6469         InvalidCastException instead of an InternalErrorException.
6470         * class.cs (TypeContainer.DefineMembers): Update to changes.
6471         (TypeContainer.DoDefineMembers): Likewise.
6472         (TypeContainer.GetMethods): Likewise.
6473         (PropertyMember.Define): Likewise.
6474         (MemberBase.Parent): New property that forwards to
6475         MemberCore.Parent, but ensures that we get a TypeContainer.
6476         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
6477         (RootContext.PopulateTypes): Likewise.  Remove special case code
6478         for !RootContext.StdLib: DefineMembers is idempotent.
6479
6480 2005-12-14  Miguel de Icaza  <miguel@novell.com>
6481
6482         * convert.cs (ExplicitConversionCore): Check the return value from
6483         ExplicitConversionCore which can return null on failure.  Fixes #76914
6484
6485 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
6486
6487         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
6488
6489 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
6490
6491         * doc.cs : The search for referenced namespace was insufficient to
6492           get global one as it used to do. Fixed bug #76965.
6493
6494 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
6495
6496         * doc.cs : check name in cref in the last phase that whether it is
6497           namespace or not.
6498
6499 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6500
6501         * cs-tokenizer.cs : reverted the latest change: it somehow broke
6502           Mono.C5.
6503
6504 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6505
6506         * doc.cs : so it turned out that we cannot skip override check for 
6507           interface members. Fixed bug #76954.
6508
6509 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
6510
6511         * cs-tokenizer.cs : fixed bug #75984:
6512           - #warning and #error should not be handled when the source line
6513             is disabled.
6514           - #line is not checked strictly when the source line is disabled.
6515           - #define and #undef is on the other hand checked strictly at any
6516             state.
6517
6518 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
6519
6520         * cs-tokenizer.cs : missing Location (actually, filename) in one of
6521           CS1027 report.
6522
6523 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6524
6525         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
6526
6527         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
6528         event initializers.
6529         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
6530         (FieldBase.Initializer): Initializer is now optional.
6531         (EventField.Define): Only event field can have initializer.
6532
6533         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
6534
6535         * const.cs (Const): Reuse initializer.
6536
6537         * cs-parser.jay: Updated after FieldBase changes.
6538         Added current_array_type to simplify array initializers.
6539
6540         * ecore.cs (NullCast.IsDefaultValue): Implemented.
6541
6542         * expression.cs, iterators.cs: Updated.
6543
6544         * namespace.cs (NamespaceEntry): Made UsingFound private.
6545
6546 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6547
6548         * parameterCollection.cs: Obsolete, removed.
6549         * parser.cs: Obsolete, removed.
6550
6551 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
6552
6553         Fix #76849.
6554         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
6555
6556         * enum.cs (Enum.Define): Set obsolete context here.
6557
6558 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6559
6560         * doc.cs :
6561           - FindDocumentedMember() now expects 1) paramList as null
6562             when "we don't have to check the number of parameters" and
6563             2) Type.EmptyTypes when "there is no arguments".
6564           - Introduced FoundMember struct to hold the exact type which was
6565             used to find the documented member (the above change broke
6566             test-xml-044; it might be better just to use DeclaringType than
6567             what MS does, like this change does, but it depends on usage.)
6568
6569 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
6570
6571         * doc.cs : documented member might be from DeclaringType for nested
6572           types. Fixed bug #76782.
6573
6574 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
6575
6576         * anonymous.cs: Have the param code handle leaving copies on the
6577         stack etc. Allows anonymous params to take part in the assignment
6578         code (++, +=, etc). Fixes bug #76550
6579
6580         * expression.cs: Handle the prepare_for_load/leave_copy by passing
6581         it down to the anon code.
6582
6583         * iterators.cs: Use dummy var here
6584
6585         * codegen.cs: Handle new vars
6586
6587 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6588
6589         Fix #76849.
6590         * class.cs (MethodData.Define): Set proper Obsolete context.
6591
6592         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
6593         obsolete context.
6594         (FieldExpr.DoResolve): Ditto.
6595
6596 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
6597
6598         Fix #76849.
6599         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
6600         parent is not obsolete.
6601
6602 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
6603
6604         * doc.cs : (FindDocumentedMember) find parameterless members first
6605           and get CS0419 in the early stage. Fixed first case of bug #76727.
6606
6607 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
6608
6609         Fix #76859.
6610         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
6611         no error was reported.
6612
6613         *expression.cs (Binary.DoResolve): left can be null.
6614
6615 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
6616
6617         Fix #76783.
6618         * class.cs (MethodData.Emit): Parameters should be labeled first.
6619
6620 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
6621
6622         Fix #76761.
6623         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
6624
6625 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
6626
6627         * attribute.cs (AreParametersCompliant): Moved to Parameter.
6628
6629         * class.cs (MethodCore): Parameter clean up.
6630         (IMethodData): Added ParameterInfo.
6631         (MethodData): Parameter clean up.
6632         (Indexer.Define): Parameter clean up.
6633
6634         * anonymous.cs,
6635         * codegen.cs,
6636         * cs-parser.jay,
6637         * decl.cs,
6638         * doc.cs,
6639         * ecore.cs,
6640         * flowanalysis.cs,
6641         * iterators.cs,
6642         * pending.cs,
6643         * statement.cs,
6644         * typemanager.cs: Parameter clean up.
6645
6646         * delegate.cs (Define): Get rid of duplicated code.
6647
6648         * expression.cs (ParameterReference): Removed useless parameters
6649         and simplified.
6650         (Invocation): Ditto.
6651
6652         * parameter.cs (ParamsParameter): New class, params specialization.
6653         (ArglistParameter): Attemp to separate arglist.
6654         (Parameter): Refactored to be reusable and faster.
6655         (Parameter.Modifier): Made understandable.
6656         (Parameters): Changed to be used as a class for `this' assembly
6657         parameters. Refactored to use new specialized classes.
6658
6659         * support.cs (ParameterData): Added Types property.
6660         (InternalParameters): Deleted.
6661
6662 2005-08-20  Martin Baulig  <martin@ximian.com>
6663
6664         Merging this patch from GMCS to fix #75867.
6665
6666         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
6667         scope if we don't already have it.
6668
6669 2005-11-17  Martin Baulig  <martin@ximian.com>
6670
6671         * anonymous.cs
6672         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
6673         inherit the scope from our parent.  Fixes #76653.
6674
6675 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6676
6677         * doc.cs : the previous patch does not actually fix the bug.
6678           PropertyInfo override check is now implemented and really fixed it.
6679         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
6680
6681 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6682
6683         * doc.cs : apply "override filter" also to properties.
6684           Fixed bug #76730.
6685
6686 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
6687
6688         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
6689           no need to check overrides. For classes, omit those results from 
6690           interfaces since they must exist in the class. Fixed bug #76726.
6691
6692 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6693
6694         * typemanager.cs : (GetFullNameSignature) differentiate indexers
6695           with different parameters. Fixed the second problem in #76685.
6696
6697 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6698
6699         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
6700           get expected 'protected' access in CheckValidFamilyAccess()).
6701           Fixed bug #76692.
6702
6703 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
6704
6705         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
6706           Fixed bug #76705.  CS1569 was incorrectly commented out.
6707
6708 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6709
6710         * doc.cs : use Invocation.IsOverride() to do real override check.
6711         * expression.cs : made Invocation.IsOverride() internal.
6712
6713 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
6714
6715         * doc.cs : use TypeManager.FindMembers() instead of (possible)
6716           TypeBuilder.FindMembers() and filter overriden base members out.
6717           Fixed bug #76990.
6718
6719 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6720
6721         * doc.cs : ref/out parameters are represented as '@' (instead of
6722           '&' in type FullName). Fixed bug #76630 (additionally crefs).
6723
6724 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6725
6726         * doc.cs : when there was no '.' in cref to methods in doc comment,
6727           then parameters were missing in the output. Fixed bug #76691.
6728
6729 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6730
6731         * driver.cs : don't output docs when there is an error.
6732           Fixed bug #76693.
6733
6734 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6735
6736         * doc.cs :
6737           Now it should detect indexers. Fixed primary concern in bug #76685.
6738           Fixed CS0419 message to not show the identical member signature in
6739           the message.
6740
6741 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
6742
6743         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
6744           instead of Type.FindMembers() since it does not handle events.
6745           Fixed bug #71604.
6746
6747 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
6748
6749         * codegen.cs: Fixed typo (speficied -> specified).
6750
6751 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6752
6753         Fix #76369.
6754         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
6755
6756 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
6757
6758         * attribute.cs: Changed error message.
6759
6760         * cs-tokenizer.cs: One more check.
6761
6762 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6763
6764         * statement.cs (Block.Resolve): Ignore empty statement.
6765
6766 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
6767
6768         * report.cs: Made error/warning methods more strict to avoid
6769         their misuse.
6770
6771         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
6772         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
6773         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
6774         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
6775
6776 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
6777
6778         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
6779         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
6780
6781         * class.cs (TypeContainer.IsComImport): New property.
6782         (Constructor.Define): Create proper ctor for ComImport types.
6783
6784         * expression.cs (New.CheckComImport): Fixed.
6785
6786 2005-11-07  Miguel de Icaza  <miguel@novell.com>
6787
6788         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
6789         that a parameter has been captured does not mean that we do not
6790         have to do the rest of the processing.  This fixes the second part
6791         of #76592.  If there was another anonymous method capturing
6792         values in the past, the Scope would never be set for the second
6793         method that captured the same parameter.
6794
6795         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
6796         properly manipulate the stack.   Second part of fix for #76592.
6797
6798         * expression.cs (New): Add support for invoking "new" on
6799         interfaces that have been flagged with the ComImport attribute and
6800         the CoClass.  Fixes #76637 
6801
6802         * statement.cs (Try.DoEmit): When a variable is captured, do not
6803         try to emit the vi.LocalBuilder variable as it has been captured.
6804         Create a temporary variable and store the results on the
6805         FieldBuilder.  Fixes #76642
6806
6807 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
6808
6809         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
6810
6811         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
6812
6813         * expression.cs (Binary.DoResolve): Added && optimalization.
6814     
6815         * typemanager.cs (AddUserType): Removed useless argument.
6816
6817 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
6818
6819         * statement.cs (Block.variables): Uses ListDictionary.
6820
6821 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6822
6823         Fix #75969.
6824         * class.cs (PartialContainer.EmitType): Customized to emit
6825         security attributes.
6826         (ClassPart.ApplyAttributeBuilder): Transform security attribute
6827         for partial classes.
6828
6829 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
6830
6831         Fix #76599.
6832         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
6833         access has to be fixed.
6834         
6835         * typemanager.cs (IsUnmanagedType): Wrong common field type.
6836
6837 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
6838
6839         Fix #76590.
6840         * ecore.cs (NullCast.Reduce): Implemented.
6841
6842         * expression.cs (ArrayCreation.CheckIndices): Correcly check
6843         constant type.
6844         
6845         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
6846         properly.
6847         (Foreach.Resolve): Catch null properly.
6848
6849 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6850  
6851         * cs-tokenizer.cs: Warning text fix.
6852
6853         * driver.cs: AllWarningNumbers exposed on public interface.
6854
6855         * report.cs (): Reviewed warning numbers.
6856         (IsValidWarning): Use binary search.
6857
6858 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
6859  
6860         * driver.cs: Implemeted resource visibility.
6861         (Resources): New class for code sharing between /res: and
6862         /linkres:
6863  
6864 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
6865
6866         Fix #76568.
6867         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
6868         folding.
6869         
6870         * convert (Convert.ImplicitReferenceConversion): NullCast holds
6871         contants only.
6872         
6873         * ecore.cs (NullCast): Child is contant only.
6874         
6875         * literal.cs (NullLiteral.Reduce): null can be converted to any
6876         reference type.
6877
6878 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
6879
6880         * driver.cs: Use Encoding.Default as default code page instead
6881           of ISO-28591.
6882
6883 2005-10-27  Raja R Harinath  <rharinath@novell.com>
6884
6885         Fix #76085.
6886         * expression.cs (Invocation.Error_InvalidArguments): Handle
6887         __arglist parameters.
6888         (Invocation.VerifyArgumentsCompat): Likewise.
6889         * support.cs (ReflectionParameters.GetSignatureForError): Print
6890         __arglist parameters.
6891         (InternalParamters.GetSignatureForError): Likewise.
6892         * parameter.cs (Parameters.GetSignatureForError): Likewise.
6893
6894 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
6895
6896         * attribute.cs (GetPropertyValue): Made public.
6897
6898         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
6899         Resolve.
6900         Add new property WrapNonExceptionThrows to handle 2.0 assembly
6901         attribute.
6902         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
6903         is not defined.
6904         
6905         * driver.cs: Reflect method name change.
6906         
6907         * statement.cs (Try.Resolve): Warn when try has both general
6908         exception handlers.
6909         
6910         * typemanager.cs: runtime_compatibility_attr_type new predefined
6911         type.
6912
6913 2005-10-26  Raja R Harinath  <harinath@gmail.com>
6914
6915         Fix #76419.
6916         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
6917         treat it as an empty parameter list.
6918
6919 2005-10-26  Raja R Harinath  <rharinath@novell.com>
6920
6921         Fix #76271.     
6922         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
6923         ResolveAsTypeStep silent.
6924         * statement.cs (Block.AddConstant): Mark block as used.
6925         (Block.ResolveMeta): Avoid piling on error messages
6926         if a constant initializer resolution fails.
6927
6928 2005-10-25  Raja R Harinath  <rharinath@novell.com>
6929
6930         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
6931         Remove.
6932         (NamespaceEntry.VerifyAllUsing): New.
6933         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
6934         behaviour.  Delegates actual resolution of alias to ...
6935         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
6936         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
6937         Update.
6938         * driver.cs (Driver.MainDriver): Update.
6939         
6940         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
6941         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
6942         property.
6943         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
6944         Remove.
6945         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
6946         RootNamespace.DefineNamespacesForAll.
6947
6948 2005-10-24  Raja R Harinath  <harinath@gmail.com>
6949
6950         * typemanager.cs (assemblies, external_aliases, modules)
6951         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
6952         (ComputeNamespaces, GetRootNamespace): Remove extra staging
6953         overhead.  Move resposibility ...
6954         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
6955         * driver.cs, attribute.cs, codegen.cs: Update to changes.
6956
6957 2005-10-23  Raja R Harinath  <harinath@gmail.com>
6958
6959         * namespace.cs (RootNamespace.all_namespaces): Renamed from
6960         cached_namespaces.  Improve usage.
6961         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
6962         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
6963         Move from GlobalRootNamespace and simplify.
6964         (RootNamespace.Global): Make instance variable.
6965         (RootNamespace.RootNamespace): Add "alias name" parameter.
6966         (GlobalRootNamespace): Simplify drastically.
6967         (Namespace.Lookup): Don't use GetNamespace.
6968         * typemanager.cs (GetRootNamespace): Rename from
6969         ComputeNamespaceForAlias.
6970         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
6971
6972 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6973
6974         * anonymous.cs (AnonymousContainer): Don't crash when container
6975         doesn't exist.
6976
6977 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6978
6979         * expression.cs (Binary.DoResolve): Warn when comparing same
6980         values.
6981
6982 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
6983
6984         Fix #76486.
6985         * expression.cs (Binary.DoResolve): It looks like there are no
6986         convetsion rules in enum context.
6987
6988 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6989
6990         Add support for extern alias qualifiers.
6991         * typemanager.cs: Move some LookupTypeReflection code
6992         to namespace.cs, to have cleaner code. Added some methods
6993         to help us keep track of the extern aliased references.
6994         * driver.cs: Add suport for extern alias assemblies on command
6995         line and check for their warnings/errors. Also keep track of the
6996         extern aliased assemblies.
6997         * namespace.cs: Move the global functionality of Namespace
6998         to GlobalRootNamespace/RootNamespace. Now the global namespace
6999         is GlobalRootNamespace.Globa. Also the code moved from 
7000         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
7001         Finally added LocalAliasEntry (AliasEntry before) and
7002         ExternAliasEntry, to handle alias statements.
7003         * cs-parser.jay: Add support in the grammar for extern alias
7004         statement.
7005         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
7006         Update callings to Namespace (now in GlobalRootNamespace).
7007
7008 2005-10-18  Raja R Harinath  <rharinath@novell.com>
7009
7010         Fix #76371.
7011         * class.cs (TypeContainer.DefineType): Move updating of
7012         topological sort earlier in the code.
7013         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
7014
7015 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
7016
7017         Fix #76273.
7018         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
7019         
7020         * constant.cs (Constant.TryReduce): Moved from Cast class.
7021         (Reduce): Made little bit more OO and fixed missing conversions.
7022         
7023         * ecore.cs (Reduce): Implemented.
7024         (Binary.EnumLiftUp): New method to upgrade values to enum values.
7025         
7026         * literal.cs (Reduce): Implemented.
7027         
7028         * class.cs: Reverted Miguel's wrong commit.
7029
7030 2005-10-14  Miguel de Icaza  <miguel@novell.com>
7031
7032         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
7033
7034 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
7035
7036         * cs-parser.jay, expression.cs : CS0214 was missing error location
7037           for constants. Fixed bug #76404.
7038
7039 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
7040
7041         Fix #76370.
7042         * convert.cs (ExplicitConversionCore): Fixed object->enum
7043         conversion.
7044
7045 2005-10-10  Raja R Harinath  <rharinath@novell.com>
7046
7047         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
7048         InstanceExpression.
7049         (PropertyExpr.EmitCall): Likewise.
7050         * expression.cs (Invocation.EmitArguments): Handle case where
7051         arguments == null.
7052         (Invocation.EmitCall): Avoid allocating temporary variable if
7053         there are no arguments.
7054
7055 2005-10-07  Raja R Harinath  <rharinath@novell.com>
7056
7057         Fix #76323.
7058         * convert.cs (ImplicitConversionStandard): Move conversion of
7059         void* to arbitrary pointer types ...
7060         (ExplicitConversionStandard): .. here.
7061         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
7062         error to always print typenames.
7063
7064 2005-10-07  Raja R Harinath  <rharinath@novell.com>
7065
7066         * convert.cs (GetConversionOperator): Rename from
7067         GetConversionOperators.  Move operator selection code from ...
7068         (UserDefinedConversion): ... here.
7069
7070 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
7071
7072         * convert.cs (ExplicitConversionCore): Removed duplicate enum
7073         conversion.
7074
7075 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
7076
7077         * assign.cs (Assign.DoResolve): Error method changed.
7078
7079         * cfold.cs (DoConstantNumericPromotions): Error method changed.
7080         
7081         * const.cs (ResolveValue): Reset in_transit immediately.
7082         
7083         * constant.cs: Error method changed.
7084         
7085         * convert.cs: Removed useless location parameter.
7086         (ExplicitNumericConversion): Don't do double enum check.
7087         (ExplicitConversionCore): Renamed from ExplicitConversion.
7088         (ExplicitUnsafe): Extracted from ExplicitConversion.
7089         (ExplicitConversion): Uses for error reporting.
7090         
7091         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
7092         error messages.
7093         (ResolveBoolean): Uses common error method.
7094         (CastToDecimal): Get rid of ec.
7095         (CastFromDecimal): Optimized.
7096         (ConvCast): Get rid of ec.
7097         
7098         * enum.cs (ResolveValue): Reset in_transit immediately.
7099         (Emit): Return after first error.
7100         
7101         * expression.cs: Convert changes.
7102         
7103         * literal.cs: Error method changed.
7104         
7105         * statement.cs: Error method changed.
7106
7107 2005-10-03  Raja R Harinath  <rharinath@novell.com>
7108
7109         * support.cs (SeekableStreamReader.Position): Don't error out when
7110         the requested position is just beyond the end of the current
7111         buffered data.
7112
7113 2005-09-28  Raja R Harinath  <rharinath@novell.com>
7114
7115         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
7116         try to keep in sync with the byte count of the underlying Stream.
7117         However, this limits us to a window size of 2048 characters: i.e.,
7118         the maximum lookahead of our lexer/parser can be 2048 characters.
7119
7120 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
7121
7122         Fix #76255.
7123         * driver.cs: Fix compilation files with full root path.
7124
7125 2005-09-25  Miguel de Icaza  <miguel@novell.com>
7126
7127         * report.cs (SymbolRelatedToPreviousError): Format the output so
7128         it does not use an open parenthesis that is never closed. 
7129
7130         * driver.cs: Follow coding guidelines
7131
7132 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7133
7134         Fix #72930.
7135         * const.cs (Const.ResolveValue): Check for assigning non-null
7136         value to reference type.
7137
7138 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
7139
7140         * anonymous.cs: Implemented ExprClassName.
7141         
7142         * assign.cs (Assign.DoResolve): Don't chrash when type is not
7143         delegate.
7144         
7145         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
7146         check.
7147         
7148         * class.cs (StaticClass.DefineContainerMembers): Report protected
7149         members as error.
7150         
7151         * codegen.cs: if(ed) PRODUCTION.
7152         
7153         * convert.cs (Error_CannotImplicitConversion): Better error
7154         distinction.
7155         
7156         * cs-parser.jay: More error checks.
7157         
7158         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
7159         
7160         * driver.cs (CSCParseOption): Enabled wrong option check.
7161         
7162         * ecore.cs (Expression.ExprClassName): Turned to property.
7163         (MemberExpr.CheckIntermediateModification): For checking boxed
7164         value types     modification.
7165         
7166         * statement.cs (Fixed.Resolve): Expression type must be
7167         convertible to fixed type.
7168         (CollectionForeach.GetEnumeratorFilter,TryType):
7169         Small refactoring for easier error checking.
7170
7171 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
7172
7173         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
7174         attributes.
7175         
7176         * class.cs (GeneratedBaseInitializer): New class for customization
7177         compiler generated initializers.
7178         (MemberBase.DoDefine): Check Obsolete attribute here.
7179         (FieldMember.DoDefine): Ditto.
7180         
7181         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
7182         constants.
7183         
7184         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
7185         (MemberCore.GetObsoleteAttribute): Removed argument.
7186         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
7187         (MemberCore.CheckObsoleteType): New helper.
7188         
7189         * delegate.cs,
7190         * enum.cs,
7191         * statement.cs: Updates after MemberCore changes.
7192         
7193         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
7194         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
7195         
7196         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
7197         obsolete attribute for compiler construct.
7198         (As.DoResolve): Cache result.
7199         
7200         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
7201
7202 2005-09-26  Raja R Harinath  <rharinath@novell.com>
7203
7204         Fix #76133.
7205         * expression.cs (This.VerifyFixed): In a value type T, the type of
7206         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
7207         value type R, 'this' is treated as a value parameter.
7208
7209 2005-09-22  Miguel de Icaza  <miguel@novell.com>
7210
7211         * statement.cs (Lock): Use the TemporaryVariable class instead of
7212         manually using local variables as those do not work when variables
7213         are captured.
7214
7215         * ecore.cs: Moved the TemporaryVariable class from being a nested
7216         class inside Foreach to be a public class that can be employed in
7217         other places. 
7218
7219 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
7220
7221         * cs-parser.jay: interface_accessors replaced by
7222         accessor_declarations.
7223
7224         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
7225         location.
7226         
7227         * statement.cs (GotoCase.Resolve): Convert null constant to
7228         null case.
7229         (SwitchLabel.ResolveAndReduce): Ditto.
7230         (SwitchLabel.NullStringCase): Custom null stamp.
7231         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
7232         
7233         typemanager.cs (CSharpSignature): Don't skip first argument
7234         for full names.
7235
7236 2005-09-18  Miguel de Icaza  <miguel@novell.com>
7237
7238         * driver.cs: Set InEmacs based on the environment variable EMACS. 
7239
7240         * location.cs (InEmacs): in this mode, do not report column
7241         location as it confuses Emacs.
7242
7243 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
7244
7245         * cfold.cs, constant.cs, convert.cs, ecore.cs,
7246         expression.cs, iterators.cs, literal.cs: Store constants and
7247         literals location.
7248         
7249         * class.cs (MemberBase.ShortName): Pass location.
7250         
7251         * cs-parser.jay: Some location fixes.
7252         
7253         * ecore.cs (Expression.Location): Made virtual.
7254
7255 2005-09-05  Miguel de Icaza  <miguel@novell.com>
7256
7257         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
7258         if the underlying types are the same, otherwise we need to produce
7259         code that will do the proper cast.
7260
7261         This was exposed by Marek's constant rewrite which produced
7262         invalid code for the call site:
7263
7264         enum X : long { a }
7265         void Method (X v) {}
7266
7267         Method ((X) 5)
7268
7269         This fixes test-49.cs
7270
7271 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7272
7273         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
7274           Type/Object should be allowed as well. Fixed bug #75968.
7275
7276 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
7277
7278         * expression.cs : (Binary.DoResolve): when one is enum constant and
7279           another is constant 0, then return enum one *as enum type*.
7280           Fixed bug 74846.
7281
7282 2005-09-02  Raja R Harinath  <rharinath@novell.com>
7283
7284         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
7285         internal.
7286
7287         Fix #75941.
7288         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
7289         flow-branching for LocalVariableReferences in case we were invoked
7290         from a MemberAccess.
7291         * expression.cs (LocalVariableReference.VerifyAssigned): New.
7292         Carved out of ...
7293         (LocalVariableReference.DoResolveBase): ... this.
7294         (MemberAccess.Resolve): Do the check that was disabled during
7295         SimpleNameResolve.
7296
7297 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7298
7299         * class.cs :
7300           (PartialContainer.Create): check abstract/sealed/static strictly
7301           but abstract/sealed can exist only at one side. Fixed bug #75883.
7302
7303 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
7304
7305         Fix #75945.
7306         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
7307         specified, don't default to UnmanagedType.I4.
7308
7309 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
7310
7311         * expression.cs : conditional operator should check possibly
7312           incorrect assign expression. Fixed bug #75946.
7313
7314 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7315
7316         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
7317           Reverting the change. gmcs is much complex than mcs on this matter.
7318
7319 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
7320
7321         * cs-tokenizer.cs : To read another token ahead of the actual 
7322           consumption, use new SavedToken and cache token instead of moving
7323           back the stream with SeekableStreamReader (it seemed problematic).
7324         * cs-parser.jay,
7325           driver.cs : Thus use StreamReader directly.
7326         * support.cs : Thus removed SeekableStreamReader.
7327
7328 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7329
7330         Fix #75934.
7331         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
7332         (ScopeInfo.EmitScopeType): Use it to construct field names from
7333         names of captured locals.
7334
7335         Fix #75929.
7336         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
7337         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
7338         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
7339         (ExplicitConversion): Remove enum cases already handled by
7340         implicit conversion.  Move implicit conversion check to the beginning.
7341         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
7342         * expression.cs (ArrayCreation.EmitDynamicInitializers):
7343         Don't treat System.Enum as a struct.
7344
7345 2005-08-30  Jb Evain  <jbevain@gmail.com>
7346
7347         * attribute.cs: handles as expression in parameters.
7348
7349 2005-08-30  Raja R Harinath  <rharinath@novell.com>
7350
7351         Fix #75802.
7352         * class.cs (TypeContainer.VerifyClsName): Don't use a
7353         PartialContainer when verifying CLS compliance.
7354         (AbstractPropertyEventMethod): Set Parent here, ...
7355         (PropertyMethod): ... not here.
7356
7357 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
7358
7359         * attribute.cs : escaped attribute name should not be allowed to be
7360           resolved (e.g. @class as classAttribute). Fixed bug #75930.
7361
7362 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7363
7364         Fix #75927.
7365         * convert.cs (ImplicitStandardConversionExists): Allow zero also
7366         when converting a long constant to unsigned long.
7367         * expression.cs (Invocation.OverloadResolve): Add sanity check to
7368         detect where IsApplicable and VerifyArgumentsCompat disagree.
7369
7370 2005-08-29  Raja R Harinath  <rharinath@novell.com>
7371         and Carlos Alberto Cortez  <carlos@unixmexico.org>
7372
7373         Fix #75848.
7374         * class.cs (TypeContainer.CanElideInitializer): New helper.
7375         (TypeContainer.EmitFieldInitializers): Use it to determine if we
7376         can safely emitting the initializer of a field.
7377
7378 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7379
7380         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
7381           allowed inside a switch (without loop). Fixed bug #75433.
7382
7383 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
7384
7385         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
7386         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
7387
7388 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7389
7390         * driver.cs : kinda reverting the default encoding changes (not exact 
7391           revert since I noticed that "codepage:reset" might not work fine).
7392
7393 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7394
7395         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
7396           Location. Now getter and setter store location correctly.
7397           (errors/cs0111-12.cs now reports the expected location.)
7398
7399 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
7400
7401         * driver.cs : Use default encoding on the environment.
7402           Removed (now that) extra parameter for SeekableStreamReader.
7403         * support.cs : (SeekableStreamReader) third .ctor() argument for
7404           StreamReader is not required (always true). preamble size could
7405           be acquired in simpler and safe way.
7406
7407 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
7408
7409         * cs-parser.jay: report CS0642 at warning level 3
7410           and report CS0642 for an if else statement also
7411           fixes bug #74745. Patch by John Luke (and a bit
7412           modified by me).
7413           Removed extra CS0642 warning check for "while",
7414           "for" and "fixed".
7415         * statement.cs: In Block.Resolve(), CS0642 check
7416           is reimplemented to check a sequence of an empty
7417           statement and a block.
7418
7419           Both fix bug #66777.
7420
7421 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
7422
7423         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
7424         detection until I fix it.
7425         
7426         * cs-tokenizer.cs: Changed error message.
7427         
7428         * cs-parser.jay: Fixed 2 error locations.
7429         
7430         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
7431         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
7432         properties.
7433         
7434         * enum.cs (GetSignatureForError): Fixed.
7435         
7436         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
7437         method detection.
7438         
7439         * class.cs,
7440         * typemanager.cs (RegisterProperty): Removed.
7441         
7442         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
7443
7444 2005-08-24  Raja R Harinath  <rharinath@novell.com>
7445
7446         Fix #75874.
7447         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
7448         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
7449
7450 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7451
7452         * expression.cs : tiny fix is required for not warning positive ulong.
7453           See test-441.cs.
7454
7455 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7456
7457         * expression.cs : add CS0652 check for constant and integral
7458           expression. Fixed bug #53974.
7459
7460 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7461
7462         * expression.cs : in DoNumericPromotions(), check if there is implicit
7463           conversion overload for string (to check CS0034). Fixed bug #52492.
7464
7465 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7466
7467         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
7468
7469 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7470
7471         * ecore.cs : report location when it is *not* Null.
7472
7473 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
7474
7475         * codegen.cs,
7476           ecore.cs,
7477           flowanalysis.cs,
7478           expression.cs:
7479           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
7480           correctly. Fixed bug #75721.
7481
7482 2005-08-23  Raja R Harinath  <rharinath@novell.com>
7483
7484         * support.cs (SeekableStreamReader.Position): Avoid an expensive
7485         loop that performs 'min (pos, char_count)'.
7486
7487         Fix #75862.
7488         * expression.cs (Unary.ResolveOperator): Don't discard implicit
7489         converted value in Operator.OnesComplement.
7490
7491 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
7492
7493         * anonymous.cs: If the anon method is pulled into a helper class,
7494         it needs to be `internal' not `private'. Fixes runtime behavior on
7495         msft. bug #75704
7496
7497 2005-08-20  Martin Baulig  <martin@ximian.com>
7498
7499         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7500         scope if we don't already have it.
7501
7502         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
7503         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
7504         fixes #75867.
7505
7506 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
7507
7508         Fix #75803
7509         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
7510         is a partial class.
7511
7512 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
7513
7514         The big constants rewrite
7515         Fix #75746, #75685 and more
7516         As a side effect saved 1MB for MWF ;-)
7517         
7518         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
7519         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
7520         enum based for corlib compilation.
7521         
7522         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
7523         subtractions.
7524         
7525         * class.cs (FixedField.Define): Use ResolveAsConstant.
7526         
7527         * const.cs (IConstant): Interface constants and enums.
7528         (Const.ResolveValue): New method for constant resolvning.
7529         (ExternalConstant): Constants from imported assemblies.
7530         
7531         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
7532         conversion; like enums.
7533         (Constant.ToType): Converts this constant to different type.
7534         (Constant.Increment): Adds 1.
7535         
7536         * convert.cs (ImplicitConversionRequired): Simplified.
7537         
7538         * cs-parser.jay: Create EnumMember directly.
7539         
7540         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
7541         
7542         * doc.cs (GenerateEnumDocComment): Removed.
7543         
7544         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
7545         (ConvertIntLiteral): Removed.
7546         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
7547         
7548         * enum.cs (EnumMember): Implement IConstant.
7549         (Enum.IsValidEnumConstant): Removed.
7550         (Enum.GetNextDefaultValue): Removed.
7551         (Enum.FindMembers): Updated.
7552         (Enum.GenerateDocComment): Iterate enum members.
7553         
7554         * expression.cs (Cast.TryReduce): Handle enums correctly.
7555         (New.Constantify): Made public.
7556         (MemberAccess.DoResolve): Removed contant specific if(s).
7557         
7558         * literal.cs (NullLiteral): Implement new abstract methods.
7559         
7560         * statement.cs (GotoCase.Resolve): Use new constant methods.
7561         (SwitchLabel.ResolveAndReduce): Use new constant methods.
7562         
7563         * typemanager.cs (LookupEnum): Removed.
7564         (IsEnumType): Fixed to work with corlib.
7565         (RegisterConstant): Removed.
7566         (LookupConstant): Removed.
7567         (GetConstant): Changed to work with IConstant.
7568
7569 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
7570
7571         * location.cs : Fixed overflown (>255) column number.
7572
7573 2005-08-03  Raja R Harinath  <rharinath@novell.com>
7574
7575         First cut of the qualified-alias-member feature.
7576         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
7577         token.
7578         * cs-parser.jay (DOUBLE_COLON): New token.
7579         (namespace_or_type_name): Add rule for recognizing
7580         qualified-alias-members.
7581         (primary_expression): Likewise.
7582         (element_access): Allow QualifiedAliasMember as a possible
7583         type-bearing expression.
7584         (local_variable_type, local_variable_pointer_type): Likewise.
7585         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
7586         aliases in the current and enclosing namespace declarations.
7587         (NamespaceEntry.UsingAlias): Add CS0440 warning.
7588         * decl.cs (MemberName.is_double_colon): New.
7589         (MemberName.MemberName): Add new constructor for alias-member.
7590         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
7591         * expression.cs (QualifiedAliasMember): New expression type.
7592
7593 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7594
7595         * location.cs : it borked when no argument was specified.
7596
7597 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7598
7599         * location.cs : tiny ToString() format fix.
7600
7601 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7602
7603         * statement.cs : oops, it was missing.
7604
7605 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
7606
7607         A set of fixes for precise line/column location.
7608
7609         * location.cs :
7610           "token" field now holds a file/line "delta", a line number offset 
7611           from the segment, and a column number. See also:
7612           http://lists.ximian.com/pipermail/mono-devel-list/2004-
7613           December/009508.html
7614           Removed static IsNull. Use instance IsNull property instead.
7615         * cs-tokenizer.cs :
7616           For some tokens it stores Location. For Identifier it stores
7617           LocatedToken which is a pair of string name and location.
7618           Column numbers are adjusted only at getChar().
7619         * report.cs :
7620           Use Location.ToString() for reporting (it now contains column).
7621         * cs-parser.jay :
7622           Largely modified to use LocatedToken instead of
7623           string (IDENTIFIER), and to acquire Location from some tokens.
7624         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
7625           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
7626           codegen.cs :
7627           Now MemberName holds Location. DeclSpace.ctor() receives Location
7628           as a parameter. Removed extra parameters to all derived classes.
7629           Replaced Location.IsNull() with instance property.
7630         * assign.cs, expression.cs :
7631           Added .ctor() overload that omits Location.
7632         * attribute.cs :
7633           Added "nameEscaped" flag that indicates the identifier was escaped
7634           in the source file. This fixes bug #57047.
7635
7636 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
7637
7638         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
7639         New method, looking for lo-case imported cls type.
7640
7641         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
7642         here.
7643
7644         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
7645
7646         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
7647
7648         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
7649         all_imported_types.
7650         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
7651
7652         Optimized to save 3.5 MB for SWF compilation.
7653
7654 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7655
7656         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
7657         (PartialContainer.Create): Moved logic AddToContainer.
7658         (PartialContainer.MarkForDuplicationCheck): Shares name.
7659         
7660         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
7661         place.
7662         
7663         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
7664         initialization.
7665         (Namespace.GetSignatureForError): New method.
7666         
7667         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
7668         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
7669
7670 2005-08-01  Raja R Harinath  <rharinath@novell.com>
7671
7672         Fix #75669.
7673         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
7674         member lookup rather than qualifier_type, since qualifier_type can
7675         be null.
7676
7677 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
7678
7679         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
7680         enum member.
7681
7682 2005-07-31  Miguel de Icaza  <miguel@novell.com>
7683
7684         * statement.cs: Copy the local exception into the exception
7685         captured local.  Fixes 75674
7686
7687 2005-07-31  Raja R Harinath  <harinath@gmail.com>
7688
7689         Fix #75658.
7690         * expression.cs (Invocation.OverloadResolve): Don't report error
7691         CS1501 if error CS1502 has been reported.
7692         (New.DoResolve): Delegate CS1501 reporting to
7693         Invocation.OverloadResolve.
7694
7695         Fix #75656.
7696         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
7697         invariant-meaning-in-block property in an enclosing block if
7698         necessary.
7699
7700 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
7701
7702         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
7703         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
7704         (Switch.CheckSwitch): Just save 50kb for SWF.
7705
7706 2005-07-27  Martin Baulig  <martin@ximian.com>
7707
7708         * anonymous.cs (CaptureContext.AddField): Added
7709         `AnonymousContainer am' argument; compute its toplevel scope if
7710         it's not already computed.  Fixes #75649.
7711
7712 2005-07-26  Raja R Harinath  <rharinath@novell.com>
7713
7714         Fix #75628.
7715         * class.cs (Constructor.Emit): Reset block to null if the block
7716         resolve fails.
7717
7718 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7719
7720         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
7721
7722 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
7723
7724         * class.cs (MethodData.Define): Check whether accessor implementing
7725         interface is public.
7726
7727         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
7728
7729 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
7730
7731         Fix #57245
7732         * namespace.cs (LookupType): Moved same type check to...
7733         
7734         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
7735         with the same name.
7736
7737 2005-07-21  Raja R Harinath  <rharinath@novell.com>
7738
7739         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
7740         already found a typebuilder.
7741         * class.cs (MethodCore.IsDuplicateImplementation): Compare
7742         MemberNames, not strings.
7743
7744         * const.cs (Error_ExpressionMustBeConst): 
7745         Rename from Error_EpressionMustBeConst.
7746         * const.cs, class.cs, statement.cd: Update.
7747
7748 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
7749
7750         Fix #65573
7751
7752         * const.cs (Const.LookupConstantValue): Report missing contant expression
7753         everytime.
7754         (Error_EpressionMustBeConstant): Only one error method.
7755
7756         * class.cs, statement.c: Updated.
7757
7758 2005-07-20  Raja R Harinath  <rharinath@novell.com>
7759
7760         * statement.cs (Block.Flags): Add back HasVarargs.
7761         (Block.flags): Make protected.
7762         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
7763
7764         * typemanager.cs (types, typecontainers, user_types): Remove.
7765         (UserTypes, TypeContainers): Likewise.
7766         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
7767         (CleanUp, Reset): Update.
7768         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
7769         (GetNestedType): Use Type.GetNestedType.
7770         (CoreLookupType): Take two arguments, the namespace and the
7771         basename of the type.  Update to use the Namespace.Lookup
7772         mechanism.
7773         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
7774         (RealMemberLookup): Use IsNestedChildOf instead of playing with
7775         string concatenation and substring matches.
7776         * class.cs, enum.cs, delegate.cs: Update to changes.
7777
7778 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
7779
7780         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
7781         Expression and made virtual.
7782
7783         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
7784         (ImplicitStandardConversionExists): Fixed `byte' typo ?
7785
7786         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
7787
7788         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
7789         error message.
7790
7791         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
7792         change.
7793
7794 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
7795
7796         Fix #57707
7797         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
7798         AssemblyCultureAttribute is not used on executable.
7799
7800         * rootcontext.cs,
7801         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
7802
7803 2005-07-16  Raja R Harinath  <rharinath@novell.com>
7804
7805         Fix #60638.
7806         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
7807         New.  Reports CS0252/CS0253.
7808         Mostly taken from preliminary patch by Duncak Mak.
7809         (Binary.DoResolveOperator): Store results of operator lookup.
7810         Use them to detect if we need to warn about unintended reference
7811         comparisons.
7812
7813 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7814
7815         Fix #72969.
7816         * namespace.cs (Namespace.Lookup): Add back location parameter.
7817         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
7818         * delegate.cs, ecore.cs, expression.cs: Update to changes.
7819
7820         * codegen.cs (EmitContext.DeclSpace): Make readonly.
7821         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
7822         (Namespace.LookupType): ... this.
7823         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
7824         of namespaces.
7825         * typemanager.cs (LookupTypeReflection): Remove buggy code that
7826         purported to handle pointers.
7827         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
7828         CoreLookupType.
7829
7830 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
7831
7832         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
7833         type as namespace.
7834
7835 2005-07-15  Raja R Harinath  <rharinath@novell.com>
7836
7837         * namespace.cs (Namespace.Lookup): Drop location parameter.
7838         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
7839         (NamespaceEntry.Lookup): ... this.
7840         (NamespaceEntry.Error_AmbiguousTypeReference):
7841         Move here from DeclSpace.
7842         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
7843         names ...
7844         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
7845         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
7846         Move to NamespaceEntry.
7847         * delegate.cs, expression.cs: Update to changes.
7848
7849 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
7850
7851         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
7852         CheckAttributeType and refactored.
7853         (Attribute.ResolvePossibleAttributeType): Changed to reuse
7854         ResolveAsTypeTerminal error handling.
7855         (ResolveAsTypeTerminal): Introduced because of global attributes extra
7856         handling.
7857         (GetSignatureForError): Print errors in same way.
7858
7859         * class.cs,
7860         * codegen.cs: Reflect attribute GetSignatureForError change.
7861
7862         * ecore.cs,
7863         * expression.cs: Add silent parameter to ResolveAsTypeStep.
7864
7865         * namespace.cs (UsingEntry): Refactored to make fields private.
7866
7867         * assign.cs,
7868         statement.cs: Error_UnexpectedKind has extra parameter.
7869
7870 2005-07-14  Raja R Harinath  <rharinath@novell.com>
7871
7872         * ecore.cs (IAlias): Remove.
7873         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
7874         that implement the interface.
7875         * namespace.cs (Namespace): Likewise.
7876         (Namespace.declspaces): Renamed from 'defined_names'.
7877         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
7878         DeclSpace instead of an IAlias.
7879         * tree.cs (Tree.AddDecl): Update.
7880
7881 2005-07-12  Raja R Harinath  <rharinath@novell.com>
7882
7883         * statement.cs (Block.Flags); Remove HasVarargs.
7884         (Block.HasVarargs): Move to ToplevelBlock.
7885         (Block.ThisVariable, Block.AddThisVariable): Likewise.
7886         (Block.Variables): Make protected.  Initialize variable hashtable
7887         if necessary.
7888         (Block.AddVariable): Update.
7889         (Block.Resolve): Update to changes.
7890         (ToplevelBlock.HasVarargs): New boolean.
7891         (ToplevelBlock.ThisVariable): Move here from Block.
7892         (ToplevelBlock.AddThisVariable): Likewise.
7893         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
7894         * expression.cs (This.ResolveBase): Update to changes.
7895         (ArglistAccess.DoResolve): Likewise.
7896
7897 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7898
7899         Fix #75321
7900         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
7901
7902         * class.cs (TypeContainer.VerifyMembers): Distinguish between
7903         not used and not used & assigned.
7904         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
7905
7906 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
7907
7908         Fix #75053
7909         * expression.cs (Is.DoResolve): null is never provided type.
7910
7911 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
7912
7913         Fix #52496
7914         * cs-parser.jay: Less strict event error rule to catch more errors.
7915
7916 2005-07-08  Martin Baulig  <martin@ximian.com>
7917
7918         Fix test-iter-10.cs - distinguish whether we `yield' in a property
7919         gettter (allowed) or setter (not allowed).
7920
7921         * class.cs (Accessor): Implement IIteratorContainer.
7922         (Accessor.Yields): New public field.
7923         (PropertyBase.PropertyMethod.Define): Handle iterators on a
7924         per-accessor basis.
7925
7926         * cs-parser.jay
7927         (get_accessor_declaration, set_accessor_declaration): Set the
7928         `yields' flag on the accessor, not the property.
7929         (property_declaration): Do the iterators check on a per-accessor
7930         basis and not for the whole property.
7931
7932 2005-07-08  Martin Baulig  <martin@ximian.com>
7933
7934         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
7935         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
7936
7937 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
7938
7939         Fix #74975
7940         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
7941         (ExtractSecurityPermissionSet): Cope with self referencing security
7942         attributes properly.
7943
7944         * driver.cs (SetOutputFile): Made public property OutputFile.
7945
7946 2005-07-07  Raja R Harinath  <rharinath@novell.com>
7947
7948         Fix #75486.
7949         * class.cs (TypeContainer.first_nonstatic_field): Rename from
7950         has_nonstatic_fields.  Make into a FieldBase pointer.
7951         (TypeContainer.AddField): Add CS0282 check.
7952         (TypeContainer.EmitType): Update.
7953
7954 2005-07-06  Miguel de Icaza  <miguel@novell.com>
7955
7956         * cs-tokenizer.cs (consume_identifier): Do not create strings to
7957         compare if they start with __.
7958
7959 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7960
7961         * statement.cs (Switch.SwitchGoverningType): Only look at
7962         UserCasts that don't need implicit standard conversions to one of
7963         the allowed switch types (Fixes test-322.cs).
7964         (LocalInfo.Resolve): Re-enable sanity-test.
7965
7966 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
7967
7968         * cs-tokenizer.cs (consume_identifier): Detect double undescores
7969         
7970         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
7971         
7972         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
7973
7974 2005-07-06  Raja R Harinath  <rharinath@novell.com>
7975
7976         Fix #75472.
7977         * ecore.cs (SimpleName.GetSignatureForError): Add.
7978         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
7979         (MemberAccess.GetSignatureForError): Add.
7980
7981 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
7982  
7983         The big error and warning messages review.
7984         
7985         * anonymous.cs,
7986         * assign.cs,
7987         * attribute.cs,
7988         * class.cs,
7989         * codegen.cs,
7990         * convert.cs,
7991         * cs-parser.jay,
7992         * cs-tokenizer.cs,
7993         * decl.cs,
7994         * delegate.cs,
7995         * doc.cs,
7996         * driver.cs,
7997         * ecore.cs,
7998         * enum.cs,
7999         * expression.cs,
8000         * flowanalysis.cs,
8001         * iterators.cs,
8002         * literal.cs,
8003         * location.cs,
8004         * modifiers.cs,
8005         * namespace.cs,
8006         * parameter.cs,
8007         * pending.cs,
8008         * report.cs,
8009         * rootcontext.cs,
8010         * statement.cs,
8011         * support.cs,
8012         * tree.cs,
8013         * typemanager.cs: Updated.
8014         
8015         * class.cs: (MethodCore.SetYields): Moved here to share.
8016         (PropertyMethod.Define): Moved iterator setup here.
8017         
8018         * iterators.cs: Add orig_method to have full access to parent
8019         container.
8020
8021 2005-07-05  Raja R Harinath  <rharinath@novell.com>
8022
8023         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
8024         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
8025         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
8026         variable of struct type.
8027         * expression.cs (Unary.ResolveOperator): Update to change.
8028         (Indirection.VerifyFixed): Likewise.
8029         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
8030         (ParameterReference.VerifyFixed): Value parameters are fixed.
8031         (This.VerifyFixed): Treat 'this' as a value parameter.
8032         * statement.cs (LocalInfo.IsFixed): Remove.
8033
8034 2005-07-01  Martin Baulig  <martin@ximian.com>
8035
8036         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
8037         `ec.EmitThis ()' to get the correct scope.
8038
8039 2005-07-01  Martin Baulig  <martin@ximian.com>
8040
8041         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
8042         instance is a ParameterReference; fixes #75299.
8043
8044 2005-07-01  Martin Baulig  <martin@ximian.com>
8045
8046         Reverted Marek's latest patch (r46725):
8047         - it contains structural changes which are neither mentioned in
8048           the ChangeLog nor explained anywhere; for example the additional
8049           argument of EmitContext's and Iterator's .ctor's and the
8050           TypeContainer.DefineMembers() change.
8051         - structural changes like this should go in in seperate patches
8052           and not be hidden in a huge patch which just seems to affect
8053           warnings and errors.
8054           a big and hard to understand patch.
8055         - it breaks iterators and causes regressions, for instance in
8056           test-iter-03.cs.      
8057
8058 2005-06-30  Raja R Harinath  <rharinath@novell.com>
8059
8060         Fix #75412.
8061         * expression.cs (Indexers.map): Remove.
8062         (Indexers.Append): Filter out inaccessible setters and getters.
8063         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
8064
8065         Fix #75283.
8066         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
8067         Refactored from ...
8068         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
8069         (FieldExpr.Emit, PropertyExpr.Emit): Update.
8070         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
8071         * expression.cs (Invocation.EmitCall): Add CS0120 check.
8072
8073 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
8074
8075         Fix #75322
8076         * class.cs (FieldBase.GetInitializerExpression): One more field
8077         for backup.
8078
8079 2005-06-28  Miguel de Icaza  <miguel@novell.com>
8080
8081         * pending.cs: Do not define a proxy if the base method is virtual,
8082         it will be picked up by the runtime (bug 75270).
8083
8084 2005-06-08  Martin Baulig  <martin@ximian.com>
8085
8086         The big Iterators rewrite :-)
8087
8088         * iterators.cs: Rewrite this to use the anonymous methods framework.
8089
8090         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
8091         before the TypeContainers; see 2test-21.cs.
8092
8093         * class.cs
8094         (TypeContainer.DefineType): Don't create a new EmitContext if we
8095         already have one (this only happens if we're an Iterator).
8096         (TypeContainer.Define): Also call Define() on all our iterators.
8097         (Method.CreateEmitContext): Added support for iterators.
8098
8099         * anonymous.cs
8100         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
8101         (AnonymousContainer.CreateMethodHost): Moved here from
8102         AnonymousMethod and made abstract.
8103         (AnonymousContainer.CreateScopeType): New abstract method.
8104         (AnonymousContainer.IsIterator): New public property.
8105         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
8106         get the ScopeTypeBuilder rather than manually defining it here. 
8107         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
8108         iterators here.
8109
8110         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
8111         before RootContext.DefineTypes().
8112
8113         * codegen.cs (EmitContext.RemapToProxy): Removed.
8114         (EmitContext.CurrentAnonymousMethod): Changed type from
8115         AnonymousMethod -> AnonymousContainer.
8116         (EmitContext.ResolveTopBlock): Protect from being called twice.
8117         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
8118         (EmitContext.EmitThis): Removed the iterators hacks; use the
8119         anonymous methods framework for that.
8120
8121         * statement.cs
8122         (ToplevelBlock.Container): Make this a property, not a field.
8123         (ToplevelBlock.ReParent): New public method; move the
8124         ToplevelBlock into a new container.
8125         (Foreach.TemporaryVariable): Simplify.
8126
8127 2005-06-05  Martin Baulig  <martin@ximian.com>
8128
8129         * statement.cs (LocalInfo.CompilerGenerated): New flag.
8130         (Block.AddTemporaryVariable): New public method; creates a new
8131         `LocalInfo' for a temporary variable.
8132         (Block.EmitMeta): Create the LocalBuilders for all the temporary
8133         variables here.
8134         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
8135         non-iterator variables.
8136
8137 2005-06-05  Martin Baulig  <martin@ximian.com>
8138
8139         * statement.cs (Foreach.TemporaryVariable): Create the
8140         LocalBuilder in the Emit phase and not in Resolve since in some
8141         situations, we don't have an ILGenerator during Resolve; see
8142         2test-19.cs for an example.
8143
8144 2005-06-04  Martin Baulig  <martin@ximian.com>
8145
8146         **** Merged r45395 from GCS ****
8147
8148         The big Foreach rewrite - Part II.
8149
8150         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
8151         with `PropertyInfo ienumerator_getcurrent'.
8152
8153         * codegen.cs (VariableStorage): Removed.
8154
8155         * statement.cs
8156         (Foreach): Derive from Statement, not ExceptionStatement.
8157         (Foreach.CollectionForeach): New nested class.  Moved all the code
8158         dealing with collection foreach here.
8159         (Foreach.ForeachHelperMethods): Removed.
8160         (Foreach.TemporaryVariable): Implement IMemoryLocation.
8161
8162 2005-05-23  Martin Baulig  <martin@ximian.com>
8163
8164         * statement.cs (Try.DoResolve): Don't create a `finally' if we
8165         don't need to.  Fix #75014.
8166
8167 2005-05-20  Martin Baulig  <martin@ximian.com>
8168
8169         Merged r44808 from GMCS.
8170
8171         * class.cs (TypeContainer.CircularDepException): Removed.
8172         (TypeContainer.DefineType): Removed the `InTransit' stuff.
8173         (TypeContainer.CheckRecursiveDefinition): Check for circular class
8174         (CS0146) and interface (CS0529) dependencies here.
8175
8176 2005-06-21  Raja R Harinath  <rharinath@novell.com>
8177
8178         * expression.cs (Invocation.EmitCall): Fix initialization
8179         'this_call' to reflect current behaviour.  Fix indentation.
8180
8181         * convert.cs (FindMostEncompassedType): Add two trivial special
8182         cases (number_of_types == 0 || number_of_types == 1).
8183         (FindMostEncompasingType): Likewise.
8184
8185 2005-06-17  Raja R Harinath  <rharinath@novell.com>
8186
8187         Some cleanups preparing for the fix of #75283.
8188         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
8189         error testing.
8190         (EventExpr.InstanceResolve): Likewise.
8191         (EventExpr.DoResolve): Remove redundant checks.
8192
8193 2005-06-10  Duncan Mak  <duncan@novell.com>
8194
8195         * cs-tokenizer.cs (process_directives): New flag for controlling
8196         the processing of preprocessor directives.
8197         (x_token): After seeing a '#', return Token.NONE instead of going
8198         to handle_preprocessing_directive() when not processing
8199         directives. This avoids unnecessary processing during the token peek in
8200         is_punct().
8201
8202         This fixes #74939.
8203
8204         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
8205         the existing error reporting methods instead of Report.Error.
8206
8207         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
8208         after Raja's rewrite.
8209
8210 2005-06-08  Miguel de Icaza  <miguel@novell.com>
8211
8212         * class.cs: Small fix.
8213
8214 2005-06-08  Raja R Harinath  <rharinath@novell.com>
8215
8216         Fix #75160.
8217         * class.cs (GetPartialBases): Fix return value check of
8218         part.GetClassBases.
8219
8220 2005-06-07  Raja R Harinath  <rharinath@novell.com>
8221
8222         Ensure that partial classes are registered in their enclosing
8223         namespace.  Initial part of fix of #75160.
8224         * tree.cs (Tree.RecordDecl): Add new namespace argument.
8225         Register declspace with namespace here, not in
8226         DeclSpace.RecordDecl.
8227         * cs-parser.jay: Pass namespace to RecordDecl.
8228         * class.cs (PartialContainer.Create): Likewise.
8229         (ClassPart.DefineType): New sanity-check.  Throws an exception if
8230         called.
8231         * decl.cs (Declspace.RecordDecl): Remove.
8232         * namespace.cs (NamespaceEntry.DefineName): Remove.
8233
8234 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
8235
8236         * rootcontext.cs: Reset TargetExt as well.
8237
8238 2005-06-03  Raja R Harinath  <rharinath@novell.com>
8239
8240         * ecore.cs (Expression.Resolve): Emit CS0654 error when
8241         -langversion:ISO-1.
8242
8243 2005-06-02  Raja R Harinath  <rharinath@novell.com>
8244
8245         Fix #75080, cs0119.cs.
8246         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
8247         of ...
8248         (Expression.Resolve): ... this.  Use it.  Remove bogus code
8249         allowing ExprClass.Type and ExprClass.Namespace for
8250         ResolveFlags.VariableOrValue.
8251         (Expression.Resolve) [1-argument variant]: Change default resolve
8252         flags based on language version.
8253         (Expression.Error_UnexpectedKind): Use a simple string array
8254         rather than an ArrayList.
8255         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
8256         not ExprClass.Type.
8257         (TypeOfVoid.DoResolve): Likewise.
8258         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
8259         flags argument -- it always has the same value.
8260
8261 2005-05-31  Raja R Harinath  <rharinath@novell.com>
8262
8263         Fix #75081.
8264         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
8265         Use it in the error message.
8266         * assign.cs, expression.cs, statement.cs: Update.
8267
8268 2005-05-30  Raja R Harinath  <rharinath@novell.com>
8269
8270         Fix #75088.
8271         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
8272         the "almostMatchedMember" case too.
8273         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
8274         that failed the accessibility checks to 'almost_match'.
8275
8276 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
8277
8278         * attribute.cs: Use internal MethodBuilder methods to set
8279         ExactSpelling and SetLastError on PInvoke methods, instead
8280         of passing them via charset.  Fixes #75060.
8281
8282 2005-05-27  Raja R Harinath  <rharinath@novell.com>
8283
8284         * parameter.cs (Parameter): Remove TODO comment.
8285         (Parameter.DefineParameter): Remove Location parameter.
8286         (Parameters.LabelParameters): Likewise.
8287         * class.cs (Constructor.Emit): Update to change.
8288         (MethodData.Emit): Likewise.
8289         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
8290         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
8291
8292 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
8293
8294         * parameter.cs,
8295           Removed Parameters.Location and added Parameter.Location instead.
8296           Removed Location parameter from Emit() and GetSignature().
8297         * anonymous.cs,
8298           class.cs,
8299           cs-parser.jay,
8300           delegate.cs,
8301           iterators.cs,
8302           statement.cs :
8303           Modified all related calls.
8304
8305 2005-05-26  Raja R Harinath  <rharinath@novell.com>
8306
8307         Improve user-defined conversion handling.
8308         * convert.cs (GetConversionOperators): Rewrite.  Return only the
8309         applicable operators.
8310         (AddConversionOperators): New.  Helper for GetConversionOperators.
8311         (FindMostEncompassedType, FindMostEncompassingType): Verify that
8312         there is only one most encompassed/encompassing type.
8313         (FindMostSpecificSource, FindMostSpecificTarget): Remove
8314         "applicable operator" handling.
8315         (UserConversion): Move cache here from GetConversionOperators.
8316         Directly cache the chosen operator, rather than the whole
8317         MethodGroup.
8318         (ExplicitNumericConversion): Fix buggy implementation of Decimal
8319         case.  Allow conversion of decimal to sbyte and byte too.
8320         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
8321         New static methods.  Used to avoid allocating EmptyExpressions in
8322         convert.cs.
8323
8324 2005-05-24  Duncan Mak  <duncan@novell.com>
8325
8326         * ecore.cs (CastFromDecimal): New class for casting a decimal to
8327         another class, used in Convert.ExplicitNumericConversion.
8328         (CastToDecimal): New class, similar to above, but casts to
8329         System.Decimal, used in Convert.ImplicitNumericConversion and also
8330         in explicit convesion from double/float to decimal.
8331
8332         * convert.cs (ImplicitNumericConversion): Handle implicit
8333         conversions to System.Decimal.
8334         (ExplicitNumericConversion): handle explicit conversions to
8335         System.Decimal.
8336
8337         This fixes #68711.
8338         
8339 2005-05-20  Miguel de Icaza  <miguel@novell.com>
8340
8341         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
8342         know the type at this stage, just break through.   Fixes #75008 
8343
8344 2005-05-19  Martin Baulig  <martin@ximian.com>
8345
8346         * delegate.cs
8347         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
8348         to disable error reporting.
8349
8350         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
8351         here since we don't want to report an error; see the new test-336.cs.
8352
8353 2005-05-19  Raja R Harinath  <rharinath@novell.com>
8354
8355         * statement.cs (ToplevelBlock.GetParameterReference)
8356         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
8357         Move here from class Block.
8358         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
8359         * expression.cs (ParameterReference.DoResolveBase): Likewise.
8360
8361 2005-05-18  Martin Baulig  <martin@ximian.com>
8362
8363         Fix #74978.
8364
8365         * flowanalysis.cs
8366         (FlowBranching.Reachability): Add non-static public And() and Or()
8367         methods.
8368         (FlowBranchingSwitch): New class; do the `break_origins' thing
8369         like in FlowBranchingLoop.
8370         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
8371         reachability, not just locals and parameters.
8372         (FlowBranching.MergeChild): Remove some of the hacks for loop and
8373         switch; MergeBreakOrigins() now takes care of that.
8374
8375 2005-05-18  Martin Baulig  <martin@ximian.com>
8376
8377         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8378         a loop and may leave it, reset the barrier; fixes #74974.
8379
8380 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
8381         
8382         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
8383         is back.
8384         
8385         * cs-parser.jay: Catch more lexical errors.
8386         
8387         * report.cs: Add one more Error method.
8388         
8389         * rootcontext.cs,
8390         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
8391
8392 2005-05-17  Martin Baulig  <martin@ximian.com>
8393
8394         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
8395         #70970. 
8396
8397 2005-05-16  Raja R Harinath  <rharinath@novell.com>
8398
8399         Fix test-382.cs.  Emit values of decimal constants.
8400         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
8401         Carved out of ...
8402         (TypeContainer.AddField): ... this.
8403         (TypeContainer.EmitFieldInitializers): Allow the list of fields
8404         with initializers to include 'Const's.
8405         (ClassPart.RegisterFieldForInitialization): Forward to
8406         PartialContainer.
8407         * const.cs (Const.Const): Pass initializer to base class.
8408         (Const.Define): In case of decimal constants, register them for
8409         initialization in a static constructor.
8410
8411 2005-05-14  Martin Baulig  <martin@ximian.com>
8412
8413         * statement.cs (Block.Resolve): Correctly handle unreachable code;
8414         do not call ResolveUnreachable() on unreachable statements in
8415         here, see the comment in the source code.
8416
8417 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8418
8419         Fix #74934.
8420         * expression.cs (BinaryResolveOperator): If one of the operands of
8421         an equality comparison is 'null' and the other is a pointer type,
8422         convert the null to a NullPointer.
8423         * convert.cs (ImplicitReferenceConversion): If the expression is a
8424         NullLiteral and the target type is a pointer type, return a
8425         NullPointer instead.
8426         (ImplicitConversionStandard): Likewise.
8427
8428 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
8429         
8430         * cs-parser.jay: Set readonly context based on special constructs.
8431         
8432         * expression.cs (LocalVariableReference.DoResolveBase): Improved
8433         readonly variable error handling.
8434         
8435         * rootcontext.cs (EmitCode): Don't verify members when error
8436         occurred.
8437         
8438         * statement.cs (LocalInfo): Add reaodnly context information.
8439         (SetReadOnlyContext, GetReadOnlyContext): New methods.
8440
8441 2005-05-13  Raja R Harinath  <rharinath@novell.com>
8442
8443         * statement.cs (Block.Resolve): Revert change below.  Modify fix
8444         for #74041 to initialize 'resolved' to false only for explicit
8445         blocks.  Fixes #74873.
8446
8447 2005-05-12  Raja R Harinath  <harinath@gmail.com>
8448
8449         Fix #74920.
8450         * typemanager.cs (unmanaged_enclosing_types): New.
8451         (IsUnmanagedType): Avoid infloops by using
8452         'unmanaged_enclosing_types' to talk with recursive invocations.
8453
8454 2005-05-13  Martin Baulig  <martin@ximian.com>
8455
8456         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
8457         instance variable, not a local.  Fix #74873.
8458         (Block.ResolveUnreachable): Set it to true here.
8459
8460 2005-05-11  Duncan Mak  <duncan@novell.com>
8461
8462         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
8463         continuing to process for 'arg'.
8464         (handle_preprocessing_directive): Check the argument of the #endif
8465         directive and report error CS1025 if there are any trailing
8466         characters.
8467
8468         According to the C# spec, having even whitespace after the #endif
8469         directive is illegal; however, because we call arg.TrimEnd ()
8470         beforehand, we have the same behavior as csc, allowing whitespace
8471         after the directive.
8472
8473         Fixes #74892.
8474
8475 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
8476
8477         Fix #74863.
8478         
8479         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
8480         (Constructor.GetObsoleteAttribute): Implemented correctly.
8481
8482 2005-05-10  Martin Baulig  <martin@ximian.com>
8483
8484         * support.cs (ReflectionParameters.ParameterModifier): Use
8485         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
8486         and `ParameterAttributes.In'.  Fixes #74884.
8487
8488 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
8489
8490         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
8491         
8492         * expression.cs (Argument.GetParameterModifier): Turned to property.
8493         (Invocation.Error_InvalidArguments): Add more descriptive errors.
8494         
8495         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
8496         its C# equivalent.
8497         
8498 2005-05-09  Raja R Harinath  <rharinath@novell.com>
8499
8500         Fix #74852.
8501         * decl.cs (MemberCache.AddMethods): Register override methods,
8502         rather than non-override methods.
8503         * typemanager.cs (RegisterOverride): New.
8504         (IsOverride): Update.
8505
8506 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
8507
8508         Fix #73105.
8509         
8510         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
8511         recursive declaration.
8512         
8513         * statement.cs (Block.ResolveMeta): Report any error in resolving.
8514         
8515 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
8516
8517         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
8518         
8519         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
8520
8521 2005-05-05  Raja R Harinath  <rharinath@novell.com>
8522
8523         Fix #74797.
8524         * decl.cs (DeclSpace.FamilyAccessible): 
8525         Use TypeManager.IsNestedFamilyAccessible.
8526
8527         Fix reopened #64812.
8528         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
8529         internal'.
8530
8531 2005-05-04  Raja R Harinath  <rharinath@novell.com>
8532             Abin Thomas  <projectmonokochi@rediffmail.com>
8533             Anoob V E  <projectmonokochi@rediffmail.com>
8534             Harilal P R  <projectmonokochi@rediffmail.com>
8535
8536         Fix #64812.
8537         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
8538         allow access to all static members.
8539
8540 2005-05-04  Martin Baulig  <martin@ximian.com>
8541
8542         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
8543
8544 2005-05-04  Martin Baulig  <martin@ximian.com>
8545
8546         Fix #74655.
8547
8548         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
8549         section at the end; make things work if `default' is not the last
8550         section.        
8551
8552 2005-05-04  Martin Baulig  <martin@ximian.com>
8553
8554         Fix #70400.
8555
8556         * statement.cs (Switch): Replaced the `got_default' field with a
8557         `default_section' one.
8558         (Switch.CheckSwitch): Set `default_section' here.
8559         (Switch.Resolve): If we're a constant switch and the constant is
8560         not found, use the default section.
8561
8562 2005-05-03  Martin Baulig  <martin@ximian.com>
8563
8564         * expression.cs (ArrayAccess.EmitGetLength): New public method.
8565
8566         * statement.cs (Foreach.ArrayForeach): New nested class.
8567         (Foreach.TemporaryVariable): New nested class.
8568         (Foreach.EmitArrayForeach): Removed; this is now in the new
8569         ArrayForeach class.
8570
8571 2005-05-03  Raja R Harinath  <rharinath@novell.com>
8572
8573         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
8574         more conservative.
8575         (VerifyPendingMethods): Revert change below.
8576
8577         * typemanager.cs (IsOverride, RegisterNonOverride): New.
8578         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
8579         that used to trigger warning -28.  Remove warning -28.
8580         * expression.cs (Invocation.OverloadResolve): Use
8581         TypeManager.IsOverride to distinguish override methods.
8582
8583         Fix #74773.
8584         * pending.cs (VerifyPendingMethods): If a base type implements the
8585         requested interface, don't bother checking individual methods of
8586         the base type.  As a side-effect, this prevents the creation of
8587         unnecessary proxies.
8588
8589 2005-05-02  Martin Baulig  <martin@ximian.com>
8590
8591         Fix #70182.
8592
8593         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8594         Also `And' the locals if the old vector is null.
8595         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
8596         null; in this case we basically reset all the variables.        
8597
8598 2005-05-02  Martin Baulig  <martin@ximian.com>
8599
8600         Fix #74529.
8601
8602         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
8603         Added `FlowBranching branching' argument; always `and' the
8604         variables instead of `or'ing them unless we're an infinite loop.
8605
8606         * statement.cs (While.Resolve): Create a new sibling unless we're
8607         infinite.       
8608
8609 2005-05-02  Martin Baulig  <martin@ximian.com>
8610
8611         Fix #70140.
8612
8613         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
8614         arguments; use it instead of creating a new TopLevelBlock.
8615         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
8616         our ConstructorInitializer.
8617
8618         * statement.cs
8619         (TopLevelBlock.TopLevelBranching): New public property.
8620         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
8621         and create our `TopLevelBranching'.
8622
8623         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
8624         anonymous method host, use `block.TopLevelBranching' rather than
8625         creating a new branching.
8626
8627 2005-04-20  Miguel de Icaza  <miguel@novell.com>
8628
8629         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
8630         a ScopeInfo, if any of the current children is a child of the new
8631         entry, move those children there.
8632
8633 2005-04-30  Martin Baulig  <martin@ximian.com>
8634
8635         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
8636         at the beginning of a SwitchSection.  Fix #73335.
8637
8638 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
8639
8640         Fix #74378
8641         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
8642         
8643         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
8644         (FieldExpr.DoResolve): Obsolete members are ignored for field
8645         initializers.
8646         
8647 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
8648
8649         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
8650         of arrays detection.
8651
8652         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
8653         verification.
8654         (Field.VerifyClsCompliance): Volatile fields are not compliant.
8655
8656         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
8657         arrays report.
8658
8659 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
8660
8661         * cs-parser.jay: Use the prefered version of -unsafe in error
8662         message.
8663
8664 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
8665
8666         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
8667         circumstances.
8668
8669 2005-04-20  John Luke  <john.luke@gmail.com>
8670
8671         * driver.cs: fix typo in error message, --outout to --output
8672
8673 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
8674
8675         * codegen.cs (InRefOutArgumentResolving): New field.
8676         
8677         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
8678         fields outside contructor.
8679         
8680         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
8681         
8682 2005-04-19  Miguel de Icaza  <miguel@novell.com>
8683
8684         * anonymous.cs (CaptureContext.EmitParameterInstance): The
8685         parameter code was not completed ever, so it was not as up-to-date
8686         as local variables.  Must finish it.
8687
8688         The bug fix was to compare the Toplevel of the block, not the
8689         current block.  Thanks for Ben for pointing this out. 
8690
8691 2005-04-19  Raja R Harinath  <rharinath@novell.com>
8692
8693         * decl.cs (AddMethods): Use the declaring type of the problem
8694         method to determine if we want to squash a warning.
8695
8696 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
8697
8698         * attribute.cs: Removed debug output.
8699
8700         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
8701         
8702         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
8703         Report.Stderr.
8704         
8705 2005-04-18  Raja R Harinath  <rharinath@novell.com>
8706
8707         Fix #74481.
8708         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
8709         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
8710         all null comparisons against reference types.
8711
8712 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
8713
8714         Fix# 74565
8715         * class.cs (TypeContainer.CircularDepException) New nested
8716         exception class.
8717         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
8718         (TypeContainer.DefineType): Removed error, reset InTransit before
8719         exit.
8720         (Class.DefineType): Throw exception when is in Transit.
8721         Catch exception and report error.
8722         (Struct.DefineType): Throw exception when is in Transit.
8723         Catch exception and report error.
8724         (Interface.DefineType): Throw exception when is in Transit.
8725         Catch exception and report error.
8726
8727         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
8728         handle nested exception handlers.
8729
8730         * flowanalysis.cs (InTryWithCatch): New method, search for try with
8731         a catch.
8732
8733         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
8734         InFinally and InCatch storage.
8735
8736         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
8737         (Catch.Resolve): Set and Restore ec.InCatch.
8738         (Try.Resolve): Set and Restore ec.InFinally.
8739         (Try.HasCatch): True when try has catch.
8740
8741 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
8742
8743         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
8744           for the same event member, so exclude such cases from warning 419.
8745           Fixed bug #74633.
8746
8747 2005-04-16  Miguel de Icaza  <miguel@novell.com>
8748
8749         * expression.cs (Binary.ResolveOperator): Apply patch from John
8750         Luke to fix bug 59864: operators &, | and ^ on enumerations
8751         require that the same enum type on both sides.
8752
8753         * driver.cs: Add warnings to old flag usage, this is to assist
8754         people who produce Makefiles and hope that the Makefiles will be
8755         used on Windows.
8756
8757         * class.cs (TypeContainer.EmitType): Moved the definition of the
8758         special $PRIVATE$ field from the resolve phase to the Emit phase.
8759         During resolve we do not know if we are a struct with
8760         HasExplicitLayout, we know this only after the attributes for the
8761         type are emitted.
8762
8763         Set the FieldOffset to zero on the dummy field that we create for
8764         the class.   Fixes 74590.
8765
8766 2005-04-16  Raja R Harinath  <rharinath@novell.com>
8767
8768         Fix #73834.
8769         * ecore.cs (PropertyExpr.resolved): New.
8770         (DoResolve): Use it to handle a case of double resolution here.
8771         Handle a case of identical-name-and-type-name.
8772         * expression.cs (ArrayCreation.CheckIndices): Avoid double
8773         resolution by storing the results of expression resolution back
8774         into the "probes" array.
8775
8776 2005-04-15  Raja R Harinath  <rharinath@novell.com>
8777
8778         Fix cs0208-7.cs and cs0208-8.cs.
8779         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
8780         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
8781         error reporting to point out the reason a struct is not unmanaged.
8782
8783 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8784
8785         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
8786           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
8787
8788 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8789
8790         Fix #74528.
8791         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
8792         IdenticalNameAndTypeName here.
8793         (EventExpr.InstanceResolve): Likewise.
8794
8795 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
8796
8797         C# 2.0 DefaultCharSetAttribute implementation
8798         
8799         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
8800         which allows us to set GlobalNamespace for every resolve.
8801         (Attribute.ResolveArguments): Cut from Resolve.
8802         (Attribute.GetCharSetValue): Returns CharSet named argument.
8803         (Attribute.DefinePInvokeMethod): Gets default charset from
8804         module settings.
8805         (GlobalAttribute.ResolveAsTypeStep): Override.
8806         (GlobalAttribute.ResolveArguments): Override.
8807         
8808         * class.cs (TypeAttr): Is protected.
8809         
8810         * codegen.cs (ModuleClass.DefaultCharSet): New member.
8811         (ModuleClass.DefaultCharSetType): New memeber.
8812         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
8813         
8814         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
8815         charset from module.
8816         
8817         * delegate.cs (TypeAttr): Override.
8818         (Delegate.DefineType): Use this TypeAttr.
8819         
8820         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
8821         at very early stage (before types are defined) to resolve model
8822         module attributes. It will probably not work with corlib but it
8823         should be ok.
8824         
8825         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
8826         charset from module.
8827         
8828         * typemanager.cs (default_charset_type): New type.
8829
8830 2005-04-13  Raja R Harinath  <rharinath@novell.com>
8831
8832         * decl.cs (MemberCache.AddMethods): Don't warn if
8833         System.Object.Finalize has buggy MethodAttributes.
8834
8835         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
8836         removed below.
8837
8838 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8839
8840         * doc.cs : detect ambiguous reference to overloaded members.
8841           Fixed bug #71603. MS 1.1 csc does not detect it.
8842
8843 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
8844
8845         * doc.cs : delegates must not be referenced with parameters.
8846           Fixed bug #71605.
8847
8848 2005-04-12  Miguel de Icaza  <miguel@novell.com>
8849
8850         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
8851
8852 2005-04-10  Miguel de Icaza  <miguel@novell.com>
8853
8854         * driver.cs (MainDriver): Stop processing if the CLS stage found
8855         errors. 
8856
8857         (CompilerCallableEntryPoint.InvokeCompiler): Always
8858         reset after execution;   Take a TextWriter argument for the
8859         output.
8860
8861         * report.cs: Use the error stream instead of hardcoding stderr. 
8862
8863 2005-04-09  Miguel de Icaza  <miguel@novell.com>
8864
8865         * class.cs: Reduce code paths to test, too small of an
8866         optimization to make it worth the extra testing.  Always perform
8867         it. 
8868
8869 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8870
8871         Fix #74510.
8872         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
8873         operators that had errors reported on them.
8874
8875 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
8876
8877         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
8878         argument types.
8879         (Attribute.Resolve): Add named argument type checking.
8880         
8881         * class.cs (FixedField.Define): Use IsPrimitiveType
8882         
8883         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
8884         
8885         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
8886         unsafe parameter types.
8887         
8888         * statement.cs (Using.ResolveExpression): Add better error description.
8889         
8890         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
8891         
8892 2005-04-08  Raja R Harinath  <rharinath@novell.com>
8893
8894         Fix #74484.
8895         * attribute.cs (Attribute.GetAttributeUsage): Resolve
8896         AttributeUsageAttribute in the emitcontext of the attribute class,
8897         not in the emitcontext of the attributable entity it was attached to.
8898         * cs-parser.jay: Use 'current_class', not 'current_container',
8899         when creating a GlobalAttribute.
8900
8901 2005-04-08  Alp Toker  <alp@atoker.com>
8902
8903         * pending.cs: The fix to #58413 failed to compile methods implementing
8904         interfaces with/without params modifiers and vice versa, even though
8905         params modifiers aren't part of the signature. Make the modifier check
8906         less strict as in csc.
8907
8908 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
8909             Anoob V E  <projectmonokochi@rediffmail.com>
8910             Harilal P R  <projectmonokochi@rediffmail.com>
8911
8912         Fix #58413.
8913         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
8914         modifiers of pending methods.
8915         (PendingImplementation.PendingImplementation): Initialize it.
8916         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
8917         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
8918         with ParameterData.  Add check for modifiers.
8919         * class.cs (MethodData.Define): Update to changes.
8920
8921 2005-04-07  Raja R Harinath  <rharinath@novell.com>
8922
8923         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
8924
8925 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
8926
8927         * class.cs (PropertyMethod.Define): Check private accessor in abstract
8928         property.
8929         
8930         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
8931         
8932         * rootcontext.cs,
8933         * typemanager.cs: Registered RequiredAttributeAttribute.
8934         
8935 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
8936
8937         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
8938         Warning CS0169 is back at level 3.
8939         (IMethodData.SetMemberIsUsed): New method.
8940         
8941         * decl.cs (IsUsed): New value; moved from FieldBase.Status
8942         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
8943         
8944         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
8945
8946         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
8947         contants.
8948         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
8949         is used.
8950         
8951         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
8952         is used.
8953         
8954         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
8955         to avoid the problems with nested types.
8956
8957 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
8958             Anoob V.E  <projectmonokochi@rediffmail.com>
8959             Harilal P.R  <projectmonokochi@rediffmail.com>
8960             Raja R Harinath  <rharinath@novell.com>
8961
8962         Fix #73820.
8963         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
8964         attribute.
8965         * typemanager (GetConstructor): Make public.
8966
8967 2005-04-05  John Luke  <john.luke@gmail.com>
8968             Raja R Harinath  <rharinath@novell.com>
8969
8970         Fix #62232.
8971         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
8972         struct too.  Return false quicker in a few cases.
8973         (VerifyUnManaged): Use it.
8974
8975 2005-04-05  Raja R Harinath  <rharinath@novell.com>
8976
8977         Fix #74041.
8978         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
8979         not 'unreachable_seen'.
8980
8981 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
8982
8983         * attribute.cs (Attribute.GetValue): Removed unused.
8984         
8985         * codegen.cs (CodeGen.TrimExt): Removed unused.
8986         
8987         * cs-parser.jay (output): Removed unused.
8988         
8989         * cs-tokenizer.cs (hex_digits): Removed unused.
8990         
8991         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
8992         
8993         * expression.cs (Indirection.LoadExprValue): Removed unused.
8994         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
8995         
8996         * iterators.cs (Iterator.param_types): Removed unused.
8997         
8998         * statement.cs (Goto.block): Removed unused.
8999         (ToplevelBlock.did): Removed unused.
9000         (Switch.ResolveConstantSwitch): Removed unused.
9001
9002 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
9003
9004         * rootcontext.cs: Allow mcs to bootstrap with the compilation
9005         resetting thingy.
9006
9007 2005-04-01  Raja R Harinath  <rharinath@novell.com>
9008
9009         Fix #74232 and cs0208-3.cs.
9010         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
9011         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
9012         unmanaged type.  Don't use FieldBuilders when 't' is a
9013         TypeBuilder.  Use ModFlags and MemberType fields.
9014         * class.cs (MemberBase.member_type): Rename from MemberType.
9015         (MemberBase.MemberType): New property.  Determines member_type on
9016         demand.
9017         (MemberBase.DoDefine): Don't initialize MemberType here.
9018         (FieldMember.Define): Likewise.
9019
9020 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
9021
9022         Fix #74241
9023         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
9024         Attributes are emitted there.
9025         
9026 2005-04-01  Raja R Harinath  <rharinath@novell.com>
9027
9028         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
9029         keyword in 'partial enum' too.
9030         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
9031         is not allowed).
9032         Report from Kamil Skalski <nazgul@omega.pl>.
9033
9034         Fix #74309.
9035         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
9036         have partial containers too.
9037
9038         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
9039         in block' checks to Block.CheckInvariantMeaningInBlock.
9040         * statement.cs (Block.GetKnownVariableInfo): Make private.
9041         (Block.IsVariableUsedInChildBlock): Remove.
9042         (Block.IsVariableUsedInBlock): Likewise.
9043         (Block.CheckInvariantMeaningInBlock): New.  Show location of
9044         conflicting declaration.
9045         (Block.AddVariable): Make error messages less long-winded and more
9046         specific.  Show location of conflicting declaration.
9047         * parameter.cs (Parameters.Location): New readonly property.
9048
9049 2005-03-31  Raja R Harinath  <rharinath@novell.com>
9050
9051         Clean up semantics of invoking ResolveMemberAccess.
9052         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
9053         can have an instance, ensure that we pass in a non-TypeExpression
9054         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
9055         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
9056         argument.  Update to changes and simplify.
9057         (FieldExpr.Emitinstance): Remove CS0120 check.
9058         (PropertyExpr.EmitInstance): Likewise.
9059         * expression.cs (Argument.Resolve): Likewise.
9060         (Invocation.DoResolve): Update to changes in semantics of
9061         InstanceExpression.
9062
9063 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
9064
9065         Fix #74241
9066         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
9067         customization.
9068         
9069         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
9070
9071 2005-03-31  Raja R Harinath  <rharinath@novell.com>
9072
9073         Fix difference in behaviour with commandline invocation.
9074         * driver.cs (Driver.Reset): New.
9075         (CompilerCallableEntryPoint): Call it.
9076
9077         * statement.cs (If.Resolve): Avoid spurious "uninitialized
9078         variable" warnings if the boolean expression failed to resolve.
9079
9080 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
9081
9082         * attribute.cs: Fix the union of several permissions when some of them
9083         are unrestricted (so the result isn't an unrestricted permission set).
9084         Fix #74036.
9085
9086 2005-03-30  Raja R Harinath  <rharinath@novell.com>
9087
9088         * ecore.cs (MemberExpr): New class.  Convert from interface
9089         IMemberExpr.
9090         (MemberExpr.ResolveMemberAccess): Refactor and move here from
9091         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
9092         error checks.
9093         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
9094         (MethodGroupExpr.IsExplicitImpl): Remove.
9095         (Expression.GetFieldFromEvent): Remove.
9096         (SimpleName.MemberStaticCheck): Remove.
9097         (SimpleName.DoSimpleNameResolve): Update to changes.
9098         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
9099         (MemberAccess.IdenticalNameAndTypeName): Remove.
9100         (MemberAccess.error176): Move to MemberExpr.
9101         (MemberAccess.DoResolve): Update to changes.
9102         (BaseAccess.DoResolve): Likewise.
9103
9104 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
9105
9106         C# 2.0 Conditional attribute class implementation
9107         
9108         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
9109         Analyzes class whether it has attribute which has ConditionalAttribute
9110         and its condition is not defined.
9111         
9112         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
9113         (Class.IsExcluded): New method. Search for at least one defined
9114         condition in ConditionalAttribute of attribute class.
9115
9116 2005-03-30  Raja R Harinath  <rharinath@novell.com>
9117
9118         * ecore.cs (PropertyExpr): Derive from Expression, not
9119         ExpressionStatement.
9120         (PropertyExpr.EmitStatement): Remove.
9121
9122 2005-03-29  Raja R Harinath  <rharinath@novell.com>
9123
9124         Fix #74060.
9125         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
9126         internal field "value__" of an enum be private.  The examples for
9127         "value__" that I found on MSDN all used FieldAttributes.Private.
9128
9129         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
9130         Don't mention IL method attribute names.
9131
9132         Fix #47991.  Remove a TODO.
9133         * statement.cs (Block.Toplevel): Make into a field.
9134         (Block.Parameters): Move into ToplevelBlock.
9135         (Block.known_variables): Rename from child_variable_names.
9136         (Block.Block): Remove variants that take Parameters.  Initialize
9137         'Toplevel' with the immediately surrounding toplevel block.
9138         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
9139         LocalInfo parameter.
9140         (Block.GetKnownVariableInfo): New.
9141         (Block.IsVariableNameUsedInChildBlock): Update.
9142         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
9143         the block, even though it may not be in scope.
9144         (Block.AddVariable): Remove Parameters parameter.  Use
9145         Toplevel.Parameters instead.
9146         (Block.AddConstant): Remove Parameters parameter.
9147         (Block.GetParameterReference): Update to use Toplevel.Parameters.
9148         (Block.IsParamaterReference): Likewise.
9149         (Block.IsLocalParameter): Likewise.  Simplify a lot.
9150         (ToplevelBlock.Parameters): New.  Moved from Block.
9151         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
9152         initialize Parameters to a non-null value.
9153         * cs-parser.jay: Update to changes.
9154         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
9155         simple names that mean different things in the same block.  Use
9156         Block.IsVariableNameUsedInBlock.
9157
9158 2005-03-28  Raja R Harinath  <rharinath@novell.com>
9159
9160         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
9161         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
9162         GetTypeHandle.  It is possible for a reflected type to derive from
9163         a TypeBuilder (e.g., int[] derives from the TypeBuilder
9164         System.Array during mscorlib compilation).
9165         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
9166         contain a method_hash, don't create one either.  Don't create a
9167         deep copy of the base cache's method_hash.
9168         (MemberCache.SetupCache): Rename back from DeepCopy.
9169         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
9170         already initialized.  If we see an override function, add its
9171         underlying base virtual function to the member_hash too.
9172
9173         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
9174
9175 2005-03-26  Raja R Harinath  <harinath@acm.org>
9176
9177         Fix #73038.
9178         * assign.cs (Assign.DoResolve): When the RHS of an assignment
9179         fails to resolve, ensure that the LHS is still resolved as an
9180         lvalue.
9181
9182 2005-03-25  Raja R Harinath  <harinath@acm.org>
9183
9184         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
9185         ec.ContainerType.
9186         (Enum.current_ec): Remove.
9187         (Enum.LookupEnumValue): Remove EmitContext argument.
9188         Just uses the one created during DefineType.
9189         (Enum.FindMembers): Update.
9190         * expression.cs (MemberAccess.DoResolve): Update.
9191
9192 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
9193
9194         * assign.cs (Assign.DoResolve): Check for CS1717 when
9195         source and target are same (uses Equals).
9196
9197         * expression.cs (LocalVariableReference, ParameterReference,
9198         This): Implemented Equals, GetHashCode.
9199
9200         * statement.cs (Block.GetParameterReference): Removed useless
9201         local variable.
9202
9203 2005-03-22  Raja R Harinath  <rharinath@novell.com>
9204
9205         Fix cs0128.cs
9206         * statement.cs (Block.AddVariable): Ensure that we skip implicit
9207         blocks before deciding whether the error is cs0136 or cs0128.
9208
9209         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
9210         (using_alias_directive, using_namespace_directive): Pass
9211         MemberName, not an expression to Namespace.UsingAlias and
9212         Namespace.Using.
9213         (MakeName): Use the MemberName of the namespace.
9214         * namespace.cs (Namespace.MemberName): New.
9215         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
9216         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
9217         Likewise.
9218         * decl.cs (MemberName.Name): Make readonly.
9219         (MemberName.FromDotted): New "constructor".
9220         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
9221         (MemberCore.Name): Compute from MemberName on demand.
9222         (MemberCore.SetMemberName): Provide a way to change the
9223         MemberName.
9224         (MemberCore.AddToContainer): Don't take a fullname parameter.
9225         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
9226         fully qualified name of the container to the member name.
9227         (TypeContainer.AddToTypeContainer): Use a fully qualified name
9228         only if the type is a member of the root container.
9229         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
9230         MemberName.Left rather than searching for an embedded ".".
9231         (PartialContainer.CreatePart): Update to changes in RootContext.
9232         (MemberBase.ShortName): Turn into a property.  Use
9233         MemberCore.SetMemberName.
9234         (MemberBase.ExplicitInterfaceName): Remove.
9235         (MemberBase.UpdateMemberName): Remove.
9236         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
9237         (PropertyBase.SetMemberName): New override.
9238         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
9239         (Tree.GetDecl): New.
9240         (Tree.AllDecls): Rename from Decls.
9241         * attribute.cs, enum.cs, report.cs: Update to changes.
9242         * driver.cs (MainDriver): Use MemberName.FromDotted on
9243         RootContext.MainClass.
9244
9245 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
9246
9247         * class.cs (FixedField.Define): Check for CS1664 and more sanity
9248         checks.
9249
9250         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
9251
9252 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
9253
9254         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
9255         property accessor modifiers.
9256
9257         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
9258         fixed buffer attribute (CS1716).
9259         (PropertyMethod.HasCustomAccessModifier): When property accessor
9260         has custom modifier.
9261
9262         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
9263         modifiers.
9264         (PropertyExpr.DoResolveLValue): Add CS0272.
9265
9266 2005-03-17  Miguel de Icaza  <miguel@novell.com>
9267
9268         * convert.cs: When converting to a pointer, use the proper Conv.U
9269         or Conv.I depending on the source data type.
9270
9271         * cs-tokenizer.cs: Make the size for large decimal constants,
9272         fixes #72957.
9273
9274 2005-03-17  Martin Baulig  <martin@ximian.com>
9275
9276         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
9277         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
9278
9279 2005-03-17  Martin Baulig  <martin@ximian.com>
9280
9281         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
9282         to bool so we can return an error condition.
9283         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
9284         returned an error.
9285
9286 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
9287
9288         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
9289         attributes.
9290
9291 2005-03-16  Raja R Harinath  <rharinath@novell.com>
9292
9293         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
9294         Refactor to avoid traversing the list of assemblies, and to avoid
9295         string concatenation.
9296         * typemanager.cs (guid_attr_type): Remove.
9297         (negative_hits, pointers, references): Remove hashes.
9298         (type_hash): New.
9299         (GetConstructedType): New.  Uses type_hash to handle constructed
9300         types (arrays, references, pointers).
9301         (GetReferenceType, GetPointerType): Use it.
9302         (GetNestedType): New.  Uses type_hash to handle nested types of
9303         reflected types.
9304         (LookupType, LookupTypeDirect): Remove.
9305         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
9306         'types' hash and LookupTypeReflection directly.
9307         (params_string, params_object): Use GetConstructedType.
9308         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
9309         top-level types.
9310         (Namespace.Lookup): Use cached_types.
9311         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
9312         provided by old TypeManager.LookupType.
9313         * rootcontext.cs (MakeFQN): Remove.
9314         * decl.cs (DeclSpace.MakeFQN): Likewise.
9315         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
9316         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
9317         TypeManager.GetConstructedType.
9318         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
9319
9320 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
9321
9322         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
9323         indexers.
9324
9325         * cs-parser.jay: Reports CS1527 for any namespace element.
9326
9327         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
9328         Added CS0407.
9329
9330         * expression.cs (ParameterReference.IsAssigned): Changed error to
9331         CS0269.
9332         (Error_WrongNumArguments): Moved CS0245 detection here.
9333
9334         * statement.cs (Return.Resolve): Add CS1622 report.
9335
9336 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
9337
9338         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
9339
9340 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
9341
9342         * attribute.cs expression.cs: Get rid of some allocations.
9343
9344 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
9345
9346         * doc.cs : just eliminate the latest change.
9347
9348 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9349
9350         * doc.cs : commented out the latest change. It breaks xml-030.cs
9351
9352 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9353
9354         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
9355           fail. So invoke CreateType() in FindDocumentedType().
9356
9357 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
9358
9359         * cs-tokenizer.cs : added IsKeyword().
9360         * doc.cs : Detect keyword incorrectly used as identifier.
9361           Allow identifiers prefixed by @.
9362
9363 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
9364
9365         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
9366         It caused exception in namespace resolving (again!).
9367         
9368         * class.cs (Class.ctor): Removed exit.
9369         (PropertyMethod.ctor): ditto.
9370         
9371         * codegen.cs (Codegen.Reset): Reset static data.
9372         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
9373         
9374         * cs-tokenizer.cs (Cleanup): Removed.
9375         
9376         * driver.cs (GetSystemDir): Rewrote to one line command.
9377         It caused problem with unloaded dynamic modules.
9378         (UnixParseOption): Removed Exit.
9379         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
9380         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
9381         Now can be mcs used as library.
9382         
9383         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
9384         empty location.
9385         
9386         * location.cs (Reset): Reset static data.
9387         
9388         * namespace.cs (Reset): Reset static data.
9389         
9390         * report.cs (Report.Reset): Reset static data.
9391         
9392         * rootcontext.cs (RootContext.Reset): Reset static data.
9393         
9394         * tree.cs (RootTypes.ctor): Use Location.Null
9395         
9396         * typemanager.cs (TypeManager.Reset): Reset static data.
9397         (CoreLookupType): Removed Exit.
9398         (TypeHandle.Reset): Reset static data.
9399         
9400 2005-03-10  Raja R Harinath  <rharinath@novell.com>
9401
9402         Fix #73516.
9403         * typemanager.cs (ComputeNamespaces): Import namespaces from
9404         referenced modules too.
9405
9406 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9407
9408         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
9409         than '.'.
9410
9411 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9412
9413         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
9414         enclosing DeclSpace.  This ensures that a name-lookup populates
9415         more caches and there are fewer 'TypeExpression's.  Carve out
9416         nested type lookup into ...
9417         (LookupNestedTypeInHierarchy): ... this.
9418
9419 2005-03-09  Raja R Harinath  <rharinath@novell.com>
9420
9421         Clean up a few partial-class semantics.  
9422         Fixes test-357.cs and cs1618-2.cs.
9423         * cs-parser.jay (struct_declaration): Use 'current_class' as
9424         parent of newly-created struct.  Remove call to Register ().
9425         Use 'pop_current_class' to complete handing the current struct.
9426         (interface_declaration): Likewise.
9427         (class_declaration): Likewise.
9428         (enum_declaration): Use 'current_class' as parent of newly created
9429         enum.
9430         (delegate_declaration): Likewise.
9431         (pop_current_class): New function.  This is used to handle closing
9432         up the 'current_class' and 'current_container', and pointing them
9433         to the enclosing class/container.
9434         (CSharpParser): Initialize 'current_class' too.
9435         * decl.cs (MemberCore): Add check for invariant: a partial
9436         container is not a parsed entity, and thus does not enclose any
9437         parsed members.
9438         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
9439         (DeclSpace.BaseTypeExpr): Use it.
9440         (DeclSpace.LookupType): Add check for invariant.
9441         * class.cs (TypeContainer): Add check for invariant: a nested
9442         class should have the same NamespaceEntry as its enclosing class.
9443         (TypeContainer.EmitFieldInitializers): Make virtual.
9444         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
9445         MemberCore.
9446         (TypeContainer.Register): Remove.
9447         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
9448         null.  Use TypeResolveEmitContext for resolving base types and
9449         interfaces.  Move initialization of Parts.TypeBuilder here from
9450         ...
9451         (TypeContainer.DefineNestedTypes): ... here.
9452         (PartialContainer): Take a Namespace not a NamespaceEntry.
9453         (PartialContainer.Create): Don't use Register.  Call the
9454         appropriate Add... function directly.
9455         (ClassPart): Take both the PartialContainer and the enclosing
9456         class as constructor arguments.
9457         (ClassPart.EmitFieldInitializers): Override.
9458         (ClassPart.PartFindNestedTypes): Remove.
9459         (FieldBase.GetInitializerExpression): Resolve the initializer
9460         expression in the emit context of the enclosing class.
9461         * tree.cs (RootTypes): Remove Register ().
9462         
9463 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
9464
9465         * cs-parser.jay: Removed CS0134.
9466         
9467         * driver.cs: Removed CS1901.
9468         
9469         * expression.cs (SizeOf.DoResolve): Don't report CS0233
9470         for predefined types.
9471
9472 2005-03-07  Duncan Mak  <duncan@novell.com>
9473
9474         * codegen.cs (Save):  Catch UnauthorizedAccessException as
9475         well. Fixes bug #73454.
9476
9477 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
9478
9479         * cs-tokenizer.cs (xtoken): Add CS1035.
9480         
9481         * class.cs (MethodData.Define): Add CS0683.
9482         (FieldMember.ctor): Add CS0681.
9483
9484 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9485
9486         * ecore.cs (SimpleName.DoResolve): Rename from
9487         SimpleName.DoResolveAllowStatic.
9488         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
9489         Pass 'intermediate' flag to MemberStaticCheck.
9490         (SimpleName.MemberStaticCheck): Skip "static check" only in case
9491         of "intermediate" lookups via MemberAccess.
9492         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
9493         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
9494
9495 2005-03-07  Raja R Harinath  <rharinath@novell.com>
9496
9497         Fix #73394.
9498         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
9499         slipped in because of variable names that are identical to a
9500         builtin type's BCL equivalent ('string String;', 'int Int32;').
9501         (PropertyExpr.EmitInstance): Likewise.
9502
9503 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
9504
9505         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
9506         
9507         * report.cs (warning_ignore_table): Made public.
9508
9509 2005-03-04  Raja R Harinath  <rharinath@novell.com>
9510
9511         Fix #73282.
9512         * class.cs (MethodData.Emit): Pass 'container' to
9513         container.GetObsoleteAttribute instead of 'container.Parent'.
9514
9515 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
9516
9517         * cs-parser.jay: Add 1534 error test.
9518
9519         * iterators.cs (Yield.CheckContext): Add error 1629.
9520         (Iterator.ctor): Save unsafe modifier.
9521         (MoveNextMethod.DoEmit): Restore unsafe context.
9522
9523         * namespace.cs (UsingAlias): Better error message.
9524
9525 2005-03-03  Dan Winship  <danw@novell.com>
9526
9527         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
9528         the warning message [#73219]
9529
9530 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9531
9532         Fix compile with MCS 1.0.0.0.
9533         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
9534         w_restore to not depend on string constant folding.
9535
9536 2005-03-03  Raja R Harinath  <rharinath@novell.com>
9537
9538         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
9539         CS0246 check to users who passed 'silent = false'.
9540         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
9541         check.
9542         (SimpleName.SimpleNameResolve): Update.
9543         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
9544         (MemberAccess.IdenticalNameAndTypeName): Update.
9545         * doc.cs (FindDocumentedTypeNonArray): Update.
9546
9547 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
9548
9549         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
9550         * parameters.cs (ComputeAndDefineParameters): Remove.
9551         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
9552         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
9553         Use GetParameterInfo.
9554
9555 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
9556
9557         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
9558
9559 2005-03-02  Raja R Harinath  <rharinath@novell.com>
9560
9561         Unify DeclSpace.LookupType and DeclSpace.FindType.
9562         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
9563         is in charge of defining nested types on demand.
9564         (DeclSpace.LookupType): Use it when the current_type is a
9565         TypeBuilder.  Use LookupTypeDirect for reflected types.
9566         (DeclSpace.FindType): Remove.
9567         (DeclSpace.LookupInterfaceOrClass): Likewise.
9568         (DeclSpace.DefineTypeAndParents): Likewise.
9569         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
9570         DeclSpace.LookupType.
9571         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
9572         * typemanager.cs (LookupType): Simplify.
9573         (AddUserType): Remove type from negative_hits.
9574         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
9575         * class.cs (TypeContainer.FindMembers): Move handling of nested
9576         types ...
9577         (TypeContainer.FindMembers_NestedTypes): ... here.
9578         (TypeContainer.FindNestedType): Implement override.
9579         (ClassPart.FindNestedType): Delegate to PartialContainer.
9580         (ClassPart.PartFindNestedType): Looks up the nested types of the
9581         part alone.
9582
9583 2005-03-02  Martin Baulig  <martin@ximian.com>
9584
9585         * class.cs (TypeContainer.DoDefineMembers): We also need a default
9586         static constructor in static classes.
9587
9588 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
9589
9590         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9591         sizeParamIndex is not specified.
9592
9593 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
9594
9595         Fix #73117
9596         * report.cs (WarningMessage.IsEnabled): Missing null check.
9597
9598 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9599
9600         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
9601         in the fields and not in the properties.
9602
9603 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
9604
9605         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
9606         fields as well.
9607
9608 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9609
9610         * attribute.cs: Small refactoring (improved robustness).
9611         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
9612         (ValidateGuid): Removed.
9613         (Resolve): Removed referenced to above mentioned.
9614         (GetAttributeUsage): Made private and changed to work without
9615         class assistance.
9616         (GetIndexerAttributeValue): Don't crash.
9617         (GetConditionalAttributeValue): Ditto.
9618         (GetClsCompliantAttributeValue): Ditto.
9619         (ExtractSecurityPermissionSet): All attributes exceptions are
9620         error 648.
9621         (GetPropertyValue): New helper.
9622         (GetMethodImplOptions): New method.
9623         (DefinePInvokeMethod): Reuse common code. Implemented handling of
9624         some missing properties.
9625         
9626         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
9627         (Method.ApplyAttributeBuilder): Updated.
9628         
9629         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
9630         exception.
9631
9632 2005-02-28  Raja R Harinath  <rharinath@novell.com>
9633
9634         Fix #73052.
9635         * report.cs (Report.SymbolRelatedToPreviousError): Handle
9636         non-simple types (array, pointer, reference).
9637
9638 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
9639
9640         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
9641
9642         * class.cs (MethodCore.IsDuplicateImplementation): Special error
9643         for operators.
9644         (Method.CheckBase): Catch wrong destructor here.
9645         (MethodData.Define): Add errors 550, 668.
9646
9647         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
9648
9649         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
9650
9651         * pending.cs (VerifyPendingMethods): Add error 551.
9652
9653         * typemanager.cs (CSharpName): Next error report helper.
9654
9655 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
9656
9657         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
9658         attributes. Removed useless attribute double check.
9659         It saves almost 2MBs for corlib.
9660
9661 2005-02-25  Raja R Harinath  <rharinath@novell.com>
9662
9663         Fix #72924.
9664         * statement.cs (ExpressionStatement.Resolve): Make robust to being
9665         called twice in case of error.
9666
9667 2005-02-23  Chris Toshok  <toshok@ximian.com>
9668
9669         Fix compiler portions of #72827.
9670         * statement.cs (Block.Emit): call Begin/EndScope on the
9671         EmitContext instead of the ILGenerator.
9672
9673         * codegen.cs (EmitContext.BeginScope): new method, call
9674         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
9675         we have one.)
9676         (EmitContext.BeginScope): same, but EndScope and CloseScope
9677
9678         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
9679         offset and call the superclass's OpenScope(int) with it.
9680         (SymbolWriter.CloseScope): get the current il
9681         offset and call superclass's CloseScope(int) with it.
9682
9683 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
9684
9685         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
9686         CS1677 for out and ref as well.
9687
9688         * class.cs (Method.Define): Add error CS1599 detection.
9689         
9690         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
9691         
9692         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
9693         
9694         * delegate.cs (Delegate.Define): Add error CS1599 detection.
9695         
9696         * support.cs.cs (ModifierDesc): New helper method.
9697
9698 2005-02-23  Raja R Harinath  <rharinath@novell.com>
9699             Abin Thomas  <projectmonokochi@rediffmail.com>
9700             Anoob V E  <projectmonokochi@rediffmail.com>
9701             Harilal P R  <projectmonokochi@rediffmail.com>
9702
9703         Fix #57851, #72718.
9704         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
9705         MemberLookup (used for error reporting) actually returns a result.
9706         Fix error report number (122, not 112).
9707
9708 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
9709             Anoob V E  <projectmonokochi@rediffmail.com>
9710             Harilal P R  <projectmonokochi@rediffmail.com>
9711
9712         Fix #71134.
9713         * pending.cs (PendingImplementation.GetAbstractMethods):
9714         Find NonPublic members too.
9715
9716 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
9717
9718         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
9719         Fixed error 217.
9720         
9721         * class.cs (MethodCore.CheckMethodAgainstBase):
9722         Add error 239 report.
9723
9724 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9725
9726         Fix #68955.
9727         * expression.cs (Invocation.IsApplicable): Make public.
9728         (Invocation.IsParamsMethodApplicable): Likewise.
9729         * delegate.cs (Delegate.VerifyApplicability): Don't use
9730         Invocation.VerifyArgumentCompat for parameter applicability
9731         testing.  Use Invocation.IsApplicable and
9732         Invocation.IsParamsMethodApplicable.
9733
9734 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9735
9736         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
9737         
9738         * class.cs (Operator.Define): Add error 217 report.
9739         
9740 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9741
9742         * namespace.cs (UsingEntry.Resolve): Undo change below.
9743
9744 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9745
9746         Fix #72756.
9747         * ecore.cs (Expression.MemberLookupFailed): Add argument to
9748         disable the error message when the extended MemberLookup also
9749         fails.
9750         (Expression.MemberLookupFinal): Update.
9751         (SimpleName.DoSimpleNameResolve): Update.
9752         * expression.cs (MemberAccess.ResolveNamespaceOrType):
9753         Don't use MemberLookupFinal.
9754         (New.DoResolve): Update.
9755         (BaseAccess.CommonResolve): Update.
9756
9757 2005-02-21  Raja R Harinath  <rharinath@novell.com>
9758
9759         Fix #72732.
9760         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
9761         occured previously, don't resolve again.
9762
9763 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
9764
9765         Fix #69949
9766         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
9767         argument. Call ResolveAttributeUsage for unresolved.
9768         when types doesn't match ctor arguments.
9769         
9770         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
9771         for nested attribute classes.
9772         (Class.attribute_usage): Removed.
9773         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
9774         for attribute class.
9775         
9776         * ecore.cs (IsAttribute): Removed.
9777         
9778         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
9779         
9780         * rootcontext.cs (RegisterAttribute): Removed, attributes are
9781         now normal types.
9782         (attribute_types): Removed.
9783         (EmitCode): Global attributes are emited as the latest.
9784
9785 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
9786
9787         * class.cs (EmitFieldInitializers): Don't emit field initializer
9788         for default values when optimilization is on.
9789         
9790         * constant.cs (Constant.IsDefaultValue): New property.
9791         
9792         * driver.cs: Add /optimize handling.
9793         
9794         * constant.cs,
9795         * ecore.cs,
9796         * literal.cs: Implement new IsDefaultValue property.
9797         
9798         * rootcontext.cs (Optimize): New field, holds /optimize option.
9799
9800 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9801
9802         Fix crasher in re-opened #72347.
9803         * namespace.cs (Namespace.Lookup): Return null if
9804         DeclSpace.DefineType returns null.
9805
9806         Fix #72678.
9807         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
9808
9809 2005-02-18  Raja R Harinath  <rharinath@novell.com>
9810
9811         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
9812         now returns null if it cannot resolve to an lvalue.
9813         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
9814         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
9815         returned null.  Remove check for SimpleName.
9816         (EventExpr.DoResolveLValue): New.
9817         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
9818         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
9819         error from ...
9820         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
9821         avoid CS0131 error.
9822         (Unary.ResolveOperator): Move CS0211 check ...
9823         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
9824         CS0131 error.
9825         (Unary.DoResolveLValue): Simplify.
9826         (AddressOf.DoResolveLValue): New.
9827         (ArrayAccess.DoResolveLValue): New.
9828
9829 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
9830
9831         * attribute.cs (Attribute.Resolve): Add arguments casting for
9832         when types doesn't match ctor arguments.
9833
9834 2005-02-16  Raja R Harinath  <rharinath@novell.com>
9835
9836         Fix parts of #63202.
9837         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
9838         lookup of operator in base type.  Ensure that all checks happen
9839         when the operator resolves to an "op_..." method.
9840
9841 2005-02-15  Raja R Harinath  <rharinath@novell.com>
9842
9843         Fix #71992.
9844         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
9845         'ignore_cs0104' parameter.  Pass it to ...
9846         (NamespaceEntry.Lookup): ... this.
9847         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
9848         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9849         (TypeLookupExpression.DoResolveAsTypeStep): Update.
9850         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
9851         Update.  Request that cs0104 errors be ignored.
9852         (ComposedCast.ResolveAsTypeStep): Update.
9853
9854 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9855
9856         Fix #59209.
9857         * expression.cs (Invocation.BetterFunction): Remove support for
9858         comparing virtual functions and their overrides.
9859         (Invocation.IsOverride): New.
9860         (Invocation.OverloadResolve): Don't consider 'override' functions
9861         during candidate selection.  Store them in a lookaside list.
9862         If the selected method is a 'virtual' function, use the list to
9863         find any overrides that are closer to the LHS type.
9864
9865 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
9866
9867         * expression.cs (New.DoResolve): Add complex core type reduction.
9868         (New.Constantify): Converts complex core type syntax like 'new int ()'
9869         to simple constant.
9870         
9871 2005-02-14  Raja R Harinath  <rharinath@novell.com>
9872
9873         * decl.cs (EntryType.EntryType): New constructor to create an
9874         updated copy of a cache entry.
9875         (MemberCache.AddMethods): Use it.
9876         (MemberCache.ClearDeclaredOnly): Remove.
9877         (MemberCache.MemberCache): Update.
9878
9879 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9880
9881         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
9882         variable.  This one is represents the actual low-level declaration
9883         of the method, as opposed to the semantic level `IsStatic'.   
9884
9885         An anonymous method which is hosted into a static method might be
9886         actually an instance method.  IsStatic would reflect the
9887         container, while MethodIsStatic represents the actual code
9888         generated.
9889
9890         * expression.cs (ParameterReference): Use the new MethodIsStatic
9891         instead of IsStatic.
9892
9893         * anonymous.cs (AnonymousMethod.Compatible): Pass the
9894         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
9895         set on the current EmitContext. 
9896
9897         * expression.cs (Cast): Overload DoResolveLValue so we can pass
9898         resolve our casted expression as an LValue.  This triggers the
9899         proper LValue processing that is later required by Assign.
9900
9901         This fixes 72347.
9902
9903         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
9904
9905 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
9906
9907         C# 2.0 Fixed buffer implementation
9908
9909         * anonymous.cs: Update after RegisterHelperClass renaming.
9910
9911         * attribute.cs (AttributeTester.fixed_buffer_cache):
9912         Cache of external fixed buffers.
9913         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
9914         implementation if field is fixed buffer else null.
9915
9916         * class.cs
9917         (TypeContainer.AddField): Accept FieldMember instead of Field.
9918         (FieldBase.IsFieldClsCompliant): Extracted code from
9919         VerifyClsCompliance descendant customization.
9920         (FixedField): New class handles fixed buffer fields.
9921         (FixedFieldExternal): Keeps information about imported fixed
9922         buffer.
9923         (IFixedField): Make access to internal or external fixed buffer
9924         same.
9925
9926         * cs-parser.jay: Add fixed buffer parsing.
9927
9928         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
9929         buffer.
9930
9931         * expression.cs (Indirection): Extended implementation to accept
9932         fixed buffer field.
9933         (PointerArithmetic.Emit): Get element from fixed buffer as well.
9934         (ElementAccess.MakePointerAccess): Get type as parameter.
9935         (DoResolve): Add fixed buffer field expression conversion.
9936         (DoResolveLValue): Ditto.
9937         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
9938         (ArrayPtr): Derives from FixedBufferPtr.
9939         (ArrayPtr.Emit): Add extra emit for array elements.
9940
9941         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
9942
9943         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
9944         for compiler generated types.
9945         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
9946
9947         * statement.cs (Fixed): Refactored to be easier add fixed buffer
9948         and consume less memory.
9949         (Fixed.Resolve): Add fixed buffer case.
9950
9951         * typemanager.cs (compiler_generated_attr_ctor,
9952         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
9953         (HasElementType): Add our own implementation to work on every
9954         runtime.
9955
9956 2005-02-11  Miguel de Icaza  <miguel@novell.com>
9957
9958         * anonymous.cs (CaptureContext): Track whether `this' has been
9959         referenced.   
9960
9961         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
9962         only captured `this' if it was implicitly done (instance
9963         methods/variables were used). 
9964
9965         * codegen.cs (EmitContext.CaptureThis): New method to flag that
9966         `this' must be captured.
9967
9968 2005-01-30  Miguel de Icaza  <miguel@novell.com>
9969  
9970         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
9971         is null it means that there has been no need to capture anything,
9972         so we just create a sibling.
9973
9974         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
9975
9976         Just a partial fix.  The other half is fairly elusive.
9977         
9978 2005-02-10  Raja R Harinath  <rharinath@novell.com>
9979
9980         Fix #52586, cs0121-4.cs.
9981         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
9982         and return a hashtable.
9983         (MemberCache.ClearDeclaredOnly): New.
9984         (MemberCache.MemberCache): Update to change.  Make a deep copy of
9985         the method_hash of a base type too.
9986         (MemberCache.AddMethods): Adapt to having a deep copy of the base
9987         type methods.  Overwrite entries with the same MethodHandle so
9988         that the ReflectedType is correct.  The process leaves in base
9989         virtual functions and their overrides as distinct entries.
9990         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
9991         matters since it was boxed in a ArrayList before.
9992         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
9993         modifier.
9994         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
9995         case of a virtual function and its override (choose the overload
9996         as better).
9997         (Invocation.OverloadResolve): Avoid 'override' members during
9998         'applicable_type' calculation.
9999
10000 2005-02-09  Raja R Harinath  <rharinath@novell.com>
10001
10002         Combine two near-redundant caches.
10003         * typemanager.cs (method_params): Rename from method_internal_params.
10004         (TypeManager.GetParameterData): New.  Replace
10005         Invocation.GetParameterData.
10006         (TypeManager.LookupParametersByBuilder): Remove.
10007         * expression.cs (Invocation.method_parameter_cache): Remove.
10008         (Invocation.GetParameterData): Remove.
10009         Update to changes.
10010         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
10011         Update to changes.
10012
10013 2005-02-08  Raja R Harinath  <rharinath@novell.com>
10014
10015         Fix #72015.
10016         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
10017         TypeManager.multicast_delegate_type is null, resolve it by looking
10018         up "System.MulticastDelegate".
10019         * rootcontext.cs (RootContext.ResolveCore): Simplify.
10020
10021 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
10022             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
10023             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
10024
10025         Fix cs0164.cs.
10026         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
10027         (LabeledStatement.AddReference): New.  Set 'referenced'.
10028         (Goto.Resolve): Use it.
10029
10030 2005-02-05  John Luke  <john.luke@gmail.com>
10031
10032         * driver.cs: remove duplicate -doc line in Usage ()
10033
10034 2005-02-04  Raja R Harinath  <rharinath@novell.com>
10035
10036         * location.cs (Location.AddFile): Fix CS2002 error report.
10037
10038 2005-02-02  Martin Baulig  <martin@ximian.com>
10039
10040         * delegate.cs (Delegate.DefineType): Report an internal error if
10041         TypeManager.multicast_delegate_type is null.  See bug #72015 for
10042         details.        
10043
10044 2005-02-02  Raja R Harinath  <rharinath@novell.com>
10045
10046         Fix a crasher in a variant of #31984.
10047         * const.cs (Constant.CheckBase): New override that defers the
10048         new-or-override check in case the base type hasn't been populated
10049         yet.
10050         (Constant.Define): Ensure the new-or-override check is performed.
10051
10052 2005-02-01  Duncan Mak  <duncan@ximian.com>
10053
10054         * const.cs (LookupConstantValue): Check that `ce' is not null
10055         before calling GetValue ().
10056
10057 2005-02-01  Raja R Harinath  <rharinath@novell.com>
10058
10059         Fix test-334.cs (#69519).
10060         * cs-parser.jay (using_alias_directive): Pass in an expression to
10061         NamespaceEntry.UsingAlias.
10062         (using_namespace_directive): Pass in an expression to
10063         NamespaceEntry.Using.
10064         (namespace_name): Don't flatten to a string.
10065         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
10066         (NamespaceEntry.AliasEntry.Resolve): Lookup using
10067         ResolveAsTypeStep.
10068         (NamespaceEntry.UsingEntry): Likewise.
10069         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
10070         changes.
10071         (NamespaceEntry.LookupForUsing): Remove.
10072         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
10073         names.
10074         (NamespaceEntry.Lookup): Remove support for dotted names.
10075
10076 2005-02-01  Raja R Harinath  <rharinath@novell.com>
10077
10078         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
10079         split into two.
10080         (NamespaceEntry.ImplicitParent): Compute on demand.
10081         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
10082         parallels the current.
10083         (NamespaceEntry.LookupForUsing): Use it.
10084         (NamespaceEntry.Lookup): If the current namespace-entry is
10085         implicit, don't search aliases and using tables.
10086
10087 2005-02-01  Raja R Harinath  <rharinath@novell.com>
10088
10089         Fix #31984.
10090         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
10091         BaseCache here.
10092         (TypeContainer.BaseCache): Compute on demand.
10093         (TypeContainer.FindMembers): Define constants and types if they're
10094         not already created.
10095         (FieldMember.Define): Move resetting of ec.InUnsafe before error
10096         check.
10097         * const.cs (Constant.Define): Make idempotent.
10098
10099 2005-01-29  Miguel de Icaza  <miguel@novell.com>
10100
10101         * pending.cs: Produce better code (no nops produced by using Ldarg
10102         + value).
10103         
10104         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
10105         i - 1' it should be arg + 1.
10106
10107         Fixes bug #71819.
10108
10109 2005-01-28  Raja R Harinath  <rharinath@novell.com>
10110
10111         * attribute.cs (Attribute.CheckAttributeType): Make private
10112         non-virtual.
10113         (Attribute.ResolveType): Make virtual.
10114         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
10115         handling of RootContext.Tree.Types.
10116
10117 2005-01-27  Raja R Harinath  <rharinath@novell.com>
10118
10119         Update attribute-handling to use the SimpleName/MemberAccess
10120         mechanisms.
10121         * cs-parser.jay (attribute): Pass in an expression to the
10122         constructors of Attribute and GlobalAttribute.
10123         * attribute.cs (Attribute): Take an expression for the name.
10124         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
10125         passed in attribute name expression.
10126         (Attribute.CheckAttributeType): Use it.
10127         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
10128         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
10129         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
10130         argument to prevent error messages if the lookup fails.
10131
10132 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
10133
10134         * expression.cs (Indirection): Implemented IVariable interface
10135         to support indirection in AddressOf operator.
10136         (PointerArithmetic.Emit): Add optimalization for case where
10137         result can be precomputed.
10138
10139 2005-01-26  Martin Baulig  <martin@ximian.com>
10140
10141         * class.cs (TypeContainer.AttributeTargets): Return the correct
10142         AttributeTargets depending on our `Kind' instead of throwing an
10143         exception; fixes #71632.
10144
10145 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
10146
10147         Fix #71257
10148         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
10149         constant members.
10150
10151 2005-01-25  Raja R Harinath  <rharinath@novell.com>
10152
10153         Fix #71602.
10154         * expression.cs (MemberAccess.DoResolve): Don't complain with
10155         cs0572 when the LHS of a member access has identical name and type
10156         name.
10157
10158 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
10159
10160         Fix #71651, #71675
10161         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
10162         CreatePermission.
10163         Create custom PermissionSet only for PermissionSetAttribute.
10164
10165 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
10166
10167         Fix #71649
10168         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
10169         delegates in static class.
10170
10171 2005-01-24  Martin Baulig  <martin@ximian.com>
10172
10173         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10174         merging an implicit block, just use its reachability.
10175
10176         * statement.cs (Block.Resolve): Make the unreachable code check
10177         work wrt. implicit blocks; see test-337 from #63842.
10178
10179 2005-01-21  Alp Toker  <alp@atoker.com>
10180  
10181         * cs-parser.jay: destructor_declaration's container is PartialContainer
10182         not Class when partial types are used, so use Kind prop instead of
10183         'is'.
10184         
10185 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
10186
10187         * cs-parser.jay: Improve error reporting when an interface
10188         declares new types.
10189
10190 2005-01-20  Dick Porter  <dick@ximian.com>
10191
10192         * support.cs: SeekableStreamReader fix from Sandor Dobos
10193         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
10194         chars are read.  Fixes bug 70369.
10195
10196 2005-01-20  Raja R Harinath  <rharinath@novell.com>
10197
10198         * cs-parser.jay (catch_clause): Simplify current_block handling
10199         somewhat.
10200
10201 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
10202
10203         * convert.cs (ImplicitStandardConversionExists): Synchronize the
10204         code with ImplicitStandardConversion to handle the implicit
10205         conversion of method groups into valid delegate invocations. 
10206
10207         The problem is that in parameter handling we were using this code
10208         path.  Fixes bug #64698
10209
10210 2005-01-19  Raja R Harinath  <rharinath@novell.com>
10211
10212         * cs-parser.jay: Fix several infelicities.
10213         - Avoid assigning to the parser value stack.  Code like 
10214           '$3 = null' is unclean.  Synthesize a value for the code block
10215           instead. 
10216         - Avoid using oob_stack for storing location information.  Use ...
10217         (_mark_): ... this.  New (empty) rule.  Saves the current location
10218         in $$.
10219         (foreach_statement): Avoid using oob_stack for current_block
10220         handling.  Use technique used in for_statement and
10221         using_statement.  Synthesize a value for the code block to store
10222         additional intermediate information.
10223
10224 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
10225
10226         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
10227         of a different type is only allowed to private fields of a
10228         containing type, not on fields of a base class.
10229
10230         See test-174.cs and error cs0122-9.cs
10231
10232 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10233
10234         Fix test-335.cs (bug #58126).
10235         * cs-parser.jay (argument): Split out non-expression parts of the
10236         rule into 'non_simple_argument'.
10237         (invocation_expression): Support parenthesized invocations with
10238         multiple arguments, and with single non-simple arguments.
10239
10240 2005-01-13  Raja R Harinath  <rharinath@novell.com>
10241
10242         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
10243         places.
10244
10245 2005-01-12  Raja R Harinath  <rharinath@novell.com>
10246
10247         Fix cs0038-1.cs, cs1640-6.cs.
10248         * ecore.cs (Expression.Resolve): Remove special-case for
10249         SimpleName in error-handling.
10250         (Expression.almostMatchedMembers): Relax access permission to
10251         protected.
10252         (Expression.MemberLookupFailed): Handle duplicates in
10253         almostMatchedMembers list.
10254         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
10255         * expression.cs (New.DoResolve): Report CS1540 for more cases.
10256         * typemanager.cs (GetFullNameSignature): Use the MethodBase
10257         overload if the passed in MemberInfo is a MethodBase.
10258
10259 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
10260
10261         Fix #70749
10262         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
10263         for non-CAS & merge permission sets properly.
10264
10265 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10266
10267         Improve standard-compliance of simple name and member access 
10268         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
10269         * ecore.cs (FullNamedExpression): New abstract base class 
10270         for Namespaces and TypeExpressions.
10271         (ResolveFlags.SimpleName): Remove.
10272         (SimpleName): Remove support for dotted names.
10273         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
10274         DeclSpace.FindType and DeclSpace.LookupType.
10275         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
10276         (Expression.ExprClassName): Make member function.
10277         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
10278         a namespace.  Remove creation of dotted "SimpleName"s.
10279         (MemberAccess.DoResolve): Likewise.
10280         * decl.cs (DeclSpace.Cache): Make private.
10281         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
10282         (DeclSpace.FindType): Update.
10283         (DeclSpace.LookupType): Move here from RootContext.  Return a 
10284         FullNamedExpression.
10285         * namespace.cs (Namespace): Derive from FullNamedExpression
10286         so that it can be part of expression resolution.
10287         (Namespace.Lookup): Return an FullNamedExpression.
10288         (NamespaceEntry.LookupAlias): Lookup aliases only in current
10289         namespace.
10290         * rootcontext.cs (NamespaceLookup): Remove.
10291         (LookupType): Move to DeclSpace.
10292         * attribute.cs (CheckAttributeType): Update.
10293         * doc.cs (FindDocumentedType): Remove allowAlias argument.
10294         (FindDocumentedTypeNonArray): Likewise.
10295
10296 2005-01-11  Raja R Harinath  <rharinath@novell.com>
10297
10298         Fix cs0509.cs, cs1632.cs.
10299         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
10300         is the same as IsInterface.
10301         (TypeContainer.GetClassBases): Likewise.
10302         * statement.cs (LabeledStatement.ig): New field.
10303         (LabeledStatement.LabelTarget): Save ILGenerator which created the
10304         label.
10305         (LabeledStatement.DoEmit): Check that the label was created with
10306         the same ILGenerator.
10307
10308 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10309
10310         Fix #71058
10311         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
10312         accessors to its properties.
10313
10314         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
10315         from accessors to property.
10316         
10317 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
10318
10319         Fix #70722
10320         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
10321         only for overrides.
10322         
10323 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
10324
10325         * attribute.cs: Check for null and empty strings.  
10326
10327         I have lost another battle to Paolo.
10328
10329 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
10330
10331         Fix #70942
10332         * class.cs (PropertyMethod): Set Parent field in ctors.
10333         (SetMethod.InternalParameters): Add unsafe switch hack.
10334         Override MarkForDuplicationCheck where it is appropriate.
10335
10336         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
10337         It says whether container allows members with the same name.
10338         Base default is no.
10339         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
10340         Removed is_method parameter.
10341
10342 2005-01-06  Duncan Mak  <duncan@ximian.com>
10343
10344         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
10345         because the previous change led to incorrect reporting of CS1032
10346         ("Cannot define/undefine preprocessor symbols after first token in
10347         file"). Instead of using `tokens_seen' as the only flag that
10348         triggers CS1040, introduce `comments_seen'. This new flag is used
10349         to signify having seen comments on the current line, so it is
10350         unset after a newline.
10351
10352 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10353
10354         * doc.cs : When searching for a type, find nested type too.
10355           This fixes bug #71040.
10356
10357 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
10358
10359         * doc.cs :
10360           - Warn missing member comment on those classes which also does not
10361             have doc comments. Fixed bug #71041.
10362           - Don't warn missing doc comment on default constructor.
10363             Fixed bug #71042.
10364
10365 2005-01-06  Duncan Mak  <duncan@ximian.com>
10366
10367         * cs-tokenizer.cs (xtoken): After handling traditional C-style
10368         comments, set `tokens_seen' to true. This allows us to detect
10369         misplaced preprocessor directives (i.e. not at the beginning of
10370         the a line, nor after whitespaces). In that case, report error
10371         CS1040. This fixes bug #56460.
10372
10373         * cs-parser.jay (interface_member_declaration): Add checks for
10374         IsExplicitImpl, and report CS0541 error if an interface member is
10375         defined as an explicit interface declaration.
10376
10377 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
10378
10379         Fix #70817
10380         * class.cs (PropertyMethod): Set Parent field in ctors.
10381         (SetMethod.InternalParameters): Add unsafe switch hack.
10382         
10383         * decl.cs (MemberCore.Parent): Cannot be readonly.
10384
10385 2005-01-06  Raja R Harinath  <rharinath@novell.com>
10386
10387         * decl.cs (DeclSpace.ResolveType): Remove.
10388         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
10389         Merge in code from ...
10390         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
10391         * class.cs, enum.cs: Update to changes.
10392
10393 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * anonymous.cs: Ensure that we init the scope of our parent if it
10396         has not been initialized yet.
10397
10398 2004-12-30  Duncan Mak  <duncan@ximian.com>
10399
10400         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
10401         if field.FieldBuilder is null. Fixes #70758.
10402
10403         * convert.cs: Fixed some typos and updated some of the comments.
10404         (ImplicitStandardConversionExists):
10405         (TryImplicitIntConversion): If `target_type' is an interface and
10406         the type of `ic' implements this interface, return true or a new
10407         BoxedCast instead of null. This fixes #70468.
10408
10409 2004-12-29  Duncan Mak  <duncan@ximian.com>
10410
10411         * expression.cs (Argument.Emit): Check that Expr is
10412         IMemoryLocation before casting to it, and report CS1510 otherwise.
10413
10414         This fixes #70402.
10415
10416 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
10417
10418         * statement.cs (Block.ThisVariable): remove the recursion here, to
10419         make the --profile more sane.
10420
10421 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
10422
10423         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
10424         assembly, by JB Evain.
10425
10426 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10427
10428         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
10429           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
10430         "parent" refers to enclosing type/class.  "base" refers to superclass.
10431
10432 2004-12-17  Raja R Harinath  <rharinath@novell.com>
10433
10434         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10435         Ensure that we only have GlobalAttributes.
10436         * attribute.cs (Attribute.Emit): Make non-virtual.
10437         (GlobalAttribute.Emit): Remove.
10438         (Attribute.Resolve): Make virtual.
10439         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
10440         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
10441         the argument. Don't create one.
10442         (Attribute.GetObsoleteAttribute): Likewise.
10443         (Attribute.GetClsCompliantAttributeValue): Likewise.
10444         * class.cs, decl.cs: Update to changes.
10445
10446 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
10447
10448         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
10449         
10450         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
10451         
10452         * statement.cs (Foreach.Resolve): Add error 186 report.
10453
10454 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
10455
10456         * expression.cs (Conditional.DoResolve): Add warning 429.
10457         
10458         * statement.cs (If.Resolve): Add warning 665.
10459
10460 2004-12-16  Raja R Harinath  <rharinath@novell.com>
10461
10462         New invariant: RootContext.Tree.Types.NamespaceEntry == null
10463         except when in the parser, and in GlobalAttribute.
10464         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
10465         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
10466         RootContext.Tree.Types.NamespaceEntry once work is done.
10467         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
10468         and resets RootContext.Tree.Types.NamespaceEntry.
10469
10470 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
10471
10472         * cs-parser.jay: Don't create a block for every variable.
10473
10474 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
10475
10476         * location.cs: Provide extra information.
10477
10478         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
10479         variables from the captured environment, it is the ldarg_0.
10480
10481 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10482
10483         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
10484         find a conclusion.
10485         
10486         * class.cs: Changed warning level for 169 to avoid developer
10487         displeasure from warning flooding. It will be changed back when they
10488         fix most of current BCL warnings.
10489         
10490         * RootContext.cs: Pushed default WarningLevel to 3.
10491         
10492         * statement.cs: Removed unused variable.
10493
10494 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
10495
10496         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
10497         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
10498         Add error 502 report.
10499         (StaticClass.DefineType): Add error 441 report.
10500         (Class.AllowedModifiersProp): New virtual property as temporary
10501         extension to AllowedModifiers.
10502         (Class.DefineType): Add error 418 report. Moved ModFlags check here
10503         to share implementation with StaticClass and don't call virtual
10504         methods from ctor.
10505         
10506         * driver.cs (MainDriver): Add error 1558 test.
10507
10508         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
10509         report. Moved error 36 test here.
10510
10511         * statement.cs (Throw.Resolve): Add error 724 report.
10512
10513         * typemanager.cs: Add out_attribute_type core type.
10514         
10515 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
10516
10517         * class.cs (TypeContainer.VerifyClsCompliance): Add error
10518         3018 report.
10519         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
10520
10521         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
10522         3017 report.
10523         
10524         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
10525
10526         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
10527         Add error 3023 report.
10528         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
10529
10530         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
10531         implementation.
10532
10533 2004-12-12  John Luke  <john.luke@gmail.com>
10534
10535         * driver.cs (AddArgs): take -- into account when
10536         adding arguments, fixes bug 65710 
10537
10538 2004-12-12  Martin Baulig  <martin@ximian.com>
10539
10540         * expression.cs (Unary.TryReduceNegative): Added support for
10541         SByteConstant and ByteConstant.
10542         (Unary.Reduce): Check error values from TryReduceNegative().
10543
10544 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
10545
10546         * attributes.cs (Attribute.Resolve): Avoid multiple error report
10547         and report exception as error 182.
10548
10549 2004-12-10  Raja R Harinath  <rharinath@novell.com>
10550
10551         * driver.cs (Main): Fix message when there are warnings.
10552
10553 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
10554
10555         * delegate.cs: Fixed my fix from yesterday, sorry about that.
10556
10557 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
10558
10559         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
10560         Reduced number of warnings.
10561         
10562         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
10563
10564 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
10565
10566         * driver.cs: Removed message.
10567
10568         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
10569
10570 2004-12-08    <vargaz@freemail.hu>
10571
10572         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
10573
10574 2004-12-08  Martin Baulig  <martin@ximian.com>
10575
10576         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
10577         instead of a CS3002 for properties and indexer.
10578
10579 2004-12-08  Martin Baulig  <martin@ximian.com>
10580
10581         * decl.cs (MemberName.ToString): Make this work again.
10582
10583 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
10584
10585         * attribute.cs (Resolve): Add error 591 detection.
10586
10587         * class.cs (FieldMember.Define): Add error 1547 detection.
10588         (Indexer.Define): Add error 620 detection.
10589         (Operator.Define): Add error 590 detection.
10590
10591         * ecore.cs: Missing argument for error 79.
10592
10593         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
10594         detection.
10595
10596 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
10597
10598         Fix #70106
10599         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
10600         only.
10601
10602 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
10603
10604         * cs-parser.jay : handle doc comments on implicit/explicit operators.
10605           Some operator comments were suppressed.
10606         * doc.cs : Implicit/explicit operator name in doc comments are like
10607           "op_Explicit(type)~returnType", so added suffix handling.
10608
10609 2004-12-07  Martin Baulig  <martin@ximian.com>
10610
10611         * decl.cs
10612         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
10613         (MemberCore.GetClsCompliantAttributeValue): Likewise.
10614         (DeclSpace.ec): New protected field; store the EmitContext here.
10615         (DeclSpace.EmitContext): New public property; moved here from
10616         `TypeContainer'.
10617         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
10618         EmitContext.
10619
10620         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
10621         (Enum.Emit): Don't create a new EmitContext.
10622
10623         * delegate.cs (Delegate.DefineType): Always create the
10624         EmitContext.
10625
10626         * iterators.cs (Iterators.DefineIterator): Create a new
10627         EmitContext and store it in `ec'.
10628
10629 2004-08-24  Martin Baulig  <martin@ximian.com>
10630
10631         * typemanager.cs
10632         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
10633         this for accessibility checks.
10634         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
10635         IsNestedFamilyAccessible.
10636         (TypeManager.IsSubclassOf): New method, do what the name actually
10637         says.   
10638
10639 2004-12-06  Raja R Harinath  <rharinath@novell.com>
10640
10641         Fix crash on cs0657-17.cs.
10642         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10643         Use RootContext.Tree.Types, not 'new RootTypes ()'.
10644         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
10645         the case where the NamespaceEntry gets overwritten.
10646
10647 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
10648
10649         Fixed #69195, #56821
10650         * ecore.cs (ResolveBoolean): Tiny refactoring.
10651
10652         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
10653         of right expression resolving when left is false constant and
10654         operator is LogicalAnd OR true constant and operator is LogicalOr.
10655
10656         * statement.cs (ResolveUnreachable): Always reports warning.
10657
10658 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
10659
10660         * class.cs: Distinguish between 1721 and 1722 (just a little help
10661         for the programmer).
10662
10663 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
10664
10665         * delegate.cs: Only allow this on new versions of the language. 
10666
10667 2004-12-02  Duncan Mak  <duncan@ximian.com>
10668
10669         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
10670         Expression class.
10671         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
10672         here as a static method. Take an additional bool out parameter
10673         `must_do_cs1540_check' for signaling to InstanceResolve.
10674         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
10675         member field from PropertyExpr class and made it an argument of
10676         the method instead.
10677         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
10678         check for MarshalByRefObject, and report CS0122 instead of CS1540.
10679         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
10680         and `remove_accessor' as well as InstanceResolve: report CS0122
10681         where applicable.
10682
10683         Fixes #70129.
10684
10685 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10686
10687         Fix test-327.cs, test-328.cs, and put in early infrastructure
10688         for eventually fixing #52697.
10689         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
10690         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
10691         from other methods.
10692         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
10693         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
10694         (VerifyUsing, error246): Update.
10695         * rootcontext.cs (RootContext.NamespaceLookup): Just use
10696         'NamespaceEntry.LookupNamespaceOrType'.
10697
10698 2004-12-03  Martin Baulig  <martin@ximian.com>
10699
10700         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10701         method as our child, call AnonymousMethod.Compatible() on it.
10702
10703 2004-12-03  Raja R Harinath  <rharinath@novell.com>
10704
10705         Disable XML documentation support in 'basic' profile.
10706         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
10707         Redirect XmlElement to System.Object.
10708         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
10709         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
10710         * mcs.exe.sources: Add doc-bootstrap.cs.
10711         * doc-bootstrap.cs: New file.  Contains empty stub implementation
10712         of doc.cs.
10713
10714 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
10715
10716         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
10717           comments are allowed.
10718
10719 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10720
10721         * delegate.cs: Add checks for subtypes in paramaters and return values
10722         in VerifyMethod () to add support for Covariance/Contravariance
10723         in delegates.
10724         
10725 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
10726
10727         * report.cs: Remove extra closing parenthesis.
10728
10729         * convert.cs (Error_CannotImplicitConversion): If the name of the
10730         types are the same, provide some extra information.
10731
10732         * class.cs (FieldBase): Use an unused bit field from the field to
10733         encode the `has_offset' property from the FieldMember.  This saves
10734         a couple of Ks on bootstrap compilation.
10735
10736         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
10737         method as our child, return the AnonymousMethod resolved
10738         expression.
10739
10740         * expression.cs (New.DoResolve): Allow return values from
10741         NewDelegate to also include AnonymousMethods.
10742
10743         Fixes #70150.
10744
10745 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
10746
10747         Fix bug #70102
10748         * attribute.cs (Resolve): Improved implementation of params
10749         attribute arguments.
10750
10751         * support.cs (ParameterData): Add HasParams to be faster.
10752
10753 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
10754
10755         all things are for /doc support:
10756
10757         * doc.cs: new file that supports XML documentation generation.
10758         * mcs.exe.sources: added doc.cs.
10759         * driver.cs:
10760           Handle /doc command line option.
10761           Report error 2006 instead of 5 for missing file name for /doc.
10762           Generate XML documentation when required, after type resolution.
10763         * cs-tokenizer.cs:
10764           Added support for picking up documentation (/// and /** ... */),
10765           including a new XmlCommentState enumeration.
10766         * cs-parser.jay:
10767           Added lines to fill Documentation element for field, constant,
10768           property, indexer, method, constructor, destructor, operator, event
10769           and class, struct, interface, delegate, enum.
10770           Added lines to warn incorrect comment.
10771         * rootcontext.cs :
10772           Added Documentation field (passed only when /doc was specified).
10773         * decl.cs:
10774           Added DocComment, DocCommentHeader, GenerateDocComment() and
10775           OnGenerateDocComment() and some supporting private members for
10776           /doc feature to MemberCore.
10777         * class.cs:
10778           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
10779         * delegate.cs:
10780           Added overriden DocCommentHeader.
10781         * enum.cs:
10782           Added overriden DocCommentHeader and GenerateDocComment().
10783
10784 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
10785
10786         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
10787         unwrapping the enumeration values, chain to
10788         DoConstantNumericPromotions again, so we can promote things to the
10789         fundamental types (takes care of enums that are bytes, sbytes).
10790
10791         Fixes bug #62054.
10792
10793 2004-12-01  Raja R Harinath  <rharinath@novell.com>
10794
10795         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
10796         Fix long-standing bug in type-lookup.  Use FindType instead of
10797         LookupType when ec.ResolvingTypeTree.
10798         (Attribute.ResolveType, Attribute.Resolve)
10799         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
10800         Update to changes.
10801         (Attributes.Search): Remove internal version.  Update.
10802         (Attributes.SearchMulti): Update.
10803         (Attributes.GetClsCompliantAttribute): Remove.
10804         (Attributes.GetIndexerNameAttribute): Remove.
10805         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
10806         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
10807         * class.cs (Indexer.Define): Likewise.
10808
10809 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
10810
10811         Fix bug #68790
10812         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
10813         MarshallByReference members access.
10814
10815         * expression.cs: Use CheckMarshallByRefAccess;
10816         Better error CS0197 message.
10817
10818         * report.cs: Print whole related error message.
10819
10820 2004-11-30  Raja R Harinath  <rharinath@novell.com>
10821
10822         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
10823         the current directory to help debugging.
10824
10825 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10826
10827         * class (GetClassBases): Better error 60 report.
10828         (EventProperty): Disabled warning 67 detection.
10829
10830 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10831
10832         Fix bug #60324
10833         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
10834
10835         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
10836         precise values.
10837
10838 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
10839
10840         Fix bug #49488
10841         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
10842
10843         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
10844
10845 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
10846
10847         * attribute.cs (Attribute.Resolve): Refine error reporting and
10848         report a cs0117 if the identifier does not exist, to distinguish
10849         from 0617 which is a miss-use of the actual identifier.
10850
10851         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
10852         between cs0070 and cs0079.
10853
10854         * class.cs (MemberBase.DoDefine): When reporting a wrong
10855         accessibility level, we use MethodCore to compare instead of
10856         Method (this was a regression in some refactoring effort).
10857
10858         So now we correctly report cs0056 again.
10859
10860         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
10861         testing the target_type (which was known to be object_type) and
10862         not the source type (which is anonymous_method).
10863
10864         Fixed reporting of error cs1660.
10865
10866         * expression.cs (UserCast.Source): Expose the underlying cast.
10867
10868         * statement.cs (Switch.SwitchGoverningType): Sort the list of
10869         allowed types to find a match to int32 first (most common).
10870
10871         In addition, it ignores any ImplicitUserConversions that did an
10872         internal implicit conversion (as the switch statement allows only
10873         one integral conversion to exist).
10874
10875         * class.cs (PartialContainer.Create): rename `name' to
10876         `member_name' for clarity.  Then replace the string calls with a
10877         call to MemberName.GetPartialName, as now using
10878         MemberName.ToString is an error (this is due to the side effects
10879         it had, that were fixed in the past).
10880
10881         This will restore the error reporting on a number of partial class
10882         errors that were missusing this (and getting an exception as a
10883         results, which is now just a plain textual warning, because
10884         yyparse debug output would crash otherwise).
10885
10886 2004-11-26  Raja R Harinath  <rharinath@novell.com>
10887
10888         * Makefile (PROGRAM_INSTALL_DIR): Remove.
10889
10890 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10891
10892         * rootcontext.cs (LookupType): Make sure to cache lookups that
10893         don't give us a negative result. This saves about 5% of corlib
10894         compilation time.
10895
10896 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10897
10898         * report.cs (AbstractMessage.Print): messages are sent to stderr
10899
10900         * class.cs (TypeContainer.GetClassBases): It is an error to have a
10901         non-interface in the list of interfaces (at this point, either
10902         parent was properly set, or a base class is being listed in the
10903         interfaces section).
10904
10905         This flags error 1722, and resolves the crash from bug 69259.
10906
10907 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
10908
10909         * statement.cs (Using.EmitExpressionFinally): make this work right
10910         for valuetypes. Fixes 69926.
10911
10912 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
10913
10914         * const.cs (Const.ChangeType): Cope with the "0 literal can be
10915         converted to an enum" here, before we try to change the underlying
10916         type.  This code exists, but it is a different code path than the
10917         one used while encoding constants.
10918
10919         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
10920         old bug: when converting from the null literal to a pointer,
10921         return an EmptyCast, not the NullLiteral.
10922
10923         This fixes #69921, the recent null_type changes probably made this
10924         bug more prominent.
10925
10926         (ImplicitReferenceConversionExists): In addition, resynchronized
10927         the code here, so it matches the same code in
10928         ImplicitReferenceConversionExists for the `from any class-type S
10929         to any interface-type T'.
10930         
10931
10932 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
10933
10934         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
10935
10936 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
10937
10938         * cs-parser.jay: Use verbosity accordingly. 
10939
10940 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10941
10942         * expression.cs (Unary.ResolveOperator): Do not report warning;
10943         AddressOf reads from variable.
10944         
10945         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
10946
10947 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
10948
10949         Fix bug #69462
10950
10951         * attribute.cs (Attributable): Removed CheckTargets.
10952         (Attributes.Emit): Explicit attribute targets are tested here.
10953
10954         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
10955         not enabled for interfaces.
10956
10957         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
10958         (GetAssemblyName): Ouch next bug there.
10959
10960 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
10961
10962         * expression.cs: Error 275 added.
10963         
10964 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
10965
10966         Fix bug #69177 (Implemented decimal constant support)
10967
10968         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
10969         (BinaryFold): Add DecimalConstant.
10970
10971         * const.cs (Define): Decimal constant 
10972         (is not constant.
10973         (ChangeType): Add decimal type handling.
10974         (LookupConstantValue): Don't set value for decimal type but
10975         emit DecimalConstantAttribute. Needed for constant optimization.
10976
10977         * constant.cs (ToDecimal): New method.
10978         (ConvertToDecimal): New method.
10979         (IntConstant): Implemented ConvertToDecimal.
10980         (DecimalConstant.Emit): Emit optimized version for decimals in
10981         int range.
10982
10983         * expression.cs (ResolveOperator): Changed order of constant
10984         reduction to work correctly with native types which have
10985         overloaded operators.
10986         (ResolveMemberAccess): Extract constant value from attribute
10987         for decimal type.
10988
10989         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
10990
10991         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
10992         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
10993         (ChangeType): Decimal is special.
10994         (TypeToCoreType): Add decimal type.
10995
10996 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
10997
10998         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
10999         decimal types.
11000
11001 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
11002
11003         * class.cs (EventField.ApplyAttributeBuilder): Fix error
11004         test cs1667-5.cs.
11005
11006 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
11007
11008         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
11009
11010         * pending.cs (PendingImplementation): Grab only interfaces.
11011
11012 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
11013
11014         * statement.cs (ForeachHelperMethods): Add location member and
11015         error 202 detection.
11016
11017 2004-11-19  Raja R Harinath  <rharinath@novell.com>
11018
11019         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
11020         automatically handled by executable.make.
11021         (PROGRAM): Make profile-specific.
11022
11023 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
11024
11025         * expression.cs (DoResolveBase): Fixed wrong warning for out
11026         variables.
11027
11028 2004-11-18  Martin Baulig  <martin@ximian.com>
11029
11030         Merged latest changes into gmcs.  Please keep this comment in
11031         here, it makes it easier for me to see what changed in MCS since
11032         the last time I merged.
11033
11034 2004-11-17  Raja R Harinath  <rharinath@novell.com>
11035
11036         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
11037         (TypeHandle.GetMemberCache): New.
11038         (TypeHandle.TypeHandle): Update.
11039         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
11040         (TypeManager.LookupParentInterfacesCache):
11041         Rename from LookupInterfaceCache.  Optimize slightly.
11042         (TypeManager.MemberLookup_FindMembers): Update.
11043         * decl.cs (MemberCache.MemberCache): Set Container to null in the
11044         multi-type variant.
11045         (AddCacheContents): Rename from AddHashtable.
11046         * class.cs (TypeContainer.parent_container): Remove.
11047         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
11048         (TypeContainer.DoDefineMembers): Don't initialize it.
11049         Update to name changes.
11050         
11051 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
11052
11053         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
11054         that factors the code to check access modifiers on override.  
11055
11056         (PropertyBase): Use the code here.
11057
11058         Patch from Lluis S'anchez, fixes bug #69361.
11059
11060 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
11061
11062         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
11063         routine that is used to report the use of a captured variable
11064         whose address has been taken.
11065
11066         There are two checks: one when variables are being captured and
11067         the other check is when the address of a variable is taken. 
11068         
11069         (because an anonymous methods might be resolved before *or* after
11070         the address has been taken) and 
11071
11072         * expression.cs (Conditional.DoResolve): Remove the special
11073         casing that Martin added to trueExpr and falseExpr being both
11074         NullLiteral.  We get the right behavior now just by introducing
11075         the null_type into the compiler. 
11076
11077         * convert.cs (ExplicitConversion): Change the code to use
11078         null_type instead of testing `expr is NullLiteral'.
11079         (ImplicitConversionStandard): use null_type too.
11080         (ImplicitReferenceConversionExists): use null_type too.
11081         (ImplicitReferenceConversion): use null_type too.
11082
11083         * literal.cs: The type of `NullLiteral' is now null_type instead
11084         of object_type. 
11085         (Resolve): Set the type here.
11086
11087         * typemanager.cs: Introduce null_type.
11088
11089 2004-11-17  Martin Baulig  <martin@ximian.com>
11090
11091         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
11092         direction, like FindMembers() does.  Fixes #69546, testcase is in
11093         test-315.cs.    
11094
11095 2004-11-16  Martin Baulig  <martin@ximian.com>
11096
11097         This is based on a patch from Marek Safar, see bug #69082.
11098         Fixes bugs #63705 and #67130.
11099
11100         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
11101         method; create a MemberCache for an interface type and cache the
11102         result.
11103
11104         * decl.cs (IMemberContainer.ParentContainer): Removed.
11105         (IMemberContainer.ParentCache): New property.
11106         (MemberCache.SetupCacheForInterface): Removed.
11107         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
11108         to create a cache for an interface's "parent".
11109
11110         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
11111         interfaces too.
11112
11113 2004-11-16  Martin Baulig  <martin@ximian.com>
11114
11115         Merged back from gmcs; these changes already went into gmcs a
11116         couple of weeks ago.
11117
11118         * typemanager.cs
11119         (TypeManager.AddUserType): Removed the `ifaces' argument.
11120         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
11121         `TypeExpr []'.
11122         (TypeManager.AddUserInterface): Removed.
11123         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
11124         `TypeExpr []'.
11125         (TypeManager.GetInterfaces): Likewise.
11126         (TypeManager.GetExplicitInterfaces): Likewise.
11127
11128         * ecore.cs (TypeExpr.GetInterfaces): Removed.
11129
11130         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
11131         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
11132
11133 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
11134
11135         * statement.cs: Avoid adding bools to a hashtable.
11136
11137 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
11138
11139         * expression.cs (Invocation.OverloadResolve): Flag error if we are
11140         calling an unsafe method from a safe location.
11141
11142 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
11143
11144         Fix #69167
11145         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
11146
11147 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
11148
11149         * namespace.cs (VerifyUsing): use GetPartialName instead of
11150         ToString. 
11151
11152 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
11153
11154         * statement.cs (Return.Resolve): Fix regression in typo: if
11155         `in_exc', we have to request a NeedReturnLabel, this was a typo
11156         introduced in the anonymous method check-in.  Fixes #69131.
11157
11158         * Indexers were using the ShortName when defining themselves,
11159         causing a regression in the compiler bootstrap when applying the
11160         patch from 2004-11-02 (first part), now they use their full name
11161         and the bug is gone.
11162
11163 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
11164
11165         * driver.cs: Strip the path from the names of embedded resources. Fixes
11166         #68519.
11167
11168 2004-11-04  Raja R Harinath  <rharinath@novell.com>
11169
11170         Fix error message regression: cs0104-2.cs.
11171         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
11172         (AliasEntry.Resolve): Update.
11173         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
11174         'silent' flag.
11175         (RootContext.LookupType): Update.
11176
11177 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
11178
11179         * cs-parser.jay: Add support for handling accessor modifiers
11180         * class: Add support port accessor modifiers and error checking,
11181         define PropertyMethod.Define as virtual (not abstract anymore)
11182         * ecore.cs: Add checking for proeprties access with access modifiers
11183         * iterators.cs: Modify Accessor constructor call based in the modified
11184         constructor
11185 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
11186
11187         * expression.cs (StringConcat): Handle being called twice,
11188         as when we have a concat in a field init with more than two
11189         ctors in the class
11190
11191 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
11192
11193         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
11194         special case explicit implementations, we should always produce
11195         the .property or .event declaration.
11196         
11197         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
11198         since it will not return correct data if people use this
11199         unresolved in the presence of using statements (see test-313).
11200
11201         * class.cs (MethodData.Define): If we are an explicit interface
11202         implementation, set the method name to the full name of the
11203         interface plus the name of the method.  
11204
11205         Notice that using the method.MethodName.GetFullName() does not
11206         work, as it will only contain the name as declared on the source
11207         file (it can be a shorthand in the presence of using statements)
11208         and not the fully qualifed type name, for example:
11209
11210         using System;
11211
11212         class D : ICloneable {
11213                 object ICloneable.Clone ()  {
11214                 }
11215         }
11216
11217         Would produce a method called `ICloneable.Clone' instead of
11218         `System.ICloneable.Clone'.
11219
11220         * namespace.cs (Alias.Resolve): Use GetPartialName.
11221         
11222 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11223
11224         * cs-parser.jay: Add error 1055 report.
11225
11226 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
11227
11228         * assign.cs (Assign.DoResolve): Only do the transform of
11229         assignment into a New if the types are compatible, if not, fall
11230         through and let the implicit code deal with the errors and with
11231         the necessary conversions. 
11232
11233 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
11234
11235         * cs-parser.jay: Add error 1031 report.
11236
11237         * cs-tokenizer.cs: Add location for error 1038.
11238
11239 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11240
11241         * cs-parser.jay: Add error 1016 report.
11242
11243 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11244
11245         * cs-parser.jay: Add errors 1575,1611 report.
11246
11247 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11248
11249         * cs-parser.jay: Add error 1001 report.
11250
11251 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11252
11253         Fix #68850
11254         * attribute.cs (GetMarshal): Add method argument for
11255         caller identification.
11256
11257         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
11258         agument for GetMarshal and RuntimeMissingSupport.
11259
11260 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
11261
11262         * attribute.cs (ExtractSecurityPermissionSet): Removed
11263         TypeManager.code_access_permission_type.
11264
11265         * typemanager.cs: Removed TypeManager.code_access_permission_type.
11266
11267 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
11268
11269         * expression.cs (LocalVariableReference.DoResolveLValue): Check
11270         for obsolete use of a variable here.   Fixes regression on errors
11271         cs0619-25 and cs0619-26.
11272
11273 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
11274
11275         Fix #62358, implemented security attribute encoding.
11276
11277         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
11278         Tests permitted SecurityAction for assembly or other types.
11279         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
11280         data from SecurityPermissionAttribute to PermisionSet class.
11281
11282         * class.cs (ApplyAttributeBuilder): Added special handling
11283         for System.Security.Permissions.SecurityAttribute based types.
11284
11285         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
11286         special handling for System.Security.Permissions.SecurityAttribute
11287         based types.
11288
11289         * enum.cs (ApplyAttributeBuilder): Added special handling
11290         for System.Security.Permissions.SecurityAttribute based types.
11291
11292         * parameter.cs (ApplyAttributeBuilder): Added special handling
11293         for System.Security.Permissions.SecurityAttribute based types.
11294
11295         * rootcontext.cs: Next 2 core types.
11296
11297         * typemanager.cs (TypeManager.security_permission_attr_type):
11298         Built in type for the SecurityPermission Attribute.
11299         (code_access_permission_type): Build in type.
11300
11301 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
11302
11303         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
11304         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
11305         all of this information into
11306         EmitContext.EmitCapturedVariableInstance.
11307         
11308         * codegen.cs (EmitCapturedVariableInstance): move here the
11309         funcionality of emitting an ldarg.0 in the presence of a
11310         remapping.   This centralizes the instance emit code.
11311
11312         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
11313         then emit a load of this: it means that we have reached the
11314         topmost ScopeInfo: the one that contains the pointer to the
11315         instance of the class hosting the anonymous method.
11316
11317         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
11318         captures to the topmost CaptureContext.
11319
11320 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
11321
11322         * expression.cs (LocalVariableReference): Move the knowledge about
11323         the iterators into codegen's EmitCapturedVariableInstance.
11324
11325 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
11328         all code paths return a value from an anonymous method (it is the
11329         same as the 161 error, but for anonymous methods).
11330
11331 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
11332
11333         The introduction of anonymous methods in the compiler changed
11334         various ways of doing things in the compiler.  The most
11335         significant one is the hard split between the resolution phase
11336         and the emission phases of the compiler.
11337
11338         For instance, routines that referenced local variables no
11339         longer can safely create temporary variables during the
11340         resolution phase: they must do so from the emission phase,
11341         since the variable might have been "captured", hence access to
11342         it can not be done with the local-variable operations from the runtime.
11343         
11344         * statement.cs 
11345
11346         (Block.Flags): New flag `IsTopLevel' to indicate that this block
11347         is a toplevel block.
11348
11349         (ToplevelBlock): A new kind of Block, these are the blocks that
11350         are created by the parser for all toplevel method bodies.  These
11351         include methods, accessors and anonymous methods.
11352
11353         These contain some extra information not found in regular blocks:
11354         A pointer to an optional CaptureContext (for tracking captured
11355         local variables and parameters).  A pointer to the parent
11356         ToplevelBlock.
11357         
11358         (Return.Resolve): Catch missmatches when returning a value from an
11359         anonymous method (error 1662).
11360         Invoke NeedReturnLabel from the Resolve phase instead of the emit
11361         phase.
11362
11363         (Break.Resolve): ditto.
11364
11365         (SwitchLabel): instead of defining the labels during the
11366         resolution phase, we now turned the public ILLabel and ILLabelCode
11367         labels into methods called GetILLabelCode() and GetILLabel() that
11368         only define the label during the Emit phase.
11369
11370         (GotoCase): Track the SwitchLabel instead of the computed label
11371         (its contained therein).  Emit the code by using
11372         SwitchLabel.GetILLabelCode ().
11373
11374         (LocalInfo.Flags.Captured): A new flag has been introduce to track
11375         whether the Local has been captured or not.
11376
11377         (LocalInfo.IsCaptured): New property, used to tell whether the
11378         local has been captured.
11379         
11380         * anonymous.cs: Vastly updated to contain the anonymous method
11381         support.
11382
11383         The main classes here are: CaptureContext which tracks any
11384         captured information for a toplevel block and ScopeInfo used to
11385         track the activation frames for various local variables.   
11386
11387         Each toplevel block has an optional capture context associated
11388         with it.  When a method contains an anonymous method both the
11389         toplevel method and the anonymous method will create a capture
11390         context.   When variables or parameters are captured, they are
11391         recorded on the CaptureContext that owns them, for example:
11392
11393         void Demo () {
11394              int a;
11395              MyDelegate d = delegate {
11396                  a = 1;
11397              }
11398         }
11399
11400         Here `a' will be recorded as captured on the toplevel
11401         CapturedContext, the inner captured context will not have anything
11402         (it will only have data if local variables or parameters from it
11403         are captured in a nested anonymous method.
11404
11405         The ScopeInfo is used to track the activation frames for local
11406         variables, for example:
11407
11408         for (int i = 0; i < 10; i++)
11409                 for (int j = 0; j < 10; j++){
11410                    MyDelegate d = delegate {
11411                         call (i, j);
11412                    }
11413                 }
11414
11415         At runtime this captures a single captured variable `i', but it
11416         captures 10 different versions of the variable `j'.  The variable
11417         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
11418         recorded on a child.  
11419
11420         The toplevel ScopeInfo will also track information like the `this'
11421         pointer if instance variables were referenced (this is necessary
11422         as the anonymous method lives inside a nested class in the host
11423         type of the method). 
11424
11425         (AnonymousMethod): Expanded to track the Toplevel, implement
11426         `AnonymousMethod.Compatible' to tell whether an anonymous method
11427         can be converted to a target delegate type. 
11428
11429         The routine now also produces the anonymous method content
11430
11431         (AnonymousDelegate): A helper class that derives from
11432         DelegateCreation, this is used to generate the code necessary to
11433         produce the delegate for the anonymous method that was created. 
11434
11435         * assign.cs: API adjustments for new changes in
11436         Convert.ImplicitStandardConversionExists.
11437
11438         * class.cs: Adjustments to cope with the fact that now toplevel
11439         blocks are of type `ToplevelBlock'. 
11440
11441         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
11442         insteda of standard blocks.
11443
11444         Flag errors if params arguments are passed to anonymous methods.
11445
11446         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
11447         `CurrentAnonymousMethod' which points to the current Anonymous
11448         Method.  The variable points to the AnonymousMethod class that
11449         holds the code being compiled.  It is set in the new EmitContext
11450         created for the anonymous method.
11451
11452         (EmitContext.Phase): Introduce a variable and an enumeration to
11453         assist in enforcing some rules about when and where we are allowed
11454         to invoke certain methods (EmitContext.NeedsReturnLabel is the
11455         only one that enfonces this right now).
11456
11457         (EmitContext.HaveCaptureInfo): new helper method that returns
11458         whether we have a CapturedContext initialized.
11459
11460         (EmitContext.CaptureVariable): New method used to register that a
11461         LocalInfo must be flagged for capturing. 
11462
11463         (EmitContext.CapturedParameter): New method used to register that a
11464         parameters must be flagged for capturing. 
11465         
11466         (EmitContext.CapturedField): New method used to register that a
11467         field must be flagged for capturing. 
11468
11469         (EmitContext.HaveCapturedVariables,
11470         EmitContext.HaveCapturedFields): Return whether there are captured
11471         variables or fields. 
11472
11473         (EmitContext.EmitMethodHostInstance): This is used to emit the
11474         instance for the anonymous method.  The instance might be null
11475         (static methods), this (for anonymous methods that capture nothing
11476         and happen to live side-by-side with the current method body) or a
11477         more complicated expression if the method has a CaptureContext.
11478
11479         (EmitContext.EmitTopBlock): Routine that drives the emission of
11480         code: it will first resolve the top block, then emit any metadata
11481         and then emit the code.  The split is done so that we can extract
11482         any anonymous methods and flag any captured variables/parameters.
11483         
11484         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
11485         during this phase, the ILGenerator should not be used as labels
11486         and local variables declared here might not be accessible to any
11487         code that is part of an anonymous method.  
11488
11489         Exceptions to this include the temporary variables that are
11490         created by some statements internally for holding temporary
11491         variables. 
11492         
11493         (EmitContext.EmitMeta): New routine, in charge of emitting all the
11494         metadata for a cb
11495
11496         (EmitContext.TemporaryReturn): This method is typically called
11497         from the Emit phase, and its the only place where we allow the
11498         ReturnLabel to be defined other than the EmitMeta.  The reason is
11499         that otherwise we would have to duplicate a lot of logic in the
11500         Resolve phases of various methods that today is on the Emit
11501         phase. 
11502
11503         (EmitContext.NeedReturnLabel): This no longer creates the label,
11504         as the ILGenerator is not valid during the resolve phase.
11505
11506         (EmitContext.EmitThis): Extended the knowledge in this class to
11507         work in anonymous methods in addition to iterators. 
11508
11509         (EmitContext.EmitCapturedVariableInstance): This emits whatever
11510         code is necessary on the stack to access the instance to a local
11511         variable (the variable will be accessed as a field).
11512
11513         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
11514         EmitContext.EmitAddressOfParameter): Routines to support
11515         parameters (not completed at this point). 
11516         
11517         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
11518         will also remove the parameters.
11519
11520         * convert.cs (Convert): Define a `ConstantEC' which points to a
11521         null.  This is just to prefity some code that uses
11522         ImplicitStandardConversion code and do not have an EmitContext
11523         handy.
11524
11525         The idea is to flag explicitly that at that point in time, it is
11526         known that the conversion will not trigger the delegate checking
11527         code in implicit conversions (which requires a valid
11528         EmitContext). 
11529
11530         Everywhere: pass new EmitContext parameter since
11531         ImplicitStandardConversionExists now requires it to check for
11532         anonymous method conversions. 
11533
11534         (Convert.ImplicitStandardConversionExists): If the type of an
11535         expression is the anonymous_method_type, and the type is a
11536         delegate, we invoke the AnonymousMethod.Compatible method to check
11537         whether an implicit conversion is possible. 
11538
11539         (Convert.ImplicitConversionStandard): Only do implicit method
11540         group conversions if the language level is not ISO_1.
11541
11542         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
11543         MethodInfo for the Invoke method.  used by Delegate and
11544         AnonymousDelegate.
11545
11546         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
11547         method conversions if the target type is a delegate.
11548
11549         Removed extra debugging nops.
11550
11551         (LocalVariableReference): Turn the `local_info' into a public
11552         field. 
11553
11554         Add `prepared' field, the same hack used for FieldExprs to cope
11555         with composed assignments, as Local variables do not necessarily
11556         operate purely on the stack as they used to: they can be captured
11557         fields. 
11558
11559         Add `temp' for a temporary result, like fields.
11560
11561         Refactor DoResolve and DoResolveLValue into DoResolveBase.
11562
11563         It now copes with Local variables that are captured and emits the
11564         proper instance variable to load it from a field in the captured
11565         case. 
11566
11567         (ParameterReference.DoResolveBase): During the resolve phase,
11568         capture parameters if we are in an anonymous method.
11569
11570         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
11571         anonymous method, use the EmitContext helper routines to emit the
11572         parameter reference.
11573
11574         * iterators.cs: Set RemapToProxy to true/false during the
11575         EmitDispose class.
11576
11577         * parameters.cs (GetParameterByName): New helper method. 
11578
11579         * typemanager.cs (anonymous_method_type) a new type that
11580         represents an anonyous method.  This is always an internal type,
11581         used as a fencepost to test against the anonymous-methodness of an
11582         expression. 
11583         
11584 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
11585
11586         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
11587         561 report.
11588         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
11589
11590 2004-10-18  Martin Baulig  <martin@ximian.com>
11591
11592         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
11593         `Type' directly, but call ResolveType() on it.
11594         (Catch.Resolve): Likewise.
11595         (Foreach.Resolve): Likewise.
11596
11597 2004-10-18  Martin Baulig  <martin@ximian.com>
11598
11599         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
11600         `Type' directly, but call ResolveType() on it.
11601         (Probe.DoResolve): Likewise.
11602         (ArrayCreation.LookupType): Likewise.
11603         (TypeOf.DoResolve): Likewise.
11604         (SizeOf.DoResolve): Likewise.
11605
11606 2004-10-18  Martin Baulig  <martin@ximian.com>
11607
11608         * expression.cs (Invocation.BetterFunction): Put back
11609         TypeManager.TypeToCoreType().
11610
11611 2004-10-18  Raja R Harinath  <rharinath@novell.com>
11612
11613         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
11614         the ResolveType.
11615
11616 2004-10-18  Martin Baulig  <martin@ximian.com>
11617
11618         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
11619         `Type' directly, but call ResolveType() on it.
11620
11621 2004-10-18  Martin Baulig  <martin@ximian.com>
11622
11623         * class.cs (FieldMember.Define): Don't access the TypeExpr's
11624         `Type' directly, but call ResolveType() on it.
11625         (MemberBase.DoDefine): Likewise.
11626
11627         * expression.cs (New.DoResolve): Don't access the TypeExpr's
11628         `Type' directly, but call ResolveType() on it.
11629         (ComposedCast.DoResolveAsTypeStep): Likewise.
11630
11631         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
11632         `Type' directly, but call ResolveType() on it.
11633
11634 2004-10-17  John Luke  <john.luke@gmail.com>
11635
11636         * class.cs (Operator.GetSignatureForError): use CSharpName
11637
11638         * parameter.cs (Parameter.GetSignatureForError): Returns
11639         correct name even if was not defined.
11640
11641 2004-10-13  Raja R Harinath  <rharinath@novell.com>
11642
11643         Fix #65816.
11644         * class.cs (TypeContainer.EmitContext): New property.
11645         (DefineNestedTypes): Create an emitcontext for each part.
11646         (MethodCore.DoDefineParameters): Use container's emitcontext.
11647         Pass type array to InternalParameters.
11648         (MemberBase.DoDefine): Use container's emitcontext.
11649         (FieldMember.Define): Likewise.
11650         (Event.Define): Likewise.
11651         (SetMethod.GetParameterInfo): Change argument to EmitContext.
11652         Pass type array to InternalParameters.
11653         (SetIndexerMethod.GetParameterInfo): Likewise.
11654         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
11655         * delegate.cs (Define): Pass emitcontext to
11656         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
11657         array to InternalParameters.
11658         * expression.cs (ParameterReference.DoResolveBase): Pass
11659         emitcontext to GetParameterInfo.
11660         (ComposedCast.DoResolveAsTypeStep): Remove check on
11661         ec.ResolvingTypeTree.
11662         * parameter.cs (Parameter.Resolve): Change argument to
11663         EmitContext.  Use ResolveAsTypeTerminal.
11664         (Parameter.GetSignature): Change argument to EmitContext.
11665         (Parameters.ComputeSignature): Likewise.
11666         (Parameters.ComputeParameterTypes): Likewise.
11667         (Parameters.GetParameterInfo): Likewise.
11668         (Parameters.ComputeAndDefineParameterTypes): Likewise.
11669         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
11670         * support.cs (InternalParameters..ctor): Remove variant that takes
11671         a DeclSpace.
11672         * typemanager.cs (system_intptr_expr): New.
11673         (InitExpressionTypes): Initialize it.
11674
11675 2004-10-12  Chris Toshok  <toshok@ximian.com>
11676
11677         * cs-parser.jay: fix location for try_statement and catch_clause.
11678
11679 2004-10-11  Martin Baulig  <martin@ximian.com>
11680
11681         * report.cs: Don't make --fatal abort on warnings, we have
11682         -warnaserror for that.
11683
11684 2004-10-07  Raja R Harinath  <rharinath@novell.com>
11685
11686         More DeclSpace.ResolveType avoidance.
11687         * decl.cs (MemberCore.InUnsafe): New property.
11688         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
11689         with newly created EmitContext.
11690         (FieldMember.Define): Likewise.
11691         * delegate.cs (Delegate.Define): Likewise.
11692         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
11693         only if normal name-lookup fails.
11694         (TypeExpr.DoResolve): Enable error-checking.
11695         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
11696         (SizeOf.DoResolve): Likewise.
11697         (ComposedCast.DoResolveAsTypeStep): Likewise.
11698         (StackAlloc.DoResolve): Likewise.
11699         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
11700         (Block.Unsafe): New property.
11701         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
11702         (Unsafe): Set 'unsafe' flag of contained block.
11703         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
11704         (Fixed.Resolve): Likewise.
11705         (Catch.Resolve): Likewise.
11706         (Using.ResolveLocalVariableDecls): Likewise.
11707         (Foreach.Resolve): Likewise.
11708
11709 2004-10-05  John Luke <john.luke@gmail.com>
11710
11711         * cs-parser.jay: add location to error CS0175
11712
11713 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
11714
11715         * ecore.cs (Expression.Constantity): Add support for turning null
11716         into a constant.
11717
11718         * const.cs (Const.Define): Allow constants to be reference types
11719         as long as the value is Null.
11720
11721 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
11722
11723         * namespace.cs (NamespaceEntry.Using): No matter which warning
11724         level is set, check if this namespace name has already been added.
11725
11726 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
11727
11728         * expression.cs: reftype [!=]= null should always use br[true,false].
11729         # 67410
11730
11731 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
11732
11733         Fix #67108
11734         * attribute.cs: Enum conversion moved to 
11735         GetAttributeArgumentExpression to be applied to the all
11736         expressions.
11737
11738 2004-10-01  Raja R Harinath  <rharinath@novell.com>
11739
11740         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
11741         * class.c (TypeContainer.DefineType): Flag error if
11742         base types aren't accessible due to access permissions.
11743         * decl.cs (DeclSpace.ResolveType): Move logic to
11744         Expression.ResolveAsTypeTerminal.
11745         (DeclSpace.ResolveTypeExpr): Thin layer over
11746         Expression.ResolveAsTypeTerminal.
11747         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
11748         Refactor code into NestedAccess.  Use it.
11749         (DeclSpace.NestedAccess): New.
11750         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
11751         argument to silence errors.  Check access permissions.
11752         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
11753         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
11754         (Cast.DoResolve): Likewise.
11755         (New.DoResolve): Likewise.
11756         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
11757         (TypeOf.DoResolve): Likewise.
11758
11759         * expression.cs (Invocation.BetterConversion): Return the Type of
11760         the better conversion.  Implement section 14.4.2.3 more faithfully.
11761         (Invocation.BetterFunction): Make boolean.  Make correspondence to
11762         section 14.4.2.2 explicit.
11763         (Invocation.OverloadResolve): Update.
11764         (Invocation): Remove is_base field.
11765         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
11766         (Invocation.Emit): Likewise.
11767
11768 2004-09-27  Raja R Harinath  <rharinath@novell.com>
11769
11770         * README: Update to changes.
11771
11772 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
11773
11774         * cs-parser.jay: Reverted 642 warning fix.
11775
11776 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11777
11778         Fix bug #66615
11779         * decl.cs (FindMemberWithSameName): Indexer can have more than
11780         1 argument.
11781
11782 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11783
11784         * expression.cs (LocalVariableReference.DoResolveLValue):
11785         Do not report warning 219 for out values.
11786         (EmptyExpression.Null): New member to avoid extra allocations.
11787
11788 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11789
11790         * cs-parser.jay: Fix wrong warning 642 report.
11791
11792         * cs-tokenizer.cs (CheckNextToken): New helper;
11793         Inspect next character if is same as expected.
11794
11795 2004-09-23  Martin Baulig  <martin@ximian.com>
11796
11797         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
11798         (Convert.ImplicitReferenceConversionExists): Likewise.
11799
11800 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
11801
11802         * class.cs (Operator.Define): Add error 448 and 559 report.
11803
11804 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11805
11806         * class.cs (MemberBase.IsTypePermitted): New protected
11807         method for checking error CS0610.
11808
11809 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11810
11811         * class.cs (TypeContainer.HasExplicitLayout): New property
11812         Returns whether container has StructLayout attribute set Explicit.
11813         (FieldMember): New abstract class for consts and fields.
11814         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
11815         (Field): Reuse FieldMember.
11816
11817         * const.cs (Const): Reuse FieldMember.
11818
11819         * rootcontext.cs: EmitConstants call moved to class.
11820
11821 2004-09-22  Martin Baulig  <martin@ximian.com>
11822
11823         Thanks to Peter Sestoft for this bug report.
11824
11825         * expression.cs (Conditional): If both the `trueExpr' and the
11826         `falseExpr' is a NullLiteral, return a NullLiteral.
11827
11828 2004-09-22  Martin Baulig  <martin@ximian.com>
11829
11830         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
11831         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
11832         for the "get_Current" call.
11833
11834 2004-09-22  Martin Baulig  <martin@ximian.com>
11835
11836         Marek and me just fixed one of our oldest bugs: #28562 :-)
11837
11838         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
11839
11840         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
11841         we're an EnumConstant, just return that.
11842         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
11843         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
11844         to get the value which'll actually be written into the attribute.
11845         However, we have to use GetValue() to access the attribute's value
11846         in the compiler.        
11847
11848 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
11849
11850         * constant.cs (Constant.IsNegative): New abstract property
11851         IsNegative.
11852
11853         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
11854         (StackAlloc.DoResolve): Reused IsNegative.
11855
11856 2004-09-21  Martin Baulig  <martin@ximian.com>
11857
11858         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
11859         if we're used in an iterator, we may be called from different
11860         methods.
11861
11862         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
11863         we actually have an exception block.
11864
11865 2004-09-20  John Luke <jluke@cfl.rr.com>
11866
11867         * class.cs, cs-parser.jay: Improve the error report for 1520:
11868         report the actual line where the error happens, not where the
11869         class was declared.
11870
11871         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
11872         Pass location information that was available elsewhere.
11873
11874 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
11875
11876         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
11877         runtime to delay sign assemblies.
11878
11879 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11880
11881         * cs-parser.jay: Do not report the stack trace, this is barely
11882         used nowadays.
11883
11884 2004-08-22  John Luke  <john.luke@gmail.com>
11885  
11886         * driver.cs : check that a resource id is not already used
11887         before adding it, report CS1508 if it is, bug #63637
11888
11889 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
11890
11891         * ecore.cs: Removed dead code.
11892
11893 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
11894
11895         * class.cs: Do not report warning CS0067 on the interfaces.
11896
11897 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11898
11899         * cs-parser.jay: Add error 504 report.
11900
11901 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11902
11903         * rootcontext.cs: WarningLevel is 4 by default now.
11904
11905         * statement.cs (Fixed.Resolve): Do not null
11906         VariableInfo.
11907
11908 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
11909
11910         Fixed bug #55780
11911         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
11912         deep search when property is not virtual.
11913         (PropertyExpr.ResolveAccessors): Make one call for both
11914         accessors.
11915
11916 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11917
11918         Fixed bug #65766
11919         * statement.cs: Error 152 report constains also location.
11920
11921 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11922
11923         Fixed bug #65766
11924         * const.cs: Explicitly set constant as static.
11925
11926 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11927
11928         Fixed bug #64226
11929         * cs-parser.jay: Add error 1017 report.
11930
11931 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
11932
11933         Fixed bug #59980, #64224
11934         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
11935
11936         * typemanager.cs (IsSpecialMethod): Simplified
11937
11938 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11939
11940         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
11941         condition with better params.
11942
11943 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11944
11945         Fixed bug #65238
11946         * attribute.cs (Resolve): Property has to have both
11947         accessors.
11948
11949 2004-09-14  Martin Baulig  <martin@ximian.com>
11950
11951         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
11952
11953 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
11954
11955         Fixed bug #61902
11956         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
11957         called and is obsolete then this member suppress message
11958         when call is inside next [Obsolete] method or type.
11959
11960         * expression.cs: Use TestObsoleteMethodUsage member.
11961
11962 2004-09-14  Martin Baulig  <martin@ximian.com>
11963
11964         * cs-parser.jay: Sync a bit with the GMCS version.
11965
11966 2004-09-14  Martin Baulig  <martin@ximian.com>
11967
11968         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
11969         (CSharpParser.yacc_verbose_flag): New public field.
11970
11971         * genericparser.cs: Removed.
11972
11973 2004-09-14  Raja R Harinath  <rharinath@novell.com>
11974
11975         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
11976
11977 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
11978
11979         * class.cs (MethodCore.CheckBase): Fix bug #65757.
11980
11981 2004-09-10  Martin Baulig  <martin@ximian.com>
11982
11983         Backported my MemberName changes from GMCS into MCS.
11984
11985         - we are now using a special `MemberName' class instead of using
11986         strings; in GMCS, the `MemberName' also contains the type
11987         arguments.
11988
11989         - changed the grammar rules a bit:
11990           * the old `member_name' is now a `namespace_or_type_name':
11991             The rule is that we use `namespace_or_type_name' everywhere
11992             where we expect either a "member name" (GetEnumerator) or a
11993             "member name" with an explicit interface name
11994             (IEnumerable.GetEnumerator).
11995             In GMCS, the explicit interface name may include type arguments
11996             (IEnumerable<T>.GetEnumerator).
11997           * we use `member_name' instead of just `IDENTIFIER' for
11998             "member names":
11999             The rule is that we use `member_name' wherever a member may
12000             have type parameters in GMCS.       
12001
12002         * decl.cs (MemberName): New public class.
12003         (MemberCore.MemberName): New public readonly field.
12004         (MemberCore.ctor): Take a `MemberName' argument, not a string.
12005         (DeclSpace): Likewise.
12006
12007         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
12008         * enum.cs (Enum.ctor): Likewise.
12009
12010         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
12011         MemberName.     
12012         (AliasEntry.ctor): Take a MemberName, not an Expression.
12013         (AliasEntry.UsingAlias): Likewise.
12014
12015         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
12016         (IMethodData.MemberName): Changed type from string to MemberName.
12017         (MemberBase.ExplicitInterfaceName): Likewise.
12018         (AbstractPropertyEventMethod.SetupName): Make this private.
12019         (AbstractPropertyEventMethod.ctor): Added `string prefix'
12020         argument; compute the member name here.
12021         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
12022         on the `member.MemberName' and the `prefix'.
12023
12024         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
12025         not `type_name'.
12026         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
12027         thus, we get a `MemberName' instead of a `string'.  These
12028         declarations may have type parameters in GMCS.
12029         (interface_method_declaration, delegate_declaration): Likewise.
12030         (class_declaration, interface_declaration): Likewise.
12031         (method_header): Use `namespace_or_type_name' instead of
12032         `member_name'.  We may be an explicit interface implementation.
12033         (property_declaration, event_declaration): Likewise.
12034         (member_name): This is now just an `IDENTIFIER', not a
12035         `namespace_or_type_name'.
12036         (type_name, interface_type): Removed.
12037         (namespace_or_type_name): Return a MemberName, not an Expression.
12038         (primary_expression): Use `member_name' instead of `IDENTIFIER';
12039         call GetTypeExpression() on the MemberName to get an expression.
12040         (IndexerDeclaration.interface_type): Changed type from string to
12041         MemberName.
12042         (MakeName): Operate on MemberName's instead of string's.
12043
12044 2004-09-13  Raja R Harinath  <rharinath@novell.com>
12045
12046         Fix bug #55770.
12047         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
12048         (NamespaceEntry.Lookup): Add new argument to flag if we want the
12049         lookup to avoid symbols introduced by 'using'.
12050         * rootcontext.cs (NamespaceLookup): Update.
12051
12052 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
12053
12054         * class.cs (TypeContainer.DoDefineMembers): Do not call
12055         DefineDefaultConstructor for static classes.
12056
12057 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
12058
12059         * attribute.cs (Attribute.Resolve): Add error 653 report.
12060
12061         * class.cs (Class.ApplyAttributeBuilder): Add error 641
12062         report.
12063         (Method.ApplyAttributeBuilder): Add error 685 report.
12064         (Operator.Define): Add error 564 report.
12065
12066         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
12067
12068         * expression.cs (Invocation.DoResolve): Add error
12069         245 and 250 report.
12070
12071         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
12072         error 674 report.
12073
12074 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12075
12076         * class.cs (ConstructorInitializer.Resolve):
12077         Wrong error number (515->516).
12078
12079 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12080
12081         * class.cs (Indexer.Define): Add error 631 report.
12082
12083 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12084
12085         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
12086
12087 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
12088
12089         * expression.cs (Probe.DoResolve): Add error CS0241 report.
12090
12091 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
12092
12093         * cs-parser.jay: Added error CS0241 report.
12094
12095 2004-09-10  Raja R Harinath  <rharinath@novell.com>
12096
12097         * cs-parser.jay (fixed_statement): Introduce a scope for the
12098         declaration in the 'fixed' statement.
12099
12100 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12101
12102         * cs-parser.jay: Added CS0230 error report.
12103
12104 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12105
12106         * cs-parser.jay: Added errors CS0231 and CS0257 report.
12107
12108 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12109
12110         * expression.cs (Argument.Resolve): Added error CS0192 and
12111         CS0199 report.
12112
12113 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
12114
12115         C# 2.0 #pragma warning feature
12116
12117         * cs-tokenizer.cs (PreProcessPragma): New method; 
12118         Handles #pragma directive.
12119
12120         * report.cs (WarningRegions): New class; Support
12121         class for #pragma warning directive. It tests whether
12122         warning is enabled for a given line.
12123
12124 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
12125
12126         * const.cs: Add more descriptive error report, tahnks to
12127         Sebastien. 
12128
12129 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
12130
12131         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
12132
12133 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
12134
12135         * expression.cs: Apply patch from Ben: Remove dead code from
12136         ArrayCreation, and remove the TurnintoConstant call in const.cs,
12137         as that code just threw an exception anwyays.
12138
12139         * const.cs: Remove the call to the turnintoconstant, for details
12140         see bug: #63144
12141         
12142         * literal.cs: The type of the null-literal is the null type;  So
12143         we use a placeholder type (literal.cs:System.Null, defined here)
12144         for it.
12145
12146         * expression.cs (Conditional.DoResolve): Remove some old code that
12147         is no longer needed, conversions have been fixed.
12148
12149         (ArrayCreationExpression.DoResolve): Return false if we fail to
12150         resolve the inner expression.
12151
12152 2004-09-07  Raja R Harinath  <rharinath@novell.com>
12153
12154         Fix test-290.cs.
12155         * cs-parser.jay (delegate_declaration): Record a delegate
12156         declaration as a type declaration.
12157         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
12158
12159 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
12160
12161         * parameter.cs: Do not crash if the type can not be resolved. 
12162
12163         * expression.cs: Report errors with unsafe pointers, fixes #64896
12164
12165 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
12166
12167         * expression.cs: Pointer arith always needs to do a conv.i
12168         if the operand is a long. fix 65320
12169
12170 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12171
12172         Fixed cs0619-37.cs, cs0619-38.cs
12173
12174         * enum.cs (GetObsoleteAttribute): Removed.
12175
12176         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
12177         on Enum member is double staged. The first is tested member
12178         and then enum.
12179
12180 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
12181
12182         Fixed #56986, #63631, #65231
12183
12184         * class.cs: (TypeContainer.AddToMemberContainer): New method,
12185         adds member to name container.
12186         (TypeContainer.AddToTypeContainer): New method, adds type to
12187         name container.
12188         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
12189         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
12190         AddOperator): Simplified by reusing AddToMemberContainer.
12191         (TypeContainer.UserDefinedStaticConstructor): Changed to property
12192         instead of field.
12193         (Method.CheckForDuplications): Fixed implementation to test all
12194         possibilities.
12195         (MemberBase): Detection whether member is explicit interface
12196         implementation is now in constructor.
12197         (MemberBase.UpdateMemberName): Handles IndexerName.
12198         (Accessor): Changed to keep also location information.
12199         (AbstractPropertyEventMethod): Is derived from MemberCore.
12200         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
12201         will be emited or not.
12202         (PropertyBase.AreAccessorsDuplicateImplementation):
12203         Tests whether accessors are not in collision with some method.
12204         (Operator): Is derived from MethodCore to simplify common
12205         operations.
12206
12207         * decl.cs (Flags.TestMethodDuplication): Test for duplication
12208         must be performed.
12209         (DeclSpace.AddToContainer): Adds the member to defined_names
12210         table. It tests for duplications and enclosing name conflicts.
12211
12212         * enum.cs (EnumMember): Clean up to reuse the base structures
12213
12214 2004-09-03  Martin Baulig  <martin@ximian.com>
12215
12216         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
12217         into TypeContainer, to make partial classes work again.
12218
12219 2004-09-03  Martin Baulig  <martin@ximian.com>
12220
12221         * rootcontext.cs (RootContext.V2): Removed.
12222
12223 2004-03-23  Martin Baulig  <martin@ximian.com>
12224
12225         * expression.cs (Invocation.OverloadResolve): Added `bool
12226         may_fail' argument and use it instead of the Location.IsNull() hack.
12227
12228 2004-09-03  Martin Baulig  <martin@ximian.com>
12229
12230         Merged latest changes into gmcs.  Please keep this comment in
12231         here, it makes it easier for me to see what changed in MCS since
12232         the last time I merged.
12233
12234 2004-09-03  Raja R Harinath  <rharinath@novell.com>
12235
12236         Fix #61128.
12237         * expression.cs (BetterConversion): Don't allow either conversion 
12238         to be null.  Remove redundant implicit conversion test when 'q ==
12239         null' -- when this function is invoked, we already know that the
12240         implicit conversion exists.
12241         (BetterFunction): Assume that 'best' is non-null.  Remove
12242         redundant reimplementation of IsApplicable when 'best' is null.
12243         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
12244         number of arguments.
12245         (IsAncestralType): Extract from OverloadResolve.
12246         (OverloadResolve): Make robust to the MethodGroupExpr being
12247         unsorted.  Implement all the logic of Section 14.5.5.1, and
12248         support overloading of methods from multiple applicable types.
12249         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
12250
12251         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
12252         (RealError, Warning): Append type of report to related symbol.
12253
12254 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
12255
12256         * enum.cs: Fixed CLS-Compliance checks for enum members.
12257         Error tests cs3008-8.cs, cs3014-8.cs
12258
12259 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12260
12261         Fixed bug #62342, #63102
12262         * class.cs: ImplementIndexer uses member.IsExplicitImpl
12263         like ImplementMethod.
12264
12265 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
12266
12267         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12268         Fixed bug #65170.
12269
12270 2004-09-02  Martin Baulig  <martin@ximian.com>
12271
12272         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
12273         TypeManager.GetArgumentTypes() rather than calling GetParameters()
12274         on the MethodBase.
12275
12276 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
12277
12278         C# 2.0 Static classes implemented
12279
12280         * class.cs (TypeContainer): instance_constructors,
12281         initialized_fields, initialized_static_fields,
12282         default_constructor, base_inteface_types are protected to be
12283         accessible from StaticClass.
12284         (TypeContainer.DefineDefaultConstructor): New virtual method
12285         for custom default constructor generating
12286         (StaticClass): New class to handle "Static classes" feature.
12287
12288         * cs-parser.jay: Handle static keyword on class like instance
12289         of StaticClass.
12290
12291         * driver.cs: Added "/langversion" command line switch with two
12292         options (iso-1, default).
12293
12294 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
12295
12296         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
12297
12298 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
12299
12300         * delegate.cs: Style.
12301
12302 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12303
12304         * delegate.cs: Add seperate instance expr field for miguel.
12305
12306 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12307
12308         * PointerArithmetic (Resolve): make sure we are not doing
12309         pointer arith on void*. Also, make sure we are resolved
12310         by not setting eclass until resolve.
12311
12312         All callers: Make sure that PointerArithmetic gets resolved.
12313
12314 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
12315
12316         * ArrayCreation (LookupType): If the type does not resolve 
12317         to an array, give an error.
12318
12319 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
12320
12321         * statement.cs (Try.Resolve): Fixed bug #64222
12322
12323 2004-08-27  Martin Baulig  <martin@ximian.com>
12324
12325         * class.cs
12326         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
12327         crash here.     
12328
12329 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12330
12331         * ecore.cs (Constantify): Get underlying type via
12332         System.Enum.GetUnderlyingType to avoid StackOverflow on the
12333         Windows in special cases.
12334
12335 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
12336
12337         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
12338         for obtaining also private methods.
12339         (GetRemoveMethod): Used GetRemoveMethod (true)
12340         for obtaining also private methods.
12341
12342 2004-08-24  Martin Baulig  <martin@ximian.com>
12343
12344         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
12345         MethodAttributes.HideBySig for operators.
12346
12347 2004-08-23  Martin Baulig  <martin@ximian.com>
12348
12349         Back to the old error reporting system :-)
12350
12351         * report.cs (Message): Removed.
12352         (Report.MessageData, ErrorData, WarningData): Removed.
12353         (Report.Error, Warning): Back to the old system.
12354
12355 2004-08-23  Martin Baulig  <martin@ximian.com>
12356
12357         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
12358
12359         * class.cs (TypeContainer.ParentContainer): New public virtual
12360         method; replaces the explicit interface implementation.
12361         (ClassPart.ParentContainer): Override.
12362
12363 2004-08-23  Martin Baulig  <martin@ximian.com>
12364
12365         * statement.cs (Switch): Added support for constant switches; see
12366         #59428 or test-285.cs.
12367
12368 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12369
12370         Fixed bug #62740.
12371         * statement.cs (GetEnumeratorFilter): Removed useless
12372         logic because C# specs is strict. GetEnumerator must be
12373         public.
12374
12375 2004-08-22  Martin Baulig  <martin@ximian.com>
12376
12377         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
12378         a switch and may break, reset the barrier.  Fixes #59867.
12379
12380 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
12381
12382         CLS-Compliance speed up (~5% for corlib)
12383
12384         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
12385         New method. Tests container for CLS-Compliant names
12386
12387         * class.cs (TypeContainer.VerifyClsName): New method.
12388         Checks whether container name is CLS Compliant.
12389         (Constructor): Implements IMethodData.
12390
12391         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
12392         low-case table for CLS Compliance test.
12393         (MemberCache.VerifyClsParameterConflict): New method.
12394         Checks method parameters for CS3006 error.
12395
12396         * enum.cs (EnumMember): Is derived from MemberCore.
12397         (Enum.VerifyClsName): Optimized for better performance.
12398
12399 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12400
12401         * report.cs: Renamed Error_T to Error and changed all
12402         references.
12403
12404 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
12405
12406         * class.cs (TypeContainer.IndexerArrayList): New inner class
12407         container for indexers.
12408         (TypeContainer.DefaultIndexerName): New constant for default
12409         indexer name. Replaced all "Item" with this constant.
12410         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
12411
12412         * typemanager.cs (TypeManager.default_member_ctor): Cache here
12413         DefaultMemberAttribute constructor.
12414
12415 2004-08-05  Martin Baulig  <martin@ximian.com>
12416
12417         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
12418         Fix bug #59429.
12419
12420 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
12421
12422         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
12423         multi platforms problem.
12424
12425         * compiler.csproj: Included shared files.
12426
12427 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12428
12429         Fix bug 60333, 55971 in the more general way
12430         * attribute.cs (Attribute.GetAttributeArgumentExpression):
12431         Added arg_type argument for constant conversion.
12432         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
12433
12434 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12435
12436         Fix bug #59760
12437         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
12438         OperatorArrayList, MethodCoreArrayList for typecontainer
12439         containers. Changed class member types to these new types.
12440         (MethodArrayList.DefineMembers): Added test for CS0659.
12441
12442 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
12443
12444         * cfold.cs: Synchronize the folding with the code in expression.cs
12445         Binary.DoNumericPromotions for uint operands.
12446
12447         * attribute.cs: Revert patch from Raja, it introduced a regression
12448         while building Blam-1.2.1 (hard to isolate a test case).
12449
12450 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
12451
12452         Fix for #55382
12453         * class.cs:
12454         (TypeContainer.Define): Renamed to DefineContainerMembers because of
12455         name collision.
12456         (MethodCore.parent_method): New member. The method we're overriding
12457         if this is an override method.
12458         (MethodCore.CheckBase): Moved from Method class and made common.
12459         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
12460         private.
12461         (MethodCore.CheckForDuplications): New abstract method. For custom
12462         member duplication search in a container
12463         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
12464         method and its return type.
12465         (Event.conflict_symbol): New member. Symbol with same name in the
12466         parent class.
12467
12468         * decl.cs:
12469         (MemberCache.FindMemberWithSameName): New method. The method
12470         is looking for conflict with inherited symbols.
12471
12472 2004-08-04  Martin Baulig  <martin@ximian.com>
12473
12474         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
12475
12476         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
12477
12478 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12479
12480         * report.cs (Message): New enum for better error, warning reference in
12481         the code.
12482         (MessageData): New inner abstract class. It generally handles printing of
12483         error and warning messages.
12484         Removed unused Error, Warning, Message methods.
12485
12486 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12487
12488         Fix for cs0592-8.cs test
12489         * attribute.cs
12490         (Attributable.ValidAttributeTargets): Made public.
12491         (Attribute.ExplicitTarget): New member for explicit target value.
12492         (Attribute.CheckTargets): Now we translate explicit attribute
12493         target to Target here.
12494
12495 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
12496
12497         * ecore.cs (MethodGroupExpr): new IsBase property.
12498
12499         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
12500
12501         * delegate.cs (DelegateCreation): store a MethodGroupExpr
12502         rather than an instance expr.
12503
12504         (DelegateCreation.Emit): Use the method group rather than
12505         the instance expression. Also, if you have base.Foo as the
12506         method for a delegate, make sure to emit ldftn, not ldftnvirt.
12507
12508         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
12509
12510         (NewDelegate.DoResolve): Only check for the existance of Invoke
12511         if the method is going to be needed. Use MethodGroupExpr.
12512
12513         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
12514
12515         * expression.cs: For pointer arith., make sure to use
12516         the size of the type, not the size of the pointer to
12517         the type.
12518
12519 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
12520
12521         Fix for #60722
12522         * class.cs (Class): Added error CS0502 test.
12523
12524 2004-08-03  John Luke  <jluke@cfl.rr.com>
12525             Raja R Harinath  <rharinath@novell.com>
12526
12527         Fix for #60997.
12528         * attribute.cs (Attribute.complained_before): New flag.
12529         (Attribute.ResolveType, Attribute.Resolve),
12530         (Attribute.DefinePInvokeMethod): Set it.
12531         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
12532         
12533 2004-08-03  Martin Baulig  <martin@ximian.com>
12534
12535         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
12536         use a user-defined operator; we still need to do numeric
12537         promotions in case one argument is a builtin type and the other
12538         one has an implicit conversion to that type.  Fixes #62322.
12539
12540 2004-08-02  Martin Baulig  <martin@ximian.com>
12541
12542         * statement.cs (LocalInfo.Flags): Added `IsThis'.
12543         (LocalInfo.IsThis): New public property.
12544         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
12545
12546 2004-08-01  Martin Baulig  <martin@ximian.com>
12547
12548         * class.cs (TypeContainer.GetClassBases): Don't set the default
12549         here since we may get called from GetPartialBases().
12550         (TypeContainer.DefineType): If GetClassBases() didn't return a
12551         parent, use the default one.
12552
12553 2004-07-30  Duncan Mak  <duncan@ximian.com>
12554
12555         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
12556
12557 2004-07-30  Martin Baulig  <martin@ximian.com>
12558
12559         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
12560
12561         * class.cs (SourceMethod): New public class, derive from the
12562         symbol writer's ISourceMethod.
12563         (Method): Use the new symbol writer API.
12564
12565         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
12566         as argument and use the new symbol writer.
12567
12568         * location.cs
12569         (SourceFile): Implement the symbol writer's ISourceFile.
12570         (Location.SymbolDocument): Removed.
12571         (Location.SourceFile): New public property.
12572
12573         * symbolwriter.cs: Use the new symbol writer API.
12574
12575 2004-07-30  Raja R Harinath  <rharinath@novell.com>
12576
12577         * Makefile (install-local): Remove.  Functionality moved to
12578         executable.make.
12579
12580 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
12581
12582         * Makefile: Install mcs.exe.config file together with mcs.exe.
12583         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
12584         correct runtime version.
12585         
12586 2004-07-25  Martin Baulig  <martin@ximian.com>
12587
12588         * class.cs
12589         (TypeContainer.RegisterOrder): Removed, this was unused.
12590         (TypeContainer, interface_order): Removed.
12591         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
12592         TypeContainer as argument since we can also be called with a
12593         `PartialContainer' for a partial class/struct/interface.
12594         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
12595         of checking whether we're an `Interface' - we could be a
12596         `PartialContainer'.
12597         (PartialContainer.Register): Override; call
12598         AddClass()/AddStruct()/AddInterface() on our parent.
12599
12600         * cs-parser.jay (interface_member_declaration): Add things to the
12601         `current_container', not the `current_class'.
12602
12603         * rootcontext.cs (RegisterOrder): The overloaded version which
12604         takes an `Interface' was unused, removed.
12605
12606         * typemanager.cs (TypeManager.LookupInterface): Return a
12607         `TypeContainer', not an `Interface'.
12608         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
12609         contain a `PartialContainer' for an interface, so check it's
12610         `Kind' to figure out what it is.
12611
12612 2004-07-25  Martin Baulig  <martin@ximian.com>
12613
12614         * class.cs (Class.DefaultTypeAttributes): New public constant.
12615         (Struct.DefaultTypeAttributes): Likewise.
12616         (Interface.DefaultTypeAttributes): Likewise.
12617         (PartialContainer.TypeAttr): Override this and add the
12618         DefaultTypeAttributes.
12619
12620 2004-07-25  Martin Baulig  <martin@ximian.com>
12621
12622         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
12623         we can just use the `Parent' field instead.
12624
12625 2004-07-25  Martin Baulig  <martin@ximian.com>
12626
12627         * class.cs (TypeContainer.Emit): Renamed to EmitType().
12628
12629 2004-07-25  Martin Baulig  <martin@ximian.com>
12630
12631         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
12632         our parts before defining any methods.
12633         (TypeContainer.VerifyImplements): Make this virtual.
12634         (ClassPart.VerifyImplements): Override and call VerifyImplements()
12635         on our PartialContainer.
12636
12637 2004-07-25  Martin Baulig  <martin@ximian.com>
12638
12639         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
12640
12641         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
12642         argument, we can just use the `Parent' field instead.
12643
12644         * class.cs
12645         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
12646         (MemberBase.DoDefine): Likewise.
12647
12648 2004-07-24  Martin Baulig  <martin@ximian.com>
12649
12650         * decl.cs (MemberCore.Parent): New public field.
12651         (DeclSpace.Parent): Moved to MemberCore.
12652
12653         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
12654         (MemberBase.ctor): Added TypeContainer argument, pass it to our
12655         parent's .ctor.
12656         (FieldBase, Field, Operator): Likewise.
12657         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
12658         (EventField, Event): Likewise.
12659
12660 2004-07-23  Martin Baulig  <martin@ximian.com>
12661
12662         * class.cs (PartialContainer): New public class.
12663         (ClassPart): New public class.
12664         (TypeContainer): Added support for partial classes.
12665         (TypeContainer.GetClassBases): Splitted some of the functionality
12666         out into GetNormalBases() and GetPartialBases().
12667
12668         * cs-tokenizer.cs (Token.PARTIAL): New token.
12669         (Tokenizer.consume_identifier): Added some hacks to recognize
12670         `partial', but only if it's immediately followed by `class',
12671         `struct' or `interface'.
12672
12673         * cs-parser.jay: Added support for partial clases.
12674
12675 2004-07-23  Martin Baulig  <martin@ximian.com>
12676
12677         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
12678         a `DeclSpace' and also made it readonly.
12679         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
12680         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
12681         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
12682
12683         * cs-parser.jay: Pass the `current_class', not the
12684         `current_container' (at the moment, this is still the same thing)
12685         to a new Method, Property, Event, Indexer or Constructor.
12686
12687 2004-07-23  Martin Baulig  <martin@ximian.com>
12688
12689         * cs-parser.jay (CSharpParser): Added a new `current_class' field
12690         and removed the `current_interface' one.
12691         (struct_declaration, class_declaration, interface_declaration):
12692         Set `current_class' to the newly created class/struct/interface;
12693         set their `Bases' and call Register() before parsing their body.
12694
12695 2004-07-23  Martin Baulig  <martin@ximian.com>
12696
12697         * class.cs (Kind): New public enum.
12698         (TypeContainer): Made this class abstract.
12699         (TypeContainer.Kind): New public readonly field.
12700         (TypeContainer.CheckDef): New public method; moved here from
12701         cs-parser.jay.
12702         (TypeContainer.Register): New public abstract method.
12703         (TypeContainer.GetPendingImplementations): New public abstract
12704         method.
12705         (TypeContainer.GetClassBases): Removed the `is_class' and
12706         `is_iface' parameters.
12707         (TypeContainer.DefineNestedTypes): Formerly known as
12708         DoDefineType().
12709         (ClassOrStruct): Made this class abstract.
12710
12711         * tree.cs (RootTypes): New public type. 
12712
12713 2004-07-20  Martin Baulig  <martin@ximian.com>
12714
12715         * tree.cs (Tree.RecordNamespace): Removed.
12716         (Tree.Namespaces): Removed.
12717
12718         * rootcontext.cs (RootContext.IsNamespace): Removed.
12719
12720         * cs-parser.jay (namespace_declaration): Just create a new
12721         NamespaceEntry here.
12722
12723 2004-07-20  Martin Baulig  <martin@ximian.com>
12724
12725         * statement.cs (ExceptionStatement): New abstract class.  This is
12726         now used as a base class for everyone who's using `finally'.
12727         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
12728         our local variables before using them.
12729
12730         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
12731         virtual method.  This is used by Yield.Resolve() to "steal" an
12732         outer block's `finally' clauses.
12733         (FlowBranchingException): The .ctor now takes an ExceptionStatement
12734         argument.
12735
12736         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
12737         version which takes an ExceptionStatement.  This version must be
12738         used to create exception branchings.
12739
12740         * iterator.cs
12741         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
12742         (Iterator.EmitMoveNext): Added exception support; protect the
12743         block with a `fault' clause, properly handle 'finally' clauses.
12744         (Iterator.EmitDispose): Run all the `finally' clauses here.
12745
12746 2004-07-20  Martin Baulig  <martin@ximian.com>
12747
12748         * iterator.cs: This is the first of a set of changes in the
12749         iterator code.  Match the spec more closely: if we're an
12750         IEnumerable, then GetEnumerator() must be called.  The first time
12751         GetEnumerator() is called, it returns the current instance; all
12752         subsequent invocations (if any) must create a copy.
12753
12754 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
12755
12756         * expression.cs: Resolve the constant expression before returning
12757         it. 
12758
12759 2004-07-19  Martin Baulig  <martin@ximian.com>
12760
12761         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
12762         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
12763         the return type of the new EmitContext.
12764
12765 2004-07-18  Martin Baulig  <martin@ximian.com>
12766
12767         * class.cs (Property.Define): Fix iterators.
12768
12769         * iterators.cs (Iterator.Define): Moved the
12770         `container.AddInterator (this)' call here from the .ctor; only do
12771         it if we resolved successfully.
12772
12773 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
12774
12775         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
12776         `true' for preprocessing directives that we parse.  The return
12777         value indicates whether we should return to regular tokenizing or
12778         not, not whether it was parsed successfully.
12779
12780         In the past if we were in: #if false ... #line #endif, we would
12781         resume parsing after `#line'.  See bug 61604.
12782
12783         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
12784         building: IsEnumType should return true only for enums, not for
12785         enums or System.Enum itself.  This fixes #61593.
12786
12787         Likely what happened is that corlib was wrong: mcs depended on
12788         this bug in some places.  The bug got fixed, we had to add the
12789         hack, which caused bug 61593.
12790
12791         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
12792         that was a workaround for the older conditions.
12793
12794 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
12795
12796         * assign.cs: IAssignMethod has a new interface, as documented
12797         inline. All assignment code now uses this new api.
12798
12799         * ecore.cs, expression.cs: All classes which implement
12800         IAssignMethod now use the new interface.
12801
12802         * expression.cs (Invocation): add a hack to EmitCall so that
12803         IndexerAccess can be the target of a compound assignment without
12804         evaluating its arguments twice.
12805
12806         * statement.cs: Handle changes in Invocation api.
12807
12808 2004-07-16  Martin Baulig  <martin@ximian.com>
12809
12810         * iterators.cs: Rewrote this.  We're now using one single Proxy
12811         class for both the IEnumerable and the IEnumerator interface and
12812         `Iterator' derives from Class so we can use the high-level API.
12813
12814         * class.cs (TypeContainer.AddIterator): New method.
12815         (TypeContainer.DoDefineType): New protected virtual method, which
12816         is called from DefineType().
12817         (TypeContainer.DoDefineMembers): Call DefineType() and
12818         DefineMembers() on all our iterators.
12819         (TypeContainer.Emit): Call Emit() on all our iterators.
12820         (TypeContainer.CloseType): Call CloseType() on all our iterators.
12821
12822         * codegen.cs (EmitContext.CurrentIterator): New public field.
12823
12824 2004-07-15  Martin Baulig  <martin@ximian.com>
12825
12826         * typemanager.cs
12827         (TypeManager.not_supported_exception_type): New type.   
12828
12829 2004-07-14  Martin Baulig  <martin@ximian.com>
12830
12831         * iterators.cs: Use real error numbers.
12832
12833 2004-07-14  Martin Baulig  <martin@ximian.com>
12834
12835         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
12836         requires this to be a System.Collection.IEnumerable and not a
12837         class implementing that interface.
12838         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
12839
12840 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
12841
12842         * class.cs: Fixed previous fix, it broke some error tests.
12843
12844 2004-07-12  Martin Baulig  <martin@ximian.com>
12845
12846         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
12847         Fixes #61293.
12848
12849 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
12850
12851         * assign.cs (LocalTemporary): Add new argument: is_address,If
12852         `is_address' is true, then the value that we store is the address
12853         to the real value, and not the value itself.
12854         
12855         * ecore.cs (PropertyExpr): use the new local temporary
12856         stuff to allow us to handle X.Y += z (where X is a struct)
12857
12858 2004-07-08  Martin Baulig  <martin@ximian.com>
12859
12860         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
12861         not always return, just like we're doing in Using.Resolve().
12862
12863 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
12864
12865         * cs-parser.jay (fixed_statement): flag this as Pinned.
12866
12867 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
12868
12869         * typemanager.cs (TypeManager): Removed MakePinned method, this
12870         mechanism is replaced with the .NET 2.x compatible mechanism of
12871         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
12872
12873         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
12874         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
12875         `IsFixed' property which has a different meaning.
12876
12877 2004-07-02  Raja R Harinath  <rharinath@novell.com>
12878
12879         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
12880         visible from inside a nested class, not just the names of the
12881         immediately enclosing class.
12882         Fix for bug #60730.
12883
12884 2004-06-24  Raja R Harinath  <rharinath@novell.com>
12885
12886         * expression.cs (BetterConversion): Remove buggy special-case
12887         handling of "implicit constant expression conversions".  At this
12888         point, we already know that the conversion is possible -- we're
12889         only checking to see which is better.
12890
12891 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12892
12893         * cs-parser.jay: Added error CS0210 test.
12894
12895 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12896
12897         * cs-parser.jay: Added error CS0134 test.
12898
12899 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12900
12901         Fix bug #52507
12902         * cs-parser.jay: Added error CS0145 test.
12903
12904 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
12905
12906         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
12907
12908 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
12909         
12910         * expression.cs (StackAlloc.Resolve): The argument may not
12911         be a constant; deal with this case.
12912         
12913 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
12914
12915         * attribute.cs (IndexerName_GetIndexerName): Renamed to
12916         GetIndexerAttributeValue.
12917         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
12918
12919         * class.cs (Indexer.Define): Added error tests for CS0415,
12920         CS0609.
12921
12922 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
12923
12924         * attribute.cs (Attribute.Resolve): Keep field code in sync with
12925         property code.
12926
12927 2004-06-23  Martin Baulig  <martin@ximian.com>
12928
12929         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
12930         neither return nor throw, reset the barrier as well.  Fixes #60457.
12931
12932 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
12933
12934         * class.cs : EventAttributes is now set to None by default.
12935           This fixes bug #60459.
12936
12937 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12938
12939         Fix bug #60219
12940         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
12941         Don't throw exception but return null (it's sufficient now).
12942
12943 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
12944
12945         * typemanager.cs (GetArgumentTypes): Faster implementation.
12946
12947 2004-06-18  Martin Baulig  <martin@ximian.com>
12948
12949         * attribute.cs (Attribute.Resolve): Check whether we're an
12950         EmptyCast which a Constant child.  Fixes #60333.
12951
12952 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
12953
12954         * statement.cs (EmitCollectionForeach): Account for the fact that
12955         not all valuetypes are in areas which we can take the address of.
12956         For these variables, we store to a temporary variable. Also, make
12957         sure that we dont emit a `callvirt' on a valuetype method.
12958
12959 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12960
12961         * expression.cs (StackAlloc.DoReSolve): Added test for
12962         negative parameter (CS0247).
12963
12964 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12965
12966         Fix bug #59792
12967         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
12968
12969 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
12970
12971         Fix bug #59781
12972         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
12973         ulong.
12974
12975 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12976
12977         Fix bug #58254 & cs1555.cs, cs1556.cs
12978         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
12979
12980 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
12981
12982         * cs-parser.jay: Added error CS1669 test for indexers.
12983
12984 2004-06-11  Martin Baulig  <martin@ximian.com>
12985
12986         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
12987         call this twice: for params and varargs methods.
12988
12989 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12990
12991         * class.cs:
12992         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
12993
12994 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
12995
12996         * attribute.cs (Attribute.GetValidTargets): Made public.
12997
12998         * class.cs: 
12999         (AbstractPropertyEventMethod): New class for better code sharing.
13000         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
13001         CS1667 report.
13002         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
13003
13004 2004-06-11  Raja R Harinath  <rharinath@novell.com>
13005
13006         Fix bug #59477.
13007         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
13008         that the call to Resolve is part of a MemberAccess.
13009         (Expression.Resolve): Use it for SimpleName resolution.
13010         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
13011         Add 'intermediate' boolean argument.
13012         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
13013         error message when the SimpleName can be resolved ambiguously
13014         between an expression and a type.
13015         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
13016         public.
13017         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
13018         call on the left-side.
13019
13020 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13021
13022         * class.cs:
13023         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
13024
13025 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13026
13027         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
13028
13029 2004-06-11  Martin Baulig  <martin@ximian.com>
13030
13031         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
13032         varargs methods if applicable.
13033
13034 2004-06-11  Martin Baulig  <martin@ximian.com>
13035
13036         * expression.cs (Invocation.EmitCall): Don't use
13037         `method.CallingConvention == CallingConventions.VarArgs' since the
13038         method could also have `CallingConventions.HasThis'.
13039
13040 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13041
13042         * class.cs (Event.GetSignatureForError): Implemented.
13043         Fixed crash in error test cs3010.cs
13044
13045 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
13046
13047         * cs-tokenizer.cs: Change the way we track __arglist to be
13048         consistent with the other keywords.
13049
13050 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
13051
13052         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
13053         tomorrow.
13054
13055 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
13056
13057         * codegen.cs: Check that all referenced assemblies have a strongname
13058         before strongnaming the compiled assembly. If not report error CS1577.
13059         Fix bug #56563. Patch by Jackson Harper.
13060         * typemanager.cs: Added a method to return all referenced assemblies.
13061         Fix bug #56563. Patch by Jackson Harper.
13062
13063 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
13064
13065         * class.cs:
13066         (Method.ApplyAttributeBuilder): Moved and added conditional
13067         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
13068
13069         * delegate.cs:
13070         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
13071
13072 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
13073
13074         Fixed #59640
13075         * class.cs: (EventField.attribute_targets): Changed default target.
13076
13077 2004-06-08  Martin Baulig  <martin@ximian.com>
13078
13079         * expression.cs (Invocation.EmitCall): Enable varargs methods.
13080
13081 2004-06-08  Martin Baulig  <martin@ximian.com>
13082
13083         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
13084
13085 2004-06-07  Martin Baulig  <martin@ximian.com>
13086
13087         Added support for varargs methods.
13088
13089         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
13090         keyword.
13091
13092         * cs-parser.jay: Added support for `__arglist'.
13093
13094         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
13095
13096         * expression.cs (Argument.AType): Added `ArgList'.
13097         (Invocation): Added support for varargs methods.
13098         (ArglistAccess): New public class.
13099         (Arglist): New public class.
13100
13101         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
13102
13103         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
13104         a method's top-level block if the method has varargs.
13105
13106         * support.cs (ReflectionParameters, InternalParameters): Added
13107         support for varargs methods.    
13108
13109 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
13110
13111         * class.cs: Provide location in indexer error report.
13112
13113         * driver.cs: Use standard names.
13114
13115         * namespace.cs: Catch the use of using after a namespace has been
13116         declared also on using aliases.
13117
13118 2004-06-03  Raja R Harinath  <rharinath@novell.com>
13119
13120         Bug #50820.
13121         * typemanager.cs (closure_private_ok, closure_invocation_type)
13122         (closure_qualifier_type, closure_invocation_assembly)
13123         (FilterWithClosure): Move to ...
13124         (Closure): New internal nested class.
13125         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
13126         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
13127         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
13128         (MemberLookup, MemberLookupFailed): Use it.
13129         * expression.cs (New.DoResolve): Treat the lookup for the
13130         constructor as being qualified by the 'new'ed type.
13131         (Indexers.GetIndexersForTypeOrInterface): Update.
13132
13133 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
13134
13135         * attribute.cs
13136         (GetConditionalAttributeValue): New method. Returns
13137         condition of ConditionalAttribute.
13138         (SearchMulti): New method.  Returns all attributes of type 't'.
13139         Use it when attribute is AllowMultiple = true.
13140         (IsConditionalMethodExcluded): New method.
13141
13142         * class.cs
13143         (Method.IsExcluded): Implemented. Returns true if method has conditional
13144         attribute and the conditions is not defined (method is excluded).
13145         (IMethodData): Extended interface for ConditionalAttribute support.
13146         (PropertyMethod.IsExcluded): Implemented.
13147
13148         * decl.cs
13149         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
13150
13151         * expression.cs
13152         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
13153         on the method.
13154
13155 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13156
13157         * expression.cs (ArrayCreationExpression): Make this just an
13158         `expression'. It can't be a statement, so the code here was
13159         dead.
13160
13161 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13162
13163         Fixed #59072
13164         * typemanager.cs (GetFullNameSignature): New method for
13165         MethodBase types.
13166
13167 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
13168
13169         Fixed #56452
13170         * class.cs (MemberBase.GetSignatureForError): New virtual method.
13171         Use this method when MethodBuilder is null.
13172         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
13173         Added test for error CS0626 (MONO reports error for this situation).
13174         (IMethodData.GetSignatureForError): Extended interface.
13175
13176 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13177
13178         * attribute.cs
13179         (AttributeTester.GetObsoleteAttribute): Returns instance of
13180         ObsoleteAttribute when type is obsolete.
13181
13182         * class.cs
13183         (TypeContainer.VerifyObsoleteAttribute): Override.
13184         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
13185         (MethodCode.VerifyObsoleteAttribute): Override.
13186         (MemberBase.VerifyObsoleteAttribute): Override.
13187
13188         * decl.cs
13189         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
13190         and report proper error.
13191
13192         *delegate.cs
13193         Delegate.VerifyObsoleteAttribute): Override.
13194
13195         * ecore.cs
13196         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
13197         and report proper error.
13198         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
13199
13200         * enum.cs
13201         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
13202         and enum member.
13203
13204         * expression.cs
13205         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
13206         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
13207         Added test for ObsoleteAttribute.
13208
13209         * statement.cs
13210         (Catch): Derived from Statement.
13211
13212 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
13213  
13214         Fixed bug #59071 & cs0160.cs
13215  
13216         * statement.cs (Try.Resolve): Check here whether order of catch
13217         clauses matches their dependencies.
13218
13219 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
13220
13221         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
13222         caused a regression: #59343.  Referencing nested classes from an
13223         assembly stopped working.
13224
13225 2004-05-31  Martin Baulig  <martin@ximian.com>
13226
13227         MCS is now frozen for beta 2.
13228
13229 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13230
13231         * convert.cs: add a trivial cache for overload operator resolution.
13232
13233 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13234
13235         * decl.cs: If possible, use lookuptypedirect here. We can only do
13236         this if there is no `.' after the namespace. Avoids using
13237         LookupType, which does lots of slow processing.
13238         (FindNestedType) New method, does what it says :-).
13239         * namespace.cs: use LookupTypeDirect.
13240         * rootcontext.cs: use membercache, if possible.
13241         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
13242
13243 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13244
13245         * expression.cs:
13246         According to the spec, 
13247
13248         In a member access of the form E.I, if E is a single identifier,
13249         and if the meaning of E as a simple-name (§7.5.2) is a constant,
13250         field, property, localvariable, or parameter with the same type as
13251         the meaning of E as a type-name (§3.8), then both possible
13252         meanings of E are permitted.
13253
13254         We did not check that E as a simple-name had the same type as E as
13255         a type name.
13256
13257         This trivial check gives us 5-7% on bootstrap time.
13258
13259 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
13260
13261         * expression.cs (Invocation.OverloadResolve): Avoid the
13262         use of hashtables and boxing here by allocating on demand.
13263
13264 2004-05-30  Martin Baulig  <martin@ximian.com>
13265
13266         * rootcontext.cs (RootContext.LookupType): Don't cache things if
13267         we're doing a silent lookup.  Don't try to lookup nested types in
13268         TypeManager.object_type (thanks to Ben Maurer).
13269
13270 2004-05-30  Martin Baulig  <martin@ximian.com>
13271
13272         Committing a patch from Ben Maurer.
13273
13274         * rootcontext.cs (RootContext.LookupType): Cache negative results.
13275
13276 2004-05-29  Martin Baulig  <martin@ximian.com>
13277
13278         * class.cs (IMethodData.ShouldIgnore): New method.
13279
13280         * typemanager.cs (TypeManager.MethodFlags): Don't take a
13281         `Location' argument, we don't need it anywhere.  Use
13282         `IMethodData.ShouldIgnore ()' instead of
13283         `MethodData.GetMethodFlags ()'.
13284         (TypeManager.AddMethod): Removed.
13285         (TypeManager.AddMethod2): Renamed to AddMethod.
13286
13287 2004-05-29  Martin Baulig  <martin@ximian.com>
13288
13289         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
13290
13291         * convert.cs (Convert.ImplicitReferenceConversion): If we're
13292         converting from a class type S to an interface type and we already
13293         have an object on the stack, don't box it again.  Fixes #52578.
13294
13295 2004-05-29  Martin Baulig  <martin@ximian.com>
13296
13297         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13298         Added support for `params' parameters.  Fixes #59267.
13299
13300 2004-05-29  Martin Baulig  <martin@ximian.com>
13301
13302         * literal.cs (NullPointer): Provide a private .ctor which sets
13303         `type' to TypeManager.object_type.  Fixes #59048.
13304
13305 2004-05-29  Martin Baulig  <martin@ximian.com>
13306
13307         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
13308         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
13309
13310         * ecore.cs (EventExpr.instance_expr): Make the field private.
13311
13312 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
13313
13314         Fixed bug #50080 & cs0214-2.cs
13315         * expression.cs (Cast.DoResolve): Check unsafe context here.
13316         
13317         * statement.cs (Resolve.DoResolve): Likewise.
13318
13319 2004-05-26  Martin Baulig  <martin@ximian.com>
13320
13321         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
13322
13323         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
13324         (RootContext.LookupType): Pass down the `silent' flag.
13325
13326 2004-05-25  Martin Baulig  <martin@ximian.com>
13327
13328         * expression.cs
13329         (MethodGroupExpr.IdenticalTypeName): New public property.
13330         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
13331         expression actually refers to a type.
13332
13333 2004-05-25  Martin Baulig  <martin@ximian.com>
13334
13335         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
13336         for #56176 and made it actually work.
13337
13338 2004-05-25  Martin Baulig  <martin@ximian.com>
13339
13340         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
13341         (FieldExpr, PropertyExpr): Override and implement
13342         CacheTemporaries.  Fixes #52279.
13343
13344 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
13345
13346         * location.cs: In the new compiler listing a file twice is a
13347         warning, not an error.
13348
13349 2004-05-24  Martin Baulig  <martin@ximian.com>
13350
13351         * enum.cs (Enum.DefineType): For the `BaseType' to be a
13352         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
13353
13354 2004-05-24  Martin Baulig  <martin@ximian.com>
13355
13356         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
13357         walking the `using' list.  Fixes #53921.
13358
13359 2004-05-24  Martin Baulig  <martin@ximian.com>
13360
13361         * const.cs (Const.LookupConstantValue): Added support for
13362         EmptyCast's; fixes #55251.
13363
13364 2004-05-24  Martin Baulig  <martin@ximian.com>
13365
13366         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
13367         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
13368         which does the CS0135 check.  The reason is that we first need to
13369         check whether the variable actually exists.
13370
13371 2004-05-24  Martin Baulig  <martin@ximian.com>
13372
13373         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
13374         than RootContext.LookupType() to find the explicit interface
13375         type.  Fixes #58584.
13376
13377 2004-05-24  Raja R Harinath  <rharinath@novell.com>
13378
13379         * Makefile: Simplify.  Use executable.make.
13380         * mcs.exe.sources: New file.  List of sources of mcs.exe.
13381
13382 2004-05-24  Anders Carlsson  <andersca@gnome.org>
13383
13384         * decl.cs:
13385         * enum.cs:
13386         Use the invariant culture when doing String.Compare for CLS case
13387         sensitivity.
13388         
13389 2004-05-23  Martin Baulig  <martin@ximian.com>
13390
13391         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
13392         don't have any dots.  Fixes #52622, added cs0246-8.cs.
13393
13394         * namespace.cs (NamespaceEntry.Lookup): Likewise.
13395         
13396 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13397
13398         * class.cs (MemberBase.Define): Reuse MemberType member for 
13399         resolved type. Other methods can use it too.
13400
13401 2004-05-23  Martin Baulig  <martin@ximian.com>
13402
13403         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
13404         the variable also exists in the current block (otherwise, we need
13405         to report a CS0103).  Fixes #58670.
13406
13407 2004-05-23  Martin Baulig  <martin@ximian.com>
13408
13409         * flowanalysis.cs (Reachability.Reachable): Compute this
13410         on-the-fly rather than storing it as a field.
13411
13412 2004-05-23  Martin Baulig  <martin@ximian.com>
13413
13414         * flowanalysis.cs (Reachability.And): Manually compute the
13415         resulting `barrier' from the reachability.      
13416        
13417 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
13418
13419         Fix bug #57835
13420         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
13421         instance of ObsoleteAttribute when symbol is obsolete.
13422
13423         * class.cs
13424         (IMethodData): Extended interface for ObsoleteAttribute support.
13425
13426 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13427
13428         * attribute.cs: Fix bug #55970
13429
13430 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
13431
13432         Fix bug #52705
13433         * attribute.cs
13434         (GetObsoleteAttribute): New method. Creates the instance of
13435         ObsoleteAttribute.
13436         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
13437         ObsoleteAttribute when member is obsolete.
13438         (AttributeTester.Report_ObsoleteMessage): Common method for
13439         Obsolete error/warning reporting.
13440
13441         * class.cs
13442         (TypeContainer.base_classs_type): New member for storing parent type.
13443
13444         * decl.cs
13445         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
13446         for this MemberCore.
13447
13448 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13449
13450         * attribute.cs, const.cs: Fix bug #58590
13451
13452 2004-05-21  Martin Baulig  <martin@ximian.com>
13453
13454         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
13455         out parameters if the end of the method is unreachable.  Fixes
13456         #58098. 
13457
13458 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13459
13460         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
13461         Hari was right, why extra method.
13462
13463 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
13464
13465         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
13466
13467 2004-05-20  Martin Baulig  <martin@ximian.com>
13468
13469         Merged this back from gmcs to keep the differences to a minumum.
13470
13471         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
13472         instead of a Declspace.
13473         (Attribute.ResolveType): Likewise.
13474         (Attributes.Search): Likewise.
13475         (Attributes.Contains): Likewise.
13476         (Attributes.GetClsCompliantAttribute): Likewise.
13477
13478         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
13479         argument.
13480         (MethodData.ApplyAttributes): Take an EmitContext instead of a
13481         DeclSpace.
13482
13483 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
13484
13485         Fix bug #58688 (MCS does not report error when the same attribute
13486         is assigned twice)
13487
13488         * attribute.cs (Attribute.Emit): Distinction between null and default.
13489
13490 2004-05-19  Raja R Harinath  <rharinath@novell.com>
13491
13492         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
13493         of a top-level attribute without an attribute target.
13494         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
13495         Make non-static.
13496         (Attribute.Conditional_GetConditionName), 
13497         (Attribute.Obsolete_GetObsoleteMessage): Update.
13498         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
13499         part of ScanForIndexerName.
13500         (Attribute.CanIgnoreInvalidAttribute): New function.
13501         (Attribute.ScanForIndexerName): Move to ...
13502         (Attributes.ScanForIndexerName): ... here.
13503         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
13504         (Attributes.Search): New internal variant that can choose not to
13505         complain if types aren't resolved.  The original signature now
13506         complains.
13507         (Attributes.GetClsCompliantAttribute): Use internal variant, with
13508         complaints suppressed.
13509         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
13510         only if it not useful.
13511         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
13512         top-level for attributes that are shared between the assembly
13513         and a top-level class.
13514         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
13515         * class.cs: Update to reflect changes.
13516         (DefineIndexers): Fuse loops.
13517         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
13518         a couple more variants of attribute names.
13519
13520 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
13521
13522         Fix bug #52585 (Implemented explicit attribute declaration)
13523
13524         * attribute.cs:
13525         (Attributable.ValidAttributeTargets): New abstract method. It gets
13526         list of valid attribute targets for explicit target declaration.
13527         (Attribute.Target): It holds target itself.
13528         (AttributeSection): Removed.
13529         (Attribute.CheckTargets): New method. It checks whether attribute
13530         target is valid for the current element.
13531
13532         * class.cs:
13533         (EventProperty): New class. For events that are declared like
13534         property (with add and remove accessors).
13535         (EventField): New class. For events that are declared like field.
13536         class.cs
13537
13538         * cs-parser.jay: Implemented explicit attribute target declaration.
13539
13540         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
13541         Override ValidAttributeTargets.
13542
13543         * parameter.cs:
13544         (ReturnParameter): Class for applying custom attributes on 
13545         the return type.
13546         (ParameterAtribute): New class. Class for applying custom
13547         attributes on the parameter type.
13548
13549 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
13550
13551         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
13552         definitions. 
13553
13554         (Method): Allow UNSAFE here.
13555
13556         * modifiers.cs: Support unsafe reporting.
13557
13558 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
13559
13560         * decl.cs: Fix bug #58478.
13561
13562 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13563
13564         * statement.cs: When checking for unreachable code on an EmptyStatement,
13565         set the location. Fixes bug #58488.
13566
13567 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
13568
13569         * driver.cs: Add -pkg handling.
13570
13571         From Gonzalo: UseShelLExecute=false
13572
13573 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
13574
13575         * attribute.cs:
13576         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
13577         for attribute.
13578         (Attribute.IsClsCompliaceRequired): Moved to base for better
13579         accesibility.
13580         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
13581         when attribute is AttributeUsageAttribute.
13582         (Attribute.GetValidTargets): Simplified.
13583         (Attribute.GetAttributeUsage): New method returns AttributeUsage
13584         attribute for this type.
13585         (Attribute.ApplyAttributes): Method renamed to Emit and make
13586         non-static.
13587         (GlobalAttributeSection): New class for special handling of global
13588         attributes (assembly, module).
13589         (AttributeSection.Emit): New method.
13590
13591         * class.cs: Implemented Attributable abstract methods.
13592         (MethodCore.LabelParameters): Moved to Parameter class.
13593         (Accessor): Is back simple class.
13594         (PropertyMethod): Implemented Attributable abstract class.
13595         (DelegateMethod): Implemented Attributable abstract class.
13596         (Event): New constructor for disctintion between normal Event
13597         and Event with accessors.
13598
13599         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
13600
13601         * codegen.cs, const.cs, decl.cs, delegate.cs:
13602         (CommonAssemblyModulClass): Implemented Attributable abstract class
13603         and simplified.
13604
13605         * enum.cs: Implement IAttributeSupport interface.
13606         (EnumMember): New class for emum members. Implemented Attributable
13607         abstract class
13608
13609         * parameter.cs:
13610         (ParameterBase): Is abstract.
13611         (ReturnParameter): New class for easier [return:] attribute handling.
13612
13613         * typemanager.cs: Removed builder_to_attr.
13614
13615 2004-05-11  Raja R Harinath  <rharinath@novell.com>
13616
13617         Fix bug #57151.
13618         * attribute.cs (Attribute.GetPositionalValue): New function.
13619         * class.cs (TypeContainer.VerifyMembers): New function.
13620         (TypeContainer.Emit): Use it.
13621         (ClassOrStruct): New base class for Class and Struct.
13622         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
13623         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
13624         class.
13625         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
13626         then each non-static field should have a FieldOffset attribute.
13627         Otherwise, none of the fields should have a FieldOffset attribute.
13628         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
13629         and FieldOffset attributes.
13630         * typemanager.cs (TypeManager.struct_layout_attribute_type)
13631         (TypeManager.field_offset_attribute_type): New core types.
13632         (TypeManager.InitCoreTypes): Initialize them.
13633
13634 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
13635
13636         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
13637         Return correct type.
13638         From bug #58270.
13639
13640 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
13641
13642         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
13643         be implicitly converted to ulong.
13644         
13645         * expression.cs: The logic for allowing operator &, | and ^ worked
13646         was wrong, it worked before because we did not report an error in
13647         an else branch.  Fixes 57895.
13648
13649         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
13650         allow volatile fields to be reference types.
13651
13652 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
13653
13654         * driver.cs: Add support for /debug-
13655
13656 2004-05-07  Raja R Harinath  <rharinath@novell.com>
13657
13658         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
13659         Add a 'complain' parameter to silence errors.
13660         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
13661         silently overlooked type-resolutions.
13662         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
13663         to reflect changes.
13664         (Attributes.Search): New function.
13665         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
13666         (Attributes.GetAttributeFullName): Remove hack.
13667         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
13668         Update to reflect changes.
13669         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
13670         Use Attributes.Search instead of nested loops.
13671
13672 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
13673
13674         * decl.cs:
13675         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
13676         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
13677         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
13678
13679         * report.cs: (Report.Warning): Renamed to Warning_T because of
13680         parameter collision.
13681
13682 2004-05-05  Raja R Harinath  <rharinath@novell.com>
13683
13684         * expression.cs (MemberAccess.ResolveMemberAccess):
13685         Exit with non-zero status after Report.Error.
13686         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
13687         Likewise.
13688         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
13689
13690 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13691
13692         * support.cs: Don't hang when the file is empty.
13693
13694 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
13695
13696         * support.cs: In SeekableStreamReader, compute the preamble size of the
13697           underlying stream. Position changes should take into account that initial
13698           count of bytes.
13699
13700 2004-05-03  Todd Berman  <tberman@sevenl.net>
13701
13702         * driver.cs: remove unused GetSysVersion function.
13703
13704 2004-05-03  Todd Berman  <tberman@sevenl.net>
13705
13706         * driver.cs: Remove the hack from saturday, as well as the hack
13707         from jackson (LoadAssemblyFromGac), also adds the CWD to the
13708         link_paths to get that bit proper.
13709
13710 2004-05-01  Todd Berman  <tberman@sevenl.net>
13711
13712         * driver.cs: Try a LoadFrom before a Load, this checks the current
13713         path. This is currently a bug in mono that is be fixed, however, this
13714         provides a workaround for now. This will be removed when the bug
13715         is fixed.
13716
13717 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
13718
13719         * CryptoConvert.cs: Updated to latest version. Fix issue with 
13720         incomplete key pairs (#57941).
13721
13722 2004-05-01  Todd Berman  <tberman@sevenl.net>
13723
13724         * driver.cs: Remove '.' from path_chars, now System.* loads properly
13725         from the GAC
13726
13727 2004-04-30  Jackson Harper  <jackson@ximian.com>
13728
13729         * codegen.cs: Open keys readonly.
13730         
13731 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13732
13733         * typemanager.cs: don't report cyclic struct layout when a struct
13734         contains 2 or more fields of the same type. Failed for Pango.AttrShape
13735         which has 2 Pango.Rectangle fields.
13736
13737 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13738
13739         * expression.cs: Handle IntPtr comparisons with IL code
13740         rather than a method call.
13741
13742 2004-04-29  Martin Baulig  <martin@ximian.com>
13743
13744         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
13745         the list of PropertyInfo's in class hierarchy and find the
13746         accessor.  Fixes #56013.
13747
13748 2004-04-29  Martin Baulig  <martin@ximian.com>
13749
13750         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
13751
13752 2004-04-29  Martin Baulig  <martin@ximian.com>
13753
13754         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13755
13756         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
13757
13758 2004-04-29  Martin Baulig  <martin@ximian.com>
13759
13760         * class.cs (ConstructorInitializer.Resolve): Check whether the
13761         parent .ctor is accessible.  Fixes #52146.
13762
13763 2004-04-29  Martin Baulig  <martin@ximian.com>
13764
13765         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
13766
13767         * statement.cs (Using.EmitLocalVariableDecls): Use
13768         TypeManager.idisposable_type, not typeof (IDisposable).
13769         (Foreach.EmitCollectionForeach): Added support for valuetypes.
13770
13771 2004-04-29  Martin Baulig  <martin@ximian.com>
13772
13773         * class.cs (Event.Define): Don't emit the field and don't set
13774         RTSpecialName and SpecialName for events on interfaces.  Fixes
13775         #57703. 
13776
13777 2004-04-29  Raja R Harinath  <rharinath@novell.com>
13778
13779         Refactor Attribute.ApplyAttributes.
13780         * attribute.cs (Attributable): New base class for objects that can
13781         have Attributes applied on them.
13782         (Attribute): Make AttributeUsage fields public.
13783         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
13784         (Attribute.IsInternalCall): New property.
13785         (Attribute.UsageAttr): Convert to a public read-only property.
13786         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
13787         (Attribute.ResolveType, Attribute.Resolve)
13788         (Attribute.ScanForIndexerName): Update to reflect changes.
13789         (Attribute.CheckAttributeTarget): Re-format.
13790         (Attribute.ApplyAttributes): Refactor, to various
13791         Attributable.ApplyAttributeBuilder methods.
13792         * decl.cs (MemberCore): Make Attributable.
13793         * class.cs (Accessor): Make Attributable.
13794         (MethodData.ApplyAttributes): Use proper attribute types, not
13795         attribute names.
13796         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
13797         (TypeContainer.ApplyAttributeBuilder)
13798         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
13799         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
13800         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
13801         (Operator.ApplyAttributeBuilder): New factored-out methods.
13802         * const.cs (Const.ApplyAttributeBuilder): Likewise.
13803         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
13804         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
13805         * parameter.cs (ParameterBase): New Attributable base class
13806         that can also represent Return types.
13807         (Parameter): Update to the changes.
13808
13809 2004-04-29  Jackson Harper  <jackson@ximian.com>
13810
13811         * driver.cs: Prefer the corlib system version when looking for
13812         assemblies in the GAC. This is still a hack, but its a better hack
13813         now.
13814         
13815 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
13816
13817         * decl.cs, enum.cs: Improved error 3005 reporting.
13818   
13819         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
13820         (related_symbols): New private member for list of symbols
13821         related to reported error/warning.
13822         
13823         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
13824
13825 2004-04-29  Martin Baulig  <martin@ximian.com>
13826
13827         * ecore.cs (Expression.Constantify): If we're an enum and
13828         TypeManager.TypeToCoreType() doesn't give us another type, use
13829         t.UnderlyingSystemType.  Fixes #56178.  
13830
13831 2004-04-29  Martin Baulig  <martin@ximian.com>
13832
13833         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
13834         interfaces and for each interface, only add members directly
13835         declared in that interface.  Fixes #53255.
13836
13837 2004-04-28  Martin Baulig  <martin@ximian.com>
13838
13839         * expression.cs (ConditionalLogicalOperator): Use a temporary
13840         variable for `left' to avoid that we evaluate it more than once;
13841         bug #52588.
13842
13843 2004-04-28  Martin Baulig  <martin@ximian.com>
13844
13845         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
13846         `void[]' (CS1547).
13847
13848 2004-04-28  Martin Baulig  <martin@ximian.com>
13849
13850         * statement.cs (LocalInfo.Resolve): Check whether the type is not
13851         void (CS1547).
13852
13853         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
13854         whether the type is not void (CS1547).
13855
13856 2004-04-28  Martin Baulig  <martin@ximian.com>
13857
13858         * expression.cs (Unary.DoResolveLValue): Override this and report
13859         CS0131 for anything but Operator.Indirection.
13860
13861 2004-04-28  Martin Baulig  <martin@ximian.com>
13862
13863         Committing a patch from Ben Maurer; see bug #50820.
13864
13865         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13866         check for classes.
13867
13868         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13869         classes.        
13870
13871 2004-04-28  Martin Baulig  <martin@ximian.com>
13872
13873         Committing a patch from Ben Maurer; see bug #50820.
13874
13875         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
13876         check for classes.
13877
13878         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
13879         classes.        
13880
13881 2004-04-28  Martin Baulig  <martin@ximian.com>
13882
13883         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
13884         (Block.AddLabel): Call DoLookupLabel() to only search in the
13885         current block.
13886
13887 2004-04-28  Martin Baulig  <martin@ximian.com>
13888
13889         * cfold.cs (ConstantFold.BinaryFold): Added special support for
13890         comparing StringConstants and NullLiterals in Equality and Inequality.
13891
13892 2004-04-28  Jackson Harper  <jackson@ximian.com>
13893
13894         * driver.cs: Attempt to load referenced assemblies from the
13895         GAC. This is the quick and dirty version of this method that
13896         doesnt take into account versions and just takes the first
13897         canidate found. Will be good enough for now as we will not have more
13898         then one version installed into the GAC until I update this method.
13899
13900 2004-04-28  Martin Baulig  <martin@ximian.com>
13901
13902         * typemanager.cs (TypeManager.CheckStructCycles): New public
13903         static method to check for cycles in the struct layout.
13904
13905         * rootcontext.cs (RootContext.PopulateTypes): Call
13906         TypeManager.CheckStructCycles() for each TypeContainer.
13907         [Note: We only need to visit each type once.]
13908
13909 2004-04-28  Martin Baulig  <martin@ximian.com>
13910
13911         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
13912
13913         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
13914         success and added `out object value'.  Use a `bool resolved' field
13915         to check whether we've already been called rather than
13916         `ConstantValue != null' since this breaks for NullLiterals.
13917
13918 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13919
13920         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
13921         setting of this flag, since the 'set' method may be non-public.
13922
13923 2004-04-28  Raja R Harinath  <rharinath@novell.com>
13924
13925         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
13926         check on current_vector.Block.
13927
13928 2004-04-27  Martin Baulig  <martin@ximian.com>
13929
13930         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
13931         a field initializer.  Fixes #56459.
13932
13933 2004-04-27  Martin Baulig  <martin@ximian.com>
13934
13935         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
13936         we're not attempting to use an indexer.  Fixes #52154.
13937
13938 2004-04-27  Martin Baulig  <martin@ximian.com>
13939
13940         * statement.cs (Return): Don't create a return label if we don't
13941         need it; reverts my change from January 20th.  Thanks to Ben
13942         Maurer for this.
13943
13944 2004-04-27  Martin Baulig  <martin@ximian.com>
13945
13946         According to the spec, `goto' can only leave a nested scope, but
13947         never enter it.
13948
13949         * statement.cs (Block.LookupLabel): Only lookup in the current
13950         block, don't recurse into parent or child blocks.
13951         (Block.AddLabel): Check in parent and child blocks, report
13952         CS0140/CS0158 if we find a duplicate.
13953         (Block): Removed this indexer for label lookups.
13954         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
13955         this already does the error reporting for us.
13956
13957         * flowanalysis.cs
13958         (FlowBranching.UsageVector.Block): New public variable; may be null.
13959         (FlowBranching.CreateSibling): Added `Block' argument.
13960         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
13961         label for the target of a `goto' and check whether we're not
13962         leaving a `finally'.
13963
13964 2004-04-27  Martin Baulig  <martin@ximian.com>
13965
13966         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13967         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
13968         just for returns).
13969
13970 2004-04-27  Martin Baulig  <martin@ximian.com>
13971
13972         * statement.cs (Block.AddLabel): Also check for implicit blocks
13973         and added a CS0158 check.
13974
13975 2004-04-27  Martin Baulig  <martin@ximian.com>
13976
13977         * flowanalysis.cs (FlowBranchingLoop): New class.
13978         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
13979         UsageVector's instead of an ArrayList.
13980         (FlowBranching.Label): Likewise.
13981         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
13982         (FlowBranching.AddBreakVector): New method.
13983
13984 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
13985
13986         * attribute.cs: Small regression fix: only convert the type if we
13987         the type is different, fixes System.Drawing build.
13988
13989 2004-04-27  Martin Baulig  <martin@ximian.com>
13990
13991         * attribute.cs (Attribute.Resolve): If we have a constant value
13992         for a named field or property, implicity convert it to the correct
13993         type.
13994
13995 2004-04-27  Raja R Harinath  <rharinath@novell.com>
13996
13997         * statement.cs (Block.Block): Implicit blocks share
13998         'child_variable_names' fields with parent blocks.
13999         (Block.AddChildVariableNames): Remove.
14000         (Block.AddVariable): Mark variable as "used by a child block" in
14001         every surrounding block.
14002         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
14003         been used in a child block, complain about violation of "Invariant
14004         meaning in blocks" rule.
14005         * cs-parser.jay (declare_local_variables): Don't use
14006         AddChildVariableNames.
14007         (foreach_statement): Don't create an implicit block: 'foreach'
14008         introduces a scope.
14009
14010 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
14011
14012         * convert.cs (ImplicitNumericConversion): 0 is also positive when
14013         converting from 0L to ulong.  Fixes 57522.
14014
14015 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
14016
14017         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
14018         derived class hides via 'new' keyword field from base class (test-242.cs).
14019         TODO: Handle this in the more general way.
14020         
14021         * class.cs (CheckBase): Ditto.
14022
14023 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
14024
14025         * decl.cs (caching_flags): New member for storing cached values
14026         as bit flags.
14027         (MemberCore.Flags): New enum where bit flags for caching_flags
14028         are defined.
14029         (MemberCore.cls_compliance): Moved to caching_flags.
14030         (DeclSpace.Created): Moved to caching_flags.
14031
14032         * class.cs: Use caching_flags instead of DeclSpace.Created
14033         
14034 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
14037         if we are only a derived class, not a nested class.
14038
14039         * typemanager.cs: Same as above, but do this at the MemberLookup
14040         level (used by field and methods, properties are handled in
14041         PropertyExpr).   Allow for the qualified access if we are a nested
14042         method. 
14043
14044 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
14045
14046         * class.cs: Refactoring.
14047         (IMethodData): New inteface; Holds links to parent members
14048         to avoid member duplication (reduced memory allocation).
14049         (Method): Implemented IMethodData interface.
14050         (PropertyBase): New inner classes for get/set methods.
14051         (PropertyBase.PropertyMethod): Implemented IMethodData interface
14052         (Event): New inner classes for add/remove methods.
14053         (Event.DelegateMethod): Implemented IMethodData interface.
14054
14055         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
14056         EmitContext (related to class.cs refactoring).
14057
14058 2004-04-21  Raja R Harinath  <rharinath@novell.com>
14059
14060         * delegate.cs (Delegate.VerifyApplicability): If the number of
14061         arguments are the same as the number of parameters, first try to
14062         verify applicability ignoring  any 'params' modifier on the last
14063         parameter.
14064         Fixes #56442.
14065
14066 2004-04-16  Raja R Harinath  <rharinath@novell.com>
14067
14068         * class.cs (TypeContainer.AddIndexer): Use
14069         'ExplicitInterfaceName' to determine if interface name was
14070         explicitly specified.  'InterfaceType' is not initialized at this time.
14071         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
14072         Indexers array is already in the required order.  Initialize
14073         'IndexerName' only if there are normal indexers.
14074         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
14075         (TypeContainer.Emit): Emit DefaultMember attribute only if
14076         IndexerName is initialized.
14077         Fixes #56300.
14078
14079 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
14080
14081         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
14082         Fixes #57007
14083
14084 2004-04-15  Raja R Harinath  <rharinath@novell.com>
14085
14086         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
14087         attributes.
14088         Fix for #56456.
14089
14090         * attribute.cs (Attribute.Resolve): Check for duplicate named
14091         attributes.
14092         Fix for #56463.
14093
14094 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
14095
14096         * iterators.cs (MarkYield): track whether we are in an exception,
14097         and generate code accordingly.  Use a temporary value to store the
14098         result for our state.
14099
14100         I had ignored a bit the interaction of try/catch with iterators
14101         since their behavior was not entirely obvious, but now it is
14102         possible to verify that our behavior is the same as MS .NET 2.0
14103
14104         Fixes 54814
14105
14106 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
14107
14108         * iterators.cs: Avoid creating temporaries if there is no work to
14109         do. 
14110
14111         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
14112         Enumerations, use TypeManager.EnumToUnderlying and call
14113         recursively. 
14114
14115         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
14116         bug #57013
14117
14118         (This.Emit): Use EmitContext.EmitThis to emit our
14119         instance variable.
14120
14121         (This.EmitAssign): Ditto.
14122
14123         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
14124         codepaths, we will move all the functionality into
14125         Mono.CSharp.This 
14126
14127         (FieldExpr.EmitAssign): Ditto.
14128
14129         This fixes several hidden bugs that I uncovered while doing a code
14130         review of this today.
14131
14132         * codegen.cs (EmitThis): reworked so the semantics are more clear
14133         and also support value types "this" instances.
14134
14135         * iterators.cs: Changed so that for iterators in value types, we
14136         do not pass the value type as a parameter.  
14137
14138         Initialization of the enumerator helpers is now done in the caller
14139         instead of passing the parameters to the constructors and having
14140         the constructor set the fields.
14141
14142         The fields have now `assembly' visibility instead of private.
14143
14144 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
14145
14146         * expression.cs (Argument.Resolve): Check if fields passed as ref
14147         or out are contained in a MarshalByRefObject.
14148
14149         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
14150         another compiler type.
14151
14152 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
14153
14154         * class.cs (Indexer.Define): use the new name checking method.
14155         Also, return false on an error.
14156         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
14157         (is_identifier_[start/part]_character): make static.
14158
14159 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
14160
14161         * expression.cs (Binary.ResolveOperator): Do no append strings
14162         twice: since we can be invoked more than once (array evaluation)
14163         on the same concatenation, take care of this here.  Based on a fix
14164         from Ben (bug #56454)
14165
14166 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
14167
14168         * codegen.cs: Fix another case where CS1548 must be reported (when 
14169         delay-sign isn't specified and no private is available #56564). Fix
14170         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
14171         error when MCS is used on the MS runtime and we need to delay-sign 
14172         (which seems unsupported by AssemblyBuilder - see #56621).
14173
14174 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
14175
14176         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
14177         (TypeManager.ComputeNamespaces): Faster implementation for
14178         Microsoft runtime.
14179
14180         * compiler.csproj: Updated AssemblyName to mcs.
14181
14182 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
14183
14184         * rootcontext.cs: Add new types to the boot resolution.
14185
14186         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
14187         MulticastDelegate is not allowed.
14188
14189         * typemanager.cs: Add new types to lookup: System.TypedReference
14190         and ArgIterator.
14191
14192         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
14193         check for TypedReference or ArgIterator, they are not allowed. 
14194
14195         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
14196         makes us properly catch 1510 in some conditions (see bug 56016 for
14197         details). 
14198
14199 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
14200
14201         * CryptoConvert.cs: update from corlib version
14202         with endian fixes.
14203
14204 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
14205
14206         * class.cs (Indexer.Define): Check indexername declaration
14207
14208 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
14209
14210         * attribute.cs (IsClsCompliant): Fixed problem with handling
14211         all three states (compliant, not-compliant, undetected).
14212
14213 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
14214
14215         * attribute.cs (Attribute): Location is now public.
14216         (Resolve): Store resolved arguments (pos_values) in attribute class.
14217         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
14218         (GetClsCompliantAttributeValue): New method that gets
14219         CLSCompliantAttribute value.
14220         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
14221         if exists else null.
14222         (AttributeTester): New class for CLS-Compliant verification routines.
14223
14224         * class.cs (Emit): Add CLS-Compliant verification.
14225         (Method.GetSignatureForError): Implemented.
14226         (Constructor.GetSignatureForError): Implemented
14227         (Constructor.HasCompliantArgs): Returns if constructor has
14228         CLS-Compliant arguments.
14229         (Constructor.Emit): Override.
14230         (Construcor.IsIdentifierClsCompliant): New method; For constructors
14231         is needed to test only parameters.
14232         (FieldBase.GetSignatureForError): Implemented.
14233         (TypeContainer): New member for storing base interfaces.
14234         (TypeContainer.FindMembers): Search in base interfaces too.
14235
14236         * codegen.cs (GetClsComplianceAttribute): New method that gets
14237         assembly or module CLSCompliantAttribute value.
14238         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
14239         for assembly.
14240         (ModuleClass.Emit): Add error 3012 test.
14241
14242         * const.cs (Emit): Override and call base for CLS-Compliant tests.
14243
14244         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
14245         state for all decl types.
14246         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
14247         if CLS-Compliant tests are required.
14248         (IsClsCompliaceRequired): New method. Analyze whether code
14249         must be CLS-Compliant.
14250         (IsExposedFromAssembly): New method. Returns true when MemberCore
14251         is exposed from assembly.
14252         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
14253         value or gets cached value.
14254         (HasClsCompliantAttribute): New method. Returns true if MemberCore
14255         is explicitly marked with CLSCompliantAttribute.
14256         (IsIdentifierClsCompliant): New abstract method. This method is
14257         used to testing error 3005.
14258         (IsIdentifierAndParamClsCompliant): New method. Common helper method
14259         for identifier and parameters CLS-Compliant testing.
14260         (VerifyClsCompliance): New method. The main virtual method for
14261         CLS-Compliant verifications.
14262         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
14263         null. I don't know why is null (too many public members !).
14264         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
14265         and get value of first CLSCompliantAttribute that found.
14266
14267         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
14268         (VerifyClsCompliance): Override and add extra tests.
14269
14270         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
14271         clscheck- disable CLS-Compliant verification event if assembly is has
14272         CLSCompliantAttribute(true).
14273
14274         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
14275         ApllyAttribute is now called in emit section as in the other cases.
14276         Possible future Emit integration.
14277         (IsIdentifierClsCompliant): New override.
14278         (VerifyClsCompliance): New override.
14279         (GetEnumeratorName): Returns full enum name.
14280
14281         * parameter.cs (GetSignatureForError): Implemented.
14282
14283         * report.cs (WarningData): New struct for Warning message information.
14284         (LocationOfPreviousError): New method.
14285         (Warning): New method. Reports warning based on the warning table.
14286         (Error_T): New method. Reports error based on the error table.
14287
14288         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
14289         verifications are done here.
14290
14291         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
14292
14293         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
14294         CLSCompliantAttribute.
14295         (all_imported_types): New member holds all imported types from other
14296         assemblies.
14297         (LoadAllImportedTypes): New method fills static table with exported types
14298         from all referenced assemblies.
14299         (Modules): New property returns all assembly modules.
14300
14301 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
14302
14303         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
14304         throwing a parser error.
14305
14306         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
14307         which removes the hardcoded get_/set_ prefixes for properties, as
14308         IL allows for the properties to be named something else.  
14309
14310         Bug #56013
14311
14312         * expression.cs: Do not override operand before we know if it is
14313         non-null.  Fix 56207
14314
14315 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14316
14317         * typemanager.cs: support for pinned variables.
14318
14319 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14320
14321         * decl.cs, typemanager.cs: Avoid using an arraylist
14322         as a buffer if there is only one result set.
14323
14324 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14325
14326         * expression.cs: Make sure you cant call a static method
14327         with an instance expression, bug #56174.
14328
14329 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
14330
14331         * class.cs (IsDuplicateImplementation): Improve error reporting to
14332         flag 663 (method only differs in parameter modifier).
14333
14334         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
14335         in preprocessor directives.
14336
14337         * location.cs (LookupFile): Allow for the empty path.
14338
14339         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
14340         better approach for some of that patch, but its failing with the
14341         CharSet enumeration.  For now try/catch will do.
14342
14343         * typemanager.cs: Do not crash if a struct does not have fields.
14344         Fixes 56150.
14345
14346 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14347
14348         * expression.cs: cs0213, cant fix a fixed expression.
14349         fixes 50231.
14350
14351 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14352
14353         * cs-parser.jay: detect invalid embeded statements gracefully.
14354         bug #51113.
14355
14356 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
14357
14358         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
14359         As a regex:
14360         s/
14361         the invocation type may not be a subclass of the tye of the item/
14362         The type of the item must be a subclass of the invocation item.
14363         /g
14364
14365         Fixes bug #50820.
14366
14367 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
14368
14369         * attribute.cs: Added methods to get a string and a bool from an
14370         attribute. Required to information from AssemblyKeyFileAttribute,
14371         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
14372         * codegen.cs: Modified AssemblyName creation to include support for
14373         strongnames. Catch additional exceptions to report them as CS1548.
14374         * compiler.csproj: Updated include CryptoConvert.cs.
14375         * compiler.csproj.user: Removed file - user specific configuration.
14376         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
14377         Mono.Security assembly. The original class is maintained and tested in
14378         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
14379         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
14380         like CSC 8.0 (C# v2) supports.
14381         * Makefile: Added CryptoConvert.cs to mcs sources.
14382         * rootcontext.cs: Added new options for strongnames.
14383
14384 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
14385
14386         * driver.cs: For --expect-error, report error code `2'
14387         if the program compiled with no errors, error code `1' if
14388         it compiled with an error other than the one expected.
14389
14390 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
14391
14392         * compiler.csproj: Updated for Visual Studio .NET 2003.
14393         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
14394         * compiler.sln: Updated for Visual Studio .NET 2003.
14395
14396 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
14397
14398         * expression.cs: Fix bug #47234. We basically need to apply the
14399         rule that we prefer the conversion of null to a reference type
14400         when faced with a conversion to 'object' (csc behaviour).
14401
14402 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14403
14404         * statement.cs: Shorter form for foreach, eliminates
14405         a local variable. r=Martin.
14406
14407 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14408
14409         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
14410         checks if we can use brtrue/brfalse to test for 0.
14411         * expression.cs: use the above in the test for using brtrue/brfalse.
14412         cleanup code a bit.
14413
14414 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14415
14416         * expression.cs: Rewrite string concat stuff. Benefits:
14417
14418         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
14419         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
14420         rather than a concat chain.
14421
14422         * typemanager.cs: Add lookups for more concat overloads.
14423
14424 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
14425
14426         * expression.cs: Emit shorter il code for array init.
14427
14428         newarr
14429         dup
14430         // set 1
14431
14432         // set 2
14433
14434         newarr
14435         stloc.x
14436
14437         ldloc.x
14438         // set 1
14439
14440         ldloc.x
14441         // set 2
14442
14443 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
14444
14445         * statement.cs: Before, two switch blocks would be merged if the
14446         total size of the blocks (end_item - begin_item + 1) was less than
14447         two times the combined sizes of the blocks.
14448
14449         Now, it will only merge if after the merge at least half of the
14450         slots are filled.
14451
14452         fixes 55885.
14453
14454 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
14455
14456         * class.cs : csc build fix for GetMethods(). See bug #52503.
14457
14458 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
14459
14460         * expression.cs: Make sure fp comparisons work with NaN.
14461         This fixes bug #54303. Mig approved this patch a long
14462         time ago, but we were not able to test b/c the runtime
14463         had a related bug.
14464
14465 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
14466
14467         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
14468
14469 2004-03-19  Martin Baulig  <martin@ximian.com>
14470
14471         * class.cs (MemberCore.IsDuplicateImplementation): Report the
14472         error here and not in our caller.
14473
14474 2004-03-19  Martin Baulig  <martin@ximian.com>
14475
14476         * interface.cs: Completely killed this file.
14477         (Interface): We're now a TypeContainer and live in class.cs.
14478
14479         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
14480         argument; we're now also called for interfaces.
14481         (TypeContainer.DefineMembers): Allow this method being called
14482         multiple times.
14483         (TypeContainer.GetMethods): New public method; formerly known as
14484         Interface.GetMethod().  This is used by PendingImplementation.
14485         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
14486         it's now private and non-static.
14487         (Interface): Moved this here; it's now implemented similar to
14488         Class and Struct.
14489         (Method, Property, Event, Indexer): Added `bool is_interface'
14490         argument to their .ctor's.
14491         (MemberBase.IsInterface): New public field.
14492
14493         * cs-parser.jay: Create normal Method, Property, Event, Indexer
14494         instances instead of InterfaceMethod, InterfaceProperty, etc.
14495         (opt_interface_base): Removed; we now use `opt_class_base' instead.
14496         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
14497
14498 2004-03-19  Martin Baulig  <martin@ximian.com>
14499
14500         * class.cs (MethodCore.IsDuplicateImplementation): New private
14501         method which does the CS0111 checking.
14502         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
14503         Use IsDuplicateImplementation().
14504
14505 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
14506
14507         * decl.cs (FindMemberToOverride): New method to find the correct
14508         method or property to override in the base class.
14509         * class.cs
14510             - Make Method/Property use the above method to find the
14511               version in the base class.
14512             - Remove the InheritableMemberSignatureCompare as it is now
14513               dead code.
14514
14515         This patch makes large code bases much faster to compile, as it is
14516         O(n) rather than O(n^2) to do this validation.
14517
14518         Also, it fixes bug 52458 which is that nested classes are not
14519         taken into account when finding the base class member.
14520
14521         Reviewed/Approved by Martin.
14522
14523 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
14524
14525         * interface.cs: In all interface classes removed redundant
14526         member initialization.
14527
14528 2004-03-16  Martin Baulig  <martin@ximian.com>
14529
14530         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
14531
14532 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
14533
14534         * decl.cs (DefineTypeAndParents): New helper method to define a
14535         type's containers before the type itself is defined;  This is a
14536         bug exposed by the recent changes to Windows.Forms when an
14537         implemented interface was defined inside a class that had not been
14538         built yet.   
14539
14540         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
14541
14542         (Check): Loop correctly to report errors modifiers
14543         (UNSAFE was not in the loop, since it was the same as TOP).
14544
14545         * interface.cs: Every interface member now takes a ModFlags,
14546         instead of a "is_new" bool, which we set on the base MemberCore. 
14547
14548         Every place where we called "UnsafeOk" in the interface, now we
14549         call the proper member (InterfaceMethod.UnsafeOK) instead to get
14550         the unsafe settings from the member declaration instead of the
14551         container interface. 
14552
14553         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
14554
14555         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
14556         `set_indexer_name' to the pending bits (one per type).
14557
14558         We fixed a bug today that was picking the wrong method to
14559         override, since for properties the existing InterfaceMethod code
14560         basically ignored the method name.  Now we make sure that the
14561         method name is one of the valid indexer names.
14562
14563 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
14564  
14565         * support.cs (SeekableStreamReader): Keep track of stream byte
14566         positions and don't mix them with character offsets to the buffer.
14567
14568         Patch from Gustavo Giráldez
14569
14570 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
14571
14572         * interface.cs (InterfaceSetGetBase): Removed double member
14573         initialization, base class does it as well.
14574
14575 2004-03-13  Martin Baulig  <martin@ximian.com>
14576
14577         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
14578         when compiling corlib.
14579
14580 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
14581
14582         * convert.cs (ExplicitConversion): We were reporting an error on
14583         certain conversions (object_type source to a value type, when the
14584         expression was `null') before we had a chance to pass it through
14585         the user defined conversions.
14586
14587         * driver.cs: Replace / and \ in resource specifications to dots.
14588         Fixes 50752
14589
14590         * class.cs: Add check for duplicate operators.  Fixes 52477
14591
14592 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
14593
14594         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
14595         that are in the middle of the statements, not only at the end.
14596         Fixes #54987
14597
14598         * class.cs (TypeContainer.AddField): No longer set the
14599         `HaveStaticConstructor' flag, now we call it
14600         `UserDefineStaticConstructor' to diferentiate the slightly
14601         semantic difference.
14602
14603         The situation is that we were not adding BeforeFieldInit (from
14604         Modifiers.TypeAttr) to classes that could have it.
14605         BeforeFieldInit should be set to classes that have no static
14606         constructor. 
14607
14608         See:
14609
14610         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
14611
14612         And most importantly Zoltan's comment:
14613
14614         http://bugzilla.ximian.com/show_bug.cgi?id=44229
14615
14616         "I think beforefieldinit means 'it's ok to initialize the type sometime 
14617          before its static fields are used', i.e. initialization does not need
14618          to be triggered by the first access to the type. Setting this flag
14619          helps the JIT to compile better code, since it can run the static
14620          constructor at JIT time, and does not need to generate code to call it
14621          (possibly lots of times) at runtime. Unfortunately, mcs does not set
14622          this flag for lots of classes like String. 
14623          
14624          csc sets this flag if the type does not have an explicit static 
14625          constructor. The reasoning seems to be that if there are only static
14626          initalizers for a type, and no static constructor, then the programmer
14627          does not care when this initialization happens, so beforefieldinit
14628          can be used.
14629          
14630          This bug prevents the AOT compiler from being usable, since it 
14631          generates so many calls to mono_runtime_class_init that the AOT code
14632          is much slower than the JITted code. The JITted code is faster, 
14633          because it does not generate these calls if the vtable is type is
14634          already initialized, which is true in the majority of cases. But the
14635          AOT compiler can't do this."
14636
14637 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * class.cs (MethodData.Emit): Refactor the code so symbolic
14640         information is generated for destructors;  For some reasons we
14641         were taking a code path that did not generate symbolic information
14642         before. 
14643
14644 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
14645
14646         * class.cs: Create a Constructor.CheckBase method that
14647         takes care of all validation type code. The method
14648         contains some code that was moved from Define.
14649
14650         It also includes new code that checks for duplicate ctors.
14651         This fixes bug #55148.
14652
14653 2004-03-09  Joshua Tauberer <tauberer@for.net>
14654
14655         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
14656         a { ... }-style array creation invokes EmitStaticInitializers
14657         which is not good for reference-type arrays.  String, decimal
14658         and now null constants (NullCast) are not counted toward
14659         static initializers.
14660
14661 2004-03-05  Martin Baulig  <martin@ximian.com>
14662
14663         * location.cs (SourceFile.HasLineDirective): New public field;
14664         specifies whether the file contains or is referenced by a "#line"
14665         directive.
14666         (Location.DefineSymbolDocuments): Ignore source files which
14667         either contain or are referenced by a "#line" directive.        
14668
14669 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
14670
14671         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
14672         direct access to our parent, so check the method inline there.
14673
14674 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
14675
14676         * expression.cs (Invocation.EmitCall): Miguel's last commit
14677         caused a regression. If you had:
14678
14679             T t = null;
14680             t.Foo ();
14681
14682         In Foo the implict this would be null.
14683
14684 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
14685
14686         * expression.cs (Invocation.EmitCall): If the method is not
14687         virtual, do not emit a CallVirt to it, use Call.
14688
14689         * typemanager.cs (GetFullNameSignature): Improve the method to
14690         cope with ".ctor" and replace it with the type name.
14691
14692         * class.cs (ConstructorInitializer.Resolve): Now the method takes
14693         as an argument the ConstructorBuilder where it is being defined,
14694         to catch the recursive constructor invocations.
14695
14696 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
14697
14698         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
14699         routines to check if a type is an enumerable/enumerator allow
14700         classes that implement the IEnumerable or IEnumerator interfaces.
14701
14702         * class.cs (Property, Operator): Implement IIteratorContainer, and
14703         implement SetYields.
14704
14705         (Property.Define): Do the block swapping for get_methods in the
14706         context of iterators.   We need to check if Properties also
14707         include indexers or not.
14708
14709         (Operator): Assign the Block before invoking the
14710         OperatorMethod.Define, so we can trigger the Iterator code
14711         replacement. 
14712
14713         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
14714         Property and Operator classes are not created when we parse the
14715         declarator but until we have the block completed, so we use a
14716         singleton SimpleIteratorContainer.Simple to flag whether the
14717         SetYields has been invoked.
14718
14719         We propagate this setting then to the Property or the Operator to
14720         allow the `yield' to function.
14721
14722 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
14723
14724         * codegen.cs: Implemented attribute support for modules.
14725         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
14726         Assembly/Module functionality.
14727
14728         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
14729         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
14730         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
14731
14732 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
14733
14734         * interface.cs (FindMembers): The operation is performed on all base
14735         interfaces and not only on the first. It is required for future CLS Compliance patch.
14736
14737 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
14738
14739         * statement.cs, codegen.cs:
14740         This patch deals with patterns such as:
14741
14742         public class List : IEnumerable {
14743
14744                 public MyEnumerator GetEnumerator () {
14745                         return new MyEnumerator(this);
14746                 }
14747
14748                 IEnumerator IEnumerable.GetEnumerator () {
14749                         ...
14750                 }
14751                 
14752                 public struct MyEnumerator : IEnumerator {
14753                         ...
14754                 }
14755         }
14756
14757         Before, there were a few things we did wrong:
14758         1) we would emit callvirt on a struct, which is illegal
14759         2) we emited ldarg when we needed to emit ldarga
14760         3) we would mistakenly call the interface methods on an enumerator
14761         type that derived from IEnumerator and was in another assembly. For example:
14762
14763         public class MyEnumerator : IEnumerator
14764
14765         Would have the interface methods called, even if there were public impls of the
14766         method. In a struct, this lead to invalid IL code.
14767
14768 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
14769
14770         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
14771           renamed to Emit.
14772
14773         * delegate.cs (Define): Fixed crash when delegate type is undefined.
14774
14775 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
14776
14777         * cs-parser.jay: Fix small regression: we were not testing V2
14778         compiler features correctly.
14779
14780         * interface.cs: If the emit context is null, then create one
14781
14782 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
14783
14784         * decl.cs (GetSignatureForError): New virtual method to get full name
14785           for error messages.
14786
14787         * attribute.cs (IAttributeSupport): New interface for attribute setting.
14788           Now it is possible to rewrite ApplyAttributes method to be less if/else.
14789
14790         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
14791           Duplicated members and code in these classes has been removed.
14792           Better encapsulation in these classes.
14793
14794 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
14795
14796         * assign.cs (Assign.DoResolve): When dealing with compound
14797         assignments, there is a new rule in ECMA C# 2.4 (might have been
14798         there before, but it is documented here) that states that in:
14799
14800         a op= b;
14801
14802         If b is of type int, and the `op' is a shift-operator, then the
14803         above is evaluated as:
14804
14805         a = (int) a op b 
14806
14807         * expression.cs (Binary.ResolveOperator): Instead of testing for
14808         int/uint/long/ulong, try to implicitly convert to any of those
14809         types and use that in pointer arithmetic.
14810
14811         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
14812         method to print information for from the type, not from the
14813         null-method we were given.
14814
14815 2004-02-01  Duncan Mak  <duncan@ximian.com>
14816
14817         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
14818         parsing for cmd, fixes bug #53694.
14819
14820 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
14821
14822         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
14823         in the member name duplication tests. Property and operator name duplication
14824         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
14825
14826 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
14827
14828         * interface.cs (PopulateMethod): Fixed crash when interface method
14829         returns not existing type (error test cs0246-3.cs).
14830
14831 2004-02-02  Ravi Pratap M <ravi@ximian.com>
14832
14833         * cs-parser.jay (interface_accessors): Re-write actions to also
14834         store attributes attached to get and set methods. Fix spelling
14835         while at it.
14836
14837         (inteface_property_declaration): Modify accordingly.
14838
14839         (InterfaceAccessorInfo): New helper class to store information to pass
14840         around between rules that use interface_accessors.
14841
14842         * interface.cs (Emit): Apply attributes on the get and set
14843         accessors of properties and indexers too.
14844
14845         * attribute.cs (ApplyAttributes): Modify accordingly to use the
14846         right MethodBuilder when applying attributes to the get and set accessors.
14847
14848 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
14851
14852 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
14853
14854         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
14855
14856 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
14857
14858         * cs-parser.jay: Remove YIELD token, instead use the new grammar
14859         changes that treat `yield' specially when present before `break'
14860         or `return' tokens.
14861
14862         * cs-tokenizer.cs: yield is no longer a keyword.
14863
14864 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
14865
14866         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
14867         setting for default constructors.
14868         For default constructors are almost every time set wrong Modifier. The
14869         generated IL code has been alright. But inside mcs this values was
14870         wrong and this was reason why several of my CLS Compliance tests
14871         failed.
14872
14873 2004-01-22  Martin Baulig  <martin@ximian.com>
14874
14875         * cs-parser.jay (namespace_or_type_name): Return an Expression,
14876         not a QualifiedIdentifier.  This is what `type_name_expression'
14877         was previously doing.
14878         (type_name_expression): Removed; the code is now in
14879         `namespace_or_type_name'.
14880         (qualified_identifier): Removed, use `namespace_or_type_name'
14881         instead.
14882         (QualifiedIdentifier): Removed this class.      
14883
14884 2004-01-22  Martin Baulig  <martin@ximian.com>
14885
14886         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
14887         not a string as alias name.
14888
14889 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
14890
14891         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
14892         #52730 bug, and instead compute correctly the need to use a
14893         temporary variable when requesting an address based on the
14894         static/instace modified of the field and the constructor.
14895  
14896 2004-01-21  Martin Baulig  <martin@ximian.com>
14897
14898         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
14899         class and namespace before looking up aliases.  Fixes #52517.
14900
14901 2004-01-21  Martin Baulig  <martin@ximian.com>
14902
14903         * flowanalysis.cs (UsageVector.Merge): Allow variables being
14904         assinged in a 'try'; fixes exception4.cs.
14905
14906 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14907         * class.cs : Implemented parameter-less constructor for TypeContainer
14908
14909         * decl.cs: Attributes are now stored here. New property OptAttributes
14910
14911         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
14912
14913         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
14914
14915 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14916
14917         * typemanager.cs (CSharpSignature): Now reports also inner class name.
14918           (CSharpSignature): New method for indexer and property signature.
14919
14920 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14921
14922         * pending.cs (IsVirtualFilter): Faster implementation.
14923
14924 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14925
14926         * typemanager.cs: Avoid inclusion of same assembly more than once.
14927
14928 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14929
14930         * cs-parser.jay: Fixed problem where the last assembly attribute
14931           has been applied also to following declaration (class, struct, etc.)
14932           
14933 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
14934
14935         * class.cs: Added error CS0538, CS0539 reporting.
14936         Fixed crash on Microsoft runtime when field type is void.
14937
14938         * cs-parser.jay: Added error CS0537 reporting.
14939
14940         * pending.cs: Added error CS0535 reporting.
14941         Improved error report for errors CS0536, CS0534.
14942
14943 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
14944
14945         Merge a few bits from the Anonymous Method MCS tree.
14946
14947         * statement.cs (ToplevelBlock): New class for toplevel methods,
14948         will hold anonymous methods, lifted variables.
14949
14950         * cs-parser.jay: Create toplevel blocks for delegates and for
14951         regular blocks of code. 
14952
14953 2004-01-20  Martin Baulig  <martin@ximian.com>
14954
14955         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
14956         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
14957         and `NeedExplicitReturn'; added `IsLastStatement'.
14958         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
14959         have a `ReturnLabel' or we're not unreachable.
14960
14961         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
14962         child's reachability; don't just override ours with it.  Fixes
14963         #58058 (lluis's example).
14964         (FlowBranching): Added public InTryOrCatch(), InCatch(),
14965         InFinally(), InLoop(), InSwitch() and
14966         BreakCrossesTryCatchBoundary() methods.
14967
14968         * statement.cs (Return): Do all error checking in Resolve().
14969         Unless we are the last statement in a top-level block, always
14970         create a return label and jump to it.
14971         (Break, Continue): Do all error checking in Resolve(); also make
14972         sure we aren't leaving a `finally'.
14973         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
14974         statement in a top-level block.
14975         (Block.Flags): Added `IsDestructor'.
14976         (Block.IsDestructor): New public property.
14977
14978 2004-01-20  Martin Baulig  <martin@ximian.com>
14979
14980         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
14981
14982 2004-01-20  Martin Baulig  <martin@ximian.com>
14983
14984         * statement.cs (Statement.ResolveUnreachable): New public method.
14985         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
14986         (Block.Resolve): Resolve unreachable statements.
14987
14988 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14989
14990         * expression.cs: We need to fix the case where we do
14991         not have a temp variable here.
14992
14993         * assign.cs: Only expression compound assignments need
14994         temporary variables.
14995
14996 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
14997
14998         * flowanalysis.cs: Reduce memory allocation in a few ways:
14999           - A block with no variables should not allocate a bit
15000             vector for itself.
15001           - A method with no out parameters does not need any tracking
15002             for assignment of the parameters, so we need not allocate
15003             any data for it.
15004           - The arrays:
15005                 public readonly Type[] VariableTypes;
15006                 public readonly string[] VariableNames;
15007             Are redundant. The data is already stored in the variable
15008             map, so we need not allocate another array for it.
15009           - We need to add alot of checks for if (params | locals) == null
15010             due to the first two changes.
15011
15012 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
15013
15014         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
15015         implement IMemoryLocation, we store a copy on a local variable and
15016         take the address of it.  Patch from Benjamin Jemlich
15017
15018         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
15019         to use a special "type_name_expression" rule which reduces the
15020         number of "QualifiedIdentifier" classes created, and instead
15021         directly creates MemberAccess expressions.
15022
15023 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
15024
15025         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
15026         that fixes #52853.  Null literal assignment to ValueType
15027
15028         * class.cs (MethodData.Emit): Instead of checking the name of the
15029         method to determine if its a destructor, create a new derived
15030         class from Method called Destructor, and test for that.  
15031
15032         * cs-parser.jay: Create a Destructor object instead of a Method.  
15033
15034         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
15035
15036         Fixes: 52933
15037
15038 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
15039
15040         * expression.cs (Binary.ResolveOperator): Perform an implicit
15041         conversion from MethodGroups to their delegate types on the
15042         Addition operation.
15043
15044         * delegate.cs: Introduce a new class DelegateCreation that is the
15045         base class for `NewDelegate' and `ImplicitDelegateCreation',
15046         factor some code in here.
15047
15048         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
15049         conversion from MethodGroups to compatible delegate types. 
15050
15051         * ecore.cs (Expression.Resolve): Do not flag error 654
15052         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
15053         we allow conversions from MethodGroups to delegate types now.
15054
15055         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
15056         assignments in v2 either.
15057
15058 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
15059
15060         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
15061         static read-only fields in ctors.
15062
15063         Applied patch from Benjamin Jemlich 
15064
15065         * expression.cs (UnaryMutator): Avoid leaking local variables. 
15066
15067 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
15068
15069         * cs-tokenizer.cs (IsCastToken): Allow the various native types
15070         here to return true, as they can be used like this:
15071
15072                 (XXX) int.MEMBER ()
15073
15074         Fixed 49836 and all the other dups
15075
15076 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
15077
15078         * driver.cs: Implement /win32res and /win32icon.
15079
15080 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
15081
15082         * cs-parser.jay: Add a rule to improve error handling for the
15083         common mistake of placing modifiers after the type.
15084
15085 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * cs-parser.jay (interface_event_declaration): Catch
15088         initialization of events on interfaces, and report cs0068
15089
15090         * cs-parser.jay (interface_event_declaration): Catch
15091         initialization of events. 
15092
15093         * ecore.cs: Better report missing constructors.
15094
15095         * expression.cs (Binary.ResolveOperator): My previous bug fix had
15096         the error reporting done in the wrong place.  Fix.
15097
15098         * expression.cs (Binary.ResolveOperator): Catch the 
15099         operator + (E x, E y) error earlier, and later allow for implicit
15100         conversions in operator +/- (E e, U x) from U to the underlying
15101         type of E.
15102
15103         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
15104         52596, if the container class is abstract, the default constructor
15105         is protected otherwise its public (before, we were always public).
15106
15107         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
15108         fixed statement.
15109
15110         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
15111         Jemlich that fixes bug #52597, MCS was generating invalid code for
15112         idisposable structs.   Thanks to Ben for following up with this
15113         bug as well.
15114
15115 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
15116
15117         * driver.cs: Allow assemblies without code to be generated, fixes
15118         52230.
15119
15120 2004-01-07  Nick Drochak <ndrochak@gol.com>
15121
15122         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
15123
15124 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
15125
15126         * cs-parser.jay: Add rules to improve error reporting if fields or
15127         methods are declared at the namespace level (error 116)
15128
15129         * Add rules to catch event add/remove
15130
15131 2004-01-04  David Sheldon <dave-mono@earth.li>
15132
15133   * expression.cs: Added matching ")" to error message for 
15134   CS0077
15135
15136 2004-01-03 Todd Berman <tberman@gentoo.org>
15137
15138         * ecore.cs, attribute.cs:
15139         Applying fix from #52429.
15140
15141 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15142
15143         * ecore.cs, expression.cs, statement.cs:
15144         Total rewrite of how we handle branching. We
15145         now handle complex boolean expressions with fewer
15146         jumps. As well if (x == 0) no longer emits a ceq.
15147
15148         if (x is Foo) is much faster now, because we generate
15149         better code.
15150
15151         Overall, we get a pretty big improvement on our benchmark
15152         tests. The code we generate is smaller and more readable.
15153
15154         I did a full two-stage bootstrap. The patch was reviewed
15155         by Martin and Miguel.
15156
15157 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15158
15159         * cs-parser.jay: Make primary_expression not take a QI.
15160         we dont need this because the member_access rule covers
15161         us here. So we replace the rule with just IDENTIFIER.
15162
15163         This has two good effects. First, we remove a s/r conflict.
15164         Second, we allocate many fewer QualifiedIdentifier objects.
15165
15166 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15167
15168         * attribute.cs: Handle MarshalAs attributes as pseudo, and
15169         set the correct information via SRE. This prevents
15170         hanging on the MS runtime. Fixes #29374.
15171
15172 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
15173
15174         * convert.cs: correctly handle conversions to value types
15175         from Enum and ValueType as unboxing conversions.
15176
15177         Fixes bug #52569. Patch by Benjamin Jemlich.
15178
15179 2004-01-02  Ravi Pratap  <ravi@ximian.com>
15180
15181         * expression.cs (BetterConversion): Prefer int -> uint
15182         over int -> ulong (csc's behaviour). This fixed bug #52046.
15183
15184 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15185
15186         * decl.cs (MemberCache.FindMembers): now returns a
15187         MemberInfo [].
15188
15189         * typemanager.cs: In general, go with with ^^.
15190         (CopyNewMethods): take an IList.
15191         (RealMemberLookup): Only allocate an arraylist
15192         if we copy from two sets of methods.
15193
15194         This change basically does two things:
15195         1) Fewer array lists allocated due to CopyNewMethods.
15196         2) the explicit cast in MemberList costed ALOT.
15197
15198 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
15199
15200         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
15201         a hashtable to avoid needless string allocations when an identifier is
15202         used more than once (the common case).
15203
15204 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15205
15206         * pending.cs: MS's TypeBuilder.GetInterfaces ()
15207         is broken, it will not return anything. So, we
15208         have to use the information we have in mcs to
15209         do the task.
15210
15211         * typemanager.cs: Add a cache for GetInterfaces,
15212         since this will now be used more often (due to ^^)
15213
15214         (GetExplicitInterfaces) New method that gets the
15215         declared, not effective, interfaces on a type
15216         builder (eg, if you have interface IFoo, interface
15217         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
15218         { IBar }.
15219
15220         This patch makes MCS able to bootstrap itself on
15221         Windows again.
15222
15223 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
15224
15225         * expression.cs: Remove the Nop's that Miguel put
15226         in by mistake.
15227
15228 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15229
15230         * report.cs, codegen.cs: Give the real stack trace to
15231         the error when an exception is thrown.
15232
15233 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15234
15235         * decl.cs: only allocate hashtables for ifaces if 
15236         it is an iface!
15237
15238 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
15239
15240         * expression.cs: fix the error from cs0121-2.cs
15241         (a parent interface has two child interfaces that
15242         have a function with the same name and 0 params
15243         and the function is called through the parent).
15244
15245 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
15246
15247         * class.cs, rootcontext.cs, typmanager.cs: do not
15248         leak pointers.
15249
15250 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15251
15252         * codegen.cs: remove stack for the ec flow branching.
15253         It is already a linked list, so no need.
15254
15255 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15256
15257         * Makefile: Allow custom profiler here.
15258
15259 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15260
15261         * typemanager.cs (LookupType):
15262           - Use a static char [], because split takes
15263             a param array for args, so it was allocating
15264             every time.
15265           - Do not store true in a hashtable, it boxes.
15266
15267 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
15268
15269         * flowanalysis.cs: bytify common enums.
15270
15271 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15272
15273         * modifiers.cs: Add a new set of flags for the
15274         flags allowed on explicit interface impls.
15275         * cs-parser.jay: catch the use of modifiers in
15276         interfaces correctly.
15277         * class.cs: catch private void IFoo.Blah ().
15278
15279         All related to bug #50572.
15280
15281 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15282
15283         * decl.cs: Rewrite the consistant accessability checking.
15284         Accessability is not linear, it must be implemented in
15285         a tableish way. Fixes #49704.
15286
15287 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
15288
15289         * expression.cs: Handle negation in a checked context.
15290         We must use subtraction from zero. Fixes #38674.
15291
15292 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15293
15294         * class.cs: Ignore static void main in DLLs.
15295         * rootcontext.cs: Handle the target type here,
15296         since we are have to access it from class.cs
15297         * driver.cs: account for the above.
15298
15299 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15300
15301         * report.cs: Give line numbers and files if available.
15302
15303 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
15304
15305         * driver.cs: Implement /addmodule.
15306
15307         * typemanager.cs:  Change 'modules' field so it now contains Modules not
15308         ModuleBuilders.
15309
15310 2003-12-20  Martin Baulig  <martin@ximian.com>
15311
15312         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
15313         (FieldBase.IsAssigned): Removed this field.
15314         (FieldBase.SetAssigned): New public method.
15315         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
15316
15317 2003-12-20  Martin Baulig  <martin@ximian.com>
15318
15319         * expression.cs (LocalVariableReference.DoResolve): Don't set
15320         `vi.Used' if we're called from DoResolveLValue().
15321
15322         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
15323         returns the usage vector it just merged into the current one -
15324         pass this one to UsageWarning().
15325         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
15326         of the `EmitContext', don't call this recursively on our children.
15327
15328 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
15329
15330         * driver.cs: Implement /target:module.
15331
15332 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
15333
15334         * support.cs (CharArrayHashtable): New helper class.
15335
15336         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
15337         char arrays, not strings, so we can avoid creating a string in
15338         consume_identifier if the identifier is a keyword.
15339
15340 2003-12-16  Martin Baulig  <martin@ximian.com>
15341
15342         * statement.cs (LocalInfo.Assigned): Removed this property.
15343         (LocalInfo.Flags): Removed `Assigned'.
15344         (LocalInfo.IsAssigned): New public method; takes the EmitContext
15345         and uses flow analysis.
15346         (Block.UsageWarning): Made this method private.
15347         (Block.Resolve): Call UsageWarning() if appropriate.
15348
15349         * expression.cs (LocalVariableReference.DoResolve): Always set
15350         LocalInfo.Used here.
15351
15352 2003-12-13  Martin Baulig  <martin@ximian.com>
15353
15354         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
15355         any value here; we're now using flow analysis to figure out
15356         whether a statement/block returns a value.
15357
15358 2003-12-13  Martin Baulig  <martin@ximian.com>
15359
15360         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
15361         working again.
15362         (FlowBranching.MergeFinally): Don't call
15363         `branching.CheckOutParameters()' here, this is called in
15364         MergeTopBlock().
15365         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
15366         when adding the `finally' vector.       
15367
15368 2003-12-13  Martin Baulig  <martin@ximian.com>
15369
15370         * flowanalysis.cs
15371         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
15372         actually work and also fix #48962.
15373
15374 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15375
15376         * decl.cs: Do not check System.Object for nested types,
15377         since we know it does not have any. Big bang for buck:
15378
15379         BEFORE:
15380            Run 1:   8.35 seconds
15381            Run 2:   8.32 seconds
15382            corlib:  17.99 seconds
15383         AFTER:
15384            Run 1:   8.17 seconds
15385            Run 2:   8.17 seconds
15386            corlib:  17.39 seconds
15387
15388 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15389
15390         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
15391         time we are returning 0 members, so we save alot here.
15392
15393 2003-12-11  Martin Baulig  <martin@ximian.com>
15394
15395         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
15396         `MergeChild()', also just take the `FlowBranching' as argument;
15397         call Merge() on it and return the result.
15398         (FlowBranching.Merge): We don't need to do anything if we just
15399         have one sibling.
15400
15401 2003-12-11  Martin Baulig  <martin@ximian.com>
15402
15403         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
15404         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
15405         Maurer for this idea.
15406
15407 2003-12-11  Martin Baulig  <martin@ximian.com>
15408
15409         * flowanalysis.cs (MergeResult): This class is now gone; we now
15410         use the `UsageVector' for this.  The reason for this is that if a
15411         branching just has one sibling, we don't need to "merge" them at
15412         all - that's the next step to do.
15413         (FlowBranching.Merge): We now return a `UsageVector' instead of a
15414         `MergeResult'.
15415
15416 2003-12-11  Martin Baulig  <martin@ximian.com>
15417
15418         Reworked flow analyis and made it more precise and bug-free.  The
15419         most important change is that we're now using a special `Reachability'
15420         class instead of having "magic" meanings of `FlowReturns'.  I'll
15421         do some more cleanups and optimizations and also add some more
15422         documentation this week.
15423
15424         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
15425         largely reworked this class.
15426         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
15427         the new `Reachability' class instead of having "magic" values here.
15428         (FlowBranching): We're now using an instance of `Reachability'
15429         instead of having separate `Returns', `Breaks' etc. fields.
15430
15431         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
15432         based on flow analysis; ignore the return value of block.Emit ().
15433
15434 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
15435
15436         * driver.cs typemanager.cs: Find the mono extensions to corlib even
15437         if they are private.
15438
15439 2003-12-09  Martin Baulig  <martin@ximian.com>
15440
15441         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
15442         call them directly on the UsageVector.
15443
15444 2003-12-09  Martin Baulig  <martin@ximian.com>
15445
15446         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
15447         Changed return type from `FlowReturns' to `Reachability'.
15448
15449 2003-12-09  Martin Baulig  <martin@ximian.com>
15450
15451         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
15452         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
15453         `Reachable' fields with a single `Reachability' one.
15454
15455 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15456
15457         * class.cs (FindMembers): Remove foreach's.
15458
15459         Bootstrap times:
15460
15461         BEFORE
15462                 Run 1:   8.74 seconds
15463                 Run 2:   8.71 seconds
15464
15465         AFTER
15466                 Run 1:   8.64 seconds
15467                 Run 2:   8.58 seconds
15468
15469
15470 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15471
15472         * cs-parser.jay:
15473         * gen-treedump.cs:
15474         * statement.cs:
15475         This patch does a few things:
15476                 1. EmptyStatement is now a singleton, so it is never reallocated.
15477                 2. All blah is EmptyStatement constructs have been changed to
15478                    blah == EmptyStatement.Value, which is much faster and valid
15479                    now that EmptyStatement is a singleton.
15480                 3. When resolving a block, rather than allocating a new array for
15481                    the non-empty statements, empty statements are replaced with
15482                    EmptyStatement.Value
15483                 4. Some recursive functions have been made non-recursive.
15484         Mainly the performance impact is from (3), however (1) and (2) are needed for
15485         this to work. (4) does not make a big difference in normal situations, however
15486         it makes the profile look saner.
15487
15488         Bootstrap times:
15489
15490         BEFORE
15491         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15492         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
15493         Total memory allocated: 56397 KB
15494
15495         AFTER
15496         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
15497         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
15498         Total memory allocated: 55666 KB
15499
15500 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15501
15502         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
15503         than the hashtable in a hashtable version
15504
15505         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
15506         we always end up concating a string. This results in a huge perf
15507         loss, because many strings have to be tracked by the GC. In this
15508         patch, we first use a hashtable that works with two keys, so that
15509         the strings do not need to be concat'ed.
15510
15511         Bootstrap times:
15512         BEFORE
15513                 Run 1:   8.74 seconds
15514                 Run 2:   8.71 seconds
15515
15516         AFTER
15517                 Run 1:   8.65 seconds
15518                 Run 2:   8.56 seconds
15519
15520 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
15521
15522         * Makefile: Add a new target `do-time' that does a quick and simple
15523         profile, leaving easy to parse output.
15524
15525 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
15526
15527         * codegen.cs (Init): Create the dynamic assembly with 
15528         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
15529
15530 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
15531
15532         * support.cs: Make the PtrHashtable use only one
15533         instance of its comparer.
15534
15535 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
15536
15537         * typemanager.cs: Fix lookup of GetNamespaces.
15538
15539 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * expression.cs: Removed redundant line.
15542
15543         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
15544         ArrayLists, use for loops with bounds.  
15545
15546         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
15547         arraylist.
15548
15549         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
15550         arraylists, use for loop with bounds.
15551
15552         The above three changes give us a 0.071 second performance
15553         improvement out of 3.294 seconds down to 3.223.  On my machine
15554         the above changes reduced the memory usage by 1,387 KB during
15555         compiler bootstrap.
15556
15557         * cs-parser.jay (QualifiedIdentifier): New class used to represent
15558         QualifiedIdentifiers.  Before we created a new string through
15559         concatenation, and mostly later on, the result would be
15560         manipulated by DecomposeQI through string manipulation.
15561
15562         This reduced the compiler memory usage for bootstrapping from
15563         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
15564         compile times in 0.05 seconds.
15565
15566 2003-11-28  Dick Porter  <dick@ximian.com>
15567
15568         * support.cs: Do string compares with the Invariant culture.
15569
15570         * rootcontext.cs: 
15571         * gen-treedump.cs: 
15572         * expression.cs: 
15573         * driver.cs: 
15574         * decl.cs: 
15575         * codegen.cs: 
15576         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
15577         the comparison is done with the Invariant culture.
15578
15579 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
15580
15581         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
15582         GetEnumerator method.
15583
15584         (ProbeCollectionType): Iterate starting at the most specific type
15585         upwards looking for a GetEnumerator
15586
15587         * expression.cs: Shift count can be up to 31 for int/uint and 63
15588         for long/ulong.
15589
15590 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * statement.cs (Block.LookupLabel): Also look for the label on the
15593         children blocks.  Use a hash table to keep track of visited
15594         nodes. 
15595
15596         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
15597         we actually did transform the other operand, otherwise fall back
15598         to the common codepath that casts to long.
15599
15600         * cs-tokenizer.cs: Use the same code pattern as the int case.
15601         Maybe I should do the parsing myself, and avoid depending on the
15602         Parse routines to get this done.
15603
15604 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
15605
15606         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15607         which fixes bug 51347.  This time test it.
15608
15609         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
15610         attributes for example can not tell the difference between these.
15611         The difference was only a syntax feature of the language. 
15612
15613         * attribute.cs: Apply attributes to delegates.
15614
15615         * delegate.cs: Call the apply attributes method.
15616
15617 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
15618
15619         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
15620         comparing 0 vs Byte.MinValue, not the value
15621
15622         (ImplicitConversionRequired): When reporting a conversion error,
15623         use error 31 to print out the constant error instead of the
15624         simpler 29.
15625
15626         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
15627         which fixes bug 51347.
15628
15629 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
15630
15631         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
15632         which fixes the -warnaserror command line option.
15633
15634 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
15635
15636         * cfold.cs (DoNumericPromotions): During constant folding of
15637         additions on UIntConstant, special case intconstants with
15638         IntConstants like we do on the expression binary operator. 
15639
15640 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
15641
15642         * convert.cs (ImplicitReferenceConversion): We were missing a case
15643         (System.Enum are not value types or class types, so we need to
15644         classify them separatedly).
15645
15646         * driver.cs: We do not support error 2007.
15647
15648 2003-11-12 Jackson Harper <jackson@ximian.com>
15649
15650         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
15651         system directory. Also use the full file name so users can
15652         libraries names mscorlib-o-tron.dll in a non system dir.
15653
15654 2003-11-10  Martin Baulig  <martin@ximian.com>
15655
15656         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
15657         (TypeManager.InitCoreTypes): Initialize them here, but instead of
15658         calling `ResolveType()' on them, directly assign their `Type'.
15659
15660 2003-11-08  Martin Baulig  <martin@ximian.com>
15661
15662         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
15663         return value and the `out parent' parameter.
15664         (TypeContainer.DefineType): Moved the CS0644 check into
15665         GetClassBases().  Don't pass the interface types to the
15666         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
15667         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
15668
15669         * ecore.cs (TypeExpr.IsAttribute): New property.
15670         (TypeExpr.GetInterfaces): New method.
15671
15672         * interface.cs (Interface.GetInterfaceTypeByName): Return a
15673         TypeExpr instead of a Type.
15674         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
15675         (Interface.DefineType): Don't pass the interface types to the
15676         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
15677         them later and then call `TypeBulider.AddInterfaceImplementation()'.
15678
15679         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
15680         instead of a `Type[]'.
15681         (TypeManager.RegisterBuilder): Likewise.
15682         (TypeManager.AddUserInterface): Likewise.
15683         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
15684         `Type[]' and also return a `TypeExpr[]'.
15685         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
15686
15687 2003-11-08  Martin Baulig  <martin@ximian.com>
15688
15689         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
15690         Expression.     
15691
15692 2003-11-08  Martin Baulig  <martin@ximian.com>
15693
15694         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
15695         TypeManager.ResolveExpressionTypes().
15696
15697         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
15698         instead of an Expression.
15699         (TypeExpr): This is now an abstract base class for `TypeExpression'.
15700         (TypeExpression): New public class; formerly known as `TypeExpr'.
15701
15702         * expression.cs (ComposedCast): Derive from TypeExpr.
15703
15704         * typemanager.cs (TypeManager.system_*_expr): These are now
15705         TypExpr's instead of Expression's.
15706         (TypeManager.ResolveExpressionTypes): New public static function;
15707         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
15708         of them.        
15709
15710 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
15711
15712         * expression.cs (New.DoResolve): Do not dereference value that
15713         might be a null return.
15714
15715         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
15716         sure that the constant value has the right type.  Fixes an
15717         unreported bug, similar to 50425.
15718
15719         * const.cs (Const.LookupConstantValue): Call
15720         ImplicitStandardConversionExists before doing a conversion to
15721         avoid havng the TypeManager.ChangeType do conversions.
15722
15723         Reduced the number of casts used
15724
15725         (Const.ChangeType): New routine to enable reuse of the constant
15726         type changing code from statement.
15727
15728         * typemanager.cs (ChangeType): Move common initialization to
15729         static global variables.
15730
15731         Fixes #50425.
15732
15733         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
15734         every value type to go through, even if it was void.  Fix that. 
15735
15736         * cs-tokenizer.cs: Use is_identifier_start_character on the start
15737         character of the define, and the is_identifier_part_character for
15738         the rest of the string.
15739
15740 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
15741
15742         * expression.cs (UnaryMutator.EmitCode): When I updated
15743         LocalVariableReference.DoResolve, I overdid it, and dropped an
15744         optimization done on local variable references.
15745
15746 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
15747
15748         * ecore.cs: Convert the return from Ldlen into an int.
15749
15750 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
15751
15752         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
15753         the accessibility, this is a special case for toplevel non-public
15754         classes (internal for instance).
15755
15756 2003-10-20  Nick Drochak <ndrochak@gol.com>
15757
15758         * ecore.cs: Fix typo and build.  Needed another right paren.
15759
15760 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
15761
15762         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
15763         `internal' case regular and protected, but not allowing protected
15764         to be evaluated later.  Bug 49840
15765
15766 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
15767
15768         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
15769         to kb.Nlast, and not the kb.nFirst to isolate the switch
15770         statement.
15771
15772         Extract the underlying type, so enumerations of long/ulong are
15773         treated like long/ulong.
15774
15775 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
15776
15777         * expression.cs (New): Overload the meaning of RequestedType to
15778         track the possible creation of the NewDelegate type, since
15779         DoResolve is invoked more than once for new constructors on field
15780         initialization.
15781
15782         See bugs: #48800 and #37014
15783
15784         * cs-parser.jay (declare_local_constants): Take an arraylist
15785         instead of a single constant.
15786
15787         (local_constant_declaration): It should take a
15788         constant_declarators, not a constant_declarator.  Fixes 49487
15789
15790         * convert.cs: Fix error report.
15791
15792 2003-10-13 Jackson Harper <jackson@ximian.com>
15793
15794         * typemanager.cs (TypeToCoreType): Add float and double this fixes
15795         bug #49611
15796
15797 2003-10-09  Martin Baulig  <martin@ximian.com>
15798
15799         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
15800         to the .ctor.
15801         (MethodCore.DoDefineParameters): Removed the TypeContainer
15802         argument; use the DeclSpace which was passed to the .ctor instead.
15803         (MethodCore.CheckParameter): Take a DeclSpace instead of a
15804         TypeContainer; we only need a DeclSpace here.
15805
15806 2003-10-09  Martin Baulig  <martin@ximian.com>
15807
15808         * class.cs (MethodData): Added additional `DeclSpace ds' argument
15809         to the .ctor.
15810         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
15811         EmitContext's .ctor.    
15812
15813 2003-10-09  Martin Baulig  <martin@ximian.com>
15814
15815         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
15816         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
15817         AsAccessible(), moved them as well.
15818
15819         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
15820
15821 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
15822
15823         * cs-parser.jay : Renamed yyName to yyNames related to jay.
15824
15825 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
15828         generation for >=, as spotted by Paolo, bug 48679.  
15829         Patch from David Waite.
15830
15831         * cs-tokenizer.cs: Add handling for #pragma.
15832
15833         * cs-parser.jay: Allow for both yield and yield return in the
15834         syntax.  The anti-cobolization of C# fight will go on!
15835
15836         * class.cs (TypeBuilder.DefineType): Catch error condition here
15837         (Parent.DefineType erroring out and returning null).
15838
15839         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
15840         coping with enumerations variables, we were mistakenly processing
15841         them as a regular value type instead of built-in types.  Fixes the
15842         bug #48063
15843
15844         * typemanager.cs (IsBuiltinOrEnum): New method.
15845
15846 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
15847
15848         * cs-parser.jay: Upgrade: yield now needs the return clause.
15849
15850 2003-09-19  Martin Baulig  <martin@ximian.com>
15851
15852         * decl.cs (MemberCache.SetupCacheForInterface): Take a
15853         `MemberCache parent' argument.  Normally, an interface doesn't
15854         have a parent type except System.Object, but we use this in gmcs
15855         for generic type parameters.
15856
15857 2003-09-18  Martin Baulig  <martin@ximian.com>
15858
15859         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
15860         on `type.IsInterface'; don't check whether the type has a parent
15861         to determine whether it's an interface.
15862
15863 2003-09-15  Martin Baulig  <martin@ximian.com>
15864
15865         * class.cs (TypeContainer.DefineType): Added an error flag to
15866         avoid reporting duplicate CS0146's ("class definition is
15867         circular.").
15868
15869         * driver.cs (Driver.MainDriver): Abort if
15870         RootContext.ResolveTree() reported any errors.
15871
15872 2003-09-07  Martin Baulig  <martin@ximian.com>
15873
15874         * report.cs (Error, Warning): Added overloaded versions which take
15875         a `params object[] args' and call String.Format().
15876
15877 2003-09-07  Martin Baulig  <martin@ximian.com>
15878
15879         * decl.cs (DeclSpace..ctor): Don't call
15880         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
15881         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
15882         (DeclSpace.RecordDecl): New method.
15883
15884         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
15885
15886 2003-09-02  Ravi Pratap  <ravi@ximian.com>
15887
15888         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
15889         value attributes to be applied to ParameterBuilders.
15890
15891         * class.cs (MethodCore.LabelParameters): Make static and more
15892         generic so that it can be used from other places - like interface
15893         methods, for instance.
15894
15895         * interface.cs (Interface.Emit): Call LabelParameters before
15896         emitting attributes on the InterfaceMethod.
15897
15898 2003-08-26  Martin Baulig  <martin@ximian.com>
15899
15900         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
15901         resolving aliases; fixes #47927.
15902
15903 2003-08-26  Martin Baulig  <martin@ximian.com>
15904
15905         * statement.cs (Using.DoResolve): This is internally emitting a
15906         try/finally clause, so we need to set ec.NeedExplicitReturn if we
15907         do not always return.  Fixes #47681.
15908
15909 2003-08-26  Martin Baulig  <martin@ximian.com>
15910
15911         * decl.cs (MemberCore): Moved WarningNotHiding(),
15912         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
15913         into MemberBase.
15914         (AdditionResult): Make this nested in DeclSpace.
15915         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
15916         argument; call NamespaceEntry.Define() unless we're nested in a
15917         class or struct.
15918
15919         * namespace.cs (Namespace.DefineName): New public function.  This
15920         is called from DeclSpace's .ctor to add 
15921         (Namespace.Lookup): Include DeclSpaces in the lookup.
15922
15923         * class.cs (Operator): Derive from MemberBase, not MemberCore.
15924
15925         * const.cs (Const): Derive from MemberBase, not MemberCore.     
15926
15927 2003-08-25  Martin Baulig  <martin@ximian.com>
15928
15929         * convert.cs (Convert.ExplicitReferenceConversion): When
15930         converting from an interface type to a class, unbox if the target
15931         type is a struct type.  Fixes #47822.
15932
15933 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15934
15935         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
15936         #47854.
15937
15938 2003-08-22  Martin Baulig  <martin@ximian.com>
15939
15940         * class.cs (TypeManager.DefineType): When defining a nested type,
15941         call DefineType() on our parent; fixes #47801.
15942
15943 2003-08-22  Martin Baulig  <martin@ximian.com>
15944
15945         * class.cs (MethodData.Define): While checking if a method is an
15946         interface implementation, improve the test a bit more to fix #47654.
15947
15948 2003-08-22  Martin Baulig  <martin@ximian.com>
15949
15950         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
15951         correctly; fixes #47722.
15952
15953 2003-08-22  Martin Baulig  <martin@ximian.com>
15954
15955         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
15956         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
15957
15958         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
15959
15960 2003-08-22  Martin Baulig  <martin@ximian.com>
15961
15962         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
15963         can only be assigned in static constructors.  Fixes #47161.
15964
15965 2003-08-22  Martin Baulig  <martin@ximian.com>
15966
15967         Rewrote and improved the flow analysis code.
15968
15969         * flowbranching.cs (FlowBranching): Make this class abstract.
15970         (FlowBranching.CreateBranching): New static function to create a
15971         new flow branching.
15972         (FlowBranchingBlock, FlowBranchingException): New classes.
15973         (FlowBranching.UsageVector.Type): New public readonly field.
15974         (FlowBranching.UsageVector.Breaks): Removed the setter.
15975         (FlowBranching.UsageVector.Returns): Removed the setter.
15976         (FlowBranching.UsageVector): Added Break(), Return(),
15977         NeverReachable() and Throw() methods to modify the reachability.
15978         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
15979         done by FlowBranching.Merge().
15980         (FlowBranching.UsageVector.MergeChild): New method; merges the
15981         merge result into the current vector.
15982         (FlowBranching.Merge): New abstract method to merge a branching.
15983
15984 2003-08-12  Martin Baulig  <martin@ximian.com>
15985
15986         * expression.cs (Indirection.CacheTemporaries): Create the
15987         LocalTemporary with the pointer type, not its element type.
15988
15989 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
15992         token was a keyword or not.
15993
15994         Add `error' options where an IDENTIFIER was expected;  Provide
15995         CheckToken and CheckIdentifierToken convenience error reporting
15996         functions. 
15997
15998         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
15999
16000         * decl.cs: Rename `NamespaceEntry Namespace' public field into
16001         NameSpaceEntry NameSpaceEntry.
16002
16003         (LookupInterfaceOrClass): Avoid creating a full qualified name
16004         from namespace and name: avoid doing lookups when we know the
16005         namespace is non-existant.   Use new Tree.LookupByNamespace which
16006         looks up DeclSpaces based on their namespace, name pair.
16007
16008         * driver.cs: Provide a new `parser verbose' to display the
16009         exception thrown during parsing.  This is turned off by default
16010         now, so the output of a failure from mcs is more graceful.
16011
16012         * namespace.cs: Track all the namespaces defined in a hashtable
16013         for quick lookup.
16014
16015         (IsNamespace): New method
16016
16017 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
16018
16019         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
16020         we know that we need to concatenate (full typename can never be
16021         null). 
16022
16023         * class.cs: ditto.
16024
16025         * statement.cs: Use a bitfield;  Do not initialize to null things
16026         which are done by the constructor by default.
16027
16028         * cs-parser.jay: bug fix, parameter was 4, not 3.
16029
16030         * expression.cs: Just use the property;
16031
16032         * statement.cs: No need for GetVariableInfo method.
16033
16034 2003-08-08  Martin Baulig  <martin@ximian.com>
16035
16036         * flowanalysis.cs (FlowReturns): This is now nested in the
16037         `FlowBranching' class.
16038         (MyBitVector): Moved this here from statement.cs.
16039         (FlowBranching.SiblingType): New enum type.
16040         (FlowBranching.CreateSibling): Added `SiblingType' argument.
16041
16042 2003-08-07  Martin Baulig  <martin@ximian.com>
16043
16044         * flowanalysis.cs (FlowBranchingType): This is now nested in the
16045         `FlowBranching' class and called `BranchingType'.
16046
16047 2003-08-07  Martin Baulig  <martin@ximian.com>
16048
16049         * flowanalysis.cs: Moved all the control flow analysis code into
16050         its own file.
16051
16052 2003-08-07  Martin Baulig  <martin@ximian.com>
16053
16054         * assign.cs (Assign.DoResolve): `target' must either be an
16055         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
16056         #37319.
16057
16058 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
16059
16060         * expression.cs (BinaryMethod): This kind of expression is created by the
16061         Binary class if it determines that the operator has to be handled
16062         by a method.
16063
16064         (BinaryDelegate): This kind of expression is created if we are
16065         dealing with a + or - operator on delegates.
16066
16067         (Binary): remove method, argumetns, and DelegateOperator: when
16068         dealing with methods, 
16069
16070         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
16071
16072         * statement.cs (Block): use bitfields for the three extra booleans
16073         we had in use.   Remove unused topblock parameter.
16074
16075         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
16076
16077         * assign.cs: Drop extra unneeded tests.
16078
16079 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
16080
16081         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
16082
16083         * statement.cs (Foreach): Use VariableStorage instead of
16084         LocalBuilders.   
16085
16086         * codegen.cs (VariableStorage): New class used by clients that
16087         require a variable stored: locals or fields for variables that
16088         need to live across yield.
16089
16090         Maybe provide a convenience api for EmitThis+EmitLoad?
16091
16092         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
16093         these bad boys.
16094
16095 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
16096
16097         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
16098         RemapParameterLValue): New methods that are used to turn a
16099         precomputed FieldInfo into an expression like this:
16100
16101                 instance.FieldInfo
16102
16103         The idea is to use this instead of making LocalVariableReference
16104         have more than one meaning.
16105
16106         * cs-parser.jay: Add error production to BASE.
16107
16108         * ecore.cs: Deal with TypeManager.GetField returning null, which
16109         is now a valid return value.
16110
16111         (FieldExprNoAddress): New expression for Fields whose address can
16112         not be taken.
16113
16114         * expression.cs (LocalVariableReference): During the resolve
16115         phases, create new expressions if we are in a remapping context.
16116         Remove code that dealt with remapping here.
16117
16118         (ParameterReference): same.
16119
16120         (ProxyInstance): New expression, like the `This' expression, but
16121         it is born fully resolved.  We know what we are doing, so remove
16122         the errors that are targeted to user-provided uses of `this'.
16123
16124         * statement.cs (Foreach): our variable is now stored as an
16125         Expression;  During resolution, follow the protocol, dont just
16126         assume it will return this.
16127
16128 2003-08-06  Martin Baulig  <martin@ximian.com>
16129
16130         * support.cs (SeekableStreamReader.cs): New public class.
16131
16132         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
16133         SeekableStreamReader instead of the normal StreamReader.
16134
16135 2003-08-04  Martin Baulig  <martin@ximian.com>
16136
16137         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
16138         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
16139         deambiguate casts and delegate invocations.
16140         (parenthesized_expression): Use the new tokens to ensure this is
16141         not a cast of method invocation.
16142
16143         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
16144         when reading a `)' and Deambiguate_CloseParens () was previously
16145         called.
16146
16147         * expression.cs (ParenthesizedExpression): New class.  This is
16148         just used for the CS0075 test.
16149         (Binary.DoResolve): Check for CS0075.   
16150
16151 2003-07-29  Ravi Pratap  <ravi@ximian.com>
16152
16153         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
16154         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
16155         reference comparison.
16156
16157         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
16158         examine the ReturnType for equality - this is necessary in the
16159         cases of implicit and explicit operators whose signature also
16160         includes the return type.
16161
16162 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * namespace.cs: Cache the result of the namespace computation,
16165         instead of computing it every time.
16166
16167 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
16168
16169         * decl.cs: Use a global arraylist that we reuse over invocations
16170         to avoid excesive memory consumption.  Reduces memory usage on an
16171         mcs compile by one meg (45 average).
16172
16173         * typemanager.cs (LookupTypeReflection): In .NET pointers are
16174         private, work around that.
16175
16176 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
16177
16178         * literal.cs (IntLiteral): Define Zero and One static literals. 
16179
16180         * cs-parser.jay (integer_literal): use static literals to reduce
16181         memory usage for the most used literals (0, 1 and -1).  211kb
16182         reduced in memory usage.
16183
16184         Replace all calls to `new ArrayList' with `new
16185         ArrayList(4)' which is a good average number for most allocations,
16186         and also requires only 16 bytes of memory for its buffer by
16187         default. 
16188
16189         This reduced MCS memory usage in seven megabytes for the RSS after
16190         bootstrapping.
16191
16192 2003-07-28  Ravi Pratap  <ravi@ximian.com>
16193
16194         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
16195         handle params methods the correct way by forming only one
16196         applicable set with params and normal methods in them. Earlier we
16197         were looking at params methods only if we found no normal methods
16198         which was not the correct thing to do.
16199
16200         (Invocation.BetterFunction): Take separate arguments indicating
16201         when candidate and the best method are params methods in their
16202         expanded form.
16203
16204         This fixes bugs #43367 and #46199.
16205
16206         * attribute.cs: Documentation updates.
16207
16208         (CheckAttribute): Rename to CheckAttributeTarget.
16209         (GetValidPlaces): Rename to GetValidTargets.
16210
16211         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
16212         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
16213
16214         Fixes bug #44468.
16215
16216 2003-07-28  Martin Baulig  <martin@ximian.com>
16217
16218         * class.cs (TypeContainer.DefineMembers): Use the base type's full
16219         name when looking up the base class of a nested class.  Fixes #46977.
16220
16221 2003-07-26  Martin Baulig  <martin@ximian.com>
16222
16223         * expression.cs (Indexers.Indexer): New nested struct; contains
16224         getter, setter and the indexer's type.
16225         (Indexers.Properties): This is now an ArrayList of
16226         Indexers.Indexer's.
16227         (IndexerAccess.DoResolveLValue): Correctly set the type if the
16228         indexer doesn't have any getters.
16229
16230         * assign.cs (Assign.DoResolve): Also do the implicit conversions
16231         for embedded property and indexer assignments.
16232
16233 2003-07-26  Martin Baulig  <martin@ximian.com>
16234
16235         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
16236         preprocessor directive is not the first non-whitespace character
16237         on a line.
16238
16239 2003-07-26  Martin Baulig  <martin@ximian.com>
16240
16241         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
16242         namespace parsing, follow the spec more closely.
16243
16244         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
16245         NamespaceEntry.Lookup().
16246
16247 2003-07-25  Martin Baulig  <martin@ximian.com>
16248
16249         * MethodCore.cs (OverridesSomething): New public field; it's set
16250         from TypeContainer.DefineMembers if this method overrides
16251         something (which doesn't need to be a method).  Fix #39462.
16252
16253 2003-07-25  Ravi Pratap  <ravi@ximian.com>
16254
16255         * typemanager.cs (GetMembers): Ensure that the list of members is
16256         reversed. This keeps things in sync.
16257
16258         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
16259         find an AttributeUsage attribute.
16260
16261         * expression.cs (Invocation.OverloadResolve): Perform the check
16262         which disallows Invoke to be directly called on a Delegate.
16263
16264         (Error_InvokeOnDelegate): Report error cs1533.
16265
16266 2003-07-25  Martin Baulig  <martin@ximian.com>
16267
16268         * expression.cs (Indexers.GetIndexersForType): Only look in the
16269         interface hierarchy if the requested type is already an
16270         interface.  Fixes #46788 while keeping #46502 fixed.
16271
16272 2003-07-25  Martin Baulig  <martin@ximian.com>
16273
16274         * class.cs (TypeContainer.DefineMembers): Check whether all
16275         readonly fields have been assigned and report warning CS0649 if
16276         not.
16277
16278         * statement.cs (LocalInfo.IsFixed): Always return true if this is
16279         a valuetype.
16280
16281 2003-07-24  Ravi Pratap  <ravi@ximian.com>
16282
16283         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
16284         returned from GetMethods to make things consistent with the
16285         assumptions MCS makes about ordering of methods.
16286
16287         This should comprehensively fix bug #45127 and it does :-)
16288
16289         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
16290         ordering is actually reverse.
16291
16292         * Clean up some debug messages I left lying around.
16293
16294         * interface.cs (Populate*): Get rid of code which emits attributes
16295         since the stage in which we emit attributes is the 'Emit' stage,
16296         not the define stage.
16297
16298         (Emit): Move attribute emission for interface members here.
16299
16300 2003-07-22  Ravi Pratap  <ravi@ximian.com>
16301
16302         * expression.cs (Invocation.OverloadResolve): Follow the spec more
16303         closely: we eliminate methods in base types when we have an
16304         applicable method in a top-level type.
16305
16306         Please see section 14.5.5.1 for an exact description of what goes
16307         on. 
16308
16309         This fixes bug #45127 and a host of other related to corlib compilation.
16310
16311         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
16312         array is the method corresponding to the top-level type (this is
16313         because of the changes made to icall.c) so we change this
16314         accordingly.
16315
16316         (MethodGroupExpr.Name): This too.
16317
16318         * typemanager.cs (GetElementType): New method which does the right
16319         thing when compiling corlib. 
16320
16321         * everywhere: Make use of the above in the relevant places.
16322
16323 2003-07-22  Martin Baulig  <martin@ximian.com>
16324
16325         * cs-parser.jay (invocation_expression): Moved
16326         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
16327         `cast_expression', but create a InvocationOrCast which later
16328         resolves to either an Invocation or a Cast.
16329
16330         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
16331         method; call this before EmitStatement() to make sure that this
16332         expression can be used as a statement.
16333
16334         * expression.cs (InvocationOrCast): New class; resolves to either
16335         an Invocation or a Cast.
16336
16337         * statement.cs (StatementExpression): Call ResolveStatement() on
16338         the ExpressionStatement before emitting it.
16339
16340 2003-07-21  Martin Baulig  <martin@ximian.com>
16341
16342         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
16343         `ref' and `out' attributes match; fixes #46220.
16344         (MemberAccess.ResolveMemberAccess): You can't reference a type
16345         through an expression; fixes #33180.
16346         (Indexers.GetIndexersForType): Don't return the indexers from
16347         interfaces the class implements; fixes #46502.
16348
16349 2003-07-21  Martin Baulig  <martin@ximian.com>
16350
16351         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
16352         CS0661 checks; fixes bug #30442.
16353
16354 2003-07-21  Martin Baulig  <martin@ximian.com>
16355
16356         * decl.cs (AdditionResult): Added `Error'.
16357
16358         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
16359
16360         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
16361         makes cs0031.cs actually work.
16362
16363 2003-07-20  Martin Baulig  <martin@ximian.com>
16364
16365         * namespace.cs: Fixed that bug which caused a crash when compiling
16366         the debugger's GUI.
16367
16368 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
16369
16370         * typemanager.cs (LookupTypeReflection): Never expose types which
16371         are NotPublic, NestedPrivate, NestedAssembly, or
16372         NestedFamANDAssem.  We used to return these, and later do a check
16373         that would report a meaningful error, but the problem is that we
16374         would not get the real match, if there was a name override.
16375
16376 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * namespace.cs (Namespace, Name): Do not compute the namespace
16379         name dynamically, compute it in the constructor.  This reduced
16380         memory usage by 1697 KB.
16381
16382         * driver.cs: Use --pause to pause at the end.
16383
16384 2003-07-17  Peter Williams  <peter@newton.cx>
16385
16386         * Makefile: Change the name of the test target so that it doesn't
16387         conflict with the recursive test target.
16388
16389 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
16390
16391         * expression.cs (LocalVariableReference.Emit, EmitAssign,
16392         AddressOf): Do not use EmitThis, that was wrong, use the actual
16393         this pointer.
16394
16395 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
16396
16397         * class.cs (MethodData.Define): While checking if a method is an
16398         interface implementation, improve the test: If we are not public
16399         (use new test here: use the computed MethodAttributes directly,
16400         instead of the parsed modifier flags) check if the `implementing'
16401         method comes from an interface or not.
16402
16403         * pending.cs (VerifyPendingMethods): Slightly better error
16404         message.
16405
16406         * makefile: add test target that does the mcs bootstrap.
16407
16408 2003-07-16  Ravi Pratap  <ravi@ximian.com>
16409
16410         * interface.cs (Define): Do nothing here since there are no
16411         members to populate etc. Move the attribute emission out of here
16412         since this was just totally the wrong place to put it. Attribute
16413         application happens during the 'Emit' phase, not in the 'Define'
16414         phase.
16415
16416         (Emit): Add this method and move the attribute emission here
16417
16418         * rootcontext.cs (EmitCode): Call the Emit method on interface
16419         types too.
16420
16421 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16422
16423         * expression.cs (OverloadResolve): Report error only if Location
16424         is not 'Null' which means that there was a probe going on.
16425
16426 2003-07-14  Martin Baulig  <martin@ximian.com>
16427
16428         * expression.cs (ConditionalLogicalOperator): New public class to
16429         implement user defined conditional logical operators.
16430         This is section 14.11.2 in the spec and bug #40505.
16431
16432 2003-07-14  Martin Baulig  <martin@ximian.com>
16433
16434         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
16435
16436 2003-07-14  Martin Baulig  <martin@ximian.com>
16437
16438         * codegen.cs (EmitContext.InFixedInitializer): New public field.
16439
16440         * ecore.cs (IVariable.VerifyFixed): New interface method.
16441
16442         * expression.cs (Unary.ResolveOperator): When resolving the `&'
16443         operator, check whether the variable is actually fixed.  Fixes bug
16444         #36055.  Set a variable definitely assigned when taking its
16445         address as required by the spec.
16446
16447         * statement.cs (LocalInfo.IsFixed): New field.
16448         (LocalInfo.MakePinned): Set `IsFixed' to true.
16449
16450 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
16451
16452         * attribute.cs (Attribute.Resolve): While doing a Member lookup
16453         for .ctors, ensure that we only ask for members declared in the
16454         attribute type (BindingFlags.DeclaredOnly).
16455
16456         Fixes bug #43632.
16457
16458         * expression.cs (Error_WrongNumArguments): Report error 1501
16459         correctly the way CSC does.
16460
16461 2003-07-13  Martin Baulig  <martin@ximian.com>
16462
16463         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
16464         lookup on the fully qualified name, to make things like "X.X" work
16465         where "X.X" is a fully qualified type name, but we also have a
16466         namespace "X" in the using list.  Fixes #41975.
16467
16468 2003-07-13  Martin Baulig  <martin@ximian.com>
16469
16470         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
16471         function. If we're a CompoundAssign, we need to create an embedded
16472         CompoundAssign, not an embedded Assign.
16473         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
16474         Fixes #45854.
16475
16476 2003-07-13  Martin Baulig  <martin@ximian.com>
16477
16478         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
16479         work to fix bug #46088.
16480
16481 2003-07-13  Ravi Pratap <ravi@ximian.com>
16482
16483         * class.cs (Operator.Emit): Do not emit attributes here - it is
16484         taken care of by the Method class that we delegate too. This takes
16485         care of bug #45876.
16486
16487 2003-07-10  Martin Baulig  <martin@ximian.com>
16488
16489         * expression.cs (TypeOfVoid): New class.
16490         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
16491
16492 2003-07-10  Martin Baulig  <martin@ximian.com>
16493
16494         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
16495         bug #35957.
16496
16497 2003-07-10  Martin Baulig  <martin@ximian.com>
16498
16499         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
16500         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
16501
16502         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
16503
16504         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
16505
16506 2003-07-10  Martin Baulig  <martin@ximian.com>
16507
16508         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
16509         of decimal.  Fixes #42850.
16510
16511         NOTE: I also fixed the created byte blob, but this doesn't work on
16512         the MS runtime and csc never produces any byte blobs for decimal
16513         arrays.
16514
16515 2003-07-10  Martin Baulig  <martin@ximian.com>
16516
16517         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
16518         structs; fixes #32068.
16519         (Block.AddChildVariableNames): Fixed #44302.
16520
16521 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16522
16523         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
16524
16525 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16526
16527         * attribute.cs: And this test is onger needed.
16528
16529 2003-07-08  Martin Baulig  <martin@ximian.com>
16530
16531         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
16532         inaccessible types.  Fixes #36313.
16533
16534         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
16535
16536         * namespace.cs (NamespaceEntry): Create implicit entries for all
16537         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
16538         implicit entries for N1.N2 and N1.
16539
16540 2003-07-08  Martin Baulig  <martin@ximian.com>
16541
16542         Rewrote the handling of namespaces to fix a lot of the issues
16543         wrt. `using' aliases etc.
16544
16545         * namespace.cs (Namespace): Splitted this class into a
16546         per-assembly `Namespace' and a per-file `NamespaceEntry'.
16547
16548         * typemanager.cs (TypeManager.IsNamespace): Removed.
16549         (TypeManager.ComputeNamespaces): Only compute namespaces from
16550         loaded assemblies here, not the namespaces from the assembly we're
16551         currently compiling.
16552
16553 2003-07-08  Martin Baulig  <martin@ximian.com>
16554
16555         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
16556
16557 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16558
16559         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
16560         already fixed it.  
16561
16562         I thought about the memory savings here, but LookupTypeReflection
16563         is used under already very constrained scenarios.  Compiling
16564         corlib or mcs only exposes one hit, so it would not really reduce
16565         any memory consumption.
16566
16567 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16568
16569         * typemanager.cs: fixes bug #45889 by only adding public types from
16570         other assemblies to the list of known types.
16571
16572 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
16573
16574         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
16575         on the type we resolved.
16576
16577 2003-07-05  Martin Baulig  <martin@ximian.com>
16578
16579         * pending.cs (PendingImplementation.ParentImplements): Don't
16580         create the proxy if the parent is abstract.
16581
16582         * class.cs (TypeContainer.DefineIndexers): Process explicit
16583         interface implementations first.  Fixes #37714.
16584
16585 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
16586
16587         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
16588         defined recursively;  but since we modify the input parameters
16589         (left is set to `this' temporarily), we reset this value if the
16590         left_is_explicit is false, which gives the original semantics to
16591         the code.  
16592
16593         * literal.cs (NullPointer): new class used to represent a null
16594         literal in a pointer context.
16595
16596         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
16597         type is a pointer, use a NullPointer object instead of a
16598         NullLiteral.   Closes 43687
16599
16600         (ExplicitConversion): Convert pointer values using
16601         the conv opcode to the proper type.
16602
16603         * ecore.cs (New): change ValueTypeVariable property into a method,
16604         that returns whether the valuetype is suitable for being used.
16605
16606         * expression.cs (Binary.DoNumericPromotions): Only return if we
16607         the int constant was a valid uint, and we can return both left and
16608         right as uints.  If not, we continue processing, to trigger the
16609         type conversion.  This fixes 39018.
16610
16611         * statement.cs (Block.EmitMeta): During constant resolution, set
16612         the CurrentBlock property on the emitcontext, so that we resolve
16613         constants propertly.
16614
16615 2003-07-02  Martin Baulig  <martin@ximian.com>
16616
16617         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
16618         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
16619
16620         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
16621         than emitting it here.
16622
16623         * statement.cs: Fixed some more flow analysis bugs.
16624
16625 2003-07-02  Martin Baulig  <martin@ximian.com>
16626
16627         * class.cs (MethodData.Define): When implementing interface
16628         methods, set Final unless we're Virtual.
16629
16630         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
16631         check work for interface methods.
16632
16633 2003-07-01  Martin Baulig  <martin@ximian.com>
16634
16635         * ecore.cs (EmitContext.This): Replaced this property with a
16636         GetThis() method which takes a Location argument.  This ensures
16637         that we get the correct error location for a CS0188.
16638
16639 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
16642         ImplicitStandardConversion.
16643
16644         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
16645
16646 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
16647
16648         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
16649         optimization.
16650
16651 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
16652
16653         * class.cs (Constructor.Define): Turn off initlocals for unsafe
16654         constructors.
16655
16656         (MethodData.Define): Turn off initlocals for unsafe methods.
16657
16658 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
16659
16660         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
16661         complete;  Fixes #37521.
16662
16663         * delegate.cs: Use Modifiers.TypeAttr to compute the
16664         TypeAttributes, instead of rolling our own.  This makes the flags
16665         correct for the delegates.
16666
16667 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
16668
16669         * class.cs (Constructor.Define): Set the private flag for static
16670         constructors as well.
16671
16672         * cs-parser.jay (statement_expression): Set the return value to
16673         null, to avoid a crash when we catch an error.
16674
16675 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
16676
16677         * cs-parser.jay: Applied patch from Jackson that adds support for
16678         extern and unsafe modifiers to destructor declarations.
16679
16680         * expression.cs: Report error 21 if the user is trying to index a
16681         System.Array.
16682
16683         * driver.cs: Add an error message, suggested by the bug report.
16684
16685         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
16686         if we do not have a ": this ()" constructor initializer.  Fixes 45149
16687
16688 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
16689
16690         * namespace.cs: Add some information to reduce FAQs.
16691
16692 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
16693
16694         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
16695         underlying enumeration types.  Fixes #43915.
16696
16697         * expression.cs: Treat ushort/short as legal values to be used in
16698         bitwise operations.
16699
16700 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
16701
16702         * delegate.cs: transfer custom attributes for paramenters from
16703         the delegate declaration to Invoke and BeginInvoke.
16704
16705 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
16706
16707         * attribute.cs: handle custom marshalers and emit marshal info
16708         for fields, too.
16709
16710 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
16711
16712         * makefile.gnu: Added anonymous.cs to the compiler sources.
16713
16714 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
16715
16716         * iterators.cs: Change the name of the proxy class to include two
16717         underscores.
16718
16719         * cs-parser.jay: Update grammar to include anonymous methods.
16720
16721         * anonymous.cs: new file.
16722
16723 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
16724
16725         * class.cs (Field.Define): Add missing test for pointers and
16726         safety. 
16727
16728 2003-05-27  Ravi Pratap  <ravi@ximian.com>
16729
16730         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
16731         we use the stobj opcode.
16732
16733         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
16734         since it wasn't the correct fix. 
16735
16736         It still is puzzling that we are required to use stobj for IntPtr
16737         which seems to be a ValueType.
16738
16739 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
16740
16741         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
16742         during regular simple name resolution.   Now, the trick is that
16743         instead of returning for processing the simplename, we do a
16744         TypeManager.LookupType (ie, a rooted lookup as opposed to a
16745         contextual lookup type).   If a match is found, return that, if
16746         not, return for further composition.
16747
16748         This fixes long-standing 30485.
16749
16750         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16751         using the address to initialize an object, do an Stobj instead of
16752         using the regular Stelem.
16753
16754         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
16755         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
16756         Because if we are a BaseIndexerAccess that value will be true.
16757         Fixes 43643.
16758
16759         * statement.cs (GotoCase.Resolve): Return after reporting an
16760         error, do not attempt to continue. 
16761
16762         * expression.cs (PointerArithmetic.Emit): If our operand is a
16763         long, convert our constants to match the operand before
16764         multiplying.  Convert to I type before adding.   Fixes 43670.
16765
16766 2003-05-14  Ravi Pratap  <ravi@ximian.com>
16767
16768         * enum.cs (ImplicitConversionExists) : Rename to
16769         ImplicitEnumConversionExists to remove ambiguity. 
16770
16771         * ecore.cs (NullCast): New type of cast expression class which
16772         basically is very similar to EmptyCast with the difference being
16773         it still is a constant since it is used only to cast a null to
16774         something else
16775         (eg. (string) null)
16776
16777         * convert.cs (ImplicitReferenceConversion): When casting a null
16778         literal, we return a NullCast.
16779
16780         * literal.cs (NullLiteralTyped): Remove - I don't see why this
16781         should be around anymore.
16782
16783         The renaming (reported was slightly wrong). Corrections:
16784
16785         ConvertImplicitStandard -> ImplicitConversionStandard
16786         ConvertExplicitStandard -> ExplicitConversionStandard
16787
16788         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
16789         before passing them in !
16790
16791         * convert.cs (ImplicitConversionStandard): When comparing for
16792         equal expr and target types, ensure that expr is not a
16793         NullLiteral.
16794
16795         In general, we must not be checking (expr_type ==
16796         target_type) in the top level conversion methods
16797         (ImplicitConversion, ExplicitConversion etc). This checking is
16798         done in the methods that they delegate to.
16799
16800 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
16801
16802         * convert.cs: Move Error_CannotConvertType,
16803         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
16804         ImplicitNumericConversion, ImplicitConversionExists,
16805         ImplicitUserConversionExists, StandardConversionExists,
16806         FindMostEncompassedType, FindMostSpecificSource,
16807         FindMostSpecificTarget, ImplicitUserConversion,
16808         ExplicitUserConversion, GetConversionOperators,
16809         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
16810         TryImplicitIntConversion, Error_CannotConvertImplicit,
16811         ConvertImplicitRequired, ConvertNumericExplicit,
16812         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
16813         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
16814         its own file.
16815
16816         Perform the following renames:
16817
16818         StandardConversionExists -> ImplicitStandardConversionExists
16819         ConvertImplicit -> ImplicitConversion
16820         ConvertImplicitStandard -> ImplicitStandardConversion
16821         TryImplicitIntConversion -> ImplicitIntConversion
16822         ConvertImplicitRequired -> ImplicitConversionRequired
16823         ConvertNumericExplicit -> ExplicitNumericConversion
16824         ConvertReferenceExplicit -> ExplicitReferenceConversion
16825         ConvertExplicit -> ExplicitConversion
16826         ConvertExplicitStandard -> ExplicitStandardConversion
16827
16828 2003-05-19  Martin Baulig  <martin@ximian.com>
16829
16830         * statement.cs (TypeInfo.StructInfo): Made this type protected.
16831         (TypeInfo): Added support for structs having structs as fields.
16832
16833         * ecore.cs (FieldExpr): Implement IVariable.
16834         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
16835         VariableInfo for the field.
16836
16837 2003-05-18  Martin Baulig  <martin@ximian.com>
16838
16839         * expression.cs (This.DoResolve): Report a CS0027 if we're
16840         emitting a field initializer.
16841
16842 2003-05-18  Martin Baulig  <martin@ximian.com>
16843
16844         * expression.cs (This.ResolveBase): New public function.
16845         (This.DoResolve): Check for CS0188.
16846
16847         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
16848         This.Resolve().
16849
16850         * ecore.cs (MethodGroupExpr.DoResolve): Set the
16851         `instance_expression' to null if we don't have any non-static
16852         methods.
16853
16854 2003-05-18  Martin Baulig  <martin@ximian.com>
16855
16856         Reworked the way how local variables and parameters are handled by
16857         the flow analysis code.
16858
16859         * statement.cs (TypeInfo, VariableMap): New public classes.
16860         (VariableInfo): New public class.  This is now responsible for
16861         checking whether a variable has been assigned.  It is used for
16862         parameters and local variables.
16863         (Block.EmitMeta): Take the InternalParameters as argument; compute
16864         the layout of the flow vectors here.
16865         (Block.LocalMap, Block.ParameterMap): New public properties.
16866         (FlowBranching): The .ctor doesn't get the InternalParameters
16867         anymore since Block.EmitMeta() now computes the layout of the flow
16868         vector.
16869         (MyStructInfo): This class is now known as `StructInfo' and nested
16870         in `TypeInfo'; we don't access this directly anymore.
16871
16872         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
16873         property and removed IsAssigned(), IsFieldAssigned(),
16874         SetAssigned() and SetFieldAssigned(); we now call them on the
16875         VariableInfo so we don't need to duplicate this code everywhere.
16876
16877         * expression.cs (ParameterReference): Added `Block block' argument
16878         to the .ctor.
16879         (LocalVariableReference, ParameterReference, This): The new
16880         VariableInfo class is now responsible for all the definite
16881         assignment stuff.
16882
16883         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
16884         IsParameterAssigned, SetParameterAssigned): Removed.
16885
16886 2003-05-18  Martin Baulig  <martin@ximian.com>
16887
16888         * typemanager.cs (InitCoreTypes): Try calling
16889         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
16890         the 3-args-version.  Corlib now also needs our `void_type'.
16891         (GetMethod): Added overloaded version which takes an optional
16892         `bool report_errors' to allow lookups of optional methods.
16893
16894 2003-05-12  Martin Baulig  <martin@ximian.com>
16895
16896         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
16897         only used for locals and not for parameters.
16898
16899 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
16900
16901         * support.cs (InternalParameters.ParameterType): Return the
16902         ExternalType of the parameter.
16903
16904         * parameter.cs (Parameter.ExternalType): drop the two arguments,
16905         they were unused.
16906
16907 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
16908
16909         * class.cs (MethodData.Define): Do not set the `newslot' on
16910         interface members, if they are also flagged as "override".
16911
16912         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
16913         better code for ++i and i++.  This only works for static fields
16914         and local variables.
16915
16916         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
16917         want to pull the DeclSpace out of the builder_to_declspace instead
16918         of the TypeBuilder (like in TypeContainer.FindMembers).
16919
16920         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
16921         instead of LookupTypeContainer.  Fixes the crash on .NET for
16922         looking up interface members.
16923
16924         * const.cs: Create our own emit context during the Definition
16925         stage, so that constants are evaluated in the proper context, when
16926         a recursive definition happens.
16927
16928 2003-05-11  Martin Baulig  <martin@ximian.com>
16929
16930         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
16931         new block for a switch section.
16932         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
16933         the adding/lookup in the switch block.  Fixes #39828.
16934
16935 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
16936
16937         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
16938         functionality: I needed to convert the data after I had performed
16939         the add/sub operation into the operands type size.
16940
16941         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
16942         pass the type for the box operation, otherwise the resulting
16943         object would have been of type object.
16944
16945         (BoxedCast): Add constructor to specify the type to box as.
16946
16947 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
16948
16949         * iterators.cs: I was reusing the `count' variable inadvertently,
16950         take steps to not allow this to happen.
16951
16952 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
16953
16954         * attribute.cs (Attribute.Resolve): Params attributes are encoded
16955         by creating an array at the point where the params starts and
16956         putting all those arguments there, then adjusting the size of the
16957         array.
16958
16959 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * expression.cs (New.AddressOf): Implement interface
16962         IMemoryLocation.  This is used when the `new' operator is used in
16963         the context of an invocation to a method on a value type.
16964
16965         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
16966         example. 
16967
16968         * namespace.cs: Also check the using aliases here.
16969
16970         * driver.cs: Move the test for using validity after the types have
16971         been entered, so we do a single pass that also includes the using
16972         aliases. 
16973
16974         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
16975         in the regular case.   CreateSiblingForFinally is doing extra
16976         error checking.
16977
16978         * attribute.cs (GetAttributeArgumentExpression): Store the result
16979         on an out value, and use the return value to indicate failure
16980         instead of using null (which is a valid return for Constant.GetValue).
16981
16982         * statement.cs: Perform the analysis flow for the increment
16983         portion after the statement, because this will be the real flow of
16984         execution.  Fixes #42385
16985
16986         * codegen.cs (EmitContext.EmitArgument,
16987         EmitContext.EmitStoreArgument): New helper functions when the
16988         RemapToProxy flag is set.
16989
16990         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
16991         function.
16992
16993         Add support for remapping parameters. 
16994
16995         * iterators.cs: Propagate parameter values;  Store parameter
16996         values in the proxy classes.
16997
16998 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
16999
17000         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
17001         need a proxy reference;  I do not know what I was thinking
17002
17003         * cs-parser.jay (constructor_initializer): catch another error,
17004         and display nice message.
17005
17006         (field_declaration): catch void field declaration
17007         to flag a better error. 
17008
17009         * class.cs (MemberBase.CheckBase): Report an error instead of a
17010         warning if a new protected member is declared in a struct. 
17011         (Field.Define): catch the error of readonly/volatile.
17012
17013         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
17014
17015         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
17016         volatile variable is taken
17017
17018 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
17019
17020         * statement.cs (Fixed.Resolve): Report an error if we are not in
17021         an unsafe context.
17022
17023 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
17024
17025         * typemanager.cs: reuse the code that handles type clashes for
17026         delegates and enumerations.
17027
17028         * class.cs (Report28): Always report.
17029
17030         * expression.cs (EncodeAsAttribute): Allow nulls here.
17031
17032 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
17033
17034         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
17035         the functionality for testing whether an expression is valid for
17036         an attribute here.  Also handle the case of arrays of elements
17037         being stored. 
17038
17039         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
17040         encoding a linear array into an array of objects that are suitable
17041         to be passed to an CustomAttributeBuilder.
17042
17043         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
17044
17045         * ecore.cs: (FieldExpr): Handle field remapping here.
17046
17047         * iteratators.cs: Pass the instance variable (if the method is an
17048         instance method) to the constructors, so we can access the field
17049         variables on the class.
17050
17051         TODO: Test this with structs.  I think the THIS variable on
17052         structs might have to be a pointer, and not a refenrece
17053
17054 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
17055
17056         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
17057         local variables to fields in a proxy class.
17058
17059         * iterators.cs (PopulateProxy): Rename our internal fields to
17060         <XXX>.  
17061         Create a <THIS> field if we are an instance method, so we can
17062         reference our parent container variables.
17063         (MapVariable): Called back from the EmitContext code to enter a
17064         new variable to field mapping into the proxy class (we just create
17065         a FieldBuilder).
17066
17067         * expression.cs
17068         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
17069         for using the remapped locals to fields.
17070
17071         I placed the code here, because that gives the same semantics to
17072         local variables, and only changes the Emit code.
17073
17074         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
17075         statements inside iterators.
17076         (VariableInfo): Add a FieldBuilder for the cases when we are
17077         remapping local variables to fields in a proxy class
17078
17079         * ecore.cs (SimpleNameResolve): Avoid testing two times for
17080         current_block != null.
17081
17082         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
17083         not cope with strings, as it has been moved to the
17084         TableSwitchEmit.  Fixed bug in switch generation.
17085
17086         * expression.cs (New.DoResolve): Provide more context for the user
17087         when reporting an error.
17088
17089         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
17090         pointers. 
17091
17092         * expression.cs (MemberAccess.DoResolve): When we get a type back,
17093         check the permissions for it.  Note than in a type-resolution
17094         context the check was already present in DeclSpace.ResolveType,
17095         but was missing from the MemberAccess.
17096
17097         (ArrayCreation.CheckIndices): warn if the user has
17098         more nested levels of expressions, but there are no more
17099         dimensions specified.  Avoids crash on bug 41906.
17100
17101 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
17102
17103         * statement.cs (Block): replace Implicit bool, for a generic
17104         flags.   
17105         New flag: `Unchecked'.  This is used during the EmitMeta phase
17106         (which is out-of-line with the regular Resolve/Emit process for a
17107         statement, as this is done ahead of time, but still gets a chance
17108         to call constant resolve).
17109
17110         (Block.Flags): new enum for adding a new flag.
17111
17112         (Block.EmitMeta): track the state of unchecked.
17113
17114         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
17115         to enable constant resolution to work there as well.
17116
17117 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
17118
17119         * typemanager.cs (ienumerable_type): Also look up
17120         System.Collections.IEnumerable. 
17121
17122 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
17123
17124         TODO: Test more than one conditional per method.
17125
17126         * class.cs (Indexer.Define): Report the location where the user is
17127         referencing the unsupported feature.
17128
17129         (MethodData): Overload the use of `conditionals' to
17130         minimize the creation of needless ArrayLists.   This saves roughly
17131         212kb on my machine.
17132
17133         (Method): Implement the new IIteratorContainer interface.
17134         (Method.SetYields): Implement the method by setting the ModFlags
17135         to contain METHOD_YIELDS.
17136
17137         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
17138         which just got set to null.
17139
17140         * iterators.cs: New file.
17141
17142         (Yield, YieldBreak): New statements.
17143
17144         * statement.cs (Return.Resolve): Flag an error if we are used in
17145         an iterator method.
17146
17147         * codegen.cs (InIterator): New flag set if the code is being
17148         compiled in an iterator method.
17149
17150         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
17151         internal modifier, and we just use it to avoid adding extra
17152         fields, as this is seldom used.  
17153
17154         * cs-parser.jay: Add yield_statement (yield and yield break).
17155
17156         * driver.cs: New flag -v2 to turn on version 2 features. 
17157
17158         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
17159         hashtable when v2 is enabled.
17160
17161 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
17162
17163         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
17164         there is already a namespace defined with this name.
17165
17166         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
17167         people upgraded their corlibs.
17168
17169         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
17170         always use fully qualified types, no need to use the compiler
17171         front end.
17172
17173         (TypeManager.IsNamespace): Use binarysearch.
17174
17175         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
17176         AddDelegate): I did not quite use the new IsValid API properly: I
17177         have to pass the short-name and the fullname.  I was passing only
17178         the basename instead of the fullname sometimes. 
17179
17180         (TypeContainer.DefineType): call NamespaceClash.
17181
17182         * interface.cs (Interface.DefineType): use NamespaceClash before
17183         defining the type.
17184
17185         * delegate.cs (Delegate.DefineType): use NamespaceClash before
17186         defining the type.
17187
17188         * enum.cs: (Enum.DefineType): use NamespaceClash before
17189         defining the type.
17190
17191         * typemanager.cs (: 3-line patch that gives us some tasty 11%
17192         speed increase.  First, use the negative_hits cache when we get a
17193         negative.  Second, add the type with its full original name
17194         instead of the new . and + encoded name (reflection uses + to
17195         separate type from a nested type).  Use LookupTypeReflection
17196         directly which bypasses the type->name hashtable (that we already
17197         know does not contain the type.
17198
17199         * decl.cs (DeclSpace.ResolveTypeExpr): track the
17200         location/container type. 
17201
17202         * driver.cs: When passing utf8, use directly the UTF8Encoding.
17203
17204 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
17205
17206         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
17207
17208         * delegate.cs (NewDelegate.Resolve): Test whether an instance
17209         method is being referenced in the method group from a static
17210         context, and report error 120 if so.
17211
17212         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
17213         Error118. 
17214
17215         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
17216         is created, we create the A namespace).
17217
17218         * cs-parser.jay: A namespace also introduces a DeclarationFound.
17219         Fixes #41591
17220
17221 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
17222
17223         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
17224         invocation to ModuleBuilder.GetType with the same values will
17225         return a new type instance, so we need to cache its return
17226         values. 
17227
17228         * expression.cs (Binary.ResolveOperator): Only allow the compare
17229         operators on enums if they are of the same type.
17230
17231         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
17232         types of ValueType on their own case.  Before we were giving them
17233         the same treatment as objects.
17234
17235         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
17236         fullname.  Short name is used to compare against container name.
17237         Fullname is used to check against defined namespace names.
17238
17239         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
17240         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
17241
17242         (Method.CheckBase): Call parent.
17243         (MemberBase.CheckBase): Check for protected members on sealed
17244         classes.
17245         (PropertyBase.CheckBase): Call parent.
17246         (Field.Define): Call parent.
17247
17248         * report.cs: Negative error codes are now mapped to 8000 - code,
17249         so that the display is render more nicely.
17250
17251         * typemanager.cs: Do not use try/catch, instead report a regular
17252         error. 
17253
17254         (GetPointerType, GetReferenceType): These methods provide
17255         mechanisms to obtain the T* and T& from a T.  We had the code
17256         previously scattered around the code base, and it also used
17257         TypeManager.LookupType that would go through plenty of caches.
17258         This one goes directly to the type source.
17259
17260         In some places we did the Type.GetType followed by
17261         ModuleBuilder.GetType, but not in others, so this unifies the
17262         processing as well.
17263
17264         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
17265         statements now that we have namespace information.
17266
17267         * typemanager.cs (IsNamespace): New method, returns whether the
17268         string presented is a namespace or not.
17269
17270         (ComputeNamespaces): New public entry point, computes the list of
17271         available namespaces, using the GetNamespaces API call in Mono, or
17272         the slower version in MS.NET.   
17273
17274         Now before we start the semantic analysis phase, we have a
17275         complete list of namespaces including everything that the user has
17276         provided.
17277
17278         Deleted old code to cache namespaces in .nsc files.
17279
17280 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
17281
17282         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
17283         class/struct location definition Location for the implicit
17284         constructor location.
17285
17286         (Operator.Define): Use the location of the operator for the
17287         implicit Method definition.
17288
17289         (Constructor.Emit): use the constructor location for the implicit
17290         base initializer constructor.
17291
17292         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
17293         and the Expression class now contains two new methods:
17294
17295         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
17296         isolate type lookup from the rest of the resolution process.
17297
17298         Since we use Expressions to hold type definitions due to the way
17299         we parse the input we have historically overloaded Resolve to
17300         perform the Type lookups if a special flag is passed.  Now this is
17301         eliminated and two methods take their place. 
17302
17303         The differences in the two methods between xStep and xTerminal is
17304         that xStep is involved in our current lookup system that uses
17305         SimpleNames to compose a name, while xTerminal is used just to
17306         catch the case where the simplename lookup failed.
17307
17308 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
17309
17310         * expression.cs (ResolveMemberAccess): Remove redundant code.
17311         TypeExpr expressions are always born fully resolved.
17312
17313         * interface.cs (PopulateMethod): Do not lookup the types twice.
17314         We were doing it once during SemanticAnalysis and once during
17315         PopulateMethod.
17316
17317         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
17318         in local variable type definitions, were being returned as a
17319         SimpleName (we decomposed everything into a string), that is
17320         because primary_expression was being used instead of a type in the
17321         grammar (reduce/reduce conflicts).
17322
17323         The part that was wrong is that we converted the expression into a
17324         string (an oversimplification in one hand, compounded with primary
17325         expressions doing string concatenation).
17326
17327         So things like:
17328
17329         A.B.C [] x;
17330
17331         Would return "A.B.C[]" as a SimpleName.  This stopped things like
17332         using clauses from working on this particular context.  And a type
17333         was being matched directly against "A.B.C[]".
17334
17335         We now use the correct approach, and allow for ComposedCast to be
17336         part of the unary expression.  So the "A.B.C []" become a composed
17337         cast of "A.B.C" (as a nested group of MemberAccess with a
17338         SimpleName at the end) plus the rank composition "[]". 
17339
17340         Also fixes 35567
17341
17342 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
17343
17344         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
17345         for the access level checking.
17346
17347         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
17348         `TypeContainer container', because I kept getting confused when I
17349         was debugging this code.
17350
17351         * expression.cs (Indexers): Instead of tracking getters/setters,
17352         we now track them in parallel.  We create one arraylist less, but
17353         most importantly it is possible now for the LValue code to find a
17354         matching get for a set.
17355
17356         (IndexerAccess.DoResolveLValue): Update the code.
17357         GetIndexersForType has been modified already to extract all the
17358         indexers from a type.  The code assumed it did not.
17359
17360         Also make the code set the correct return type for the indexer.
17361         This was fixed a long time ago for properties, but was missing for
17362         indexers.  It used to be void_type.
17363
17364         (Binary.Emit): Test first for doubles instead of
17365         floats, as they are more common.
17366
17367         (Binary.EmitBranchable): Use the .un version of the branch opcodes
17368         when dealing with floats and the <=, >= operators.  This fixes bug
17369         #39314 
17370
17371         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
17372         to load the array value by emitting a load on the foreach variable
17373         type.  This was incorrect.  
17374
17375         We now emit the code to load an element using the the array
17376         variable type, and then we emit the conversion operator.
17377
17378         Fixed #40176
17379
17380 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
17381
17382         * attribute.cs: Avoid allocation of ArrayLists in the common case.
17383
17384 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
17387         test for protection before we test for signatures. 
17388
17389         (MethodSignature.ToString): implement.
17390
17391         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
17392         to the case where we reduced into a LongConstant.
17393
17394         * decl.cs (CheckAccessLevel): If the type is an array, we can not
17395         depend on whether the information is acurrate, because the
17396         Microsoft runtime will always claim that the array type is public,
17397         regardless of the real state.
17398
17399         If the type is a pointer, another problem happens: the type is
17400         reported as non-public in Microsoft.  
17401
17402         In both cases we have to call CheckAccessLevel recursively with
17403         the underlying type as the argument to be tested.
17404
17405 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
17406
17407         * assign.cs (Assign.Emit): If we are dealing with a compound
17408         assignment expression, we should use the code path that stores the
17409         intermediate result in a temporary value.  This fixes #40903.
17410
17411         *expression.cs (Indirection.ToString): Provide ToString method for
17412         debugging. 
17413
17414 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
17415
17416         * class.cs: Null out fields holding references to Block objects so
17417         they can be garbage collected.
17418
17419         * expression.cs (OverloadResolve): Remove unused local.
17420
17421 2003-04-07  Martin Baulig  <martin@ximian.com>
17422
17423         * codegen.cs (EmitContext.CurrentFile): New public field.
17424         (EmitContext.Mark): Use the CurrentFile to check whether the
17425         location is in the correct file.
17426         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
17427
17428 2003-04-07  Martin Baulig  <martin@ximian.com>
17429
17430         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
17431
17432         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
17433         location.  [FIXME: The location argument which gets passed to this
17434         method is sometimes wrong!]
17435
17436 2003-04-07  Nick Drochak <ndrochak@gol.com>
17437
17438         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
17439
17440 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
17441
17442         * expression.cs (Indirection.EmitAssign): We were using the
17443         temporary, but returning immediately instead of continuing the
17444         EmitAssing flow.
17445
17446 2003-04-06  Martin Baulig  <martin@ximian.com>
17447
17448         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
17449         if it's a nested child, but also deriving from the outer class.
17450         See test 190.cs.
17451
17452         * typemanager.cs (IsNestedChildOf): Make this work if it's a
17453         nested child, but also deriving from the outer class.  See
17454         test-190.cs.
17455         (FilterWithClosure): We may access private members of the outer
17456         class if we're a nested child and deriving from the outer class.
17457         (RealMemberLookup): Only set `closure_private_ok' if the
17458         `original_bf' contained BindingFlags.NonPublic.
17459
17460 2003-04-05  Martin Baulig  <martin@ximian.com>
17461
17462         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
17463
17464 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * class.cs (Event.Define): Do not allow abstract events to have
17467         initializers. 
17468
17469 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
17470
17471         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
17472         block in event declarations.
17473
17474         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
17475         value type, get its address.
17476
17477         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
17478         leaving a class on the stack instead of a boolean value (int
17479         0/1).  Change the code so we compare against null, and then the
17480         result against zero.
17481
17482         * class.cs (TypeContainer.GetClassBases): We were checking for the
17483         parent class being sealed too late.
17484
17485         * expression.cs (Binary.Emit): For <= and >= when dealing with
17486         floating point values, use cgt.un and clt.un instead of cgt and
17487         clt alone.
17488
17489 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
17490
17491         * statement.cs: Apply the same optimization as MS: skip the 
17492         GetEnumerator returning an IEnumerator, and use the one returning a 
17493         CharEnumerator instead. This allows us to avoid the try-finally block 
17494         and the boxing.
17495
17496 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
17497
17498         * cs-parser.jay: Attributes cannot be applied to
17499                          namespaces. Fixes #40473
17500
17501 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17502
17503         * class.cs:
17504         (Add*): check if the name is valid using the full name for constants,
17505         fields, properties and events.
17506
17507 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
17508
17509         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
17510         char constants to be part of the enumeration.
17511
17512         * expression.cs (Conditional.DoResolve): Add support for operator
17513         true. Implements the missing functionality from 14.12
17514
17515         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
17516         operator true/false as required by the spec.
17517
17518         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
17519         implicit conversion to boolean.
17520
17521         * statement.cs (Statement.ResolveBoolean): A boolean expression is
17522         also one where the type implements `operator true'. 
17523
17524         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
17525         get an expression that will invoke operator true based on an
17526         expression.  
17527
17528         (GetConversionOperators): Removed the hack that called op_True
17529         here.  
17530
17531         (Expression.ResolveBoolean): Move this from Statement.
17532
17533 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
17534
17535         * ecore.cs (FieldExpr): do not allow initialization of initonly
17536         fields on derived classes
17537
17538 2003-03-13  Martin Baulig  <martin@ximian.com>
17539
17540         * statement.cs (Block.Emit): Call ig.BeginScope() and
17541         ig.EndScope() when compiling with debugging info; call
17542         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
17543
17544 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
17545
17546         * expression.cs (Indexers): Do not construct immediately, allow
17547         for new members to be appended as we go.  Fixes 38143
17548
17549 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17550
17551         * expression.cs: save/restore context when resolving an unchecked
17552         expression.
17553
17554 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
17555
17556         * cfold.cs: Catch division by zero in modulus operator during
17557         constant folding.
17558
17559 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
17560
17561         * interface.cs (Interface.DefineMembers): Avoid defining members
17562         twice. 
17563
17564 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
17565
17566         * driver.cs: handle the +/- options for -noconfig
17567
17568         * statement.cs (Unckeched.Resolve): Also track the state of
17569         unchecked in the Resolve phase.
17570
17571 2003-02-27  Martin Baulig  <martin@ximian.com>
17572
17573         * ecore.cs (Expression.MemberLookup): Don't create a
17574         MethodGroupExpr for something which is not a method.  Fixes #38291.
17575
17576 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
17577
17578         * class.cs (MemberBase.CheckParameters): Also check that the type
17579         is unmanaged if it is a pointer.
17580
17581         * expression.cs (SizeOf.Resolve): Add location information.
17582
17583         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
17584         a managed type is declared.
17585
17586         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
17587         parameter modifiers as well.  Fixes bug 38606
17588
17589         * class.cs: Very sad.  Am backing out the speed up changes
17590         introduced by the ArrayList -> Array in the TypeContainer, as they
17591         were not actually that much faster, and introduced a bug (no error
17592         reports on duplicated methods).
17593
17594         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
17595         source first, this will guarantee that we have a valid expression
17596         before calling in lower levels functions that will require a
17597         resolved object.  Then use this original_source in the
17598         target.ResolveLValue instead of the original source that was
17599         passed to us.
17600
17601         Another change.  Use target.Resolve instead of LValueResolve.
17602         Although we are resolving for LValues, we will let the Assign code
17603         take care of that (it will be called again from Resolve).  This
17604         basically allows code like this:
17605
17606         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
17607         class Y { void A (X x) { x [0] += o; }
17608
17609         The problem was that the indexer was trying to resolve for
17610         set_Item (idx, object o) and never finding one.  The real set_Item
17611         was set_Item (idx, X).  By delaying the process we get the right
17612         semantics. 
17613
17614         Fixes bug 36505
17615
17616 2003-02-23  Martin Baulig  <martin@ximian.com>
17617
17618         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
17619         while calling DoEmit ().
17620
17621         * codegen.cs (EmitContext.Mark): Don't mark locations in other
17622         source files; if you use the #line directive inside a method, the
17623         compiler stops emitting line numbers for the debugger until it
17624         reaches the end of the method or another #line directive which
17625         restores the original file.
17626
17627 2003-02-23  Martin Baulig  <martin@ximian.com>
17628
17629         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
17630
17631 2003-02-23  Martin Baulig  <martin@ximian.com>
17632
17633         * statement.cs (Block.AddChildVariableNames): We need to call this
17634         recursively, not just for our immediate children.
17635
17636 2003-02-23  Martin Baulig  <martin@ximian.com>
17637
17638         * class.cs (Event.Define): Always make the field private, like csc does.
17639
17640         * typemanager.cs (TypeManager.RealMemberLookup): Make events
17641         actually work, fixes bug #37521.
17642
17643 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
17644
17645         * delegate.cs: When creating the various temporary "Parameters"
17646         classes, make sure that we call the ComputeAndDefineParameterTypes
17647         on those new parameters (just like we do with the formal ones), to
17648         allow them to be resolved in the context of the DeclSpace.
17649
17650         This fixes the bug that Dick observed in Bugzilla #38530.
17651
17652 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
17653
17654         * expression.cs (ResolveMemberAccess): When resolving a constant,
17655         do not attempt to pull a constant if the value was not able to
17656         generate a valid constant.
17657
17658         * const.cs (LookupConstantValue): Do not report more errors than required.
17659
17660 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17661
17662         * expression.cs: fixes bug #38328.
17663
17664 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17665
17666         * class.cs: Changed all the various members that can be part of a
17667         class from being an ArrayList to be an Array of the right type.
17668         During the DefineType type_list, interface_list, delegate_list and
17669         enum_list are turned into types, interfaces, delegates and enums
17670         arrays.  
17671
17672         And during the member population, indexer_list, event_list,
17673         constant_list, field_list, instance_constructor_list, method_list,
17674         operator_list and property_list are turned into their real arrays.
17675
17676         Although we could probably perform this operation earlier, for
17677         good error reporting we need to keep the lists and remove the
17678         lists for longer than required.
17679
17680         This optimization was triggered by Paolo profiling the compiler
17681         speed on the output of `gen-sample-program.pl' perl script. 
17682
17683         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
17684         not crash in methods like MemberLookupFailed that use this field.  
17685
17686         This problem arises when the compiler fails to resolve a type
17687         during interface type definition for example.
17688
17689 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
17690
17691         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
17692         inherit from System.Object, so we have to stop at null, not only
17693         when reaching System.Object.
17694
17695 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
17696
17697         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
17698         DeclaredOnly because the parent indexer might have had a different
17699         name, but did not loop until the top of the hierarchy was reached.
17700
17701         The problem this one fixes is 35492: when a class implemented an
17702         indexer from an interface, we were getting the interface method
17703         (which was abstract) and we were flagging an error (can not invoke
17704         abstract method).
17705
17706         This also keeps bug 33089 functioning, and test-148 functioning.
17707
17708         * typemanager.cs (IsSpecialMethod): The correct way of figuring
17709         out if a method is special is to see if it is declared in a
17710         property or event, or whether it is one of the predefined operator
17711         names.   This should fix correctly #36804.
17712
17713 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
17714
17715         The goal here is to remove the dependency on EmptyCast.Peel ().
17716         Killing it completely.
17717
17718         The problem is that currently in a number of places where
17719         constants are expected, we have to "probe" for an EmptyCast, and
17720         Peel, which is not the correct thing to do, as this will be
17721         repetitive and will likely lead to errors. 
17722
17723         The idea is to remove any EmptyCasts that are used in casts that
17724         can be reduced to constants, so we only have to cope with
17725         constants. 
17726
17727         This bug hunt was triggered by Bug 37363 and the desire to remove
17728         the duplicate pattern where we were "peeling" emptycasts to check
17729         whether they were constants.  Now constants will always be
17730         constants.
17731
17732         * ecore.cs: Use an enumconstant here instead of wrapping with
17733         EmptyCast.  
17734
17735         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
17736         throwing me off.  By handling this we can get rid of a few hacks.
17737
17738         * statement.cs (Switch): Removed Peel() code.
17739
17740 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
17741
17742         * class.cs: Location information for error 508
17743
17744         * expression.cs (New.DoResolve): Add a guard against double
17745         resolution of an expression.  
17746
17747         The New DoResolve might be called twice when initializing field
17748         expressions (see EmitFieldInitializers, the call to
17749         GetInitializerExpression will perform a resolve on the expression,
17750         and later the assign will trigger another resolution
17751
17752         This leads to bugs (#37014)
17753
17754         * delegate.cs: The signature for EndInvoke should contain any ref
17755         or out parameters as well.  We were not doing this in the past. 
17756
17757         * class.cs (Field.Define): Do not overwrite the type definition
17758         inside the `volatile' group.  Turns out that volatile enumerations
17759         were changing the type here to perform a validity test, which
17760         broke conversions. 
17761
17762 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
17763
17764         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
17765         and structs, we do not want to load the instance variable
17766
17767         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
17768         enum_type has to be handled like an object reference (implicit
17769         conversions exists from this to object), but the regular IsClass
17770         and IsValueType tests will never return true for this one.
17771
17772         Also we use TypeManager.IsValueType instead of type.IsValueType,
17773         just for consistency with the rest of the code (this is only
17774         needed if we ever use the construct exposed by test-180.cs inside
17775         corlib, which we dont today).
17776
17777 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
17778
17779         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
17780         just InternalCall.
17781
17782 2003-02-09  Martin Baulig  <martin@ximian.com>
17783
17784         * namespace.cs (Namespace..ctor): Added SourceFile argument.
17785         (Namespace.DefineNamespaces): New static public method; this is
17786         called when we're compiling with debugging to add all namespaces
17787         to the symbol file.
17788
17789         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
17790         pass it to the Namespace's .ctor.
17791
17792         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
17793         and MethodBase arguments; pass the namespace ID to the symwriter;
17794         pass the MethodBase instead of the token to the symwriter.
17795         (SymbolWriter.DefineNamespace): New method to add a namespace to
17796         the symbol file.
17797
17798 2003-02-09  Martin Baulig  <martin@ximian.com>
17799
17800         * symbolwriter.cs: New file.  This is a wrapper around
17801         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
17802         methods here in near future.
17803
17804 2003-02-09  Martin Baulig  <martin@ximian.com>
17805
17806         * codegen.cs (EmitContext.Mark): Just pass the arguments to
17807         ILGenerator.MarkSequencePoint() which are actually used by the
17808         symbol writer.
17809
17810 2003-02-09  Martin Baulig  <martin@ximian.com>
17811
17812         * location.cs (SourceFile): New public sealed class.  This
17813         contains the name and an index which is used in the location's token.
17814         (Location): Reserve an appropriate number of bits in the token for
17815         the source file instead of walking over that list, this gives us a
17816         really huge performance improvement when compiling with debugging.
17817
17818         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
17819         `SourceFile' argument instead of a string.
17820         (Driver.ProcessFile): Add all the files via Location.AddFile(),
17821         but don't parse/tokenize here, we need to generate the list of all
17822         source files before we do that.
17823         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
17824         the files.
17825
17826         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
17827         instead of a string.
17828
17829         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
17830         of a string.
17831
17832 2003-02-09  Martin Baulig  <martin@ximian.com>
17833
17834         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
17835         filename on `#line default'.
17836
17837 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
17838
17839         * statement.cs: don't clear the pinned var when the fixed statement
17840         returns from the method (fixes bug#37752).
17841
17842 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
17843
17844         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
17845         to IsValueType.
17846
17847 2003-02-07  Martin Baulig  <martin@ximian.com>
17848
17849         * driver.cs: Removed the `--debug-args' command line argument.
17850
17851         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
17852         automatically by the AsssemblyBuilder.
17853         (CodeGen.InitializeSymbolWriter): We don't need to call any
17854         initialization function on the symbol writer anymore.  This method
17855         doesn't take any arguments.
17856
17857 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
17858
17859         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
17860         from referenced assemblies as well.
17861
17862 2003-02-02  Martin Baulig  <martin@ximian.com>
17863
17864         * class.cs (MethodData.Emit): Generate debugging info for external methods.
17865
17866 2003-02-02  Martin Baulig  <martin@ximian.com>
17867
17868         * class.cs (Constructor.Emit): Open the symbol writer before
17869         emitting the constructor initializer.
17870         (ConstructorInitializer.Emit): Call ec.Mark() to allow
17871         single-stepping through constructor initializers.
17872
17873 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
17874
17875         * class.cs: Handle error 549: do not allow virtual methods in
17876         sealed classes. 
17877
17878 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
17879
17880         * decl.cs: Check access levels when resolving types
17881
17882 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
17883
17884         * statement.cs: Add parameters and locals set in catch blocks that might 
17885         return to set vector
17886
17887 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
17888
17889         * class.cs (Operator): Set the SpecialName flags for operators.
17890
17891         * expression.cs (Invocation.DoResolve): Only block calls to
17892         accessors and operators on SpecialName methods.
17893
17894         (Cast.TryReduce): Handle conversions from char constants.
17895
17896
17897 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
17898
17899         * statement.cs: small memory and time optimization in FlowBranching.
17900
17901 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
17902
17903         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
17904         problem that the last fix but in the other sid (Set).
17905
17906         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
17907         access when there is no indexer in the hierarchy.
17908
17909 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
17910
17911         * class.cs: Combine some if statements.
17912
17913 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17914
17915         * driver.cs: fixed bug #37187.
17916
17917 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
17918
17919         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
17920         any indexer, it's needed to build a list with all the indexers in the
17921         hierarchy (AllGetters), else we have problems. Fixes #35653.
17922
17923 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
17924
17925         * class.cs (MethodData.Define): It is wrong for an interface
17926         implementation to be static in both cases: explicit and implicit.
17927         We were only handling this in one case.
17928
17929         Improve the if situation there to not have negations.
17930
17931         * class.cs (Field.Define): Turns out that we do not need to check
17932         the unsafe bit on field definition, only on usage.  Remove the test.
17933
17934 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17935
17936         * driver.cs: use assembly.Location instead of Codebase (the latest
17937         patch made mcs fail when using MS assemblies).
17938
17939 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
17940
17941         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
17942         get the path to *corlib.dll.
17943
17944 2003-01-21  Nick Drochak <ndrochak@gol.com>
17945
17946         * cs-tokenizer.cs:
17947         * pending.cs:
17948         * typemanager.cs: Remove compiler warnings
17949
17950 2003-01-20  Duncan Mak  <duncan@ximian.com>
17951
17952         * AssemblyInfo.cs: Bump the version number to 0.19.
17953
17954 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17955
17956         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
17957
17958 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
17959
17960         * class.cs (Constructor::Emit): Emit debugging info for constructors.
17961
17962 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
17963
17964         * cs-parser.jay: Small fix: we were not comparing the constructor
17965         name correctly.   Thanks to Zoltan for the initial pointer.
17966
17967 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
17968
17969         * cs-tokenizer.cs: Set file name when specified with #line
17970
17971 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
17972
17973         * cs-parser.jay: Only perform the constructor checks here if we
17974         are named like the class;  This will help provider a better
17975         error.  The constructor path is taken when a type definition is
17976         not found, but most likely the user forgot to add the type, so
17977         report that rather than the constructor error.
17978
17979 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
17980
17981         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
17982         allocations.
17983
17984 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17985
17986         * cs-parser.jay: Add cleanup call.
17987
17988 2003-01-13  Duncan Mak  <duncan@ximian.com>
17989
17990         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
17991         consistent with other methods.
17992
17993 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
17994
17995         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
17996
17997 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
17998
17999         * attribute.cs: only set GuidAttr to true when we have a
18000         GuidAttribute.
18001
18002 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18003
18004         * ecore.cs:
18005         * expression.cs:
18006         * typemanager.cs: fixes to allow mcs compile corlib with the new
18007         Type.IsSubclassOf fix.
18008
18009 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
18010
18011         * expression.cs (LocalVariableReference.DoResolve): Classify a
18012         constant as a value, not as a variable.   Also, set the type for
18013         the variable.
18014
18015         * cs-parser.jay (fixed_statement): take a type instead of a
18016         pointer_type, so we can produce a better error message later.
18017
18018         * statement.cs (Fixed.Resolve): Flag types that are not pointers
18019         as an error.  
18020
18021         (For.DoEmit): Make inifinite loops have a
18022         non-conditional branch back.
18023
18024         (Fixed.DoEmit): First populate the pinned variables, then emit the
18025         statement, then clear the variables.  Before I was emitting the
18026         code once for each fixed piece.
18027
18028
18029 2003-01-08  Martin Baulig  <martin@ximian.com>
18030
18031         * statement.cs (FlowBranching.MergeChild): A break in a
18032         SWITCH_SECTION does not leave a loop.  Fixes #36155.
18033
18034 2003-01-08  Martin Baulig  <martin@ximian.com>
18035
18036         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
18037         lives in the same number space than `param_map'.  Fixes #36154.
18038
18039 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
18040
18041         * cs-parser.jay (constructor_declaration): Set the
18042         Constructor.ModFlags before probing for it.  This makes the
18043         compiler report 514, 515 and 132 (the code was there, but got
18044         broken). 
18045
18046         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
18047         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
18048         (GotoCase.Resolve): Set `Returns' to ALWAYS.
18049
18050 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
18051
18052         * enum.cs: create the enum static fields using the enum type.
18053
18054 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
18055
18056         * class.cs: don't try to create the ParamBuilder for the return
18057         type if it's not needed (and handle it breaking for the ms runtime
18058         anyway).
18059
18060 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
18061
18062         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
18063
18064 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
18065
18066         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
18067         the command.   This showed up while compiling the JANET source
18068         code, which used \r as its only newline separator.
18069
18070 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
18071
18072         * class.cs (Method.Define): If we are an operator (because it
18073         reuses our code), then set the SpecialName and HideBySig.  #36128
18074
18075 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
18076
18077         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
18078         exception, report error 120 `object reference required'.
18079
18080         * driver.cs: Add --pause option, used during to measure the size
18081         of the process as it goes with --timestamp.
18082
18083         * expression.cs (Invocation.DoResolve): Do not allow methods with
18084         SpecialName to be invoked.
18085
18086 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
18087
18088         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
18089         number before adding it.
18090
18091 2002-12-21  Ravi Pratap  <ravi@ximian.com>
18092
18093         * ecore.cs (StandardImplicitConversion): When in an unsafe
18094         context, we allow conversion between void * to any other pointer
18095         type. This fixes bug #35973.
18096
18097 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
18098
18099         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
18100         is not thrown when extensionless outputs are used 
18101
18102 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18103
18104         * rootcontext.cs: fixed compilation of corlib.
18105
18106 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
18107
18108         * attribute.cs (Attributes.Contains): Add new method.
18109
18110         * class.cs (MethodCore.LabelParameters): if the parameter is an
18111         `out' parameter, check that no attribute `[In]' has been passed.
18112
18113         * enum.cs: Handle the `value__' name in an enumeration.
18114
18115 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
18116
18117         * decl.cs: Added special case to allow overrides on "protected
18118         internal" methods
18119
18120 2002-12-18  Ravi Pratap  <ravi@ximian.com>
18121
18122         * attribute.cs (Attributes.AddAttributeSection): Rename to this
18123         since it makes much more sense.
18124
18125         (Attributes.ctor): Don't require a Location parameter.
18126
18127         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
18128
18129         * attribute.cs (ApplyAttributes): Remove extra Location parameters
18130         since we already have that information per attribute.
18131
18132         * everywhere : make appropriate changes.
18133
18134         * class.cs (LabelParameters): Write the code which actually
18135         applies attributes to the return type. We can't do this on the MS
18136         .NET runtime so we flag a warning in the case an exception is
18137         thrown.
18138
18139 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
18140
18141         * const.cs: Handle implicit null conversions here too.
18142
18143 2002-12-17  Ravi Pratap  <ravi@ximian.com>
18144
18145         * class.cs (MethodCore.LabelParameters): Remove the extra
18146         Type [] parameter since it is completely unnecessary. Instead
18147         pass in the method's attributes so that we can extract
18148         the "return" attribute.
18149
18150 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
18151
18152         * cs-parser.jay (parse): Use Report.Error to flag errors instead
18153         of ignoring it and letting the compile continue.
18154
18155         * typemanager.cs (ChangeType): use an extra argument to return an
18156         error condition instead of throwing an exception.
18157
18158 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
18159
18160         * expression.cs (Unary.TryReduce): mimic the code for the regular
18161         code path.  Perform an implicit cast in the cases where we can
18162         implicitly convert to one of the integral types, and then reduce
18163         based on that constant.   This fixes bug #35483.
18164
18165 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18166
18167         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
18168
18169 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18170
18171         * namespace.cs: fixed bug #35489.
18172
18173 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
18174
18175         * class.cs: Remove some dead code.
18176
18177         * cs-parser.jay: Estimate the number of methods needed
18178         (RootContext.MethodCount);
18179
18180         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
18181         numbers instead of StringBuilders.
18182
18183         * support.cs (PtrHashtable): Add constructor with initial size;
18184         We can now reduce reallocations of the method table.
18185
18186 2002-12-10  Ravi Pratap  <ravi@ximian.com>
18187
18188         * attribute.cs (ApplyAttributes): Keep track of the emitted
18189         attributes on a per-target basis. This fixes bug #35413.
18190
18191 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
18192
18193         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
18194         default to the Windows 1252 encoding.
18195
18196         (UnixParseOption): Support version, thanks to Alp for the missing
18197         pointer. 
18198
18199         * AssemblyInfo.cs: Add nice assembly information.
18200
18201         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
18202         (bug 35169).
18203
18204         * cs-parser.jay: Allow a trailing comma before the close bracked
18205         in the attribute_section production.
18206
18207         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
18208         address of the instance was being taken, I will take this out,
18209         because we take the address of the object immediately here.
18210
18211 2002-12-09  Ravi Pratap  <ravi@ximian.com>
18212
18213         * typemanager.cs (AreMultipleAllowed): Take care of the most
18214         obvious case where attribute type is not in the current assembly -
18215         stupid me ;-)
18216
18217 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
18218
18219         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
18220         definitions, instead of doing that afterwards.  
18221
18222         Also we use a nice little hack, depending on the constructor, we
18223         know if we are a "composed" name or a simple name.  Hence, we
18224         avoid the IndexOf test, and we avoid 
18225
18226         * codegen.cs: Add code to assist in a bug reporter to track down
18227         the source of a compiler crash. 
18228
18229 2002-12-07  Ravi Pratap  <ravi@ximian.com>
18230
18231         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
18232         types have been emitted for a given element and flag an error
18233         if something which does not have AllowMultiple set is used more
18234         than once.
18235
18236         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
18237         attribute types and their corresponding AllowMultiple properties
18238
18239         (AreMultipleAllowed): Check the property for a given type.
18240
18241         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
18242         property in the case we have a TypeContainer.
18243
18244         (Attributes.AddAttribute): Detect duplicates and just skip on
18245         adding them. This trivial fix catches a pretty gross error in our
18246         attribute emission - global attributes were being emitted twice!
18247
18248         Bugzilla bug #33187 is now fixed.
18249
18250 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
18253         instead of pp_and).
18254
18255         * expression.cs (Binary.ResolveOperator): I can only use the
18256         Concat (string, string, string) and Concat (string, string,
18257         string, string) if the child is actually a concatenation of
18258         strings. 
18259
18260 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
18261
18262         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
18263         context where we need a 2-character lookahead.
18264
18265         * pending.cs (PendingImplementation): Rework so we can keep track
18266         of interface types all the time, and flag those which were
18267         implemented by parents as optional.
18268
18269 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * expression.cs (Binary.ResolveOperator): Use
18272         String.Concat(string,string,string) or
18273         String.Concat(string,string,string,string) when possible. 
18274
18275         * typemanager: More helper methods.
18276
18277
18278 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
18279
18280         * pending.cs: remove the bogus return from GetMissingInterfaces()
18281         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
18282
18283 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18284
18285         * namespace.cs: avoid duplicated 'using xxx' being added to
18286         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
18287         when we get more than one 'using' statement for the same namespace.
18288         Report a CS0105 warning for it.
18289
18290 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * cs-tokenizer.cs (consume_identifier): use read directly, instead
18293         of calling getChar/putback, uses internal knowledge of it.    
18294
18295         (xtoken): Reorder tokenizer so most common patterns are checked
18296         first.  This reduces the compilation time in another 5% (from 8.11s
18297         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
18298
18299         The parsing time is 22% of the compilation in mcs, and from that
18300         64% is spent on the tokenization process.  
18301
18302         I tried using a binary search for keywords, but this is slower
18303         than the hashtable.  Another option would be to do a couple of
18304         things:
18305
18306                 * Not use a StringBuilder, instead use an array of chars,
18307                   with a set value.  Notice that this way we could catch
18308                   the 645 error without having to do it *afterwards*.
18309
18310                 * We could write a hand-parser to avoid the hashtable
18311                   compares altogether.
18312
18313         The identifier consumption process takes 37% of the tokenization
18314         time.  Another 15% is spent on is_number.  56% of the time spent
18315         on is_number is spent on Int64.Parse:
18316
18317                 * We could probably choose based on the string length to
18318                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
18319                   computations. 
18320
18321         Another 3% is spend on wrapping `xtoken' in the `token' function.
18322
18323         Handle 0xa0 as whitespace (#34752)
18324
18325 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
18326
18327         * typemanager.cs (IsCLRType): New routine to tell whether a type
18328         is one of the builtin types.  
18329
18330         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
18331         typecode in more places instead of doing pointer comparissions.
18332         We could leverage some knowledge about the way the typecodes are
18333         laid out.
18334
18335         New code to cache namespaces in assemblies, it is currently not
18336         invoked, to be used soon.
18337
18338         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
18339
18340         * expression.cs (Binary.ResolveOperator): specially handle
18341         strings, and do not perform user-defined operator overloading for
18342         built-in types.
18343
18344 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
18345
18346         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
18347         internalcall as it is a pretty simple operation;  Avoid whenever
18348         possible to call Char.IsLetter.
18349
18350         (consume_identifier): Cut by half the number of
18351         hashtable calls by merging the is_keyword and GetKeyword behavior.
18352
18353         Do not short-circuit, because if we do, we
18354         report errors (ie, #if false && true would produce an invalid
18355         directive error);
18356
18357
18358 2002-11-24  Martin Baulig  <martin@ximian.com>
18359
18360         * expression.cs (Cast.TryReduce): If we're in checked syntax,
18361         check constant ranges and report a CS0221.  Fixes #33186.
18362
18363 2002-11-24  Martin Baulig  <martin@ximian.com>
18364
18365         * cs-parser.jay: Make this work for uninitialized variable
18366         declarations in the `for' initializer.  Fixes #32416.
18367
18368 2002-11-24  Martin Baulig  <martin@ximian.com>
18369
18370         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
18371         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
18372
18373 2002-11-24  Martin Baulig  <martin@ximian.com>
18374
18375         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
18376         argument; if true, we also check for user-defined conversions.
18377         This is only needed if both arguments are of a user-defined type.
18378         Fixes #30443, added test-175.cs.
18379         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
18380
18381         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
18382
18383 2002-11-24  Martin Baulig  <martin@ximian.com>
18384
18385         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
18386         function to get the store opcode.
18387         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
18388         only emit the Ldelema if the store opcode is Stobj.  You must run
18389         both test-34 and test-167 to test this.  Fixes #34529.
18390
18391 2002-11-23  Martin Baulig  <martin@ximian.com>
18392
18393         * ecore.cs (Expression.MemberLookup): Added additional
18394         `qualifier_type' argument which is used when we're being called
18395         from MemberAccess.DoResolve() and null if we're called from a
18396         SimpleName lookup.
18397         (Expression.MemberLookupFailed): New method to report errors; this
18398         does the CS1540 check and reports the correct error message.
18399
18400         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
18401         argument for the CS1540 check and redone the way how we're dealing
18402         with private members.  See the comment in the source code for details.
18403         (FilterWithClosure): Reverted this back to revision 1.197; renamed
18404         `closure_start_type' to `closure_qualifier_type' and check whether
18405         it's not null.  It was not this filter being broken, it was just
18406         being called with the wrong arguments.
18407
18408         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
18409         and pass it the correct `qualifier_type'; this also does the error
18410         handling for us.
18411
18412 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
18413
18414         * expression.cs (Invocation.EmitParams): If the we are dealing
18415         with a non-built-in value type, load its address as well.
18416
18417         (ArrayCreation): Use a a pretty constant instead
18418         of the hardcoded value 2.   Use 6 instead of 2 for the number of
18419         static initializers.  
18420
18421         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
18422         because they are not really value types, just glorified integers. 
18423
18424         * driver.cs: Do not append .exe, the CSC compiler does not do it.
18425
18426         * ecore.cs: Remove redundant code for enumerations, make them use
18427         the same code path as everything else, fixes the casting issue
18428         with enumerations in Windows.Forms.
18429
18430         * attribute.cs: Do only cast to string if it is a string, the
18431         validation happens later.
18432
18433         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
18434         people upgrade their corlibs.
18435
18436         * ecore.cs: Oops, enumerations were not following the entire code path
18437
18438 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
18439
18440         * typemanager.cs (FilterWithClosure): Commented out the test for
18441         1540 in typemanager.cs, as it has problems when accessing
18442         protected methods from a parent class (see test-174.cs). 
18443
18444         * attribute.cs (Attribute.ValidateGuid): new method.
18445         (Attribute.Resolve): Use above.
18446
18447 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
18448
18449         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
18450
18451         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
18452         handling for enumerations, as we only needed the TypeContainer
18453         functionality to begin with (this is required for the fix below to
18454         work for enums that reference constants in a container class for
18455         example). 
18456
18457         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
18458
18459         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
18460         a valid TypeBuilder to perform lookups on.o
18461
18462         * class.cs (InheritableMemberSignatureCompare): Use true in the
18463         call to GetGetMethod and GetSetMethod, because we are comparing
18464         the signature, and we need to get the methods *even* if they are
18465         private. 
18466
18467         (PropertyBase.CheckBase): ditto.
18468
18469         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
18470         GotoCase.Resolve): Use Peel on EmpytCasts.
18471
18472         * ecore.cs (EmptyCast): drop child, add Peel method.
18473
18474 2002-11-17  Martin Baulig  <martin@ximian.com>
18475
18476         * ecore.cs (EmptyCast.Child): New public property.
18477
18478         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
18479         label resolved to an EmptyCast.  Fixes #34162.
18480         (GotoCase.Resolve): Likewise.
18481         (Block.EmitMeta): Likewise.
18482
18483 2002-11-17  Martin Baulig  <martin@ximian.com>
18484
18485         * expression.cs (Invocation.BetterConversion): Prefer int over
18486         uint; short over ushort; long over ulong for integer literals.
18487         Use ImplicitConversionExists instead of StandardConversionExists
18488         since we also need to check for user-defined implicit conversions.
18489         Fixes #34165.  Added test-173.cs.
18490
18491 2002-11-16  Martin Baulig  <martin@ximian.com>
18492
18493         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
18494         with the `true' and `false' literals.  Fixes #33151.
18495
18496 2002-11-16  Martin Baulig  <martin@ximian.com>
18497
18498         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
18499         October 22nd; don't do the cs1540 check for static members.
18500
18501         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
18502         now using our own filter here and doing the cs1540 check again.
18503
18504 2002-11-16  Martin Baulig  <martin@ximian.com>
18505
18506         * support.cs (InternalParameters): Don't crash if we don't have
18507         any fixed parameters.  Fixes #33532.
18508
18509 2002-11-16  Martin Baulig  <martin@ximian.com>
18510
18511         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
18512         when looking up static methods to make this work on Windows.
18513         Fixes #33773.
18514
18515 2002-11-16  Martin Baulig  <martin@ximian.com>
18516
18517         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
18518         a setter rather than using PropertyInfo.CanWrite.
18519
18520 2002-11-15  Nick Drochak  <ndrochak@gol.com>
18521
18522         * class.cs: Allow acces to block member by subclasses. Fixes build
18523         breaker.
18524
18525 2002-11-14  Martin Baulig  <martin@ximian.com>
18526
18527         * class.cs (Constructor.Emit): Added the extern/block check.
18528         Fixes bug #33678.
18529
18530 2002-11-14  Martin Baulig  <martin@ximian.com>
18531
18532         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
18533         iteration while looking for indexers, this is needed because the
18534         indexer may have a different name in our base classes.  Fixed the
18535         error reporting (no indexers at all, not get accessor, no
18536         overloaded match).  Fixes bug #33089.
18537         (IndexerAccess.DoResolveLValue): Likewise.
18538
18539 2002-11-14  Martin Baulig  <martin@ximian.com>
18540
18541         * class.cs (PropertyBase.CheckBase): Make this work for multiple
18542         indexers.  Fixes the first part of bug #33089.
18543         (MethodSignature.InheritableMemberSignatureCompare): Added support
18544         for properties.
18545
18546 2002-11-13  Ravi Pratap  <ravi@ximian.com>
18547
18548         * attribute.cs (Attribute.Resolve): Catch the
18549         NullReferenceException and report it since it isn't supposed to
18550         happen. 
18551
18552 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
18553
18554         * expression.cs (Binary.EmitBranchable): Also handle the cases for
18555         LogicalOr and LogicalAnd that can benefit from recursively
18556         handling EmitBranchable.  The code now should be nice for Paolo.
18557
18558 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
18559
18560         * typemanager.cs (LookupType): Added a negative-hit hashtable for
18561         the Type lookups, as we perform quite a number of lookups on
18562         non-Types.  This can be removed once we can deterministically tell
18563         whether we have a type or a namespace in advance.
18564
18565         But this might require special hacks from our corlib.
18566
18567         * TODO: updated.
18568
18569         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
18570         and double which avoids a conversion from an integer to a double.
18571
18572         * expression.cs: tiny optimization, avoid calling IsConstant,
18573         because it effectively performs the lookup twice.
18574
18575 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
18576
18577         But a bogus return here to keep the semantics of the old code
18578         until the Mono runtime is fixed.
18579
18580         * pending.cs (GetMissingInterfaces): New method used to remove all
18581         the interfaces that are already implemented by our parent
18582         classes from the list of pending methods. 
18583
18584         * interface.cs: Add checks for calls after ResolveTypeExpr.
18585
18586 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
18587
18588         * class.cs (Class.Emit): Report warning 67: event not used if the
18589         warning level is beyond 3.
18590
18591         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
18592         being a NullLiteral.
18593
18594         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
18595         specifiers. 
18596
18597         * class.cs (TypeContainer.GetClassBases): Cover a missing code
18598         path that might fail if a type can not be resolved.
18599
18600         * expression.cs (Binary.Emit): Emit unsigned versions of the
18601         operators. 
18602
18603         * driver.cs: use error 5.
18604
18605 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
18606
18607         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
18608
18609 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
18610
18611         * cs-parser.jay (switch_section): A beautiful patch from Martin
18612         Baulig that fixed 33094.
18613
18614 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
18615
18616         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
18617         Check whether the base is abstract and report an error if so.
18618
18619         * expression.cs (IndexerAccess.DoResolveLValue,
18620         IndexerAccess.DoResolve): ditto. 
18621
18622         (Invocation.DoResolve): ditto.
18623
18624         (Invocation.FullMethodDesc): Improve the report string.
18625
18626         * statement.cs (Block): Eliminate IsVariableDefined as it is
18627         basically just a wrapper for GetVariableInfo.
18628
18629         * ecore.cs (SimpleName): Use new 
18630
18631         * support.cs (ReflectionParamter.ParameterType): We unwrap the
18632         type, as we return the actual parameter ref/unref state on a
18633         different call.
18634
18635 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
18636
18637         * support.cs: Return proper flags REF/OUT fixing the previous
18638         commit.  
18639
18640         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
18641         not used to mean `ref' but `ref or out' in ParameterReference
18642
18643         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
18644         full type signature instead of calling TypeManger.CSharpName
18645         ourselves. 
18646
18647         * support.cs (InternalParameters.ParameterDesc): Do not compare
18648         directly to the modflags, because REF/OUT will actually be bitsets
18649         if set. 
18650
18651         * delegate.cs (VerifyMethod): Check also the modifiers.
18652
18653         * cs-tokenizer.cs: Fix bug where floating point values with an
18654         exponent where a sign was missing was ignored.
18655
18656         * driver.cs: Allow multiple assemblies to be specified in a single
18657         /r: argument
18658
18659 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
18660
18661         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
18662         because identifiers after a parenthesis would end up in this kind
18663         of production, and we needed to desamiguate it for having casts
18664         like:
18665
18666                 (UserDefinedType *) xxx
18667
18668 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
18669
18670         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
18671         we should set on the Bindingflags.NonPublic, but not turn on
18672         private_ok.  private_ok controls whether a Private member is
18673         returned (this is chekced on the filter routine), while the
18674         BindingFlags.NonPublic just controls whether private/protected
18675         will be allowed.   This fixes the problem part of the problem of
18676         private properties being allowed to be used in derived classes.
18677
18678         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
18679         so we can call the children DoResolveLValue method (this will
18680         properly signal errors on lvalue assignments to base properties)
18681
18682         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
18683         getter are null, and we have a property info, we know that this
18684         happened because the lookup failed, so we report an error 122 for
18685         protection level violation.
18686
18687         We also silently return if setter and getter are null in the
18688         resolve functions, this condition only happens if we have flagged
18689         the error before.  This is the other half of the problem. 
18690
18691         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
18692         not have accessibility information, that is why we were returning
18693         true in the filter function in typemanager.cs.
18694
18695         To properly report 122 (property is inaccessible because of its
18696         protection level) correctly, we report this error in ResolveAccess
18697         by failing if both the setter and the getter are lacking (ie, the
18698         lookup failed). 
18699
18700         DoResolve and DoLResolve have been modified to check for both
18701         setter/getter being null and returning silently, the reason being
18702         that I did not want to put the knowledge about this error in upper
18703         layers, like:
18704
18705         int old = Report.Errors;
18706         x = new PropertyExpr (...);
18707         if (old != Report.Errors)
18708                 return null;
18709         else
18710                 return x;
18711
18712         So the property expr is returned, but it is invalid, so the error
18713         will be flagged during the resolve process. 
18714
18715         * class.cs: Remove InheritablePropertySignatureCompare from the
18716         class, as we no longer depend on the property signature to compute
18717         whether it is possible to implement a method or not.
18718
18719         The reason is that calling PropertyInfo.GetGetMethod will return
18720         null (in .NET, in Mono it works, and we should change this), in
18721         cases where the Get Method does not exist in that particular
18722         class.
18723
18724         So this code:
18725
18726         class X { public virtual int A { get { return 1; } } }
18727         class Y : X { }
18728         class Z : Y { public override int A { get { return 2; } } }
18729
18730         Would fail in Z because the parent (Y) would not have the property
18731         defined.  So we avoid this completely now (because the alternative
18732         fix was ugly and slow), and we now depend exclusively on the
18733         method names.
18734
18735         (PropertyBase.CheckBase): Use a method-base mechanism to find our
18736         reference method, instead of using the property.
18737
18738         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
18739         routines are gone now.
18740
18741         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
18742         names, they were incorrectly named.
18743
18744         * cs-tokenizer.cs: Return are more gentle token on failure. 
18745
18746         * pending.cs (PendingImplementation.InterfaceMethod): This routine
18747         had an out-of-sync index variable, which caused it to remove from
18748         the list of pending methods the wrong method sometimes.
18749
18750 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
18751
18752         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
18753         CanWrite, because those refer to this particular instance of the
18754         property, and do not take into account the fact that we can
18755         override single members of a property.
18756
18757         Constructor requires an EmitContext.  The resolution process does
18758         not happen here, but we need to compute the accessors before,
18759         because the resolution does not always happen for properties.
18760
18761         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
18762         subclass, before we did not update this flag, but we did update
18763         bindingflags. 
18764
18765         (GetAccessors): Drop this routine, as it did not work in the
18766         presence of partially overwritten set/get methods. 
18767
18768         Notice that this broke the cs1540 detection, but that will require
18769         more thinking. 
18770
18771 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18772
18773         * class.cs:
18774         * codegen.cs:
18775         * driver.cs: issue a warning instead of an error if we don't support
18776         debugging for the platform. Also ignore a couple of errors that may
18777         arise when trying to write the symbols. Undo my previous patch.
18778
18779 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18780
18781         * driver.cs: ignore /debug switch except for Unix platforms.
18782
18783 2002-10-23  Nick Drochak  <ndrochak@gol.com>
18784
18785         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
18786
18787 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
18788
18789         * driver.cs: Do not make mcs-debug conditional, so we do not break
18790         builds that use it.
18791
18792         * statement.cs (UsageVector.MergeChildren): I would like Martin to
18793         review this patch.  But basically after all the children variables
18794         have been merged, the value of "Breaks" was not being set to
18795         new_breaks for Switch blocks.  I think that it should be set after
18796         it has executed.  Currently I set this to the value of new_breaks,
18797         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
18798         conservative, but I do not understand this code very well.
18799
18800         I did not break anything in the build, so that is good ;-)
18801
18802         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
18803
18804 2002-10-20  Mark Crichton  <crichton@gimp.org>
18805
18806         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
18807
18808 2002-10-20  Nick Drochak  <ndrochak@gol.com>
18809
18810         * cfold.cs: Fixed compile blocker.
18811
18812 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
18813
18814         * driver.cs: I was chekcing the key, not the file.
18815
18816 2002-10-19  Ravi Pratap  <ravi@ximian.com>
18817
18818         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
18819         message that we were generating - we just need to silently return
18820         a null.
18821
18822 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
18823
18824         * class.cs (Event.Define): Change my previous commit, as this
18825         breaks the debugger.  This is a temporary hack, as it seems like
18826         the compiler is generating events incorrectly to begin with.
18827
18828         * expression.cs (Binary.ResolveOperator): Added support for 
18829         "U operator - (E x, E y)"
18830
18831         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
18832         y)".
18833
18834         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
18835         init-only variables, but this path did not take into account that
18836         there might be also instance readonly variables.  Correct this
18837         problem. 
18838
18839         This fixes bug 32253
18840
18841         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
18842         delegates as well.
18843
18844         * driver.cs: Change the extension for modules to `netmodule'
18845
18846         * cs-parser.jay: Improved slightly the location tracking for
18847         the debugger symbols.
18848
18849         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
18850         modifiers that were specified instead of the hardcoded value
18851         (FamAndAssem).  This was basically ignoring the static modifier,
18852         and others.  Fixes 32429.
18853
18854         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
18855         fixed a bug in the process (32476)
18856
18857         * expression.cs (ArrayAccess.EmitAssign): Patch from
18858         hwang_rob@yahoo.ca that fixes bug 31834.3
18859
18860 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
18861
18862         * driver.cs: Make the module extension .netmodule.
18863
18864 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
18865
18866         * driver.cs: Report an error if the resource file is not found
18867         instead of crashing.
18868
18869         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
18870         false, like Emit does.
18871
18872 2002-10-16  Nick Drochak  <ndrochak@gol.com>
18873
18874         * typemanager.cs: Remove unused private member.  Also reported mcs
18875         bug to report this as a warning like csc.
18876
18877 2002-10-15  Martin Baulig  <martin@gnome.org>
18878
18879         * statement.cs (Statement.Emit): Made this a virtual method; emits
18880         the line number info and calls DoEmit().
18881         (Statement.DoEmit): New protected abstract method, formerly knows
18882         as Statement.Emit().
18883
18884         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
18885
18886 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
18887
18888         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
18889         have fixed a remaining problem: not every AddXXXX was adding a
18890         fully qualified name.  
18891
18892         Now everyone registers a fully qualified name in the DeclSpace as
18893         being defined instead of the partial name.  
18894
18895         Downsides: we are slower than we need to be due to the excess
18896         copies and the names being registered this way.  
18897
18898         The reason for this is that we currently depend (on the corlib
18899         bootstrap for instance) that types are fully qualified, because
18900         we dump all the types in the namespace, and we should really have
18901         types inserted into the proper namespace, so we can only store the
18902         basenames in the defined_names array.
18903
18904 2002-10-10  Martin Baulig  <martin@gnome.org>
18905
18906         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
18907         from bug #31834, see the bug report for a testcase which is
18908         miscompiled.
18909
18910 2002-10-10  Martin Baulig  <martin@gnome.org>
18911
18912         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
18913         flow analysis code for this.
18914
18915         * statement.cs (Do, While, For): Tell the flow analysis code about
18916         infinite loops.
18917         (FlowBranching.UsageVector): Added support for infinite loops.
18918         (Block.Resolve): Moved the dead code elimination here and use flow
18919         analysis to do it.
18920
18921 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
18922
18923         * class.cs (Field.Define): Catch cycles on struct type
18924         definitions. 
18925
18926         * typemanager.cs (IsUnmanagedtype): Do not recursively check
18927         fields if the fields are static.  We only need to check instance
18928         fields. 
18929
18930         * expression.cs (As.DoResolve): Test for reference type.
18931
18932         * statement.cs (Using.ResolveExpression): Use
18933         ConvertImplicitRequired, not ConvertImplicit which reports an
18934         error on failture
18935         (Using.ResolveLocalVariableDecls): ditto.
18936
18937         * expression.cs (Binary.ResolveOperator): Report errors in a few
18938         places where we had to.
18939
18940         * typemanager.cs (IsUnmanagedtype): Finish implementation.
18941
18942 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * expression.cs: Use StoreFromPtr instead of extracting the type
18945         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
18946
18947         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
18948         an enumeration value to a System.Enum, but System.Enum is not a
18949         value type, but an class type, so we need to box.
18950
18951         (Expression.ConvertExplicit): One codepath could return
18952         errors but not flag them.  Fix this.  Fixes #31853
18953
18954         * parameter.cs (Resolve): Do not allow void as a parameter type.
18955
18956 2002-10-06  Martin Baulig  <martin@gnome.org>
18957
18958         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
18959         if it's a class type and not a struct.  Fixes #31815.
18960
18961 2002-10-06  Martin Baulig  <martin@gnome.org>
18962
18963         * statement.cs: Reworked the flow analysis code a bit to make it
18964         usable for dead code elimination.
18965
18966 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18967
18968         * cs-parser.jay: allow empty source files. Fixes bug #31781.
18969
18970 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18971
18972         * expression.cs (ComposedCast.DoResolveType): A quick workaround
18973         to fix the test 165, will investigate deeper.
18974
18975 2002-10-04  Martin Baulig  <martin@gnome.org>
18976
18977         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
18978         finally blocks actually work.
18979         (Try.Resolve): We don't need to create a sibling for `finally' if
18980         there is no finally block.
18981
18982 2002-10-04  Martin Baulig  <martin@gnome.org>
18983
18984         * class.cs (Constructor.Define): The default accessibility for a
18985         non-default constructor is private, not public.
18986
18987 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * class.cs (Constructor): Make AllowedModifiers public, add
18990         EXTERN.
18991
18992         * cs-parser.jay: Perform the modifiers test here, as the
18993         constructor for the Constructor class usually receives a zero
18994         because of the way we create it (first we create, later we
18995         customize, and we were never checking the modifiers).
18996
18997         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
18998         is a version of LookupTypeReflection that includes the type-name
18999         cache.  This can be used as a fast path for functions that know
19000         the fully qualified name and are only calling into *.GetType() to
19001         obtain a composed type.
19002
19003         This is also used by TypeManager.LookupType during its type
19004         composition.
19005
19006         (LookupType): We now also track the real type name, as sometimes
19007         we can get a quey for the real type name from things like
19008         ComposedCast.  This fixes bug 31422.
19009
19010         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
19011         complete type fullname, it does not have to go through the type
19012         resolution system to obtain the composed version of the type (for
19013         obtaining arrays or pointers).
19014
19015         (Conditional.Emit): Use the EmitBoolExpression to
19016         generate nicer code, as requested by Paolo.
19017
19018         (ArrayCreation.CheckIndices): Use the patch from
19019         hwang_rob@yahoo.ca to validate the array initializers. 
19020
19021 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
19022
19023         * class.cs (ConstructorInitializer.Emit): simplify code by using
19024         Invocation.EmitCall, and at the same time, fix the bugs in calling
19025         parent constructors that took variable arguments. 
19026
19027         * ecore.cs (Expression.ConvertNumericExplicit,
19028         Expression.ImplicitNumericConversion): Remove the code that
19029         manually wrapped decimal (InternalTypeConstructor call is now gone
19030         as well).
19031
19032         * expression.cs (Cast.TryReduce): Also handle decimal types when
19033         trying to perform a constant fold on the type.
19034
19035         * typemanager.cs (IsUnmanagedtype): Partially implemented.
19036
19037         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
19038         that only turned off an error report, and did nothing else. 
19039
19040 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
19041
19042         * driver.cs: Handle and ignore /fullpaths
19043
19044 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
19045
19046         * expression.cs (Binary.ResolveOperator): Catch the case where
19047         DoNumericPromotions returns true, 
19048
19049         (Binary.DoNumericPromotions): Simplify the code, and the tests.
19050
19051 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
19052
19053         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
19054         report error 70.
19055
19056 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
19057
19058         * ecore.cs (ConvertNumericExplicit): It is not enough that the
19059         conversion exists, but it is also required that the conversion be
19060         performed.  This manifested in "(Type64Enum) 2".  
19061
19062         * class.cs (TypeManager.AddMethod): The fix is not to change
19063         AddEnum, because that one was using a fully qualified name (every
19064         DeclSpace derivative does), but to change the AddMethod routine
19065         that was using an un-namespaced name.  This now correctly reports
19066         the duplicated name.
19067
19068         Revert patch until I can properly fix it.  The issue
19069         is that we have a shared Type space across all namespaces
19070         currently, which is wrong.
19071
19072         Options include making the Namespace a DeclSpace, and merge
19073         current_namespace/current_container in the parser.
19074
19075 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * cs-parser.jay: Improve error reporting when we get a different
19078         kind of expression in local_variable_type and
19079         local_variable_pointer_type. 
19080
19081         Propagate this to avoid missleading errors being reported.
19082
19083         * ecore.cs (ImplicitReferenceConversion): treat
19084         TypeManager.value_type as a target just like object_type.   As
19085         code like this:
19086
19087         ValueType v = 1;
19088
19089         Is valid, and needs to result in the int 1 being boxed before it
19090         is assigned to the value type v.
19091
19092         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
19093         to validate the enumeration name.
19094
19095         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
19096         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
19097         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
19098
19099         * ecore.cs (TryImplicitIntConversion): When doing an
19100         implicit-enumeration-conversion, check if the type is 64-bits and
19101         perform a conversion before passing to EnumConstant.
19102
19103 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
19104
19105         * decl.cs (Error_AmbiguousTypeReference); New routine used to
19106         report ambiguous type references.  Unlike the MS version, we
19107         report what the ambiguity is.   Innovation at work ;-)
19108
19109         (DeclSpace.FindType): Require a location argument to
19110         display when we display an ambiguous error.
19111
19112         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
19113
19114         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
19115
19116         * expression.cs (EmitDynamicInitializers): Apply patch from
19117         hwang_rob@yahoo.ca that fixes the order in which we emit our
19118         initializers. 
19119
19120 2002-09-21  Martin Baulig  <martin@gnome.org>
19121
19122         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
19123         delegate takes no arguments.
19124
19125 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
19126
19127         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
19128         from integers.
19129
19130         * expression.cs: Extract the underlying type.
19131
19132         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
19133
19134         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
19135
19136 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * class.cs (TypeContainer.DefineType): We can not use the nice
19139         PackingSize with the size set to 1 DefineType method, because it
19140         will not allow us to define the interfaces that the struct
19141         implements.
19142
19143         This completes the fixing of bug 27287
19144
19145         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
19146         means also structs.  This fixes part of the problem. 
19147         (Expresion.ImplicitReferenceConversionExists): ditto.
19148
19149         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
19150         error if there were no errors reported during the type lookup
19151         process, to avoid duplicates or redundant errors.  Without this
19152         you would get an ambiguous errors plus a type not found.  We have
19153         beaten the user enough with the first error.  
19154
19155         (DeclSparce.FindType): Emit a warning if we have an ambiguous
19156         reference. 
19157
19158         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
19159         during the resolution process, stop the lookup, this avoids
19160         repeated error reports (same error twice).
19161
19162         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
19163
19164         * typemanager.cs (LookupType): Redo the type lookup code to match
19165         the needs of System.Reflection.  
19166
19167         The issue is that System.Reflection requires references to nested
19168         types to begin with a "+" sign instead of a dot.  So toplevel
19169         types look like: "NameSpace.TopLevelClass", and nested ones look
19170         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
19171         levels. 
19172
19173 2002-09-19  Martin Baulig  <martin@gnome.org>
19174
19175         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
19176         says that a method always returns or always throws an exception,
19177         don't report the CS0161.
19178
19179         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
19180         set `Returns = new_returns'.
19181
19182 2002-09-19  Martin Baulig  <martin@gnome.org>
19183
19184         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
19185         to an enum constant, check for a CS0176.
19186
19187 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
19188
19189         * class.cs (TypeContainer.CheckPairedOperators): Now we check
19190         for operators that must be in pairs and report errors.
19191
19192         * ecore.cs (SimpleName.DoResolveType): During the initial type
19193         resolution process, when we define types recursively, we must
19194         check first for types in our current scope before we perform
19195         lookups in the enclosing scopes.
19196
19197         * expression.cs (MakeByteBlob): Handle Decimal blobs.
19198
19199         (Invocation.VerifyArgumentsCompat): Call
19200         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
19201         I thought we were supposed to always call this, but there are a
19202         few places in the code where we dont do it.
19203
19204 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
19205
19206         * driver.cs: Add support in -linkres and -resource to specify the
19207         name of the identifier.
19208
19209 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19210
19211         * ecore.cs (StandardConversionExists): Sync with the conversion
19212         code: allow anything-* to void* conversions.
19213
19214         (FindMostSpecificSource): Use an Expression argument
19215         instead of a Type, because we might be handed over a Literal which
19216         gets a few more implicit conversions that plain types do not.  So
19217         this information was being lost.
19218
19219         Also, we drop the temporary type-holder expression when not
19220         required.
19221
19222 2002-09-17  Martin Baulig  <martin@gnome.org>
19223
19224         * class.cs (PropertyBase.CheckBase): Don't check the base class if
19225         this is an explicit interface implementation.
19226
19227 2002-09-17  Martin Baulig  <martin@gnome.org>
19228
19229         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
19230         different `IndexerName' attributes.
19231
19232         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
19233         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
19234         virtual CommonResolve().
19235
19236 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
19237
19238         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
19239         and convert that to the UnderlyingType.
19240
19241         * statement.cs (Foreach.Resolve): Indexers are just like variables
19242         or PropertyAccesses.
19243
19244         * cs-tokenizer.cs (consume_string): Track line numbers and columns
19245         inside quoted strings, we were not doing this before.
19246
19247 2002-09-16  Martin Baulig  <martin@gnome.org>
19248
19249         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
19250         resolve it.  This is needed for the definite assignment check of the
19251         instance expression, fixes bug #29846.
19252         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
19253
19254 2002-09-16  Nick Drochak  <ndrochak@gol.com>
19255
19256         * parameter.cs: Fix compile error.  Cannot reference static member
19257         from an instance object.  Is this an mcs bug?
19258
19259 2002-09-14  Martin Baulig  <martin@gnome.org>
19260
19261         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
19262         multiple times.  Fixes bug #30295, added test-166.cs.
19263
19264 2002-09-14  Martin Baulig  <martin@gnome.org>
19265
19266         * statement.cs (Block.Emit): Don't emit unreachable code.
19267         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
19268         `break' statements.
19269         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
19270
19271 2002-09-14  Martin Baulig  <martin@gnome.org>
19272
19273         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
19274         is set.
19275
19276 2002-09-14  Martin Baulig  <martin@gnome.org>
19277
19278         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
19279         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
19280         be false on the ms runtime.
19281
19282 2002-09-13  Martin Baulig  <martin@gnome.org>
19283
19284         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
19285         the CS0038 error message.
19286
19287 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
19288
19289         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
19290         constant inside, return it.
19291
19292 2002-09-12  Martin Baulig  <martin@gnome.org>
19293
19294         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
19295         implicit conversion can be done between enum types.
19296
19297         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
19298         check whether an implicit conversion to the current enum's UnderlyingType
19299         exists and report an error if not.
19300
19301         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
19302         without debugging support.
19303
19304         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
19305         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
19306
19307 2002-09-12  Martin Baulig  <martin@gnome.org>
19308
19309         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
19310
19311         * ecore.cs (IMemberExpr.DeclaringType): New property.
19312         (SimpleName.SimpleNameResolve): Check whether we're accessing a
19313         nonstatic member of an outer type (CS0038).
19314
19315 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
19316
19317         * driver.cs: Activate the using-error detector at warning level
19318         4 (at least for MS-compatible APIs).
19319
19320         * namespace.cs (VerifyUsing): Small buglett fix.
19321
19322         * pending.cs (PendingImplementation): pass the container pointer. 
19323
19324         * interface.cs (GetMethods): Allow for recursive definition.  Long
19325         term, I would like to move every type to support recursive
19326         definitions, not the current ordering mechanism that we have right
19327         now.
19328
19329         The situation is this: Attributes are handled before interfaces,
19330         so we can apply attributes to interfaces.  But some attributes
19331         implement interfaces, we will now handle the simple cases
19332         (recursive definitions will just get an error).  
19333
19334         * parameter.cs: Only invalidate types at the end if we fail to
19335         lookup all types.  
19336
19337 2002-09-09  Martin Baulig  <martin@gnome.org>
19338
19339         * ecore.cs (PropertyExpr.Emit): Also check for
19340         TypeManager.system_int_array_get_length so this'll also work when
19341         compiling corlib.  Fixes #30003.
19342
19343 2002-09-09  Martin Baulig  <martin@gnome.org>
19344
19345         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
19346         and throw an exception if we can't get the type's size.  Fixed #30040,
19347         added test-165.cs.
19348
19349 2002-09-09  Martin Baulig  <martin@gnome.org>
19350
19351         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
19352
19353         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
19354         context.  Fixes bug #30027.
19355
19356         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
19357         virtual functions.  Fixes bug #30043, added test-164.cs.
19358
19359 2002-09-08  Ravi Pratap  <ravi@ximian.com>
19360
19361         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
19362
19363 2002-09-08  Nick Drochak  <ndrochak@gol.com>
19364
19365         * driver.cs: Use an object to get the windows codepage since it's not a
19366         static property.
19367
19368 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
19369
19370         * statement.cs (For.Emit): for infinite loops (test == null)
19371         return whether there is a break inside, not always "true".
19372
19373         * namespace.cs (UsingEntry): New struct to hold the name of the
19374         using definition, the location where it is defined, and whether it
19375         has been used in a successful type lookup.
19376
19377         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
19378         strings.
19379
19380         * decl.cs: ditto.
19381
19382 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19383
19384         * attribute.cs : Fix incorrect code which relied on catching
19385         a NullReferenceException to detect a null being passed in
19386         where an object was expected.
19387
19388 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
19389
19390         * statement.cs (Try): flag the catch variable as assigned
19391
19392         * expression.cs (Cast): Simplified by using ResolveType instead of
19393         manually resolving.
19394
19395         * statement.cs (Catch): Fix bug by using ResolveType.
19396
19397 2002-09-06  Ravi Pratap  <ravi@ximian.com>
19398
19399         * expression.cs (BetterConversion): Special case for when we have
19400         a NullLiteral as the argument and we have to choose between string
19401         and object types - we choose string the way csc does.
19402
19403         * attribute.cs (Attribute.Resolve): Catch the
19404         NullReferenceException and report error #182 since the Mono
19405         runtime no more has the bug and having this exception raised means
19406         we tried to select a constructor which takes an object and is
19407         passed a null.
19408
19409 2002-09-05  Ravi Pratap  <ravi@ximian.com>
19410
19411         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
19412         message (1502, 1503) when we can't locate a method after overload
19413         resolution. This is much more informative and closes the bug
19414         Miguel reported.
19415
19416         * interface.cs (PopulateMethod): Return if there are no argument
19417         types. Fixes a NullReferenceException bug.
19418
19419         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
19420         expressions too. Previously we were checking only in one place for
19421         positional arguments leaving out named arguments.
19422
19423         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
19424         type to the enum type is not allowed. Remove code corresponding to
19425         that.
19426
19427         (ConvertNumericExplicit): Allow explicit conversions from
19428         the underlying type to enum type. This precisely follows the spec
19429         and closes a bug filed by Gonzalo.
19430
19431 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19432
19433         * compiler.csproj:
19434         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
19435
19436 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
19437
19438         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
19439         it was important that we stored the right value after the
19440         reduction in `converted'.
19441
19442 2002-09-04  Martin Baulig  <martin@gnome.org>
19443
19444         * location.cs (Location.SymbolDocument): Use full pathnames for the
19445         source files.
19446
19447 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
19448
19449         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
19450         of the expression resolve mechanism, because that will catch the
19451         SimpleName error failures.
19452
19453         (Conditional): If we can not resolve the
19454         expression, return, do not crash.
19455
19456 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19457
19458         * cs-tokenizer.cs:
19459         (location): display token name instead of its number.
19460
19461 2002-08-28  Martin Baulig  <martin@gnome.org>
19462
19463         * expression.cs (Binary.ResolveOperator): Don't silently return
19464         but return an error if an operator cannot be applied between two
19465         enum types.
19466
19467 2002-08-28  Martin Baulig  <martin@gnome.org>
19468
19469         * class.cs (Constructor.Define): Set the permission attributes
19470         correctly instead of making all constructors public.
19471
19472 2002-08-28  Martin Baulig  <martin@gnome.org>
19473
19474         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
19475         for private members before reporting a CS0103; if we find anything,
19476         it's a CS0122.
19477
19478 2002-08-28  Martin Baulig  <martin@gnome.org>
19479
19480         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
19481         to check whether `closure_start_type == closure_invocation_type',
19482         we also need to check whether `m.DeclaringType == closure_invocation_type'
19483         before bypassing the permission checks.  We might be accessing
19484         protected/private members from the base class.
19485         (TypeManager.RealMemberLookup): Only set private_ok if private
19486         members were requested via BindingFlags.NonPublic.
19487
19488         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
19489
19490         * expression.cs (MemberAccess.ResolveMemberAccess): Set
19491         MethodGroupExpr.IsExplicitImpl if appropriate.
19492         (Invocation.DoResolve): Don't report the CS0120 for explicit
19493         interface implementations.
19494
19495 2002-08-27  Martin Baulig  <martin@gnome.org>
19496
19497         * expression.cs (Invocation.DoResolve): If this is a static
19498         method and we don't have an InstanceExpression, we must report
19499         a CS0120.
19500
19501 2002-08-25  Martin Baulig  <martin@gnome.org>
19502
19503         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
19504         `==' between a valuetype and an object.
19505
19506 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
19507
19508         * ecore.cs (TypeExpr): Provide a ToString method.
19509
19510 2002-08-24  Martin Baulig  <martin@gnome.org>
19511
19512         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
19513         now called proggie.dbg and it's a binary file.
19514
19515 2002-08-23  Martin Baulig  <martin@gnome.org>
19516
19517         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
19518
19519 2002-08-23  Martin Baulig  <martin@gnome.org>
19520
19521         * struct.cs (MyStructInfo.ctor): Make this work with empty
19522         structs; it's not allowed to use foreach() on null.
19523
19524 2002-08-23  Martin Baulig  <martin@gnome.org>
19525
19526         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
19527         writer the full pathname of the generated assembly.
19528
19529 2002-08-23  Martin Baulig  <martin@gnome.org>
19530
19531         * statements.cs (FlowBranching.UsageVector.MergeChildren):
19532         A `finally' block never returns or breaks; improved handling of
19533         unreachable code.
19534
19535 2002-08-23  Martin Baulig  <martin@gnome.org>
19536
19537         * statement.cs (Throw.Resolve): Allow `throw null'.
19538
19539 2002-08-23  Martin Baulig  <martin@gnome.org>
19540
19541         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
19542         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
19543         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
19544         MemberLookup would return a wrong event if this is an explicit
19545         interface implementation and the class has an event with the same
19546         name.
19547
19548 2002-08-23  Martin Baulig  <martin@gnome.org>
19549
19550         * statement.cs (Block.AddChildVariableNames): New public method.
19551         (Block.AddChildVariableName): Likewise.
19552         (Block.IsVariableNameUsedInChildBlock): Likewise.
19553         (Block.AddVariable): Check whether a variable name has already
19554         been used in a child block.
19555
19556         * cs-parser.jay (declare_local_variables): Mark all variable names
19557         from the current block as being used in a child block in the
19558         implicit block.
19559
19560 2002-08-23  Martin Baulig  <martin@gnome.org>
19561
19562         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
19563         find the symbol writer.
19564
19565         * driver.cs: csc also allows the arguments to /define being
19566         separated by commas, not only by semicolons.
19567
19568 2002-08-23  Martin Baulig  <martin@gnome.org>
19569
19570         * interface.cs (Interface.GetMembers): Added static check for events.
19571
19572 2002-08-15  Martin Baulig  <martin@gnome.org>
19573
19574         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
19575         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
19576
19577         * ecore.cs (Expression.MemberLookup): Added documentation and explained
19578         why the MethodData.EmitDestructor() change was necessary.
19579
19580 2002-08-20  Martin Baulig  <martin@gnome.org>
19581
19582         * class.cs (TypeContainer.FindMembers): Added static check for events.
19583
19584         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
19585
19586         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
19587         use Type.GetEvents(), not Type.FindMembers().
19588
19589 2002-08-20  Martin Baulig  <martin@gnome.org>
19590
19591         * decl.cs (MemberCache): Added a special method cache which will
19592         be used for method-only searched.  This ensures that a method
19593         search will return a MethodInfo with the correct ReflectedType for
19594         inherited methods.      
19595
19596 2002-08-20  Martin Baulig  <martin@gnome.org>
19597
19598         * decl.cs (DeclSpace.FindMembers): Made this public.
19599
19600 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19601
19602         * delegate.cs: fixed build on windows.
19603         [FIXME:  Filed as bug #29150: MCS must report these errors.]
19604
19605 2002-08-19  Ravi Pratap  <ravi@ximian.com>
19606
19607         * ecore.cs (StandardConversionExists): Return a false
19608         if we are trying to convert the void type to anything else
19609         since that is not allowed.
19610
19611         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
19612         we flag error 70 in the event an event is trying to be accessed
19613         directly from outside the declaring type.
19614
19615 2002-08-20  Martin Baulig  <martin@gnome.org>
19616
19617         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
19618         MemberCache from typemanager.cs to decl.cs.
19619
19620 2002-08-19  Martin Baulig  <martin@gnome.org>
19621
19622         * class.cs (TypeContainer): Implement IMemberContainer.
19623         (TypeContainer.DefineMembers): Create the MemberCache.
19624         (TypeContainer.FindMembers): Do better BindingFlags checking; only
19625         return public members if BindingFlags.Public was given, check
19626         whether members are static.
19627
19628 2002-08-16  Martin Baulig  <martin@gnome.org>
19629
19630         * decl.cs (DeclSpace.Define): Splitted this in Define and
19631         DefineMembers.  DefineMembers is called first and initializes the
19632         MemberCache.
19633
19634         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
19635         DefineMembers() on all our DeclSpaces.
19636
19637         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
19638         but call DefineMembers() on all nested interfaces.  We call their
19639         Define() in our new Define() function.
19640
19641         * interface.cs (Interface): Implement IMemberContainer.
19642         (Interface.Define): Moved all code except the attribute stuf to
19643         DefineMembers().
19644         (Interface.DefineMembers): Initialize the member cache.
19645
19646         * typemanager.cs (IMemberFinder): Removed this interface, we don't
19647         need this anymore since we can use MemberCache.FindMembers directly.
19648
19649 2002-08-19  Martin Baulig  <martin@gnome.org>
19650
19651         * typemanager.cs (MemberCache): When creating the cache for an
19652         interface type, add all inherited members.
19653         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
19654         to `out bool used_cache' and documented it.
19655         (TypeManager.MemberLookup): If we already used the cache in the first
19656         iteration, we don't need to do the interfaces check.
19657
19658 2002-08-19  Martin Baulig  <martin@gnome.org>
19659
19660         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
19661         here from IMemberFinder and don't implement this interface anymore.
19662         (DeclSpace.MemberCache): Moved here from IMemberFinder.
19663
19664         * typemanager.cs (IMemberFinder): This interface is now only used by
19665         classes which actually support the member cache.
19666         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
19667         since we only put DeclSpaces into this Hashtable.
19668         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
19669         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
19670
19671 2002-08-16  Martin Baulig  <martin@gnome.org>
19672
19673         * typemanager.cs (ICachingMemberFinder): Removed.
19674         (IMemberFinder.MemberCache): New property.
19675         (TypeManager.FindMembers): Merged this with RealFindMembers().
19676         This function will never be called from TypeManager.MemberLookup()
19677         so we can't use the cache here, just the IMemberFinder.
19678         (TypeManager.MemberLookup_FindMembers): Check whether the
19679         IMemberFinder has a MemberCache and call the cache's FindMembers
19680         function.
19681         (MemberCache): Rewrote larger parts of this yet another time and
19682         cleaned it up a bit.
19683
19684 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
19685
19686         * driver.cs (LoadArgs): Support quoting.
19687
19688         (Usage): Show the CSC-like command line arguments.
19689
19690         Improved a few error messages.
19691
19692 2002-08-15  Martin Baulig  <martin@gnome.org>
19693
19694         * typemanager.cs (IMemberContainer.Type): New property.
19695         (IMemberContainer.IsInterface): New property.
19696
19697         The following changes are conditional to BROKEN_RUNTIME, which is
19698         defined at the top of the file.
19699
19700         * typemanager.cs (MemberCache.MemberCache): Don't add the base
19701         class'es members, but add all members from TypeHandle.ObjectType
19702         if we're an interface.
19703         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
19704         is the current type.
19705         (MemberCache.CacheEntry.Container): Removed this field.
19706         (TypeHandle.GetMembers): Include inherited members.
19707
19708 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19709
19710         * typemanager.cs: fixed compilation and added a comment on a field that
19711         is never used.
19712
19713 2002-08-15  Martin Baulig  <martin@gnome.org>
19714
19715         * class.cs (ConstructorInitializer.Resolve): In the
19716         Expression.MemberLookup call, use the queried_type as
19717         invocation_type.
19718
19719         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
19720         declared' attribute, it's always true.
19721         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
19722         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
19723         temporary wrapper for FindMembers which tells MemberLookup whether
19724         members from the base classes are included in the return value.
19725         This will go away soon.
19726         (TypeManager.MemberLookup): Use this temporary hack here; once the
19727         new MemberCache is completed, we don't need to do the DeclaredOnly
19728         looping here anymore since the MemberCache will take care of this.
19729         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
19730         (MemberCache): When creating the MemberCache for a class, get
19731         members from the current class and all its base classes.
19732         (MemberCache.CacheEntry.Container): New field.  This is a
19733         temporary hack until the Mono runtime is fixed to distinguish
19734         between ReflectedType and DeclaringType.  It allows us to use MCS
19735         with both the MS runtime and the unfixed Mono runtime without
19736         problems and without accecting performance.
19737         (MemberCache.SearchMembers): The DeclaredOnly looping from
19738         TypeManager.MemberLookup is now done here.      
19739
19740 2002-08-14  Martin Baulig  <martin@gnome.org>
19741
19742         * statement.cs (MyStructInfo.MyStructInfo): Don't call
19743         Type.GetFields on dynamic types but get the fields from the
19744         corresponding TypeContainer.
19745         (MyStructInfo.GetStructInfo): Added check for enum types.
19746
19747         * typemanager.cs (MemberList.IsSynchronized): Implemented.
19748         (MemberList.SyncRoot): Implemented.
19749         (TypeManager.FilterWithClosure): No need to check permissions if
19750         closure_start_type == closure_invocation_type, don't crash if
19751         closure_invocation_type is null.
19752
19753 2002-08-13  Martin Baulig  <martin@gnome.org>
19754
19755         Rewrote TypeContainer.FindMembers to use a member cache.  This
19756         gives us a speed increase of about 35% for the self-hosting MCS
19757         build and of about 15-20% for the class libs (both on GNU/Linux).
19758
19759         * report.cs (Timer): New class to get enhanced profiling.  This
19760         whole class is "TIMER" conditional since it remarkably slows down
19761         compilation speed.
19762
19763         * class.cs (MemberList): New class.  This is an IList wrapper
19764         which we're now using instead of passing MemberInfo[]'s around to
19765         avoid copying this array unnecessarily.
19766         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
19767         (ICachingMemberFinder, IMemberContainer): New interface.
19768         (TypeManager.FilterWithClosure): If `criteria' is null, the name
19769         has already been checked, otherwise use it for the name comparision.
19770         (TypeManager.FindMembers): Renamed to RealMemberFinder and
19771         provided wrapper which tries to use ICachingMemberFinder.FindMembers
19772         if possible.  Returns a MemberList, not a MemberInfo [].
19773         (TypeHandle): New class, implements IMemberContainer.  We create
19774         one instance of this class per type, it contains a MemberCache
19775         which is used to do the member lookups.
19776         (MemberCache): New class.  Each instance of this class contains
19777         all members of a type and a name-based hash table.
19778         (MemberCache.FindMembers): This is our new member lookup
19779         function.  First, it looks up all members of the requested name in
19780         the hash table.  Then, it walks this list and sorts out all
19781         applicable members and returns them.
19782
19783 2002-08-13  Martin Baulig  <martin@gnome.org>
19784
19785         In addition to a nice code cleanup, this gives us a performance
19786         increase of about 1.4% on GNU/Linux - not much, but it's already
19787         half a second for the self-hosting MCS compilation.
19788
19789         * typemanager.cs (IMemberFinder): New interface.  It is used by
19790         TypeManager.FindMembers to call FindMembers on a TypeContainer,
19791         Enum, Delegate or Interface.
19792         (TypeManager.finder_to_member_finder): New PtrHashtable.
19793         (TypeManager.finder_to_container): Removed.
19794         (TypeManager.finder_to_delegate): Removed.
19795         (TypeManager.finder_to_interface): Removed.
19796         (TypeManager.finder_to_enum): Removed.
19797
19798         * interface.cs (Interface): Implement IMemberFinder.
19799
19800         * delegate.cs (Delegate): Implement IMemberFinder.
19801
19802         * enum.cs (Enum): Implement IMemberFinder.
19803
19804         * class.cs (TypeContainer): Implement IMemberFinder.
19805
19806 2002-08-12  Martin Baulig  <martin@gnome.org>
19807
19808         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
19809
19810 2002-08-12  Martin Baulig  <martin@gnome.org>
19811
19812         * ecore.cs (ITypeExpression): New interface for expressions which
19813         resolve to a type.
19814         (TypeExpression): Renamed to TypeLookupExpression.
19815         (Expression.DoResolve): If we're doing a types-only lookup, the
19816         expression must implement the ITypeExpression interface and we
19817         call DoResolveType() on it.
19818         (SimpleName): Implement the new ITypeExpression interface.
19819         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
19820         hack, the situation that we're only looking up types can't happen
19821         anymore when this method is called.  Moved the type lookup code to
19822         DoResolveType() and call it.
19823         (SimpleName.DoResolveType): This ITypeExpression interface method
19824         is now doing the types-only lookup.
19825         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
19826         (ResolveFlags): Added MaskExprClass.
19827
19828         * expression.cs (MemberAccess): Implement the ITypeExpression
19829         interface.
19830         (MemberAccess.DoResolve): Added support for a types-only lookup
19831         when we're called via ITypeExpression.DoResolveType().
19832         (ComposedCast): Implement the ITypeExpression interface.
19833
19834         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
19835         Expression.Resolve() with ResolveFlags.Type instead.
19836
19837 2002-08-12  Martin Baulig  <martin@gnome.org>
19838
19839         * interface.cs (Interface.Define): Apply attributes.
19840
19841         * attribute.cs (Attribute.ApplyAttributes): Added support for
19842         interface attributes.
19843
19844 2002-08-11  Martin Baulig  <martin@gnome.org>
19845
19846         * statement.cs (Block.Emit): Only check the "this" variable if we
19847         do not always throw an exception.
19848
19849         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
19850         whether the property has a set accessor.
19851
19852 2002-08-11  Martin Baulig  <martin@gnome.org>
19853
19854         Added control flow analysis support for structs.
19855
19856         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
19857         with control flow analysis turned off.
19858         (IVariable): New interface.
19859         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
19860         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
19861         (FieldExpr.DoResolve): Resolve the instance expression with flow
19862         analysis turned off and do the definite assignment check after the
19863         resolving when we know what the expression will resolve to.
19864
19865         * expression.cs (LocalVariableReference, ParameterReference):
19866         Implement the new IVariable interface, only call the flow analysis
19867         code if ec.DoFlowAnalysis is true.
19868         (This): Added constructor which takes a Block argument.  Implement
19869         the new IVariable interface.
19870         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
19871         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
19872         This does the definite assignment checks for struct members.
19873
19874         * class.cs (Constructor.Emit): If this is a non-static `struct'
19875         constructor which doesn't have any initializer, call
19876         Block.AddThisVariable() to tell the flow analysis code that all
19877         struct elements must be initialized before control returns from
19878         the constructor.
19879
19880         * statement.cs (MyStructInfo): New public class.
19881         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
19882         argument to this indexer.  If non-zero, check an individual struct
19883         member, not the whole struct.
19884         (FlowBranching.CheckOutParameters): Check struct members.
19885         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
19886         overloaded versions of these methods which take an additional
19887         `int field_idx' argument to check struct members.
19888         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
19889         overloaded versions of these methods which take an additional
19890         `string field_name' argument to check struct member.s
19891         (VariableInfo): Implement the IVariable interface.
19892         (VariableInfo.StructInfo): New public property.  Returns the
19893         MyStructInfo instance of the variable if it's a struct or null.
19894         (Block.AddThisVariable): New public method.  This is called from
19895         Constructor.Emit() for non-static `struct' constructor which do
19896         not have any initializer.  It creates a special variable for the
19897         "this" instance variable which will be checked by the flow
19898         analysis code to ensure that all of the struct's fields are
19899         initialized before control returns from the constructor.
19900         (UsageVector): Added support for struct members.  If a
19901         variable/parameter is a struct with N members, we reserve a slot
19902         in the usage vector for each member.  A struct is considered fully
19903         initialized if either the struct itself (slot 0) or all its
19904         members are initialized.
19905
19906 2002-08-08  Martin Baulig  <martin@gnome.org>
19907
19908         * driver.cs (Driver.MainDriver): Only report an error CS5001
19909         if there were no compilation errors.
19910
19911         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
19912         `UnsafeContext' property to determine whether the parent is in
19913         unsafe context rather than checking the parent's ModFlags:
19914         classes nested in an unsafe class are unsafe as well.
19915
19916 2002-08-08  Martin Baulig  <martin@gnome.org>
19917
19918         * statement.cs (UsageVector.MergeChildren): Distinguish between
19919         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
19920         we return.  Added test17() and test18() to test-154.cs.
19921
19922 2002-08-08  Martin Baulig  <martin@gnome.org>
19923
19924         * typemanager.cs (TypeManager.FilterWithClosure): If we have
19925         Family access, make sure the invoking type isn't a subclass of the
19926         queried type (that'd be a CS1540).
19927
19928         * ecore.cs (Expression.MemberLookup): Added overloaded version of
19929         this method which takes an additional `Type invocation_type'.
19930
19931         * expression.cs (BaseAccess.DoResolve): Use the base type as
19932         invocation and query type.
19933         (MemberAccess.DoResolve): If the lookup failed and we're about to
19934         report a CS0122, try a lookup with the ec.ContainerType - if this
19935         succeeds, we must report a CS1540.
19936
19937 2002-08-08  Martin Baulig  <martin@gnome.org>
19938
19939         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
19940         (MethodGroupExpr): Implement the IMemberExpr interface.
19941
19942         * expression (MemberAccess.ResolveMemberAccess): No need to have
19943         any special code for MethodGroupExprs anymore, they're now
19944         IMemberExprs.   
19945
19946 2002-08-08  Martin Baulig  <martin@gnome.org>
19947
19948         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
19949         Family, FamANDAssem and FamORAssem permissions.
19950         (TypeManager.IsSubclassOrNestedChildOf): New public method.
19951
19952 2002-08-08  Martin Baulig  <martin@gnome.org>
19953
19954         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
19955         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
19956         or loop block.
19957
19958 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
19959
19960         * driver.cs: implemented /resource option to embed managed resources.
19961
19962 2002-08-07  Martin Baulig  <martin@gnome.org>
19963
19964         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
19965         (FieldBase.HasFieldInitializer): New public property.
19966         (FieldBase.GetInitializerExpression): New public method.  Resolves and
19967         returns the field initializer and makes sure it is only resolved once.
19968         (TypeContainer.EmitFieldInitializers): Call
19969         FieldBase.GetInitializerExpression to get the initializer, this ensures
19970         that it isn't resolved multiple times.
19971
19972         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
19973         the resolving process (SimpleName/MemberLookup) that we're currently
19974         emitting a field initializer (which must not access any instance members,
19975         this is an error CS0236).
19976
19977         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
19978         argument, if the `IsFieldInitializer' flag is set, we must report and
19979         error CS0236 and not an error CS0120.   
19980
19981 2002-08-07  Martin Baulig  <martin@gnome.org>
19982
19983         * ecore.cs (IMemberExpr): New public interface.
19984         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
19985         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
19986         if the expression is an IMemberExpr.
19987
19988         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
19989         to be null, implicitly default to `this' if we're non-static in
19990         this case.  Simplified the code a lot by using the new IMemberExpr
19991         interface.  Also fixed bug #28176 here.
19992
19993 2002-08-06  Martin Baulig  <martin@gnome.org>
19994
19995         * cs-parser.jay (SimpleLookup): Removed.  We need to create
19996         ParameterReferences during semantic analysis so that we can do a
19997         type-only search when resolving Cast, TypeOf and SizeOf.
19998         (block): Pass the `current_local_parameters' to the Block's
19999         constructor.
20000
20001         * class.cs (ConstructorInitializer): Added `Parameters parameters'
20002         argument to the constructor.
20003         (ConstructorInitializer.Resolve): Create a temporary implicit
20004         block with the parameters.
20005
20006         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
20007         references here if we aren't doing a type-only search.
20008
20009         * statement.cs (Block): Added constructor which takes a
20010         `Parameters parameters' argument.
20011         (Block.Parameters): New public property.
20012
20013         * support.cs (InternalParameters.Parameters): Renamed `parameters'
20014         to `Parameters' and made it public readonly.
20015
20016 2002-08-06  Martin Baulig  <martin@gnome.org>
20017
20018         * ecore.cs (Expression.Warning): Made this public as well.
20019
20020         * report.cs (Report.Debug): Print the contents of collections.
20021
20022 2002-08-06  Martin Baulig  <martin@gnome.org>
20023
20024         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
20025         used to tell Resolve() which kinds of expressions it may return.
20026         (Expression.Resolve): Added overloaded version of this method which
20027         takes a `ResolveFlags flags' argument.  This can be used to tell
20028         Resolve() which kinds of expressions it may return.  Reports a
20029         CS0118 on error.
20030         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
20031         ResolveFlags.SimpleName.
20032         (Expression.Error118): Added overloaded version of this method which
20033         takes a `ResolveFlags flags' argument.  It uses the flags to determine
20034         which kinds of expressions are allowed.
20035
20036         * expression.cs (Argument.ResolveMethodGroup): New public method.
20037         Resolves an argument, but allows a MethodGroup to be returned.
20038         This is used when invoking a delegate.
20039
20040         * TODO: Updated a bit.
20041
20042 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20043
20044         Fixed compilation with csc.
20045
20046         * ecore.cs: Expression.Error made public. Is this correct? Should
20047         Warning be made public too?
20048
20049         * expression.cs: use ea.Location instead of ea.loc.
20050         [FIXME:  Filed as bug #28607: MCS must report these errors.]
20051
20052 2002-08-06  Martin Baulig  <martin@gnome.org>
20053
20054         * ecore.cs (Expression.loc): Moved the location here instead of
20055         duplicating it in all derived classes.
20056         (Expression.Location): New public property.
20057         (Expression.Error, Expression.Warning): Made them non-static and
20058         removed the location argument.
20059         (Expression.Warning): Added overloaded version which takes an
20060         `int level' argument.
20061         (Expression.Error118): Make this non-static and removed the
20062         expression and location arguments.
20063         (TypeExpr): Added location argument to the constructor.
20064
20065         * expression.cs (StaticCallExpr): Added location argument to
20066         the constructor.
20067         (Indirection, PointerArithmetic): Likewise.
20068         (CheckedExpr, UnCheckedExpr): Likewise.
20069         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
20070         (StringPtr): Likewise.
20071
20072
20073 2002-08-05  Martin Baulig  <martin@gnome.org>
20074
20075         * expression.cs (BaseAccess.DoResolve): Actually report errors.
20076
20077         * assign.cs (Assign.DoResolve): Check whether the source
20078         expression is a value or variable.
20079
20080         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
20081         while resolving the corresponding blocks.
20082
20083         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
20084         an error, don't silently return null.
20085
20086         * statement.cs (Block.AddVariable): Do the error reporting here
20087         and distinguish between CS0128 and CS0136.
20088         (Block.DoResolve): Report all unused labels (warning CS0164).
20089         (LabeledStatement): Pass the location to the constructor.
20090         (LabeledStatement.HasBeenReferenced): New property.
20091         (LabeledStatement.Resolve): Set it to true here.
20092
20093         * statement.cs (Return.Emit): Return success even after reporting
20094         a type mismatch error (CS0126 or CS0127), this is what csc does and
20095         it avoids confusing the users with any consecutive errors.
20096
20097 2002-08-05  Martin Baulig  <martin@gnome.org>
20098
20099         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
20100
20101         * const.cs (Const.LookupConstantValue): Catch circular definitions.
20102
20103         * expression.cs (MemberAccess.DoResolve): Silently return if an
20104         error has already been reported.
20105
20106         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
20107         error has already been reported.
20108
20109 2002-08-05  Martin Baulig  <martin@gnome.org>
20110
20111         * statement.cs (UsageVector): Only initialize the `parameters'
20112         vector if we actually have any "out" parameters.
20113
20114 2002-08-05  Martin Baulig  <martin@gnome.org>
20115
20116         * expression.cs (Binary.ResolveOperator): When combining delegates,
20117         they must have the same type.
20118
20119 2002-08-05  Martin Baulig  <martin@gnome.org>
20120
20121         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
20122         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
20123         work with the ms runtime and we also don't need it: if we're a
20124         PropertyBuilder and not in the `indexer_arguments' hash, then we
20125         are a property and not an indexer.
20126
20127         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
20128         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
20129         since the latter one doesn't work with the ms runtime.
20130
20131 2002-08-03  Martin Baulig  <martin@gnome.org>
20132
20133         Fixed bugs #27998 and #22735.
20134
20135         * class.cs (Method.IsOperator): New public field.
20136         (Method.CheckBase): Report CS0111 if there's already a method
20137         with the same parameters in the current class.  Report CS0508 when
20138         attempting to change the return type of an inherited method.
20139         (MethodData.Emit): Report CS0179 if a method doesn't have a body
20140         and it's not marked abstract or extern.
20141         (PropertyBase): New abstract base class for Property and Indexer.
20142         (PropertyBase.CheckBase): Moved here from Property and made it work
20143         for indexers.
20144         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
20145         the same so we can reuse it there.
20146         (Property, Indexer): Derive from PropertyBase.
20147         (MethodSignature.inheritable_property_signature_filter): New delegate
20148         to find properties and indexers.
20149
20150         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
20151         argument and improved error reporting.
20152
20153         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
20154         EmptyReadOnlyParameters and made it a property.
20155
20156         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
20157         version of this method which takes a `PropertyInfo indexer'.
20158         (TypeManager.RegisterIndexer): New method.
20159
20160         * class.cs: Added myself as author of this file :-)
20161
20162 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20163
20164         * class.cs: fixed compilation on windoze.
20165
20166 2002-08-03  Martin Baulig  <martin@gnome.org>
20167
20168         * interface.cs (Interface.GetInterfaceBases): Check whether all
20169         base interfaces are at least as accessible than the current one.
20170
20171         * class.cs (TypeContainer.GetClassBases): Check whether base types
20172         are at least as accessible than the current type.
20173         (TypeContainer.AsAccessible): Implemented and made non-static.
20174         (MemberBase.CheckParameters): Report errors if the accessibility
20175         checks fail.
20176
20177         * delegate.cs (Delegate.Delegate): The default visibility is
20178         internal for top-level types and private for nested types.
20179         (Delegate.Define): Report errors if the accessibility checks fail.
20180
20181         * enum.cs (Enum.Enum): The default visibility is internal for
20182         top-level types and private for nested types.
20183         (Enum.DefineType): Compute the correct visibility.
20184
20185         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
20186         function which takes a `bool is_toplevel' instead of a TypeContainer.
20187
20188         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
20189         builtin type.
20190
20191 2002-08-02  Martin Baulig  <martin@gnome.org>
20192
20193         * expression.cs (LocalVariableReferenc): Added constructor which
20194         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
20195         (LocalVariableReference.IsReadOnly): New property.
20196         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
20197         variable is readonly, use our own readonly flag to do this; you can
20198         use the new constructor to get a writable reference to a read-only
20199         variable.
20200
20201         * cs-parser.jay (foreach_statement, using_statement): Get a writable
20202         reference to the local variable.
20203
20204 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
20205
20206         * rootcontext.cs (ResolveCore): Also include System.Exception
20207
20208         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
20209         we reach an EmptyStatement.
20210
20211         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
20212         is also fine.
20213
20214         * expression.cs (Binary.ResolveOperator): Check error result in
20215         two places.
20216
20217         use brtrue/brfalse directly and avoid compares to null.
20218
20219 2002-08-02  Martin Baulig  <martin@gnome.org>
20220
20221         * class.cs (TypeContainer.Define): Define all nested interfaces here.
20222         Fixes bug #28407, added test-155.cs.
20223
20224 2002-08-01  Martin Baulig  <martin@gnome.org>
20225
20226         * class.cs (Event.EmitDefaultMethod): Make this work with static
20227         events.  Fixes #28311, added verify-3.cs.
20228
20229 2002-08-01  Martin Baulig  <martin@gnome.org>
20230
20231         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
20232         `is_disposable' fields.
20233         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
20234         `hm.is_disposable' if we're using the collection pattern.
20235         (Foreach.EmitCollectionForeach): Use the correct type for the
20236         enumerator's local variable, only emit the try/finally block if
20237         necessary (fixes #27713).
20238
20239 2002-08-01  Martin Baulig  <martin@gnome.org>
20240
20241         * ecore.cs (Expression.report118): Renamed to Error118 and made
20242         it public static.
20243
20244         * statement.cs (Throw.Resolve): Check whether the expression is of
20245         the correct type (CS0118) and whether the type derives from
20246         System.Exception (CS0155).
20247         (Catch.Resolve): New method.  Do the type lookup here and check
20248         whether it derives from System.Exception (CS0155).
20249         (Catch.CatchType, Catch.IsGeneral): New public properties.
20250
20251         * typemanager.cs (TypeManager.exception_type): Added.
20252
20253 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
20254
20255         * driver.cs: Updated About function.
20256
20257 2002-07-31  Martin Baulig  <martin@gnome.org>
20258
20259         Implemented Control Flow Analysis.
20260
20261         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
20262         (EmitContext.CurrentBranching): Added.
20263         (EmitContext.StartFlowBranching): Added.
20264         (EmitContext.EndFlowBranching): Added.
20265         (EmitContext.KillFlowBranching): Added.
20266         (EmitContext.IsVariableAssigned): Added.
20267         (EmitContext.SetVariableAssigned): Added.
20268         (EmitContext.IsParameterAssigned): Added.
20269         (EmitContext.SetParameterAssigned): Added.
20270         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
20271         Added control flow analysis stuff here.
20272
20273         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
20274         resolve the expression as lvalue.
20275         (LocalVariableReference.DoResolve): Check whether the variable has
20276         already been assigned.
20277         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
20278         the parameter as assigned here.
20279         (ParameterReference.DoResolve): Check whether the parameter has already
20280         been assigned.
20281         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
20282         expression as lvalue.
20283
20284         * statement.cs (FlowBranching): New class for the flow analysis code.
20285         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
20286         (LabeledStatement.IsDefined): New public property.
20287         (LabeledStatement.AddUsageVector): New public method to tell flow
20288         analyis that the label may be reached via a forward jump.
20289         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
20290         flow analysis.
20291         (VariableInfo.Number): New public field.  This is used by flow analysis
20292         to number all locals of a block.
20293         (Block.CountVariables): New public property.  This is the number of
20294         local variables in this block (including the locals from all parent
20295         blocks).
20296         (Block.EmitMeta): Number all the variables.
20297
20298         * statement.cs: Added flow analysis support to all classes.
20299
20300 2002-07-31  Martin Baulig  <martin@gnome.org>
20301
20302         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
20303         To get debugging messages, compile mcs with /define:MCS_DEBUG and
20304         then use this argument.
20305
20306         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
20307
20308         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
20309         use this to specify /define options.
20310
20311 2002-07-29  Martin Baulig  <martin@gnome.org>
20312
20313         * statement.cs (Fixed): Moved all code that does variable lookups
20314         and resolvings from Emit to Resolve.
20315
20316         * statement.cs (For): Moved all code that does variable lookups
20317         and resolvings from Emit to Resolve.
20318
20319         * statement.cs (Using): Moved all code that does variable lookups
20320         and resolvings from Emit to Resolve.
20321
20322 2002-07-29  Martin Baulig  <martin@gnome.org>
20323
20324         * attribute.cs (Attribute.Resolve): Explicitly catch a
20325         System.NullReferenceException when creating the
20326         CustromAttributeBuilder and report a different warning message.
20327
20328 2002-07-29  Martin Baulig  <martin@gnome.org>
20329
20330         * support.cs (ParameterData.ParameterName): Added method to
20331         get the name of a parameter.
20332
20333         * typemanager.cs (TypeManager.IsValueType): New public method.
20334
20335 2002-07-29  Martin Baulig  <martin@gnome.org>
20336
20337         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
20338         is a flag which specifies that it's either ref or out.
20339         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
20340         the out parameter to `out Parameter.Modifier mod', also set the
20341         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
20342
20343         * support.cs (InternalParameters.ParameterModifier): Distinguish
20344         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20345         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20346
20347         * expression.cs (Argument.GetParameterModifier): Distinguish
20348         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
20349         Parameter.Modifier.ISBYREF flag if it's either ref or out.
20350
20351 2002-07-29  Martin Baulig  <martin@gnome.org>
20352
20353         * expression.cs (ParameterReference.ParameterReference): Added
20354         `Location loc' argument to the constructor.
20355
20356         * cs-parser.jay: Pass location to ParameterReference.
20357
20358 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
20359
20360         * statement.cs (Try): Initialize the location.
20361
20362         * cs-parser.jay: pass location to Try.
20363
20364         * expression.cs (Unary.Reduce): Change the prototype to return
20365         whether a constant fold could be performed or not.  The result is
20366         returned in an out parameters.  In the case of Indirection and
20367         AddressOf, we want to perform the full tests.
20368
20369 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
20370
20371         * statement.cs (Statement.Emit): Flag dead code.
20372
20373 2002-07-27  Andrew Birkett  <andy@nobugs.org>
20374
20375         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
20376
20377 2002-07-27  Martin Baulig  <martin@gnome.org>
20378
20379         * class.cs (MethodData.Define): Put back call to
20380         TypeManager.AddMethod(), accidentally commented this out.
20381
20382         * report.cs (Debug): New public method to print debugging information,
20383         this is `[Conditional ("DEBUG")]'.
20384
20385 2002-07-26  Martin Baulig  <martin@gnome.org>
20386
20387         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
20388         (switch_statement): Push the current_block to the switch_stack and
20389         pop it again when we're done with the switch.
20390         (switch_section): The new block is a child of the current_block.
20391         Fixes bug #24007, added test-152.cs.
20392
20393 2002-07-27  Martin Baulig  <martin@gnome.org>
20394
20395         * expression.cs (Invocation.EmitArguments): When calling a varargs
20396         function with only its fixed arguments, we need to pass an empty
20397         array.
20398
20399 2002-07-27  Martin Baulig  <martin@gnome.org>
20400
20401         Mono 0.13 has been released.
20402
20403 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
20404
20405         * driver.cs: Rename --resource to --linkres, because that is what
20406         we do currently, we dont support --resource yet.
20407
20408         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
20409
20410 2002-07-25  Martin Baulig  <martin@gnome.org>
20411
20412         * class.cs (MethodData): New public class.  This is a `method builder'
20413         class for a method or one accessor of a Property/Indexer/Event.
20414         (MethodData.GetMethodFlags): Moved here from MemberBase.
20415         (MethodData.ApplyAttributes): Likewise.
20416         (MethodData.ApplyObsoleteAttribute): Likewise.
20417         (MethodData.ApplyConditionalAttribute): Likewise.
20418         (MethodData.ApplyDllImportAttribute): Likewise.
20419         (MethodData.CheckAbstractAndExternal): Likewise.
20420         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
20421         (MethodData.Emit): Formerly known as Method.Emit().
20422         (MemberBase): Moved everything which was specific to a single
20423         accessor/method to MethodData.
20424         (Method): Create a new MethodData and call Define() and Emit() on it.
20425         (Property, Indexer, Event): Create a new MethodData objects for each
20426         accessor and call Define() and Emit() on them.
20427
20428 2002-07-25  Martin Baulig  <martin@gnome.org>
20429
20430         Made MethodCore derive from MemberBase to reuse the code from there.
20431         MemberBase now also checks for attributes.
20432
20433         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
20434         (MemberBase.GetMethodFlags): Moved here from class Method and marked
20435         as virtual.
20436         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
20437         `CallingConventions cc' and `Attributes opt_attrs' arguments.
20438         (MemberBase.ApplyAttributes): New virtual method; applies the
20439         attributes to a method or accessor.
20440         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
20441         (MemberBase.ApplyConditionalAttribute): Likewise.
20442         (MemberBase.ApplyDllImportAttribute): Likewise.
20443         (MemberBase.CheckAbstractAndExternal): Likewise.
20444         (MethodCore.ParameterTypes): This is now a property instead of a
20445         method, it's initialized from DoDefineParameters().
20446         (MethodCore.ParameterInfo): Removed the set accessor.
20447         (MethodCore.DoDefineParameters): New protected virtual method to
20448         initialize ParameterTypes and ParameterInfo.
20449         (Method.GetReturnType): We can now simply return the MemberType.
20450         (Method.GetMethodFlags): Override the MemberBase version and add
20451         the conditional flags.
20452         (Method.CheckBase): Moved some code from Define() here, call
20453         DoDefineParameters() here.
20454         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
20455         here to avoid some larger code duplication.
20456         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
20457         ensure that abstract and external accessors don't declare a body.
20458
20459         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
20460         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
20461         lookup in the attribute's parent classes, so we need to abort as soon
20462         as we found the first match.
20463         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
20464         the attribute has no arguments.
20465
20466         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
20467         of a Method.
20468
20469 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20470
20471         * cs-parser.jay: reverted previous patch.
20472
20473 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20474
20475         * cs-parser.jay: fixed bug #22119.
20476
20477 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20478
20479         * attribute.cs: fixed compilation. The error was:
20480         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
20481         be assigned to before control leaves the current method."
20482         [FIXME:  Filed as bug #28186: MCS must report this error.]
20483
20484 2002-07-25  Martin Baulig  <martin@gnome.org>
20485
20486         * attribute.cs (Attribute.Conditional_GetConditionName): New static
20487         method to pull the condition name ouf of a Conditional attribute.
20488         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
20489         the obsolete message and error flag out of an Obsolete attribute.
20490
20491         * class.cs (Method.GetMethodFlags): New public method to get the
20492         TypeManager.MethodFlags for this method.
20493         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
20494         private methods.
20495         (Method.Define): Get and apply the Obsolete and Conditional attributes;
20496         if we're overriding a virtual function, set the new private variable
20497         `parent_method'; call the new TypeManager.AddMethod().
20498
20499         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
20500         the MethodBuilder and the Method in a PtrHashtable.
20501         (TypeManager.builder_to_method): Added for this purpose.
20502         (TypeManager.MethodFlags): Added IsObsoleteError.
20503         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
20504         Obsolete and Conditional arguments in MethodBuilders.  If we discover
20505         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
20506         the message from the attribute.
20507
20508 2002-07-24  Martin Baulig  <martin@gnome.org>
20509
20510         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
20511         preprocessor directives, ensure that the argument to #define/#undef is
20512         exactly one identifier and that it's actually an identifier.
20513
20514         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
20515         did not work ....
20516
20517 2002-07-24  Martin Baulig  <martin@gnome.org>
20518
20519         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
20520         initialize it to TypeManager.object_type in the constructor.
20521         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
20522         of the `hm.get_current' method if we're using the collection pattern.
20523         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
20524         for the explicit conversion to make it work when we're using the collection
20525         pattern and the `Current' property has a different return type than `object'.
20526         Fixes #27713.
20527
20528 2002-07-24  Martin Baulig  <martin@gnome.org>
20529
20530         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
20531         does not match, but don't report any errors.  This method is called in
20532         order for all methods in a MethodGroupExpr until a matching method is
20533         found, so we don't want to bail out if the first method doesn't match.
20534         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
20535         matches, report the 123.  Fixes #28070.
20536
20537 2002-07-24  Martin Baulig  <martin@gnome.org>
20538
20539         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
20540         TypeManager.TypeToCoreType() to the top of the method so the
20541         following equality checks will work.  Fixes #28107.
20542
20543 2002-07-24  Martin Baulig  <martin@gnome.org>
20544
20545         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
20546         operand is of type uint, and the other operand is of type sbyte,
20547         short or int, the operands are converted to type long." -
20548         Actually do what this comment already told us.  Fixes bug #28106,
20549         added test-150.cs.
20550
20551 2002-07-24  Martin Baulig  <martin@gnome.org>
20552
20553         * class.cs (MethodBase): New abstract class.  This is now a base
20554         class for Property, Indexer and Event to avoid some code duplication
20555         in their Define() and DefineMethods() methods.
20556         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
20557         generic methods for Define() and DefineMethods().
20558         (FieldBase): Derive from MemberBase, not MemberCore.
20559         (Property): Derive from MemberBase, not MemberCore.
20560         (Property.DefineMethod): Moved all the code from this method to the
20561         new MethodBase.DefineAccessor(), just call it with appropriate
20562         argumetnts.
20563         (Property.Define): Call the new Property.DoDefine(), this does some
20564         sanity checks and we don't need to duplicate the code everywhere.
20565         (Event): Derive from MemberBase, not MemberCore.
20566         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
20567         accessors, this will also make them work with interface events.
20568         (Indexer): Derive from MemberBase, not MemberCore.
20569         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
20570         (Indexer.Define): Use the new MethodBase functions.
20571
20572         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
20573         argument to the constructor.
20574         (Interface.FindMembers): Added support for interface events.
20575         (Interface.PopluateEvent): Implemented.
20576
20577         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
20578
20579 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
20580
20581         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
20582         but this is required to check for a method name being the same as
20583         the containing class.  
20584
20585         Handle this now.
20586
20587 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20588
20589         * interface.cs: initialize variable.
20590
20591 2002-07-23  Martin Baulig  <martin@gnome.org>
20592
20593         Implemented the IndexerName attribute in interfaces.
20594
20595         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
20596         name if this is an explicit interface implementation.
20597         (Indexer.InterfaceIndexerName): New public variable.  If we're
20598         implementing an interface indexer, this is the IndexerName in that
20599         interface.  Otherwise, it's the IndexerName.
20600         (Indexer.DefineMethod): If we're implementing interface indexer,
20601         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
20602         and Pending.ImplementIndexer methods.
20603         (Indexer.Define): Also define the PropertyBuilder if we're
20604         implementing an interface indexer and this is neither an explicit
20605         interface implementation nor do the IndexerName match the one in
20606         the interface.
20607
20608         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
20609         If a method is defined here, then we always need to create a proxy
20610         for it.  This is used when implementing interface indexers.
20611         (Pending.IsInterfaceIndexer): New public method.
20612         (Pending.ImplementIndexer): New public method.
20613         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
20614         This is used when implementing interface indexers to define a proxy
20615         if necessary.
20616         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
20617         define a proxy if necessary.
20618
20619         * interface.cs (Interface.IndexerName): New public variable.
20620         (Interface.PopulateIndexer): Set the IndexerName.
20621         (Interface.DefineIndexers): New private method.  Populate all the
20622         indexers and make sure their IndexerNames match.
20623
20624         * typemanager.cs (IndexerPropertyName): Added support for interface
20625         indexers.
20626
20627 2002-07-22  Martin Baulig  <martin@gnome.org>
20628
20629         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
20630         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
20631         ret if HasReturnLabel.
20632         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
20633         variables.
20634
20635         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
20636         and set the ec.LoopBeginTryCatchLevel.
20637         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
20638         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
20639         the current ec.TryCatchLevel, the branch goes out of an exception
20640         block.  In this case, we need to use Leave and not Br.
20641
20642 2002-07-22  Martin Baulig  <martin@gnome.org>
20643
20644         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
20645         block unless the block does not always return or it is contained in
20646         another try { ... } catch { ... } block.  Fixes bug #26506.
20647         Added verify-1.cs to the test suite.
20648
20649 2002-07-22  Martin Baulig  <martin@gnome.org>
20650
20651         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
20652         then we do not always return.  Fixes bug #24985.
20653
20654 2002-07-22  Martin Baulig  <martin@gnome.org>
20655
20656         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
20657         lookup on a per-class level; ie. walk up the class hierarchy until we
20658         found at least one applicable method, then choose the best among them.
20659         Fixes bug #24463 and test-29.cs.
20660
20661 2002-07-22  Martin Baulig  <martin@gnome.org>
20662
20663         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
20664         return types of the methods.  The return type is not part of the
20665         signature and we must not check it to make the `new' modifier work.
20666         Fixes bug #27999, also added test-147.cs.
20667         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
20668
20669         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
20670         on the method's return type.
20671
20672 2002-07-21  Martin Baulig  <martin@gnome.org>
20673
20674         * assign.cs: Make this work if the rightmost source is a constant and
20675         we need to do an implicit type conversion.  Also adding a few more tests
20676         to test-38.cs which should have caught this.
20677
20678         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
20679         target in the makefile for this.  The makefile.gnu is primarily intended
20680         for end-users who don't want to debug the compiler.
20681
20682 2002-07-21  Martin Baulig  <martin@gnome.org>
20683
20684         * assign.cs: Improved the Assign class so it can now handle embedded
20685         assignments (X = Y = Z = something).  As a side-effect this'll now also
20686         consume less local variables.  test-38.cs now passes with MCS, added
20687         a few new test cases to that test.
20688
20689 2002-07-20  Martin Baulig  <martin@gnome.org>
20690
20691         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
20692         instructions.  Fixes bug #27977, also added test-146.cs.
20693
20694 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20695
20696         * cs-tokenizer.cs: fixed getHex ().
20697
20698 2002-07-19  Martin Baulig  <martin@gnome.org>
20699
20700         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
20701         not Type.GetType() to lookup the array type.  This is needed when
20702         we're constructing an array of a user-defined type.
20703         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
20704         single-dimensional arrays, but also for single-dimensial arrays of
20705         type decimal.
20706
20707 2002-07-19  Martin Baulig  <martin@gnome.org>
20708
20709         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
20710         this function is called, it's not allowed to share LocalBuilders
20711         among ILGenerators.
20712
20713 2002-07-19  Martin Baulig  <martin@gnome.org>
20714
20715         * expression.cs (Argument.Resolve): Report an error 118 when trying
20716         to pass a type as argument.
20717
20718 2002-07-18  Martin Baulig  <martin@gnome.org>
20719
20720         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
20721         Conv_R_Un for the signed `long' type.
20722
20723 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
20724
20725         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
20726         `expr' for the temporary result, as that will fail if we do
20727         multiple resolves on the same expression.
20728
20729 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
20730
20731         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
20732         ec.TypeContainer for looking up aliases. 
20733
20734         * class.cs (TypeContainer): Remove LookupAlias from here.
20735
20736         * decl.cs (DeclSpace); Move here.
20737
20738 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
20739
20740         * class.cs (FindMembers): Only call filter if the constructor
20741         bulider is not null.
20742
20743         Also handle delegates in `NestedTypes' now.  Now we will perform
20744         type lookups using the standard resolution process.  This also
20745         fixes a bug.
20746
20747         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
20748         This uses Expressions (the limited kind that can be parsed by the
20749         tree) instead of strings.
20750
20751         * expression.cs (ComposedCast.ToString): Implement, used to flag
20752         errors since now we have to render expressions.
20753
20754         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
20755         FormArrayType. 
20756
20757         * ecore.cs (SimpleName.ToString): ditto.
20758
20759         * cs-parser.jay: Instead of using strings to assemble types, use
20760         Expressions to assemble the type (using SimpleName, ComposedCast,
20761         MemberAccess).  This should fix the type lookups in declarations,
20762         because we were using a different code path for this.
20763
20764         * statement.cs (Block.Resolve): Continue processing statements
20765         even when there is an error.
20766
20767 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
20768
20769         * class.cs (Event.Define): Also remove the `remove' method from
20770         the list of pending items.
20771
20772         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
20773         generate more compact code. 
20774
20775 2002-07-17  Martin Baulig  <martin@gnome.org>
20776
20777         * const.cs (Const.LookupConstantValue): Add support for constant
20778         `unchecked' and `checked' expressions.
20779         Also adding test case test-140.cs for this.
20780
20781 2002-07-17  Martin Baulig  <martin@gnome.org>
20782
20783         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
20784         check whether mi.ReturnType implements the IEnumerator interface; the
20785         `==' and the IsAssignableFrom() will fail in this situation.
20786
20787 2002-07-16  Ravi Pratap  <ravi@ximian.com>
20788
20789         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
20790         here too.
20791
20792 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20793
20794         * expression.cs: fixed bug #27811.
20795
20796 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
20797
20798         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
20799         Molaro: when we are a ref, the value already contains a pointer
20800         value, do not take the address of it.
20801
20802 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
20803         * removed mb-parser.jay and mb-tokenizer.cs
20804
20805 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
20806
20807         * expression.cs: check against the building corlib void type.
20808
20809 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
20810
20811         * ecore.cs: fix for valuetype static readonly fields: when 
20812         initializing them, we need their address, not the address of a copy.
20813
20814 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
20815
20816         * typemanager.cs: register also enum_type in corlib.
20817
20818 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
20819
20820         * class.cs: allow calling this (but not base) initializers in structs.
20821
20822 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
20823
20824         * ecore.cs: make sure we compare against the building base types
20825         in GetTypeSize ().
20826
20827 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
20828
20829         * typemanager.cs: fix TypeToCoreType() to handle void and object
20830         (corlib gets no more typerefs after this change).
20831
20832 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * expression.cs (ArrayCreation.EmitArrayArguments): use
20835         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
20836
20837         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
20838         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
20839         array indexes, the runtime actually forbids them.
20840
20841         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
20842         for array arguments here.
20843
20844         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
20845         instead of the default for ValueTypes.
20846
20847         (New.DoEmit): Use IsValueType instead of
20848         IsSubclassOf (value_type)
20849         (New.DoResolve): ditto.
20850         (Invocation.EmitCall): ditto.
20851
20852         * assign.cs (Assign): ditto.
20853
20854         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
20855         Statements *are* currently doing part of their resolution during
20856         Emit.  
20857
20858         Expressions do always resolve during resolve, but statements are
20859         only required to propagate resolution to their children.
20860
20861 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
20862
20863         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
20864
20865         (LoadAssembly): Do not add the dll if it is already specified
20866
20867         (MainDriver): Add the System directory to the link path at the end,
20868         after all the other -L arguments. 
20869
20870         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
20871         wrong opcode for loading bytes and bools (ldelem.i1 instead of
20872         ldelem.u1) and using the opposite for sbytes.
20873
20874         This fixes Digger, and we can finally run it.
20875
20876         * driver.cs (UnixParseOption): Move the option parsing here.  
20877         (CSCParseOption): Implement CSC-like parsing of options.
20878
20879         We now support both modes of operation, the old Unix way, and the
20880         new CSC-like way.  This should help those who wanted to make cross
20881         platform makefiles.
20882
20883         The only thing broken is that /r:, /reference: and /lib: are not
20884         implemented, because I want to make those have the same semantics
20885         as the CSC compiler has, and kill once and for all the confussion
20886         around this.   Will be doing this tomorrow.
20887
20888         * statement.cs (Unsafe.Resolve): The state is checked during
20889         resolve, not emit, so we have to set the flags for IsUnsfe here.
20890
20891 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20892
20893         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
20894         not catch the Error_ObjectRefRequired in SimpleName (as it is
20895         possible to have a class/instance variable name that later gets
20896         deambiguated), we have to check this here.      
20897
20898 2002-07-10  Ravi Pratap  <ravi@ximian.com>
20899
20900         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
20901         make static and put into Expression.
20902
20903         (Event.Define): Register the private field of the event with the 
20904         TypeManager so that GetFieldFromEvent can get at it.
20905
20906         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
20907         keep track of the private field associated with an event which
20908         has no accessors.
20909
20910         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
20911         private field.
20912
20913         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
20914
20915 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
20916
20917         * expression.cs (Binary.EmitBranchable): this routine emits the
20918         Binary expression in a branchable context.  This basically means:
20919         we need to branch somewhere, not just get the value on the stack.
20920
20921         This works together with Statement.EmitBoolExpression.
20922
20923         * statement.cs (Statement.EmitBoolExpression): Use
20924         EmitBranchable. 
20925
20926 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
20927
20928         * statement.cs (For): Reduce the number of jumps in loops.
20929
20930         (For): Implement loop inversion for the For statement.
20931
20932         (Break): We can be breaking out of a Try/Catch controlled section
20933         (foreach might have an implicit try/catch clause), so we need to
20934         use Leave instead of Br.
20935
20936         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
20937         now).  If the instace expression supports IMemoryLocation, we use
20938         the AddressOf method from the IMemoryLocation to extract the
20939         address instead of emitting the instance.
20940
20941         This showed up with `This', as we were emitting the instance
20942         always (Emit) instead of the Address of This.  Particularly
20943         interesting when This is a value type, as we dont want the Emit
20944         effect (which was to load the object).
20945
20946 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
20947
20948         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
20949
20950         * statement.cs (Checked): Set the CheckedState during the resolve
20951         process too, as the ConvCast operations track the checked state on
20952         the resolve process, and not emit.
20953
20954         * cs-parser.jay (namespace_member_declaration): Flag that we have
20955         found a declaration when we do.  This is used to flag error 1529
20956
20957         * driver.cs: Report ok when we display the help only.
20958
20959 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
20960
20961         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
20962
20963 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
20964
20965         * cs-tokenizer.cs (define): We also have to track locally the
20966         defines.  AllDefines is just used for the Conditional Attribute,
20967         but we also need the local defines for the current source code. 
20968
20969 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
20970
20971         * statement.cs (While, For, Do): These loops can exit through a
20972         Break statement, use this information to tell whether the
20973         statement is the last piece of code.
20974
20975         (Break): Flag that we break.
20976
20977         * codegen.cs (EmitContexts): New `Breaks' state variable.
20978
20979 2002-07-03  Martin Baulig  <martin@gnome.org>
20980
20981         * class.cs (TypeContainer.MethodModifiersValid): Allow override
20982         modifiers in method declarations in structs.  Otherwise, you won't
20983         be able to override things like Object.Equals().
20984
20985 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
20986
20987         * class.cs (Method, Property, Indexer): Do not allow the public
20988         modifier to be used in explicit interface implementations.
20989
20990         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
20991         override modifiers in method declarations in structs
20992
20993 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
20994
20995         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
20996         integer or real overflow, report an error
20997
20998 2002-07-02  Martin Baulig  <martin@gnome.org>
20999
21000         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
21001         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
21002         to tell the runtime about our newly created System.Object and
21003         System.ValueType types.
21004
21005 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
21006
21007         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
21008         struct instead of Ldarg/Starg.
21009
21010 2002-07-02  Martin Baulig  <martin@gnome.org>
21011
21012         * expression.cs (Indirection.Indirection): Call
21013         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
21014
21015 2002-07-02  Martin Baulig  <martin@gnome.org>
21016
21017         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
21018         ValueType, call TypeManager.TypeToCoreType() on it.
21019         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
21020         the OpCodes.Newarr argument.
21021
21022 2002-07-02  Martin Baulig  <martin@gnome.org>
21023
21024         * expression.cs (Invocation.EmitCall): When compiling corlib,
21025         replace all calls to the system's System.Array type to calls to
21026         the newly created one.
21027
21028         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
21029         System.Array methods.
21030         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
21031         from the system's System.Array type which must be replaced.
21032
21033 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
21034
21035         * typemanager.cs: load unverifiable_code_ctor so we can build
21036         corlib using the correct type. Avoid using GetTypeCode() with
21037         TypeBuilders.
21038         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
21039         TypeManager.object_type to allow building corlib.
21040
21041 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
21042
21043         * ecore.cs: handle System.Enum separately in LoadFromPtr().
21044
21045 2002-07-01  Martin Baulig  <martin@gnome.org>
21046
21047         * class.cs: Make the last change actually work, we need to check
21048         whether `ifaces != null' to avoid a crash.
21049
21050 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21051
21052         * class.cs: when we build structs without fields that implement
21053         interfaces, we need to add the interfaces separately, since there is
21054         no API to both set the size and add the interfaces at type creation
21055         time.
21056
21057 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21058
21059         * expression.cs: the dimension arguments to the array constructors
21060         need to be converted if they are a long.
21061
21062 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
21063
21064         * class.cs: don't emit ldarg.0 if there is no parent constructor
21065         (fixes showstopper for corlib).
21066
21067 2002-06-29  Martin Baulig  <martin@gnome.org>
21068
21069         MCS now compiles corlib on GNU/Linux :-)
21070
21071         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
21072         ie. check for MethodImplOptions.InternalCall.
21073
21074         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
21075         and TypeManager.attribute_type are null, so we must explicitly check
21076         whether parent is not null to find out whether it's an attribute type.
21077         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
21078         and SetBuilder, not only if the property is neither abstract nor external.
21079         This is necessary to set the MethodImplOptions on the accessor methods.
21080         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
21081         SetBuilder, see Property.Emit().
21082
21083         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
21084         populate "System.Object", "System.ValueType" and "System.Attribute" since
21085         they've already been populated from BootCorlib_PopulateCoreTypes().
21086
21087 2002-06-29  Martin Baulig  <martin@gnome.org>
21088
21089         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
21090         is the NullLiteral, we also need to make sure that target_type is not
21091         an enum type.   
21092
21093 2002-06-29  Martin Baulig  <martin@gnome.org>
21094
21095         * rootcontext.cs (RootContext.ResolveCore): We must initialize
21096         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
21097         before calling BootstrapCorlib_ResolveDelegate ().
21098
21099 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21100
21101         * statement.cs: fixed build-breaker. All tests passed ok.
21102
21103 2002-06-27  Martin Baulig  <martin@gnome.org>
21104
21105         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
21106         for System.Decimal when compiling corlib.
21107
21108 2002-06-27  Martin Baulig  <martin@gnome.org>
21109
21110         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
21111         switch blocks which contain nothing but a default clause.
21112
21113 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
21114
21115        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
21116
21117 2002-06-27  Martin Baulig  <martin@gnome.org>
21118
21119         * ecore.cs (PropertyExpr.PropertyExpr): Call
21120         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
21121
21122         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
21123         is already a TypeBuilder.
21124
21125 2002-06-27  Martin Baulig  <martin@gnome.org>
21126
21127         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
21128         `target_type == TypeManager.array_type', not IsAssignableFrom() in
21129         the "from an array-type to System.Array" case.  This makes it work
21130         when compiling corlib.
21131
21132 2002-06-27  Martin Baulig  <martin@gnome.org>
21133
21134         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
21135         non-static PropertyExpr, set its InstanceExpression.  This makes
21136         the `ICollection.Count' property work in System/Array.cs.
21137
21138 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
21139
21140         * driver.cs: Made error handling more consistent.  Errors now
21141         tracked by Report class, so many methods which used to return int
21142         now return void.  Main() now prints success/failure and 
21143         errors/warnings message.
21144
21145         Renamed '--probe' compiler argument to '--expect-error'.  Removed
21146         the magic number return values (123 and 124).  Now, if the
21147         expected error occurs, the compiler exits with success (exit value
21148         0).  If the compilation completes without seeing that particular
21149         error, the compiler exits with failure (exit value 1).  The
21150         makefile in mcs/errors has been changed to handle the new behaviour.
21151
21152         * report.cs: Made 'expected error' number a property and renamed
21153         it from 'Probe' to 'ExpectedError'.
21154
21155         * genericparser.cs: Removed error handling support, since it is
21156         now all done by Report class.
21157
21158         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
21159         class, so parse() no longer returns an int.
21160
21161         * namespace.cs: Use Report.Error instead of GenericParser.error
21162
21163 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
21164
21165         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
21166         TypeContainer.AddOperator): At the front of the list put the
21167         explicit implementations, so they get resolved/defined first. 
21168
21169 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
21170
21171         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
21172         interface type is implemented by this TypeContainer.  Used during
21173         explicit interface implementation.
21174
21175         (Property.Define, Indexer.Define, Method.Define): Validate that
21176         the given interface in the explicit implementation is one of the
21177         base classes for the containing type.
21178
21179         Also if we are explicitly implementing an interface, but there is
21180         no match in the pending implementation table, report an error.
21181
21182         (Property.Define): Only define the property if we are
21183         not explicitly implementing a property from an interface.  Use the
21184         correct name also for those properties (the same CSC uses,
21185         although that is really not needed).
21186
21187         (Property.Emit): Do not emit attributes for explicitly implemented
21188         properties, as there is no TypeBuilder.
21189
21190         (Indexer.Emit): ditto.
21191
21192         Hiding then means that we do not really *implement* a pending
21193         implementation, which makes code fail.
21194
21195 2002-06-22  Martin Baulig  <martin@gnome.org>
21196
21197         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
21198         the return value of Object.GetType().  [FIXME: we need to do this whenever
21199         we get a type back from the reflection library].
21200
21201 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
21202
21203         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
21204
21205 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
21206
21207         * attribute.cs: Return null if we can not look up the type.
21208
21209         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
21210         the interface types found.
21211
21212         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
21213         interface types found.
21214
21215         * typemanager.cs (GetInterfaces): Make this routine returns alll
21216         the interfaces and work around the lame differences between
21217         System.Type and System.Reflection.Emit.TypeBuilder in the results
21218         result for GetInterfaces.
21219
21220         (ExpandInterfaces): Given an array of interface types, expand and
21221         eliminate repeated ocurrences of an interface.  This expands in
21222         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
21223         be IA, IB, IC.
21224
21225 2002-06-21  Martin Baulig  <martin@gnome.org>
21226
21227         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
21228         on System.Enum.
21229
21230 2002-06-21  Martin Baulig  <martin@gnome.org>
21231
21232         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
21233         and called with one of the core types, return the corresponding typebuilder for
21234         that type.
21235
21236         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
21237         element type.
21238
21239 2002-06-21  Martin Baulig  <martin@gnome.org>
21240
21241         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
21242         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
21243         (Expression.ConvertReferenceExplicit): Likewise.
21244
21245         * expression.cs (ElementAccess.DoResolve): Likewise.
21246         (ElementAccess.DoResolveLValue): Likewise.
21247
21248 2002-06-10  Martin Baulig  <martin@gnome.org>
21249
21250         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
21251         add the "value" parameter to the parameter list.
21252
21253         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
21254         to our caller.
21255
21256 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
21257
21258         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
21259         the argument to an int, uint, long or ulong, per the spec.  Also
21260         catch negative constants in array creation.
21261
21262 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
21263
21264         * class.cs: do not allow the same interface to appear twice in
21265         the definition list.
21266
21267 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
21268
21269         * ecore.cs: don't use ldlen with System.Array.
21270
21271 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
21272
21273         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
21274
21275 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
21276
21277         * modifiers.cs: produce correct field attributes for protected
21278         internal. Easy fix so miguel can work on ther harder stuff:-)
21279
21280 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
21281
21282         * pending.cs: New file.  Move the code from class.cs here.
21283         Support clearning the pending flag for all methods (when not doing
21284         explicit interface implementation).
21285
21286 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
21287
21288         * rootcontext.cs: added a couple more types needed to bootstrap.
21289
21290 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
21291
21292         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
21293         constructor in the type, instead of any constructor in the type
21294         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
21295         a bug in the Mono runtime when applying the params attribute). 
21296
21297 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
21298         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
21299
21300 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
21301
21302         * expression.cs (Unary.ResolveOperator): Use TypeManager
21303         to resolve the type.
21304
21305 2002-06-13  Ravi Pratap  <ravi@ximian.com>
21306
21307         * cs-parser.jay (enum_member_declaration): Pass in the attributes
21308         attached.
21309
21310         * enum.cs (AddEnumMember): Add support to store the attributes associated 
21311         with each member too.
21312
21313         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
21314         field builders too - this takes care of the enum member case.
21315
21316 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
21317
21318         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
21319         address-of operator on both value types and pointers.
21320
21321 2002-06-10  Martin Baulig  <martin@gnome.org>
21322
21323         * interface.cs (Interface.PopulateIndexer): Add the indexer's
21324         PropertyBuilder to the `property_builders' list.
21325
21326         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
21327         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
21328         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
21329         find any indexers which are inherited from an interface.
21330
21331 2002-06-09  Martin Baulig  <martin@gnome.org>
21332
21333         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
21334         the same type as the constant if necessary.  There's also a test-130.cs
21335         for this.
21336
21337         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
21338
21339         * typemanager.cs (TypeManager.ChangeType): Previously known as
21340         Enum.ChangeEnumType().
21341
21342 2002-06-09  Martin Baulig  <martin@gnome.org>
21343
21344         * expression.cs (Cast.TryReduce): Added support for consts.
21345
21346 2002-06-08  Ravi Pratap  <ravi@ximian.com>
21347
21348         * class.cs (Accessor): Hold attributes information so we can pass
21349         it along.
21350
21351         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
21352         Modify to pass in attributes attached to the methods.
21353
21354         (add_accessor_declaration, remove_accessor_declaration): Ditto.
21355
21356         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
21357         to handle the Accessor kind :-)
21358
21359         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
21360
21361 2002-06-08  Martin Baulig  <martin@gnome.org>
21362
21363         * expression.cs (Unary.TryReduceNegative): Added support for
21364         ULongConstants.
21365
21366 2002-06-08  Martin Baulig  <martin@gnome.org>
21367
21368         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
21369         name can't be found in the `defined_names' - the caller will do a
21370         MemberLookup in this case and thus find methods in System.Enum
21371         such as Enum.IsDefined().
21372
21373 2002-06-08  Martin Baulig  <martin@gnome.org>
21374
21375         * enum.cs (Enum.ChangeEnumType): This is a custom version of
21376         Convert.ChangeType() which works with TypeBuilder created types.
21377         (Enum.LookupEnumValue, Enum.Define): Use it here.
21378
21379         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
21380         `TypeBuilder.BaseType != null' check.
21381         (TypeContainer.FindMembers): Only lookup parent members if we
21382         actually have a parent.
21383         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
21384         (ConstructorInitializer.Resolve): Likewise.
21385
21386         * interface.cs (Interface.FindMembers): Added
21387         `TypeBuilder.BaseType != null' check.
21388
21389         * rootcontext.cs (RootContext.ResolveCore): Added
21390         "System.Runtime.CompilerServices.IndexerNameAttribute" to
21391         classes_second_stage.
21392
21393         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
21394         debug_type and trace_type when compiling with --nostdlib.       
21395
21396 2002-06-07  Martin Baulig  <martin@gnome.org>
21397
21398         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
21399         (AddField): Set it to true when adding a non-static field.
21400         (DefineType): Use `have_nonstatic_fields' to find out whether we
21401         have non-static fields, not `Fields != null'.
21402
21403 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
21404
21405         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
21406         dereferencing a null on the static-field code path)
21407
21408 2002-05-30  Martin Baulig  <martin@gnome.org>
21409
21410         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
21411         to take command line arguments.  Use reflection to call the new
21412         custom `Initialize' function on the symbol writer and pass it the
21413         command line arguments.
21414
21415         * driver.cs (--debug-args): New command line argument to pass command
21416         line arguments to the symbol writer.
21417
21418 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
21419
21420         * assign.cs (DoResolve): Forgot to do the implicit conversion to
21421         the target type for indexers and properties.  Thanks to Joe for
21422         catching this.
21423
21424 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
21425
21426         * typemanager.cs (MethodFlags): returns the method flags
21427         (Obsolete/ShouldIgnore) that control warning emission and whether
21428         the invocation should be made, or ignored. 
21429
21430         * expression.cs (Invocation.Emit): Remove previous hack, we should
21431         not do this on matching a base type, we should do this based on an attribute
21432
21433         Only emit calls to System.Diagnostics.Debug and
21434         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
21435         on the command line.
21436
21437         * rootcontext.cs: Global settings for tracing and debugging.
21438
21439         * cs-tokenizer.cs (define): New utility function to track
21440         defines.   Set the global settings for TRACE and DEBUG if found.
21441
21442 2002-05-25  Ravi Pratap  <ravi@ximian.com>
21443
21444         * interface.cs (Populate*): Pass in the TypeContainer as well as
21445         the DeclSpace as parameters so that we can create EmitContexts and
21446         then use that to apply attributes etc.
21447
21448         (PopulateMethod, PopulateEvent, PopulateProperty)
21449         (PopulateIndexer): Apply attributes everywhere.
21450
21451         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
21452         etc.
21453
21454         (ApplyAttributes): Update accordingly.
21455
21456         We now apply interface attributes for all members too.
21457
21458 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
21459
21460         * class.cs (Indexer.Define); Correctly check if we are explicit
21461         implementation (instead of checking the Name for a ".", we
21462         directly look up if the InterfaceType was specified).
21463
21464         Delay the creation of the PropertyBuilder.
21465
21466         Only create the PropertyBuilder if we are not an explicit
21467         interface implementation.   This means that explicit interface
21468         implementation members do not participate in regular function
21469         lookups, and hence fixes another major ambiguity problem in
21470         overload resolution (that was the visible effect).
21471
21472         (DefineMethod): Return whether we are doing an interface
21473         implementation. 
21474
21475         * typemanager.cs: Temporary hack until we get attributes in
21476         interfaces (Ravi is working on that) and we get IndexerName
21477         support in interfaces.
21478
21479         * interface.cs: Register the indexers as properties.
21480
21481         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
21482         warning, I have verified that this is a bug in the .NET runtime
21483         (JavaScript suffers of the same problem).
21484
21485         * typemanager.cs (MemberLookup): When looking up members for
21486         interfaces, the parent of an interface is the implicit
21487         System.Object (so we succeed in searches of Object methods in an
21488         interface method invocation.  Example:  IEnumerable x;  x.ToString
21489         ()) 
21490
21491 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
21492
21493         * class.cs (Event): Events should also register if they do
21494         implement the methods that an interface requires.
21495
21496         * typemanager.cs (MemberLookup); use the new GetInterfaces
21497         method. 
21498
21499         (GetInterfaces): The code used to lookup interfaces for a type is
21500         used in more than one place, factor it here. 
21501
21502         * driver.cs: Track the errors at the bottom of the file, we kept
21503         on going.
21504
21505         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
21506         instance if the method we are calling is static!
21507
21508 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
21509
21510         * attribute.cs (ApplyAttributes): Make this function filter out
21511         the IndexerName attribute (as that attribute in reality is never
21512         applied) and return the string constant for the IndexerName
21513         attribute. 
21514
21515         * class.cs (TypeContainer.Emit): Validate that all the indexers
21516         have the same IndexerName attribute, and if so, set the
21517         DefaultName attribute on the class. 
21518
21519         * typemanager.cs: The return value might contain other stuff (not
21520         only methods).  For instance, consider a method with an "Item"
21521         property and an Item method.
21522
21523         * class.cs: If there is a problem with the parameter types,
21524         return. 
21525
21526 2002-05-24  Ravi Pratap  <ravi@ximian.com>
21527
21528         * ecore.cs (ImplicitConversionExists): Wrapper function which also
21529         looks at user defined conversion after making a call to 
21530         StandardConversionExists - we need this for overload resolution.
21531
21532         * expression.cs : Update accordingly the various method calls.
21533
21534         This fixes 2 bugs filed against implicit user defined conversions 
21535
21536 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
21537
21538         * statement.cs: Track the result of the assignment.
21539
21540 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
21541
21542         * expression.cs (MemberAccess): Improved error reporting for
21543         inaccessible members.
21544
21545 2002-05-22  Martin Baulig  <martin@gnome.org>
21546
21547         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
21548         itself with debugging support.
21549
21550 2002-05-22  Martin Baulig  <martin@gnome.org>
21551
21552         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
21553         Removed, this isn't needed anymore.
21554
21555 2002-05-20  Martin Baulig  <martin@gnome.org>
21556
21557         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
21558         be underlying type for an enum.
21559
21560 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
21561
21562         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
21563         that splits out the loading of just the core types.
21564
21565         * rootcontext.cs (ResolveCore): Split the struct resolution in
21566         two, so we can load the enumeration underlying types before any
21567         enums are used.
21568
21569         * expression.cs (Is): Bandaid until we fix properly Switch (see
21570         bug #24985 for details).
21571
21572         * typemanager.cs (ImplementsInterface): The hashtable will contain
21573         a null if there are no interfaces implemented.
21574
21575 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
21576
21577         * cs-parser.jay (indexer_declarator): It is fine to have array
21578         parameters
21579
21580 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21581
21582         * typemanager.cs: (RegisterBuilder): New function used to register
21583         TypeBuilders that implement interfaces.  Since
21584         TypeBuilder.GetInterfaces (as usual) does not work with lame
21585         Reflection.Emit. 
21586         (AddUserType): register interfaces.
21587
21588         (ImplementsInterface): Use the builder_to_ifaces hash if we are
21589         dealing with TypeBuilder.  Also, arrays are showing up as
21590         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
21591         methods can not be invoked on them!
21592
21593         * ecore.cs (ExplicitReferenceConversionExists): Made public.
21594         (ImplicitReferenceConversionExists): Split out from
21595         StandardConversionExists. 
21596
21597         * expression.cs (As): We were only implementing one of the three
21598         cases for the as operator.  We now implement them all.
21599         (Is): Implement the various other cases for Is as well.
21600
21601         * typemanager.cs (CACHE): New define used to control if we want or
21602         not the FindMembers cache.  Seems to have a negative impact on
21603         performance currently
21604
21605         (MemberLookup): Nested types have full acess to
21606         enclosing type members
21607
21608         Remove code that coped with instance/static returns for events, we
21609         now catch this in RealFindMembers.
21610
21611         (RealFindMembers): only perform static lookup if the instance
21612         lookup did not return a type or an event.  
21613
21614 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
21615
21616         * assign.cs (CompoundAssign): We pass more semantic information
21617         now to Compound Assignments than we did before: now we have all
21618         the information at hand, and now we resolve the target *before* we
21619         do the expression expansion, which allows the "CacheValue" method
21620         to have the effect we intended (before, a [x] += 1 would generate
21621         two differen ArrayAccess expressions from the ElementAccess,
21622         during the resolution process).
21623
21624         (CompoundAssign.DoResolve): Resolve target and original_source here.
21625
21626 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
21627
21628         * expression.cs (ArrayAccess): dropped debugging information. 
21629
21630         * typemanager.cs: Small bug fix: I was always returning i_members,
21631         instead of one of i_members or s_members (depending on which had
21632         the content).
21633
21634         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
21635         method is invoked before any code generation takes place, and it
21636         is a mechanism to inform that the expression will be invoked more
21637         than once, and that the method should use temporary values to
21638         avoid having side effects
21639
21640         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
21641
21642         * ecore.cs (Expression.CacheTemporaries): Provide empty default
21643         implementation.
21644
21645         * expression.cs (Indirection, ArrayAccess): Add support for
21646         CacheTemporaries in these two bad boys. 
21647
21648         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
21649         ldobj or ldind_ref.  
21650         (StoreFromPtr): Handle stobj as well.
21651
21652         * expression.cs (UnaryMutator): Share more code.
21653
21654         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
21655         down: I was not tracking the Filter function as well, which
21656         was affecting the results of the cache.
21657
21658 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * attribute.cs: Remove the hack to handle the CharSet property on
21661         StructLayouts. 
21662
21663 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
21664
21665         * attribute.cs (DoResolve): More uglyness, we now only try to
21666         resolve the attribute partially, to extract the CharSet
21667         information (only if we are a StructLayout attribute).  Otherwise 
21668
21669         (GetExtraTypeInfo): Add some code to conditionally kill in the
21670         future this.   I am more and more convinced that the .NET
21671         framework has special code to handle the attribute setting on
21672         certain elements.
21673
21674         * expression.cs (IsParamsMethodApplicable): Revert my previous
21675         foreach change here, it was wrong.
21676
21677 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
21678
21679         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
21680         (pp_expr): do not abort on unknown input, just return.
21681         (eval): abort if there are pending chars.
21682
21683         * attribute.cs (Attribute.Resolve): Positional parameters are
21684         optional.  Deal with that case.
21685
21686         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
21687         the Ansi/Unicode/Auto information for the type.
21688
21689         (TypeContainer.DefineType): instantiate the EmitContext here, as
21690         we will be using it during the type definition (to resolve
21691         attributes) and during the emit phase.
21692
21693         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
21694         to pull type information out of the attributes
21695
21696         (Attribute.Resolve): track the constructor builder, and allow for
21697         multiple invocations (structs and classes will use this).
21698
21699         * ecore.cs (MemberLookupFinal): new version with all the
21700         parameters customizable.
21701
21702         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
21703         constructors.  Return if the result value is null (as the error
21704         would have been flagged already by MemberLookupFinal)
21705
21706         Do not allow instances of abstract classes or interfaces to be
21707         created.
21708
21709         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
21710         We have to compare the assembly property here when dealing with
21711         FamANDAssem and Assembly access modifiers, because we might be
21712         creating an assembly from *modules* (that means that we are not
21713         getting TypeBuilders for types defined in other modules that are
21714         part of this assembly).
21715
21716         (Method.Emit): If the method is marked abstract and has a body,
21717         emit an error. 
21718
21719         (TypeContainer.DefineMembers): If both the defined member and the
21720         parent name match are methods, then do not emit any warnings: let
21721         the Method.Define routine take care of flagging warnings.  But if
21722         there is a mismatch (method overrides something else, or method is
21723         overriwritten by something, then emit warning).
21724
21725         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
21726         set to null, this means `do not check for the return type on the
21727         signature'. 
21728
21729         (Method.Define): set the return type for the method signature to
21730         null, so that we get methods with the same name and parameters and
21731         different return types.  This is used to flag warning 114 (you are
21732         hiding a method, and you probably want to use the new/override
21733         keywords instead).
21734
21735         * typemanager.cs (MemberLookup): Implemented proper access
21736         control, closing a long standing set of bug reports.  The problem
21737         was that the Framework only has two bits: Public and NonPublic,
21738         and NonPublic includes private and protected methods, but we need
21739         to enforce the FamANDAssem, FamOrAssem and Family. 
21740
21741 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
21742
21743         * statement.cs (GotoCase): Return true: Ammounts to giving up
21744         knowledge on whether we return or not, and letting the other case
21745         be responsible for it.
21746
21747 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
21748
21749         * driver.cs: Do not load directories for each file processed, only
21750         do it if there is a pattern.
21751
21752         * ecore.cs: Report readonly assigns here as well, as we might have
21753         been resolved only by MemberAccess.
21754
21755         (SimpleName.SimpleNameResolve): Also be useful for LValue
21756         resolution.   We need this to propagate assign to local readonly variables
21757
21758         * typemanager.cs: Use a ptrhashtable for the criteria, because we
21759         do not want to reuse potential criteria memory.
21760
21761         * class.cs (MyEventBuilder): Set reflected_type;
21762
21763         * ecore.cs (Constantify): Added support for constifying bools.
21764
21765         (RootContext.LookupType): Added a cache for values looked up in
21766         the declaration space.
21767
21768         * typemanager.cs (FindMembers): Now is a front-end to
21769         RealFindMembers, and provides a two-level hashtable-based cache to
21770         the request.  
21771
21772         15% performance improvement: from 22.5 to 19.2 seconds.
21773
21774         * expression.cs (IsParamsMethodApplicable): use foreach.
21775         (Invocation.DoResolve): ditto.
21776         (New.DoResolve): ditto.
21777         (ArrayCreation.DoResolve): ditto.
21778
21779         * ecore.cs (FindMostEncompassingType): use foreach.
21780
21781         * delegate.cs (NewDelegate.DoResolve): Use foreach
21782
21783         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
21784         (RemoveMethods): use foreach.
21785
21786         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
21787         nested foreach statements instead of for, and also break out of
21788         the inner loop once a match is found.
21789
21790         (Invocation.OverloadResolve): Use foreach, simplify the code. 
21791
21792 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
21793
21794         * cfold.cs (BinaryFold): During an enumeration evaluation context,
21795         we actually unwrap the expression to allow for extra information
21796         to be extracted. 
21797
21798         * expression.cs: Use Shr_Un on unsigned operations. 
21799
21800 2002-05-08  Ravi Pratap  <ravi@ximian.com>
21801
21802         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
21803         applicable operators was not being considered correctly. This closes
21804         the bug Miguel reported.
21805
21806 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
21807
21808         * attribute.cs: check that the type derives from System.Attribute
21809         and report the correct error in that case (moved the duplicate code to
21810         its own method, too).
21811
21812 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
21813
21814         * attribute.cs: lookup attribute type name as the spec says: first the
21815         bare attribute name and then name + "Attribute" (nant compiles with
21816         mcs after this fix).
21817
21818 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
21819
21820         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
21821         Because of the way we parse things, we should try to see if a
21822         UIntConstant can fit in an integer.
21823
21824 2002-05-07  Ravi Pratap  <ravi@ximian.com>
21825
21826         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
21827         when we are in an explicit context.
21828
21829         (ConvertReferenceExplicit): When converting from Iface type S to Class
21830         T make sure the rules are implemented as an OR.
21831
21832         * parameter.cs (ParameterType): Make it a property for now although the
21833         purpose really isn't anything immediate.
21834
21835         * expression.cs (Is*Applicable): Do better checking on the parameter type
21836         of a ref/out parameter. The ones from the system assemblies are already 
21837         marked with the correct type so we don't need to do any correction.
21838
21839         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
21840         the object type is standard too so include that.
21841
21842 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21843
21844         * ecore.cs (StandardConversionExists): Augment with missing code:
21845         deal with IntConstant, LongConstants and Enumerations.
21846
21847         * assign.cs: Report the error, instead of failing silently
21848
21849         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
21850         typecontainer that they are declared, because the
21851         typecontainer/namespace will have the list of using clauses that
21852         need to be applied.
21853
21854         Assembly Attributes were escaping the normal registration
21855         mechanism. 
21856
21857         (EmitCode): Apply attributes within an EmitContext that represents
21858         the container they were declared on.
21859
21860         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
21861
21862 2002-05-06  Ravi Pratap  <ravi@ximian.com>
21863
21864         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
21865         Revamp completely - make much cleaner as we now operate only
21866         on a set of Types.
21867
21868         (FindMostSpecificSource, FindMostSpecificTarget): New methods
21869         to implement the logic detailed in the spec more correctly.
21870
21871         (UserDefinedConversion): Update accordingly.
21872
21873 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21874
21875         * statement.cs: Return flow analysis information up.
21876
21877         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
21878         and the default.
21879
21880         (token): Do not consume an extra character before calling
21881         decimal_digits.
21882
21883 2002-05-06  Piers Haken <piersh@friskit.com>
21884
21885         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
21886
21887 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * class.cs (Constructor.Emit): Set the IsStatic flag in the
21890         EmitContext during the instance constructor initializer
21891         resolution, to stop access to instance variables.
21892
21893         This is mandated by the spec, last paragraph of the `constructor
21894         initializers' section. 
21895
21896 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
21897
21898         * cs-parser.jay, class.cs (Accessor): new class used to represent
21899         an accessor (get or set).  In the past we used `null' to represent
21900         a missing accessor.  But this is ambiguous because there was no
21901         way to tell in abstract indexers/properties if one of them was
21902         specified.
21903
21904         Now there is a way of addressing that.
21905
21906         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
21907         instead of FindMembers.
21908
21909         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
21910         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
21911
21912         * attribute.cs: Treat indexers and properties as the same in terms
21913         of applying attributes
21914
21915         * ecore.cs (FindMostEncompassedType): Use statically initialized
21916         EmptyExpressions()s like we do elsewhere to avoid creating useless
21917         objects (and we take this out of the tight loop).
21918
21919         (GetConversionOperators): Move the code to extract the actual
21920         operators to a separate routine to clean things up.
21921
21922 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
21923
21924         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
21925         events are always registered FieldBuilders.
21926
21927         * class.cs (FieldBase): New class shared by Fields 
21928
21929         * delegate.cs: If we are a toplevel delegate, use our full name.
21930         If we are a nested delegate, then only use our tail name.
21931
21932 2002-05-02  Ravi Pratap  <ravi@ximian.com>
21933
21934         * expression.cs (IsApplicable): Ensure that we add the "&" to
21935         ref/out types before comparing it with the type of the argument.
21936
21937         (IsParamsMethodApplicable): Ditto.
21938
21939         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
21940         silly me ;-)
21941
21942         * delegate.cs : Handle the case when we have more than one applicable
21943         method. Flag an error only when we finish checking all.
21944
21945 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
21946
21947         * expression.cs: Add support for boolean static initializers.
21948
21949 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
21950
21951         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
21952
21953         * parameter.cs (ComputeParameterTypes,
21954         ComputeAndDefineParameterTypes): Better error handling: now we
21955         clear the `types' cache if we fail during any of the type lookups.
21956         We also return the status code correctly to our caller
21957
21958         * delegate.cs: If we fail to define a delegate, abort the extra
21959         steps. 
21960
21961         * expression.cs (Binary.ResolveOperator): for
21962         operator==(object,object) and operator !=(object, object) we also
21963         have to verify that there is an implicit conversion from one to
21964         the other.
21965
21966         (ArrayAccess.DoResolve): Array Access can operate on
21967         non-variables. 
21968
21969 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
21970
21971         * assign.cs (CompoundAssign): A new class used as a "flag" that
21972         the assignment actually is happening as part of a compound
21973         assignment operator.
21974
21975         During compound assignment, a few new rules exist to enable things
21976         like:
21977
21978         byte b |= 1 + 2
21979
21980         From the spec:
21981
21982         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
21983         to the type of x) if y is implicitly convertible to the type of x,
21984         and the operator is a builtin operator and the return type of the
21985         operator is explicitly convertible to the type of x. 
21986
21987         * rootcontext.cs: Reset warning level to 2.  4 catches various
21988         "interesting" features in mcs, we must clean this up at some
21989         point, but currently am trying to kill other bugs ;-)
21990
21991         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
21992         in container classes as well.  
21993
21994         * expression.cs (Binary.ResolveOperator): Handle string case
21995         before anything else (as operator overloading does emit an error
21996         before doing anything else).
21997
21998         This code could go away when we move to a table driven model, but
21999         i could not come up with a good plan last night.
22000
22001 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
22002
22003         * typemanager.cs (CSharpName): reimplementation using regex.
22004         * class.cs: added null check for fields in Emit
22005         * rootcontext.cs: set warninglevel to 4
22006
22007 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
22008
22009         * typemanager.cs (CSharpName): reimplemented with Lupus
22010         suggestion.
22011
22012 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
22013
22014         * statement.cs (If): correclty implement Resolve, because we were
22015         not catching sem errors in there.  The same process is needed
22016         everywhere else. 
22017         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
22018
22019
22020         (Statement.Warning_DeadCodeFound): Factorize code.
22021         (While): Report dead code here too.
22022
22023         (Statement): Added Resolve virtual method to allow
22024         for resolution split from the emit code.
22025
22026 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
22027
22028         * statement.cs (EmitBoolExpression): No longer try to resolve the
22029         expression here.    
22030         (MakeBoolean): New utility function that resolve, implicitly
22031         converts to boolean and tags the expression. 
22032
22033
22034         (If, Do): Implement dead code elimination.
22035         (While): Implement loop inversion
22036
22037         (Do, While, For, If): Resolve the expression prior to calling our
22038         code generation.
22039
22040 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
22041
22042         * class.cs:
22043           - added method Report28 (warning: program has more than one entry point)
22044           - added method IsEntryPoint, implements paragraph 10.1 of the spec
22045           - modified method Method.Define, the part at the end of the method
22046
22047         * rootcontext.cs: added static public Location EntryPointLocation;
22048           
22049         * ../errors/cs0028.cs : Add test case for the above warning.              
22050
22051         * typemanager.cs:
22052           - modified method CSharpName to allow arrays of primitive type to
22053             be printed nicely (e.g. instead of System.Int32[][] it now prints
22054             int[][])
22055           - added method CSharpSignature: returns the signature of a method
22056             in string format to be used in reporting errors, warnings, etc.
22057
22058         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
22059         with String.Empty.
22060
22061 2002-04-26  Ravi Pratap  <ravi@ximian.com>
22062
22063         * delegate.cs (Define): Fix extremely silly bug where I was
22064         setting the type of the 'object' parameter of the BeginInvoke
22065         method to System.IAsyncResult instead of System.Object ;-)
22066
22067 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
22068
22069         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
22070         here. 
22071
22072         (Constructor.Emit): return if we fail to initialize the
22073         constructor.  Another door closed!  
22074
22075         * expression.cs (New.DoResolve): Improve error message (from -6 to
22076         1501).  Use DeclaredOnly lookup to find the exact constructor.
22077
22078         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
22079         loop.  This is useful.
22080
22081         * cs-parser.jay: Adjust the default parameters so that destructors
22082         have the proper signature.
22083
22084 2002-04-26  Martin Baulig  <martin@gnome.org>
22085
22086         * driver.cs (LoadAssembly): If `assembly' contains any characters
22087         which are only valid in path names and not in assembly names
22088         (currently slash, backslash and point), use Assembly.LoadFrom ()
22089         instead of Assembly.Load () on the `assembly' (before iteration
22090         over the link_paths).
22091
22092 2002-04-26  Martin Baulig  <martin@gnome.org>
22093
22094         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
22095
22096 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
22097
22098         * class.cs (Property): use the new typemanager.MemberLookup
22099
22100         (TypeContainer.MemberLookup): Implement using the
22101         TypeManager.MemberLookup now. 
22102
22103         * typemanager.cs: Make MemberLookup a function of the TypeManager,
22104         and return MemberInfos, so that these can be used without an
22105         EmitContext (what we had before).
22106
22107 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
22108
22109         * expression.cs: Fix the case where the argument to params if the
22110         type of the params.  I omitted handling this before.   Fixed
22111
22112 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
22113
22114         * driver.cs: Call BootCorlib_PopulateCoreType
22115
22116         * class.cs (Property.CheckBase): Check for properties only, not
22117         for all members. 
22118
22119         * interface.cs: Temporary hack: try/catch around the
22120         CustomAttributeBuilder, because I am getting an exception that I
22121         do not understand.
22122
22123         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
22124         types whose definitions are required to be there (attributes are
22125         defined before standard types).
22126
22127         Compute definitions as we boot the various types, as they are used
22128         immediately (value_type class will need object_type, but if we do
22129         not initialize object_type, we will pass a null, which will let
22130         the runtime pick the System.Object from the existing corlib, which
22131         is not what we want).
22132
22133 2002-04-22  Patrik Torstensson <totte@labs2.com>
22134
22135         * cs-tokenizer.cs: fixed a number of trim() issues.
22136
22137 2002-04-22  Ravi Pratap  <ravi@ximian.com>
22138
22139         * expression.cs (Argument.Type): Ensure that we return the correct
22140         type when we have out or ref parameters [in which case we 
22141         append a "&"].
22142
22143 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
22144
22145         * class.cs (Property, Indexer): Allow extern modifier in there. 
22146
22147         * typemanager.cs (InitBaseTypes): Initializes object_type and
22148         value_type, since those will be used early on during the bootstrap
22149         process to compile corlib.
22150
22151         (InitCoreTypes): Move code from here to InitBaseTypes.
22152
22153 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
22154
22155         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
22156         single-dimension arrays as using the ldlen opcode.  
22157
22158         Daniel Lewis discovered this optimization.  
22159
22160         * typemanager.cs: Add signature for System.Array::get_Length
22161
22162 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22163
22164         * statement.cs: report the error when the foreach does not apply to an
22165         array nor a collection.
22166
22167 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
22168
22169         * expression.cs: Add implicit conversions to the operator ~.
22170
22171         * constant.cs (DecimalConstant.Emit): Emit decimal value.
22172
22173         * typemanager.cs: Locate the decimal constructor.
22174
22175 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22176
22177         * attribute.cs: use the new property of TypeOf.
22178         * expression.cs: added 'get' property around typearg.
22179
22180         These changes fix a build breaker reported by NickD. Is this the
22181         correct way to fix?  If not, please, revert my changes and make it
22182         work :-).
22183
22184 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
22185
22186         * attribute.cs: Add support for typeof in attribute invocations.
22187         I am not sure that this is right though.
22188
22189 2002-04-14  Duncan Mak  <duncan@ximian.com>
22190
22191         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
22192         Binary.Operator.Division case.
22193
22194 2002-04-13  Ravi Pratap  <ravi@ximian.com>
22195
22196         * class.cs (DefineType): Ensure that we do a proper check on
22197         attribute types and also register it with the TypeManager.
22198
22199         (TypeContainer.Targets): The default for attribute types is
22200         AttributeTargets.All.
22201
22202         * attribute.cs (ApplyAttributes): Registering the attribute type
22203         is done elsewhere, not when we discover we have a Usage attribute.
22204
22205 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22206
22207         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
22208         and get rid of is_delegate parameter.
22209
22210         * everywhere : update.
22211
22212 2002-04-12  Ravi Pratap  <ravi@ximian.com>
22213
22214         * cs-parser.jay (compilation_unit): Revamp completely to use
22215         some new ideas that I got from Rhys' grammar to solve the problems
22216         with assembly level attributes.
22217
22218         (outer_declaration): New grammar production.
22219
22220         (attribute_sections): Add.
22221
22222         (opt_attributes): Base on attribute_sections
22223
22224         (namespace_declaration): Allow opt_attributes to tackle the case
22225         when we have assembly level attributes - we are clever in this
22226         regard now ;-)
22227
22228         * attribute.cs (ApplyAttributes): Do not worry about assembly 
22229         attributes in the non-global context.
22230
22231         * rootcontext.cs (AddGlobalAttributes): Go back to using this
22232         instead of SetGlobalAttributes.
22233
22234         * class.cs, rootcontext.cs : Ensure we define and generate 
22235         attribute types before anything else.
22236
22237         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
22238         and flag the new error -20 for the case when the attribute type
22239         does not have valid targets specified. csc does not catch this.
22240
22241         * ../errors/errors.txt : update for error # -20
22242
22243 2002-04-11  Ravi Pratap  <ravi@ximian.com>
22244
22245         * support.cs (InternalParameters.ParameterModifier): Do some null
22246         checking and return sane values.
22247
22248         * class.cs (Method.Define): If we are a PInvoke method, ensure
22249         that we are static and extern. Report error # 601
22250
22251         * ../errors/cs0601.cs : Add test case for the above error.
22252
22253 2002-04-07  Ravi Pratap  <ravi@ximian.com>
22254
22255         * rootcontext.cs (attribute_types): We need to keep type of
22256         all attribute types separately and emit code for them first.
22257
22258         (RegisterAttribute) : Implement.
22259
22260         * class.cs (DefineType): Check if the current Type is a custom
22261         attribute type and register it accordingly.
22262
22263         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
22264         adding the first attribute twice and rename to
22265
22266         (SetGlobalAttributes): this.
22267
22268         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
22269         lookups.
22270
22271         * attribute.cs (ApplyAttributes): Take an additional argument telling us
22272         if we are processing global arguments. Hmm, I am unsure of this.
22273
22274 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22275
22276         * expression.cs: added static array of strings to avoid calling
22277         Enum.ToString () for Operator in Binary. Significant recover of
22278         performance.
22279
22280 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
22281
22282         * class.cs (FindMembers): Allow the Builders of the various
22283         members to be null.  If they are skip them.  This only happens
22284         during the PInvoke declaration.
22285
22286 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
22287
22288         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
22289         failure, so we do not keep going afterwards.
22290
22291         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
22292         wanted to pass `false' as the `is_delegate' argument.  If this is
22293         the case, why not use delegate_type == null to mean `is_delegate =
22294         false' and anything else as is_delegate = true.
22295
22296 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
22297
22298         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
22299         code for the section, not the beginning of the tests.
22300
22301 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
22302
22303         * cfold.cs: Handle operator + (Enum x, Underlying x) 
22304
22305         * expression.cs (Binary): same.  Warn about errors where we have
22306         Enum/Enum in operator + as well.
22307
22308 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
22309
22310         * statement.cs:
22311                 - added support for switch(bool)
22312                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
22313                 - add TableSwitchEmit() to handle table-based switch statements
22314
22315 2002-04-05  Ravi Pratap  <ravi@ximian.com>
22316
22317         * expression.cs (Invocation.OverloadResolve): Factor out code which
22318         does parameter compatibility checking with arguments so that we can 
22319         re-use the code even from Delegate.VerifyApplicability
22320
22321         (VerifyArgumentsCompat): Move above code here.
22322
22323         * delegate.cs (VerifyApplicability): Get rid of duplicate code
22324         and instead make a call to the above method.
22325
22326 2002-03-31  Ravi Pratap  <ravi@ximian.com>
22327
22328         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
22329         We use it to keep track of classes which are attribute types.
22330
22331 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
22332
22333         * delegate.cs (Delegate.Define): Correctly define the types in the
22334         presence of fixed and array parameters.
22335
22336         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
22337         doing FindMembers.
22338
22339         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
22340         include NonPublic after the first iteration.
22341
22342         * class.cs (Indexer.CheckBase): Only check if both parents are
22343         non-null. 
22344
22345         * cs-parser.jay (accessor_body): If empty, set to null.
22346
22347         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
22348         same code path here to resolve constants names that we did have in
22349         MemberAccess.DoResolve.  There is too much code duplicated here.
22350
22351 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
22352
22353         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
22354
22355         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
22356         to MakeUnionSet.
22357
22358         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
22359         tokens, numbers and strings.
22360
22361         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
22362         parenthesis.
22363
22364         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
22365         asyncronous parameters and the regular parameters.  
22366
22367         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
22368         specify the target directory.
22369
22370         * expression.cs: (This.DoResolve): Simplify
22371         (As.Emit): Optimize, do not generate IsInst if the expression is
22372         always of the given type.
22373
22374         (Is.DoResolve): Bug fix, we were reporting both always/never for
22375         the is expression.
22376
22377         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
22378         creating too many unnecessary arrays.
22379
22380 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
22381
22382         * class.cs (EmitFieldInitializer): Use Assign expression to assign
22383         fields instead of rolling our own initializer.   Takes care of all
22384         implicit conversions, and drops unnecessary static checks/argument.
22385
22386 2002-03-31  Dick Porter  <dick@ximian.com>
22387
22388         * driver.cs: use the GetDirectories() return values properly, and
22389         use "/" as path separator.
22390
22391 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
22392
22393         * expression.cs (Unary): Optimize - - expr into expr.
22394         (Binary): Optimize a + (-b) into a -b.
22395
22396         * codegen.cs (CodeGen): Made all methods static.
22397
22398 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
22399
22400         * rootcontext.cs: 
22401
22402         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
22403         TypeBuilder property.
22404
22405         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
22406         instead. 
22407
22408         * tree.cs: Removed the various RecordXXXX, and replaced with a
22409         single RecordDecl.  Removed all the accessor methods, and just
22410         left a single access point Type 
22411
22412         * enum.cs: Rename DefineEnum to DefineType.
22413
22414         * decl.cs: New abstract method `DefineType' used to unify the
22415         Defines for Enumerations, Interfaces, TypeContainers and
22416         Delegates.
22417
22418         (FindType): Moved LookupInterfaceOrClass here.  Moved the
22419         LookupBaseClasses method that used to live in class.cs and
22420         interface.cs here, and renamed to FindType.
22421
22422         * delegate.cs: Implement DefineType.  Take advantage of the
22423         refactored pattern for locating the parent builder without taking
22424         the parent_builder argument (which we know does not work if we are
22425         nested, and triggering a toplevel definition).
22426
22427 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22428
22429         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
22430         accessibility of a member has changed during override and report
22431         an error if so.
22432
22433         * class.cs (Method.Define, Property.Define): Only complain on
22434         overrides if the method is private, any other accessibility is
22435         fine (and since we just checked the permission is the same, we are
22436         good to go).
22437
22438         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
22439         and elif are processed always.  The other pre-processing
22440         directives are only processed if we are "taking" the path
22441
22442 2002-03-29  Martin Baulig  <martin@gnome.org>
22443
22444         * class.cs (Method.Emit): Only emit symbolic debugging info if the
22445         current location is not Null.
22446
22447         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
22448         a separate method so we can profile it.
22449
22450         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
22451         `span.Seconds' are just seconds, but no minutes or hours.
22452         (MainDriver): Profile the CodeGen.SaveSymbols calls.
22453
22454 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22455
22456         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
22457         Remove the gratuitous set of Final:
22458
22459                                 // If an interface implementation, then we can set Final.
22460                                 if (((flags & MethodAttributes.Abstract) == 0) &&
22461                                     implementing.DeclaringType.IsInterface)
22462                                         flags |= MethodAttributes.Final;
22463
22464         I do not know what I was smoking when I used that.
22465
22466
22467         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
22468         step into fixing the name resolution issues for delegates and
22469         unifying the toplevel name resolution.
22470
22471 2002-03-28  Martin Baulig  <martin@gnome.org>
22472
22473         * class.cs (Method.Emit): If we have a symbol writer, call its
22474         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
22475         tell it about the current method.
22476
22477         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
22478         writer that we're going to emit the first byte of IL code for a new
22479         statement (a new source line).
22480         (EmitContext.EmitTopBlock): If we have a symbol writer, call
22481         EmitContext.Mark() before emitting any code.
22482
22483         * location.cs (SymbolDocument): Return null when we're Null.
22484
22485         * statement.cs (Statement): Moved the `Location loc' variable here.
22486         (Statement.EmitBoolExpression): If we have a symbol writer, call
22487         ec.Mark() before emitting any code to tell it that we're at the
22488         beginning of a new statement.
22489         (StatementExpression): Added `Location' argument to the constructor.
22490         (Block): Added public readonly variable `StartLocation' and public
22491         variable `EndLocation'.  The latter is to be set using SetEndLocation().
22492         (Block): Added constructor which takes a start and end location.
22493         (Block.SetEndLocation): New method. This sets the end location.
22494         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
22495         local variables we create.
22496         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
22497         each statement and do also mark the begin and end of the block.
22498
22499         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
22500         tell it the current lexer.Location, use Location.Null for the end of the
22501         block.
22502         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
22503         current block, set its end location using SetEndLocation().
22504         (statement_expression): StatementExpression constructor now takes the
22505         lexer.Location as additional argument.
22506         (for_statement, declare_local_variables): Likewise.
22507         (declare_local_variables): When creating a new implicit block, use the
22508         new Block constructor and pass it the lexer.Location.
22509
22510 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
22511
22512         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
22513         members also on the parent interfaces recursively.
22514
22515 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
22516
22517         * report.cs: Use new formats, since Gonzalo finished the missing
22518         bits. 
22519
22520         * expression.cs (Binary.ResolveOperator): added missing operator|
22521         operator& and operator^ for bool/bool.
22522
22523         * cs-parser.jay: CheckDef now takes a Location argument that is
22524         used to report errors more precisly (instead of reporting the end
22525         of a definition, we try to track something which is a lot closer
22526         to the source of the problem).
22527
22528         * cs-tokenizer.cs: Track global token use, so we can properly flag
22529         the use of #define/#undef after the first token has been seen.
22530
22531         Also, rename the reportXXXX to Error_DescriptiveName
22532
22533         * decl.cs (DeclSpace.IsTopLevel): Move property here from
22534         TypeContainer, so that Enum and Interface can use this too.
22535
22536         * class.cs (TypeContainer.LookupInterfaceOrClass,
22537         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
22538         `builder' argument.  Typically this was used to pass the parent
22539         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
22540         the definition).  
22541
22542         The problem is that a nested class could trigger the definition of
22543         a toplevel class, and the builder would be obviously wrong in that
22544         case. 
22545
22546         So we drop this argument, and we compute dynamically the
22547         TypeBuilder/ModuleBuilder (the correct information was available
22548         to us anyways from DeclSpace.Parent)
22549
22550         * interface.cs (Interface.DefineInterface): Drop builder
22551         parameter cleanup like class.cs
22552
22553         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
22554         like class.cs
22555
22556         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
22557         values. 
22558
22559         (Try.Emit): Propagate the returns value from the statement.
22560
22561         (Return.Emit): Even if we are leavning 
22562
22563         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
22564
22565         * modifiers.cs: Fix the computation of MethodAttributes flags.
22566
22567 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
22568
22569         * driver.cs: allow compilation of files that start with '/'.
22570         Add a default case when checking the argument of --target.
22571
22572 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
22573
22574         * interface.cs: Implement the same search algorithm for types in
22575         the interface code.
22576
22577         * delegate.cs: Do not allow multiple definition.
22578
22579         * Recovered ChangeLog that got accidentally amputated
22580
22581         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
22582
22583         * rootcontext.cs: Load manually enum to allow core classes to
22584         contain enumerations.
22585
22586         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
22587         Update to new static methods in TypeManager.
22588
22589         * typemanager.cs (GetMethod, GetConstructor): Use our
22590         implementation of FindMembers to find the members, since during
22591         corlib compilation, the types are TypeBuilders and GetMethod and
22592         GetConstructor do not work.
22593
22594         Make all methods in TypeManager static.
22595
22596         (InitCodeHelpers): Split the functionality from
22597         the InitCodeTypes function.
22598
22599         * driver.cs: Call InitCodeHelpers after we have populated the
22600         types. 
22601
22602         * cs-parser.jay (delegate_declaration): we did not used to compute
22603         the delegate name correctly for void delegates.
22604
22605 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
22606
22607         * rootcontext.cs (RootContext): Init the interface_resolve_order
22608         and type_container_resolve_order always.
22609
22610         (ResolveCore, BootstrapCorlib_ResolveClass,
22611         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
22612         compiler when compiling with --nostdlib
22613
22614         * class.cs (TypeContainer.DefineType): Check that our parent is
22615         not null.  This test is most important when we are bootstraping
22616         the core types.
22617
22618         * codegen.cs: Split out the symbol writing code.
22619
22620 2002-03-25  Martin Baulig  <martin@gnome.org>
22621
22622         * driver.cs (-g): Made -g an alias for --debug.
22623
22624 2002-03-24  Martin Baulig  <martin@gnome.org>
22625
22626         * codegen.cs (SymbolWriter): New public variable. Returns the
22627         current symbol writer.
22628         (CodeGen): Added `bool want_debugging_support' argument to the
22629          constructor. If true, tell the ModuleBuild that we want debugging
22630         support and ask it for the ISymbolWriter.
22631         (Save): If we have a symbol writer, call it's Close() method after
22632         saving the assembly.
22633
22634         * driver.c (--debug): New command line argument to create a
22635         debugger information file.
22636
22637         * location.cs (SymbolDocument): New public property. Returns an
22638         ISymbolDocumentWriter object for the current source file or null
22639         if we don't have a symbol writer.
22640
22641 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
22642
22643         * driver.cs (LoadAssembly): Correctly return when all the paths
22644         have been tried and not before.
22645
22646         * statement.cs (Switch.Emit): return the actual coverage for this
22647         statement (returns/not-returns)
22648
22649         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
22650         switch of the statement if we are the last switch section.  That
22651         kills two problems: try/catch problems (we used to emit an empty
22652         nop at the end) and switch statements where all branches would
22653         return. 
22654
22655 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
22656
22657         * driver.cs: Add default assemblies (the equivalent to the
22658         Microsoft CSC.RSP file)
22659
22660         * cs-tokenizer.cs: When updating `cols and setting it to zero,
22661         also update tokens_seen and set it to false.
22662
22663         * driver.cs: Implement --recurse for Mike.
22664
22665         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
22666         correctly splitting out the paths.
22667
22668 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
22669
22670         * interface.cs (Interface.PopulateProperty): Instead of using
22671         `parent' as the declaration space for the set parameters, use
22672         `this' 
22673
22674         * support.cs (InternalParameters): InternalParameters constructor
22675         takes a DeclSpace instead of a TypeContainer.
22676
22677         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
22678         types are being initialized, load the address of it before calling
22679         the function.  
22680
22681         (New): Provide a mechanism to disable the generation of local
22682         value type temporaries when the caller will be providing us with
22683         an address to store it.
22684
22685         (ArrayCreation.EmitDynamicInitializers): Use it.
22686
22687 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
22688
22689         * expression.cs (Invocation.EmitArguments): Only probe for array
22690         property if there is more than one argument.  Sorry about that.
22691
22692         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
22693         empty param arrays.
22694
22695         * class.cs (Method.LabelParameters): Fix incorrect code path that
22696         prevented the `ParamArrayAttribute' from being applied to the
22697         params attribute.
22698
22699 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
22700
22701         * support.cs (ReflectionParameters): Correctly compute whether the
22702         last argument is a params array.  Fixes the problem with
22703         string.Split ('a')
22704
22705         * typemanager.cs: Make the assemblies array always be non-null
22706         (empty, but non-null)
22707
22708         * tree.cs (RecordDecl): New function that abstracts the recording
22709         of names.  This reports error 101, and provides a pointer to the
22710         previous declaration.  Fixes a crash in the compiler.
22711
22712         * cs-parser.jay (constructor_declaration): Update to new grammar,
22713         and provide a constructor_body that can be empty.
22714
22715 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
22716
22717         * driver.cs: Add support for --resources.
22718
22719         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
22720         Make all types for the various array helper methods be integer.
22721
22722         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
22723         CheckState to ConvCast.
22724
22725         (ConvCast): Now it takes a `checked' state argument, to avoid
22726         depending on the emit context for the conversion, and just using
22727         the resolve time setting.
22728
22729         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
22730         instead of Invocation.EmitArguments.  We do not emit the original
22731         arguments, instead we emit those which have been converted to
22732         unsigned int expressions.
22733
22734         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
22735
22736         * codegen.cs: ditto.
22737
22738         * expression.cs (LocalVariableReference): Drop the use of the
22739         Store function that depended on the variable index.
22740
22741         * statement.cs (VariableInfo): Drop the `Idx' property from this
22742         class, as this is not taking into account the indexes for
22743         temporaries tat we generate during the execution, getting the
22744         indexes wrong.
22745
22746         * class.cs: First emit class initializers, then call the parent
22747         constructor. 
22748
22749         * expression.cs (Binary): Fix opcode emision.
22750         (UnaryMutator.EmitCode): Support checked code generation
22751
22752         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
22753         matches for events for both the Static and Instance scans,
22754         pointing to the same element.   Fix that.
22755
22756 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
22757
22758         * rootcontext.cs (ResolveTree): Always set the
22759         interface_resolve_order, because nested interfaces will be calling
22760         into us.
22761
22762         * class.cs (GetInterfaceOrClass): Track the same resolution
22763         process used by TypeManager.LookupType.  This fixes the nested
22764         type lookups in class declarations (separate path from
22765         LookupType). 
22766
22767         (TypeContainer.DefineType): Also define nested interfaces.
22768         (TypeContainer.RegisterOrder): New public function used to
22769         register the order in which child interfaces need to be closed.
22770
22771         Nested interfaces need to be closed after their parents have been
22772         created. 
22773
22774         * interface.cs (InterfaceAttr): Put all the logic for computing
22775         the interface attribute here. 
22776
22777         (DefineInterface): Register our interface order with the
22778         RootContext or with the TypeContainer depending on the case.
22779
22780 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22781
22782         * cs-parser.jay: rework foreach statement to work with the new
22783         changes to the policy on SimpleNames.
22784
22785         * report.cs: support Stacktrace on warnings as well.
22786
22787         * makefile: drop --unsafe and /unsafe from the compile.
22788
22789 2002-03-13  Ravi Pratap  <ravi@ximian.com>
22790
22791         * ecore.cs (StandardConversionExists): Modify to take an Expression
22792         as the first parameter. Ensure we do null -> reference type conversion
22793         checking.
22794
22795         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
22796         temporary Expression objects.
22797
22798 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
22799
22800         * interface.cs: workaround bug in method overloading resolution
22801         (there is already a bugzilla bug for it).
22802
22803 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
22804
22805         We could also solve this problem by having a separate path for
22806         performing type lookups, instead of DoResolve, we could have a
22807         ResolveType entry point, and only participating pieces of the
22808         production (simplename, deref, array) would implement this. 
22809
22810         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
22811         signal SimpleName to only resolve type names and not attempt to
22812         resolve anything else.
22813
22814         * expression.cs (Cast): Set the flag.
22815
22816         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
22817
22818         * class.cs: Only report 108 if there is no `new' modifier.
22819
22820         * cs-parser.jay: rework foreach statement to work with the new
22821         changes to the policy on SimpleNames.
22822
22823         * report.cs: support Stacktrace on warnings as well.
22824
22825         * makefile: drop --unsafe and /unsafe from the compile.
22826
22827 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
22828
22829         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22830         lookups here, instead of doing that at parse time.  This means
22831         that our grammar will not introduce `LocalVariableReferences' as
22832         expressions at this point.  That solves the problem of code like
22833         this:
22834
22835         class X {
22836            static void Main ()
22837            { int X = 1;
22838             { X x = null }}}
22839
22840         This is only half the fix.  The full fix requires parameters to
22841         also be handled in this way.
22842
22843         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
22844         makes the use more obvious of the DeclSpace.  The
22845         ec.TypeContainer.TypeBuilder is now only used to pull the
22846         TypeBuilder for it.
22847
22848         My theory is that I can get rid of the TypeBuilder completely from
22849         the EmitContext, and have typecasts where it is used (from
22850         DeclSpace to where it matters).  
22851
22852         The only pending problem is that the code that implements Aliases
22853         is on TypeContainer, and probably should go in DeclSpace.
22854
22855         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
22856         lookups here, instead of doing that at parse time.  This means
22857         that our grammar will not introduce `LocalVariableReferences' as
22858         expressions at this point.  That solves the problem of code like
22859         this:
22860
22861         class X {
22862            static void Main ()
22863            { int X = 1;
22864             { X x = null }}}
22865
22866         This is only half the fix.  The full fix requires parameters to
22867         also be handled in this way.
22868
22869         * class.cs (Property.DefineMethod): When implementing an interface
22870         method, set newslot, when implementing an abstract method, do not
22871         set the flag (before we tried never setting it, or always setting
22872         it, which is the difference).
22873         (Indexer.DefineMethod): same.
22874         (Method.DefineMethod): same.
22875
22876         * ecore.cs: Only set the status used flag if we get back a Field.
22877
22878         * attribute.cs: Temporary hack, so Paolo can keep working.
22879
22880 2002-03-08  Ravi Pratap  <ravi@ximian.com>
22881
22882         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
22883         the unmanaged type in the case we have a MarshalAs attribute.
22884
22885         (Resolve): Handle the case when we are parsing the special MarshalAs
22886         attribute [we need to store the unmanaged type to use later]
22887
22888         * typemanager.cs (marshal_as_attr_type): Built in type for the 
22889         MarshalAs Attribute.
22890
22891         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
22892         on parameters and accordingly set the marshalling info.
22893
22894 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
22895
22896         * class.cs: Optimizing slightly by removing redundant code after
22897         we switched to the `NoTypes' return value.
22898         (Property.DefineMethod): use NoTypes here too.
22899
22900         This fixes the bug I introduced in my last batch of changes.
22901
22902 2002-03-05  Ravi Pratap  <ravi@ximian.com>
22903
22904         * tree.cs (RecordEnum): Add. We now keep track of enums too.
22905
22906         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
22907         Enums since those are types too. 
22908
22909         * cs-parser.jay (enum_declaration): Record enums as we parse them.
22910
22911         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
22912         thanks to a call during the lookup process.
22913
22914 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
22915
22916         * statement.cs (Foreach): Lots of work to accomodate a particular
22917         kind of foreach statement that I had not kept in mind.  It is
22918         possible to have foreachs on classes that provide a GetEnumerator
22919         method that return objects that implement the "pattern" for using
22920         a foreach, there is no need to support GetEnumerator
22921         specifically. 
22922
22923         This is needed to compile nant.
22924
22925         * decl.cs: Only report 114 if the member is not `Finalize' and if
22926         the warning level is at least 2.
22927
22928         * class.cs: Moved the compare function from Method to
22929         MethodSignature. 
22930
22931         (MethodSignature.InheritableMemberSignatureCompare): Add new
22932         filter function that is used to extract inheritable methods from a
22933         class. 
22934
22935         (Method.Define): Use the new `inheritable_method_signature_filter'
22936         delegate
22937
22938         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
22939         command. 
22940
22941 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
22942
22943         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
22944
22945         * cs-parser.jay: Add opt_semicolon to the interface declaration.
22946
22947         * expression.cs: Pass location information to
22948         ConvertImplicitStandard. 
22949
22950         * class.cs: Added debugging code to track return values from
22951         interfaces. 
22952
22953 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
22954
22955         * expression.cs (Is.DoResolve): If either side of the `is' is an
22956         interface, do not flag the warning.
22957
22958         * ecore.cs (ImplicitReferenceConversion): We need a separate test
22959         for interfaces
22960
22961         * report.cs: Allow for --fatal to be used with --probe.
22962
22963         * typemanager.cs (NoTypes): Move the definition for the empty Type
22964         array here. 
22965
22966         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
22967         properties. 
22968         (TypeContainer.DefineProxy): New function used to proxy to parent
22969         implementations when implementing interfaces.
22970         (TypeContainer.ParentImplements): used to lookup if our parent
22971         implements a public function that is required by an interface.
22972         (TypeContainer.VerifyPendingMethods): Hook this up.
22973
22974         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
22975         `modules' and `assemblies' arraylists into arrays.  We only grow
22976         these are the very early start up of the program, so this improves
22977         the speedof LookupType (nicely measured).
22978
22979         * expression.cs (MakeByteBlob): Replaced unsafe code with
22980         BitConverter, as suggested by Paolo.
22981
22982         * cfold.cs (ConstantFold.Binary): Special case: perform constant
22983         folding of string concatenation, but if either side is a string,
22984         and the other is not, then return null, and let the runtime use
22985         the concatenation on the string plus the object (using
22986         `Object.ToString'). 
22987
22988 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
22989
22990         Constant Folding has been implemented now.
22991
22992         * expression.cs (Unary.Reduce): Do not throw an exception, catch
22993         the error instead on types that are not supported in one's
22994         complement. 
22995
22996         * constant.cs (Constant and all children): New set of functions to
22997         perform implict and explicit conversions.
22998
22999         * ecore.cs (EnumConstant): Implement the new functions to perform
23000         conversion by proxying to the child expression.
23001
23002         * codegen.cs: (ConstantCheckState): Constant evaluation has its
23003         own separate setting that can not be turned off from the command
23004         line using --unchecked or --checked and is only controlled using
23005         the checked/unchecked statements and expressions.  This setting is
23006         used by the constant folder to flag errors.
23007
23008         * expression.cs (CheckedExpr, UncheckedExpr): Set the
23009         ConstantCheckState as well.   
23010
23011         During Resolve, they also have to flag the state, because the
23012         constant folder runs completely in the Resolve phase.
23013
23014         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
23015         well.
23016
23017 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
23018
23019         * cfold.cs: New file, this file contains the constant folder.
23020
23021         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
23022         argument to track whether we are using the resulting address to
23023         load or store a value and provide better error messages. 
23024
23025         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
23026         new AddressOf arguments.
23027
23028         * statement.cs (Foreach.EmitCollectionForeach): Update
23029
23030         * expression.cs (Argument.Emit): Call AddressOf with proper
23031         arguments to track usage.
23032
23033         (New.DoEmit): Call AddressOf with new arguments.
23034
23035         (Unary.Emit): Adjust AddressOf call.
23036
23037 2002-03-01  Ravi Pratap  <ravi@ximian.com>
23038
23039         * cs-parser.jay (member_access): Change the case for pre-defined types
23040         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
23041         this suggestion.
23042
23043         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
23044         a method body.
23045
23046         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
23047         essentially like methods and apply attributes like MethodImplOptions to them too.
23048
23049         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
23050         not being null.
23051
23052         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
23053         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
23054         is the DeclSpace.
23055
23056         * Update code everywhere accordingly.
23057
23058         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
23059
23060         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
23061
23062 2002-02-28  Ravi Pratap  <ravi@ximian.com>
23063
23064         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
23065         try performing lookups against those instead of jumping straight into using
23066         the 'using' clauses.
23067
23068         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
23069
23070         (LookupType): Perform lookups in implicit parents too.
23071
23072         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
23073         sequence as RootContext.LookupType. 
23074
23075         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
23076         the various cases of namespace lookups into this method.
23077
23078 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
23079
23080         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
23081         in positional arguments)
23082
23083         * class.cs (Operator): Update the AllowedModifiers to contain
23084         extern. 
23085
23086         * cs-parser.jay: Update operator declaration to allow for the
23087         operator body to be empty.
23088
23089         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
23090         values. 
23091
23092 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
23093
23094         * class.cs (Method.Emit): Label parameters.
23095
23096         * driver.cs: Return 1 or 0 as the program exit code.
23097
23098 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
23099
23100         * expression.cs: Special case the `null' object when trying to
23101         auto-compute the type, as anything can be explicitly converted to
23102         that. 
23103
23104         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
23105         spotting this Paolo.
23106
23107         (Expression.ImplicitNumericConversion): Perform comparissions of
23108         the type using the underlying type in the case of an enumeration
23109         rather than using the enumeration type for the compare.
23110
23111         Cope with the underlying == type case, which is not possible to
23112         catch before. 
23113
23114         (Expression.ConvertNumericExplicit): Perform comparissions of
23115         the type using the underlying type in the case of an enumeration
23116         rather than using the enumeration type for the compare.
23117
23118         * driver.cs: If the user does not supply an extension, assume .exe
23119
23120         * cs-parser.jay (if_statement): Rewrote so that we can track the
23121         location for the if statement.
23122
23123         * expression.cs (Binary.ConstantFold): Only concat strings when
23124         the operation is "+", not everything ;-)
23125
23126         * statement.cs (Statement.EmitBoolExpression): Take a location
23127         argument. 
23128         (If, While, Do): Track location.
23129
23130         * expression.cs (Binary.ResolveOperator): In the object + string
23131         case, I was missing a call to ConvertImplicit
23132
23133 2002-02-25  Ravi Pratap  <ravi@ximian.com>
23134
23135         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
23136         Location arguments. Ensure we use RootContext.LookupType to do our work
23137         and not try to do a direct Type.GetType and ModuleBuilder.GetType
23138
23139         * interface.cs (PopulateMethod): Handle the type of the parameter being
23140         null gracefully.
23141
23142         * expression.cs (Invocation.BetterFunction): Handle the case when we 
23143         have a params method with no fixed arguments and a call is made with no
23144         arguments.
23145
23146 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
23147
23148         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
23149         the verbatim-string-literal
23150
23151         * support.cs (InternalParameters.ParameterModifier): handle null
23152         fixed parameters.
23153         (InternalParameters.ParameterType): ditto.
23154
23155         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
23156         duplicating the name of the variable parameter.
23157         (GetParameterByName): Fix bug where we were not looking up array
23158         paramters if they were the only present (thanks Paolo!).
23159         (GetParameterInfo): We only have an empty set of types if both
23160         fixed and array are set to null.
23161         (GetParameterInfo-idx): Handle FixedParameter == null
23162
23163         * cs-parser.jay: Handle the case where there is no catch
23164         statements (missing null test).
23165
23166 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
23167
23168         * driver.cs (MainDriver): Be conservative on our command line
23169         handling.
23170
23171         Catch DirectoryNotFoundException when calling GetFiles.
23172
23173         (SplitPathAndPattern): Used to split the input specification into
23174         a path and a pattern that we can feed to Directory.GetFiles.
23175
23176 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
23177
23178         * statement.cs (Fixed): Implement the last case of the Fixed
23179         statement (string handling).
23180
23181         * expression.cs (StringPtr): New class used to return a char * to
23182         a string;  Used by the Fixed statement.
23183
23184         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
23185
23186         * expression.cs (Binary.ResolveOperator): Remove redundant
23187         MemberLookup pn parent type.
23188         Optimize union call, we do not need a union if the types are the same.
23189         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
23190         type.
23191
23192         Specialize the use of MemberLookup everywhere, instead of using
23193         the default settings. 
23194
23195         (StackAlloc): Implement stackalloc keyword.
23196
23197         * cs-parser.jay: Add rule to parse stackalloc.
23198
23199         * driver.cs: Handle /h, /help, /?
23200
23201         * expression.cs (MakeByteBlob): Removed the hacks we had in place
23202         before we supported unsafe code.
23203
23204         * makefile: add --unsafe to the self compilation of mcs.
23205
23206 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
23207
23208         * expression.cs (PointerArithmetic): New class that is used to
23209         perform pointer arithmetic.
23210         (Binary.Resolve): Handle pointer arithmetic
23211         Handle pointer comparission.
23212         (ArrayPtr): Utility expression class that is used to take the
23213         address of an array.
23214
23215         (ElementAccess): Implement array access for pointers
23216
23217         * statement.cs (Fixed): Implement fixed statement for arrays, we
23218         are missing one more case before we are done.
23219
23220         * expression.cs (Indirection): Implement EmitAssign and set the
23221         ExprClass to Variable.  This allows pointer dereferences to be
23222         treated as variables, and to have values assigned to them.
23223
23224         * ecore.cs (Expression.StoreFromPtr): New utility function to
23225         store values dereferencing.
23226
23227 2002-02-20  Ravi Pratap  <ravi@ximian.com>
23228
23229         * expression.cs (Binary.ResolveOperator): Ensure that we are
23230         not trying to operate on a void type - this fixes the reported
23231         bug.
23232
23233         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
23234         the parent implementation is sealed.
23235
23236         * ../errors/cs0239.cs : Add.
23237
23238         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
23239
23240         * typemanager.cs (unverifiable_code_type): Corresponds to 
23241         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
23242         which have unsafe code in them.
23243
23244         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
23245         unsafe context.
23246
23247 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
23248
23249         * cs-tokenizer.cs: Add support for @"litreal strings"
23250
23251         Make tokenizer accept pre-processor directives
23252         on any column (remove the old C-like limitation). 
23253
23254         * rootcontext.cs (EmitCode): Emit any global attributes.
23255         (AddGlobalAttributes): Used to keep track of assembly attributes. 
23256
23257         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
23258
23259         * cs-parser.jay: Add support for global attributes.  
23260
23261 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
23262
23263         * expression.cs (Indirection): New helper class.  Unary will
23264         create Indirection classes to be able to implement the
23265         IMemoryLocation interface on it.
23266
23267 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
23268
23269         * cs-parser.jay (fixed_statement): reference the right statement.
23270
23271         * statement.cs (Fixed.Emit): Finish implementing the fixed
23272         statement for the &x case.
23273
23274 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
23275
23276         * class.cs (Property.Define, Method.Define): Remove newslot when
23277         `implementing'.  
23278
23279         * modifiers.cs: My use of NewSlot when `Abstract' was set was
23280         wrong.  NewSlot should only be used if the `new' keyword is present.
23281
23282         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
23283         locating our system dir.  Sorry about this.
23284
23285 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23286
23287         * driver.cs (GetSystemDir): Compute correctly the location of our
23288         system assemblies.  I was using the compiler directory instead of
23289         the library directory.
23290
23291 2002-02-13  Ravi Pratap  <ravi@ximian.com>
23292
23293         * expression.cs (BetterFunction): Put back in what Miguel commented out
23294         since it is the correct fix. The problem is elsewhere ;-)
23295
23296         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
23297         parameters of the parms method are themselves compatible or not !
23298
23299         (StandardConversionExists): Fix very dangerous bug where we were forgetting
23300         to check that a class implements an interface before saying that an implicit
23301         conversion was allowed. Use ImplementsInterface to do the checking.
23302
23303 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
23304
23305         * class.cs (Method.Define): Track whether we are an explicit
23306         implementation or not.  And only call DefineMethodOverride if we
23307         are an explicit implementation.
23308
23309         (Property.DefineMethod): Ditto.
23310
23311 2002-02-11  Ravi Pratap  <ravi@ximian.com>
23312
23313         * expression.cs (BetterFunction): Catch hideous bug which was
23314          preventing us from detecting ambiguous calls due to implicit casts i.e
23315         cs0121.
23316
23317 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
23318
23319         * support.cs (Pair): Remove un-needed method.  I figured why I was
23320         getting the error in cs-parser.jay, the variable in a foreach loop
23321         is readonly, and the compiler does not really treat this as a variable.
23322
23323         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
23324         instead of EQUALS in grammar.  
23325
23326         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
23327
23328         * expression.cs (Unary.DoResolve): Check whether the argument is
23329         managed or not.
23330
23331 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
23332
23333         * support.cs: Api for Pair to set a value.  Despite the fact that
23334         the variables are public the MS C# compiler refuses to compile
23335         code that accesses the field if the variable is part of a foreach
23336         statement. 
23337
23338         * statement.cs (Fixed): Begin implementation of the fixed
23339         statement.
23340
23341         (Block.AddVariable): Return the VariableInfo on success and null
23342         on failure instead of true/false. 
23343
23344         * cs-parser.jay (foreach): Catch errors on variables already
23345         defined (we were ignoring this value before) and properly unwind
23346         the block hierarchy
23347
23348         (fixed_statement): grammar for the fixed statement.
23349
23350 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
23351
23352         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
23353         pointer types to be incretemented.
23354
23355         (SizeOf): Implement.
23356
23357         * cs-parser.jay (pointer_member_access): Implement
23358         expr->IDENTIFIER production.
23359
23360         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
23361         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
23362         on safe contexts.
23363
23364         (Unary): Implement indirection.
23365
23366         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
23367         use in non-unsafe context).
23368
23369         (SimpleName.DoResolve): Check for pointers in field access on safe
23370         contexts. 
23371
23372         (Expression.LoadFromPtr): Factor the load-indirect code in this
23373         function.  This was duplicated in UnboxCast and ParameterReference
23374
23375 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
23376
23377         * expression.cs (ComposedCast): report an error if a pointer cast
23378         is used in a safe region.
23379
23380         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
23381         pointer type casts in unsafe context.
23382
23383         * codegen.cs (EmitContext): Set up IsUnsafe.
23384
23385         * cs-parser.jay (non_expression_type): Add productions for pointer
23386         casts. 
23387
23388         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
23389         code.  We should not use force into static mode if the method is
23390         not virtual.  Fixes bug in MIS
23391
23392         * statement.cs (Do.Emit, While.Emit, For.Emit,
23393         Statement.EmitBoolExpression): Add support to Do and While to
23394         propagate infinite loop as `I do return' semantics.
23395
23396         Improve the For case to also test for boolean constants.
23397
23398         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
23399         to the list of attributes we can add.
23400
23401         Remove `EmitContext' argument.
23402
23403         * class.cs (Method.Define): Apply parameter attributes.
23404         (Constructor.Define): Apply parameter attributes.
23405         (MethodCore.LabelParameters): Move here the core of labeling
23406         parameters. 
23407
23408         * support.cs (ReflectionParameters.ParameterModifier,
23409         InternalParameters.ParameterModifier): Use IsByRef on the type and
23410         only return the OUT bit for these parameters instead of in/out/ref
23411         flags.
23412
23413         This is because I miss-understood things.  The ParameterInfo.IsIn
23414         and IsOut represent whether the parameter has the [In] and [Out]
23415         attributes set.  
23416
23417 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
23418
23419         * ecore.cs (FieldExpr.Emit): Release temporaries.
23420
23421         * assign.cs (LocalTemporary.Release): new function.
23422
23423         * codegen.cs (EmitContext.GetTemporaryStorage,
23424         EmitContext.FreeTemporaryStorage): Rework the way we deal with
23425         temporary storage.  Now we can "put back" localbuilders when we
23426         are done with them
23427
23428 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
23429
23430         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
23431         need to make a copy of the variable to generate verifiable code.
23432
23433 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
23434
23435         * driver.cs: Compute dynamically the system directory.
23436
23437         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
23438         Slower, but more generally useful.  Used by the abstract
23439         registering implementation. 
23440
23441         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
23442         the rules for the special rule on Type/instances.  First check if
23443         we have the same name, and if so, try that special static path
23444         rather than the instance path.
23445
23446 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
23447
23448         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
23449         for, while and if.
23450
23451         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
23452         Enum, ValueType, Delegate or Array for non-corlib compiles.
23453
23454         * cs-tokenizer.cs: Catch long identifiers (645)
23455
23456         * typemanager.cs (IndexerPropetyName): Ravi never tested this
23457         piece of code.
23458
23459         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
23460         fix, we were returning too early, so we were not registering
23461         pending methods from abstract classes.
23462
23463         Do not register pending methods if the class is abstract.
23464
23465         * expression.cs (Conditional.DoResolve): Report circular implicit
23466         conversions when we neecd to compute it for conditional
23467         expressions. 
23468
23469         (Is.DoResolve): If the expression is always of the provided type,
23470         flag warning 183.  If the expression can not ever be of the
23471         provided type flag warning 184.
23472
23473         * class.cs: Catch 169 as well.
23474
23475         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
23476         read. 
23477
23478 2002-01-18  Nick Drochak  <ndrochak@gol.com>
23479
23480         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
23481
23482 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
23483
23484         * interface.cs: (PopulateMethod): Check for pointers being defined
23485         only if the unsafe context is active.
23486         (PopulateProperty): ditto.
23487         (PopulateIndexer): ditto.
23488
23489         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
23490         specified.  If pointers are present, make sure that they are
23491         present in an unsafe context.
23492         (Constructor, Constructor.Define): ditto.
23493         (Field, Field.Define): ditto.
23494         (Property, Property.Define): ditto.
23495         (Event, Event.Define): ditto.
23496
23497         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
23498         hashtable if there are classes or structs defined.
23499
23500         * expression.cs (LocalVariableReference.DoResolve): Simplify this
23501         code, as the constant resolution moved.
23502
23503         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
23504         the metadata, so we can flag error 133. 
23505
23506         * decl.cs (MemberCore.UnsafeOK): New function to test that a
23507         pointer is being declared in an unsafe context.
23508
23509 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
23510
23511         * modifiers.cs (Modifiers.Check): Require a Location argument.
23512         Report error 227 for Unsafe use.
23513
23514         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
23515
23516         * statement.cs (For.Emit): If the test is null, then report that
23517         we do `return', as we wont reach anything afterwards.
23518
23519         (Switch.SwitchGoverningType): Track the expression that matched
23520         the conversion.
23521
23522         * driver.cs: Allow negative numbers as an error code to flag.
23523
23524         * cs-parser.jay: Handle 1551.
23525
23526         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
23527
23528 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23529
23530         * cs-parser.jay: Report 1518 (type declaration can only contain
23531         class, struct, interface, enum or delegate)
23532
23533         (switch_label): Report 1523 (keywords `case' or `default' must
23534         preced code)
23535
23536         (opt_switch_sections): Report 1522 (empty switch)
23537
23538         * driver.cs: Report 1515 (response file specified multiple times)
23539         Report 1516 (Source file specified multiple times).
23540
23541         * expression.cs (Argument.Resolve): Signal 1510
23542
23543         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
23544         access not allowed in static code)
23545
23546 2002-01-11  Ravi Pratap  <ravi@ximian.com>
23547
23548         * typemanager.cs (IsPointerType): Utility method which we are going
23549         to need a lot.
23550
23551         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
23552         the object type, so we take care of that.
23553
23554         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
23555
23556         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
23557         added to non-params parameters :-)
23558
23559         * typemanager.cs (CSharpName): Include 'void' type too. 
23560
23561         (void_ptr_type): Include in the set of core types.
23562
23563         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
23564         duplicating code.
23565
23566         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
23567         an unsafe context.
23568
23569         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
23570         completely forgotten about it.
23571
23572 2002-01-10  Ravi Pratap  <ravi@ximian.com>
23573
23574         * cs-parser.jay (pointer_type): Add. This begins our implementation
23575         of parsing rules for unsafe code.
23576
23577         (unsafe_statement): Implement.
23578
23579         (embedded_statement): Modify to include the above.
23580
23581         * statement.cs (Unsafe): Implement new class for unsafe blocks.
23582
23583         * codegen.cs (EmitContext.InUnsafe): Add. This determines
23584         if the current context is an unsafe one.
23585
23586         * cs-parser.jay (local_variable_pointer_type): Since local variable types
23587         are handled differently, we need separate rules for them.
23588
23589         (local_variable_declaration): Update to use local_variable_pointer_type
23590         to allow variable declarations of unmanaged pointer types.
23591
23592         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
23593         in unsafe contexts.
23594
23595         * ../errors/cs0214.cs : Add.
23596
23597 2002-01-16  Nick Drochak  <ndrochak@gol.com>
23598
23599         * makefile: remove 'response' file when cleaning.
23600
23601 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
23602
23603         * cs-parser.jay: Report 1524.
23604
23605 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
23606
23607         * typemanager.cs (RegisterMethod): drop checking if we have
23608         registered this from here
23609
23610 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
23611
23612         * class.cs (Method.EmitDestructor): Implement calling our base
23613         destructor. 
23614
23615         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
23616         value of InFinally.
23617
23618         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
23619         this routine and will wrap the call in a try/catch block.  Deal
23620         with the case.
23621
23622 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
23623
23624         * ecore.cs (Expression.MemberLookup): instead of taking a
23625         parameter `same_type' that was used to tell whether we could
23626         access private members we compute our containing type from the
23627         EmitContext.
23628
23629         (FieldExpr): Added partial support for volatile fields.  This does
23630         not work for volatile fields exposed from assemblies, as I can not
23631         figure out how to extract the modreq from it.
23632
23633         Updated all the source files to use this.
23634
23635         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
23636         because it is referenced by MemberLookup very often. 
23637
23638 2002-01-09  Ravi Pratap  <ravi@ximian.com>
23639
23640         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
23641         TypeBuilder.GetCustomAttributes to retrieve what we need.
23642
23643         Get rid of redundant default_member_attr_type as this is the same as
23644         default_member_type which already exists.
23645
23646         * interface.cs, attribute.cs : Update accordingly.
23647
23648 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
23649
23650         * typemanager.cs: Enable IndexerPropertyName again.  It does not
23651         work for TYpeBuilders though.  Ravi, can you please fix this?
23652
23653         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
23654
23655         * expression.cs (Argument.Emit): Handle the case of ref objects
23656         being passed to ref functions;  
23657
23658         (ParameterReference.EmitLoad): Loads the content of the pointer
23659         without dereferencing.
23660
23661 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23662
23663         * cs-tokenizer.cs: Implemented the pre-processing expressions.
23664
23665 2002-01-08  Ravi Pratap  <ravi@ximian.com>
23666
23667         * class.cs (Indexer.DefineMethod): Incorporate the interface
23668         type in the name of the method if we are doing explicit interface
23669         implementation.
23670
23671         * expression.cs (ConversionExists): Remove as it is completely obsolete.
23672
23673         (BetterConversion): Fix extremely trivial bug where we were referring to
23674         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
23675         again !
23676
23677         * ../errors/bug16.cs : Add although we have fixed it.
23678
23679 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
23680
23681         * expression.cs (BaseIndexer): Begin implementation.
23682
23683         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
23684
23685         * cs-parser.jay (indexer_declarator): Use qualified_identifier
23686         production directly to remove a shift/reduce, and implement
23687         explicit interface implementation.
23688
23689         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
23690         after a floating point suffix.
23691
23692         * expression.cs (DoNumericPromotions): Improved the conversion for
23693         uint/uint.  If we have a constant, we avoid doing a typecast to a
23694         larger type.
23695
23696         * class.cs (Indexer): Implement explicit interface implementation
23697         for indexers.
23698
23699 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
23700
23701         * class.cs: make the default instance constructor public and hidebysig.
23702
23703 2001-01-03  Ravi Pratap  <ravi@ximian.com>
23704
23705         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
23706         so we can call it from elsewhere.
23707
23708         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
23709         we emit it internally if the class has a defined indexer; otherwise the user
23710         emits it by decorating the class definition with the DefaultMemberAttribute.
23711
23712         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
23713         attribute is not used on a type which defines an indexer.
23714
23715         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
23716         character when we skip whitespace.
23717
23718         * ../errors/cs0646.cs : Add.
23719
23720 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
23721
23722         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
23723         again. 
23724
23725         * makefile: Add practical target `mcs3.exe' which builds the third
23726         generation compiler. 
23727
23728         * expression.cs (New): Fix structures constructor calling.
23729
23730         * class.cs (Property, Method, Indexer): Emit Final flag on the
23731         method if we are an interface implementation and we are not
23732         abstract. 
23733
23734         * ecore.cs (PropertyExpr): New public field `IsBase', tells
23735         whether this property is referencing a `base' method.
23736
23737         * expression.cs (Invocation.EmitCall): take an extra argument:
23738         is_base, this is used to determine whether the `call' or
23739         `callvirt' opcode should be used.
23740
23741
23742         * delegate.cs: update EmitCall.
23743
23744         * class.cs (Method.Define): Set NewSlot for the cases where we are
23745         not implementing an interface method.
23746
23747         (Property.Define): ditto.
23748
23749 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
23750
23751         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
23752         'r'.  Allows mcs to parse itself fully.
23753
23754 2002-01-02  Ravi Pratap  <ravi@ximian.com>
23755
23756         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
23757         of the number of initializers that require the InitializeArray method.
23758
23759         (CheckIndices): Store the Expression in all cases - not the plain value. Also
23760         update the above field where necessary.
23761
23762         (MakeByteBlob): Update accordingly.
23763
23764         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
23765         greater than 2.
23766
23767         (EmitDynamicInitializers): Update in accordance with the new optimization.
23768
23769         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
23770         same OpCode applies.
23771
23772         * cs-parser.jay : Fix some glaring errors I introduced.
23773
23774 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
23775
23776         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
23777         so that we can check for name clashes there too.
23778
23779         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
23780         for interface indexers.
23781
23782         * interfaces.cs (Define): Emit the default member attribute.
23783
23784         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
23785         variable was being referred to while setting the value ;-)
23786
23787 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
23788
23789         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
23790         byte-by-byte information when we know the data is zero.
23791
23792         Make the block always a multiple of 4, because
23793         DefineInitializedData has a bug.
23794
23795         * assign.cs: Fix, we should assign from the temporary, not from
23796         the source. 
23797
23798         * expression.cs (MakeByteBlob): Fix my incorrect code.
23799
23800 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
23801
23802         * typemanager.cs (EnumToUnderlying): This function is used to get
23803         the underlying type from an enumeration, because it does not
23804         always work. 
23805
23806         * constant.cs: Use the I4_S form for values between -128 and 127.
23807
23808         * statement.cs (Block.LookupLabel): Looks up a label.
23809         (Block): Drop support for labeled blocks.
23810
23811         (LabeledStatement): New kind of statement that represents a label
23812         only.
23813
23814         (Goto): Finally implement this bad boy.
23815
23816         * cs-parser.jay: Update to reflect new mechanism to implement
23817         labels.
23818
23819 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
23820
23821         * codegen.cs (EmitContext.This): a codegen property that keeps the
23822         a single instance of this instead of creating many different this
23823         instances. 
23824
23825         * delegate.cs (Delegate.DoResolve): Update to use the property;
23826
23827         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
23828
23829         * expression.cs (BaseAccess.DoResolve): Ditto.
23830
23831 2001-12-29  Ravi Pratap  <ravi@ximian.com>
23832
23833         * typemanager.cs (methodimpl_attr_type): Add to hold the type
23834         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
23835
23836         (InitCoreTypes): Update accordingly.
23837
23838         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
23839         so we can quickly store the state.
23840
23841         (ApplyAttributes): Set the correct implementation flags
23842         for InternalCall methods.
23843
23844 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
23845
23846         * expression.cs (EmitCall): if a method is not virtual, then do
23847         not use callvirt on it.
23848
23849         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
23850         user defined stuff) requires the use of stobj, which takes an
23851         address on the stack instead of an array and an index.  So emit
23852         the Ldelema operation for it.
23853
23854         (EmitStoreOpcode): Use stobj for valuetypes.
23855
23856         (UnaryMutator.EmitCode): Use the right 1 value depending on
23857         whether we are dealing with int64/uint64, float or doubles.
23858
23859         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
23860         constructors that I implemented last night.
23861
23862         (Constructor.IsDefault): Fix to work properly for static
23863         constructors.
23864
23865         * cs-parser.jay (CheckDef): report method signature errors.
23866         Update error number 103 to be 132.
23867
23868         * decl.cs: New AdditionResult enumeration value: MethodExists.
23869         Although we do this check for methods later on in the semantic
23870         analysis, catching repeated default constructors is so easy that
23871         we catch these here. 
23872
23873         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
23874         promotions code.
23875
23876         (ParameterReference.EmitAssign, Emit): handle
23877         bools as bytes.
23878
23879         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
23880         (ArrayAccess.EmitStoreOpcode): ditto.
23881
23882         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
23883
23884         * expression.cs (MakeByteBlob): Complete all the missing types
23885         (uint, short, ushort, byte, sbyte)
23886
23887         * class.cs: Only init instance field initializers on instance
23888         constructors. 
23889
23890         Rename `constructors' to instance_constructors. 
23891
23892         (TypeContainer.AddConstructor): Only add constructors to the list
23893         if it is not static.
23894
23895         Make sure that we handle default_static_constructor independently
23896         everywhere where we handle instance_constructors
23897
23898 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
23899
23900         * class.cs: Do not lookup or create a base initializer for a
23901         static constructor.
23902
23903         (ConstructorInitializer.Resolve): use the proper type to lookup
23904         for constructors.
23905
23906         * cs-parser.jay: Report error 1585 (modifiers between type and name).
23907
23908         * enum.cs, interface.cs: Remove CloseType, this is taken care by
23909         in DeclSpace. 
23910
23911         * decl.cs: CloseType is now an virtual method, the default
23912         implementation just closes this type.
23913
23914 2001-12-28  Ravi Pratap  <ravi@ximian.com>
23915
23916         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
23917         to PreserveSig by default. Also emit HideBySig on such methods.
23918
23919         Basically, set the defaults to standard values.
23920
23921         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
23922         argument, if candidate is better, it can't be worse than the best !
23923
23924         (Invocation): Re-write bits to differentiate between methods being
23925         applicable in their expanded form and their normal form - for params
23926         methods of course.
23927
23928         Get rid of use_standard everywhere as only standard conversions are allowed
23929         in overload resolution. 
23930
23931         More spec conformance.
23932
23933 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23934
23935         * driver.cs: Add --timestamp, to see where the compiler spends
23936         most of its time.
23937
23938         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
23939         `this' in static code.
23940
23941         (SimpleName.DoResolve): Implement in terms of a helper function
23942         that allows static-references to be passed upstream to
23943         MemberAccess.
23944
23945         (Expression.ResolveWithSimpleName): Resolve specially simple
23946         names when called by MemberAccess to implement the special
23947         semantics. 
23948
23949         (Expression.ImplicitReferenceConversion): Handle conversions from
23950         Null to reference types before others, as Null's type is
23951         System.Object. 
23952
23953         * expression.cs (Invocation.EmitCall): Handle the special case of
23954         calling methods declared on a reference type from a ValueType
23955         (Base classes System.Object and System.Enum)
23956
23957         (MemberAccess.Resolve): Only perform lookups on Enumerations if
23958         the left hand side is a TypeExpr, not on every enumeration. 
23959
23960         (Binary.Resolve): If types are reference types, then do a cast to
23961         object on operators != and == of both arguments.
23962
23963         * typemanager.cs (FindMembers): Extract instance and static
23964         members if requested.
23965
23966         * interface.cs (PopulateProperty): Use void_type instead of null
23967         as the return type for the setter method.
23968
23969         (PopulateIndexer): ditto.
23970
23971 2001-12-27  Ravi Pratap  <ravi@ximian.com>
23972
23973         * support.cs (ReflectionParameters): Fix minor bug where we
23974         were examining the wrong parameter for the ParamArray attribute.
23975
23976         Cope with requests for the type of the parameter at position
23977         greater than the params parameter's. We now return the element
23978         type of the params array as that makes more sense.
23979
23980         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
23981         accordingly as we no longer have to extract the element type
23982         ourselves.
23983
23984         (Invocation.OverloadResolve): Update.
23985
23986 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
23987
23988         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
23989         against IEnumerator, test whether the return value is a descendant
23990         of the IEnumerator interface.
23991
23992         * class.cs (Indexer.Define): Use an auxiliary method to implement
23993         the other bits of the method definition.  Begin support for
23994         explicit interface implementation.
23995
23996         (Property.DefineMethod): Use TypeManager.void_type instead of null
23997         for an empty return value.
23998
23999 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
24000
24001         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
24002         dealing with a FieldExpr which is composed of a FieldBuilder, in
24003         the code path we did extract the constant, but we should have
24004         obtained the underlying value to be able to cast it (otherwise we
24005         end up in an infinite loop, this is what Ravi was running into).
24006
24007         (ArrayCreation.UpdateIndices): Arrays might be empty.
24008
24009         (MemberAccess.ResolveMemberAccess): Add support for section
24010         14.5.4.1 that deals with the special case of E.I when E is a type
24011         and something else, that I can be a reference to a static member.
24012
24013         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
24014         handle a particular array type to create byte blobs, it is just
24015         something we dont generate byteblobs for.
24016
24017         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
24018         arguments. 
24019
24020         * location.cs (Push): remove the key from the hashtable that we
24021         are about to add.   This happens for empty files.
24022
24023         * driver.cs: Dispose files after we have parsed them.
24024
24025         (tokenize): new function that only runs the tokenizer on its
24026         input, for speed testing.
24027
24028 2001-12-26  Ravi Pratap  <ravi@ximian.com>
24029
24030         * class.cs (Event.Define): Define the private field only if there
24031         are no accessors defined.
24032
24033         * expression.cs (ResolveMemberAccess): If there is no associated
24034         field with the event, that means we have an event defined with its
24035         own accessors and we should flag error cs0070 since transforming
24036         ourselves into a field is not valid in that case.
24037
24038         * ecore.cs (SimpleName.DoResolve): Same as above.
24039
24040         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
24041         and charset to sane values.
24042
24043 2001-12-25  Ravi Pratap  <ravi@ximian.com>
24044
24045         * assign.cs (DoResolve): Perform check on events only if they 
24046         are being accessed outside the declaring type.
24047
24048         * cs-parser.jay (event_declarations): Update rules to correctly
24049         set the type of the implicit parameter etc.
24050
24051         (add_accessor, remove_accessor): Set current local parameters.
24052
24053         * expression.cs (Binary): For delegate addition and subtraction,
24054         cast the return value from the method into the appropriate delegate
24055         type.
24056
24057 2001-12-24  Ravi Pratap  <ravi@ximian.com>
24058
24059         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
24060         of these as the workaround is unnecessary.
24061
24062         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
24063         delegate data - none of that is needed at all.
24064
24065         Re-write bits to extract the instance expression and the delegate method
24066         correctly.
24067
24068         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
24069         on delegates too.
24070
24071         * attribute.cs (ApplyAttributes): New method to take care of common tasks
24072         of attaching attributes instead of duplicating code everywhere.
24073
24074         * everywhere : Update code to do attribute emission using the above method.
24075
24076 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
24077
24078         * expression.cs (IsParamsMethodApplicable): if there are not
24079         parameters, return immediately.
24080
24081         * ecore.cs: The 0 literal can be implicity converted to an enum
24082         type. 
24083
24084         (SimpleName.DoResolve): First lookup the type, then lookup the
24085         members. 
24086
24087         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
24088         want to get its address.  If the InstanceExpression is not
24089         addressable, store the result in a temporary variable, then get
24090         the address of it.
24091
24092         * codegen.cs: Only display 219 errors on warning level or above. 
24093
24094         * expression.cs (ArrayAccess): Make it implement the
24095         IMemoryLocation interface.
24096
24097         (Binary.DoResolve): handle the operator == (object a, object b)
24098         and operator != (object a, object b) without incurring into a
24099         BoxedCast (because 5 != o should never be performed).
24100
24101         Handle binary enumerator operators.
24102
24103         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
24104         value type, otherwise use Ldelem_ref.
24105
24106         Use precomputed names;
24107
24108         (AddressOf): Implement address of
24109
24110         * cs-parser.jay (labeled_statement): Fix recursive block
24111         addition by reworking the production.
24112
24113         * expression.cs (New.DoEmit): New has a special case:
24114                 
24115                  If we are dealing with a ValueType, we have a few
24116                  situations to deal with:
24117                 
24118                     * The target of New is a ValueType variable, that is
24119                       easy, we just pass this as the variable reference
24120                 
24121                     * The target of New is being passed as an argument,
24122                       to a boxing operation or a function that takes a
24123                       ValueType.
24124                 
24125                       In this case, we need to create a temporary variable
24126                       that is the argument of New.
24127
24128
24129 2001-12-23  Ravi Pratap  <ravi@ximian.com>
24130
24131         * rootcontext.cs (LookupType): Check that current_type is not null before
24132         going about looking at nested types.
24133
24134         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
24135         not implement the IAssignMethod interface any more.
24136
24137         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
24138         where we tranform them into FieldExprs if they are being resolved from within
24139         the declaring type.
24140
24141         * ecore.cs (SimpleName.DoResolve): Do the same here.
24142
24143         * assign.cs (DoResolve, Emit): Clean up code considerably. 
24144
24145         * ../errors/bug10.cs : Add.
24146
24147         * ../errors/cs0070.cs : Add.
24148
24149         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
24150
24151         * assign.cs : Get rid of EventIsLocal everywhere.
24152
24153 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
24154
24155         * ecore.cs (ConvertIntLiteral): finished the implementation.
24156
24157         * statement.cs (SwitchLabel): Convert the value we are using as a
24158         key before looking up the table.
24159
24160 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24161
24162         * codegen.cs (EmitTopBlock): Require a Location argument now.
24163
24164         * cs-parser.jay (constructor_declarator): We need to setup
24165         current_local_parameters before we parse the
24166         opt_constructor_initializer, to allow the variables to be bound
24167         to the constructor arguments.
24168
24169         * rootcontext.cs (LookupType): First lookup nested classes in our
24170         class and our parents before we go looking outside our class.
24171
24172         * expression.cs (ConstantFold): Extract/debox the values at the
24173         beginnning. 
24174
24175         * rootcontext.cs (EmitCode): Resolve the constants first before we
24176         resolve the types.  This is not really needed, but it helps debugging.
24177
24178         * statement.cs: report location.
24179
24180         * cs-parser.jay: pass location to throw statement.
24181
24182         * driver.cs: Small bug fix.
24183
24184         * report.cs: Updated format to be 4-zero filled digits.
24185
24186 2001-12-22  Ravi Pratap  <ravi@ximian.com>
24187
24188         * expression.cs (CheckIndices): Fix minor bug where the wrong
24189         variable was being referred to ;-)
24190
24191         (DoEmit): Do not call EmitStaticInitializers when the 
24192         underlying type is System.Object.
24193
24194 2001-12-21  Ravi Pratap  <ravi@ximian.com>
24195
24196         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
24197         and do the usual workaround for SRE.
24198
24199         * class.cs (MyEventBuilder.EventType): New member to get at the type
24200         of the event, quickly.
24201
24202         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
24203
24204         * assign.cs (Assign.DoResolve): Handle the case when the target
24205         is an EventExpr and perform the necessary checks.
24206
24207         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
24208         interface.
24209
24210         (SimpleName.MemberStaticCheck): Include check for EventExpr.
24211
24212         (EventExpr): Set the type in the constructor itself since we 
24213         are meant to be born fully resolved.
24214
24215         (EventExpr.Define): Revert code I wrote earlier.
24216                 
24217         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
24218         instance expression is null. The instance expression is a This in that case
24219         or a null, depending on whether it is a static method or not.
24220
24221         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
24222         refers to more than one method.
24223
24224         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
24225         and accordingly flag errors.
24226
24227 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24228
24229         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
24230
24231 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
24232
24233         * location.cs (ToString): Provide useful rutine.
24234
24235 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
24236
24237         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
24238         objects, return the actual integral boxed.
24239
24240         * statement.cs (SwitchLabel): define an ILLabel for each
24241         SwitchLabel. 
24242
24243         (Switch.CheckSwitch): If the value is a Literal, extract
24244         the underlying literal.
24245
24246         Also in the unused hashtable we had, add the SwitchLabel so we can
24247         quickly look this value up.
24248
24249         * constant.cs: Implement a bunch of new constants.  Rewrite
24250         Literal based on this.  Made changes everywhere to adapt to this.
24251
24252         * expression.cs (Expression.MakeByteBlob): Optimize routine by
24253         dereferencing array only once, and also copes with enumrations.
24254
24255         bytes are two bytes wide, not one.
24256
24257         (Cast): Perform constant conversions.
24258
24259         * ecore.cs (TryImplicitIntConversion): Return literals instead of
24260         wrappers to the literals here.
24261
24262         * expression.cs (DoNumericPromotions): long literals can converted
24263         to ulong implicity (this is taken care of elsewhere, but I was
24264         missing this spot).
24265
24266         * ecore.cs (Expression.Literalize): Make the return type Literal,
24267         to improve type checking.
24268
24269         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
24270
24271 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24272
24273         * literal.cs: Revert code from ravi that checked the bounds.  The
24274         bounds are sane by the definition of the type itself. 
24275
24276         * typemanager.cs: Fix implementation of ImplementsInterface.  We
24277         need to actually look up in our parent hierarchy for interfaces
24278         implemented. 
24279
24280         * const.cs: Use the underlying type for enumerations
24281
24282         * delegate.cs: Compute the basename for the delegate creation,
24283         that should fix the delegate test case, and restore the correct
24284         Type Lookup semantics in rootcontext
24285
24286         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
24287         referencing a nested type with the Reflection API is using the "+"
24288         sign. 
24289
24290         * cs-parser.jay: Do not require EOF token at the end.
24291
24292 2001-12-20  Ravi Pratap  <ravi@ximian.com>
24293
24294         * rootcontext.cs (LookupType): Concatenate type names with
24295         a '.' instead of a '+' The test suite passes again.
24296
24297         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
24298         field of the enumeration.
24299
24300         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
24301         the case when the member is an EventExpr.
24302
24303         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
24304         static has an associated instance expression.
24305
24306         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
24307
24308         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
24309
24310         * class.cs (Event.Define): Register event and perform appropriate checks
24311         for error #111.
24312
24313         We define the Add and Remove methods even if the use provides none because
24314         in that case, we provide default implementations ourselves.
24315
24316         Define a private field of the type of the event. This is done by the CSC compiler
24317         and we should be doing it too ;-)
24318
24319         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
24320         More methods we use in code we generate.
24321
24322         (multicast_delegate_type, delegate_type): Two separate types since the distinction
24323         is important.
24324
24325         (InitCoreTypes): Update accordingly for the above.
24326
24327         * class.cs (Event.Emit): Generate code for default accessors that we provide
24328
24329         (EmitDefaultMethod): Do the job in the above.
24330
24331         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
24332         appropriate place.
24333
24334 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
24335
24336         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
24337         builders even if we were missing one.
24338
24339         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
24340         pass the Basename as our class name instead of the Name.  The
24341         basename will be correctly composed for us.
24342
24343         * parameter.cs (Paramters): Now takes a Location argument.
24344
24345         * decl.cs (DeclSpace.LookupType): Removed convenience function and
24346         make all the code call directly LookupType in RootContext and take
24347         this chance to pass the Location information everywhere.
24348
24349         * Everywhere: pass Location information.
24350
24351 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
24352
24353         * class.cs (Constructor.Define): Updated way of detecting the
24354         length of the parameters.
24355
24356         (TypeContainer.DefineType): Use basename as the type name for
24357         nested types.
24358
24359         (TypeContainer.Define): Do not recursively define types here, as
24360         definition is taken care in order by the RootContext.
24361
24362         * tree.cs: Keep track of namespaces in a per-file basis.
24363
24364         * parameter.cs (Parameter.ComputeSignature): Update to use
24365         DeclSpace. 
24366
24367         (Parameters.GetSignature): ditto.
24368
24369         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
24370         instead of a TypeContainer.
24371
24372         (Interface.SemanticAnalysis): Use `this' instead of our parent to
24373         resolve names.  Because we need to be resolve in our context, not
24374         our parents.
24375
24376         * driver.cs: Implement response files.
24377
24378         * class.cs (TypeContainer.DefineType): If we are defined, do not
24379         redefine ourselves.
24380
24381         (Event.Emit): Emit the code for add/remove handlers.
24382         (Event.Define): Save the MethodBuilders for add/remove.
24383
24384         * typemanager.cs: Use pair here too.
24385
24386         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
24387         DictionaryEntry requires the first argument to be non-null.  
24388
24389         (enum_declaration): Compute full name for registering the
24390         enumeration.
24391
24392         (delegate_declaration): Instead of using
24393         formal_parameter_list, use opt_formal_parameter_list as the list
24394         can be empty.
24395
24396         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
24397         (EventParsing): New property that controls whether `add' and
24398         `remove' are returned as tokens or identifiers (for events);
24399
24400 2001-12-19  Ravi Pratap  <ravi@ximian.com>
24401
24402         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
24403         use MyEventBuilder only and let it wrap the real builder for us.
24404
24405         (MyEventBuilder): Revamp constructor etc.
24406
24407         Implement all operations that we perform on EventBuilder in precisely the same
24408         way here too.
24409
24410         (FindMembers): Update to use the EventBuilder member.
24411
24412         (Event.Emit): Update accordingly.
24413
24414 2001-12-18  Ravi Pratap  <ravi@ximian.com>
24415
24416         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
24417         by calling the appropriate methods.
24418
24419         (GetCustomAttributes): Make stubs as they cannot possibly do anything
24420         useful.
24421
24422         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
24423
24424 2001-12-17  Ravi Pratap  <ravi@ximian.com>
24425
24426         * delegate.cs (Delegate.Populate): Check that the return type
24427         and various parameters types are indeed accessible.
24428
24429         * class.cs (Constructor.Define): Same here.
24430
24431         (Field.Define): Ditto.
24432
24433         (Event.Define): Ditto.
24434
24435         (Operator.Define): Check that the underlying Method defined itself
24436         correctly - so it's MethodBuilder should not be null.
24437
24438         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
24439         expression happens to be null.
24440
24441         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
24442         members but as of now we don't seem to be able to do anything really useful with it.
24443
24444         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
24445         not the EventBuilder.
24446
24447 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
24448
24449         * cs-tokenizer.cs: Add support for defines.
24450         Add support for #if, #elif, #else, #endif
24451
24452         (eval_var): evaluates a variable.
24453         (eval): stubbed for evaluating functions.
24454
24455         * cs-parser.jay: Pass the defines information
24456
24457         * driver.cs: Add --define command line option.
24458
24459         * decl.cs: Move MemberCore here.
24460
24461         Make it the base class for DeclSpace.  This allows us to catch and
24462         report 108 and 109 for everything now.
24463
24464         * class.cs (TypeContainer.Define): Extract all the members
24465         before populating and emit the warning 108 (new keyword required
24466         to override) instead of having each member implement this.
24467
24468         (MemberCore.Define): New abstract method, we will be using this in
24469         the warning reporting engine in Populate.
24470
24471         (Operator.Define): Adjust to new MemberCore protocol. 
24472
24473         * const.cs (Const): This does not derive from Expression, it is a
24474         temporary object we use to create fields, it is a MemberCore. 
24475
24476         * class.cs (Method.Define): Allow the entry point to be in a
24477         specific class.
24478
24479         * driver.cs: Rewrite the argument handler to clean it up a bit.
24480
24481         * rootcontext.cs: Made it just an auxiliary namespace feature by
24482         making everything static.
24483
24484         * driver.cs: Adapt code to use RootContext type name instead of
24485         instance variable.
24486
24487         * delegate.cs: Remove RootContext argument.
24488
24489         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
24490         argument. 
24491
24492         * class.cs (Event.Define): The lookup can fail.
24493
24494         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
24495
24496         * expression.cs: Resolve the this instance before invoking the code.
24497
24498 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
24499
24500         * cs-parser.jay: Add a production in element_access that allows
24501         the thing to become a "type" reference.  This way we can parse
24502         things like "(string [])" as a type.
24503
24504         Note that this still does not handle the more complex rules of
24505         casts. 
24506
24507
24508         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
24509
24510         * ecore.cs: (CopyNewMethods): new utility function used to
24511         assemble the list of methods from running FindMembers.
24512
24513         (MemberLookup): Rework FindMembers so that 
24514
24515 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
24516
24517         * class.cs (TypeContainer): Remove Delegates who fail to be
24518         defined.
24519
24520         * delegate.cs (Populate): Verify that we dont get null return
24521         values.   TODO: Check for AsAccessible.
24522
24523         * cs-parser.jay: Use basename to emit error 574 (destructor should
24524         have the same name as container class), not the full name.
24525
24526         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
24527         possible representation.  
24528
24529         Also implements integer type suffixes U and L.
24530
24531 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
24532
24533         * expression.cs (ArrayCreation.DoResolve): We need to do the
24534         argument resolution *always*.
24535
24536         * decl.cs: Make this hold the namespace.  Hold the root context as
24537         well.
24538         (LookupType): Move here.
24539
24540         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
24541
24542         * location.cs (Row, Name): Fixed the code, it was always returning
24543         references to the first file.
24544
24545         * interface.cs: Register properties defined through interfaces.
24546
24547         * driver.cs: Add support for globbing on the command line
24548
24549         * class.cs (Field): Make it derive from MemberCore as well.
24550         (Event): ditto.
24551
24552 2001-12-15  Ravi Pratap  <ravi@ximian.com>
24553
24554         * class.cs (Event::Define): Check that the type of the event is a delegate
24555         type else flag error #66.
24556
24557         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
24558         same.
24559
24560         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
24561         values of EntryPoint, CharSet etc etc.
24562
24563         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
24564
24565         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
24566         be null and we should ignore this. I am not sure if this is really clean. Apparently,
24567         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
24568         which needs this to do its work.
24569
24570         * ../errors/cs0066.cs : Add.
24571
24572 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
24573
24574         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
24575         helper functions.
24576
24577         * class.cs: (MethodSignature.MethodSignature): Removed hack that
24578         clears out the parameters field.
24579         (MemberSignatureCompare): Cleanup
24580
24581         (MemberCore): New base class used to share code between MethodCore
24582         and Property.
24583
24584         (RegisterRequiredImplementations) BindingFlags.Public requires
24585         either BindingFlags.Instace or Static.  Use instance here.
24586
24587         (Property): Refactored code to cope better with the full spec.
24588
24589         * parameter.cs (GetParameterInfo): Return an empty array instead
24590         of null on error.
24591
24592         * class.cs (Property): Abstract or extern properties have no bodies.
24593
24594         * parameter.cs (GetParameterInfo): return a zero-sized array.
24595
24596         * class.cs (TypeContainer.MethodModifiersValid): Move all the
24597         method modifier validation to the typecontainer so we can reuse
24598         this on properties.
24599
24600         (MethodCore.ParameterTypes): return an empty sized array of types.
24601
24602         (Property.Define): Test property modifier validity.
24603
24604         Add tests for sealed/override too.
24605
24606         (Method.Emit): abstract or extern methods have no bodies.
24607
24608 2001-12-14  Ravi Pratap  <ravi@ximian.com>
24609
24610         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
24611         thing.
24612
24613         (Method::Define, ::Emit): Modify accordingly.
24614
24615         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
24616
24617         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
24618
24619         * makefile: Pass in /unsafe.
24620
24621 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
24622
24623         * class.cs (MakeKey): Kill routine.
24624
24625         * class.cs (TypeContainer.Define): Correctly define explicit
24626         method implementations (they require the full interface name plus
24627         the method name).
24628
24629         * typemanager.cs: Deply the PtrHashtable here and stop using the
24630         lame keys.  Things work so much better.
24631
24632         This of course broke everyone who depended on `RegisterMethod' to
24633         do the `test for existance' test.  This has to be done elsewhere.
24634
24635         * support.cs (PtrHashtable): A hashtable that avoid comparing with
24636         the object stupid Equals method (because, that like fails all over
24637         the place).  We still do not use it.
24638
24639         * class.cs (TypeContainer.SetRequiredInterface,
24640         TypeContainer.RequireMethods): Killed these two routines and moved
24641         all the functionality to RegisterRequiredImplementations.
24642
24643         (TypeContainer.RegisterRequiredImplementations): This routine now
24644         registers all the implementations required in an array for the
24645         interfaces and abstract methods.  We use an array of structures
24646         which can be computed ahead of time to reduce memory usage and we
24647         also assume that lookups are cheap as most classes will not
24648         implement too many interfaces.
24649
24650         We also avoid creating too many MethodSignatures.
24651
24652         (TypeContainer.IsInterfaceMethod): Update and optionally does not
24653         clear the "pending" bit if we find that there are problems with
24654         the declaration.
24655
24656         (TypeContainer.VerifyPendingMethods): Update to report errors of
24657         methods that look like implementations but are not.
24658
24659         (TypeContainer.Define): Add support for explicit interface method
24660         implementation. 
24661
24662 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
24663
24664         * typemanager.cs: Keep track of the parameters here instead of
24665         being a feature of the TypeContainer.
24666
24667         * class.cs: Drop the registration of parameters here, as
24668         InterfaceMethods are also interface declarations.
24669
24670         * delegate.cs: Register methods with the TypeManager not only with
24671         the TypeContainer.  This code was buggy.
24672
24673         * interface.cs: Full registation here.
24674
24675 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
24676
24677         * expression.cs: Remove reducer for binary expressions, it can not
24678         be done this way.
24679
24680         * const.cs: Put here the code that used to go into constant.cs
24681
24682         * constant.cs: Put here the code for constants, this is a new base
24683         class for Literals.
24684
24685         * literal.cs: Make Literal derive from Constant.
24686
24687 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
24688
24689         * statement.cs (Return.Emit): Report error 157 if the user
24690         attempts to return from a finally block.
24691
24692         (Return.Emit): Instead of emitting a return, jump to the end of
24693         the function.
24694
24695         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
24696         LocalBuilder to store the result of the function.  ReturnLabel is
24697         the target where we jump.
24698
24699
24700 2001-12-09  Radek Doulik  <rodo@ximian.com>
24701
24702         * cs-parser.jay: remember alias in current namespace
24703
24704         * ecore.cs (SimpleName::DoResolve): use aliases for types or
24705         namespaces
24706
24707         * class.cs (LookupAlias): lookup alias in my_namespace
24708
24709         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
24710         aliases hashtable
24711         (LookupAlias): lookup alias in this and if needed in parent
24712         namespaces
24713
24714 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
24715
24716         * support.cs: 
24717
24718         * rootcontext.cs: (ModuleBuilder) Made static, first step into
24719         making things static.  I need this to avoid passing the
24720         TypeContainer when calling ParameterType.
24721
24722         * support.cs (InternalParameters.ParameterType): Remove ugly hack
24723         that did string manipulation to compute the type and then call
24724         GetType.  Use Parameter.ParameterType instead.
24725
24726         * cs-tokenizer.cs: Consume the suffix for floating values.
24727
24728         * expression.cs (ParameterReference): figure out whether this is a
24729         reference parameter or not.  Kill an extra variable by computing
24730         the arg_idx during emission.
24731
24732         * parameter.cs (Parameters.GetParameterInfo): New overloaded
24733         function that returns whether a parameter is an out/ref value or not.
24734
24735         (Parameter.ParameterType): The type of the parameter (base,
24736         without ref/out applied).
24737
24738         (Parameter.Resolve): Perform resolution here.
24739         (Parameter.ExternalType): The full type (with ref/out applied).
24740
24741         * statement.cs (Using.Emit, Using.EmitExpression): Implement
24742         support for expressions on the using statement.
24743
24744 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
24745
24746         * statement.cs (Using.EmitLocalVariableDecls): Split the
24747         localvariable handling of the using statement.
24748
24749         (Block.EmitMeta): Keep track of variable count across blocks.  We
24750         were reusing slots on separate branches of blocks.
24751
24752         (Try.Emit): Emit the general code block, we were not emitting it. 
24753
24754         Check the type of the declaration to be an IDisposable or
24755         something that can be implicity converted to it. 
24756
24757         Emit conversions if required.
24758
24759         * ecore.cs (EmptyExpression): New utility class.
24760         (Expression.ImplicitConversionExists): New utility function.
24761
24762 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
24763
24764         * statement.cs (Using): Implement.
24765
24766         * expression.cs (LocalVariableReference): Support read only variables.
24767
24768         * statement.cs: Remove the explicit emit for the Leave opcode.
24769         (VariableInfo): Add a readonly field.
24770
24771 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
24772
24773         * ecore.cs (ConvCast): new class used to encapsulate the various
24774         explicit integer conversions that works in both checked and
24775         unchecked contexts.
24776
24777         (Expression.ConvertNumericExplicit): Use new ConvCast class to
24778         properly generate the overflow opcodes.
24779
24780 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24781
24782         * statement.cs: The correct type for the EmptyExpression is the
24783         element_type, not the variable type.  Ravi pointed this out.
24784
24785 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24786
24787         * class.cs (Method::Define): Handle PInvoke methods specially
24788         by using DefinePInvokeMethod instead of the usual one.
24789
24790         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
24791         above to do the task of extracting information and defining the method.
24792
24793 2001-12-04  Ravi Pratap  <ravi@ximian.com>
24794
24795         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
24796         of the condition for string type.
24797
24798         (Emit): Move that here. 
24799
24800         (ArrayCreation::CheckIndices): Keep string literals in their expression
24801         form.
24802
24803         (EmitDynamicInitializers): Handle strings appropriately.
24804
24805 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
24806
24807         * codegen.cs (EmitContext): Replace multiple variables with a
24808         single pointer to the current Switch statement.
24809
24810         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
24811         EmitContext.
24812
24813 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24814
24815         * statement.cs 
24816
24817         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
24818         default'.
24819
24820         (Foreach.Emit): Foreach on arrays was not setting
24821         up the loop variables (for break/continue).
24822
24823         (GotoCase): Semi-implented.
24824
24825 2001-12-03  Ravi Pratap  <ravi@ximian.com>
24826
24827         * attribute.cs (CheckAttribute): Handle system attributes by using
24828         Attribute.GetAttributes to examine information we need.
24829
24830         (GetValidPlaces): Same here.
24831
24832         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
24833
24834         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
24835
24836         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
24837
24838         (Method::Define): Set appropriate flags if we have a DllImport attribute.
24839
24840         (Method::Emit): Handle the case when we are a PInvoke method.
24841
24842 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
24843
24844         * expression.cs: Use ResolveWithSimpleName on compound names.
24845
24846 2001-12-02  Ravi Pratap  <ravi@ximian.com>
24847
24848         * constant.cs (EmitConstant): Make sure we resolve the associated expression
24849         before trying to reduce it.
24850
24851         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
24852
24853         * constant.cs (LookupConstantValue): Implement.
24854
24855         (EmitConstant): Use the above in emitting the constant.
24856
24857         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
24858         that are user-defined by doing a LookupConstantValue on them.
24859
24860         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
24861         too, like above.
24862
24863 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
24864
24865         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
24866
24867         (BaseAccess.DoResolve): Implement.
24868
24869         (MemberAccess.DoResolve): Split this routine into a
24870         ResolveMemberAccess routine that can be used independently
24871
24872 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
24873
24874         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
24875         As that share bits of the implementation.  Is returns a boolean,
24876         while As returns the Type that is being probed.
24877
24878 2001-12-01  Ravi Pratap  <ravi@ximian.com>
24879
24880         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
24881         instead of a Literal - much easier.
24882
24883         (EnumInTransit): Remove - utterly useless :-)
24884
24885         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
24886
24887         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
24888
24889         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
24890         chain when we have no associated expression.
24891
24892 2001-11-30  Ravi Pratap  <ravi@ximian.com>
24893
24894         * constant.cs (Define): Use Location while reporting the errror.
24895
24896         Also emit a warning when 'new' is used and there is no inherited
24897         member to hide.
24898
24899         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
24900         populated.
24901
24902         (LookupEnumValue): Implement to lookup an enum member's value and define it
24903         if necessary.
24904
24905         (Populate): Re-write accordingly to use the above routine.
24906
24907 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
24908
24909         * expression.cs (This): Fix prototype for DoResolveLValue to
24910         override the base class DoResolveLValue.
24911
24912         * cs-parser.cs: Report errors cs574 and cs575 (destructor
24913         declarations) 
24914
24915         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
24916         (we need to load the address of the field here).  This fixes
24917         test-22. 
24918
24919         (FieldExpr.DoResolveLValue): Call the DoResolve
24920         function to initialize the Instance expression.
24921
24922         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
24923         correctly the GetEnumerator operation on a value type.
24924
24925         * cs-parser.jay: Add more simple parsing error catches.
24926
24927         * statement.cs (Switch): Add support for string switches.
24928         Handle null specially.
24929
24930         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
24931
24932 2001-11-28  Ravi Pratap  <ravi@ximian.com>
24933
24934         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
24935
24936         (declare_local_constant): New helper function.
24937
24938         * statement.cs (AddConstant): Keep a separate record of constants
24939
24940         (IsConstant): Implement to determine if a variable is a constant.
24941
24942         (GetConstantExpression): Implement.
24943
24944         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
24945
24946         * statement.cs (IsVariableDefined): Re-write.
24947
24948 2001-11-27  Ravi Pratap  <ravi@ximian.com>
24949
24950         * class.cs (TypeContainer::FindMembers): Look for constants
24951         in the case when we are looking for MemberTypes.Field
24952
24953         * expression.cs (MemberAccess::DoResolve): Check that in the
24954         case we are a FieldExpr and a Literal, we are not being accessed
24955         by an instance reference.
24956
24957         * cs-parser.jay (local_constant_declaration): Implement.
24958
24959         (declaration_statement): Implement for constant declarations.
24960
24961 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
24962
24963         * statement.cs (Switch): Catch double defaults.
24964
24965         (Switch): More work on the switch() statement
24966         implementation.  It works for integral values now, need to finish
24967         string support.
24968
24969
24970 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24971
24972         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
24973         integer literals into other integer literals.  To be used by
24974         switch. 
24975
24976 2001-11-24  Ravi Pratap  <ravi@ximian.com>
24977
24978         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
24979         some memory.
24980
24981         (EmitDynamicInitializers): Cope with the above since we extract data
24982         directly from ArrayData now.
24983
24984         (ExpectInitializers): Keep track of whether initializers are mandatory
24985         or not.
24986
24987         (Bounds): Make it a hashtable to prevent the same dimension being 
24988         recorded for every element in that dimension.
24989
24990         (EmitDynamicInitializers): Fix bug which prevented the Set array method
24991         from being found.
24992
24993         Also fix bug which was causing the indices to be emitted in the reverse
24994         order.
24995
24996 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
24997
24998         * expression.cs (ArrayCreation): Implement the bits that Ravi left
24999         unfinished.  They do not work, because the underlying code is
25000         sloppy.
25001
25002 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * cs-parser.jay: Remove bogus fixme.
25005
25006         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
25007         on Switch statement.
25008
25009 2001-11-23  Ravi Pratap  <ravi@ximian.com>
25010
25011         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
25012         the same. 
25013
25014         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
25015         parameter. Apparently, any expression is allowed. 
25016
25017         (ValidateInitializers): Update accordingly.
25018
25019         (CheckIndices): Fix some tricky bugs thanks to recursion.
25020
25021         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
25022         I was being completely brain-dead.
25023
25024         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
25025         and re-write acordingly.
25026
25027         (DelegateInvocation): Re-write accordingly.
25028
25029         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
25030
25031         (MakeByteBlob): Handle types more correctly.
25032
25033         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
25034         initialization from expressions but it is incomplete because I am a complete
25035         Dodo :-|
25036
25037 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25038
25039         * statement.cs (If.Emit): Fix a bug that generated incorrect code
25040         on If.  Basically, we have to return `true' (ie, we do return to
25041         our caller) only if both branches of the if return.
25042
25043         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
25044         short-circuit operators, handle them as short circuit operators. 
25045
25046         (Cast.DoResolve): Resolve type.
25047         (Cast.Cast): Take an expression as the target type.
25048
25049         * cs-parser.jay (cast_expression): Remove old hack that only
25050         allowed a limited set of types to be handled.  Now we take a
25051         unary_expression and we resolve to a type during semantic
25052         analysis.
25053
25054         Use the grammar productions from Rhys to handle casts (this is
25055         not complete like Rhys syntax yet, we fail to handle that corner
25056         case that C# has regarding (-x), but we will get there.
25057
25058 2001-11-22  Ravi Pratap  <ravi@ximian.com>
25059
25060         * class.cs (EmitFieldInitializer): Take care of the case when we have a
25061         field which is an array type.
25062
25063         * cs-parser.jay (declare_local_variables): Support array initialization too.
25064
25065         * typemanager.cs (MakeKey): Implement.
25066
25067         (everywhere): Use the above appropriately.
25068
25069         * cs-parser.jay (for_statement): Update for array initialization while
25070         declaring variables.
25071
25072         * ecore.cs : The error message was correct, it's the variable's names that
25073         were misleading ;-) Make the code more readable.
25074
25075         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
25076         the correct type etc.
25077
25078         (ConvertExplicit): Handle Enum types by examining the underlying type.
25079
25080 2001-11-21  Ravi Pratap  <ravi@ximian.com>
25081
25082         * parameter.cs (GetCallingConvention): Always return
25083         CallingConventions.Standard for now.
25084
25085 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25086
25087         * expression.cs (Binary.ResolveOperator): Update the values of `l'
25088         and `r' after calling DoNumericPromotions.
25089
25090         * ecore.cs: Fix error message (the types were in the wrong order).
25091
25092         * statement.cs (Foreach.ProbeCollectionType): Need to pass
25093         BindingFlags.Instance as well 
25094
25095         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
25096         implicit int literal conversion in an empty cast so that we
25097         propagate the right type upstream.
25098
25099         (UnboxCast): new class used to unbox value types.
25100         (Expression.ConvertExplicit): Add explicit type conversions done
25101         by unboxing.
25102
25103         (Expression.ImplicitNumericConversion): Oops, forgot to test for
25104         the target type before applying the implicit LongLiterals to ULong
25105         literal cast.
25106
25107 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
25108
25109         * cs-parser.jay (for_statement): Reworked the way For works: now
25110         we declare manually any variables that are introduced in
25111         for_initializer to solve the problem of having out-of-band code
25112         emition (that is what got for broken).
25113
25114         (declaration_statement): Perform the actual variable declaration
25115         that used to be done in local_variable_declaration here.
25116
25117         (local_variable_declaration): Do not declare anything, just pass
25118         the information on a DictionaryEntry
25119
25120 2001-11-20  Ravi Pratap  <ravi@ximian.com>
25121
25122         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
25123         re-write of the logic to now make it recursive.
25124
25125         (UpdateIndices): Re-write accordingly.
25126
25127         Store element data in a separate ArrayData list in the above methods.
25128
25129         (MakeByteBlob): Implement to dump the array data into a byte array.
25130
25131 2001-11-19  Ravi Pratap  <ravi@ximian.com>
25132
25133         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
25134         into CheckIndices.
25135
25136         * constant.cs (Define): Implement.
25137
25138         (EmitConstant): Re-write fully.
25139
25140         Pass in location info.
25141
25142         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
25143         respectively.
25144
25145         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
25146         DictionaryEntry since we need location info too.
25147
25148         (constant_declaration): Update accordingly.
25149
25150         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
25151         code into another method : UpdateIndices.
25152
25153 2001-11-18  Ravi Pratap  <ravi@ximian.com>
25154
25155         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
25156         some type checking etc.
25157
25158 2001-11-17  Ravi Pratap  <ravi@ximian.com>
25159
25160         * expression.cs (ArrayCreation::ValidateInitializers): Implement
25161         bits to provide dimension info if the user skips doing that.
25162
25163         Update second constructor to store the rank correctly.
25164
25165 2001-11-16  Ravi Pratap  <ravi@ximian.com>
25166
25167         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
25168         and try to implement.
25169
25170         * ../errors/cs0150.cs : Add.
25171
25172         * ../errors/cs0178.cs : Add.
25173
25174 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
25175
25176         * statement.cs: Implement foreach on multi-dimensional arrays. 
25177
25178         * parameter.cs (Parameters.GetParameterByName): Also lookup the
25179         name of the params argument.
25180
25181         * expression.cs: Use EmitStoreOpcode to get the right opcode while
25182         initializing the array.
25183
25184         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
25185         we can use this elsewhere.
25186
25187         * statement.cs: Finish implementation of foreach for single
25188         dimension arrays.
25189
25190         * cs-parser.jay: Use an out-of-band stack to pass information
25191         around, I wonder why I need this.
25192
25193         foreach_block: Make the new foreach_block the current_block.
25194
25195         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
25196         function used to return a static Parameters structure.  Used for
25197         empty parameters, as those are created very frequently.
25198
25199         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
25200
25201 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25202
25203         * interface.cs : Default modifier is private, not public. The
25204         make verify test passes again.
25205
25206 2001-11-15  Ravi Pratap  <ravi@ximian.com>
25207
25208         * support.cs (ReflectionParameters): Fix logic to determine
25209         whether the last parameter is a params one. Test 9 passes again.
25210
25211         * delegate.cs (Populate): Register the builders we define with
25212         RegisterParameterForBuilder. Test 19 passes again.
25213
25214         * cs-parser.jay (property_declaration): Reference $6 instead
25215         of $$ to get at the location.
25216
25217         (indexer_declaration): Similar stuff.
25218
25219         (attribute): Ditto.
25220
25221         * class.cs (Property): Register parameters for the Get and Set methods
25222         if they exist. Test 23 passes again.
25223
25224         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
25225         call to EmitArguments as we are sure there aren't any params arguments. 
25226         Test 32 passes again.
25227
25228         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
25229         IndexOutOfRangeException. 
25230
25231         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
25232         Test 33 now passes again.
25233
25234 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
25235
25236         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
25237         broke a bunch of things.  Will have to come up with a better way
25238         of tracking locations.
25239
25240         * statement.cs: Implemented foreach for single dimension arrays.
25241
25242 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25243
25244         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
25245         an error.  This removes the lookup from the critical path.
25246
25247         * cs-parser.jay: Removed use of temporary_loc, which is completely
25248         broken. 
25249
25250 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
25251
25252         * support.cs (ReflectionParameters.ParameterModifier): Report
25253         whether the argument is a PARAMS argument or not.
25254
25255         * class.cs: Set the attribute `ParamArrayAttribute' on the
25256         parameter argument.
25257
25258         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
25259         and cons_param_array_attribute (ConstructorInfo for
25260         ParamArrayAttribute)., 
25261
25262         * codegen.cs: Emit the return using the `Return' statement, that
25263         way we can report the error correctly for missing return values. 
25264
25265         * class.cs (Method.Emit): Clean up.
25266
25267         * expression.cs (Argument.Resolve): Take another argument: the
25268         location where this argument is used.  Notice that this is not
25269         part of the "Argument" class as to reduce the size of the
25270         structure (we know the approximate location anyways).
25271
25272         Test if the argument is a variable-reference, if not, then
25273         complain with a 206.
25274
25275         (Argument.Emit): Emit addresses of variables.
25276
25277         (Argument.FullDesc): Simplify.
25278
25279         (Invocation.DoResolve): Update for Argument.Resolve.
25280
25281         (ElementAccess.DoResolve): ditto.
25282
25283         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
25284         method should be virtual, as this method is always virtual.
25285
25286         (NewDelegate.DoResolve): Update for Argument.Resolve.
25287
25288         * class.cs (ConstructorInitializer.DoResolve): ditto.
25289
25290         * attribute.cs (Attribute.Resolve): ditto.
25291
25292 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
25293
25294         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
25295
25296         * expression.cs (ParameterReference): Drop IStackStorage and implement
25297         IAssignMethod instead. 
25298
25299         (LocalVariableReference): ditto.
25300
25301         * ecore.cs (FieldExpr): Drop IStackStorage and implement
25302         IAssignMethod instead. 
25303
25304 2001-11-13  Miguel de Icaza <miguel@ximian.com>
25305
25306         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
25307         enumerations that are used in heavily used structures derive from
25308         byte in a laughable and pathetic attempt to reduce memory usage.
25309         This is the kind of pre-optimzations that you should not do at
25310         home without adult supervision.
25311
25312         * expression.cs (UnaryMutator): New class, used to handle ++ and
25313         -- separatedly from the other unary operators.  Cleans up the
25314         code, and kills the ExpressionStatement dependency in Unary.
25315
25316         (Unary): Removed `method' and `Arguments' from this class, making
25317         it smaller, and moving it all to SimpleCall, so I can reuse this
25318         code in other locations and avoid creating a lot of transient data
25319         strucutres when not required.
25320
25321         * cs-parser.jay: Adjust for new changes.
25322
25323 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
25324
25325         * enum.cs (Enum.Populate): If there is a failure during
25326         definition, return
25327
25328         * cs-parser.jay (opt_enum_base): we used to catch type errors
25329         here, but this is really incorrect.  The type error should be
25330         catched during semantic analysis.
25331
25332 2001-12-11  Ravi Pratap  <ravi@ximian.com>
25333
25334         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
25335         current_local_parameters as expected since I, in my stupidity, had forgotten
25336         to do this :-)
25337
25338         * attribute.cs (GetValidPlaces): Fix stupid bug.
25339
25340         * class.cs (Method::Emit): Perform check on applicability of attributes.
25341
25342         (Constructor::Emit): Ditto.
25343
25344         (Field::Emit): Ditto.
25345
25346         (Field.Location): Store location information.
25347
25348         (Property, Event, Indexer, Operator): Ditto.
25349
25350         * cs-parser.jay (field_declaration): Pass in location for each field.
25351
25352         * ../errors/cs0592.cs : Add.
25353
25354 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25355
25356         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
25357
25358         (InitCoreTypes): Update accordingly.
25359
25360         (RegisterAttrType, LookupAttr): Implement.
25361
25362         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
25363         info about the same.
25364
25365         (Resolve): Update to populate the above as necessary.
25366
25367         (Error592): Helper.
25368
25369         (GetValidPlaces): Helper to the above.
25370
25371         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
25372
25373         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
25374
25375 2001-11-12  Ravi Pratap  <ravi@ximian.com>
25376
25377         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
25378
25379         * ../errors/cs0617.cs : Add.
25380
25381 2001-11-11  Ravi Pratap  <ravi@ximian.com>
25382
25383         * enum.cs (Emit): Rename to Populate to be more consistent with what
25384         we expect it to do and when exactly it is called.
25385
25386         * class.cs, rootcontext.cs : Update accordingly.
25387
25388         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
25389         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
25390
25391         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
25392
25393         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
25394         of a fieldinfo using the above, when dealing with a FieldBuilder.
25395
25396 2001-11-10  Ravi Pratap  <ravi@ximian.com>
25397
25398         * ../errors/cs0031.cs : Add.
25399
25400         * ../errors/cs1008.cs : Add.
25401
25402         * ../errrors/cs0543.cs : Add.
25403
25404         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
25405         enum type.
25406
25407         (FindMembers): Implement.
25408
25409         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
25410         enums and delegates too.
25411
25412         (enum_types): Rename to builder_to_enum.
25413
25414         (delegate_types): Rename to builder_to_delegate.
25415
25416         * delegate.cs (FindMembers): Implement.
25417
25418 2001-11-09  Ravi Pratap  <ravi@ximian.com>
25419
25420         * typemanager.cs (IsEnumType): Implement.
25421
25422         * enum.cs (Emit): Re-write parts to account for the underlying type
25423         better and perform checking etc.
25424
25425         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
25426         of the underlying type.
25427
25428         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
25429         value
25430
25431         * enum.cs (error31): Helper to report error #31.
25432
25433         * cs-parser.jay (enum_declaration): Store location of each member too.
25434
25435         * enum.cs (member_to_location): New hashtable. 
25436
25437         (AddEnumMember): Update location hashtable.
25438
25439         (Emit): Use the location of each member while reporting errors.
25440
25441 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
25442
25443         * cs-parser.jay: A for_initializer if is a
25444         local_variable_declaration really ammount to have an implicit
25445         block with the variable declaration and no initializer for for.
25446
25447         * statement.cs (For.Emit): Cope with null initializers.
25448
25449         This fixes the infinite loop on for initializers.
25450
25451 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
25452
25453         * enum.cs: More cleanup.
25454
25455         * ecore.cs: Remove dead code.
25456
25457         * class.cs (Property.Emit): More simplification.
25458         (Event.Emit): ditto.
25459
25460         Reworked to have less levels of indentation.
25461
25462 2001-11-08  Ravi Pratap  <ravi@ximian.com>
25463
25464         * class.cs (Property): Emit attributes.
25465
25466         (Field): Ditto.
25467
25468         (Event): Ditto.
25469
25470         (Indexer): Ditto.
25471
25472         (Operator): Ditto.
25473
25474         * enum.cs (Emit): Ditto.
25475
25476         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
25477         Enums too.
25478
25479         * class.cs (Field, Event, etc.): Move attribute generation into the
25480         Emit method everywhere.
25481
25482         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
25483         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
25484         as we had no way of defining nested enums !
25485
25486         * rootcontext.cs : Adjust code accordingly.
25487
25488         * typemanager.cs (AddEnumType): To keep track of enum types separately.
25489
25490 2001-11-07  Ravi Pratap  <ravi@ximian.com>
25491
25492         * expression.cs (EvalConstantExpression): Move into ecore.cs
25493
25494         * enum.cs (Enum): Rename some members and make them public and readonly
25495         according to our convention.
25496
25497         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
25498         nothing else.
25499
25500         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
25501
25502         (Enum::Emit): Write a simple version for now which doesn't try to compute
25503         expressions. I shall modify this to be more robust in just a while.
25504
25505         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
25506
25507         (TypeContainer::CloseType): Create the Enum types too.
25508
25509         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
25510
25511         * expression.cs (EvalConstantExpression): Get rid of completely.
25512
25513         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
25514         user-defined values and other cases.
25515
25516         (IsValidEnumLiteral): Helper function.
25517
25518         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
25519         out there in the case we had a literal FieldExpr.
25520
25521         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
25522
25523         (Literalize): Revamp a bit to take two arguments.
25524
25525         (EnumLiteral): New class which derives from Literal to wrap enum literals.
25526
25527 2001-11-06  Ravi Pratap  <ravi@ximian.com>
25528
25529         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
25530
25531         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
25532
25533         (Resolve): Use the above to ensure we have proper initializers.
25534
25535 2001-11-05  Ravi Pratap  <ravi@ximian.com>
25536
25537         * expression.cs (Expression::EvalConstantExpression): New method to 
25538         evaluate constant expressions.
25539
25540         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
25541
25542 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
25543
25544         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
25545         in an array.
25546
25547         (Binary.ResolveOperator): Handle operator != (object a, object b)
25548         and operator == (object a, object b);
25549
25550         (Binary.DoNumericPromotions): Indicate whether the numeric
25551         promotion was possible.
25552
25553         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
25554         Implement.  
25555
25556         Made the ArrayAccess implement interface IAssignMethod instead of
25557         IStackStore as the order in which arguments are passed reflects
25558         this.
25559
25560         * assign.cs: Instead of using expr.ExprClass to select the way of
25561         assinging, probe for the IStackStore/IAssignMethod interfaces.
25562
25563         * typemanager.cs: Load InitializeArray definition.
25564
25565         * rootcontext.cs (RootContext.MakeStaticData): Used to define
25566         static data that can be used to initialize arrays. 
25567
25568 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
25569
25570         * expression.cs: Handle operator== and operator!= for booleans.
25571
25572         (Conditioal.Reduce): Implement reducer for the ?: operator.
25573
25574         (Conditional.Resolve): Implement dead code elimination.
25575
25576         (Binary.Resolve): Catch string literals and return a new
25577         concatenated string.
25578
25579         (Unary.Reduce): Implement reduction of unary expressions.
25580
25581         * ecore.cs: Split out the expression core handling here.
25582
25583         (Expression.Reduce): New method used to perform constant folding
25584         and CSE.  This is needed to support constant-expressions. 
25585
25586         * statement.cs (Statement.EmitBoolExpression): Pass true and false
25587         targets, and optimize for !x.
25588
25589 2001-11-04  Ravi Pratap  <ravi@ximian.com>
25590
25591         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
25592         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
25593         set custom atttributes.
25594
25595         * literal.cs (Literal::GetValue): New abstract method to return the actual
25596         value of the literal, cast as an object.
25597
25598         (*Literal): Implement GetValue method.
25599
25600         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
25601         expressions to the arraylist but objects of type Argument.
25602
25603         * class.cs (TypeContainer::Emit): Emit our attributes too.
25604
25605         (Method::Emit, Constructor::Emit): Ditto.
25606
25607         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
25608         to be ignoring earlier.
25609
25610 2001-11-03  Ravi Pratap  <ravi@ximian.com>
25611
25612         * attribute.cs (AttributeSection::Define): Implement to do the business
25613         of constructing a CustomAttributeBuilder.
25614
25615         (Attribute): New trivial class. Increases readability of code.  
25616
25617         * cs-parser.jay : Update accordingly.
25618
25619         (positional_argument_list, named_argument_list, named_argument): New rules
25620
25621         (attribute_arguments): Use the above so that we are more correct.
25622
25623 2001-11-02  Ravi Pratap  <ravi@ximian.com>
25624
25625         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
25626         to perform all checks for a method with a params parameter.
25627
25628         (Invocation::OverloadResolve): Update to use the above method and therefore
25629         cope correctly with params method invocations.
25630
25631         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
25632         params too.
25633
25634         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
25635         constructors in our parent too because we can't afford to miss out on 
25636         protected ones ;-)
25637
25638         * attribute.cs (AttributeSection): New name for the class Attribute
25639
25640         Other trivial changes to improve readability.
25641
25642         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
25643         use the new class names.
25644
25645 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25646
25647         * class.cs (Method::Define): Complete definition for params types too
25648
25649         (Indexer::Define): Ditto.
25650
25651         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
25652         Cope everywhere with a request for info about the array parameter.
25653
25654 2001-11-01  Ravi Pratap  <ravi@ximian.com>
25655
25656         * tree.cs (RecordNamespace): Fix up to check for the correct key.
25657
25658         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
25659         local_variable_type to extract the string corresponding to the type.
25660
25661         (local_variable_type): Fixup the action to use the new helper method.
25662
25663         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
25664         go.
25665
25666         * expression.cs : Clean out code which uses the above.
25667
25668 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25669
25670         * typemanager.cs (RegisterMethod): Check if we already have an existing key
25671         and bale out if necessary by returning a false.
25672
25673         (RegisterProperty): Ditto.
25674
25675         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
25676         and print out appropriate error messages.
25677
25678         * interface.cs (everywhere): Ditto.
25679
25680         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
25681         location to constructor.
25682
25683         * class.cs (Property, Event, Indexer): Update accordingly.
25684
25685         * ../errors/cs111.cs : Added.
25686
25687         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
25688         of a method, as laid down by the spec.
25689
25690         (Invocation::OverloadResolve): Use the above method.
25691
25692 2001-10-31  Ravi Pratap  <ravi@ximian.com>
25693
25694         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
25695         now take a TypeContainer and a Parameters object.
25696
25697         (ParameterData): Modify return type of ParameterModifier method to be 
25698         Parameter.Modifier and not a string.
25699
25700         (ReflectionParameters, InternalParameters): Update accordingly.
25701
25702         * expression.cs (Argument::GetParameterModifier): Same here.
25703
25704         * support.cs (InternalParameters::ParameterType): Find a better way of determining
25705         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
25706         symbol in it at all so maybe this is only for now.
25707
25708 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25709
25710         * support.cs (InternalParameters): Constructor now takes an extra argument 
25711         which is the actual Parameters class.
25712
25713         (ParameterDesc): Update to provide info on ref/out modifiers.
25714
25715         * class.cs (everywhere): Update call to InternalParameters to pass in
25716         the second argument too.
25717
25718         * support.cs (ParameterData): Add ParameterModifier, which is a method 
25719         to return the modifier info [ref/out etc]
25720
25721         (InternalParameters, ReflectionParameters): Implement the above.
25722
25723         * expression.cs (Argument::ParameterModifier): Similar function to return
25724         info about the argument's modifiers.
25725
25726         (Invocation::OverloadResolve): Update to take into account matching modifiers 
25727         too.
25728
25729         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
25730         a new SetFormalParameters object which we pass to InternalParameters.
25731
25732 2001-10-30  Ravi Pratap  <ravi@ximian.com>
25733
25734         * expression.cs (NewArray): Merge into the ArrayCreation class.
25735
25736 2001-10-29  Ravi Pratap  <ravi@ximian.com>
25737
25738         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
25739         NewUserdefinedArray into one as there wasn't much of a use in having
25740         two separate ones.
25741
25742         * expression.cs (Argument): Change field's name to ArgType from Type.
25743
25744         (Type): New readonly property which returns the proper type, taking into 
25745         account ref/out modifiers.
25746
25747         (everywhere): Adjust code accordingly for the above.
25748
25749         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
25750         whether we are emitting for a ref or out parameter.
25751
25752         * expression.cs (Argument::Emit): Use the above field to set the state.
25753
25754         (LocalVariableReference::Emit): Update to honour the flag and emit the
25755         right stuff.
25756
25757         * parameter.cs (Attributes): Set the correct flags for ref parameters.
25758
25759         * expression.cs (Argument::FullDesc): New function to provide a full desc.
25760
25761         * support.cs (ParameterData): Add method ParameterDesc to the interface.
25762
25763         (ReflectionParameters, InternalParameters): Implement the above method.
25764
25765         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
25766         reporting errors.
25767
25768         (Invocation::FullMethodDesc): Ditto. 
25769
25770 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
25771
25772         * cs-parser.jay: Add extra production for the second form of array
25773         creation. 
25774
25775         * expression.cs (ArrayCreation): Update to reflect the above
25776         change. 
25777
25778         * Small changes to prepare for Array initialization.
25779
25780 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
25781
25782         * typemanager.cs (ImplementsInterface): interface might be null;
25783         Deal with this problem;
25784
25785         Also, we do store negative hits on the cache (null values), so use
25786         this instead of calling t.GetInterfaces on the type everytime.
25787
25788 2001-10-28  Ravi Pratap  <ravi@ximian.com>
25789
25790         * typemanager.cs (IsBuiltinType): New method to help determine the same.
25791
25792         * expression.cs (New::DoResolve): Get rid of array creation code and instead
25793         split functionality out into different classes.
25794
25795         (New::FormArrayType): Move into NewBuiltinArray.
25796
25797         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
25798         quite useless.
25799
25800         (NewBuiltinArray): New class to handle creation of built-in arrays.
25801
25802         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
25803         account creation of one-dimensional arrays.
25804
25805         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
25806
25807         (NewUserdefinedArray::DoResolve): Implement.
25808
25809         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
25810
25811         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
25812         we maintain inside the TypeManager. This is necessary to perform lookups on the
25813         module builder.
25814
25815         (LookupType): Update to perform GetType on the module builders too.     
25816
25817         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
25818
25819         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
25820
25821 2001-10-23  Ravi Pratap  <ravi@ximian.com>
25822
25823         * expression.cs (New::DoResolve): Implement guts of array creation.
25824
25825         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
25826
25827 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
25828
25829         * expression.cs: Fix bug I introduced lsat night that broke
25830         Delegates. 
25831
25832         (Expression.Resolve): Report a 246 error (can not resolve name)
25833         if we find a SimpleName in the stream.
25834
25835         (Expression.ResolveLValue): Ditto.
25836
25837         (Expression.ResolveWithSimpleName): This function is a variant of
25838         ResolveName, this one allows SimpleNames to be returned without a
25839         warning.  The only consumer of SimpleNames is MemberAccess
25840
25841 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
25842
25843         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
25844         might arrive here.  I have my doubts that this is correct.
25845
25846         * statement.cs (Lock): Implement lock statement.
25847
25848         * cs-parser.jay: Small fixes to support `lock' and `using'
25849
25850         * cs-tokenizer.cs: Remove extra space
25851
25852         * driver.cs: New flag --checked, allows to turn on integer math
25853         checking. 
25854
25855         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
25856         Threading.Monitor.Exit 
25857
25858 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
25859
25860         * expression.cs (IndexerAccess::DoResolveLValue): Set the
25861         Expression Class to be IndexerAccess.
25862
25863         Notice that Indexer::DoResolve sets the eclass to Value.
25864
25865 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
25866
25867         * class.cs (TypeContainer::Emit): Emit code for indexers.
25868
25869         * assign.cs (IAssignMethod): New interface implemented by Indexers
25870         and Properties for handling assignment.
25871
25872         (Assign::Emit): Simplify and reuse code. 
25873
25874         * expression.cs (IndexerAccess, PropertyExpr): Implement
25875         IAssignMethod, clean up old code. 
25876
25877 2001-10-22  Ravi Pratap  <ravi@ximian.com>
25878
25879         * typemanager.cs (ImplementsInterface): New method to determine if a type
25880         implements a given interface. Provides a nice cache too.
25881
25882         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
25883         method.
25884
25885         (ConvertReferenceExplicit): Ditto.
25886
25887         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
25888         various methods, with correct names etc.
25889
25890         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
25891         Operator.UnaryNegation.
25892
25893         * cs-parser.jay (operator_declarator): Be a little clever in the case where
25894         we have a unary plus or minus operator.
25895
25896         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
25897         UnaryMinus.
25898
25899         * everywhere : update accordingly.
25900
25901         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
25902         respectively.
25903
25904         * class.cs (Method::Define): For the case where we are implementing a method
25905         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
25906         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
25907
25908 2001-10-21  Ravi Pratap  <ravi@ximian.com>
25909
25910         * interface.cs (FindMembers): Implement to work around S.R.E
25911         lameness.
25912
25913         * typemanager.cs (IsInterfaceType): Implement.
25914
25915         (FindMembers): Update to handle interface types too.
25916
25917         * expression.cs (ImplicitReferenceConversion): Re-write bits which
25918         use IsAssignableFrom as that is not correct - it doesn't work.
25919
25920         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
25921         and accordingly override EmitStatement.
25922
25923         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
25924         using the correct logic :-)
25925
25926 2001-10-19  Ravi Pratap  <ravi@ximian.com>
25927
25928         * ../errors/cs-11.cs : Add to demonstrate error -11 
25929
25930 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
25931
25932         * assign.cs (Assign::Resolve): Resolve right hand side first, and
25933         then pass this as a hint to ResolveLValue.
25934
25935         * expression.cs (FieldExpr): Add Location information
25936
25937         (FieldExpr::LValueResolve): Report assignment to readonly
25938         variable. 
25939
25940         (Expression::ExprClassFromMemberInfo): Pass location information.
25941
25942         (Expression::ResolveLValue): Add new method that resolves an
25943         LValue. 
25944
25945         (Expression::DoResolveLValue): Default invocation calls
25946         DoResolve. 
25947
25948         (Indexers): New class used to keep track of indexers in a given
25949         Type. 
25950
25951         (IStackStore): Renamed from LValue, as it did not really describe
25952         what this did.  Also ResolveLValue is gone from this interface and
25953         now is part of Expression.
25954
25955         (ElementAccess): Depending on the element access type
25956
25957         * typemanager.cs: Add `indexer_name_type' as a Core type
25958         (System.Runtime.CompilerServices.IndexerNameAttribute)
25959
25960         * statement.cs (Goto): Take a location.
25961
25962 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25963
25964         * delegate.cs (Delegate::VerifyDelegate): New method to verify
25965         if two delegates are compatible.
25966
25967         (NewDelegate::DoResolve): Update to take care of the case when
25968         we instantiate a delegate from another delegate.
25969
25970         * typemanager.cs (FindMembers): Don't even try to look up members
25971         of Delegate types for now.
25972
25973 2001-10-18  Ravi Pratap  <ravi@ximian.com>
25974
25975         * delegate.cs (NewDelegate): New class to take care of delegate
25976         instantiation.
25977
25978         * expression.cs (New): Split the delegate related code out into 
25979         the NewDelegate class.
25980
25981         * delegate.cs (DelegateInvocation): New class to handle delegate 
25982         invocation.
25983
25984         * expression.cs (Invocation): Split out delegate related code into
25985         the DelegateInvocation class.
25986
25987 2001-10-17  Ravi Pratap  <ravi@ximian.com>
25988
25989         * expression.cs (New::DoResolve): Implement delegate creation fully
25990         and according to the spec.
25991
25992         (New::DoEmit): Update to handle delegates differently.
25993
25994         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
25995         because of which we were printing out arguments in reverse order !
25996
25997         * delegate.cs (VerifyMethod): Implement to check if the given method
25998         matches the delegate.
25999
26000         (FullDelegateDesc): Implement.
26001
26002         (VerifyApplicability): Implement.
26003
26004         * expression.cs (Invocation::DoResolve): Update to accordingly handle
26005         delegate invocations too.
26006
26007         (Invocation::Emit): Ditto.
26008
26009         * ../errors/cs1593.cs : Added.
26010
26011         * ../errors/cs1594.cs : Added.
26012
26013         * delegate.cs (InstanceExpression, TargetMethod): New properties.
26014
26015 2001-10-16  Ravi Pratap  <ravi@ximian.com>
26016
26017         * typemanager.cs (intptr_type): Core type for System.IntPtr
26018
26019         (InitCoreTypes): Update for the same.
26020
26021         (iasyncresult_type, asynccallback_type): Ditto.
26022
26023         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
26024         correct.
26025
26026         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
26027         too.
26028
26029         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
26030         the builders for the 4 members of a delegate type :-)
26031
26032         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
26033         type.
26034
26035         * expression.cs (New::DoResolve): Implement guts for delegate creation.
26036
26037         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
26038
26039 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
26040
26041         * statement.cs (Break::Emit): Implement.   
26042         (Continue::Emit): Implement.
26043
26044         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
26045         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
26046         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
26047         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
26048         end loop
26049
26050         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
26051         properties that track the label for the current loop (begin of the
26052         loop and end of the loop).
26053
26054 2001-10-15  Ravi Pratap  <ravi@ximian.com>
26055
26056         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
26057         use of emitting anything at all.
26058
26059         * class.cs, rootcontext.cs : Get rid of calls to the same.
26060
26061         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
26062
26063         (Populate): Define the constructor correctly and set the implementation
26064         attributes.
26065
26066         * typemanager.cs (delegate_types): New hashtable to hold delegates that
26067         have been defined.
26068
26069         (AddDelegateType): Implement.
26070
26071         (IsDelegateType): Implement helper method.
26072
26073         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
26074
26075         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
26076         and accordingly handle it.
26077
26078         * delegate.cs (Populate): Take TypeContainer argument.
26079         Implement bits to define the Invoke method. However, I still haven't figured out
26080         how to take care of the native int bit :-(
26081
26082         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
26083         Qualify the name of the delegate, not its return type !
26084
26085         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
26086         conversion.
26087
26088         (StandardConversionExists): Checking for array types turns out to be recursive.
26089
26090         (ConvertReferenceExplicit): Implement array conversion.
26091
26092         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
26093
26094 2001-10-12  Ravi Pratap  <ravi@ximian.com>
26095
26096         * cs-parser.jay (delegate_declaration): Store the fully qualified
26097         name as it is a type declaration.
26098
26099         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
26100         readonly.
26101
26102         (DefineDelegate): Renamed from Define. Does the same thing essentially,
26103         as TypeContainer::DefineType.
26104
26105         (Populate): Method in which all the definition of the various methods (Invoke)
26106         etc is done.
26107
26108         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
26109         see.
26110
26111         (CloseDelegate): Finally creates the delegate.
26112
26113         * class.cs (TypeContainer::DefineType): Update to define delegates.
26114         (Populate, Emit and CloseType): Do the same thing here too.
26115
26116         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
26117         delegates in all these operations.
26118
26119 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
26120
26121         * expression.cs: LocalTemporary: a new expression used to
26122         reference a temporary that has been created.
26123
26124         * assign.cs: Handle PropertyAccess back here, so that we can
26125         provide the proper semantic access to properties.
26126
26127         * expression.cs (Expression::ConvertReferenceExplicit): Implement
26128         a few more explicit conversions. 
26129
26130         * modifiers.cs: `NEW' modifier maps to HideBySig.
26131
26132         * expression.cs (PropertyExpr): Make this into an
26133         ExpressionStatement, and support the EmitStatement code path. 
26134
26135         Perform get/set error checking, clean up the interface.
26136
26137         * assign.cs: recognize PropertyExprs as targets, and if so, turn
26138         them into toplevel access objects.
26139
26140 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
26141
26142         * expression.cs: PropertyExpr::PropertyExpr: use work around the
26143         SRE.
26144
26145         * typemanager.cs: Keep track here of our PropertyBuilders again to
26146         work around lameness in SRE.
26147
26148 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
26149
26150         * expression.cs (LValue::LValueResolve): New method in the
26151         interface, used to perform a second resolution pass for LValues. 
26152
26153         (This::DoResolve): Catch the use of this in static methods.
26154
26155         (This::LValueResolve): Implement.
26156
26157         (This::Store): Remove warning, assigning to `this' in structures
26158         is 
26159
26160         (Invocation::Emit): Deal with invocation of
26161         methods on value types.  We need to pass the address to structure
26162         methods rather than the object itself.  (The equivalent code to
26163         emit "this" for structures leaves the entire structure on the
26164         stack instead of a pointer to it). 
26165
26166         (ParameterReference::DoResolve): Compute the real index for the
26167         argument based on whether the method takes or not a `this' pointer
26168         (ie, the method is static).
26169
26170         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
26171         value types returned from functions when we need to invoke a
26172         method on the sturcture.
26173
26174
26175 2001-10-11  Ravi Pratap  <ravi@ximian.com>
26176
26177         * class.cs (TypeContainer::DefineType): Method to actually do the business of
26178         defining the type in the Modulebuilder or Typebuilder. This is to take
26179         care of nested types which need to be defined on the TypeBuilder using
26180         DefineNestedMethod.
26181
26182         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
26183         methods in RootContext, only ported to be part of TypeContainer.
26184
26185         (TypeContainer::GetInterfaceOrClass): Ditto.
26186
26187         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
26188
26189         * interface.cs (Interface::DefineInterface): New method. Does exactly
26190         what RootContext.CreateInterface did earlier, only it takes care of nested types 
26191         too.
26192
26193         (Interface::GetInterfaces): Move from RootContext here and port.
26194
26195         (Interface::GetInterfaceByName): Same here.
26196
26197         * rootcontext.cs (ResolveTree): Re-write.
26198
26199         (PopulateTypes): Re-write.
26200
26201         * class.cs (TypeContainer::Populate): Populate nested types too.
26202         (TypeContainer::Emit): Emit nested members too.
26203
26204         * typemanager.cs (AddUserType): Do not make use of the FullName property,
26205         instead just use the name argument passed in as it is already fully
26206         qualified.
26207
26208         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
26209         to TypeContainer mapping to see if a type is user-defined.
26210
26211         * class.cs (TypeContainer::CloseType): Implement. 
26212
26213         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
26214         the default constructor.
26215
26216         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
26217         twice.
26218
26219         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
26220
26221         * interface.cs (CloseType): Create the type here.
26222
26223         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
26224         the hierarchy.
26225
26226         Remove all the methods which are now in TypeContainer.
26227
26228 2001-10-10  Ravi Pratap  <ravi@ximian.com>
26229
26230         * delegate.cs (Define): Re-write bits to define the delegate
26231         correctly.
26232
26233 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
26234
26235         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
26236
26237         * expression.cs (ImplicitReferenceConversion): handle null as well
26238         as a source to convert to any reference type.
26239
26240         * statement.cs (Return): Perform any implicit conversions to
26241         expected return type.  
26242
26243         Validate use of return statement.  
26244
26245         * codegen.cs (EmitContext): Pass the expected return type here.
26246
26247         * class.cs (Method, Constructor, Property): Pass expected return
26248         type to EmitContext.
26249
26250 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
26251
26252         * expression.cs: Make DoResolve take an EmitContext instead of a
26253         TypeContainer.
26254
26255         Replaced `l' and `location' for `loc', for consistency.
26256
26257         (Error, Warning): Remove unneeded Tc argument.
26258
26259         * assign.cs, literal.cs, constant.cs: Update to new calling
26260         convention. 
26261
26262         * codegen.cs: EmitContext now contains a flag indicating whether
26263         code is being generated in a static method or not.
26264
26265         * cs-parser.jay: DecomposeQI, new function that replaces the old
26266         QualifiedIdentifier.  Now we always decompose the assembled
26267         strings from qualified_identifier productions into a group of
26268         memberaccesses.
26269
26270 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
26271
26272         * rootcontext.cs: Deal with field-less struct types correctly now
26273         by passing the size option to Define Type.
26274
26275         * class.cs: Removed hack that created one static field. 
26276
26277 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26278
26279         * statement.cs: Moved most of the code generation here. 
26280
26281 2001-10-09  Ravi Pratap  <ravi@ximian.com>
26282
26283         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
26284         seem very right.
26285
26286         (ElementAccess): Remove useless bits for now - keep checks as the spec
26287         says.
26288
26289 2001-10-08  Ravi Pratap  <ravi@ximian.com>
26290
26291         * expression.cs (ElementAccess::DoResolve): Remove my crap code
26292         and start performing checks according to the spec.
26293
26294 2001-10-07  Ravi Pratap  <ravi@ximian.com>
26295
26296         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
26297         rank_specifiers instead.
26298
26299         (rank_specifiers): Change the order in which the rank specifiers are stored
26300
26301         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
26302
26303         * expression.cs (ElementAccess): Implement the LValue interface too.
26304
26305 2001-10-06  Ravi Pratap  <ravi@ximian.com>
26306
26307         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
26308         except that user defined conversions are not included.
26309
26310         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
26311         perform the conversion of the return type, if necessary.
26312
26313         (New::DoResolve): Check whether we are creating an array or an object
26314         and accordingly do the needful.
26315
26316         (New::Emit): Same here.
26317
26318         (New::DoResolve): Implement guts of array creation.
26319
26320         (New::FormLookupType): Helper function.
26321
26322 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
26323
26324         * codegen.cs: Removed most of the code generation here, and move the
26325         corresponding code generation bits to the statement classes. 
26326
26327         Added support for try/catch/finalize and throw.
26328
26329         * cs-parser.jay: Added support for try/catch/finalize.
26330
26331         * class.cs: Catch static methods having the flags override,
26332         virtual or abstract.
26333
26334         * expression.cs (UserCast): This user cast was not really doing
26335         what it was supposed to do.  Which is to be born in fully resolved
26336         state.  Parts of the resolution were being performed at Emit time! 
26337
26338         Fixed this code.
26339
26340 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26341
26342         * expression.cs: Implicity convert the result from UserCast.
26343
26344 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26345
26346         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
26347         prevented it from working correctly. 
26348
26349         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
26350         merely ConvertImplicit.
26351
26352 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
26353
26354         * typemanager.cs: Make the LookupTypeContainer function static,
26355         and not per-instance.  
26356
26357         * class.cs: Make static FindMembers (the one that takes a Type
26358         argument). 
26359
26360         * codegen.cs: Add EmitForeach here.
26361
26362         * cs-parser.jay: Make foreach a toplevel object instead of the
26363         inline expansion, as we need to perform semantic analysis on it. 
26364
26365 2001-10-05  Ravi Pratap  <ravi@ximian.com>
26366
26367         * expression.cs (Expression::ImplicitUserConversion): Rename to
26368         UserDefinedConversion.
26369
26370         (Expression::UserDefinedConversion): Take an extra argument specifying 
26371         whether we look for explicit user conversions too.
26372
26373         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
26374
26375         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
26376
26377         (ExplicitUserConversion): Make it a call to UserDefinedConversion
26378         with the appropriate arguments.
26379
26380         * cs-parser.jay (cast_expression): Record location too.
26381
26382         * expression.cs (Cast): Record location info.
26383
26384         (Expression::ConvertExplicit): Take location argument.
26385
26386         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
26387         to determine if we are doing explicit conversions.
26388
26389         (UserCast::Emit): Update accordingly.
26390
26391         (Expression::ConvertExplicit): Report an error if everything fails.
26392
26393         * ../errors/cs0030.cs : Add.
26394
26395 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
26396
26397         * modifiers.cs: If the ABSTRACT keyword is present, also set the
26398         virtual and newslot bits. 
26399
26400         * class.cs (TypeContainer::RegisterRequiredImplementations):
26401         Record methods we need.
26402
26403         (TypeContainer::MakeKey): Helper function to make keys for
26404         MethodBases, since the Methodbase key is useless.
26405
26406         (TypeContainer::Populate): Call RegisterRequiredImplementations
26407         before defining the methods.   
26408
26409         Create a mapping for method_builders_to_methods ahead of time
26410         instead of inside a tight loop.
26411
26412         (::RequireMethods):  Accept an object as the data to set into the
26413         hashtable so we can report interface vs abstract method mismatch.
26414
26415 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26416
26417         * report.cs: Make all of it static.
26418
26419         * rootcontext.cs: Drop object_type and value_type computations, as
26420         we have those in the TypeManager anyways.
26421
26422         Drop report instance variable too, now it is a global.
26423
26424         * driver.cs: Use try/catch on command line handling.
26425
26426         Add --probe option to debug the error reporting system with a test
26427         suite. 
26428
26429         * report.cs: Add support for exiting program when a probe
26430         condition is reached.
26431
26432 2001-10-03  Ravi Pratap  <ravi@ximian.com>
26433
26434         * expression.cs (Binary::DoNumericPromotions): Fix the case when
26435         we do a forcible conversion regardless of type, to check if 
26436         ForceConversion returns a null.
26437
26438         (Binary::error19): Use location to report error.
26439
26440         (Unary::error23): Use location here too.
26441
26442         * ../errors/cs0019.cs : Check in.
26443
26444         * ../errors/cs0023.cs : Check in.
26445
26446         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
26447         case of a non-null MethodInfo object with a length of 0 !
26448
26449         (Binary::ResolveOperator): Flag error if overload resolution fails to find
26450         an applicable member - according to the spec :-)
26451         Also fix logic to find members in base types.
26452
26453         (Unary::ResolveOperator): Same here.
26454
26455         (Unary::report23): Change name to error23 and make first argument a TypeContainer
26456         as I was getting thoroughly confused between this and error19 :-)
26457
26458         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
26459         (::FindMostEncompassedType): Implement.
26460         (::FindMostEncompassingType): Implement.
26461         (::StandardConversionExists): Implement.
26462
26463         (UserImplicitCast): Re-vamp. We now need info about most specific
26464         source and target types so that we can do the necessary conversions.
26465
26466         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
26467         mathematical union with no duplicates.
26468
26469 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
26470
26471         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
26472         in order from base classes to child classes, so that we can in
26473         child classes look up in our parent for method names and
26474         attributes (required for handling abstract, virtual, new, override
26475         constructs: we need to instrospect our base class, and if we dont
26476         populate the classes in order, the introspection might be
26477         incorrect.  For example, a method could query its parent before
26478         the parent has any methods and would determine that the parent has
26479         no abstract methods (while it could have had them)).
26480
26481         (RootContext::CreateType): Record the order in which we define the
26482         classes.
26483
26484 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
26485
26486         * class.cs (TypeContainer::Populate): Also method definitions can
26487         fail now, keep track of this.
26488
26489         (TypeContainer::FindMembers): Implement support for
26490         DeclaredOnly/noDeclaredOnly flag.
26491
26492         (Constructor::Emit) Return the ConstructorBuilder.
26493
26494         (Method::Emit) Return the MethodBuilder. 
26495         Check for abstract or virtual methods to be public.
26496
26497         * rootcontext.cs (RootContext::CreateType): Register all the
26498         abstract methods required for the class to be complete and the
26499         interface methods that must be implemented. 
26500
26501         * cs-parser.jay: Report error 501 (method requires body if it is
26502         not marked abstract or extern).
26503
26504         * expression.cs (TypeOf::Emit): Implement.
26505
26506         * typemanager.cs: runtime_handle_type, new global type.
26507
26508         * class.cs (Property::Emit): Generate code for properties.
26509
26510 2001-10-02  Ravi Pratap  <ravi@ximian.com>
26511
26512         * expression.cs (Unary::ResolveOperator): Find operators on base type
26513         too - we now conform exactly to the spec.
26514
26515         (Binary::ResolveOperator): Same here.
26516
26517         * class.cs (Operator::Define): Fix minor quirk in the tests.
26518
26519         * ../errors/cs0215.cs : Added.
26520
26521         * ../errors/cs0556.cs : Added.
26522
26523         * ../errors/cs0555.cs : Added.
26524
26525 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26526
26527         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
26528         single integer which is really efficient
26529
26530 2001-10-01  Ravi Pratap  <ravi@ximian.com>
26531
26532         *  expression.cs (Expression::ImplicitUserConversion): Use location
26533         even in the case when we are examining True operators.
26534  
26535         * class.cs (Operator::Define): Perform extensive checks to conform
26536         with the rules for operator overloading in the spec.
26537
26538         * expression.cs (Expression::ImplicitReferenceConversion): Implement
26539         some of the other conversions mentioned in the spec.
26540
26541         * typemanager.cs (array_type): New static member for the System.Array built-in
26542         type.
26543
26544         (cloneable_interface): For System.ICloneable interface.
26545
26546         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
26547         we start resolving the tree and populating types.
26548
26549         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
26550  
26551 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
26552
26553         * expression.cs (Expression::ExprClassFromMemberInfo,
26554         Expression::Literalize): Create literal expressions from
26555         FieldInfos which are literals.
26556
26557         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
26558         type casts, because they were wrong.  The test suite in tests
26559         caught these ones.
26560
26561         (ImplicitNumericConversion): ushort to ulong requires a widening
26562         cast. 
26563
26564         Int32 constant to long requires widening cast as well.
26565
26566         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
26567         for integers because the type on the stack is not i4.
26568
26569 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
26570
26571         * expression.cs (report118): require location argument. 
26572
26573         * parameter.cs: Do not dereference potential null value.
26574
26575         * class.cs: Catch methods that lack the `new' keyword when
26576         overriding a name.  Report warnings when `new' is used without
26577         anything being there to override.
26578
26579         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
26580
26581         * class.cs: Only add constructor to hashtable if it is non-null
26582         (as now constructors can fail on define).
26583
26584         (TypeManager, Class, Struct): Take location arguments.
26585
26586         Catch field instance initialization in structs as errors.
26587
26588         accepting_filter: a new filter for FindMembers that is static so
26589         that we dont create an instance per invocation.
26590
26591         (Constructor::Define): Catch errors where a struct constructor is
26592         parameterless 
26593
26594         * cs-parser.jay: Pass location information for various new
26595         constructs. 
26596
26597         * delegate.cs (Delegate): take a location argument.
26598
26599         * driver.cs: Do not call EmitCode if there were problesm in the
26600         Definition of the types, as many Builders wont be there. 
26601
26602         * decl.cs (Decl::Decl): Require a location argument.
26603
26604         * cs-tokenizer.cs: Handle properly hex constants that can not fit
26605         into integers, and find the most appropiate integer for it.
26606
26607         * literal.cs: Implement ULongLiteral.
26608
26609         * rootcontext.cs: Provide better information about the location of
26610         failure when CreateType fails.
26611
26612 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
26613
26614         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
26615         as well.
26616
26617         * expression.cs (Binary::CheckShiftArguments): Add missing type
26618         computation.
26619         (Binary::ResolveOperator): Add type to the logical and and logical
26620         or, Bitwise And/Or and Exclusive Or code paths, it was missing
26621         before.
26622
26623         (Binary::DoNumericPromotions): In the case where either argument
26624         is ulong (and most signed types combined with ulong cause an
26625         error) perform implicit integer constant conversions as well.
26626
26627 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26628
26629         * expression.cs (UserImplicitCast): Method should always be
26630         non-null. 
26631         (Invocation::BetterConversion): Simplified test for IntLiteral.
26632
26633         (Expression::ImplicitNumericConversion): Split this routine out.
26634         Put the code that performs implicit constant integer conversions
26635         here. 
26636
26637         (Expression::Resolve): Become a wrapper around DoResolve so we can
26638         check eclass and type being set after resolve.
26639
26640         (Invocation::Badness): Remove this dead function
26641
26642         (Binary::ResolveOperator): Do not compute the expensive argumnets
26643         unless we have a union for it.
26644
26645         (Probe::Emit): Is needs to do an isinst and then
26646         compare against null.
26647
26648         (::CanConvert): Added Location argument.  If the Location argument
26649         is null (Location.Null), then we do not report errors.  This is
26650         used by the `probe' mechanism of the Explicit conversion.  We do
26651         not want to generate an error for something that the user
26652         explicitly requested to be casted.  But the pipeline for an
26653         explicit cast first tests for potential implicit casts.
26654
26655         So for now, if the Location is null, it means `Probe only' to
26656         avoid adding another argument.   Might have to revise this
26657         strategy later.
26658
26659         (ClassCast): New class used to type cast objects into arbitrary
26660         classes (used in Explicit Reference Conversions).
26661
26662         Implement `as' as well.
26663
26664         Reverted all the patches from Ravi below: they were broken:
26665
26666                 * The use of `level' as a mechanism to stop recursive
26667                   invocations is wrong.  That was there just to catch the
26668                   bug with a strack trace but not as a way of addressing
26669                   the problem.
26670
26671                   To fix the problem we have to *understand* what is going
26672                   on and the interactions and come up with a plan, not
26673                   just get things going.
26674
26675                 * The use of the type conversion cache that I proposed
26676                   last night had an open topic: How does this work across
26677                   protection domains.  A user defined conversion might not
26678                   be public in the location where we are applying the
26679                   conversion, a different conversion might be selected
26680                   (ie, private A->B (better) but public B->A (worse),
26681                   inside A, A->B applies, but outside it, B->A will
26682                   apply).
26683
26684                 * On top of that (ie, even if the above is solved),
26685                   conversions in a cache need to be abstract.  Ie, `To
26686                   convert from an Int to a Short use an OpcodeCast', not
26687                   `To convert from an Int to a Short use the OpcodeCast on
26688                   the variable 5' (which is what this patch was doing).
26689
26690 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26691
26692         * expression.cs (Invocation::ConversionExists): Re-write to use
26693         the conversion cache
26694
26695         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
26696         cache all conversions done, not just user-defined ones.
26697
26698         (Invocation::BetterConversion): The real culprit. Use ConversionExists
26699         to determine if a conversion exists instead of acutually trying to 
26700         perform the conversion. It's faster too.
26701
26702         (Expression::ConvertExplicit): Modify to use ConversionExists to check
26703         and only then attempt the implicit conversion.
26704
26705 2001-09-28  Ravi Pratap  <ravi@ximian.com>
26706
26707         * expression.cs (ConvertImplicit): Use a cache for conversions
26708         already found. Check level of recursion and bail out if necessary.
26709
26710 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
26711
26712         * typemanager.cs (string_concat_string_string, string_concat_object_object):
26713         Export standard methods that we expect for string operations.
26714
26715         * statement.cs (Block::UsageWarning): Track usage of variables and
26716         report the errors for not used variables.
26717
26718         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
26719         operator. 
26720
26721 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26722
26723         * codegen.cs: remove unnneded code 
26724
26725         * expression.cs: Removed BuiltinTypeAccess class
26726
26727         Fix the order in which implicit conversions are
26728         done.  
26729
26730         The previous fixed dropped support for boxed conversions (adding a
26731         test to the test suite now)
26732
26733         (UserImplicitCast::CanConvert): Remove test for source being null,
26734         that code is broken.  We should not feed a null to begin with, if
26735         we do, then we should track the bug where the problem originates
26736         and not try to cover it up here.
26737
26738         Return a resolved expression of type UserImplicitCast on success
26739         rather than true/false.  Ravi: this is what I was talking about,
26740         the pattern is to use a static method as a "constructor" for
26741         objects. 
26742
26743         Also, do not create arguments until the very last minute,
26744         otherwise we always create the arguments even for lookups that
26745         will never be performed. 
26746
26747         (UserImplicitCast::Resolve): Eliminate, objects of type
26748         UserImplicitCast are born in a fully resolved state. 
26749
26750         * typemanager.cs (InitCoreTypes): Init also value_type
26751         (System.ValueType). 
26752
26753         * expression.cs (Cast::Resolve): First resolve the child expression.
26754
26755         (LValue): Add new method AddressOf to be used by
26756         the `&' operator.  
26757
26758         Change the argument of Store to take an EmitContext instead of an
26759         ILGenerator, because things like FieldExpr need to be able to call
26760         their children expression to generate the instance code. 
26761
26762         (Expression::Error, Expression::Warning): Sugar functions for
26763         reporting errors.
26764
26765         (Expression::MemberLookup): Accept a TypeContainer instead of a
26766         Report as the first argument.
26767
26768         (Expression::ResolvePrimary): Killed.  I still want to improve
26769         this as currently the code is just not right.
26770
26771         (Expression::ResolveMemberAccess): Simplify, but it is still
26772         wrong. 
26773
26774         (Unary::Resolve): Catch errors in AddressOf operators.
26775
26776         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
26777         index to a byte for the short-version, or the compiler will choose
26778         the wrong Emit call, which generates the wrong data.
26779
26780         (ParameterReference::Emit, ::Store): same.
26781
26782         (FieldExpr::AddressOf): Implement.
26783
26784         * typemanager.cs: TypeManager: made public variable instead of
26785         property.
26786
26787         * driver.cs: document --fatal.
26788
26789         * report.cs (ErrorMessage, WarningMessage): new names for the old
26790         Error and Warning classes.
26791
26792         * cs-parser.jay (member_access): Turn built-in access to types
26793         into a normal simplename
26794
26795 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26796
26797         * expression.cs (Invocation::BetterConversion): Fix to cope
26798         with q being null, since this was introducing a bug.
26799
26800         * expression.cs (ConvertImplicit): Do built-in conversions first.
26801
26802 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26803
26804         * expression.cs (UserImplicitCast::Resolve): Fix bug.
26805
26806 2001-09-27  Ravi Pratap  <ravi@ximian.com>
26807
26808         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
26809         I had introduced long ago (what's new ?).
26810
26811         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
26812         the work of all the checking. 
26813         (ConvertImplicit): Call CanConvert and only then create object if necessary.
26814         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
26815
26816         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
26817         that is the right way. 
26818
26819         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
26820         overloading resolution. Use everywhere instead of cutting and pasting code.
26821
26822         (Binary::ResolveOperator): Use MakeUnionSet.
26823
26824         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
26825         we have to convert to bool types. Not complete yet.
26826
26827 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
26828
26829         * typemanager.cs (TypeManager::CSharpName): support ushort.
26830
26831         * expression.cs (Expression::TryImplicitIntConversion): Attempts
26832         to provide an expression that performsn an implicit constant int
26833         conversion (section 6.1.6).
26834         (Expression::ConvertImplicitRequired): Reworked to include
26835         implicit constant expression conversions.
26836
26837         (Expression::ConvertNumericExplicit): Finished.
26838
26839         (Invocation::Emit): If InstanceExpression is null, then it means
26840         that we perform a call on this.
26841
26842 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26843
26844         * expression.cs (Unary::Emit): Remove some dead code.
26845         (Probe): Implement Resolve and Emit for `is'.
26846         (Expression::ConvertImplicitRequired): Attempt to do constant
26847         expression conversions here.  Maybe should be moved to
26848         ConvertImplicit, but I am not sure.
26849         (Expression::ImplicitLongConstantConversionPossible,
26850         Expression::ImplicitIntConstantConversionPossible): New functions
26851         that tell whether is it possible to apply an implicit constant
26852         expression conversion.
26853
26854         (ConvertNumericExplicit): Started work on explicit numeric
26855         conversions.
26856
26857         * cs-parser.jay: Update operator constants.
26858
26859         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
26860         (Parameters::GetSignature): Hook up VerifyArgs here.
26861         (Parameters::VerifyArgs): Verifies that no two arguments have the
26862         same name. 
26863
26864         * class.cs (Operator): Update the operator names to reflect the
26865         ones that the spec expects (as we are just stringizing the
26866         operator names).
26867
26868         * expression.cs (Unary::ResolveOperator): Fix bug: Use
26869         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
26870         previous usage did only work for our methods.
26871         (Expression::ConvertImplicit): Handle decimal implicit numeric
26872         conversions as well.
26873         (Expression::InternalTypeConstructor): Used to invoke constructors
26874         on internal types for default promotions.
26875
26876         (Unary::Emit): Implement special handling for the pre/post
26877         increment/decrement for overloaded operators, as they need to have
26878         the same semantics as the other operators.
26879
26880         (Binary::ResolveOperator): ditto.
26881         (Invocation::ConversionExists): ditto.
26882         (UserImplicitCast::Resolve): ditto.
26883
26884 2001-09-26  Ravi Pratap  <ravi@ximian.com>
26885
26886         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
26887         operator, return after emitting body. Regression tests pass again !
26888
26889         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
26890         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
26891         (Invocation::OverloadResolve): Ditto.
26892         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
26893
26894         * everywhere : update calls to the above methods accordingly.
26895
26896 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
26897
26898         * assign.cs (Assign): Make it inherit from ExpressionStatement.
26899
26900         * expression.cs (ExpressionStatement): New base class used for
26901         expressions that can appear in statements, so that we can provide
26902         an alternate path to generate expression that do not leave a value
26903         on the stack.
26904
26905         (Expression::Emit, and all the derivatives): We no longer return
26906         whether a value is left on the stack or not.  Every expression
26907         after being emitted leaves a single value on the stack.
26908
26909         * codegen.cs (EmitContext::EmitStatementExpression): Use the
26910         facilties of ExpressionStatement if possible.
26911
26912         * cs-parser.jay: Update statement_expression.
26913
26914 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
26915
26916         * driver.cs: Change the wording of message
26917
26918 2001-09-25  Ravi Pratap  <ravi@ximian.com>
26919
26920         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
26921         the type of the expression to the return type of the method if
26922         we have an overloaded operator match ! The regression tests pass again !
26923         (Unary::ResolveOperator): Ditto.
26924
26925         * expression.cs (Invocation::ConversionExists): Correct the member lookup
26926         to find "op_Implicit", not "implicit" ;-)
26927         (UserImplicitCast): New class to take care of user-defined implicit conversions.
26928         (ConvertImplicit, ForceConversion): Take TypeContainer argument
26929
26930         * everywhere : Correct calls to the above accordingly.
26931
26932         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
26933         (ConvertImplicit): Do user-defined conversion if it exists.
26934
26935 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
26936
26937         * assign.cs: track location.
26938         (Resolve): Use implicit conversions on assignment.
26939
26940         * literal.cs: Oops.  Not good, Emit of short access values should
26941         pass (Bytes) or the wrong argument will be selected.
26942
26943         * expression.cs (Unary::Emit): Emit code for -expr.
26944
26945         (Unary::ResolveOperator): Handle `Substract' for non-constants
26946         (substract from zero from the non-constants).
26947         Deal with Doubles as well. 
26948
26949         (Expression::ConvertImplicitRequired): New routine that reports an
26950         error if no implicit conversion exists. 
26951
26952         (Invocation::OverloadResolve): Store the converted implicit
26953         expressions if we make them
26954
26955 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26956
26957         * class.cs (ConstructorInitializer): Take a Location argument.
26958         (ConstructorBaseInitializer): Same here.
26959         (ConstructorThisInitializer): Same here.
26960
26961         * cs-parser.jay : Update all calls accordingly.
26962
26963         * expression.cs (Unary, Binary, New): Take location argument.
26964         Update accordingly everywhere.
26965
26966         * cs-parser.jay : Update all calls to the above to take a location
26967         argument.
26968
26969         * class.cs : Ditto.
26970
26971 2001-09-24  Ravi Pratap  <ravi@ximian.com>
26972
26973         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
26974         (Invocation::BetterConversion): Same here
26975         (Invocation::ConversionExists): Ditto.
26976
26977         (Invocation::ConversionExists): Implement.
26978
26979 2001-09-22  Ravi Pratap  <ravi@ximian.com>
26980
26981         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
26982         Also take an additional TypeContainer argument.
26983
26984         * All over : Pass in TypeContainer as argument to OverloadResolve.
26985
26986         * typemanager.cs (CSharpName): Update to check for the string type and return
26987         that too.
26988
26989         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
26990         a given method.
26991
26992 2001-09-21  Ravi Pratap  <ravi@ximian.com>
26993
26994         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
26995         (Invocation::BetterFunction): Implement.
26996         (Invocation::BetterConversion): Implement.
26997         (Invocation::ConversionExists): Skeleton, no implementation yet.
26998
26999         Okay, things work fine !
27000
27001 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
27002
27003         * typemanager.cs: declare and load enum_type, delegate_type and
27004         void_type. 
27005
27006         * expression.cs (Expression::Emit): Now emit returns a value that
27007         tells whether a value is left on the stack or not.  This strategy
27008         might be reveted tomorrow with a mechanism that would address
27009         multiple assignments.
27010         (Expression::report118): Utility routine to report mismatches on
27011         the ExprClass.
27012
27013         (Unary::Report23): Report impossible type/operator combination
27014         utility function.
27015
27016         (Unary::IsIncrementableNumber): Whether the type can be
27017         incremented or decremented with add.
27018         (Unary::ResolveOperator): Also allow enumerations to be bitwise
27019         complemented. 
27020         (Unary::ResolveOperator): Implement ++, !, ~,
27021
27022         (Invocation::Emit): Deal with new Emit convetion.
27023
27024         * All Expression derivatives: Updated their Emit method to return
27025         whether they leave values on the stack or not.
27026
27027         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
27028         stack for expressions that are statements. 
27029
27030 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
27031
27032         * expression.cs (LValue): New interface.  Must be implemented by
27033         LValue objects.
27034         (LocalVariableReference, ParameterReference, FieldExpr): Implement
27035         LValue interface.
27036
27037         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
27038         interface for generating code, simplifies the code.
27039
27040 2001-09-20  Ravi Pratap  <ravi@ximian.com>
27041
27042         * expression.cs (everywhere): Comment out return statements in ::Resolve
27043         methods to avoid the warnings.
27044
27045 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
27046
27047         * driver.cs (parse): Report error 2001 if we can not open the
27048         source file.
27049
27050         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
27051         not resolve it.
27052
27053         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
27054         object. 
27055
27056         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
27057         otherwise nested blocks end up with the same index.
27058
27059         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
27060
27061         * expression.cs:  Instead of having FIXMEs in the Resolve
27062         functions, throw exceptions so it is obvious that we are facing a
27063         bug. 
27064
27065         * cs-parser.jay (invocation_expression): Pass Location information.
27066
27067         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
27068         Use a basename for those routines because .NET does not like paths
27069         on them. 
27070
27071         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
27072         already defined.
27073
27074 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
27075
27076         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
27077         are loading the correct data types (throws an exception if not).
27078         (TypeManager::InitCoreTypes): Use CoreLookupType
27079
27080         * expression.cs (Unary::ResolveOperator): return the child
27081         expression for expressions which are just +expr.
27082         (Unary::ResolveOperator): Return negative literals for -LITERAL
27083         expressions (otherwise they are Unary {Literal}).
27084         (Invocation::Badness): Take into account `Implicit constant
27085         expression conversions'.
27086
27087         * literal.cs (LongLiteral): Implement long literal class.
27088         (IntLiteral): export the `Value' of the intliteral. 
27089
27090 2001-09-19  Ravi Pratap  <ravi@ximian.com>
27091
27092         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
27093
27094         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
27095         instead of 'Operator'
27096
27097         * expression.cs (Binary::ResolveOperator): Update accordingly.
27098         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
27099         and 'Minus'
27100
27101         * cs-parser.jay (unary_expression): Update to use the new names.
27102
27103         * gen-treedump.cs (GetUnary): Same here.
27104
27105         * expression.cs (Unary::Resolve): Implement.
27106         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
27107         operators are found instead of making noise ;-)
27108         (Unary::ResolveOperator): New method to do precisely the same thing which
27109         Binary::ResolveOperator does for Binary expressions.
27110         (Unary.method, .Arguments): Add.
27111         (Unary::OperName): Implement.   
27112         (Unary::ForceConversion): Copy and Paste !
27113
27114         * class.cs (Operator::Define): Fix a small bug for the case when we have 
27115         a unary operator.
27116
27117         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
27118         for the inbuilt operators. Only overloading works for now ;-)
27119
27120 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
27121
27122         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
27123         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
27124
27125         * expression.cs (This::Emit): Implement. 
27126         (This::Resolve): Implement.
27127         (TypeOf:Resolve): Implement.
27128         (Expression::ResolveSimpleName): Add an implicit this to instance
27129         field references. 
27130         (MemberAccess::Resolve): Deal with Parameters and Fields. 
27131         Bind instance variable to Field expressions.
27132         (FieldExpr::Instance): New field used to track the expression that
27133         represents the object instance.
27134         (FieldExpr::Resolve): Track potential errors from MemberLookup not
27135         binding 
27136         (FieldExpr::Emit): Implement.
27137
27138         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
27139         the last instruction contains a return opcode to avoid generating
27140         the last `ret' instruction (this generates correct code, and it is
27141         nice to pass the peverify output).
27142
27143         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
27144         initializer for static and instance variables.
27145         (Constructor::Emit): Allow initializer to be null in the case of
27146         static constructors.  Only emit initializer for instance
27147         constructors. 
27148
27149         (TypeContainer::FindMembers): Return a null array if there are no
27150         matches.
27151
27152         Also fix the code for the MemberTypes.Method branch, as it was not
27153         scanning that for operators (or tried to access null variables before).
27154
27155         * assign.cs (Assign::Emit): Handle instance and static fields. 
27156
27157         * TODO: Updated.
27158
27159         * driver.cs: Stop compilation if there are parse errors.
27160
27161         * cs-parser.jay (constructor_declaration): Provide default base
27162         initializer for non-static constructors.
27163         (constructor_declarator): Do not provide a default base
27164         initializers if none was specified.
27165         Catch the fact that constructors should not have parameters.
27166
27167         * class.cs: Do not emit parent class initializers for static
27168         constructors, that should be flagged as an error.
27169
27170 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27171
27172         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
27173         Move back code into TypeContainer::Populate.
27174
27175 2001-09-18  Ravi Pratap  <ravi@ximian.com>
27176
27177         * class.cs (TypeContainer::AddConstructor): Fix the check to
27178         compare against Name, not Basename. 
27179         (Operator::OpType): Change Plus and Minus to Add and Subtract.
27180
27181         * cs-parser.jay : Update accordingly.
27182
27183         * class.cs (TypeContainer::FindMembers): For the case where we are searching
27184         for methods, don't forget to look into the operators too.
27185         (RegisterMethodBuilder): Helper method to take care of this for
27186         methods, constructors and operators.
27187         (Operator::Define): Completely revamp.
27188         (Operator.OperatorMethod, MethodName): New fields.
27189         (TypeContainer::Populate): Move the registering of builders into
27190         RegisterMethodBuilder.
27191         (Operator::Emit): Re-write.
27192
27193         * expression.cs (Binary::Emit): Comment out code path to emit method
27194         invocation stuff for the case when we have a user defined operator. I am
27195         just not able to get it right !
27196
27197 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27198
27199         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
27200         argument. 
27201
27202         (Expression::MemberLookup): Provide a version that allows to
27203         specify the MemberTypes and BindingFlags. 
27204
27205         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
27206         so it was not fetching variable information from outer blocks.
27207
27208         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
27209         Beforefieldinit as it was buggy.
27210
27211         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
27212         that Ravi put here.  
27213
27214         * class.cs (Constructor::Emit): Only emit if block is not null.
27215         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
27216         deal with this by semantically definining it as if the user had
27217         done it.
27218
27219         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
27220         constructors as we now "emit" them at a higher level.
27221
27222         (TypeContainer::DefineDefaultConstructor): Used to define the
27223         default constructors if none was provided.
27224
27225         (ConstructorInitializer): Add methods Resolve and Emit. 
27226
27227         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
27228
27229 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27230
27231         * class.cs (TypeContainer::EmitDefaultConstructor): Register
27232         the default constructor builder with our hashtable for methodbuilders
27233         to methodcores.
27234
27235         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
27236         and argument_count is 0 in which case we have a match.
27237         (Binary::ResolveOperator): More null checking and miscellaneous coding
27238         style cleanup.
27239
27240 2001-09-17  Ravi Pratap  <ravi@ximian.com>
27241
27242         * rootcontext.cs (IsNameSpace): Compare against null.
27243
27244         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
27245
27246         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
27247         and Unary::Operator.
27248
27249         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
27250         accordingly.
27251
27252         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
27253         we have overloaded operators.
27254         (Binary::ResolveOperator): Implement the part which does the operator overload
27255         resolution.
27256
27257         * class.cs (Operator::Emit): Implement.
27258         (TypeContainer::Emit): Emit the operators we have too.
27259
27260         * expression.cs (Binary::Emit): Update to emit the appropriate code for
27261         the case when we have a user-defined operator.
27262
27263 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
27264
27265         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
27266
27267 2001-09-16  Ravi Pratap  <ravi@ximian.com>
27268
27269         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
27270         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
27271         (Constructor::Emit): Implement.
27272         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
27273         if we have no work to do. 
27274         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
27275         Emit method.
27276
27277         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
27278         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
27279
27280         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
27281         of parent.parent.
27282
27283 2001-09-15  Ravi Pratap  <ravi@ximian.com>
27284
27285         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
27286         in the source.
27287         (Tree::RecordNamespace): Method to do what the name says ;-)
27288         (Tree::Namespaces): Property to get at the namespaces hashtable.
27289
27290         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
27291         keep track.
27292
27293         * rootcontext.cs (IsNamespace): Fixed it :-)
27294
27295 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27296
27297         * class.cs (TypeContainer::FindMembers): Add support for
27298         constructors. 
27299         (MethodCore): New class that encapsulates both the shared aspects
27300         of a Constructor and a Method.  
27301         (Method, Constructor): Factored pieces into MethodCore.
27302
27303         * driver.cs: Added --fatal which makes errors throw exceptions.
27304         Load System assembly as well as part of the standard library.
27305
27306         * report.cs: Allow throwing exceptions on errors for debugging.
27307
27308         * modifiers.cs: Do not use `parent', instead use the real type
27309         container to evaluate permission settings.
27310
27311         * class.cs: Put Ravi's patch back in.  He is right, and we will
27312         have to cope with the
27313
27314 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27315
27316         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
27317         FamORAssem, not FamANDAssem.
27318
27319 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
27320
27321         * driver.cs: Added --parse option that only parses its input files
27322         and terminates.
27323
27324         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
27325         incorrect.  IsTopLevel is not used to tell whether an object is
27326         root_types or not (that can be achieved by testing this ==
27327         root_types).  But to see if this is a top-level *class* (not
27328         necessarly our "toplevel" container). 
27329
27330 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27331
27332         * enum.cs (Enum::Define): Modify to call the Lookup method on the
27333         parent instead of a direct call to GetType.
27334
27335 2001-09-14  Ravi Pratap  <ravi@ximian.com>
27336
27337         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
27338         Modifiers.TypeAttr. This should just be a call to that method.
27339
27340         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
27341         object so that we can determine if we are top-level or not.
27342
27343         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
27344         TypeContainer too.
27345
27346         * enum.cs (Enum::Define): Ditto.
27347
27348         * modifiers.cs (FieldAttr): Re-write.
27349
27350         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
27351         (TypeContainer::HaveStaticConstructor): New property to provide access
27352         to precisely that info.
27353
27354         * modifiers.cs (MethodAttr): Re-write.
27355         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
27356
27357         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
27358         of top-level types as claimed.
27359
27360 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27361
27362         * expression.cs (MemberLookup): Fruitless attempt to lookup
27363         constructors.  Maybe I need to emit default constructors?  That
27364         might be it (currently .NET emits this for me automatically).
27365         (Invocation::OverloadResolve): Cope with Arguments == null.
27366         (Invocation::EmitArguments): new function, shared by the new
27367         constructor and us.
27368         (Invocation::Emit): Handle static and instance methods.  Emit
27369         proper call instruction for virtual or non-virtual invocations.
27370         (New::Emit): Implement.
27371         (New::Resolve): Implement.
27372         (MemberAccess:Resolve): Implement.
27373         (MethodGroupExpr::InstanceExpression): used conforming to the spec
27374         to track instances.
27375         (FieldExpr::Resolve): Set type.
27376
27377         * support.cs: Handle empty arguments.
27378                 
27379         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
27380         SimpleLookup): Auxiliary routines to help parse a qualifier
27381         identifier.  
27382
27383         Update qualifier_identifier rule.
27384
27385         * codegen.cs: Removed debugging messages.
27386
27387         * class.cs: Make this a global thing, this acts just as a "key" to
27388         objects that we might have around.
27389
27390         (Populate): Only initialize method_builders_to_methods once.
27391
27392         * expression.cs (PropertyExpr): Initialize type from the
27393         PropertyType. 
27394
27395         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
27396         Resolve pattern.  Attempt to implicitly convert value to boolean.
27397         Emit code.
27398
27399         * expression.cs: Set the type for the int32/int32 argument case.
27400         (Binary::ResolveOperator): Set the return type to boolean for
27401         comparission operators
27402
27403         * typemanager.cs: Remove debugging print code.
27404
27405         (Invocation::Resolve): resolve type.
27406
27407         * class.cs: Allocate a MemberInfo of the correct size, as the code
27408         elsewhere depends on the test to reflect the correct contents.
27409
27410         (Method::) Keep track of parameters, due to System.Reflection holes
27411
27412         (TypeContainer::Populate): Keep track of MethodBuilders to Method
27413         mapping here.
27414
27415         (TypeContainer::FindMembers): Use ArrayList and then copy an array
27416         of the exact size and return that.
27417
27418         (Class::LookupMethodByBuilder): New function that maps
27419         MethodBuilders to its methods.  Required to locate the information
27420         on methods because System.Reflection bit us again.
27421
27422         * support.cs: New file, contains an interface ParameterData and
27423         two implementations: ReflectionParameters and InternalParameters
27424         used to access Parameter information.  We will need to grow this
27425         as required.
27426
27427         * expression.cs (Invocation::GetParameterData): implement a cache
27428         and a wrapper around the ParameterData creation for methods. 
27429         (Invocation::OverloadResolve): Use new code.
27430
27431 2001-09-13  Ravi Pratap  <ravi@ximian.com>
27432
27433         * class.cs (TypeContainer::EmitField): Remove and move into 
27434         (Field::Define): here and modify accordingly.
27435         (Field.FieldBuilder): New member.
27436         (TypeContainer::Populate): Update accordingly.
27437         (TypeContainer::FindMembers): Implement.
27438
27439 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
27440
27441         * statement.cs: (VariableInfo::VariableType): New field to be
27442         initialized with the full type once it is resolved. 
27443
27444 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
27445
27446         * parameter.cs (GetParameterInfo): Use a type cache to compute
27447         things only once, and to reuse this information
27448
27449         * expression.cs (LocalVariableReference::Emit): Implement.
27450         (OpcodeCast::Emit): fix.
27451
27452         (ParameterReference::Resolve): Implement.
27453         (ParameterReference::Emit): Implement.
27454
27455         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
27456         that are expressions need to stay as Expressions.
27457
27458         * typemanager.cs (CSharpName): Returns the C# name of a type if
27459         possible. 
27460
27461         * expression.cs (Expression::ConvertImplicit): New function that
27462         implements implicit type conversions.
27463
27464         (Expression::ImplicitReferenceConversion): Implements implicit
27465         reference conversions.
27466
27467         (EmptyCast): New type for transparent casts.
27468
27469         (OpcodeCast): New type for casts of types that are performed with
27470         a sequence of bytecodes.
27471
27472         (BoxedCast): New type used for casting value types into reference
27473         types.  Emits a box opcode.
27474
27475         (Binary::DoNumericPromotions): Implements numeric promotions of
27476         and computation of the Binary::Type.
27477
27478         (Binary::EmitBranchable): Optimization.
27479
27480         (Binary::Emit): Implement code emission for expressions.
27481
27482         * typemanager.cs (TypeManager): Added two new core types: sbyte
27483         and byte.
27484
27485 2001-09-12  Ravi Pratap  <ravi@ximian.com>
27486
27487         * class.cs (TypeContainer::FindMembers): Method which does exactly
27488         what Type.FindMembers does, only we don't have to use reflection. No
27489         implementation yet.
27490
27491         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
27492         typecontainer objects as we need to get at them.
27493         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
27494
27495         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
27496         typecontainer object.
27497
27498         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
27499         of just a Report object.
27500
27501 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27502
27503         * class.cs (Event::Define): Go back to using the prefixes "add_" and
27504         "remove_"
27505         (TypeContainer::Populate): Now define the delegates of the type too.
27506         (TypeContainer.Delegates): Property to access the list of delegates defined
27507         in the type.
27508
27509         * delegates.cs (Delegate::Define): Implement partially.
27510
27511         * modifiers.cs (TypeAttr): Handle more flags.
27512
27513 2001-09-11  Ravi Pratap  <ravi@ximian.com>
27514
27515         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
27516         and not <=
27517         (Operator::Define): Re-write logic to get types by using the LookupType method
27518         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
27519         (Indexer::Define): Ditto.
27520         (Event::Define): Ditto.
27521         (Property::Define): Ditto.
27522
27523 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27524
27525         * class.cs (TypeContainer::Populate): Now define operators too. 
27526         (TypeContainer.Operators): New property to access the list of operators
27527         in a type.
27528         (Operator.OperatorMethodBuilder): New member to hold the method builder
27529         for the operator we are defining.
27530         (Operator::Define): Implement.
27531
27532 2001-09-10  Ravi Pratap  <ravi@ximian.com>
27533
27534         * class.cs (Event::Define): Make the prefixes of the accessor methods
27535         addOn_ and removeOn_ 
27536
27537         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
27538         of the location being passed in too. Ideally, this should go later since all
27539         error reporting should be done through the Report object.
27540
27541         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
27542         (Populate): Iterate thru the indexers we have and define them too.
27543         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
27544         for the get and set accessors.
27545         (Indexer::Define): Implement.
27546
27547 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
27548
27549         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
27550         my previous implementation, did not work.
27551
27552         * typemanager.cs: Add a couple of missing types (the longs).
27553
27554         * literal.cs: Use TypeManager.bool_type instead of getting it.
27555
27556         * expression.cs (EventExpr): New kind of expressions.
27557         (Expressio::ExprClassFromMemberInfo): finish
27558
27559 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
27560
27561         * assign.cs: Emit stores to static fields differently.
27562
27563 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27564
27565         * Merge in changes and adjust code to tackle conflicts. Backed out my
27566         code in Assign::Resolve ;-) 
27567
27568 2001-09-08  Ravi Pratap  <ravi@ximian.com>
27569
27570         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
27571         instead Report.Error and also pass in the location.
27572         (CSharpParser::Lexer): New readonly property to return the reference
27573         to the Tokenizer object.
27574         (declare_local_variables): Use Report.Error with location instead of plain 
27575         old error.
27576         (CheckDef): Ditto.
27577
27578         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
27579         (Operator.CheckBinaryOperator): Ditto.
27580
27581         * cs-parser.jay (operator_declarator): Update accordingly.
27582
27583         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
27584         (CheckBinaryOperator): Same here.
27585
27586         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
27587         on the name without any prefixes of namespace names etc. This is because we
27588         already might have something already fully qualified like 
27589         'System.Console.WriteLine'
27590
27591         * assign.cs (Resolve): Begin implementation. Stuck ;-)
27592
27593 2001-09-07  Ravi Pratap  <ravi@ximian.com>
27594
27595         * cs-tokenizer.cs (location): Return a string which also contains
27596         the file name.
27597
27598         * expression.cs (ElementAccess): New class for expressions of the
27599         type 'element access.'
27600         (BaseAccess): New class for expressions of the type 'base access.'
27601         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
27602         respectively.
27603
27604         * cs-parser.jay (element_access): Implement action.
27605         (base_access): Implement actions.
27606         (checked_expression, unchecked_expression): Implement.
27607
27608         * cs-parser.jay (local_variable_type): Correct and implement.
27609         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
27610
27611         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
27612
27613         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
27614         name and the specifiers.
27615
27616         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
27617
27618         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
27619         making them all public ;-)
27620
27621         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
27622         class anyways.
27623
27624 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
27625
27626         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
27627         PropertyExprs.
27628         (FieldExpr, PropertyExprs): New resolved expressions.
27629         (SimpleName::MemberStaticCheck): Perform static checks for access
27630         to non-static fields on static methods. Maybe this should be
27631         generalized for MemberAccesses. 
27632         (SimpleName::ResolveSimpleName): More work on simple name
27633         resolution. 
27634
27635         * cs-parser.jay (primary_expression/qualified_identifier): track
27636         the parameter index.
27637
27638         * codegen.cs (CodeGen::Save): Catch save exception, report error.
27639         (EmitContext::EmitBoolExpression): Chain to expression generation
27640         instead of temporary hack.
27641         (::EmitStatementExpression): Put generic expression code generation.
27642
27643         * assign.cs (Assign::Emit): Implement variable assignments to
27644         local variables, parameters and fields.
27645
27646 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
27647
27648         * statement.cs (Block::GetVariableInfo): New method, returns the
27649         VariableInfo for a variable name in a block.
27650         (Block::GetVariableType): Implement in terms of GetVariableInfo
27651
27652         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
27653         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
27654
27655 2001-09-06  Ravi Pratap  <ravi@ximian.com>
27656
27657         * cs-parser.jay (operator_declaration): Continue on my quest : update
27658         to take attributes argument.
27659         (event_declaration): Ditto.
27660         (enum_declaration): Ditto.
27661         (indexer_declaration): Ditto.
27662
27663         * class.cs (Operator::Operator): Update constructor accordingly.
27664         (Event::Event): Ditto.
27665
27666         * delegate.cs (Delegate::Delegate): Same here.
27667
27668         * enum.cs (Enum::Enum): Same here.
27669
27670 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27671
27672         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
27673
27674         * ../tests/cs0658.cs : New file to demonstrate error 0658.
27675
27676         * attribute.cs (Attributes): New class to encapsulate all attributes which were
27677         being passed around as an arraylist.
27678         (Attributes::AddAttribute): Method to add attribute sections.
27679
27680         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
27681         (struct_declaration): Update accordingly.
27682         (constant_declaration): Update.
27683         (field_declaration): Update.
27684         (method_header): Update.
27685         (fixed_parameter): Update.
27686         (parameter_array): Ditto.
27687         (property_declaration): Ditto.
27688         (destructor_declaration): Ditto.
27689
27690         * class.cs (Struct::Struct): Update constructors accordingly.
27691         (Class::Class): Ditto.
27692         (Field::Field): Ditto.
27693         (Method::Method): Ditto.
27694         (Property::Property): Ditto.
27695         (TypeContainer::OptAttribute): update property's return type.
27696
27697         * interface.cs (Interface.opt_attributes): New member.
27698         (Interface::Interface): Update to take the extra Attributes argument.
27699
27700         * parameter.cs (Parameter::Parameter): Ditto.
27701
27702         * constant.cs (Constant::Constant): Ditto.
27703
27704         * interface.cs (InterfaceMemberBase): New OptAttributes field.
27705         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
27706         the attributes as a parameter.
27707         (InterfaceProperty): Update constructor call.
27708         (InterfaceEvent): Ditto.
27709         (InterfaceMethod): Ditto.
27710         (InterfaceIndexer): Ditto.
27711
27712         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
27713         pass the attributes too.
27714         (interface_event_declaration): Ditto.
27715         (interface_property_declaration): Ditto.
27716         (interface_method_declaration): Ditto.
27717         (interface_declaration): Ditto.
27718
27719 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
27720
27721         * class.cs (Method::Define): Track the "static Main" definition to
27722         create an entry point. 
27723
27724         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
27725         EntryPoint if we find it. 
27726
27727         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
27728         (EmitContext::ig): Make this variable public.
27729
27730         * driver.cs: Make the default output file be the first file name
27731         with the .exe extension.  
27732
27733         Detect empty compilations
27734
27735         Handle various kinds of output targets.  Handle --target and
27736         rename -t to --dumper.
27737
27738         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
27739         methods inherited from Expression return now an Expression.  This
27740         will is used during the tree rewriting as we resolve them during
27741         semantic analysis.
27742
27743         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
27744         the spec.  Missing entirely is the information about
27745         accessability of elements of it.
27746
27747         (Expression::ExprClassFromMemberInfo): New constructor for
27748         Expressions that creates a fully initialized Expression based on
27749         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
27750         a Type.
27751
27752         (Invocation::Resolve): Begin implementing resolution of invocations.
27753
27754         * literal.cs (StringLiteral):  Implement Emit.
27755
27756 2001-09-05  Ravi Pratap  <ravi@ximian.com>
27757
27758         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
27759         member.
27760
27761 2001-09-04  Ravi Pratap  <ravi@ximian.com>
27762
27763         * cs-parser.jay (attribute_arguments): Implement actions.
27764         (attribute): Fix bug in production. Implement action.
27765         (attribute_list): Implement.
27766         (attribute_target): Implement.
27767         (attribute_target_specifier, opt_target_specifier): Implement
27768         (CheckAttributeTarget): New method to check if the attribute target
27769         is valid.
27770         (attribute_section): Implement.
27771         (opt_attributes): Implement.
27772
27773         * attribute.cs : New file to handle attributes.
27774         (Attribute): Class to hold attribute info.
27775
27776         * cs-parser.jay (opt_attribute_target_specifier): Remove production
27777         (attribute_section): Modify production to use 2 different rules to 
27778         achieve the same thing. 1 s/r conflict down !
27779         Clean out commented, useless, non-reducing dimension_separator rules.
27780
27781         * class.cs (TypeContainer.attributes): New member to hold list
27782         of attributes for a type.
27783         (Struct::Struct): Modify to take one more argument, the attribute list.
27784         (Class::Class): Ditto.
27785         (Field::Field): Ditto.
27786         (Method::Method): Ditto.
27787         (Property::Property): Ditto.
27788
27789         * cs-parser.jay (struct_declaration): Update constructor call to
27790         pass in the attributes too.
27791         (class_declaration): Ditto.
27792         (constant_declaration): Ditto.
27793         (field_declaration): Ditto.
27794         (method_header): Ditto.
27795         (fixed_parameter): Ditto.
27796         (parameter_array): Ditto.
27797         (property_declaration): Ditto.
27798
27799         * constant.cs (Constant::Constant): Update constructor similarly.
27800         Use System.Collections.
27801
27802         * parameter.cs (Parameter::Parameter): Update as above.
27803
27804 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27805
27806         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
27807         (TypeContainer.delegates): New member to hold list of delegates.
27808
27809         * cs-parser.jay (delegate_declaration): Implement the action correctly 
27810         this time as I seem to be on crack ;-)
27811
27812 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
27813
27814         * rootcontext.cs (RootContext::IsNamespace): new function, used to
27815         tell whether an identifier represents a namespace.
27816
27817         * expression.cs (NamespaceExpr): A namespace expression, used only
27818         temporarly during expression resolution.
27819         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
27820         utility functions to resolve names on expressions.
27821
27822 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
27823
27824         * codegen.cs: Add hook for StatementExpressions. 
27825
27826         * class.cs: Fix inverted test for static flag in methods.
27827
27828 2001-09-02  Ravi Pratap  <ravi@ximian.com>
27829
27830         * class.cs (Operator::CheckUnaryOperator): Correct error number used
27831         to make it coincide with MS' number.
27832         (Operator::CheckBinaryOperator): Ditto.
27833
27834         * ../errors/errors.txt : Remove error numbers added earlier.
27835
27836         * ../errors/cs1019.cs : Test case for error # 1019
27837
27838         * ../errros/cs1020.cs : Test case for error # 1020
27839
27840         * cs-parser.jay : Clean out commented cruft.
27841         (dimension_separators, dimension_separator): Comment out. Ostensibly not
27842         used anywhere - non-reducing rule.
27843         (namespace_declarations): Non-reducing rule - comment out.
27844
27845         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
27846         with TypeContainer::AddEnum.
27847
27848         * delegate.cs : New file for delegate handling classes.
27849         (Delegate): Class for declaring delegates.
27850
27851         * makefile : Update.
27852
27853         * cs-parser.jay (delegate_declaration): Implement.
27854
27855 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
27856
27857         * class.cs (Event::Define): Implement.
27858         (Event.EventBuilder): New member.
27859
27860         * class.cs (TypeContainer::Populate): Update to define all enums and events
27861         we have.
27862         (Events): New property for the events arraylist we hold. Shouldn't we move to using
27863         readonly fields for all these cases ?
27864
27865 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27866
27867         * class.cs (Property): Revamp to use the convention of making fields readonly.
27868         Accordingly modify code elsewhere.
27869
27870         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
27871         the Define method of the Property class.
27872
27873         * class.cs : Clean up applied patch and update references to variables etc. Fix 
27874         trivial bug.
27875         (TypeContainer::Populate): Update to define all the properties we have. Also
27876         define all enumerations.
27877
27878         * enum.cs (Define): Implement.
27879
27880 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
27881
27882         * cs-parser.jay (overloadable_operator): The semantic value is an
27883         enum of the Operator class.
27884         (operator_declarator): Implement actions.
27885         (operator_declaration): Implement.
27886
27887         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
27888         validity of definitions.
27889         (Operator::CheckBinaryOperator): Static method to check for binary operators
27890         (TypeContainer::AddOperator): New method to add an operator to a type.
27891
27892         * cs-parser.jay (indexer_declaration): Added line to actually call the
27893         AddIndexer method so it gets added ;-)
27894
27895         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
27896         already taken care of by the MS compiler ?  
27897
27898 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27899
27900         * class.cs (Operator): New class for operator declarations.
27901         (Operator::OpType): Enum for the various operators.
27902
27903 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
27904
27905         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
27906         ostensibly handle this in semantic analysis.
27907
27908         * cs-parser.jay (general_catch_clause): Comment out
27909         (specific_catch_clauses, specific_catch_clause): Ditto.
27910         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
27911         (catch_args, opt_catch_args): New productions.
27912         (catch_clause): Rewrite to use the new productions above
27913         (catch_clauses): Modify accordingly.
27914         (opt_catch_clauses): New production to use in try_statement
27915         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
27916         and re-write the code in the actions to extract the specific and
27917         general catch clauses by being a little smart ;-)
27918
27919         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
27920         Hooray, try and catch statements parse fine !
27921
27922 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27923
27924         * statement.cs (Block::GetVariableType): Fix logic to extract the type
27925         string from the hashtable of variables.
27926
27927         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
27928         I end up making that mistake ;-)
27929         (catch_clauses): Fixed gross error which made Key and Value of the 
27930         DictionaryEntry the same : $1 !!
27931
27932 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27933
27934         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
27935
27936         * cs-parser.jay (event_declaration): Correct to remove the semicolon
27937         when the add and remove accessors are specified. 
27938
27939 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
27940
27941         * cs-parser.jay (IndexerDeclaration): New helper class to hold
27942         information about indexer_declarator.
27943         (indexer_declarator): Implement actions.
27944         (parsing_indexer): New local boolean used to keep track of whether
27945         we are parsing indexers or properties. This is necessary because 
27946         implicit_parameters come into picture even for the get accessor in the 
27947         case of an indexer.
27948         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
27949
27950         * class.cs (Indexer): New class for indexer declarations.
27951         (TypeContainer::AddIndexer): New method to add an indexer to a type.
27952         (TypeContainer::indexers): New member to hold list of indexers for the
27953         type.
27954
27955 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27956
27957         * cs-parser.jay (add_accessor_declaration): Implement action.
27958         (remove_accessor_declaration): Implement action.
27959         (event_accessors_declaration): Implement
27960         (variable_declarators): swap statements for first rule - trivial.
27961
27962         * class.cs (Event): New class to hold information about event
27963         declarations.
27964         (TypeContainer::AddEvent): New method to add an event to a type
27965         (TypeContainer::events): New member to hold list of events.
27966
27967         * cs-parser.jay (event_declaration): Implement actions.
27968
27969 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
27970
27971         * cs-parser.jay (dim_separators): Implement. Make it a string
27972         concatenating all the commas together, just as they appear.
27973         (opt_dim_separators): Modify accordingly
27974         (rank_specifiers): Update accordingly. Basically do the same
27975         thing - instead, collect the brackets here.
27976         (opt_rank_sepcifiers): Modify accordingly.
27977         (array_type): Modify to actually return the complete type string
27978         instead of ignoring the rank_specifiers.
27979         (expression_list): Implement to collect the expressions
27980         (variable_initializer): Implement. We make it a list of expressions
27981         essentially so that we can handle the array_initializer case neatly too.
27982         (variable_initializer_list): Implement.
27983         (array_initializer): Make it a list of variable_initializers
27984         (opt_array_initializer): Modify accordingly.
27985
27986         * expression.cs (New::NType): Add enumeration to help us
27987         keep track of whether we have an object/delegate creation
27988         or an array creation.
27989         (New:NewType, New::Rank, New::Indices, New::Initializers): New
27990         members to hold data about array creation.
27991         (New:New): Modify to update NewType
27992         (New:New): New Overloaded contructor for the array creation
27993         case.
27994
27995         * cs-parser.jay (array_creation_expression): Implement to call
27996         the overloaded New constructor.
27997
27998 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
27999
28000         * class.cs (TypeContainer::Constructors): Return member
28001         constructors instead of returning null.
28002
28003 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
28004
28005         * typemanager.cs (InitCoreTypes): Initialize the various core
28006         types after we have populated the type manager with the user
28007         defined types (this distinction will be important later while
28008         compiling corlib.dll)
28009
28010         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
28011         on Expression Classification.  Now all expressions have a method
28012         `Resolve' and a method `Emit'.
28013
28014         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
28015         generation from working.     Also add some temporary debugging
28016         code. 
28017
28018 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
28019
28020         * codegen.cs: Lots of code generation pieces.  This is only the
28021         beginning, will continue tomorrow with more touches of polish.  We
28022         handle the fundamentals of if, while, do, for, return.  Others are
28023         trickier and I need to start working on invocations soon.
28024
28025         * gen-treedump.cs: Bug fix, use s.Increment here instead of
28026         s.InitStatement. 
28027
28028         * codegen.cs (EmitContext): New struct, used during code
28029         emission to keep a context.   Most of the code generation will be
28030         here. 
28031
28032         * cs-parser.jay: Add embedded blocks to the list of statements of
28033         this block.  So code generation proceeds in a top down fashion.
28034
28035 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
28036
28037         * statement.cs: Add support for multiple child blocks.
28038
28039 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
28040
28041         * codegen.cs (EmitCode): New function, will emit the code for a
28042         Block of code given a TypeContainer and its ILGenerator. 
28043
28044         * statement.cs (Block): Standard public readonly optimization.
28045         (Block::Block constructors): Link children. 
28046         (Block::Child): Child Linker.
28047         (Block::EmitVariables): Emits IL variable declarations.
28048
28049         * class.cs: Drop support for MethodGroups here, delay until
28050         Semantic Analysis.
28051         (Method::): Applied the same simplification that I did before, and
28052         move from Properties to public readonly fields.
28053         (Method::ParameterTypes): Returns the parameter types for the
28054         function, and implements a cache that will be useful later when I
28055         do error checking and the semantic analysis on the methods is
28056         performed.
28057         (Constructor::GetCallingConvention): Renamed from CallingConvetion
28058         and made a method, optional argument tells whether this is a class
28059         or a structure to apply the `has-this' bit.
28060         (Method::GetCallingConvention): Implement, returns the calling
28061         convention. 
28062         (Method::Define): Defines the type, a second pass is performed
28063         later to populate the methods.
28064
28065         (Constructor::ParameterTypes): implement a cache similar to the
28066         one on Method::ParameterTypes, useful later when we do semantic
28067         analysis. 
28068
28069         (TypeContainer::EmitMethod):  New method.  Emits methods.
28070
28071         * expression.cs: Removed MethodGroup class from here.
28072
28073         * parameter.cs (Parameters::GetCallingConvention): new method.
28074
28075 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
28076
28077         * class.cs (TypeContainer::Populate): Drop RootContext from the
28078         argument. 
28079
28080         (Constructor::CallingConvention): Returns the calling convention.
28081         (Constructor::ParameterTypes): Returns the constructor parameter
28082         types. 
28083
28084         (TypeContainer::AddConstructor): Keep track of default constructor
28085         and the default static constructor.
28086
28087         (Constructor::) Another class that starts using `public readonly'
28088         instead of properties. 
28089
28090         (Constructor::IsDefault): Whether this is a default constructor. 
28091
28092         (Field::) use readonly public fields instead of properties also.
28093
28094         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
28095         track of static constructors;  If none is used, turn on
28096         BeforeFieldInit in the TypeAttributes. 
28097
28098         * cs-parser.jay (opt_argument_list): now the return can be null
28099         for the cases where there are no arguments. 
28100
28101         (constructor_declarator): If there is no implicit `base' or
28102         `this', then invoke the default parent constructor. 
28103
28104         * modifiers.cs (MethodAttr): New static function maps a set of
28105         modifiers flags into a MethodAttributes enum
28106         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
28107         MethodAttr, TypeAttr to represent the various mappings where the
28108         modifiers are used.
28109         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
28110
28111 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
28112
28113         * parameter.cs (GetParameterInfo): Fix bug where there would be no
28114         method arguments.
28115
28116         * interface.cs (PopulateIndexer): Implemented the code generator
28117         for interface indexers.
28118
28119 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
28120
28121         * interface.cs (InterfaceMemberBase): Now we track the new status
28122         here.  
28123
28124         (PopulateProperty): Implement property population.  Woohoo!  Got
28125         Methods and Properties going today. 
28126
28127         Removed all the properties for interfaces, and replaced them with
28128         `public readonly' fields. 
28129
28130 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
28131
28132         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
28133         initialize their hashtables/arraylists only when they are needed
28134         instead of doing this always.
28135
28136         * parameter.cs: Handle refs and out parameters.
28137
28138         * cs-parser.jay: Use an ArrayList to construct the arguments
28139         instead of the ParameterCollection, and then cast that to a
28140         Parameter[] array.
28141
28142         * parameter.cs: Drop the use of ParameterCollection and use
28143         instead arrays of Parameters.
28144
28145         (GetParameterInfo): Use the Type, not the Name when resolving
28146         types. 
28147
28148 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
28149
28150         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
28151         and instead use public readonly fields.
28152
28153         * class.cs: Put back walking code for type containers.
28154
28155 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
28156
28157         * class.cs (MakeConstant): Code to define constants.
28158
28159         * rootcontext.cs (LookupType): New function.  Used to locate types 
28160
28161
28162 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
28163
28164         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
28165         this System.Reflection code is.  Kudos to Microsoft
28166
28167         * typemanager.cs: Implement a type cache and avoid loading all
28168         types at boot time.  Wrap in LookupType the internals.  This made
28169         the compiler so much faster.  Wow.  I rule!
28170
28171         * driver.cs: Make sure we always load mscorlib first (for
28172         debugging purposes, nothing really important).
28173
28174         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
28175         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
28176
28177         * rootcontext.cs: Lookup types on their namespace;  Lookup types
28178         on namespaces that have been imported using the `using' keyword.
28179
28180         * class.cs (TypeContainer::TypeAttr): Virtualize.
28181         (Class::TypeAttr): Return attributes suitable for this bad boy.
28182         (Struct::TypeAttr): ditto.
28183         Handle nested classes.
28184         (TypeContainer::) Remove all the type visiting code, it is now
28185         replaced with the rootcontext.cs code
28186
28187         * rootcontext.cs (GetClassBases): Added support for structs. 
28188
28189 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
28190
28191         * interface.cs, statement.cs, class.cs, parameter.cs,
28192         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
28193         Drop use of TypeRefs, and use strings instead.
28194
28195 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
28196
28197         * rootcontext.cs: 
28198
28199         * class.cs (Struct::Struct): set the SEALED flags after
28200         checking the modifiers.
28201         (TypeContainer::TypeAttr): new property, returns the
28202         TypeAttributes for a class.  
28203
28204         * cs-parser.jay (type_list): Oops, list production was creating a
28205         new list of base types.
28206
28207         * rootcontext.cs (StdLib): New property.
28208         (GetInterfaceTypeByName): returns an interface by type name, and
28209         encapsulates error handling here.
28210         (GetInterfaces): simplified.
28211         (ResolveTree): Encapsulated all the tree resolution here.
28212         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
28213         types. 
28214
28215         * driver.cs: Add support for --nostdlib, to avoid loading the
28216         default assemblies.
28217         (Main): Do not put tree resolution here. 
28218
28219         * rootcontext.cs: Beginning of the class resolution.
28220
28221 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
28222
28223         * rootcontext.cs: Provide better error reporting. 
28224
28225         * cs-parser.jay (interface_base): set our $$ to be interfaces.
28226
28227         * rootcontext.cs (CreateInterface): Handle the case where there
28228         are no parent interfaces.
28229
28230         (CloseTypes): Routine to flush types at the end.
28231         (CreateInterface): Track types.
28232         (GetInterfaces): Returns an array of Types from the list of
28233         defined interfaces.
28234
28235         * typemanager.c (AddUserType): Mechanism to track user types (puts
28236         the type on the global type hash, and allows us to close it at the
28237         end). 
28238
28239 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
28240
28241         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
28242         RecordInterface instead.
28243
28244         * cs-parser.jay: Updated to reflect changes above.
28245
28246         * decl.cs (Definition): Keep track of the TypeBuilder type that
28247         represents this type here.  Not sure we will use it in the long
28248         run, but wont hurt for now.
28249
28250         * driver.cs: Smaller changes to accomodate the new code.
28251
28252         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
28253         when done. 
28254
28255         * rootcontext.cs (CreateInterface):  New method, used to create
28256         the System.TypeBuilder type for interfaces.
28257         (ResolveInterfaces): new entry point to resolve the interface
28258         hierarchy. 
28259         (CodeGen): Property, used to keep track of the code generator.
28260
28261 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
28262
28263         * cs-parser.jay: Add a second production for delegate_declaration
28264         with `VOID'.
28265
28266         (enum_body): Put an opt_comma here instead of putting it on
28267         enum_body or enum_member_declarations so we can handle trailing
28268         commas on enumeration members.  Gets rid of a shift/reduce.
28269
28270         (type_list): Need a COMMA in the middle.
28271
28272         (indexer_declaration): Tell tokenizer to recognize get/set
28273
28274         * Remove old targets.
28275
28276         * Re-add the parser target.
28277
28278 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28279
28280         * cs-parser.jay: Add precendence rules for a number of operators
28281         ot reduce the number of shift/reduce conflicts in the grammar.
28282
28283 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
28284
28285         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
28286         and put it here.
28287
28288         Get rid of old crufty code.
28289
28290         * rootcontext.cs: Use this to keep track of the parsed
28291         representation and the defined types available to the program. 
28292
28293         * gen-treedump.cs: adjust for new convention.
28294
28295         * type.cs: Split out the type manager, and the assembly builder
28296         from here. 
28297
28298         * typemanager.cs: the type manager will live here now.
28299
28300         * cil-codegen.cs: And the code generator here. 
28301
28302 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
28303
28304         * makefile: Fixed up for easy making.
28305
28306 2001-07-13  Simon Cozens <simon@simon-cozens.org>
28307
28308         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
28309         the 
28310
28311         (unary_expression): Expand pre_increment_expression and
28312         post_decrement_expression to reduce a shift/reduce.
28313
28314 2001-07-11  Simon Cozens
28315
28316         * cs-tokenizer.cs: Hex numbers should begin with a 0.
28317
28318         Improve allow_keyword_as_indent name.
28319
28320 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
28321
28322         * Adjustments for Beta2. 
28323
28324 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
28325
28326         * decl.cs: Added `Define' abstract method.
28327         (InTransit): new property, used to catch recursive definitions. 
28328
28329         * interface.cs: Implement `Define'. 
28330
28331         * modifiers.cs: Map Modifiers.constants to
28332         System.Reflection.TypeAttribute flags.
28333
28334         * class.cs: Keep track of types and user-defined types.
28335         (BuilderInit): New method for creating an assembly
28336         (ResolveType): New function to launch the resolution process, only
28337         used by interfaces for now.
28338
28339         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
28340         that are inserted into the name space. 
28341
28342 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
28343
28344         * ARGH.  I have screwed up my tree so many times due to the use of
28345         rsync rather than using CVS.  Going to fix this at once. 
28346
28347         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
28348         load types.
28349
28350 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
28351
28352         * Experiment successful: Use System.Type rather that our own
28353         version of Type.  
28354
28355 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
28356
28357         * cs-parser.jay: Removed nsAliases from here.
28358
28359         Use new namespaces, handle `using XXX;' 
28360
28361         * namespace.cs: Reimplemented namespace handling, use a recursive
28362         definition of the class.  Now we can keep track of using clauses
28363         and catch invalid using clauses.
28364
28365 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
28366
28367         * gen-treedump.cs: Adapted for all the renaming.
28368
28369         * expression.cs (Expression): this class now has a Type property
28370         which returns an expression Type.
28371
28372         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
28373         `Type', as this has a different meaning now in the base
28374
28375 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
28376
28377         * interface.cs, class.cs: Removed from all the sources the
28378         references to signature computation, as we can not do method
28379         signature computation during the parsing time, as we are not
28380         trying to solve at that point distinguishing:
28381
28382         class X {
28383                 void a (Blah x) {}
28384                 void a (NS.Blah x) {}
28385         }
28386
28387         Which depending on the context might be valid or not, as we do not
28388         know if Blah is the same thing as NS.Blah at that point.
28389
28390         * Redid everything so the code uses TypeRefs now instead of
28391         Types.  TypeRefs are just temporary type placeholders, that need
28392         to be resolved.  They initially have a pointer to a string and the
28393         current scope in which they are used.  This is used later by the
28394         compiler to resolve the reference to an actual Type. 
28395
28396         * DeclSpace is no longer a CIR.Type, and neither are
28397         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
28398         are all DeclSpaces, but no Types. 
28399
28400         * type.cs (TypeRefManager): This implements the TypeRef manager,
28401         which keeps track of all the types that need to be resolved after
28402         the parsing has finished. 
28403
28404 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
28405
28406         * ARGH.  We are going to have to store `foreach' as a class rather
28407         than resolving it, as we need to verify error 1579 after name
28408         resolution.   *OR* we could keep a flag that says `This request to
28409         IEnumerator comes from a foreach statement' which we can then use
28410         to generate the error.
28411
28412 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
28413
28414         * class.cs (TypeContainer.AddMethod): we now add methods to the
28415         MethodGroup instead of the method hashtable.  
28416
28417         * expression.cs: Add MethodGroup abstraction, which gets us one
28418         step closer to the specification in the way we handle method
28419         declarations.  
28420
28421         * cs-parser.jay (primary_expression): qualified_identifier now
28422         tried to match up an identifier to a local variable reference or
28423         to a parameter reference.
28424
28425         current_local_parameters is now a parser global variable that
28426         points to the current parameters for the block, used during name
28427         lookup.
28428
28429         (property_declaration): Now creates an implicit `value' argument to
28430         the set accessor.
28431
28432 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
28433
28434         * parameter.cs: Do not use `param' arguments as part of the
28435         signature, per the spec.
28436
28437 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
28438
28439         * decl.cs: Base class for classes, structs and interfaces.  This
28440         is the "Declaration Space" 
28441
28442         * cs-parser.jay: Use CheckDef for checking declaration errors
28443         instead of having one on each function.
28444
28445         * class.cs: Factor out some code for handling error handling in
28446         accordance to the "Declarations" section in the "Basic Concepts"
28447         chapter in the ECMA C# spec.
28448
28449         * interface.cs: Make all interface member classes derive from
28450         InterfaceMemberBase.
28451
28452 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
28453
28454         * Many things: all interfaces are parsed and generated in
28455         gen-treedump.  Support for member variables, constructors,
28456         destructors, properties, constants is there.
28457
28458         Beginning of the IL backend, but very little done, just there for
28459         testing purposes. 
28460
28461 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
28462
28463         * cs-parser.jay: Fix labeled statement.
28464
28465         * cs-tokenizer.cs (escape): Escape " and ' always.
28466         ref_line, ref_name: keep track of the line/filename as instructed
28467         by #line by the compiler.
28468         Parse #line.
28469
28470 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
28471
28472         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
28473         to match the values in System.CodeDOM.
28474
28475         Divid renamed to Divide.
28476
28477         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
28478         statements. 
28479         (Statements.set): remove.
28480
28481         * System.CodeDOM/CodeCatchClause.cs: always have a valid
28482         statements. 
28483
28484         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
28485         falseStatements always have valid values. 
28486
28487         * cs-parser.jay: Use System.CodeDOM now.
28488